mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'dev' of https://github.com/SillyLossy/TavernAI into dev
This commit is contained in:
7
public/css/bright.min.css
vendored
Normal file
7
public/css/bright.min.css
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/*!
|
||||||
|
Theme: Bright
|
||||||
|
Author: Chris Kempson (http://chriskempson.com)
|
||||||
|
License: ~ MIT (or more permissive) [via base16-schemes-source]
|
||||||
|
Maintainer: @highlightjs/core-team
|
||||||
|
Version: 2021.09.0
|
||||||
|
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#e0e0e0;background:#000}.hljs ::selection,.hljs::selection{background-color:#505050;color:#e0e0e0}.hljs-comment{color:#b0b0b0}.hljs-tag{color:#d0d0d0}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#e0e0e0}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#fb0120}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#fc6d24}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fda331}.hljs-strong{font-weight:700;color:#fda331}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#a1c659}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#76c7b7}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#6fb3d2}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#d381c3}.hljs-emphasis{color:#d381c3;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#be643c}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}
|
@ -12,6 +12,7 @@
|
|||||||
<link href="css/fontawesome.css" rel="stylesheet">
|
<link href="css/fontawesome.css" rel="stylesheet">
|
||||||
<link href="css/solid.css" rel="stylesheet">
|
<link href="css/solid.css" rel="stylesheet">
|
||||||
<link href="css/jquery-ui.min.css" rel="stylesheet">
|
<link href="css/jquery-ui.min.css" rel="stylesheet">
|
||||||
|
<link href="css/bright.min.css" rel="stylesheet">
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="57x57" href="img/apple-icon-57x57.png" />
|
<link rel="apple-touch-icon" sizes="57x57" href="img/apple-icon-57x57.png" />
|
||||||
<link rel="apple-touch-icon" sizes="72x72" href="img/apple-icon-72x72.png" />
|
<link rel="apple-touch-icon" sizes="72x72" href="img/apple-icon-72x72.png" />
|
||||||
@ -32,8 +33,10 @@
|
|||||||
<script src="scripts/jquery.transit.min.js"></script>
|
<script src="scripts/jquery.transit.min.js"></script>
|
||||||
<script src="scripts/jquery-cookie-1.4.1.min.js"></script>
|
<script src="scripts/jquery-cookie-1.4.1.min.js"></script>
|
||||||
<script src="scripts/showdown.min.js"></script>
|
<script src="scripts/showdown.min.js"></script>
|
||||||
|
<script src="scripts/showdown-katex.min.js"></script>
|
||||||
<script src="scripts/popper.js"></script>
|
<script src="scripts/popper.js"></script>
|
||||||
<script src="scripts/purify.min.js"></script>
|
<script src="scripts/purify.min.js"></script>
|
||||||
|
<script src="scripts/highlight.min.js"></script>
|
||||||
<script type="module" src="scripts/power-user.js"></script>
|
<script type="module" src="scripts/power-user.js"></script>
|
||||||
<script type="module" src="scripts/swiped-events.js"></script>
|
<script type="module" src="scripts/swiped-events.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="style.css">
|
<link rel="stylesheet" type="text/css" href="style.css">
|
||||||
|
@ -164,8 +164,21 @@ export {
|
|||||||
// API OBJECT FOR EXTERNAL WIRING
|
// API OBJECT FOR EXTERNAL WIRING
|
||||||
window["SillyTavern"] = {};
|
window["SillyTavern"] = {};
|
||||||
|
|
||||||
let converter = new showdown.Converter({ emoji: "true" });
|
|
||||||
const gpt3 = new GPT3BrowserTokenizer({ type: 'gpt3' });
|
const gpt3 = new GPT3BrowserTokenizer({ type: 'gpt3' });
|
||||||
|
hljs.addPlugin({"before:highlightElement": ({ el }) => { el.textContent = el.innerText } });
|
||||||
|
let converter = new showdown.Converter({
|
||||||
|
emoji: "true",
|
||||||
|
underline: "true",
|
||||||
|
extensions: [
|
||||||
|
showdownKatex(
|
||||||
|
{
|
||||||
|
delimiters: [
|
||||||
|
{ left: '$$', right: '$$', display: true, asciimath: false },
|
||||||
|
{ left: '$', right: '$', display: false, asciimath: true },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
)],
|
||||||
|
});
|
||||||
/* let bg_menu_toggle = false; */
|
/* let bg_menu_toggle = false; */
|
||||||
const systemUserName = "SillyTavern System";
|
const systemUserName = "SillyTavern System";
|
||||||
let default_user_name = "You";
|
let default_user_name = "You";
|
||||||
@ -901,8 +914,9 @@ function messageFormating(mes, ch_name, isSystem, forceAvatar) {
|
|||||||
return match;
|
return match;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
mes = mes.replaceAll('\\begin{align*}', '$$');
|
||||||
|
mes = mes.replaceAll('\\end{align*}', '$$');
|
||||||
mes = converter.makeHtml(mes);
|
mes = converter.makeHtml(mes);
|
||||||
//mes = mes.replace(/{.*}/g, "");
|
|
||||||
mes = mes.replace(/{{(\*?.+?\*?)}}/g, "");
|
mes = mes.replace(/{{(\*?.+?\*?)}}/g, "");
|
||||||
|
|
||||||
mes = mes.replace(/\n/g, "<br/>");
|
mes = mes.replace(/\n/g, "<br/>");
|
||||||
@ -961,6 +975,7 @@ function addCopyToCodeBlocks(messageElement) {
|
|||||||
document.body.removeChild(copiedMsg);
|
document.body.removeChild(copiedMsg);
|
||||||
}, 2500);
|
}, 2500);
|
||||||
});
|
});
|
||||||
|
hljs.highlightElement(codeBlocks.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1286,6 +1301,7 @@ class StreamingProcessor {
|
|||||||
onFinishStreaming(messageId, text) {
|
onFinishStreaming(messageId, text) {
|
||||||
this.hideStopButton(this.messageId);
|
this.hideStopButton(this.messageId);
|
||||||
this.onProgressStreaming(messageId, text);
|
this.onProgressStreaming(messageId, text);
|
||||||
|
addCopyToCodeBlocks($(`#chat .mes[mesid="${messageId}"]`));
|
||||||
playMessageSound();
|
playMessageSound();
|
||||||
saveChatConditional();
|
saveChatConditional();
|
||||||
activateSendButtons();
|
activateSendButtons();
|
||||||
|
1361
public/scripts/highlight.min.js
vendored
Normal file
1361
public/scripts/highlight.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
36
public/scripts/showdown-katex.min.js
vendored
Normal file
36
public/scripts/showdown-katex.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/scripts/showdown-katex.min.js.map
Normal file
1
public/scripts/showdown-katex.min.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -226,6 +226,8 @@ function onTagRemoveClick(event) {
|
|||||||
const tagId = tag.attr("id");
|
const tagId = tag.attr("id");
|
||||||
tag.remove();
|
tag.remove();
|
||||||
removeTagFromMap(tagId);
|
removeTagFromMap(tagId);
|
||||||
|
$(`${getInlineListSelector()} .tag[id="${tagId}"]`).remove();
|
||||||
|
|
||||||
printTags();
|
printTags();
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
}
|
}
|
||||||
|
@ -3575,6 +3575,10 @@ body.noShadows * {
|
|||||||
text-shadow: none !important;
|
text-shadow: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.katex-html {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
/* ---------- @media queries must always go at the bottom ------------*/
|
/* ---------- @media queries must always go at the bottom ------------*/
|
||||||
|
|
||||||
/*will apply to anything 1000px or less. this catches ipads, horizontal phones, and vertical phones)*/
|
/*will apply to anything 1000px or less. this catches ipads, horizontal phones, and vertical phones)*/
|
||||||
|
Reference in New Issue
Block a user