Use init function
| @@ -244,6 +244,7 @@ import { SlashCommandEnumValue, enumTypes } from './scripts/slash-commands/Slash | |||
| 244 | import { commonEnumProviders, enumIcons } from './scripts/slash-commands/SlashCommandCommonEnumsProvider.js'; | 244 | import { commonEnumProviders, enumIcons } from './scripts/slash-commands/SlashCommandCommonEnumsProvider.js'; |
| 245 | import { initInputMarkdown } from './scripts/input-md-formatting.js'; | 245 | import { initInputMarkdown } from './scripts/input-md-formatting.js'; |
| 246 | import { AbortReason } from './scripts/util/AbortReason.js'; | 246 | import { AbortReason } from './scripts/util/AbortReason.js'; |
| 247 | import { initSystemPrompts } from './scripts/sysprompt.js'; | ||
| 247 | 248 | ||
| 248 | //exporting functions and vars for mods | 249 | //exporting functions and vars for mods |
| 249 | export { | 250 | export { |
| @@ -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); |
| @@ -137,7 +137,7 @@ function selectSystemPromptCallback(args, name) { | |||
| 137 | return foundName; | 137 | return foundName; |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | jQuery(function () { | 140 | export 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 | } |