Added quick Regenerate and Impersonate buttons Additional buttons mimic the behavior of the continue button.
| @@ -4144,6 +4144,18 @@ | ||
| 4144 | 4144 | Quick "Continue" button |
| 4145 | 4145 | </small> |
| 4146 | 4146 | </label> |
| 4147 | + <label class="checkbox_label" for="quick_regenerate" title="Show a button in the input area to ask the AI regenerate its last message." data-i18n="[title]Show a button in the input area to ask the AI regenerate its last message"> | |
| 4148 | + <input id="quick_regenerate" type="checkbox" /> | |
| 4149 | + <small data-i18n="Quick 'Regenerate' button"> | |
| 4150 | + Quick "Regenerate" button | |
| 4151 | + </small> | |
| 4152 | + </label> | |
| 4153 | + <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"> | |
| 4154 | + <input id="quick_impersonate" type="checkbox" /> | |
| 4155 | + <small data-i18n="Quick 'Impersonate' button"> | |
| 4156 | + Quick "Impersonate" button | |
| 4157 | + </small> | |
| 4158 | + </label> | |
| 4147 | 4159 | <div class="checkbox-container flex-container"> |
| 4148 | 4160 | <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"> |
| 4149 | 4161 | <input id="swipes-checkbox" type="checkbox" /> |
| @@ -6342,6 +6354,8 @@ | ||
| 6342 | 6354 | <div id="mes_stop" title="Abort request" class="mes_stop" data-i18n="[title]Abort request"> |
| 6343 | 6355 | <i class="fa-solid fa-circle-stop"></i> |
| 6344 | 6356 | </div> |
| 6357 | + <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> | |
| 6358 | + <div id="mes_regenerate" class="fa-solid fa-repeat interactable displayNone" title="Regenerate last message" data-i18n="[title]Regenerate last message" tabindex="0"></div> | |
| 6345 | 6359 | <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> |
| 6346 | 6360 | <div id="send_but" class="fa-solid fa-paper-plane interactable displayNone" title="Send a message" data-i18n="[title]Send a message"></div> |
| 6347 | 6361 | </div> |
| @@ -5610,6 +5610,8 @@ export function activateSendButtons() { | ||
| 5610 | 5610 | is_send_press = false; |
| 5611 | 5611 | $('#send_but').removeClass('displayNone'); |
| 5612 | 5612 | $('#mes_continue').removeClass('displayNone'); |
| 5613 | + $('#mes_regenerate').removeClass('displayNone'); | |
| 5614 | + $('#mes_impersonate').removeClass('displayNone'); | |
| 5613 | 5615 | $('.mes_buttons:last').show(); |
| 5614 | 5616 | hideStopButton(); |
| 5615 | 5617 | } |
| @@ -5617,6 +5619,8 @@ export function activateSendButtons() { | ||
| 5617 | 5619 | export function deactivateSendButtons() { |
| 5618 | 5620 | $('#send_but').addClass('displayNone'); |
| 5619 | 5621 | $('#mes_continue').addClass('displayNone'); |
| 5622 | + $('#mes_regenerate').addClass('displayNone'); | |
| 5623 | + $('#mes_impersonate').addClass('displayNone'); | |
| 5620 | 5624 | showStopButton(); |
| 5621 | 5625 | } |
| 5622 | 5626 | |
| @@ -9095,14 +9099,14 @@ jQuery(async function () { | ||
| 9095 | 9099 | $('#send_textarea').on('focusin focus click', () => { |
| 9096 | 9100 | S_TAPreviouslyFocused = true; |
| 9097 | 9101 | }); |
| 9098 | 9102 | $('#send_but, #option_regenerate, #option_continue, #mes_continue, #mes_regenerate, #mes_impersonate').on('click', () => { |
| 9099 | 9103 | if (S_TAPreviouslyFocused) { |
| 9100 | 9104 | $('#send_textarea').focus(); |
| 9101 | 9105 | } |
| 9102 | 9106 | }); |
| 9103 | 9107 | $(document).click(event => { |
| 9104 | 9108 | if ($(':focus').attr('id') !== 'send_textarea') { |
| 9105 | 9109 | var validIDs = ['options_button', 'send_but', 'mes_regenerate', 'mes_impersonate', 'mes_continue', 'send_textarea', 'option_regenerate', 'option_continue']; |
| 9106 | 9110 | if (!validIDs.includes($(event.target).attr('id'))) { |
| 9107 | 9111 | S_TAPreviouslyFocused = false; |
| 9108 | 9112 | } |
| @@ -9139,6 +9143,14 @@ jQuery(async function () { | ||
| 9139 | 9143 | }); |
| 9140 | 9144 | |
| 9141 | 9145 | |
| 9146 | + $('#mes_regenerate').on('click', function () { | |
| 9147 | + $('#option_regenerate').trigger('click'); | |
| 9148 | + }); | |
| 9149 | + | |
| 9150 | + $('#mes_impersonate').on('click', function () { | |
| 9151 | + $('#option_impersonate').trigger('click'); | |
| 9152 | + }); | |
| 9153 | + | |
| 9142 | 9154 | $('#mes_continue').on('click', function () { |
| 9143 | 9155 | $('#option_continue').trigger('click'); |
| 9144 | 9156 | }); |
| @@ -311,6 +311,8 @@ function RA_checkOnlineStatus() { | ||
| 311 | 311 | $('#send_form').addClass('no-connection'); //entire input form area is red when not connected |
| 312 | 312 | $('#send_but').addClass('displayNone'); //send button is hidden when not connected; |
| 313 | 313 | $('#mes_continue').addClass('displayNone'); //continue button is hidden when not connected; |
| 314 | + $('#mes_regenerate').addClass('displayNone'); //continue button is hidden when not connected; | |
| 315 | + $('#mes_impersonate').addClass('displayNone'); //continue button is hidden when not connected; | |
| 314 | 316 | $('#API-status-top').removeClass('fa-plug'); |
| 315 | 317 | $('#API-status-top').addClass('fa-plug-circle-exclamation redOverlayGlow'); |
| 316 | 318 | connection_made = false; |
| @@ -327,6 +329,8 @@ function RA_checkOnlineStatus() { | ||
| 327 | 329 | if (!is_send_press && !(selected_group && is_group_generating)) { |
| 328 | 330 | $('#send_but').removeClass('displayNone'); //on connect, send button shows |
| 329 | 331 | $('#mes_continue').removeClass('displayNone'); //continue button is shown when connected |
| 332 | + $('#mes_regenerate').removeClass('displayNone'); //continue button is shown when connected | |
| 333 | + $('#mes_impersonate').removeClass('displayNone'); //continue button is shown when connected | |
| 330 | 334 | } |
| 331 | 335 | } |
| 332 | 336 | } |
| @@ -197,6 +197,8 @@ let power_user = { | ||
| 197 | 197 | prefer_character_prompt: true, |
| 198 | 198 | prefer_character_jailbreak: true, |
| 199 | 199 | quick_continue: false, |
| 200 | + quick_regenerate: false, | |
| 201 | + quick_impersonate: false, | |
| 200 | 202 | continue_on_send: false, |
| 201 | 203 | trim_spaces: true, |
| 202 | 204 | relaxed_api_urls: false, |
| @@ -1586,7 +1588,11 @@ function loadPowerUserSettings(settings, data) { | ||
| 1586 | 1588 | $('#trim_spaces').prop('checked', power_user.trim_spaces); |
| 1587 | 1589 | $('#continue_on_send').prop('checked', power_user.continue_on_send); |
| 1588 | 1590 | $('#quick_continue').prop('checked', power_user.quick_continue); |
| 1591 | + $('#quick_regenerate').prop('checked', power_user.quick_continue); | |
| 1592 | + $('#quick_impersonate').prop('checked', power_user.quick_continue); | |
| 1589 | 1593 | $('#mes_continue').css('display', power_user.quick_continue ? '' : 'none'); |
| 1594 | + $('#mes_regenerate').css('display', power_user.quick_regenerate? '' : 'none'); | |
| 1595 | + $('#mes_impersonate').css('display', power_user.quick_impersonate ? '' : 'none'); | |
| 1590 | 1596 | $('#gestures-checkbox').prop('checked', power_user.gestures); |
| 1591 | 1597 | $('#auto_swipe').prop('checked', power_user.auto_swipe); |
| 1592 | 1598 | $('#auto_swipe_minimum_length').val(power_user.auto_swipe_minimum_length); |
| @@ -3732,6 +3738,20 @@ $(document).ready(() => { | ||
| 3732 | 3738 | saveSettingsDebounced(); |
| 3733 | 3739 | }); |
| 3734 | 3740 | |
| 3741 | + $('#quick_regenerate').on('input', function () { | |
| 3742 | + const value = !!$(this).prop('checked'); | |
| 3743 | + power_user.quick_regenerate = value; | |
| 3744 | + $('#mes_regenerate').css('display', value ? '' : 'none'); | |
| 3745 | + saveSettingsDebounced(); | |
| 3746 | + }); | |
| 3747 | + | |
| 3748 | + $('#quick_impersonate').on('input', function () { | |
| 3749 | + const value = !!$(this).prop('checked'); | |
| 3750 | + power_user.quick_impersonate = value; | |
| 3751 | + $('#mes_impersonate').css('display', value ? '' : 'none'); | |
| 3752 | + saveSettingsDebounced(); | |
| 3753 | + }); | |
| 3754 | + | |
| 3735 | 3755 | $('#trim_spaces').on('input', function () { |
| 3736 | 3756 | const value = !!$(this).prop('checked'); |
| 3737 | 3757 | power_user.trim_spaces = value; |
| @@ -716,6 +716,14 @@ body .panelControlBar { | ||
| 716 | 716 | order: 1; |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | +#mes_regenerate { | |
| 720 | + order: 1; | |
| 721 | +} | |
| 722 | + | |
| 723 | +#mes_impersonate { | |
| 724 | + order: 1; | |
| 725 | +} | |
| 726 | + | |
| 719 | 727 | #send_form .mes_stop { |
| 720 | 728 | display: none; |
| 721 | 729 | order: 2; |