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

Function renderBreadcrumbs

public/js/sharedFolderView.js:674–704  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

Callers 1

Calls 2

splitMethod · 0.80
buildShareUrlFunction · 0.70

Tested by

no test coverage detected