Fix bug where not all context blocks were cleared

This commit is contained in:
somebody
2022-08-28 18:01:27 -05:00
parent 01d8736daf
commit 6548fdf794
3 changed files with 8 additions and 15 deletions

View File

@@ -1627,7 +1627,7 @@ body {
opacity: 0.5; opacity: 0.5;
} }
.context-block { .context-block, .context-block-example{
margin: 0px 2px; margin: 0px 2px;
} }
@@ -1635,10 +1635,6 @@ body {
outline: 1px solid gray; outline: 1px solid gray;
} }
.context-block.example:hover {
outline: none !important;
}
.context-sp {background-color: orangered;} .context-sp {background-color: orangered;}
.context-prompt {background-color: orange;} .context-prompt {background-color: orange;}
.context-wi {background-color: #1751b9;} .context-wi {background-color: #1751b9;}

View File

@@ -2044,10 +2044,7 @@ function update_bias_slider_value(slider) {
} }
function update_context(data) { function update_context(data) {
for (const el of document.getElementsByClassName("context-block")) { $(".context-block").remove();
if (el.classList.contains("example")) continue;
el.remove();
}
for (const entry of data) { for (const entry of data) {
console.log(entry); console.log(entry);

View File

@@ -121,12 +121,12 @@
<div> <div>
<span class="noselect">Key:</span> <span class="noselect">Key:</span>
<div> <div>
<span class="noselect example context-block context-sp">Soft Prompt</span> <span class="noselect context-block-example context-sp">Soft Prompt</span>
<span class="noselect example context-block context-prompt">Prompt</span> <span class="noselect context-block-example context-prompt">Prompt</span>
<span class="noselect example context-block context-wi">World Info</span> <span class="noselect context-block-example context-wi">World Info</span>
<span class="noselect example context-block context-memory">Memory</span> <span class="noselect context-block-example context-memory">Memory</span>
<span class="noselect example context-block context-an">Author's Note</span> <span class="noselect context-block-example context-an">Author's Note</span>
<span class="noselect example context-block context-action">Action</span> <span class="noselect context-block-example context-action">Action</span>
</div> </div>
</div> </div>
<span id="context-viewer-close" class="material-icons-outlined">close</span> <span id="context-viewer-close" class="material-icons-outlined">close</span>