MCPcopy Create free account
hub / github.com/error311/FileRise / updateEncryptedFolderBanner

Function updateEncryptedFolderBanner

public/js/fileListView.js:113–143  ·  view source on GitHub ↗
(folder)

Source from the content-addressed store, hash-verified

111}
112
113function updateEncryptedFolderBanner(folder) {
114 const el = ensureEncryptedFolderBanner();
115 if (!el) return;
116
117 const enc = window.currentFolderCaps?.encryption || null;
118 const isEncrypted = !!enc?.encrypted;
119 if (!isEncrypted) {
120 el.style.display = 'none';
121 el.textContent = '';
122 return;
123 }
124
125 const inherited = !!enc?.inherited;
126 const root = (enc && enc.root) ? String(enc.root) : (folder || 'root');
127 const rootLabel = inherited && root ? ` (inherited from ${root})` : '';
128
129 el.style.display = 'flex';
130 el.textContent = '';
131
132 const pill = document.createElement('span');
133 pill.className = 'fr-enc-pill';
134 pill.textContent = 'Encrypted';
135
136 const text = document.createElement('div');
137 text.className = 'fr-enc-text';
138 text.textContent =
139 `This folder${rootLabel} is encrypted. ` +
140 'Video/audio previews, WebDAV, ONLYOFFICE, and archive create/extract are disabled.';
141
142 el.append(pill, text);
143}
144
145function applyEncryptedFolderUiRestrictions() {
146 const caps = window.currentFolderCaps || null;

Callers 3

fileListView.jsFile · 0.85
setActivePaneFunction · 0.85
refreshCurrentFolderCapsFunction · 0.85

Calls 1

Tested by

no test coverage detected