(id, items, options = {})
| 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; |
no test coverage detected