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