mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-08-28 17:21:05 +00:00
refactor: trim PR debloat and fix transformers build
Extract shared helpers for home notices, timetable subtitles, and theme images; dedupe global search, Select, and build scripts while preserving behaviour. Add @huggingface/transformers as a direct dependency and resolve ORT WASM paths via require.resolve so pnpm postinstall and Vite can bundle vector search. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -29,6 +29,7 @@ class AnimatedBackgroundPluginClass extends BasePlugin<typeof settings> {
|
||||
}
|
||||
|
||||
const instance = new AnimatedBackgroundPluginClass();
|
||||
const resync = (api: PluginAPI<typeof settings>) => () => void syncAnimatedBackground(api);
|
||||
|
||||
const animatedBackgroundPlugin: Plugin<typeof settings> = {
|
||||
id: "animated-background",
|
||||
@@ -43,23 +44,15 @@ const animatedBackgroundPlugin: Plugin<typeof settings> = {
|
||||
await syncAnimatedBackground(api);
|
||||
|
||||
const speedUnregister = api.settings.onChange("speed", updateAnimationSpeed);
|
||||
|
||||
const pageChangeUnregister = api.seqta.onPageChange(() => {
|
||||
void syncAnimatedBackground(api);
|
||||
});
|
||||
|
||||
const pageChangeUnregister = api.seqta.onPageChange(resync(api));
|
||||
const pageshowHandler = (event: PageTransitionEvent) => {
|
||||
if (event.persisted) void syncAnimatedBackground(api);
|
||||
};
|
||||
window.addEventListener("pageshow", pageshowHandler);
|
||||
|
||||
const containerObserver = new MutationObserver(() => {
|
||||
void syncAnimatedBackground(api);
|
||||
});
|
||||
const containerObserver = new MutationObserver(resync(api));
|
||||
const container = document.getElementById("container");
|
||||
if (container) {
|
||||
containerObserver.observe(container, { childList: true });
|
||||
}
|
||||
if (container) containerObserver.observe(container, { childList: true });
|
||||
|
||||
return () => {
|
||||
speedUnregister.unregister();
|
||||
|
||||
Reference in New Issue
Block a user