MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / renderKV

Function renderKV

example/tests/gm_value_test.js:1110–1136  ·  view source on GitHub ↗
(fid, kvMap)

Source from the content-addressed store, hash-verified

1108 }
1109
1110 function renderKV(fid, kvMap) {
1111 const refs = panelRefs[fid];
1112 if (!refs || !kvMap) return;
1113
1114 const { kvTable, myKey, accent } = refs;
1115
1116 kvTable.innerHTML = '';
1117
1118 for (const k of ALL_KEYS) {
1119 const v = kvMap[k];
1120 const own = k === myKey;
1121
1122 const card = document.createElement('div');
1123 card.className = 'kv-card';
1124
1125 if (own) card.style.borderColor = accent + '88';
1126
1127 card.innerHTML = `
1128 <div class="kv-key">${escHtml(k)}${own ? ' <i>(mine)</i>' : ''}</div>
1129 <div class="kv-val" style="${own ? `color:${accent};font-weight:700` : ''}">
1130 ${fmtVal(v)}
1131 </div>
1132 `;
1133
1134 kvTable.appendChild(card);
1135 }
1136 }
1137
1138 function updateDots(fid, ids) {
1139 const refs = panelRefs[fid];

Callers 1

gm_value_test.jsFile · 0.85

Calls 2

escHtmlFunction · 0.85
fmtValFunction · 0.85

Tested by

no test coverage detected