From b407fe2388b5eff53c866a3ce605c95d58bf3470 Mon Sep 17 00:00:00 2001 From: Stefan Daniel Schwarz Date: Fri, 4 Aug 2023 16:53:49 +0200 Subject: [PATCH] custom_stopping_strings_macro toggleable option --- default/settings.json | 1 + public/index.html | 6 ++++++ public/script.js | 6 +++++- public/scripts/power-user.js | 7 +++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/default/settings.json b/default/settings.json index ddf021549..17478fba9 100644 --- a/default/settings.json +++ b/default/settings.json @@ -147,6 +147,7 @@ "persona_description": "", "persona_description_position": 0, "custom_stopping_strings": "", + "custom_stopping_strings_macro": true, "fuzzy_search": false }, "extension_settings": { diff --git a/public/index.html b/public/index.html index eb4d99024..bb99e97a1 100644 --- a/public/index.html +++ b/public/index.html @@ -2038,6 +2038,12 @@
+

Pygmalion Formatting diff --git a/public/script.js b/public/script.js index d9107fa1b..7ea7458b1 100644 --- a/public/script.js +++ b/public/script.js @@ -1750,7 +1750,11 @@ function getStoppingStrings(isImpersonate, addSpace) { if (power_user.custom_stopping_strings) { const customStoppingStrings = getCustomStoppingStrings(); - result.push(...customStoppingStrings.map(x => substituteParams(x, name1, name2))); + if (power_user.custom_stopping_strings_macro) { + result.push(...customStoppingStrings.map(x => substituteParams(x, name1, name2))); + } else { + result.push(...customStoppingStrings); + } } return addSpace ? result.map(x => `${x} `) : result; diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index 0ff013843..b4937d58a 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -188,6 +188,7 @@ let power_user = { persona_show_notifications: true, custom_stopping_strings: '', + custom_stopping_strings_macro: true, fuzzy_search: false, }; @@ -679,6 +680,7 @@ function loadPowerUserSettings(settings, data) { $('#auto_swipe_blacklist').val(power_user.auto_swipe_blacklist.join(", ")); $('#auto_swipe_blacklist_threshold').val(power_user.auto_swipe_blacklist_threshold); $('#custom_stopping_strings').val(power_user.custom_stopping_strings); + $("#custom_stopping_strings_macro").prop("checked", power_user.custom_stopping_strings_macro); $('#fuzzy_search_checkbox').prop("checked", power_user.fuzzy_search); $('#persona_show_notifications').prop("checked", power_user.persona_show_notifications); @@ -1996,6 +1998,11 @@ $(document).ready(() => { saveSettingsDebounced(); }); + $("#custom_stopping_strings_macro").change(function () { + power_user.custom_stopping_strings_macro = $(this).prop("checked"); + saveSettingsDebounced(); + }); + $('#fuzzy_search_checkbox').on('input', function () { power_user.fuzzy_search = !!$(this).prop('checked'); saveSettingsDebounced();