This commit is contained in:
SillyLossy
2023-04-08 18:09:55 +03:00
3 changed files with 586 additions and 554 deletions

File diff suppressed because it is too large Load Diff

View File

@ -456,7 +456,7 @@ async function getStatus() {
const hordeStatus = await checkHordeStatus(); const hordeStatus = await checkHordeStatus();
online_status = hordeStatus ? 'Connected' : 'no_connection'; online_status = hordeStatus ? 'Connected' : 'no_connection';
resultCheckStatus(); resultCheckStatus();
if (online_status !== "no_connection") { if (online_status !== "no_connection") {
getStatusDebounced(); getStatusDebounced();
} }
@ -826,12 +826,12 @@ function messageFormating(mes, ch_name, isSystem, forceAvatar) {
mes = converter.makeHtml(mes); mes = converter.makeHtml(mes);
//mes = mes.replace(/{.*}/g, ""); //mes = mes.replace(/{.*}/g, "");
mes = mes.replace(/{{(\*?.+?\*?)}}/g, ""); mes = mes.replace(/{{(\*?.+?\*?)}}/g, "");
mes = mes.replace(/\n/g, "<br/>"); mes = mes.replace(/\n/g, "<br/>");
mes = mes.trim(); mes = mes.trim();
mes = mes.replace(/<code>[\s\S]*?<\/code>/g, function(match) { mes = mes.replace(/<code>[\s\S]*?<\/code>/g, function (match) {
return match.replace(/&amp;/g, '&'); return match.replace(/&amp;/g, '&');
}); });
} }
@ -1649,7 +1649,7 @@ async function Generate(type, automatic_trigger, force_name2) {
'seed': textgenerationwebui_settings.seed, 'seed': textgenerationwebui_settings.seed,
} }
]; ];
generate_data = { "data": [ JSON.stringify(data) ]}; generate_data = { "data": [JSON.stringify(data)] };
} }
if (main_api == 'novel') { if (main_api == 'novel') {
@ -1964,8 +1964,8 @@ async function saveChat(chat_name) {
chat[i].mes = str; chat[i].mes = str;
chat[i].name = default_user_name; chat[i].name = default_user_name;
} else if (i !== chat.length - 1 && chat[i].swipe_id !== undefined) { } else if (i !== chat.length - 1 && chat[i].swipe_id !== undefined) {
// delete chat[i].swipes; // delete chat[i].swipes;
// delete chat[i].swipe_id; // delete chat[i].swipe_id;
} }
}); });
var save_chat = [ var save_chat = [
@ -2137,7 +2137,7 @@ function changeMainAPI() {
"poe": { "poe": {
apiSettings: $("#poe_settings"), apiSettings: $("#poe_settings"),
apiConnector: $("#poe_api"), apiConnector: $("#poe_api"),
apiPresets: $(""), apiPresets: $("#poe_api-presets"),
apiRanges: $("#range_block_poe"), apiRanges: $("#range_block_poe"),
maxContextElem: $("#max_context_block"), maxContextElem: $("#max_context_block"),
amountGenElem: $("#amount_gen_block"), amountGenElem: $("#amount_gen_block"),
@ -2822,7 +2822,7 @@ function setExtensionPrompt(key, value, position, depth) {
} }
function updateChatMetadata(newValues, reset) { function updateChatMetadata(newValues, reset) {
chat_metadata = reset? { ...newValues } : { ...chat_metadata, ...newValues }; chat_metadata = reset ? { ...newValues } : { ...chat_metadata, ...newValues };
} }
function callPopup(text, type) { function callPopup(text, type) {
@ -3035,7 +3035,7 @@ function closeMessageEditor() {
function setGenerationProgress(progress) { function setGenerationProgress(progress) {
if (!progress) { if (!progress) {
$('#send_textarea').css({'background': '', 'transition': ''}); $('#send_textarea').css({ 'background': '', 'transition': '' });
} }
else { else {
$('#send_textarea').css({ $('#send_textarea').css({
@ -3068,7 +3068,7 @@ window["TavernAI"].getContext = function () {
saveChat: saveChatConditional, saveChat: saveChatConditional,
sendSystemMessage: sendSystemMessage, sendSystemMessage: sendSystemMessage,
activateSendButtons, activateSendButtons,
deactivateSendButtons, deactivateSendButtons,
saveReply, saveReply,
}; };
}; };
@ -3090,7 +3090,7 @@ $(document).ready(function () {
///// SWIPE BUTTON CLICKS /////// ///// SWIPE BUTTON CLICKS ///////
$(document).on('click', '.swipe_right', function () { //when we click swipe right button $(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(); closeMessageEditor();
} }
@ -3230,7 +3230,7 @@ $(document).ready(function () {
}); });
$(document).on('click', '.swipe_left', function () { // when we swipe left..but no generation. $(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(); closeMessageEditor();
} }
@ -3871,7 +3871,7 @@ $(document).ready(function () {
return; return;
} }
$("#api_url_text").val(value); $("#api_url_text").val(value);
api_server = value; api_server = value;
$("#api_loading").css("display", "inline-block"); $("#api_loading").css("display", "inline-block");
$("#api_button").css("display", "none"); $("#api_button").css("display", "none");
@ -4295,9 +4295,9 @@ $(document).ready(function () {
this_edit_mes_id = undefined; 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) { if (is_send_press || this_edit_mes_id <= 0) {
return; return;
} }
hideSwipeButtons(); hideSwipeButtons();
@ -4652,9 +4652,9 @@ $(document).ready(function () {
$(this).closest('.inline-drawer').find('.inline-drawer-content').slideToggle(); $(this).closest('.inline-drawer').find('.inline-drawer-content').slideToggle();
}); });
$(document).keyup(function(e) { $(document).keyup(function (e) {
if (e.key === "Escape") { if (e.key === "Escape") {
closeMessageEditor(); closeMessageEditor();
} }
}); });
}) })

View File

@ -33,7 +33,7 @@
--greyCAIbg: rgb(36, 36, 37); --greyCAIbg: rgb(36, 36, 37);
--ivory: rgb(220, 220, 210); --ivory: rgb(220, 220, 210);
--sheldWidth: 800px; --sheldWidth: 1000px;
} }
* { * {
@ -1043,9 +1043,10 @@ input[type=search]:focus::-webkit-search-cancel-button {
display: flex; display: flex;
flex: 1; flex: 1;
grid-template-columns: repeat(3, min-content); grid-template-columns: repeat(3, min-content);
grid-gap: 20px; grid-gap: 10px;
align-items: center; align-items: center;
justify-content: end; justify-content: end;
flex-wrap: wrap;
} }
#rm_info_block { #rm_info_block {
@ -1084,7 +1085,6 @@ input[type=search]:focus::-webkit-search-cancel-button {
} }
#result_info { #result_info {
margin-left: 10px;
color: var(--white30a); color: var(--white30a);
display: flex; display: flex;
} }
@ -1184,17 +1184,17 @@ input[type=search]:focus::-webkit-search-cancel-button {
.menu_button { .menu_button {
font-weight: bold; /* font-weight: bold; */
color: var(--white70); color: var(--white70);
background-color: var(--black50a); background-color: var(--black50a);
border: 1px solid var(--white30a); border: 1px solid var(--white30a);
border-radius: 10px; border-radius: 10px;
padding: 10px; padding: 5px;
width: min-content; width: min-content;
cursor: pointer; cursor: pointer;
margin: 10px 0; margin: 10px 0;
transition: 0.3s; transition: 0.3s;
font-size: 15px; /* font-size: 15px; */
} }
.menu_button:hover { .menu_button:hover {
@ -1671,10 +1671,12 @@ input[type='checkbox']:not(#nav-toggle):not(#rm_button_panel_pin):checked::after
.range-block-counter { .range-block-counter {
width: max-content; width: max-content;
display: block;
max-width: 100%;
position: relative; position: relative;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
margin-top: 10px; /* margin-top: 10px; */
font-size: 11px; font-size: 11px;
color: var(--white50a); color: var(--white50a);
} }
@ -1899,7 +1901,7 @@ input[type="range"]::-webkit-slider-thumb {
.checkbox_label { .checkbox_label {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
column-gap: 10px; column-gap: 5px;
align-items: center; align-items: center;
} }
@ -2200,6 +2202,7 @@ input[type="range"]::-webkit-slider-thumb {
width: 100%; width: 100%;
align-items: center; align-items: center;
column-gap: 10px; column-gap: 10px;
flex-wrap: wrap;
} }
.rm_group_settings { .rm_group_settings {
@ -2235,6 +2238,9 @@ input[type="range"]::-webkit-slider-thumb {
overflow: auto; overflow: auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border: 1px solid grey;
border-radius: 10px;
background-color: var(--black30a);
} }
#rm_group_buttons_expander { #rm_group_buttons_expander {
@ -2624,10 +2630,10 @@ a {
left: auto; left: auto;
padding: 0 10px; padding: 0 10px;
backdrop-filter: blur(10px); backdrop-filter: blur(10px);
background-color: var(--black60a); background-color: var(--black50a);
-webkit-backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
z-index: 3000; z-index: 3000;
white-space: nowrap; /* white-space: nowrap; */
border: 0; border: 0;
border-left: 1px solid var(--grey30a); border-left: 1px solid var(--grey30a);
border-bottom: 1px solid var(--grey30a); border-bottom: 1px solid var(--grey30a);
@ -2918,6 +2924,8 @@ label[for="extensions_autoconnect"] {
display: none; display: none;
} }
.drawer-content { .drawer-content {
background-color: var(--black50a); background-color: var(--black50a);
color: white; color: white;
@ -2939,6 +2947,28 @@ label[for="extensions_autoconnect"] {
-webkit-backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
} }
.fillRight, .fillLeft {
min-width: unset;
}
.fillLeft{
max-width: calc((100vw - var(--sheldWidth) - 2px) /2);
max-height: calc(100vh - 55px);
height: calc(100vh - 55px);
position: fixed;
top: 40px;
margin: 0;
left: 0;
right: auto;
padding: 0 10px;
border-radius: 0 0 20px 0;
box-shadow: none;
}
.width100p {
width:100%;
}
.drawer-content .text_pole { .drawer-content .text_pole {
width: 100%; width: 100%;
} }
@ -2949,13 +2979,20 @@ label[for="extensions_autoconnect"] {
.flex-container { .flex-container {
display: flex; display: flex;
gap: 20px; gap: 10px;
flex-wrap: wrap;
} }
.flexWide50p { .flexWide50p {
flex: 50%; flex: 50%;
} }
.justifyLeft {
text-align: start;
justify-content: left;
margin-left: unset;
}
.widthFreeExpand { .widthFreeExpand {
width: unset; width: unset;
} }
@ -2964,6 +3001,7 @@ label[for="extensions_autoconnect"] {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
column-gap: 10px; column-gap: 10px;
flex-wrap: wrap;
} }
#openai_api-presets>div { #openai_api-presets>div {
@ -3032,6 +3070,7 @@ label[for="extensions_autoconnect"] {
display: flex; display: flex;
justify-content: space-evenly; justify-content: space-evenly;
flex-direction: row; flex-direction: row;
flex-wrap: wrap;
} }
/* ---------- @media queries must always go at the bottom ------------*/ /* ---------- @media queries must always go at the bottom ------------*/