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

Function getSearchEverywhereSources

public/js/fileListView.js:5123–5149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5121}
5122
5123function getSearchEverywhereSources() {
5124 const sources = [];
5125 const select = document.getElementById('sourceSelector');
5126 if (select && select.options && select.options.length) {
5127 Array.from(select.options).forEach(opt => {
5128 const id = String(opt.value || '').trim();
5129 if (!id) return;
5130 const name = String(opt.dataset?.sourceName || opt.textContent || id);
5131 const type = String(opt.dataset?.sourceType || '');
5132 const readOnly = opt.dataset?.sourceReadOnly === '1' || opt.disabled;
5133 sources.push({ id, name, type, readOnly });
5134 });
5135 return sources;
5136 }
5137
5138 try {
5139 const metaMap = window.__FR_SOURCE_META_MAP;
5140 if (metaMap && typeof metaMap === 'object') {
5141 Object.keys(metaMap).forEach(id => {
5142 const meta = metaMap[id] || {};
5143 sources.push({ id, name: meta.name || id, type: meta.type || '', readOnly: !!meta.readOnly });
5144 });
5145 }
5146 } catch (e) { /* ignore */ }
5147
5148 return sources;
5149}
5150
5151function populateSearchEverywhereSources() {
5152 if (!searchEverywhereSourceEl) return;

Callers 2

runSearchEverywhereFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected