mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	less console spam, placehold for dinkus MD escape
This commit is contained in:
		| @@ -1625,7 +1625,18 @@ | ||||
|                                 <input id="custom_chat_separator" class="text_pole textarea_compact" type="text" placeholder="<START>" maxlength="100" /> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                         <!--                          | ||||
|                         <div> | ||||
|                             <h4 data-i18n="Non-markdown strings"> | ||||
|                                 Non-markdown strings | ||||
|                             </h4> | ||||
|                             <div> | ||||
|                                 <input id="markdown_escape_strings" class="text_pole textarea_compact" type="text" placeholder="separate with commas w/o space between" maxlength="100" /> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                         --> | ||||
|                         <div> | ||||
|  | ||||
|                             <h4 data-i18n="Instruct mode">Instruct mode | ||||
|                                 <a href="https://docs.sillytavern.app/usage/core-concepts/instructmode/" class="notes-link" target="_blank"> | ||||
|                                     <span class="note-link-span">?</span> | ||||
|   | ||||
| @@ -218,7 +218,8 @@ export { | ||||
|     talkativeness_default, | ||||
|     default_ch_mes, | ||||
|     extension_prompt_types, | ||||
|     updateVisibleDivs | ||||
|     updateVisibleDivs, | ||||
|     mesForShowdownParse, | ||||
| } | ||||
|  | ||||
| // API OBJECT FOR EXTERNAL WIRING | ||||
| @@ -228,6 +229,7 @@ const gpt3 = new GPT3BrowserTokenizer({ type: 'gpt3' }); | ||||
| hljs.addPlugin({ "before:highlightElement": ({ el }) => { el.textContent = el.innerText } }); | ||||
|  | ||||
| // Markdown converter | ||||
| let mesForShowdownParse; //intended to be used as a context to compare showdown strings against | ||||
| let converter; | ||||
| reloadMarkdownProcessor(); | ||||
|  | ||||
| @@ -1017,6 +1019,10 @@ export async function reloadCurrentChat() { | ||||
| } | ||||
|  | ||||
| function messageFormatting(mes, ch_name, isSystem, isUser) { | ||||
|     if (mes) { | ||||
|         mesForShowdownParse = mes; | ||||
|     } | ||||
|  | ||||
|     if (!mes) { | ||||
|         mes = ''; | ||||
|     } | ||||
| @@ -1233,7 +1239,7 @@ function addOneMessage(mes, { type = "normal", insertAfter = null, scroll = true | ||||
|     // don't need prompt button for user | ||||
|     if (params.isUser === true) { | ||||
|         newMessage.find(".mes_prompt").hide(); | ||||
|         console.log(`hiding prompt for user mesID ${params.mesId}`); | ||||
|         //console.log(`hiding prompt for user mesID ${params.mesId}`); | ||||
|     } | ||||
|  | ||||
|     //shows or hides the Prompt display button | ||||
| @@ -1241,16 +1247,16 @@ function addOneMessage(mes, { type = "normal", insertAfter = null, scroll = true | ||||
|  | ||||
|     //if we have itemized messages, and the array isn't null.. | ||||
|     if (params.isUser === false && itemizedPrompts.length !== 0 && itemizedPrompts.length !== null) { | ||||
|         console.log('looking through itemized prompts...'); | ||||
|         console.log(`mesIdToFind = ${mesIdToFind} from ${params.avatarImg}`); | ||||
|         console.log(`itemizedPrompts.length = ${itemizedPrompts.length}`) | ||||
|         console.log(itemizedPrompts); | ||||
|         // console.log('looking through itemized prompts...'); | ||||
|         //console.log(`mesIdToFind = ${mesIdToFind} from ${params.avatarImg}`); | ||||
|         //console.log(`itemizedPrompts.length = ${itemizedPrompts.length}`) | ||||
|         //console.log(itemizedPrompts); | ||||
|  | ||||
|         for (var i = 0; i < itemizedPrompts.length; i++) { | ||||
|             console.log(`itemized array item ${i} is MesID ${Number(itemizedPrompts[i].mesId)}, does it match ${Number(mesIdToFind)}?`); | ||||
|             //console.log(`itemized array item ${i} is MesID ${Number(itemizedPrompts[i].mesId)}, does it match ${Number(mesIdToFind)}?`); | ||||
|             if (Number(itemizedPrompts[i].mesId) === Number(mesIdToFind)) { | ||||
|                 newMessage.find(".mes_prompt").show(); | ||||
|                 console.log(`showing button for mesID ${params.mesId} from ${params.characterName}`); | ||||
|                 //console.log(`showing button for mesID ${params.mesId} from ${params.characterName}`); | ||||
|                 break; | ||||
|  | ||||
|             } /*else { | ||||
| @@ -1260,10 +1266,10 @@ function addOneMessage(mes, { type = "normal", insertAfter = null, scroll = true | ||||
|             } */ | ||||
|         } | ||||
|     } else { | ||||
|         console.log('itemizedprompt array empty null, or user, hiding this prompt buttons'); | ||||
|         //console.log('itemizedprompt array empty null, or user, hiding this prompt buttons'); | ||||
|         //$(".mes_prompt").hide(); | ||||
|         newMessage.find(".mes_prompt").hide(); | ||||
|         console.log(itemizedPrompts); | ||||
|         //console.log(itemizedPrompts); | ||||
|     } | ||||
|  | ||||
|     newMessage.find('.avatar img').on('error', function () { | ||||
| @@ -2353,7 +2359,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject, | ||||
|  | ||||
|             thisPromptBits = additionalPromptStuff; | ||||
|  | ||||
|             console.log(thisPromptBits); | ||||
|             //console.log(thisPromptBits); | ||||
|  | ||||
|             itemizedPrompts.push(thisPromptBits); | ||||
|             console.log(`pushed prompt bits to itemizedPrompts array. Length is now: ${itemizedPrompts.length}`); | ||||
|   | ||||
| @@ -92,6 +92,7 @@ let power_user = { | ||||
|     multigen_first_chunk: 50, | ||||
|     multigen_next_chunks: 30, | ||||
|     custom_chat_separator: '', | ||||
|     // markdown_escape_strings: '', | ||||
|     fast_ui_mode: true, | ||||
|     avatar_style: avatar_styles.ROUND, | ||||
|     chat_display: chat_styles.DEFAULT, | ||||
| @@ -259,7 +260,7 @@ function toggleWaifu() { | ||||
| } | ||||
|  | ||||
| function switchWaifuMode() { | ||||
|     console.log(`switching waifu to ${power_user.waifuMode}`); | ||||
|     //console.log(`switching waifu to ${power_user.waifuMode}`); | ||||
|     $("body").toggleClass("waifuMode", power_user.waifuMode); | ||||
|     $("#waifuMode").prop("checked", power_user.waifuMode); | ||||
|     scrollChatToBottom(); | ||||
| @@ -522,6 +523,7 @@ function loadPowerUserSettings(settings, data) { | ||||
|     $("#include_newline_checkbox").prop("checked", power_user.include_newline); | ||||
|     $('#render_formulas').prop("checked", power_user.render_formulas); | ||||
|     $("#custom_chat_separator").val(power_user.custom_chat_separator); | ||||
|     //$("#markdown_escape_strings").val(power_user.markdown_escape_strings); | ||||
|     $("#fast_ui_mode").prop("checked", power_user.fast_ui_mode); | ||||
|     $("#waifuMode").prop("checked", power_user.waifuMode); | ||||
|     $("#movingUImode").prop("checked", power_user.movingUI); | ||||
| @@ -959,7 +961,13 @@ $(document).ready(() => { | ||||
|         saveSettingsDebounced(); | ||||
|         reloadMarkdownProcessor(power_user.render_formulas); | ||||
|     }); | ||||
|  | ||||
|     /*  | ||||
|         $("#markdown_escape_strings").on('input', function () { | ||||
|             power_user.markdown_escape_strings = $(this).val(); | ||||
|             saveSettingsDebounced(); | ||||
|             reloadMarkdownProcessor(power_user.render_formulas); | ||||
|         }); | ||||
|      */ | ||||
|     $("#multigen").change(function () { | ||||
|         power_user.multigen = $(this).prop("checked"); | ||||
|         saveSettingsDebounced(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user