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

Function setSourceBadge

public/js/fileListView.js:1725–1744  ·  view source on GitHub ↗
(titleEl, sourceId)

Source from the content-addressed store, hash-verified

1723}
1724
1725function setSourceBadge(titleEl, sourceId) {
1726 if (!titleEl) return;
1727 const meta = getSourceMetaById(sourceId);
1728 const label = formatSourceBadgeText(meta);
1729 const existing = titleEl.querySelector('.fr-source-badge');
1730 if (!label) {
1731 if (existing) existing.remove();
1732 return;
1733 }
1734 const badge = existing || document.createElement('span');
1735 if (!existing) {
1736 badge.className = 'fr-source-badge fr-source-badge--title';
1737 titleEl.appendChild(badge);
1738 }
1739 if (existing) {
1740 badge.classList.add('fr-source-badge', 'fr-source-badge--title');
1741 }
1742 badge.textContent = label;
1743 badge.title = `Source: ${label}`;
1744}
1745
1746function refreshSourceBadges() {
1747 ensurePaneState();

Callers 1

refreshSourceBadgesFunction · 0.85

Calls 2

formatSourceBadgeTextFunction · 0.85
getSourceMetaByIdFunction · 0.70

Tested by

no test coverage detected