(folder)
| 111 | } |
| 112 | |
| 113 | function 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 | |
| 145 | function applyEncryptedFolderUiRestrictions() { |
| 146 | const caps = window.currentFolderCaps || null; |
no test coverage detected