PageSourceSearch

https://premierradio.ng/wp-content/themes/morenews-pro/assets/js-toggle-script.js?ver=4.7.0

js premierradio.ng collected 2026-10-02 21:52:50 UTC 1,372 bytes, 38 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function() {
2    const cookieName = window.AFTSiteModeCookie || "morenews-stored-site-mode";
3
4    // Apply saved mode from localStorage on page load
5    const savedMode = localStorage.getItem(cookieName);
6    if (savedMode) {
7        document.body.classList.remove("aft-dark-mode","aft-default-mode");
8        document.body.classList.add(savedMode);
9
10        // Sync cookie
11        document.cookie = cookieName + "=" + savedMode + "; path=/; max-age=" + (7*24*60*60) + "; SameSite=Lax";
12    }
13
14    // Toggle button
15    const btn = document.getElementById("aft-dark-light-mode-btn");
16    if (!btn) return;
17
18    function applyMode(mode) {
19        document.body.classList.remove("aft-dark-mode","aft-default-mode");
20        document.body.classList.add(mode);
21
22        btn.classList.remove("aft-dark-mode","aft-default-mode");
23        btn.classList.add(mode);
24
25        btn.dataset.siteMode = mode;
26    }
27
28    btn.addEventListener("click", function(e){
29        e.preventDefault();
30        let current = btn.dataset.siteMode || "aft-default-mode";
31        let next = (current === "aft-dark-mode") ? "aft-default-mode" : "aft-dark-mode";
32
33        document.cookie = cookieName + "=" + next + "; path=/; max-age=" + (7*24*60*60) + "; SameSite=Lax";
34        localStorage.setItem(cookieName, next);
35
36        applyMode(next);
37    });
38});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.