Hide extension settings to drawers

This commit is contained in:
SillyLossy
2023-04-14 14:44:39 +03:00
parent 2bc63ec839
commit c126f15291
5 changed files with 59 additions and 34 deletions

View File

@ -194,19 +194,20 @@ async function getExpressionsList() {
async function setExpression(character, expression, force) {
const filename = `${expression}.png`;
const debugImageStatus = document.querySelector(`#image_list div[id="${filename}"] span`);
const img = $('img.expression');
if (force || (debugImageStatus && !debugImageStatus.classList.contains('failure'))) {
//console.log('setting expression from character images folder');
const imgUrl = `/characters/${character}/${filename}`;
$('img.expression').prop('src', imgUrl);
$('img.expression').removeClass('default');
img.attr('src', imgUrl);
img.removeClass('default');
} else {
if (extension_settings.expressions.showDefault) {
//console.log('no character images, trying default expressions');
const defImgUrl = `/img/default-expressions/${filename}`;
//console.log(defImgUrl);
$('img.expression').prop('src', defImgUrl);
$('img.expression').addClass('default');
img.attr('src', defImgUrl);
img.addClass('default');
}
}
}
@ -233,20 +234,19 @@ function onClickExpressionImage() {
function addSettings() {
const html = `
<div class="expression_settings">
<h4>Expression images</h4>
<div class="inline-drawer">
<div class="inline-drawer-toggle inline-drawer-header">
<b>View supported images</b>
<b>Expression images</b>
<div class="inline-drawer-icon fa-solid fa-circle-chevron-down down"></div>
</div>
<div class="inline-drawer-content">
<p class="offline_mode">You are in offline mode. Click on the image below to set the expression.</p>
<div id="image_list"></div>
<p class="hint"><b>Hint:</b> <i>Create new folder in the <b>public/characters/</b> folder and name it as the name of the character. Put PNG images with expressions there.</i></p>
</div>
</div>
<label for="expressions_show_default"><input id="expressions_show_default" type="checkbox">Show default images (emojis) if missing</label>
</div>
</div>
</div>
`;
$('#extensions_settings').append(html);
$('#expressions_show_default').on('input', onExpressionsShowDefaultInput);

View File

@ -98,10 +98,16 @@ async function moduleWorker() {
(function () {
function addExtensionsSettings() {
const settingsHtml = `
<h4>Author's Note / Character Bias</h4>
<div class="floating_prompt_settings">
<div class="inline-drawer">
<div class="inline-drawer-toggle inline-drawer-header">
<b>Author's Note / Character Bias</b>
<div class="inline-drawer-icon fa-solid fa-circle-chevron-down down"></div>
</div>
<div class="inline-drawer-content">
<label for="extension_floating_prompt">Append the following text:</label>
<textarea id="extension_floating_prompt" class="text_pole" rows="8"></textarea>
<div class="floating_prompt_radio_group">
<label>
<input type="radio" name="extension_floating_position" value="0" />
After scenario
@ -110,12 +116,14 @@ async function moduleWorker() {
<input type="radio" name="extension_floating_position" value="1" />
In-chat
</label>
</div>
<label for="extension_floating_interval">Every N messages <b>you</b> send (set to 0 to disable):</label>
<input id="extension_floating_interval" class="text_pole" type="number" min="0" max="999" />
<label for="extension_floating_interval">Insertion depth (for in-chat positioning):</label>
<input id="extension_floating_depth" class="text_pole" type="number" min="0" max="99" />
<span>Appending to the prompt in next: <span id="extension_floating_counter">No</span> message(s)</span>
<br>
</div>
</div>
<div class="inline-drawer">
<div class="inline-drawer-toggle inline-drawer-header">
<b>Default note for new chats</b>

View File

@ -7,3 +7,13 @@
font-weight: 600;
color: orange;
}
.floating_prompt_settings textarea {
font-size: calc(var(--mainFontSize) * 0.9);
line-height: 1.2;
}
.floating_prompt_radio_group {
display: flex;
flex-direction: column;
}

View File

@ -234,7 +234,7 @@ async function summarizeChat(context) {
body: JSON.stringify({
text: resultingString,
params: {
min_length: extension_settings.memory.longMemoryLength * 0.8,
min_length: extension_settings.memory.longMemoryLength * 0, // testing how it behaves 0 min length
max_length: extension_settings.memory.longMemoryLength,
repetition_penalty: extension_settings.memory.repetitionPenalty,
temperature: extension_settings.memory.temperature,
@ -307,16 +307,23 @@ $(document).ready(function () {
function addExtensionControls() {
const settingsHtml = `
<div id="memory_settings">
<h4>Memory</h4>
<div class="inline-drawer">
<div class="inline-drawer-toggle inline-drawer-header">
<b>Chat memory</b>
<div class="inline-drawer-icon fa-solid fa-circle-chevron-down down"></div>
</div>
<div class="inline-drawer-content">
<label for="memory_contents">Memory contents</label>
<textarea id="memory_contents" class="text_pole" rows="8" placeholder="Context will be generated here..."></textarea>
<div class="memory_contents_controls">
<input id="memory_restore" class="menu_button" type="submit" value="Restore previous state" />
<label for="memory_frozen"><input id="memory_frozen" type="checkbox" /> Freeze context</label>
</div>
</div>
</div>
<div class="inline-drawer">
<div class="inline-drawer-toggle inline-drawer-header">
<b>Summarization settings</b>
<b>Summarization parameters</b>
<div class="inline-drawer-icon fa-solid fa-circle-chevron-down down"></div>
</div>
<div class="inline-drawer-content">

View File

@ -4,7 +4,7 @@
}
#memory_settings textarea {
font-size: 14px;
font-size: calc(var(--mainFontSize) * 0.9);
line-height: 1.2;
}