mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	/dupe
This commit is contained in:
		| @@ -2205,6 +2205,10 @@ | ||||
|                                 <input id="allow_name1_display" type="checkbox" /> | ||||
|                                 <span data-i18n="Allow {{user}}: in bot messages">Show {{user}}: in responses</span> | ||||
|                             </label> | ||||
|                             <!-- <label class="checkbox_label" for="removeXML"> | ||||
|                                 <input id="removeXML" type="checkbox" /> | ||||
|                                 <span data-i18n="Remove XML/HTML tags from responses">Remove <tags> from responses</span> | ||||
|                             </label> --> | ||||
|                             <label for="console_log_prompts"> | ||||
|                                 <input id="console_log_prompts" type="checkbox" /> | ||||
|                                 Log prompts to console | ||||
|   | ||||
| @@ -1084,6 +1084,17 @@ function messageFormatting(mes, ch_name, isSystem, isUser) { | ||||
|         mes = mes.replaceAll(`${ch_name}:`, ""); | ||||
|     } | ||||
|  | ||||
|     //function to hide any <tags> from AI response output | ||||
|     /*  if (power_user.removeXML && ch_name && !isUser && !isSystem) { | ||||
|          //console.log('incoming mes') | ||||
|          //console.log(mes) | ||||
|          mes = mes.replaceAll(/</g, "<"); | ||||
|          mes = mes.replaceAll(/>/g, ">"); | ||||
|          mes = mes.replaceAll(/<<[^>>]+>>/g, ""); | ||||
|          //console.log('mes after removed <tags>') | ||||
|          //console.log(mes) | ||||
|      } */ | ||||
|  | ||||
|     return mes; | ||||
| } | ||||
|  | ||||
| @@ -2796,6 +2807,11 @@ function getMultigenAmount() { | ||||
| } | ||||
|  | ||||
| async function DupeChar() { | ||||
|     if (!this_chid) { | ||||
|         toastr.warning('You must first select a character to duplicate!') | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     const body = { avatar_url: characters[this_chid].avatar }; | ||||
|     const response = await fetch('/dupecharacter', { | ||||
|         method: 'POST', | ||||
| @@ -5987,6 +6003,8 @@ if (isPwaMode) { $("body").addClass('PWA') } | ||||
| $(document).ready(function () { | ||||
|     //////////INPUT BAR FOCUS-KEEPING LOGIC///////////// | ||||
|  | ||||
|     registerSlashCommand('dupe', DupeChar, [], "– duplicates the currently selected character", true, true); | ||||
|  | ||||
|     setTimeout(function () { | ||||
|         $("#groupControlsToggle").trigger('click'); | ||||
|         $("#groupCurrentMemberListToggle .inline-drawer-icon").trigger('click'); | ||||
|   | ||||
| @@ -132,6 +132,7 @@ let power_user = { | ||||
|     render_formulas: false, | ||||
|     allow_name1_display: false, | ||||
|     allow_name2_display: false, | ||||
|     //removeXML: false, | ||||
|     hotswap_enabled: true, | ||||
|     timer_enabled: true, | ||||
|     timestamps_enabled: true, | ||||
| @@ -573,6 +574,7 @@ function loadPowerUserSettings(settings, data) { | ||||
|     $("#auto_save_msg_edits").prop("checked", power_user.auto_save_msg_edits); | ||||
|     $("#allow_name1_display").prop("checked", power_user.allow_name1_display); | ||||
|     $("#allow_name2_display").prop("checked", power_user.allow_name2_display); | ||||
|     //$("#removeXML").prop("checked", power_user.removeXML); | ||||
|     $("#hotswapEnabled").prop("checked", power_user.hotswap_enabled); | ||||
|     $("#messageTimerEnabled").prop("checked", power_user.timer_enabled); | ||||
|     $("#messageTimestampsEnabled").prop("checked", power_user.timestamps_enabled); | ||||
| @@ -1268,6 +1270,12 @@ $(document).ready(() => { | ||||
|         saveSettingsDebounced(); | ||||
|     }); | ||||
|  | ||||
|     /*     $("#removeXML").on("input", function () { | ||||
|             power_user.removeXML = !!$(this).prop('checked'); | ||||
|             reloadCurrentChat(); | ||||
|             saveSettingsDebounced(); | ||||
|         }); */ | ||||
|  | ||||
|     $("#token_padding").on("input", function () { | ||||
|         power_user.token_padding = Number($(this).val()); | ||||
|         saveSettingsDebounced(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user