mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Implement boring colors
This commit is contained in:
@@ -1268,9 +1268,9 @@ td.server_vars {
|
|||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#screenshot-target .human-text,
|
#screenshot-target:not(.boring-colors) .human-text,
|
||||||
#screenshot-target .edit-text,
|
#screenshot-target:not(.boring-colors) .edit-text,
|
||||||
#screenshot-target .prompt-text,
|
#screenshot-target:not(.boring-colors) .prompt-text,
|
||||||
#robot-attribution #human-attribution {
|
#robot-attribution #human-attribution {
|
||||||
color: var(--text_edit);
|
color: var(--text_edit);
|
||||||
}
|
}
|
||||||
|
@@ -7002,10 +7002,15 @@ sync_hooks.push({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
async function showScreenshotWizard(actionIds) {
|
sync_hooks.push({
|
||||||
// actionIds is an array of string action ids
|
class: "user",
|
||||||
let actionComposition = await (await fetch(`/action_composition.json?actions=${actionIds.join(",")}`)).json();
|
name: "screenshot_use_boring_colors",
|
||||||
console.log(actionComposition);
|
func: function(boring) {
|
||||||
|
screenshotTarget.classList.toggle("boring-colors", boring);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
async function showScreenshotWizard(actionComposition) {
|
||||||
screenshotTextContainer.innerHTML = "";
|
screenshotTextContainer.innerHTML = "";
|
||||||
for (const action of actionComposition) {
|
for (const action of actionComposition) {
|
||||||
for (const chunk of action) {
|
for (const chunk of action) {
|
||||||
@@ -7081,8 +7086,6 @@ for (const el of document.getElementsByClassName("screenshot-setting")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function screenshot_selection(summonEvent) {
|
async function screenshot_selection(summonEvent) {
|
||||||
// TODO: Fix single selection
|
|
||||||
|
|
||||||
// Adapted from https://stackoverflow.com/a/4220888
|
// Adapted from https://stackoverflow.com/a/4220888
|
||||||
let selection = window.getSelection();
|
let selection = window.getSelection();
|
||||||
let range = selection.getRangeAt(0);
|
let range = selection.getRangeAt(0);
|
||||||
@@ -7107,5 +7110,7 @@ async function screenshot_selection(summonEvent) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await showScreenshotWizard(selectedActionIds);
|
let actionComposition = await (await fetch(`/action_composition.json?actions=${selectedActionIds.join(",")}`)).json();
|
||||||
|
console.log(actionComposition);
|
||||||
|
await showScreenshotWizard(actionComposition);
|
||||||
}
|
}
|
Reference in New Issue
Block a user