Use init function

1dd3be947921e23f575b32dafb43f2d8e6559280

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +4 -2Ignore whitespace
public/script.js+2 -0
@@ -244,6 +244,7 @@ import { SlashCommandEnumValue, enumTypes } from './scripts/slash-commands/Slash
244import { commonEnumProviders, enumIcons } from './scripts/slash-commands/SlashCommandCommonEnumsProvider.js';244import { commonEnumProviders, enumIcons } from './scripts/slash-commands/SlashCommandCommonEnumsProvider.js';
245import { initInputMarkdown } from './scripts/input-md-formatting.js';245import { initInputMarkdown } from './scripts/input-md-formatting.js';
246import { AbortReason } from './scripts/util/AbortReason.js';246import { AbortReason } from './scripts/util/AbortReason.js';
247import { initSystemPrompts } from './scripts/sysprompt.js';
247248
248//exporting functions and vars for mods249//exporting functions and vars for mods
249export {250export {
@@ -932,6 +933,7 @@ async function firstLoadInit() {
932 initLocales();933 initLocales();
933 initDefaultSlashCommands();934 initDefaultSlashCommands();
934 initTextGenModels();935 initTextGenModels();
936 initSystemPrompts();
935 await getSystemMessages();937 await getSystemMessages();
936 sendSystemMessage(system_message_types.WELCOME);938 sendSystemMessage(system_message_types.WELCOME);
937 sendSystemMessage(system_message_types.WELCOME_PROMPT);939 sendSystemMessage(system_message_types.WELCOME_PROMPT);
public/scripts/sysprompt.js+2 -2
@@ -137,7 +137,7 @@ function selectSystemPromptCallback(args, name) {
137 return foundName;137 return foundName;
138}138}
139139
140jQuery(function () {140export function initSystemPrompts() {
141 $enabled.on('input', function () {141 $enabled.on('input', function () {
142 power_user.sysprompt.enabled = !!$(this).prop('checked');142 power_user.sysprompt.enabled = !!$(this).prop('checked');
143 toggleSystemPromptDisabledControls();143 toggleSystemPromptDisabledControls();
@@ -236,4 +236,4 @@ jQuery(function () {
236 ],236 ],
237 callback: toggleSystemPromptCallback,237 callback: toggleSystemPromptCallback,
238 }));238 }));
239});239}