MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / initializeJSONEditors

Function initializeJSONEditors

codeclash/viewer/static/js/json-editors.js:4–32  ·  view source on GitHub ↗
(metadata)

Source from the content-addressed store, hash-verified

2
3// Initialize JSON editors when page loads
4function initializeJSONEditors(metadata) {
5 // Initialize metadata JSON editor
6 const metadataContainer = document.getElementById("metadata-jsoneditor");
7 if (metadataContainer) {
8 const metadataEditor = new JSONEditor(metadataContainer, {
9 mode: "view",
10 modes: ["view", "tree"],
11 name: "metadata",
12 });
13 metadataEditor.set(metadata.results);
14 }
15
16 // Initialize round results JSON editors
17 metadata.rounds.forEach((roundData) => {
18 if (roundData.results) {
19 const roundContainer = document.getElementById(
20 `round-${roundData.round_num}-results-jsoneditor`,
21 );
22 if (roundContainer) {
23 const roundEditor = new JSONEditor(roundContainer, {
24 mode: "view",
25 modes: ["view", "tree"],
26 name: `round_${roundData.round_num}_results`,
27 });
28 roundEditor.set(roundData.results);
29 }
30 }
31 });
32}

Callers

nothing calls this directly

Calls 1

setMethod · 0.80

Tested by

no test coverage detected