Initialize world info during app startup Moves world info event binding from jQuery document-ready handler to explicit initialization function for better control flow Ensures world info setup occurs after core dependencies are loaded
| @@ -50,6 +50,7 @@ import { | |||
| 50 | importWorldInfo, | 50 | importWorldInfo, |
| 51 | wi_anchor_position, | 51 | wi_anchor_position, |
| 52 | world_info_include_names, | 52 | world_info_include_names, |
| 53 | initWorldInfo, | ||
| 53 | } from './scripts/world-info.js'; | 54 | } from './scripts/world-info.js'; |
| 54 | 55 | ||
| 55 | import { | 56 | import { |
| @@ -992,6 +993,7 @@ async function firstLoadInit() { | |||
| 992 | initBackgrounds(); | 993 | initBackgrounds(); |
| 993 | initAuthorsNote(); | 994 | initAuthorsNote(); |
| 994 | await initPersonas(); | 995 | await initPersonas(); |
| 996 | initWorldInfo(); | ||
| 995 | initRossMods(); | 997 | initRossMods(); |
| 996 | initStats(); | 998 | initStats(); |
| 997 | initCfg(); | 999 | initCfg(); |
| @@ -5160,8 +5160,7 @@ export async function assignLorebookToChat(event) { | |||
| 5160 | return callGenericPopup(template, POPUP_TYPE.TEXT); | 5160 | return callGenericPopup(template, POPUP_TYPE.TEXT); |
| 5161 | } | 5161 | } |
| 5162 | 5162 | ||
| 5163 | jQuery(() => { | 5163 | export function initWorldInfo() { |
| 5164 | |||
| 5165 | $('#world_info').on('mousedown change', async function (e) { | 5164 | $('#world_info').on('mousedown change', async function (e) { |
| 5166 | // If there's no world names, don't do anything | 5165 | // If there's no world names, don't do anything |
| 5167 | if (world_names.length === 0) { | 5166 | if (world_names.length === 0) { |
| @@ -5373,7 +5372,7 @@ jQuery(() => { | |||
| 5373 | } | 5372 | } |
| 5374 | }); | 5373 | }); |
| 5375 | }); | 5374 | }); |
| 5376 | }); | 5375 | } |
| 5377 | 5376 | ||
| 5378 | /** | 5377 | /** |
| 5379 | * Moves a World Info entry from a source lorebook to a target lorebook. | 5378 | * Moves a World Info entry from a source lorebook to a target lorebook. |