mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-02 12:26:59 +01:00
Enable object-curly-spacing lint
This commit is contained in:
parent
414c9bd5fb
commit
5f1bed1e70
@ -58,6 +58,7 @@ module.exports = {
|
|||||||
'comma-dangle': ['error', 'always-multiline'],
|
'comma-dangle': ['error', 'always-multiline'],
|
||||||
'eol-last': ['error', 'always'],
|
'eol-last': ['error', 'always'],
|
||||||
'no-trailing-spaces': 'error',
|
'no-trailing-spaces': 'error',
|
||||||
|
'object-curly-spacing': ['error', 'always'],
|
||||||
|
|
||||||
// These rules should eventually be enabled.
|
// These rules should eventually be enabled.
|
||||||
'no-async-promise-executor': 'off',
|
'no-async-promise-executor': 'off',
|
||||||
|
@ -4157,7 +4157,7 @@ async function DupeChar() {
|
|||||||
const confirm = await callPopup(`
|
const confirm = await callPopup(`
|
||||||
<h3>Are you sure you want to duplicate this character?</h3>
|
<h3>Are you sure you want to duplicate this character?</h3>
|
||||||
<span>If you just want to start a new chat with the same character, use "Start new chat" option in the bottom-left options menu.</span><br><br>`,
|
<span>If you just want to start a new chat with the same character, use "Start new chat" option in the bottom-left options menu.</span><br><br>`,
|
||||||
'confirm',
|
'confirm',
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!confirm) {
|
if (!confirm) {
|
||||||
@ -7635,22 +7635,22 @@ function addDebugFunctions() {
|
|||||||
`Recalculates token counts of all messages in the current chat to refresh the counters.
|
`Recalculates token counts of all messages in the current chat to refresh the counters.
|
||||||
Useful when you switch between models that have different tokenizers.
|
Useful when you switch between models that have different tokenizers.
|
||||||
This is a visual change only. Your chat will be reloaded.`, async () => {
|
This is a visual change only. Your chat will be reloaded.`, async () => {
|
||||||
for (const message of chat) {
|
for (const message of chat) {
|
||||||
// System messages are not counted
|
// System messages are not counted
|
||||||
if (message.is_system) {
|
if (message.is_system) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!message.extra) {
|
||||||
|
message.extra = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
message.extra.token_count = getTokenCount(message.mes, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!message.extra) {
|
await saveChatConditional();
|
||||||
message.extra = {};
|
await reloadCurrentChat();
|
||||||
}
|
});
|
||||||
|
|
||||||
message.extra.token_count = getTokenCount(message.mes, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
await saveChatConditional();
|
|
||||||
await reloadCurrentChat();
|
|
||||||
});
|
|
||||||
|
|
||||||
registerDebugFunction('generationTest', 'Send a generation request', 'Generates text using the currently selected API.', async () => {
|
registerDebugFunction('generationTest', 'Send a generation request', 'Generates text using the currently selected API.', async () => {
|
||||||
const text = prompt('Input text:', 'Hello');
|
const text = prompt('Input text:', 'Hello');
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { characters, getCharacters, handleDeleteCharacter, callPopup } from '../script.js';
|
import { characters, getCharacters, handleDeleteCharacter, callPopup } from '../script.js';
|
||||||
import {BulkEditOverlay, BulkEditOverlayState} from './BulkEditOverlay.js';
|
import { BulkEditOverlay, BulkEditOverlayState } from './BulkEditOverlay.js';
|
||||||
|
|
||||||
|
|
||||||
let is_bulk_edit = false;
|
let is_bulk_edit = false;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export {translate};
|
export { translate };
|
||||||
|
|
||||||
import {
|
import {
|
||||||
callPopup,
|
callPopup,
|
||||||
|
@ -10,7 +10,7 @@ import { NovelTtsProvider } from './novel.js';
|
|||||||
import { power_user } from '../../power-user.js';
|
import { power_user } from '../../power-user.js';
|
||||||
import { registerSlashCommand } from '../../slash-commands.js';
|
import { registerSlashCommand } from '../../slash-commands.js';
|
||||||
import { OpenAITtsProvider } from './openai.js';
|
import { OpenAITtsProvider } from './openai.js';
|
||||||
import {XTTSTtsProvider} from './xtts.js';
|
import { XTTSTtsProvider } from './xtts.js';
|
||||||
export { talkingAnimation };
|
export { talkingAnimation };
|
||||||
|
|
||||||
const UPDATE_INTERVAL = 1000;
|
const UPDATE_INTERVAL = 1000;
|
||||||
|
@ -125,7 +125,7 @@ class NovelTtsProvider {
|
|||||||
throw 'TTS Voice name not provided';
|
throw 'TTS Voice name not provided';
|
||||||
}
|
}
|
||||||
|
|
||||||
return { name: voiceName, voice_id: voiceName, lang: 'en-US', preview_url: false};
|
return { name: voiceName, voice_id: voiceName, lang: 'en-US', preview_url: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
async generateTts(text, voiceId) {
|
async generateTts(text, voiceId) {
|
||||||
|
@ -666,7 +666,7 @@ async function CreateZenSliders(elmnt) {
|
|||||||
min: sliderMin,
|
min: sliderMin,
|
||||||
max: sliderMax,
|
max: sliderMax,
|
||||||
create: async function () {
|
create: async function () {
|
||||||
await delay(100)
|
await delay(100);
|
||||||
var handle = $(this).find('.ui-slider-handle');
|
var handle = $(this).find('.ui-slider-handle');
|
||||||
var handleText, stepNumber, leftMargin;
|
var handleText, stepNumber, leftMargin;
|
||||||
|
|
||||||
@ -711,7 +711,7 @@ async function CreateZenSliders(elmnt) {
|
|||||||
stepNumber = ((sliderValue - sliderMin) / stepScale);
|
stepNumber = ((sliderValue - sliderMin) / stepScale);
|
||||||
leftMargin = (stepNumber / numSteps) * 50 * -1;
|
leftMargin = (stepNumber / numSteps) * 50 * -1;
|
||||||
originalSlider.val(numVal)
|
originalSlider.val(numVal)
|
||||||
.data('newSlider', newSlider)
|
.data('newSlider', newSlider);
|
||||||
//console.log(`${newSlider.attr('id')} sliderValue = ${sliderValue}, handleText:${handleText, numVal}, stepNum:${stepNumber}, numSteps:${numSteps}, left-margin:${leftMargin}`)
|
//console.log(`${newSlider.attr('id')} sliderValue = ${sliderValue}, handleText:${handleText, numVal}, stepNum:${stepNumber}, numSteps:${numSteps}, left-margin:${leftMargin}`)
|
||||||
var isManualInput = false;
|
var isManualInput = false;
|
||||||
var valueBeforeManualInput;
|
var valueBeforeManualInput;
|
||||||
@ -737,8 +737,8 @@ async function CreateZenSliders(elmnt) {
|
|||||||
isManualInput = true;
|
isManualInput = true;
|
||||||
//allow enter to trigger slider update
|
//allow enter to trigger slider update
|
||||||
if (e.key === 'Enter') {
|
if (e.key === 'Enter') {
|
||||||
e.preventDefault
|
e.preventDefault;
|
||||||
handle.trigger('blur')
|
handle.trigger('blur');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
//trigger slider changes when user clicks away
|
//trigger slider changes when user clicks away
|
||||||
|
Loading…
x
Reference in New Issue
Block a user