mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
initial reversion commit
This commit is contained in:
@ -105,6 +105,9 @@ export const persona_description_positions = {
|
||||
NONE: 9,
|
||||
};
|
||||
|
||||
const chromeUaIdx = navigator.userAgent.lastIndexOf('Chrome/');
|
||||
const chromeVersion = navigator.userAgent.substring(chromeUaIdx + 7, navigator.userAgent.indexOf('.', chromeUaIdx));
|
||||
|
||||
let power_user = {
|
||||
tokenizer: tokenizers.BEST_MATCH,
|
||||
token_padding: 64,
|
||||
@ -1740,20 +1743,23 @@ async function loadContextSettings() {
|
||||
if (control.isCheckbox) {
|
||||
$element.prop('checked', power_user.context[control.property]);
|
||||
} else {
|
||||
$element[0].innerText = power_user.context[control.property];
|
||||
$element.val(power_user.context[control.property]);
|
||||
}
|
||||
console.log(`Setting ${$element.prop('id')} to ${power_user.context[control.property]}`);
|
||||
|
||||
// If the setting already exists, no need to duplicate it
|
||||
// TODO: Maybe check the power_user object for the setting instead of a flag?
|
||||
$element.on('input keyup', async function () {
|
||||
const value = control.isCheckbox ? !!$(this).prop('checked') : $(this)[0].innerText;
|
||||
$element.on('input', async function () {
|
||||
const value = control.isCheckbox ? !!$(this).prop('checked') : $(this).val();
|
||||
if (control.isGlobalSetting) {
|
||||
power_user[control.property] = value;
|
||||
} else {
|
||||
power_user.context[control.property] = value;
|
||||
}
|
||||
|
||||
console.log(`Setting ${$element.prop('id')} to ${value}`);
|
||||
if (chromeUaIdx == -1 || Number(chromeVersion) < 123) {
|
||||
await resetScrollHeight($(this));
|
||||
}
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
});
|
||||
@ -1793,7 +1799,7 @@ async function loadContextSettings() {
|
||||
.prop('checked', control.isGlobalSetting ? power_user[control.property] : power_user.context[control.property])
|
||||
.trigger('input');
|
||||
} else {
|
||||
$element[0].innerText = (control.isGlobalSetting ? power_user[control.property] : power_user.context[control.property]);
|
||||
$element.val(control.isGlobalSetting ? power_user[control.property] : power_user.context[control.property]);
|
||||
$element.trigger('input');
|
||||
}
|
||||
}
|
||||
@ -3096,7 +3102,7 @@ $(document).ready(() => {
|
||||
});
|
||||
|
||||
$('#start_reply_with').on('input', function () {
|
||||
power_user.user_prompt_bias = String($(this)[0].innerText);
|
||||
power_user.user_prompt_bias = String($(this).val);
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
|
||||
@ -3628,7 +3634,7 @@ $(document).ready(() => {
|
||||
});
|
||||
|
||||
$('#custom_stopping_strings').on('input', function () {
|
||||
power_user.custom_stopping_strings = String($(this)[0].innerText).trim();
|
||||
power_user.custom_stopping_strings = String($(this).val).trim();
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user