From 1dd3be947921e23f575b32dafb43f2d8e6559280 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Thu, 19 Sep 2024 23:59:58 +0300 Subject: [PATCH] Use init function --- public/script.js | 2 ++ public/scripts/sysprompt.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/script.js b/public/script.js index 7f40fe39b..871d6a40a 100644 --- a/public/script.js +++ b/public/script.js @@ -244,6 +244,7 @@ import { SlashCommandEnumValue, enumTypes } from './scripts/slash-commands/Slash import { commonEnumProviders, enumIcons } from './scripts/slash-commands/SlashCommandCommonEnumsProvider.js'; import { initInputMarkdown } from './scripts/input-md-formatting.js'; import { AbortReason } from './scripts/util/AbortReason.js'; +import { initSystemPrompts } from './scripts/sysprompt.js'; //exporting functions and vars for mods export { @@ -932,6 +933,7 @@ async function firstLoadInit() { initLocales(); initDefaultSlashCommands(); initTextGenModels(); + initSystemPrompts(); await getSystemMessages(); sendSystemMessage(system_message_types.WELCOME); sendSystemMessage(system_message_types.WELCOME_PROMPT); diff --git a/public/scripts/sysprompt.js b/public/scripts/sysprompt.js index d28a152a6..9d298beef 100644 --- a/public/scripts/sysprompt.js +++ b/public/scripts/sysprompt.js @@ -137,7 +137,7 @@ function selectSystemPromptCallback(args, name) { return foundName; } -jQuery(function () { +export function initSystemPrompts() { $enabled.on('input', function () { power_user.sysprompt.enabled = !!$(this).prop('checked'); toggleSystemPromptDisabledControls(); @@ -236,4 +236,4 @@ jQuery(function () { ], callback: toggleSystemPromptCallback, })); -}); +}