Merge pull request #3744 from bmen25124/updateEditor_export_new_parm Exported reloadEditor

a8f1bf7a17e69f6cbbf325f3dc2d0c4b9b96293b

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

Signed
2 files changed, +4 -3Showing whitespace changes
public/scripts/st-context.js+2 -1
@@ -79,7 +79,7 @@ import { ToolManager } from './tool-calling.js';
7979import { accountStorage } from './util/AccountStorage.js';
8080import { timestampToMoment, uuidv4 } from './utils.js';
8181import { getGlobalVariable, getLocalVariable, setGlobalVariable, setLocalVariable } from './variables.js';
8282import { convertCharacterBook, getWorldInfoPrompt, loadWorldInfo, reloadEditor, saveWorldInfo, updateWorldInfoList } from './world-info.js';
8383import { ChatCompletionService, TextCompletionService } from './custom-request.js';
8484import { ConnectionManagerRequestService } from './extensions/shared.js';
8585import { updateReasoningUI, parseReasoningFromString } from './reasoning.js';
@@ -207,6 +207,7 @@ export function getContext() {
207207 },
208208 loadWorldInfo,
209209 saveWorldInfo,
210+ reloadWorldInfoEditor: reloadEditor,
210211 updateWorldInfoList,
211212 convertCharacterBook,
212213 getWorldInfoPrompt,
public/scripts/world-info.js+2 -2
@@ -908,13 +908,12 @@ export function setWorldInfoSettings(settings, data) {
908908 registerWorldInfoSlashCommands();
909909}
910910
911-function registerWorldInfoSlashCommands() {
912911/**
913912 * Reloads the editor with the specified world info file
914913 * @param {string} file - The file to load in the editor
915914 * @param {boolean} [loadIfNotSelected=false] - Indicates whether to load the file even if it's not currently selected
916915 */
917916 export function reloadEditor(file, loadIfNotSelected = false) {
918917 const currentIndex = Number($('#world_editor_select').val());
919918 const selectedIndex = world_names.indexOf(file);
920919 if (selectedIndex !== -1 && (loadIfNotSelected || currentIndex === selectedIndex)) {
@@ -922,6 +921,7 @@ function registerWorldInfoSlashCommands() {
922921 }
923922}
924923
924+function registerWorldInfoSlashCommands() {
925925 /**
926926 * Gets a *rough* approximation of the current chat context.
927927 * Normally, it is provided externally by the prompt builder.