Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions media/MPQEditor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
</vscode-button>
</div>
<div class="rightbtns">
<vscode-text-field id="VisqInputPath" startIcon="true" placeholder="visq path" readonly="true">
<span slot="start" class="codicon codicon-question" style="cursor: pointer">
<span class="help">
visq.json file with layer-wise quantization errors
</span>
</span>
<span id="visq-file" slot="end" class="codicon codicon-search" style="cursor: pointer"></span>
<span id="visq-delete" slot="end" class="codicon codicon-chrome-close" style="cursor: pointer"></span>
</vscode-text-field>
<vscode-checkbox id="circle-graph">Show Graph</vscode-checkbox>
</div>
</div>
Expand Down
29 changes: 29 additions & 0 deletions media/MPQEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ function main() {
case "modelGraphIsShown":
handleModelGraphIsShown(message.shown);
break;
case "VisqFileLoaded":
handleVisqFileLoaded(message.visqFile);
break;
default:
break;
}
Expand All @@ -58,6 +61,10 @@ function handleModelNodesChanged(names) {
document.getElementById("AddSpecificLayer").disabled = names.length < 1;
}

function handleVisqFileLoaded(visqFile) {
document.getElementById("VisqInputPath").value = visqFile;
}

function registerMainControls() {
document
.getElementById("DefaultDtype")
Expand Down Expand Up @@ -92,6 +99,28 @@ function registerMainControls() {
});
});

document
.getElementById("VisqInputPath")
.addEventListener("input", function () {
vscode.postMessage({
type: "VisqInputPathChanged",
path: document.getElementById("VisqInputPath").value,
});
});

document.getElementById("visq-file").addEventListener("click", function () {
vscode.postMessage({
type: "loadVisqFile",
});
});

document.getElementById("visq-delete").addEventListener("click", function () {
document.getElementById("VisqInputPath").value = "";
vscode.postMessage({
type: "removeVisqFile",
});
});

document.getElementById("AddSpecificLayer").disabled = true;
}

Expand Down
19 changes: 19 additions & 0 deletions media/MPQEditor/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,22 @@ float: left;
.rightbtns {
float: right;
}

.codicon.codicon-question .help {
visibility: hidden;
width: auto;
background-color: var(--vscode-editorSuggestWidget-background);
color: var(--vscode-editorSuggestWidget-foreground);
border: 2px solid var(--vscode-editorSuggestWidget-border);
font-size: small;
text-align: left;
position: absolute;
z-index: 1;
margin-left: 10px;
padding: 6px 6px 10px 8px;
font-family: var(--vscode-font-family);
}

.codicon.codicon-question:hover .help {
visibility: visible;
}