From f4f472e6ecdc8f88120ba360db4db77f79e6a690 Mon Sep 17 00:00:00 2001 From: CodeDevMLH <145071728+CodeDevMLH@users.noreply.github.com> Date: Tue, 24 Feb 2026 19:19:18 +0100 Subject: [PATCH] Refactor christmas.js: reorganize christmasSymbols definition and streamline observer setup --- Jellyfin.Plugin.Seasonals/Web/christmas.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Jellyfin.Plugin.Seasonals/Web/christmas.js b/Jellyfin.Plugin.Seasonals/Web/christmas.js index 079e8a5..43899a9 100644 --- a/Jellyfin.Plugin.Seasonals/Web/christmas.js +++ b/Jellyfin.Plugin.Seasonals/Web/christmas.js @@ -6,6 +6,8 @@ const randomChristmasMobile = config.EnableRandomChristmasMobile !== undefined ? const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different duration for the random Christmas symbols const christmasCount = config.SymbolCount || 25; // count of random extra christmas +// Array of christmas characters +const christmasSymbols = ['❆', '🎁', '❄️', '🎁', '🎅', '🎊', '🎁', '🎉']; let msgPrinted = false; // flag to prevent multiple console messages @@ -37,17 +39,12 @@ function toggleChristmas() { // observe changes in the DOM const observer = new MutationObserver(toggleChristmas); - -// start observation observer.observe(document.body, { - childList: true, // observe adding/removing of child elements - subtree: true, // observe all levels of the DOM tree - attributes: true // observe changes to attributes (e.g. class changes) + childList: true, + subtree: true, + attributes: true }); -// Array of christmas characters -const christmasSymbols = ['❆', '🎁', '❄️', '🎁', '🎅', '🎊', '🎁', '🎉']; - function addRandomChristmas(count) { const christmasContainer = document.querySelector('.christmas-container'); // get the christmas container if (!christmasContainer) return; // exit if christmas container is not found