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" />
|
<input id="custom_chat_separator" class="text_pole textarea_compact" type="text" placeholder="<START>" maxlength="100" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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
|
<h4 data-i18n="Instruct mode">Instruct mode
|
||||||
<a href="https://docs.sillytavern.app/usage/core-concepts/instructmode/" class="notes-link" target="_blank">
|
<a href="https://docs.sillytavern.app/usage/core-concepts/instructmode/" class="notes-link" target="_blank">
|
||||||
<span class="note-link-span">?</span>
|
<span class="note-link-span">?</span>
|
||||||
|
@ -218,7 +218,8 @@ export {
|
|||||||
talkativeness_default,
|
talkativeness_default,
|
||||||
default_ch_mes,
|
default_ch_mes,
|
||||||
extension_prompt_types,
|
extension_prompt_types,
|
||||||
updateVisibleDivs
|
updateVisibleDivs,
|
||||||
|
mesForShowdownParse,
|
||||||
}
|
}
|
||||||
|
|
||||||
// API OBJECT FOR EXTERNAL WIRING
|
// API OBJECT FOR EXTERNAL WIRING
|
||||||
@ -228,6 +229,7 @@ const gpt3 = new GPT3BrowserTokenizer({ type: 'gpt3' });
|
|||||||
hljs.addPlugin({ "before:highlightElement": ({ el }) => { el.textContent = el.innerText } });
|
hljs.addPlugin({ "before:highlightElement": ({ el }) => { el.textContent = el.innerText } });
|
||||||
|
|
||||||
// Markdown converter
|
// Markdown converter
|
||||||
|
let mesForShowdownParse; //intended to be used as a context to compare showdown strings against
|
||||||
let converter;
|
let converter;
|
||||||
reloadMarkdownProcessor();
|
reloadMarkdownProcessor();
|
||||||
|
|
||||||
@ -1017,6 +1019,10 @@ export async function reloadCurrentChat() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function messageFormatting(mes, ch_name, isSystem, isUser) {
|
function messageFormatting(mes, ch_name, isSystem, isUser) {
|
||||||
|
if (mes) {
|
||||||
|
mesForShowdownParse = mes;
|
||||||
|
}
|
||||||
|
|
||||||
if (!mes) {
|
if (!mes) {
|
||||||
mes = '';
|
mes = '';
|
||||||
}
|
}
|
||||||
@ -1233,7 +1239,7 @@ function addOneMessage(mes, { type = "normal", insertAfter = null, scroll = true
|
|||||||
// don't need prompt button for user
|
// don't need prompt button for user
|
||||||
if (params.isUser === true) {
|
if (params.isUser === true) {
|
||||||
newMessage.find(".mes_prompt").hide();
|
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
|
//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 we have itemized messages, and the array isn't null..
|
||||||
if (params.isUser === false && itemizedPrompts.length !== 0 && itemizedPrompts.length !== null) {
|
if (params.isUser === false && itemizedPrompts.length !== 0 && itemizedPrompts.length !== null) {
|
||||||
console.log('looking through itemized prompts...');
|
// console.log('looking through itemized prompts...');
|
||||||
console.log(`mesIdToFind = ${mesIdToFind} from ${params.avatarImg}`);
|
//console.log(`mesIdToFind = ${mesIdToFind} from ${params.avatarImg}`);
|
||||||
console.log(`itemizedPrompts.length = ${itemizedPrompts.length}`)
|
//console.log(`itemizedPrompts.length = ${itemizedPrompts.length}`)
|
||||||
console.log(itemizedPrompts);
|
//console.log(itemizedPrompts);
|
||||||
|
|
||||||
for (var i = 0; i < itemizedPrompts.length; i++) {
|
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)) {
|
if (Number(itemizedPrompts[i].mesId) === Number(mesIdToFind)) {
|
||||||
newMessage.find(".mes_prompt").show();
|
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;
|
break;
|
||||||
|
|
||||||
} /*else {
|
} /*else {
|
||||||
@ -1260,10 +1266,10 @@ function addOneMessage(mes, { type = "normal", insertAfter = null, scroll = true
|
|||||||
} */
|
} */
|
||||||
}
|
}
|
||||||
} else {
|
} 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();
|
//$(".mes_prompt").hide();
|
||||||
newMessage.find(".mes_prompt").hide();
|
newMessage.find(".mes_prompt").hide();
|
||||||
console.log(itemizedPrompts);
|
//console.log(itemizedPrompts);
|
||||||
}
|
}
|
||||||
|
|
||||||
newMessage.find('.avatar img').on('error', function () {
|
newMessage.find('.avatar img').on('error', function () {
|
||||||
@ -2353,7 +2359,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
|||||||
|
|
||||||
thisPromptBits = additionalPromptStuff;
|
thisPromptBits = additionalPromptStuff;
|
||||||
|
|
||||||
console.log(thisPromptBits);
|
//console.log(thisPromptBits);
|
||||||
|
|
||||||
itemizedPrompts.push(thisPromptBits);
|
itemizedPrompts.push(thisPromptBits);
|
||||||
console.log(`pushed prompt bits to itemizedPrompts array. Length is now: ${itemizedPrompts.length}`);
|
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_first_chunk: 50,
|
||||||
multigen_next_chunks: 30,
|
multigen_next_chunks: 30,
|
||||||
custom_chat_separator: '',
|
custom_chat_separator: '',
|
||||||
|
// markdown_escape_strings: '',
|
||||||
fast_ui_mode: true,
|
fast_ui_mode: true,
|
||||||
avatar_style: avatar_styles.ROUND,
|
avatar_style: avatar_styles.ROUND,
|
||||||
chat_display: chat_styles.DEFAULT,
|
chat_display: chat_styles.DEFAULT,
|
||||||
@ -259,7 +260,7 @@ function toggleWaifu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function switchWaifuMode() {
|
function switchWaifuMode() {
|
||||||
console.log(`switching waifu to ${power_user.waifuMode}`);
|
//console.log(`switching waifu to ${power_user.waifuMode}`);
|
||||||
$("body").toggleClass("waifuMode", power_user.waifuMode);
|
$("body").toggleClass("waifuMode", power_user.waifuMode);
|
||||||
$("#waifuMode").prop("checked", power_user.waifuMode);
|
$("#waifuMode").prop("checked", power_user.waifuMode);
|
||||||
scrollChatToBottom();
|
scrollChatToBottom();
|
||||||
@ -522,6 +523,7 @@ function loadPowerUserSettings(settings, data) {
|
|||||||
$("#include_newline_checkbox").prop("checked", power_user.include_newline);
|
$("#include_newline_checkbox").prop("checked", power_user.include_newline);
|
||||||
$('#render_formulas').prop("checked", power_user.render_formulas);
|
$('#render_formulas').prop("checked", power_user.render_formulas);
|
||||||
$("#custom_chat_separator").val(power_user.custom_chat_separator);
|
$("#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);
|
$("#fast_ui_mode").prop("checked", power_user.fast_ui_mode);
|
||||||
$("#waifuMode").prop("checked", power_user.waifuMode);
|
$("#waifuMode").prop("checked", power_user.waifuMode);
|
||||||
$("#movingUImode").prop("checked", power_user.movingUI);
|
$("#movingUImode").prop("checked", power_user.movingUI);
|
||||||
@ -959,7 +961,13 @@ $(document).ready(() => {
|
|||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
reloadMarkdownProcessor(power_user.render_formulas);
|
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 () {
|
$("#multigen").change(function () {
|
||||||
power_user.multigen = $(this).prop("checked");
|
power_user.multigen = $(this).prop("checked");
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
|
Reference in New Issue
Block a user