Added quick Regenerate and Impersonate buttons Additional buttons mimic the behavior of the continue button.

4f76e9e10fd5a07e119af9e7c42c0098db3dd67c

NearEDGE <NearEDGE@live.com>

5 files changed, +60 -2Showing whitespace changes
public/index.html+14 -0
@@ -4144,6 +4144,18 @@
41444144 Quick "Continue" button
41454145 </small>
41464146 </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>
41474159 <div class="checkbox-container flex-container">
41484160 <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">
41494161 <input id="swipes-checkbox" type="checkbox" />
@@ -6342,6 +6354,8 @@
63426354 <div id="mes_stop" title="Abort request" class="mes_stop" data-i18n="[title]Abort request">
63436355 <i class="fa-solid fa-circle-stop"></i>
63446356 </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>
63456359 <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>
63466360 <div id="send_but" class="fa-solid fa-paper-plane interactable displayNone" title="Send a message" data-i18n="[title]Send a message"></div>
63476361 </div>
public/script.js+14 -2
@@ -5610,6 +5610,8 @@ export function activateSendButtons() {
56105610 is_send_press = false;
56115611 $('#send_but').removeClass('displayNone');
56125612 $('#mes_continue').removeClass('displayNone');
5613+ $('#mes_regenerate').removeClass('displayNone');
5614+ $('#mes_impersonate').removeClass('displayNone');
56135615 $('.mes_buttons:last').show();
56145616 hideStopButton();
56155617}
@@ -5617,6 +5619,8 @@ export function activateSendButtons() {
56175619export function deactivateSendButtons() {
56185620 $('#send_but').addClass('displayNone');
56195621 $('#mes_continue').addClass('displayNone');
5622+ $('#mes_regenerate').addClass('displayNone');
5623+ $('#mes_impersonate').addClass('displayNone');
56205624 showStopButton();
56215625}
56225626
@@ -9095,14 +9099,14 @@ jQuery(async function () {
90959099 $('#send_textarea').on('focusin focus click', () => {
90969100 S_TAPreviouslyFocused = true;
90979101 });
90989102 $('#send_but, #option_regenerate, #option_continue, #mes_continue, #mes_regenerate, #mes_impersonate').on('click', () => {
90999103 if (S_TAPreviouslyFocused) {
91009104 $('#send_textarea').focus();
91019105 }
91029106 });
91039107 $(document).click(event => {
91049108 if ($(':focus').attr('id') !== 'send_textarea') {
91059109 var validIDs = ['options_button', 'send_but', 'mes_regenerate', 'mes_impersonate', 'mes_continue', 'send_textarea', 'option_regenerate', 'option_continue'];
91069110 if (!validIDs.includes($(event.target).attr('id'))) {
91079111 S_TAPreviouslyFocused = false;
91089112 }
@@ -9139,6 +9143,14 @@ jQuery(async function () {
91399143 });
91409144
91419145
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+
91429154 $('#mes_continue').on('click', function () {
91439155 $('#option_continue').trigger('click');
91449156 });
public/scripts/RossAscends-mods.js+4 -0
@@ -311,6 +311,8 @@ function RA_checkOnlineStatus() {
311311 $('#send_form').addClass('no-connection'); //entire input form area is red when not connected
312312 $('#send_but').addClass('displayNone'); //send button is hidden when not connected;
313313 $('#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;
314316 $('#API-status-top').removeClass('fa-plug');
315317 $('#API-status-top').addClass('fa-plug-circle-exclamation redOverlayGlow');
316318 connection_made = false;
@@ -327,6 +329,8 @@ function RA_checkOnlineStatus() {
327329 if (!is_send_press && !(selected_group && is_group_generating)) {
328330 $('#send_but').removeClass('displayNone'); //on connect, send button shows
329331 $('#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
330334 }
331335 }
332336 }
public/scripts/power-user.js+20 -0
@@ -197,6 +197,8 @@ let power_user = {
197197 prefer_character_prompt: true,
198198 prefer_character_jailbreak: true,
199199 quick_continue: false,
200+ quick_regenerate: false,
201+ quick_impersonate: false,
200202 continue_on_send: false,
201203 trim_spaces: true,
202204 relaxed_api_urls: false,
@@ -1586,7 +1588,11 @@ function loadPowerUserSettings(settings, data) {
15861588 $('#trim_spaces').prop('checked', power_user.trim_spaces);
15871589 $('#continue_on_send').prop('checked', power_user.continue_on_send);
15881590 $('#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);
15891593 $('#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');
15901596 $('#gestures-checkbox').prop('checked', power_user.gestures);
15911597 $('#auto_swipe').prop('checked', power_user.auto_swipe);
15921598 $('#auto_swipe_minimum_length').val(power_user.auto_swipe_minimum_length);
@@ -3732,6 +3738,20 @@ $(document).ready(() => {
37323738 saveSettingsDebounced();
37333739 });
37343740
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+
37353755 $('#trim_spaces').on('input', function () {
37363756 const value = !!$(this).prop('checked');
37373757 power_user.trim_spaces = value;
public/style.css+8 -0
@@ -716,6 +716,14 @@ body .panelControlBar {
716716 order: 1;
717717}
718718
719+#mes_regenerate {
720+ order: 1;
721+}
722+
723+#mes_impersonate {
724+ order: 1;
725+}
726+
719727#send_form .mes_stop {
720728 display: none;
721729 order: 2;