PageSourceSearch

https://wizardofodds.com/assets/js/base-15DIsjw.js

js wizardofodds.com collected 2026-10-02 03:10:05 UTC 14,801 bytes, 462 lines download raw bytes

1import {
2    createCookie,
3    getCookie,
4    headingDataScroll,
5    lazyframeInit,
6    lazyLoadBackgroundImages,
7    mobileCards,
8    onThisPage,
9    openGeneralModal,
10    openModal,
11    openPageModal,
12    scrollOnClick,
13    isMobile
14    // casinosWidgetCasinosLoad, //TODO: use for ckeditor widgets
15    // casinosWidgetBonusesLoad //TODO: use for ckeditor widgets
16} from "./global.js";
17
18scrollOnClick();
19let rtl = false;
20if ($('body').hasClass("rtl")) {
21    rtl = true;
22}
23$.ajaxSetup({
24    beforeSend: function(xhr, settings) {
25        if (settings.url.startsWith('/') || settings.url.indexOf(domain) >= 0) {
26            xhr.setRequestHeader('X-Country-Code', region);
27        }
28    }
29});
30
31$(window).bind("load", function() {
32    var decodedHash = decodeURIComponent(window.location.hash);
33
34    if (decodedHash.indexOf('#') != -1 && window.location.href.indexOf('guides') == -1) {
35        let target = "[data-scroll='" + decodedHash + "']";
36
37        if ($(target).length > 0) {
38            let $scrollableContainer = $(target).closest('.overflow');
39
40            if ($scrollableContainer.length > 0) {
41                $('html, body').animate({
42                    scrollTop: $scrollableContainer.offset().top - 40
43                }, 500);
44
45                let rowOffset = $(target).position().top + $scrollableContainer.scrollTop();
46                $scrollableContainer.animate({
47                    scrollTop: rowOffset
48                }, 500);
49            } else {
50                $('html, body').animate({
51                    scrollTop: $(target).offset().top - 40
52                }, 500);
53            }
54        }
55    }
56});
57
58
59$(document).ready(function() {
60
61    // casinosWidgetCasinosLoad(); //TODO: use for ckeditor widgets and add |widgetize filter for all contents
62
63    // casinosWidgetBonusesLoad(); //TODO: use for ckeditor widgets
64
65    openModal("#messageModal");
66
67    onThisPage();
68
69    lazyLoadBackgroundImages();
70
71    headingDataScroll();
72
73    lazyframeInit();
74
75    mobileCards();
76
77    if(window.location.search.indexOf('?email_missing=true') !== -1) {
78        window.history.replaceState({}, document.title, "/");
79       openPageModal('#pageModal', '/partial/login-modal-body', 'emailMissing');
80    }
81    if(window.location.search.indexOf('?token_expired=true') !== -1) {
82        window.history.replaceState({}, document.title, "/");
83        openPageModal('#pageModal', '/partial/login-modal-body', 'tokenExpired');
84    }
85    if(window.location.search.indexOf('?confirm_email=true') !== -1) {
86        window.history.replaceState({}, document.title, "/");
87        openPageModal('#pageModal', '/partial/login-modal-body', 'confirmEmail');
88    }
89    if(window.location.search.indexOf('?social_register=') !== -1) {
90        window.history.replaceState({}, document.title, "/");
91        openModal("#socialRegister");
92    }
93
94    $('.socialRegisterForm #login_button').on('click', function(event) {
95        $('.socialRegisterForm').addClass('was-validated');
96        event.preventDefault();
97        if ($('.socialRegisterForm')[0].checkValidity() !== false) {
98            $('#socialRegister .blur-if-loading').addClass('blur-class');
99            $('#socialRegister .blur').show();
100
101            let body = JSON.stringify({
102                email: $("#social_register_email").val(),
103                csrf_token: $("#social_login_csrf_token").val(),
104                app: $("#social_login_app").val(),
105                network: $("#social_login_network").val(),
106                username: $("#social_login_username").val(),
107                name: $("#social_login_name").val(),
108            });
109
110            $.ajax({
111                url: '/social_register',
112                headers: {'Content-Type': 'application/json'},
113                method: 'POST',
114                dataType: 'json',
115                data: body,
116                success: function(result) {
117                    $(".socialRegisterForm .login_error").hide();
118                    $('#socialRegister .blur-if-loading').removeClass('blur-class');
119                    $('#socialRegister .blur').hide();
120                    $("#socialRegister .notice-text").show();
121                    $('.socialRegisterForm').hide();
122                },
123                error: function(xhr) {
124                    $('#socialRegister .blur-if-loading').removeClass('blur-class');
125                    $('#socialRegister .blur').hide();
126                    $(".socialRegisterForm .notice-text").hide();
127                    try {
128                        if(401 === xhr.status) {
129                            $(".socialRegisterForm .login_error").html($("#socialRegister .notice-text").html()).show();
130                            $("#login-notice").hide();
131                        }
132                    } catch(e) {
133                        $(".socialRegisterForm .login_error").html('Something went wrong!').show();
134                    }
135
136                }
137            });
138        }
139    });
140
141    $(document).on("click", ".copy-code-btn", function() {
142        let buttonId = '#' + $(this).attr('id');
143        $('input' + buttonId).select();
144        document.execCommand("copy");
145    });
146
147    $(window).resize(function() {
148        mobileCards();
149    });
150
151    $("div[align='center'] a.trans img").each(function () {
152        var wrappingLink = $(this).closest("a.trans");
153        var hrefValue = wrappingLink.attr("href");
154
155        $(this).attr("src", hrefValue);
156        wrappingLink.contents().unwrap();
157    });
158
159    $('.c table td').each(function () {
160        if ($(this).html().trim() === ' ') {
161            $(this).remove();
162        }
163    });
164
165    $('.col-md-24 .box--expandable').removeClass('box--expandable').find('.box-title-expand').remove();
166
167    $('.open-page-modal').click(function(e) {
168        e.preventDefault();
169        const currentModal = $(this).parents('.modal');
170        if (currentModal) {
171            currentModal.removeClass('d-flex');
172        }
173        let infoUrl = $(this).data('url');
174        let pageModal = $("#pageModal");
175        openPageModal(pageModal, infoUrl);
176    });
177
178    $('.open-general-modal').click(function(e) {
179        e.preventDefault();
180        let infoUrl = $(this).data('url');
181        openGeneralModal(infoUrl);
182    })
183
184    $('.toggle-block').click(function(e) {
185        e.preventDefault();
186        $(this).toggleClass('active');
187        if ($(window).width() < 1040) {
188            $('body').toggleClass('no-scroll');
189        }
190        $(this).parent().siblings().find('.active').removeClass('active');
191        $(this).next().toggleClass('active');
192
193        if(!$(this).hasClass('lang')) {
194            $('.language-toggle .active').removeClass('active');
195        }
196         if(!$(this).hasClass('search')) {
197            $('.toggle-block.search.active').removeClass('active');
198            $('.top-menu').removeClass('active');
199        }
200        if ($('.toggle-block.menu').hasClass('active')) {
201            $('.menu-block').addClass('active');
202        } else {
203            $('.menu-block').removeClass('active');
204        }
205        if ($('.toggle-block.search').hasClass('active')) {
206            $('.top-menu').addClass('active');
207            $('.search-form input').focus();
208        } else {
209            $('.top-menu').removeClass('active');
210        }
211
212    })
213
214    $('.casinos-slider').slick({
215        slidesToShow: 3,
216        slidesToScroll: 1,
217        infinite: false,
218        rtl:rtl,
219        responsive: [
220            {
221                breakpoint: 1024,
222                settings: {
223                    slidesToShow: 2,
224                    slidesToScroll: 2
225                }
226            },
227            {
228                breakpoint: 576,
229                settings: {
230                    slidesToShow: 1,
231                    slidesToScroll: 1
232                }
233            }
234        ]
235    });
236
237    if ($(window).width() < 1040) {
238        $('.menu-list .has-dropdown').click(function (event) {
239            if (event.target !== this) return;
240            $(this).toggleClass('active');
241            $(this).siblings().removeClass('active');
242            $(this).siblings().find('.submenu').slideUp();
243            $(this).find('.submenu').slideToggle();
244        })
245
246        $('.submenu-column h3').click(function (e) {
247            e.preventDefault();
248
249            const menuHeading = $(this);
250            const submenuColumnParent = menuHeading.parent('.submenu-column');
251
252            menuHeading.toggleClass('active');
253            menuHeading.siblings().slideToggle();
254
255            const placeholderSibling = submenuColumnParent.next('.placeholder');
256            if (placeholderSibling.length) {
257                placeholderSibling.slideToggle();
258            }
259        });
260    }
261
262    if ($('.box-content').length) {
263        $('.box-content').each(function() {
264            if (!$(this).hasClass('overflow')) {
265                if ($(this).find('table.data').length !== 0) {
266                    $(this).addClass('overflow')
267                }
268            }
269        });
270    }
271
272    if($('.banner-block--holder').length > 0){
273        bannerBlock();
274    }
275    positionBannersBlock();
276
277    setTimeout(showNewsPopup, 180000);
278
279    function showNewsPopup() {
280        let is_already_shown = sessionStorage.getItem('alreadyShown');
281        let dontShowCookie = getCookie("subscribe_notification");
282        if (is_already_shown != 'already shown' && dontShowCookie == "") {
283            sessionStorage.setItem('alreadyShown', 'already shown');
284            let infoUrl = '/partial/newsletter-corner';
285            let newsletterCornerModal = $("#newsletterCornerModal");
286            openPageModal(newsletterCornerModal, infoUrl);
287        }
288    }
289
290    if ($(window).width() < 1025) {
291        $('.content img').each(function() {
292            if ($(this).hasClass('lcp-mobile')) {} else {
293                let attr = $(this).attr('loading');
294
295                if (typeof attr == 'undefined' || attr == false) {
296                    $(this).attr("loading", "lazy");
297                }
298            }
299        })
300    } else {
301        $('.content img').each(function() {
302            let attr = $(this).attr('loading');
303
304            if (typeof attr == 'undefined' || attr == false) {
305                $(this).attr("loading", "lazy");
306            }
307        })
308    }
309
310    $('a').each(function() {
311        if ($(this).data('fancybox') || $(this).attr('rel') === 'prettyPhoto[pp_gal]') {
312            $(this).addClass('trans');
313        }
314    })
315
316    $('.content img').each(function() {
317        let altAttr = $(this).attr('alt');
318
319        if ($(this).data('src')) {
320            let dataSrcVal = $(this).data('src');
321
322            $(this).attr("src", dataSrcVal);
323        }
324
325        if (typeof altAttr == 'undefined' || altAttr == false) {
326            let imgSrc = $(this).attr("src");
327            let newAlt = imgSrc.split("/").pop().slice(0, -4);
328            $(this).attr("alt", newAlt);
329        }
330
331        if (!$(this).attr("width")) {
332            $(this).on("load", function() {
333                var width = $(this).get(0).naturalWidth;
334                var height = $(this).get(0).naturalHeight;
335                $(this).attr("width", width);
336                $(this).attr("height", height)
337            });
338        }
339    })
340
341    $(".newsletter-popup--close").click(function() {
342        if (document.getElementById("dont_show_this_again").checked == true) {
343            createCookie("subscribe_notification", "true", 365);
344        }
345        $('.newsletter-popup').removeClass('d-flex');
346        hideRecaptcha();
347    });
348
349    if(isMobile() == true) {
350        $(document).on('click', '.tc-open', function() {
351            let $this = $(this);
352            $(this).parent().find('.bonus-hover').addClass('active')
353        });
354        $(document).on('click', '.tc-close', function() {
355            let $this = $(this);
356            $(this).parent().removeClass('active')
357        });
358    }
359
360    $(document).on('click', '.pass-toggler', function(event) {
361      event.preventDefault();
362      let passField =  $(this).parent().find('.pass-toggle');
363      let currentType = passField.attr('type');
364      let newType = (currentType === 'password') ? 'text' : 'password';
365      let passVisible = passField.clone(true);
366      passVisible.attr('type', newType);
367      passVisible.val(passField.val());
368      passField.replaceWith(passVisible);
369      if (newType === 'password') {
370          $(this).removeClass('active')
371      } else {
372          $(this).addClass('active')
373      }
374    });
375});
376
377function hideRecaptcha() {
378    const recaptcha = $(".grecaptcha-badge");
379    if (recaptcha.length) return recaptcha.css({ display: "none" });
380    requestAnimationFrame(() => this.hideRecaptcha()); 
381}
382
383if ($(window).width() > 1025) {
384    positionShareBlock();
385}
386
387function positionBannersBlock() {
388    let bannerBlockHolder = $('.banner-block');
389
390    if (bannerBlockHolder.length > 0) {
391        let bannerBlockHeight = bannerBlockHolder[0].offsetHeight;
392
393        if (bannerBlockHeight) {
394            bannerBlockHolder.css('top', -(bannerBlockHeight / 2) + 'px');
395            let paddingAndMargin = (bannerBlockHeight / 2) + 30 + 'px';
396            $('footer').css({
397                'padding-top': paddingAndMargin,
398                'margin-top': paddingAndMargin
399            });
400        }
401    }
402}
403
404$(window).resize(function() {
405    if ($(window).width() > 1025) {
406        positionShareBlock();
407    }
408
409    positionBannersBlock();
410});
411
412function bannerBlock() {
413    $.ajax({
414        url: '/partial/footer-adverts',
415        type: 'get',
416        dataType: 'html',
417        success: function(result) {
418            $('.banner-block--holder').html(result);
419            positionBannersBlock();
420        }
421    });
422}
423
424
425function positionShareBlock() {
426    const shareBlock = $('.share-block')
427    if (shareBlock.length > 0){
428
429        const menuBlock = $('.menu-block');
430        const header = document.querySelector('header')
431        const shareBlockDesktop = $('.share-block.desktop')
432        let windowWidth = $(window).width();
433        let containerWidth = $('.container').width();
434
435        const topMenuClass = function (entries) {
436            const [entry] = entries;
437            if (!entry.isIntersecting) {
438                menuBlock.addClass('scroll');
439                shareBlockDesktop.addClass('fixed');
440                let left = containerWidth + (windowWidth - containerWidth) / 2 + 20;
441
442                shareBlock.css("left", left);
443
444            } else {
445                menuBlock.removeClass('scroll');
446                shareBlockDesktop.removeClass('fixed');
447
448                shareBlock.css("left", "auto");
449            }
450        }
451
452        const obsOptions = {
453            root: null,
454            threshold: 0.1
455        }
456
457        const headerObserver = new IntersectionObserver(topMenuClass, obsOptions);
458        if (header) {
459            headerObserver.observe(header);
460        }
461    }
462}

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.