Merge pull request #2598 from NearEDGE/quick-impersonate-regenerate-buttons Added quick Regenerate and Impersonate buttons
Signed| @@ -4161,6 +4161,12 @@ | |||
| 4161 | Quick "Continue" button | 4161 | Quick "Continue" button |
| 4162 | </small> | 4162 | </small> |
| 4163 | </label> | 4163 | </label> |
| 4164 | <label class="checkbox_label" for="quick_impersonate" title="Show a button in the input area to ask the AI to impersonate your character for a single message." data-i18n="[title]Show a button in the input area to ask the AI to impersonate your character for a single message"> | ||
| 4165 | <input id="quick_impersonate" type="checkbox" /> | ||
| 4166 | <small data-i18n="Quick 'Impersonate' button"> | ||
| 4167 | Quick "Impersonate" button | ||
| 4168 | </small> | ||
| 4169 | </label> | ||
| 4164 | <div class="checkbox-container flex-container"> | 4170 | <div class="checkbox-container flex-container"> |
| 4165 | <label data-newbie-hidden class="checkbox_label" for="swipes-checkbox" title="Show arrow buttons on the last in-chat message to generate alternative AI responses. Both PC and mobile." data-i18n="[title]Show arrow buttons on the last in-chat message to generate alternative AI responses. Both PC and mobile"> | 4171 | <label data-newbie-hidden class="checkbox_label" for="swipes-checkbox" title="Show arrow buttons on the last in-chat message to generate alternative AI responses. Both PC and mobile." data-i18n="[title]Show arrow buttons on the last in-chat message to generate alternative AI responses. Both PC and mobile"> |
| 4166 | <input id="swipes-checkbox" type="checkbox" /> | 4172 | <input id="swipes-checkbox" type="checkbox" /> |
| @@ -6371,6 +6377,7 @@ | |||
| 6371 | <div id="mes_stop" title="Abort request" class="mes_stop" data-i18n="[title]Abort request"> | 6377 | <div id="mes_stop" title="Abort request" class="mes_stop" data-i18n="[title]Abort request"> |
| 6372 | <i class="fa-solid fa-circle-stop"></i> | 6378 | <i class="fa-solid fa-circle-stop"></i> |
| 6373 | </div> | 6379 | </div> |
| 6380 | <div id="mes_impersonate" class="fa-solid fa-user-secret interactable displayNone" title="Ask AI to write your message for you" data-i18n="[title]Ask AI to write your message for you" tabindex="0"></div> | ||
| 6374 | <div id="mes_continue" class="fa-fw fa-solid fa-arrow-right interactable displayNone" title="Continue the last message" data-i18n="[title]Continue the last message"></div> | 6381 | <div id="mes_continue" class="fa-fw fa-solid fa-arrow-right interactable displayNone" title="Continue the last message" data-i18n="[title]Continue the last message"></div> |
| 6375 | <div id="send_but" class="fa-solid fa-paper-plane interactable displayNone" title="Send a message" data-i18n="[title]Send a message"></div> | 6382 | <div id="send_but" class="fa-solid fa-paper-plane interactable displayNone" title="Send a message" data-i18n="[title]Send a message"></div> |
| 6376 | </div> | 6383 | </div> |
| @@ -5625,6 +5625,7 @@ export function activateSendButtons() { | |||
| 5625 | is_send_press = false; | 5625 | is_send_press = false; |
| 5626 | $('#send_but').removeClass('displayNone'); | 5626 | $('#send_but').removeClass('displayNone'); |
| 5627 | $('#mes_continue').removeClass('displayNone'); | 5627 | $('#mes_continue').removeClass('displayNone'); |
| 5628 | $('#mes_impersonate').removeClass('displayNone'); | ||
| 5628 | $('.mes_buttons:last').show(); | 5629 | $('.mes_buttons:last').show(); |
| 5629 | hideStopButton(); | 5630 | hideStopButton(); |
| 5630 | } | 5631 | } |
| @@ -5632,6 +5633,7 @@ export function activateSendButtons() { | |||
| 5632 | export function deactivateSendButtons() { | 5633 | export function deactivateSendButtons() { |
| 5633 | $('#send_but').addClass('displayNone'); | 5634 | $('#send_but').addClass('displayNone'); |
| 5634 | $('#mes_continue').addClass('displayNone'); | 5635 | $('#mes_continue').addClass('displayNone'); |
| 5636 | $('#mes_impersonate').addClass('displayNone'); | ||
| 5635 | showStopButton(); | 5637 | showStopButton(); |
| 5636 | } | 5638 | } |
| 5637 | 5639 | ||
| @@ -9112,14 +9114,14 @@ jQuery(async function () { | |||
| 9112 | $('#send_textarea').on('focusin focus click', () => { | 9114 | $('#send_textarea').on('focusin focus click', () => { |
| 9113 | S_TAPreviouslyFocused = true; | 9115 | S_TAPreviouslyFocused = true; |
| 9114 | }); | 9116 | }); |
| 9115 | $('#send_but, #option_regenerate, #option_continue, #mes_continue').on('click', () => { | 9117 | $('#send_but, #option_regenerate, #option_continue, #mes_continue, #mes_impersonate').on('click', () => { |
| 9116 | if (S_TAPreviouslyFocused) { | 9118 | if (S_TAPreviouslyFocused) { |
| 9117 | $('#send_textarea').focus(); | 9119 | $('#send_textarea').focus(); |
| 9118 | } | 9120 | } |
| 9119 | }); | 9121 | }); |
| 9120 | $(document).click(event => { | 9122 | $(document).click(event => { |
| 9121 | if ($(':focus').attr('id') !== 'send_textarea') { | 9123 | if ($(':focus').attr('id') !== 'send_textarea') { |
| 9122 | var validIDs = ['options_button', 'send_but', 'mes_continue', 'send_textarea', 'option_regenerate', 'option_continue']; | 9124 | var validIDs = ['options_button', 'send_but', 'mes_impersonate', 'mes_continue', 'send_textarea', 'option_regenerate', 'option_continue']; |
| 9123 | if (!validIDs.includes($(event.target).attr('id'))) { | 9125 | if (!validIDs.includes($(event.target).attr('id'))) { |
| 9124 | S_TAPreviouslyFocused = false; | 9126 | S_TAPreviouslyFocused = false; |
| 9125 | } | 9127 | } |
| @@ -9155,6 +9157,9 @@ jQuery(async function () { | |||
| 9155 | debouncedCharacterSearch(searchQuery); | 9157 | debouncedCharacterSearch(searchQuery); |
| 9156 | }); | 9158 | }); |
| 9157 | 9159 | ||
| 9160 | $('#mes_impersonate').on('click', function () { | ||
| 9161 | $('#option_impersonate').trigger('click'); | ||
| 9162 | }); | ||
| 9158 | 9163 | ||
| 9159 | $('#mes_continue').on('click', function () { | 9164 | $('#mes_continue').on('click', function () { |
| 9160 | $('#option_continue').trigger('click'); | 9165 | $('#option_continue').trigger('click'); |
| @@ -311,6 +311,7 @@ function RA_checkOnlineStatus() { | |||
| 311 | $('#send_form').addClass('no-connection'); //entire input form area is red when not connected | 311 | $('#send_form').addClass('no-connection'); //entire input form area is red when not connected |
| 312 | $('#send_but').addClass('displayNone'); //send button is hidden when not connected; | 312 | $('#send_but').addClass('displayNone'); //send button is hidden when not connected; |
| 313 | $('#mes_continue').addClass('displayNone'); //continue button is hidden when not connected; | 313 | $('#mes_continue').addClass('displayNone'); //continue button is hidden when not connected; |
| 314 | $('#mes_impersonate').addClass('displayNone'); //continue button is hidden when not connected; | ||
| 314 | $('#API-status-top').removeClass('fa-plug'); | 315 | $('#API-status-top').removeClass('fa-plug'); |
| 315 | $('#API-status-top').addClass('fa-plug-circle-exclamation redOverlayGlow'); | 316 | $('#API-status-top').addClass('fa-plug-circle-exclamation redOverlayGlow'); |
| 316 | connection_made = false; | 317 | connection_made = false; |
| @@ -327,6 +328,7 @@ function RA_checkOnlineStatus() { | |||
| 327 | if (!is_send_press && !(selected_group && is_group_generating)) { | 328 | if (!is_send_press && !(selected_group && is_group_generating)) { |
| 328 | $('#send_but').removeClass('displayNone'); //on connect, send button shows | 329 | $('#send_but').removeClass('displayNone'); //on connect, send button shows |
| 329 | $('#mes_continue').removeClass('displayNone'); //continue button is shown when connected | 330 | $('#mes_continue').removeClass('displayNone'); //continue button is shown when connected |
| 331 | $('#mes_impersonate').removeClass('displayNone'); //continue button is shown when connected | ||
| 330 | } | 332 | } |
| 331 | } | 333 | } |
| 332 | } | 334 | } |
| @@ -197,6 +197,7 @@ let power_user = { | |||
| 197 | prefer_character_prompt: true, | 197 | prefer_character_prompt: true, |
| 198 | prefer_character_jailbreak: true, | 198 | prefer_character_jailbreak: true, |
| 199 | quick_continue: false, | 199 | quick_continue: false, |
| 200 | quick_impersonate: false, | ||
| 200 | continue_on_send: false, | 201 | continue_on_send: false, |
| 201 | trim_spaces: true, | 202 | trim_spaces: true, |
| 202 | relaxed_api_urls: false, | 203 | relaxed_api_urls: false, |
| @@ -1592,7 +1593,9 @@ function loadPowerUserSettings(settings, data) { | |||
| 1592 | $('#trim_spaces').prop('checked', power_user.trim_spaces); | 1593 | $('#trim_spaces').prop('checked', power_user.trim_spaces); |
| 1593 | $('#continue_on_send').prop('checked', power_user.continue_on_send); | 1594 | $('#continue_on_send').prop('checked', power_user.continue_on_send); |
| 1594 | $('#quick_continue').prop('checked', power_user.quick_continue); | 1595 | $('#quick_continue').prop('checked', power_user.quick_continue); |
| 1596 | $('#quick_impersonate').prop('checked', power_user.quick_continue); | ||
| 1595 | $('#mes_continue').css('display', power_user.quick_continue ? '' : 'none'); | 1597 | $('#mes_continue').css('display', power_user.quick_continue ? '' : 'none'); |
| 1598 | $('#mes_impersonate').css('display', power_user.quick_impersonate ? '' : 'none'); | ||
| 1596 | $('#gestures-checkbox').prop('checked', power_user.gestures); | 1599 | $('#gestures-checkbox').prop('checked', power_user.gestures); |
| 1597 | $('#auto_swipe').prop('checked', power_user.auto_swipe); | 1600 | $('#auto_swipe').prop('checked', power_user.auto_swipe); |
| 1598 | $('#auto_swipe_minimum_length').val(power_user.auto_swipe_minimum_length); | 1601 | $('#auto_swipe_minimum_length').val(power_user.auto_swipe_minimum_length); |
| @@ -3739,6 +3742,13 @@ $(document).ready(() => { | |||
| 3739 | saveSettingsDebounced(); | 3742 | saveSettingsDebounced(); |
| 3740 | }); | 3743 | }); |
| 3741 | 3744 | ||
| 3745 | $('#quick_impersonate').on('input', function () { | ||
| 3746 | const value = !!$(this).prop('checked'); | ||
| 3747 | power_user.quick_impersonate = value; | ||
| 3748 | $('#mes_impersonate').css('display', value ? '' : 'none'); | ||
| 3749 | saveSettingsDebounced(); | ||
| 3750 | }); | ||
| 3751 | |||
| 3742 | $('#trim_spaces').on('input', function () { | 3752 | $('#trim_spaces').on('input', function () { |
| 3743 | const value = !!$(this).prop('checked'); | 3753 | const value = !!$(this).prop('checked'); |
| 3744 | power_user.trim_spaces = value; | 3754 | power_user.trim_spaces = value; |
| @@ -723,6 +723,10 @@ body .panelControlBar { | |||
| 723 | order: 1; | 723 | order: 1; |
| 724 | } | 724 | } |
| 725 | 725 | ||
| 726 | #mes_impersonate { | ||
| 727 | order: 1; | ||
| 728 | } | ||
| 729 | |||
| 726 | #send_form .mes_stop { | 730 | #send_form .mes_stop { |
| 727 | display: none; | 731 | display: none; |
| 728 | order: 2; | 732 | order: 2; |