()
| 185 | } |
| 186 | |
| 187 | function renderBreadcrumbs() { |
| 188 | if (!breadcrumbsEl) return; |
| 189 | while (breadcrumbsEl.firstChild) breadcrumbsEl.removeChild(breadcrumbsEl.firstChild); |
| 190 | |
| 191 | const rootLabel = (shareRoot && shareRoot !== 'root') |
| 192 | ? shareRoot.split('/').pop() |
| 193 | : tx('share_drop_root_label', null, 'Upload files'); |
| 194 | |
| 195 | const rootLink = document.createElement('a'); |
| 196 | rootLink.href = buildShareUrl(''); |
| 197 | rootLink.textContent = rootLabel; |
| 198 | breadcrumbsEl.appendChild(rootLink); |
| 199 | |
| 200 | if (!allowSubfolders || !currentPath) return; |
| 201 | |
| 202 | const parts = currentPath.split('/').filter(Boolean); |
| 203 | let acc = ''; |
| 204 | parts.forEach((part) => { |
| 205 | acc = acc ? acc + '/' + part : part; |
| 206 | const sep = document.createElement('span'); |
| 207 | sep.className = 'fr-share-breadcrumb-sep'; |
| 208 | sep.textContent = '/'; |
| 209 | breadcrumbsEl.appendChild(sep); |
| 210 | |
| 211 | const link = document.createElement('a'); |
| 212 | link.href = buildShareUrl(acc); |
| 213 | link.textContent = part; |
| 214 | breadcrumbsEl.appendChild(link); |
| 215 | }); |
| 216 | } |
| 217 | |
| 218 | function formatBytes(bytes) { |
| 219 | const n = Number(bytes || 0); |
no test coverage detected