MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / renderChoiceList

Function renderChoiceList

deployments/desktop/static/desktop.js:2094–2104  ·  view source on GitHub ↗
(id, items, options = {})

Source from the content-addressed store, hash-verified

2092 }
2093
2094 function renderChoiceList(id, items, options = {}) {
2095 const target = $(id);
2096 target.className = "choice-list";
2097 const defaultChecked = options.defaultChecked || "none";
2098 target.innerHTML = items.map((item, index) => {
2099 const value = item.id || item.name || item;
2100 const label = item.name || item.id || item;
2101 const checked = defaultCheckedForSource(index, defaultChecked) ? "checked" : "";
2102 return `<label class="source-choice"><input type="checkbox" value="${escapeHtml(value)}" ${checked}>${escapeHtml(label)}</label>`;
2103 }).join("");
2104 }
2105
2106 async function loadSourceOptions() {
2107 if (state.sourceOptionsLoaded) return;

Callers 1

loadSourceOptionsFunction · 0.70

Calls 3

defaultCheckedForSourceFunction · 0.85
$Function · 0.70
escapeHtmlFunction · 0.70

Tested by

no test coverage detected