diff --git a/public/script.js b/public/script.js index 48da24d84..f8980bd8f 100644 --- a/public/script.js +++ b/public/script.js @@ -453,7 +453,7 @@ async function getStatus() { const hordeStatus = await checkHordeStatus(); online_status = hordeStatus ? 'Connected' : 'no_connection'; resultCheckStatus(); - + if (online_status !== "no_connection") { getStatusDebounced(); } @@ -823,12 +823,12 @@ function messageFormating(mes, ch_name, isSystem, forceAvatar) { mes = converter.makeHtml(mes); //mes = mes.replace(/{.*}/g, ""); mes = mes.replace(/{{(\*?.+?\*?)}}/g, ""); - + mes = mes.replace(/\n/g, "
"); mes = mes.trim(); - mes = mes.replace(/[\s\S]*?<\/code>/g, function(match) { + mes = mes.replace(/[\s\S]*?<\/code>/g, function (match) { return match.replace(/&/g, '&'); }); } @@ -1646,7 +1646,7 @@ async function Generate(type, automatic_trigger, force_name2) { 'seed': textgenerationwebui_settings.seed, } ]; - generate_data = { "data": [ JSON.stringify(data) ]}; + generate_data = { "data": [JSON.stringify(data)] }; } if (main_api == 'novel') { @@ -1961,8 +1961,8 @@ async function saveChat(chat_name) { chat[i].mes = str; chat[i].name = default_user_name; } else if (i !== chat.length - 1 && chat[i].swipe_id !== undefined) { - // delete chat[i].swipes; - // delete chat[i].swipe_id; + // delete chat[i].swipes; + // delete chat[i].swipe_id; } }); var save_chat = [ @@ -2134,7 +2134,7 @@ function changeMainAPI() { "poe": { apiSettings: $("#poe_settings"), apiConnector: $("#poe_api"), - apiPresets: $(""), + apiPresets: $("#poe_api-presets"), apiRanges: $("#range_block_poe"), maxContextElem: $("#max_context_block"), amountGenElem: $("#amount_gen_block"), @@ -2819,7 +2819,7 @@ function setExtensionPrompt(key, value, position, depth) { } function updateChatMetadata(newValues, reset) { - chat_metadata = reset? { ...newValues } : { ...chat_metadata, ...newValues }; + chat_metadata = reset ? { ...newValues } : { ...chat_metadata, ...newValues }; } function callPopup(text, type) { @@ -3032,7 +3032,7 @@ function closeMessageEditor() { function setGenerationProgress(progress) { if (!progress) { - $('#send_textarea').css({'background': '', 'transition': ''}); + $('#send_textarea').css({ 'background': '', 'transition': '' }); } else { $('#send_textarea').css({ @@ -3065,7 +3065,7 @@ window["TavernAI"].getContext = function () { saveChat: saveChatConditional, sendSystemMessage: sendSystemMessage, activateSendButtons, - deactivateSendButtons, + deactivateSendButtons, saveReply, }; }; @@ -3087,7 +3087,7 @@ $(document).ready(function () { ///// SWIPE BUTTON CLICKS /////// $(document).on('click', '.swipe_right', function () { //when we click swipe right button - if (chat.length -1 === Number(this_edit_mes_id)) { + if (chat.length - 1 === Number(this_edit_mes_id)) { closeMessageEditor(); } @@ -3227,7 +3227,7 @@ $(document).ready(function () { }); $(document).on('click', '.swipe_left', function () { // when we swipe left..but no generation. - if (chat.length -1 === Number(this_edit_mes_id)) { + if (chat.length - 1 === Number(this_edit_mes_id)) { closeMessageEditor(); } @@ -3868,7 +3868,7 @@ $(document).ready(function () { return; } - $("#api_url_text").val(value); + $("#api_url_text").val(value); api_server = value; $("#api_loading").css("display", "inline-block"); $("#api_button").css("display", "none"); @@ -4292,9 +4292,9 @@ $(document).ready(function () { this_edit_mes_id = undefined; }); - $(document).on("click", ".mes_edit_up", function() { + $(document).on("click", ".mes_edit_up", function () { if (is_send_press || this_edit_mes_id <= 0) { - return; + return; } hideSwipeButtons(); @@ -4617,9 +4617,9 @@ $(document).ready(function () { $(this).closest('.inline-drawer').find('.inline-drawer-content').slideToggle(); }); - $(document).keyup(function(e) { + $(document).keyup(function (e) { if (e.key === "Escape") { closeMessageEditor(); - } - }); + } + }); })