mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge pull request #2751 from SillyTavern/delete-newbie-mode
Delete newbie mode
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
import { humanizedDateTime, favsToHotswap, getMessageTimeStamp, dragElement, isMobile, initRossMods, shouldSendOnEnter } from './scripts/RossAscends-mods.js';
|
import { humanizedDateTime, favsToHotswap, getMessageTimeStamp, dragElement, isMobile, initRossMods, shouldSendOnEnter, addSafariPatch } from './scripts/RossAscends-mods.js';
|
||||||
import { userStatsHandler, statMesProcess, initStats } from './scripts/stats.js';
|
import { userStatsHandler, statMesProcess, initStats } from './scripts/stats.js';
|
||||||
import {
|
import {
|
||||||
generateKoboldWithStreaming,
|
generateKoboldWithStreaming,
|
||||||
@@ -78,8 +78,6 @@ import {
|
|||||||
renderStoryString,
|
renderStoryString,
|
||||||
sortEntitiesList,
|
sortEntitiesList,
|
||||||
registerDebugFunction,
|
registerDebugFunction,
|
||||||
ui_mode,
|
|
||||||
switchSimpleMode,
|
|
||||||
flushEphemeralStoppingStrings,
|
flushEphemeralStoppingStrings,
|
||||||
context_presets,
|
context_presets,
|
||||||
resetMovableStyles,
|
resetMovableStyles,
|
||||||
@@ -918,6 +916,7 @@ async function firstLoadInit() {
|
|||||||
throw new Error('Initialization failed');
|
throw new Error('Initialization failed');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addSafariPatch();
|
||||||
await getClientVersion();
|
await getClientVersion();
|
||||||
await readSecretState();
|
await readSecretState();
|
||||||
initLocales();
|
initLocales();
|
||||||
@@ -6323,15 +6322,11 @@ export function setUserName(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function doOnboarding(avatarId) {
|
async function doOnboarding(avatarId) {
|
||||||
let simpleUiMode = false;
|
|
||||||
const template = $('#onboarding_template .onboarding');
|
const template = $('#onboarding_template .onboarding');
|
||||||
template.find('input[name="enable_simple_mode"]').on('input', function () {
|
let userName = await callGenericPopup(template, POPUP_TYPE.INPUT, currentUser?.name || name1, { rows: 2, wider: true, cancelButton: false });
|
||||||
simpleUiMode = $(this).is(':checked');
|
|
||||||
});
|
|
||||||
let userName = await callGenericPopup(template, POPUP_TYPE.INPUT, currentUser?.name || name1, { rows: 2, wide: true, large: true });
|
|
||||||
|
|
||||||
if (userName) {
|
if (userName) {
|
||||||
userName = userName.replace('\n', ' ');
|
userName = String(userName).replace('\n', ' ');
|
||||||
setUserName(userName);
|
setUserName(userName);
|
||||||
console.log(`Binding persona ${avatarId} to name ${userName}`);
|
console.log(`Binding persona ${avatarId} to name ${userName}`);
|
||||||
power_user.personas[avatarId] = userName;
|
power_user.personas[avatarId] = userName;
|
||||||
@@ -6340,12 +6335,6 @@ async function doOnboarding(avatarId) {
|
|||||||
position: persona_description_positions.IN_PROMPT,
|
position: persona_description_positions.IN_PROMPT,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (simpleUiMode) {
|
|
||||||
power_user.ui_mode = ui_mode.SIMPLE;
|
|
||||||
$('#ui_mode_select').val(power_user.ui_mode);
|
|
||||||
switchSimpleMode();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function reloadLoop() {
|
function reloadLoop() {
|
||||||
@@ -8008,7 +7997,7 @@ window['SillyTavern'].getContext = function () {
|
|||||||
registerHelper: () => { },
|
registerHelper: () => { },
|
||||||
registerMacro: MacrosParser.registerMacro.bind(MacrosParser),
|
registerMacro: MacrosParser.registerMacro.bind(MacrosParser),
|
||||||
unregisterMacro: MacrosParser.unregisterMacro.bind(MacrosParser),
|
unregisterMacro: MacrosParser.unregisterMacro.bind(MacrosParser),
|
||||||
registedDebugFunction: registerDebugFunction,
|
registerDebugFunction: registerDebugFunction,
|
||||||
/** @deprecated Use renderExtensionTemplateAsync instead. */
|
/** @deprecated Use renderExtensionTemplateAsync instead. */
|
||||||
renderExtensionTemplate: renderExtensionTemplate,
|
renderExtensionTemplate: renderExtensionTemplate,
|
||||||
renderExtensionTemplateAsync: renderExtensionTemplateAsync,
|
renderExtensionTemplateAsync: renderExtensionTemplateAsync,
|
||||||
@@ -8943,6 +8932,12 @@ function addDebugFunctions() {
|
|||||||
await reloadCurrentChat();
|
await reloadCurrentChat();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
registerDebugFunction('forceOnboarding', 'Force onboarding', 'Forces the onboarding process to restart.', async () => {
|
||||||
|
firstRun = true;
|
||||||
|
await saveSettings();
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
|
||||||
registerDebugFunction('backfillTokenCounts', 'Backfill token counters',
|
registerDebugFunction('backfillTokenCounts', 'Backfill token counters',
|
||||||
`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.
|
||||||
|
@@ -711,6 +711,18 @@ export const autoFitSendTextAreaDebounced = debounce(autoFitSendTextArea, deboun
|
|||||||
|
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
|
|
||||||
|
export function addSafariPatch() {
|
||||||
|
const userAgent = getParsedUA();
|
||||||
|
console.debug('User Agent', userAgent);
|
||||||
|
const isMobileSafari = /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
|
||||||
|
const isDesktopSafari = userAgent?.browser?.name === 'Safari' && userAgent?.platform?.type === 'desktop';
|
||||||
|
const isIOS = userAgent?.os?.name === 'iOS';
|
||||||
|
|
||||||
|
if (isIOS || isMobileSafari || isDesktopSafari) {
|
||||||
|
document.body.classList.add('safari');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function initRossMods() {
|
export function initRossMods() {
|
||||||
// initial status check
|
// initial status check
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -725,16 +737,6 @@ export function initRossMods() {
|
|||||||
RA_autoconnect();
|
RA_autoconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
const userAgent = getParsedUA();
|
|
||||||
console.debug('User Agent', userAgent);
|
|
||||||
const isMobileSafari = /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
|
|
||||||
const isDesktopSafari = userAgent?.browser?.name === 'Safari' && userAgent?.platform?.type === 'desktop';
|
|
||||||
const isIOS = userAgent?.os?.name === 'iOS';
|
|
||||||
|
|
||||||
if (isIOS || isMobileSafari || isDesktopSafari) {
|
|
||||||
document.body.classList.add('safari');
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#main_api').change(function () {
|
$('#main_api').change(function () {
|
||||||
var PrevAPI = main_api;
|
var PrevAPI = main_api;
|
||||||
setTimeout(() => RA_autoconnect(PrevAPI), 100);
|
setTimeout(() => RA_autoconnect(PrevAPI), 100);
|
||||||
|
@@ -281,6 +281,7 @@ export class Popup {
|
|||||||
case POPUP_TYPE.INPUT: {
|
case POPUP_TYPE.INPUT: {
|
||||||
this.mainInput.style.display = 'block';
|
this.mainInput.style.display = 'block';
|
||||||
if (!okButton) this.okButton.textContent = template.getAttribute('popup-button-save');
|
if (!okButton) this.okButton.textContent = template.getAttribute('popup-button-save');
|
||||||
|
if (cancelButton === false) this.cancelButton.style.display = 'none';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case POPUP_TYPE.DISPLAY: {
|
case POPUP_TYPE.DISPLAY: {
|
||||||
|
@@ -75,11 +75,6 @@ const defaultStoryString = '{{#if system}}{{system}}\n{{/if}}{{#if description}}
|
|||||||
const defaultExampleSeparator = '***';
|
const defaultExampleSeparator = '***';
|
||||||
const defaultChatStart = '***';
|
const defaultChatStart = '***';
|
||||||
|
|
||||||
export const ui_mode = {
|
|
||||||
SIMPLE: 0,
|
|
||||||
POWER: 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
const avatar_styles = {
|
const avatar_styles = {
|
||||||
ROUND: 0,
|
ROUND: 0,
|
||||||
RECTANGULAR: 1,
|
RECTANGULAR: 1,
|
||||||
@@ -132,7 +127,6 @@ let power_user = {
|
|||||||
smooth_streaming: false,
|
smooth_streaming: false,
|
||||||
smooth_streaming_speed: 50,
|
smooth_streaming_speed: 50,
|
||||||
|
|
||||||
ui_mode: ui_mode.POWER,
|
|
||||||
fast_ui_mode: true,
|
fast_ui_mode: true,
|
||||||
avatar_style: avatar_styles.ROUND,
|
avatar_style: avatar_styles.ROUND,
|
||||||
chat_display: chat_styles.DEFAULT,
|
chat_display: chat_styles.DEFAULT,
|
||||||
@@ -331,12 +325,6 @@ const debug_functions = [];
|
|||||||
|
|
||||||
const setHotswapsDebounced = debounce(favsToHotswap);
|
const setHotswapsDebounced = debounce(favsToHotswap);
|
||||||
|
|
||||||
export function switchSimpleMode() {
|
|
||||||
$('[data-newbie-hidden]').each(function () {
|
|
||||||
$(this).toggleClass('displayNone', power_user.ui_mode === ui_mode.SIMPLE);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function playMessageSound() {
|
function playMessageSound() {
|
||||||
if (!power_user.play_message_sound) {
|
if (!power_user.play_message_sound) {
|
||||||
return;
|
return;
|
||||||
@@ -1586,7 +1574,6 @@ async function loadPowerUserSettings(settings, data) {
|
|||||||
$('#bot-mes-blur-tint-color-picker').attr('color', power_user.bot_mes_blur_tint_color);
|
$('#bot-mes-blur-tint-color-picker').attr('color', power_user.bot_mes_blur_tint_color);
|
||||||
$('#shadow-color-picker').attr('color', power_user.shadow_color);
|
$('#shadow-color-picker').attr('color', power_user.shadow_color);
|
||||||
$('#border-color-picker').attr('color', power_user.border_color);
|
$('#border-color-picker').attr('color', power_user.border_color);
|
||||||
$('#ui_mode_select').val(power_user.ui_mode).find(`option[value="${power_user.ui_mode}"]`).attr('selected', true);
|
|
||||||
$('#reduced_motion').prop('checked', power_user.reduced_motion);
|
$('#reduced_motion').prop('checked', power_user.reduced_motion);
|
||||||
$('#auto-connect-checkbox').prop('checked', power_user.auto_connect);
|
$('#auto-connect-checkbox').prop('checked', power_user.auto_connect);
|
||||||
$('#auto-load-chat-checkbox').prop('checked', power_user.auto_load_chat);
|
$('#auto-load-chat-checkbox').prop('checked', power_user.auto_load_chat);
|
||||||
@@ -1620,7 +1607,6 @@ async function loadPowerUserSettings(settings, data) {
|
|||||||
switchSpoilerMode();
|
switchSpoilerMode();
|
||||||
loadMovingUIState();
|
loadMovingUIState();
|
||||||
loadCharListState();
|
loadCharListState();
|
||||||
switchSimpleMode();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadCharListState() {
|
async function loadCharListState() {
|
||||||
@@ -3683,13 +3669,6 @@ $(document).ready(() => {
|
|||||||
showDebugMenu();
|
showDebugMenu();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#ui_mode_select').on('change', function () {
|
|
||||||
const value = $(this).find(':selected').val();
|
|
||||||
power_user.ui_mode = Number(value);
|
|
||||||
switchSimpleMode();
|
|
||||||
saveSettingsDebounced();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#bogus_folders').on('input', function () {
|
$('#bogus_folders').on('input', function () {
|
||||||
power_user.bogus_folders = !!$(this).prop('checked');
|
power_user.bogus_folders = !!$(this).prop('checked');
|
||||||
printCharactersDebounced();
|
printCharactersDebounced();
|
||||||
|
Reference in New Issue
Block a user