PageSourceSearch

https://hadarat.net/assets/js/main.js?v=04ccd6df96a7

js hadarat.net collected 2026-10-04 23:37:04 UTC 15,070 bytes, 379 lines download raw bytes

1!function (e) {
2    "use strict";
3
4    function o() {
5        e(".newsletter-form").addClass("animated shake"), setTimeout(function () {
6            e(".newsletter-form").removeClass("animated shake")
7        }, 1e3)
8    }
9
10    function s(o, s) {
11        if (o) var t = "validation-success"; else t = "validation-danger";
12        e("#validator-newsletter").removeClass().addClass(t).text(s)
13    }
14
15    function bindPostImageCarouselNav($carousel) {
16        var owl = $carousel.data("owl.carousel");
17        if (!owl) return;
18        var $leftBtn = $carousel.find(".owl-nav .owl-next");
19        var $rightBtn = $carousel.find(".owl-nav .owl-prev");
20        if (!$leftBtn.length || !$rightBtn.length) return;
21        $leftBtn.each(function () {
22            var $btn = e(this).clone(!1, !1);
23            e(this).replaceWith($btn);
24            $btn.on("click", function (evt) {
25                evt.preventDefault();
26                evt.stopImmediatePropagation();
27                owl.next()
28            })
29        });
30        $rightBtn.each(function () {
31            var $btn = e(this).clone(!1, !1);
32            e(this).replaceWith($btn);
33            $btn.on("click", function (evt) {
34                evt.preventDefault();
35                evt.stopImmediatePropagation();
36                owl.prev()
37            })
38        });
39        $carousel.data("postNavBound", !0)
40    }
41
42    jQuery(".mean-menu").meanmenu({
43        meanScreenWidth: "991",
44        meanRevealPosition: "left",
45        meanRevealPositionDistance: "16px",
46        meanMenuOpen: "<span></span><span></span><span></span>"
47    }), jQuery(".meanmenu-reveal").each(function () {
48        this.style.removeProperty("background");
49        this.style.removeProperty("color");
50        if (!this.getAttribute("aria-label")) {
51            this.setAttribute("aria-label", "القائمة");
52            this.setAttribute("role", "button");
53        }
54    }), jQuery(".mean-nav .mean-expand").attr("aria-label", "توسيع القائمة الفرعية"), e(window).on("scroll", function () {
55        e(this).scrollTop() > 120 ? e(".sinmun-nav").addClass("is-sticky") : e(".sinmun-nav").removeClass("is-sticky")
56    }), e.fn.magnificPopup && e(".popup-youtube").magnificPopup({
57        disableOn: 320,
58        type: "iframe",
59        mainClass: "mfp-fade",
60        removalDelay: 160,
61        preloader: !1,
62        fixedContentPos: !1
63    }), e.fn.magnificPopup && e(".popup-video-player").magnificPopup({
64        type: "inline",
65        midClick: !0,
66        mainClass: "mfp-fade video-player-mfp",
67        removalDelay: 160,
68        preloader: !1,
69        fixedContentPos: !0,
70        closeBtnInside: !0,
71        callbacks: {
72            open: function () {
73                var content = this.content && this.content[0];
74                if (!content) return;
75                if (window.FB && content.querySelector(".fb-video")) {
76                    try {
77                        window.FB.XFBML.parse(content)
78                    } catch (err) {}
79                }
80                if (window.twttr && window.twttr.widgets && content.querySelector(".twitter-video, .twitter-tweet")) {
81                    try {
82                        window.twttr.widgets.load(content)
83                    } catch (err) {}
84                }
85            }
86        }
87    }), e(".breaking-news-slides").owlCarousel({
88        loop: !0,
89        nav: !0,
90        dots: !1,
91        rtl: !0,
92        autoplayHoverPause: !0,
93        autoplay: !0,
94        animateOut: "animate__animated animate__slideOutDown",
95        animateIn: "animate__animated animate__flipInX",
96        items: 1,
97        navText: ["<i class='icofont-rounded-right'></i>", "<i class='icofont-rounded-left'></i>"]
98    }), e(".nav-search-button").on("click", function () {
99        e(".nav-search form").toggleClass("active")
100    }), e(".nav-search-close-button").on("click", function () {
101        e(".nav-search form").removeClass("active")
102    }), e(".popular-news-slides").owlCarousel({
103        loop: !0,
104        nav: !0,
105        rtl: !0,
106        dots: !1,
107        autoplayHoverPause: !0,
108        autoplay: !0,
109        margin: 30,
110        navText: ["<i class='icofont-rounded-right'></i>", "<i class='icofont-rounded-left'></i>"],
111        responsive: {0: {items: 1}, 768: {items: 2}, 1200: {items: 3}}
112    }), e(".health-lifestyle-news-slides").owlCarousel({
113        loop: !0,
114        rtl: !0,
115        nav: !0,
116        dots: !1,
117        autoplayHoverPause: !0,
118        autoplay: !0,
119        items: 1,
120        navText: ["<i class='icofont-rounded-right'></i>", "<i class='icofont-rounded-left'></i>"]
121    }), e(".politics-news-slides").owlCarousel({
122        loop: !0,
123        rtl: !0,
124        nav: !0,
125        dots: !1,
126        autoplayHoverPause: !0,
127        autoplay: !0,
128        items: 1,
129        navText: ["<i class='icofont-rounded-right'></i>", "<i class='icofont-rounded-left'></i>"]
130    }), e(".gallery-news-inner-slides").owlCarousel({
131        loop: !0,
132        rtl: !0,
133        nav: !0,
134        dots: !1,
135        autoplayHoverPause: !0,
136        autoplay: !0,
137        items: 1,
138        navText: ["<i class='icofont-rounded-right'></i>", "<i class='icofont-rounded-left'></i>"]
139    }), function () {
140        var t = {
141            loop: !0,
142            nav: !0,
143            rtl: !0,
144            dots: !1,
145            smartSpeed: 2e3,
146            autoplayHoverPause: !0,
147            autoplay: !0,
148            navText: ["<i class='icofont-arrow-right'></i>", "<i class='icofont-arrow-left'></i>"],
149            responsive: {0: {items: 1}, 576: {items: 2}, 768: {items: 2}, 1200: {items: 3}}
150        };
151        e("#blogHomeHero > .blog-home-slides").owlCarousel(e.extend({}, t, {
152            onInitialized: function () {
153                // Hide real layout preview only after all active Owl images are decoded + painted.
154                var root = e("#blogHomeHero"), swapped = !1, pending = 0;
155
156                function revealOwl() {
157                    if (swapped) return;
158                    swapped = !0;
159                    requestAnimationFrame(function () {
160                        requestAnimationFrame(function () {
161                            root.addClass("has-owl-ready");
162                        });
163                    });
164                }
165
166                function onOneSettled() {
167                    if (--pending <= 0) revealOwl();
168                }
169
170                function waitForImg(img) {
171                    pending++;
172                    function ready() {
173                        if (img.complete && img.naturalWidth > 0 && typeof img.decode === "function") {
174                            img.decode().then(onOneSettled).catch(onOneSettled);
175                        } else {
176                            onOneSettled();
177                        }
178                    }
179                    if (img.complete) {
180                        ready();
181                    } else {
182                        img.addEventListener("load", ready, {once: !0});
183                        img.addEventListener("error", onOneSettled, {once: !0});
184                    }
185                }
186
187                var imgs = root.find(".owl-item.active img").toArray();
188                if (!imgs.length) {
189                    imgs = root.find(".blog-home-slides img").slice(0, 3).toArray();
190                }
191                if (!imgs.length) {
192                    revealOwl();
193                    return;
194                }
195
196                imgs.forEach(waitForImg);
197                setTimeout(revealOwl, 2e3); // safety: never freeze on a stuck image
198            }
199        })), e(".blog-home-slides").not("#blogHomeHero > .blog-home-slides").owlCarousel(t)
200    }(), setInterval(function () {
201        var o, s, t, a, i, n, l;
202        o = new Date("September 30, 2025 17:00:00 PDT"), o = Date.parse(o) / 1e3, s = new Date, t = o - (s = Date.parse(s) / 1e3), a = Math.floor(t / 86400), i = Math.floor((t - 86400 * a) / 3600), n = Math.floor((t - 86400 * a - 3600 * i) / 60), l = Math.floor(t - 86400 * a - 3600 * i - 60 * n), i < "10" && (i = "0" + i), n < "10" && (n = "0" + n), l < "10" && (l = "0" + l), e("#days").html(a + "<span>Days</span>"), e("#hours").html(i + "<span>Hours</span>"), e("#minutes").html(n + "<span>Minutes</span>"), e("#seconds").html(l + "<span>Seconds</span>")
203    }, 1e3), e(".new-news-slides").owlCarousel({
204        loop: !0,
205        nav: !0,
206        rtl: !0,
207        dots: !1,
208        autoplayHoverPause: !0,
209        autoplay: !0,
210        items: 1,
211        animateOut: "slideOutLeft",
212        navText: ["<i class='icofont-rounded-right'></i>", "<i class='icofont-rounded-left'></i>"]
213    }), e(".more-news-slides").owlCarousel({
214        loop: !0,
215        nav: !0,
216        dots: !1,
217        rtl: !0,
218        autoplayHoverPause: !0,
219        autoplay: !0,
220        margin: 30,
221        navText: ["<i class='icofont-rounded-right'></i>", "<i class='icofont-rounded-left'></i>"],
222        responsive: {
223            0: {items: 1},
224            768: {items: 2},
225            1200: {items: 3}
226        }
227    }), e(".more-news-slides2").each(function () {
228        var $carousel = e(this);
229        var $wrap = $carousel.closest(".post-images-carousel");
230        var $counter = $wrap.find(".post-images-counter-current");
231        var slideCount = $carousel.children().length;
232        $carousel.owlCarousel({
233            loop: slideCount > 1,
234            nav: slideCount > 1,
235            dots: !1,
236            rtl: !0,
237            autoplayHoverPause: !0,
238            autoplay: !1,
239            margin: 0,
240            startPosition: 0,
241            navText: ["<i class='icofont-rounded-right'></i>", "<i class='icofont-rounded-left'></i>"],
242            responsive: {0: {items: 1}},
243            onInitialized: function (ev) {
244                var $target = e(ev.target);
245                $target.trigger("to.owl.carousel", [0, 0, !0]);
246                bindPostImageCarouselNav($target);
247                $counter.length && $counter.text(ev.relatedTarget.relative(ev.item.index) + 1)
248            },
249            onTranslated: function (ev) {
250                $counter.length && $counter.text(ev.relatedTarget.relative(ev.item.index) + 1)
251            }
252        })
253    }), e(".default-news-slides").owlCarousel({
254        loop: !0,
255        nav: !0,
256        rtl: !0,
257        dots: !1,
258        autoplayHoverPause: !0,
259        autoplay: !0,
260        margin: 30,
261        navText: ["<i class='icofont-rounded-right'></i>", "<i class='icofont-rounded-left'></i>"],
262        responsive: {0: {items: 1}, 768: {items: 2}, 1200: {items: 3}}
263    }), e(function () {
264        e.fn.mixItUp && e(".shorting").not(".js-no-mixitup").mixItUp()
265    }), e.fn.magnificPopup && e(".popup-btn").magnificPopup({
266        type: "image",
267        gallery: {enabled: !0}
268    }), e(".video-news-slides").owlCarousel({
269        loop: !0,
270        nav: !0,
271        rtl: !0,
272        dots: !1,
273        autoplayHoverPause: !0,
274        autoplay: !0,
275        margin: 30,
276        navText: ["<i class='icofont-rounded-right'></i>", "<i class='icofont-rounded-left'></i>"],
277        responsive: {0: {items: 1}, 768: {items: 2}, 1200: {items: 2}}
278    }), e(".owl-nav button.owl-next").attr({"aria-label": "التالي"}).removeAttr("role"), e(".owl-nav button.owl-prev").attr({"aria-label": "السابق"}).removeAttr("role"), e(".owl-dots button.owl-dot").each(function (i) {
279        e(this).attr("aria-label", "الشريحة " + (i + 1)).removeAttr("role")
280    }), e(".owl-nav button, .owl-dots button").css({minWidth: "44px", minHeight: "44px"}), e(".newsletter-form").length && e.fn.validator && e(".newsletter-form").validator().on("submit", function (e) {
281        e.isDefaultPrevented() ? (o(), s(!1, "Please enter your email correctly.")) : e.preventDefault()
282    }), e(".newsletter-form").length && e.fn.ajaxChimp && e(".newsletter-form").ajaxChimp({
283        url: "https://envytheme.us20.list-manage.com/subscribe/post?u=60e1ffe2e8a68ce1204cd39a5&amp;id=42d6d188d9",
284        callback: function (t) {
285            "success" === t.result ? (e(".newsletter-form")[0].reset(), s(!0, "Thank you for subscribing!"), setTimeout(function () {
286                e("#validator-newsletter").addClass("hide")
287            }, 4e3)) : o()
288        }
289    }), e(function () {
290        e(window).on("scroll", function () {
291            var o = e(window).scrollTop();
292            o > 300 && e(".go-top").fadeIn("slow"), o < 300 && e(".go-top").fadeOut("slow")
293        }), e(".go-top").on("click", function () {
294            e("html, body").animate({scrollTop: "0"}, 500)
295        })
296    }), e(window).on("load", function () {
297        e(".wow").length && window.WOW && new WOW({
298            boxClass: "wow",
299            animateClass: "animated",
300            offset: 20,
301            mobile: !0,
302            live: !0
303        }).init()
304    })
305}(jQuery);
306
307(function ($) {
308    'use strict';
309
310    // Switch Btn
311    $('body').append("<div class='switch-box'><label id='switch' class='switch'><input type='checkbox' onchange='toggleTheme()' id='slider' aria-label='تبديل الوضع الليلي'><span class='slider round'></span></label></div>");
312
313})(jQuery);
314
315// function to set a given theme/color-scheme
316function setTheme(themeName) {
317    localStorage.setItem('sinmun_rtl_theme', themeName);
318    document.documentElement.className = themeName;
319    document.documentElement.style.colorScheme = themeName === 'theme-dark' ? 'dark' : 'light';
320}
321
322// function to toggle between light and dark theme
323function toggleTheme() {
324    if (localStorage.getItem('sinmun_rtl_theme') === 'theme-dark') {
325        setTheme('theme-light');
326
327    } else {
328        setTheme('theme-dark');
329    }
330
331}
332
333// Immediately invoked function to set the theme on initial load
334(function () {
335    var slider = document.getElementById('slider');
336    if (localStorage.getItem('sinmun_rtl_theme') === 'theme-dark') {
337        setTheme('theme-dark');
338        if (slider) {
339            slider.checked = false;
340        }
341    } else {
342        setTheme('theme-light');
343        if (slider) {
344            slider.checked = true;
345        }
346    }
347})();
348
349// Telegram embed iframes send resize messages for portrait/tall posts
350(function () {
351    function parseTelegramMessage(data) {
352        if (!data) return null;
353        if (typeof data === "string") {
354            try {
355                return JSON.parse(data);
356            } catch (err) {
357                return null;
358            }
359        }
360        return typeof data === "object" ? data : null;
361    }
362
363    window.addEventListener("message", function (event) {
364        if (event.origin !== "https://t.me" && event.origin !== "https://telegram.org") {
365            return;
366        }
367        var data = parseTelegramMessage(event.data);
368        if (!data || data.event !== "resize" || !data.height) {
369            return;
370        }
371        var frames = document.querySelectorAll("iframe.telegram-embed-frame");
372        for (var i = 0; i < frames.length; i++) {
373            if (frames[i].contentWindow === event.source) {
374                frames[i].style.height = data.height + "px";
375                break;
376            }
377        }
378    });
379})();

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.