refactor: establish standalone application boundary

This commit is contained in:
leefer
2026-08-03 21:42:25 +08:00
parent cc5fb8d73e
commit e1e76cd51e
324 changed files with 63090 additions and 44743 deletions
+13 -2
View File
@@ -1,8 +1,8 @@
window.XiaobaiPageModules.register("themes", ["themeLibraryView"], {
bind: bindThemeLibraryEvents,
enter: ["loadThemes"],
});
/* PRESERVATION-SOURCE-BEGIN app.js:2482-2583 */
async function loadThemeLibrary(force = false) {
if (state.themeLoading) return;
state.themeLoading = true;
@@ -105,4 +105,15 @@ function renderThemeDetail() {
renderThemeDirectory();
}
/* PRESERVATION-SOURCE-END app.js:2482-2583 */
function bindThemeLibraryEvents() {
document.querySelector("#themeRefreshButton").addEventListener("click", () => loadThemeLibrary(true));
document.querySelector("#themeSearch").addEventListener("input", (event) => {
state.themeQuery = event.target.value.trim().toLocaleLowerCase("zh-CN");
renderThemeDirectory();
});
document.querySelector("#themeDirectory").addEventListener("click", (event) => {
const button = event.target.closest("[data-theme-code]");
if (button) selectTheme(button.dataset.themeCode);
});
}