()
| 672 | } |
| 673 | |
| 674 | function renderBreadcrumbs() { |
| 675 | const el = document.getElementById('shareBreadcrumbs'); |
| 676 | if (!el) return; |
| 677 | while (el.firstChild) el.removeChild(el.firstChild); |
| 678 | |
| 679 | const rootLabel = (shareRoot && shareRoot !== 'root') |
| 680 | ? shareRoot.split('/').pop() |
| 681 | : 'Shared folder'; |
| 682 | |
| 683 | const rootLink = document.createElement('a'); |
| 684 | rootLink.href = buildShareUrl(''); |
| 685 | rootLink.textContent = rootLabel; |
| 686 | el.appendChild(rootLink); |
| 687 | |
| 688 | if (!allowSubfolders || !currentPath) return; |
| 689 | |
| 690 | const parts = currentPath.split('/').filter(Boolean); |
| 691 | let acc = ''; |
| 692 | parts.forEach((part) => { |
| 693 | acc = acc ? acc + '/' + part : part; |
| 694 | const sep = document.createElement('span'); |
| 695 | sep.className = 'fr-share-breadcrumb-sep'; |
| 696 | sep.textContent = '/'; |
| 697 | el.appendChild(sep); |
| 698 | |
| 699 | const link = document.createElement('a'); |
| 700 | link.href = buildShareUrl(acc); |
| 701 | link.textContent = part; |
| 702 | el.appendChild(link); |
| 703 | }); |
| 704 | } |
| 705 | |
| 706 | function renderList(items) { |
| 707 | if (!listEl) return; |
no test coverage detected