mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' into del-swipe-fix
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,
|
||||||
@ -916,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();
|
||||||
@ -6322,7 +6323,7 @@ export function setUserName(value) {
|
|||||||
|
|
||||||
async function doOnboarding(avatarId) {
|
async function doOnboarding(avatarId) {
|
||||||
const template = $('#onboarding_template .onboarding');
|
const template = $('#onboarding_template .onboarding');
|
||||||
let userName = await callGenericPopup(template, POPUP_TYPE.INPUT, currentUser?.name || name1, { rows: 2, wide: true, large: true });
|
let userName = await callGenericPopup(template, POPUP_TYPE.INPUT, currentUser?.name || name1, { rows: 2, wider: true, cancelButton: false });
|
||||||
|
|
||||||
if (userName) {
|
if (userName) {
|
||||||
userName = String(userName).replace('\n', ' ');
|
userName = String(userName).replace('\n', ' ');
|
||||||
|
@ -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