Merge branch 'SillyTavern:staging' into staging

This commit is contained in:
Tony-sama
2023-08-09 20:25:32 +02:00
committed by GitHub
11 changed files with 85 additions and 68 deletions

View File

@@ -380,6 +380,7 @@ export async function favsToHotswap() {
thisHotSwapSlot.attr('grid', isGroup ? grid : '');
thisHotSwapSlot.attr('chid', isCharacter ? chid : '');
thisHotSwapSlot.data('id', isGroup ? grid : chid);
thisHotSwapSlot.attr('title', '');
if (isGroup) {
const group = groups.find(x => x.id === grid);

View File

@@ -2,6 +2,6 @@
align-self: center;
}
#rm_print_characters_block .wide100pLess70px {
#rm_print_characters_block.bulk_select .wide100pLess70px {
width: calc(100% - 85px);
}

View File

@@ -99,11 +99,17 @@ function selectPreset(name) {
saveSettingsDebounced();
}
function formatTextGenURL(value) {
function formatTextGenURL(value, use_mancer) {
try {
const url = new URL(value);
if (!power_user.relaxed_api_urls) {
url.pathname = '/api';
if (use_mancer) { // If Mancer is in use, only require the URL to *end* with `/api`.
if (!url.pathname.endsWith('/api')) {
return null;
}
} else {
url.pathname = '/api';
}
}
return url.toString();
} catch { } // Just using URL as a validation check

View File

@@ -4,6 +4,10 @@ export function onlyUnique(value, index, array) {
return array.indexOf(value) === index;
}
export function isDigitsOnly(str) {
return /^\d+$/.test(str);
}
export function shuffle(array) {
let currentIndex = array.length,
randomIndex;