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:
@ -3002,10 +3002,6 @@
|
|||||||
<i class="fa-lg fa-solid fa-bookmark"></i>
|
<i class="fa-lg fa-solid fa-bookmark"></i>
|
||||||
<span data-i18n="Save bookmark">Save bookmark</span>
|
<span data-i18n="Save bookmark">Save bookmark</span>
|
||||||
</a>
|
</a>
|
||||||
<a id="option_toggle_AN">
|
|
||||||
<i class="fa-lg fa-solid fa-note-sticky"></i>
|
|
||||||
<span data-i18n="Author's Note">Author's Note</span>
|
|
||||||
</a>
|
|
||||||
<a id="option_convert_to_group">
|
<a id="option_convert_to_group">
|
||||||
<i class="fa-lg fa-solid fa-people-arrows"></i>
|
<i class="fa-lg fa-solid fa-people-arrows"></i>
|
||||||
<span data-i18n="Convert to group">Convert to group</span>
|
<span data-i18n="Convert to group">Convert to group</span>
|
||||||
|
@ -6235,36 +6235,6 @@ $(document).ready(function () {
|
|||||||
$("#options [id]").on("click", function () {
|
$("#options [id]").on("click", function () {
|
||||||
var id = $(this).attr("id");
|
var id = $(this).attr("id");
|
||||||
|
|
||||||
if (id == "option_toggle_AN") {
|
|
||||||
if (selected_group || this_chid) {
|
|
||||||
if ($("#floatingPrompt").css("display") !== 'flex') {
|
|
||||||
$("#floatingPrompt").css("display", "flex");
|
|
||||||
$("#floatingPrompt").css("opacity", 0.0);
|
|
||||||
$("#floatingPrompt").transition({
|
|
||||||
opacity: 1.0,
|
|
||||||
duration: 250,
|
|
||||||
easing: animation_easing,
|
|
||||||
});
|
|
||||||
|
|
||||||
if ($("#ANBlockToggle")
|
|
||||||
.siblings('.inline-drawer-content')
|
|
||||||
.css('display') !== 'block') {
|
|
||||||
$("#ANBlockToggle").click();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$("#floatingPrompt").transition({
|
|
||||||
opacity: 0.0,
|
|
||||||
duration: 250,
|
|
||||||
easing: animation_easing,
|
|
||||||
});
|
|
||||||
setTimeout(function () {
|
|
||||||
$("#floatingPrompt").hide();
|
|
||||||
}, 250);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id == "option_select_chat") {
|
if (id == "option_select_chat") {
|
||||||
if ((selected_group && !is_group_generating) || (this_chid !== undefined && !is_send_press)) {
|
if ((selected_group && !is_group_generating) || (this_chid !== undefined && !is_send_press)) {
|
||||||
displayPastChats();
|
displayPastChats();
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { chat_metadata, saveSettingsDebounced } from "../../../script.js";
|
import { chat_metadata, saveSettingsDebounced, this_chid } from "../../../script.js";
|
||||||
|
import { selected_group } from "../../group-chats.js";
|
||||||
import { ModuleWorkerWrapper, extension_settings, getContext, saveMetadataDebounced } from "../../extensions.js";
|
import { ModuleWorkerWrapper, extension_settings, getContext, saveMetadataDebounced } from "../../extensions.js";
|
||||||
import { registerSlashCommand } from "../../slash-commands.js";
|
import { registerSlashCommand } from "../../slash-commands.js";
|
||||||
export { MODULE_NAME };
|
export { MODULE_NAME };
|
||||||
@ -139,6 +140,36 @@ async function moduleWorker() {
|
|||||||
$('#extension_floating_counter').text(shouldAddPrompt ? '0' : messagesTillInsertion);
|
$('#extension_floating_counter').text(shouldAddPrompt ? '0' : messagesTillInsertion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onANMenuItemClick() {
|
||||||
|
if (selected_group || this_chid) {
|
||||||
|
if ($("#floatingPrompt").css("display") !== 'flex') {
|
||||||
|
$("#floatingPrompt").css("display", "flex");
|
||||||
|
$("#floatingPrompt").css("opacity", 0.0);
|
||||||
|
$("#floatingPrompt").transition({
|
||||||
|
opacity: 1.0,
|
||||||
|
duration: 250,
|
||||||
|
});
|
||||||
|
|
||||||
|
if ($("#ANBlockToggle")
|
||||||
|
.siblings('.inline-drawer-content')
|
||||||
|
.css('display') !== 'block') {
|
||||||
|
$("#ANBlockToggle").click();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$("#floatingPrompt").transition({
|
||||||
|
opacity: 0.0,
|
||||||
|
duration: 250,
|
||||||
|
});
|
||||||
|
setTimeout(function () {
|
||||||
|
$("#floatingPrompt").hide();
|
||||||
|
}, 250);
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
toastr.warning(`Select a character before trying to use Author's Note`, '', { timeOut: 2000 });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
function addExtensionsSettings() {
|
function addExtensionsSettings() {
|
||||||
const settingsHtml = `
|
const settingsHtml = `
|
||||||
@ -200,6 +231,13 @@ async function moduleWorker() {
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const ANButtonHtml = `
|
||||||
|
<a id="option_toggle_AN">
|
||||||
|
<i class="fa-lg fa-solid fa-note-sticky"></i>
|
||||||
|
<span data-i18n="Author's Note">Author's Note</span>
|
||||||
|
</a>
|
||||||
|
`;
|
||||||
|
$('.options-content').prepend(ANButtonHtml);
|
||||||
$('#movingDivs').append(settingsHtml);
|
$('#movingDivs').append(settingsHtml);
|
||||||
$('#extension_floating_prompt').on('input', onExtensionFloatingPromptInput);
|
$('#extension_floating_prompt').on('input', onExtensionFloatingPromptInput);
|
||||||
$('#extension_floating_interval').on('input', onExtensionFloatingIntervalInput);
|
$('#extension_floating_interval').on('input', onExtensionFloatingIntervalInput);
|
||||||
@ -214,6 +252,7 @@ async function moduleWorker() {
|
|||||||
});
|
});
|
||||||
setTimeout(function () { $('#floatingPrompt').hide() }, 200);
|
setTimeout(function () { $('#floatingPrompt').hide() }, 200);
|
||||||
})
|
})
|
||||||
|
$("#option_toggle_AN").on('click', onANMenuItemClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
addExtensionsSettings();
|
addExtensionsSettings();
|
||||||
|
Reference in New Issue
Block a user