mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
horde multiselect without CTRL
This commit is contained in:
@ -121,7 +121,7 @@ waitForElement("#floatingPrompt", 10000).then(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Device detection
|
// Device detection
|
||||||
const deviceInfo = await getDeviceInfo();
|
export const deviceInfo = await getDeviceInfo();
|
||||||
|
|
||||||
async function getDeviceInfo() {
|
async function getDeviceInfo() {
|
||||||
try {
|
try {
|
||||||
@ -135,7 +135,7 @@ async function getDeviceInfo() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isMobile() {
|
export function isMobile() {
|
||||||
const mobileTypes = ['smartphone', 'tablet', 'phablet', 'feature phone', 'portable media player'];
|
const mobileTypes = ['smartphone', 'tablet', 'phablet', 'feature phone', 'portable media player'];
|
||||||
return mobileTypes.includes(deviceInfo?.device?.type);
|
return mobileTypes.includes(deviceInfo?.device?.type);
|
||||||
}
|
}
|
||||||
@ -337,15 +337,6 @@ export async function favsToHotswap() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* function RestoreNavTab() {
|
|
||||||
if ($('#rm_button_selected_ch').children("h2").text() !== '') {
|
|
||||||
|
|
||||||
$(SelectedNavTab).click();
|
|
||||||
} else {
|
|
||||||
setTimeout(RestoreNavTab, 100);
|
|
||||||
}
|
|
||||||
} */
|
|
||||||
|
|
||||||
//changes input bar and send button display depending on connection status
|
//changes input bar and send button display depending on connection status
|
||||||
function RA_checkOnlineStatus() {
|
function RA_checkOnlineStatus() {
|
||||||
if (online_status == "no_connection") {
|
if (online_status == "no_connection") {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { saveSettingsDebounced, changeMainAPI, callPopup, setGenerationProgress, CLIENT_VERSION, getRequestHeaders } from "../script.js";
|
import { saveSettingsDebounced, changeMainAPI, 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";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
horde_settings,
|
horde_settings,
|
||||||
@ -215,13 +216,34 @@ async function showKudos() {
|
|||||||
toastr.info(`Kudos: ${data.kudos}`, data.username);
|
toastr.info(`Kudos: ${data.kudos}`, data.username);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
jQuery(function () {
|
jQuery(function () {
|
||||||
$("#horde_model").on("change", function () {
|
|
||||||
|
var hordeModelSelectScrollTop = null;
|
||||||
|
$("#horde_model").on('mousedown change', function (e) {
|
||||||
|
//desktop-only routine for multi-select without CTRL
|
||||||
|
if (deviceInfo.device.type === 'desktop') {
|
||||||
|
e.preventDefault();
|
||||||
|
var option = $(e.target);
|
||||||
|
var selectElement = $(this)[0];
|
||||||
|
hordeModelSelectScrollTop = selectElement.scrollTop;
|
||||||
|
option.prop('selected', !option.prop('selected'));
|
||||||
|
setTimeout(function () {
|
||||||
|
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);
|
||||||
saveSettingsDebounced();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* $("#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();
|
||||||
|
Reference in New Issue
Block a user