Code clean-up [skip ci]

This commit is contained in:
SillyLossy
2023-05-26 13:31:40 +03:00
parent d18105b31c
commit 760b953017
3 changed files with 18 additions and 20 deletions

View File

@@ -1026,7 +1026,7 @@
<div class="fa-solid fa-repeat "></div> <div class="fa-solid fa-repeat "></div>
</div> </div>
</h4> </h4>
<small class="horde_multiple_hint">Hold Control / Command key to select multiple models.</small> <small class="horde_multiple_hint">You can select multiple models.</small>
<select id="horde_model" multiple> <select id="horde_model" multiple>
<option>-- Horde models not loaded --</option> <option>-- Horde models not loaded --</option>
</select> </select>

View File

@@ -1,4 +1,10 @@
import { saveSettingsDebounced, changeMainAPI, callPopup, setGenerationProgress, CLIENT_VERSION, getRequestHeaders } from "../script.js"; import {
saveSettingsDebounced,
callPopup,
setGenerationProgress,
CLIENT_VERSION,
getRequestHeaders,
} from "../script.js";
import { SECRET_KEYS, writeSecret } from "./secrets.js"; import { SECRET_KEYS, writeSecret } from "./secrets.js";
import { delay } from "./utils.js"; import { delay } from "./utils.js";
import { deviceInfo } from "./RossAscends-mods.js"; import { deviceInfo } from "./RossAscends-mods.js";
@@ -216,34 +222,25 @@ async function showKudos() {
toastr.info(`Kudos: ${data.kudos}`, data.username); toastr.info(`Kudos: ${data.kudos}`, data.username);
} }
jQuery(function () { jQuery(function () {
var hordeModelSelectScrollTop = null; let hordeModelSelectScrollTop = null;
$("#horde_model").on('mousedown change', function (e) {
$("#horde_model").on('mousedown change', async function (e) {
//desktop-only routine for multi-select without CTRL //desktop-only routine for multi-select without CTRL
if (deviceInfo.device.type === 'desktop') { if (deviceInfo.device.type === 'desktop') {
e.preventDefault(); e.preventDefault();
var option = $(e.target); const option = $(e.target);
var selectElement = $(this)[0]; const selectElement = $(this)[0];
hordeModelSelectScrollTop = selectElement.scrollTop; hordeModelSelectScrollTop = selectElement.scrollTop;
option.prop('selected', !option.prop('selected')); option.prop('selected', !option.prop('selected'));
setTimeout(function () { await delay(1);
selectElement.scrollTop = hordeModelSelectScrollTop; selectElement.scrollTop = hordeModelSelectScrollTop;
}, 1)
} }
horde_settings.models = $('#horde_model').val(); horde_settings.models = $('#horde_model').val();
console.log('Updated Horde models', horde_settings.models); console.log('Updated Horde models', horde_settings.models);
}); });
/* $("#horde_model").on("change", function () {
horde_settings.models = $('#horde_model').val();
console.log('Updated Horde models', horde_settings.models);
saveSettingsDebounced();
}); */
$("#horde_auto_adjust_response_length").on("input", function () { $("#horde_auto_adjust_response_length").on("input", function () {
horde_settings.auto_adjust_response_length = !!$(this).prop("checked"); horde_settings.auto_adjust_response_length = !!$(this).prop("checked");
saveSettingsDebounced(); saveSettingsDebounced();

View File

@@ -3938,7 +3938,8 @@ toolcool-color-picker {
} }
.neutral_warning { .neutral_warning {
color: rgba(255, 0, 0, 0.5) color: rgba(225, 0, 0, 0.9);
font-weight: 800;
} }
.max_context_unlocked_block .checkbox_label { .max_context_unlocked_block .checkbox_label {