mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'dev' of https://github.com/BlipRanger/SillyTavern into feature/stats
This commit is contained in:
@@ -16,7 +16,8 @@ import {
|
||||
name1,
|
||||
name2,
|
||||
replaceCurrentChat,
|
||||
setCharacterId
|
||||
setCharacterId,
|
||||
setEditedMessageId
|
||||
} from "../script.js";
|
||||
import { favsToHotswap, isMobile, initMovingUI } from "./RossAscends-mods.js";
|
||||
import { getContext } from "./extensions.js";
|
||||
@@ -76,6 +77,7 @@ const tokenizers = {
|
||||
LLAMA: 3,
|
||||
NERD: 4,
|
||||
NERD2: 5,
|
||||
API: 6,
|
||||
}
|
||||
|
||||
const send_on_enter_options = {
|
||||
@@ -406,6 +408,8 @@ function applyChatDisplay() {
|
||||
}
|
||||
|
||||
function applySheldWidth() {
|
||||
//disabled due to 50vw conversion
|
||||
return
|
||||
power_user.sheld_width = Number(localStorage.getItem(storage_keys.sheld_width) ?? chat_styles.DEFAULT);
|
||||
$("body").toggleClass("w1000px", power_user.sheld_width === sheld_width.w1000px);
|
||||
let r = document.documentElement;
|
||||
@@ -740,9 +744,24 @@ function loadPowerUserSettings(settings, data) {
|
||||
switchWaifuMode();
|
||||
switchSpoilerMode();
|
||||
loadMovingUIState();
|
||||
loadCharListState();
|
||||
|
||||
}
|
||||
|
||||
async function loadCharListState() {
|
||||
if (document.getElementById('CharID0') !== null) {
|
||||
console.debug('setting charlist state to...')
|
||||
if (power_user.charListGrid === true) {
|
||||
console.debug('..to grid')
|
||||
$("#charListGridToggle").trigger('click')
|
||||
} else { console.debug('..to list') }
|
||||
} else {
|
||||
console.debug('charlist not ready yet')
|
||||
await delay(100)
|
||||
loadCharListState();
|
||||
}
|
||||
}
|
||||
|
||||
function loadMovingUIState() {
|
||||
if (isMobile() === false
|
||||
&& power_user.movingUIState
|
||||
@@ -1024,6 +1043,7 @@ async function resetMovablePanels(type) {
|
||||
'WorldInfo',
|
||||
'floatingPrompt',
|
||||
'expression-holder',
|
||||
'groupMemberListPopout'
|
||||
];
|
||||
|
||||
const panelStyles = ['top', 'left', 'right', 'bottom', 'height', 'width', 'margin',];
|
||||
@@ -1086,7 +1106,7 @@ function doRandomChat() {
|
||||
}
|
||||
|
||||
async function doMesCut(_, text) {
|
||||
|
||||
console.debug(`was asked to cut message id #${text}`)
|
||||
//reject invalid args or no args
|
||||
if (text && isNaN(text) || !text) {
|
||||
toastr.error(`Must enter a single number only, non-number characters disallowed.`)
|
||||
@@ -1094,7 +1114,7 @@ async function doMesCut(_, text) {
|
||||
}
|
||||
|
||||
//reject attempts to delete firstmes
|
||||
if (text === 0) {
|
||||
if (text === '0') {
|
||||
toastr.error('Cannot delete the First Message')
|
||||
return
|
||||
}
|
||||
@@ -1107,8 +1127,8 @@ async function doMesCut(_, text) {
|
||||
return
|
||||
}
|
||||
|
||||
mesToCut.find('.mes_edit_delete').trigger('click');
|
||||
$('#dialogue_popup_ok').trigger('click');
|
||||
setEditedMessageId(mesIDToCut);
|
||||
mesToCut.find('.mes_edit_delete').trigger('click', { fromSlashCommand: true });
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user