diff --git a/public/scripts/extensions/quick-reply/index.js b/public/scripts/extensions/quick-reply/index.js index 654e5fe4b..5e874bd28 100644 --- a/public/scripts/extensions/quick-reply/index.js +++ b/public/scripts/extensions/quick-reply/index.js @@ -15,8 +15,9 @@ const defaultSettings = { quickReplyEnabled: false, numberOfSlots: 5, quickReplySlots: [], - placeBeforePromptEnabled: false, + placeBeforeInputEnabled: false, quickActionEnabled: false, + AutoInputInject: true } //method from worldinfo @@ -77,8 +78,9 @@ async function loadSettings(type) { $('#quickReplyEnabled').prop('checked', extension_settings.quickReply.quickReplyEnabled); $('#quickReplyNumberOfSlots').val(extension_settings.quickReply.numberOfSlots); - $('#placeBeforePromptEnabled').prop('checked', extension_settings.quickReply.placeBeforePromptEnabled); + $('#placeBeforeInputEnabled').prop('checked', extension_settings.quickReply.placeBeforeInputEnabled); $('#quickActionEnabled').prop('checked', extension_settings.quickReply.quickActionEnabled); + $('#AutoInputInject').prop('checked', extension_settings.quickReply.AutoInputInject); } function onQuickReplyInput(id) { @@ -109,8 +111,13 @@ async function onQuickActionEnabledInput() { saveSettingsDebounced(); } -async function onPlaceBeforePromptEnabledInput() { - extension_settings.quickReply.placeBeforePromptEnabled = !!$(this).prop('checked'); +async function onPlaceBeforeInputEnabledInput() { + extension_settings.quickReply.placeBeforeInputEnabled = !!$(this).prop('checked'); + saveSettingsDebounced(); +} + +async function onAutoInputInject() { + extension_settings.quickReply.AutoInputInject = !!$(this).prop('checked'); saveSettingsDebounced(); } @@ -125,16 +132,15 @@ async function sendQuickReply(index) { let newText; - if (existingText) { - // If existing text, add space after prompt - if (extension_settings.quickReply.placeBeforePromptEnabled) { + if (existingText && extension_settings.quickReply.AutoInputInject){ + if (extension_settings.quickReply.placeBeforeInputEnabled) { newText = `${prompt} ${existingText} `; } else { newText = `${existingText} ${prompt} `; } } else { - // If no existing text, add prompt only (with a trailing space) - newText = prompt + ' '; + // If no existing text and placeBeforeInputEnabled false, add prompt only (with a trailing space) + newText = `${prompt} `; } newText = substituteParams(newText); @@ -355,8 +361,12 @@ jQuery(async () => { Disable Send / Insert In User Input +