PageSourceSearch

https://slottywaycasino.net.pl/wp-content/themes/slottyway/Slottyw…D%D0%B0%D0%B7%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F

js slottywaycasino.net.pl collected 2026-10-09 22:39:50 UTC 24,567 bytes, 852 lines download raw bytes

1(function ($) {
2
3    var $document = $(document);
4
5    var ONE_MINUTE = 60;
6    var ONE_HOUR = ONE_MINUTE * 60;
7    var ONE_DAY = ONE_HOUR * 24;
8
9    // private utils
10
11    function nowTimestamp() {
12        return Math.floor((new Date()).valueOf() / 1000);
13    }
14
15    function getSeconds(endTimestamp) {
16        return Math.max(0, endTimestamp - nowTimestamp());
17    }
18
19    function getScrollTop() {
20        return document.documentElement.scrollTop || document.body.scrollTop;
21    }
22
23
24    var COUNTDOWN_DEFAULTS = {
25        removeDelay: 3,
26        seconds: 0,
27        endTimestamp: 0,
28    };
29
30    //timer observer
31    var visibleElementsMap = new Map();
32
33    var TIMER_OBSERVER_OPTIONS = {
34        root: null,
35        rootMargin: "0px",
36        threshold: 0,
37    };
38
39    var timerObserverCallback = entries => {
40        for (const entry of entries) {
41            if (!entry.isIntersecting) {
42                visibleElementsMap.set(entry.target, false);
43            } else {
44                visibleElementsMap.set(entry.target, true);
45            }
46        }
47    }
48
49    var timerObserver = new IntersectionObserver(timerObserverCallback, TIMER_OBSERVER_OPTIONS);
50    //end timer observer
51
52    $.fn.jq_countdown = function(options) {
53        var $this = $(this);
54        timerObserver.observe($this[0]);
55
56        if ($this.length > 1) {
57            $this.each(function() {
58                $(this).jq_countdown(options);
59            });
60            return this;
61        }
62
63        options = $.extend({}, COUNTDOWN_DEFAULTS, options);
64
65        var endTimestamp = 0 + $this.data('timestamp');
66        if (endTimestamp) {
67            options.endTimestamp = endTimestamp;
68        }
69
70        endTimestamp = options.endTimestamp || (nowTimestamp() + options.seconds);
71
72        if (!endTimestamp) {
73            console.error('init countdownTimer error', this);
74            return;
75        }
76
77        var template = options.template || $this.data('template');
78        var removeDelay = options.removeDelay;
79
80        var timer = null;
81        var tick = function() {
82            if (!$this) {
83                timer && clearInterval(timer);
84                timer = null;
85                return;
86            }
87            var seconds = getSeconds(endTimestamp);
88            var s = seconds;
89
90            // days
91            var d = 0;
92            if (template.indexOf('{d}') !== -1) {
93                d = Math.floor(s / ONE_DAY);
94                s -= d * ONE_DAY;
95                if (d < 10) {
96                    d = '0' + d;
97                }
98            }
99
100            // hours
101            var h = Math.floor(s / ONE_HOUR);
102            s -= h * ONE_HOUR;
103            if (h < 10) {
104                h = '0' + h;
105            }
106
107            // minutes
108            var m = Math.floor(s / ONE_MINUTE);
109            s -= m * ONE_MINUTE;
110            if (m < 10) {
111                m = '0' + m;
112            }
113
114            // seconds
115            if (s < 10) {
116                s = '0' + s;
117            }
118
119            var html = template.replace('{d}', d)
120                .replace('{h}', h)
121                .replace('{m}', m)
122                .replace('{s}', s);
123
124            if (visibleElementsMap.get($this[0])) {
125                $this.html(html);
126            }
127
128            if (seconds <= 0) {
129                $this.trigger('countdown:end');
130                timer && clearInterval(timer);
131                timer = null;
132                $this = null;
133            } else if (!$this.is(':visible') && !$this.is('[data-no-remove]')) {
134                removeDelay--;
135                if (removeDelay < 0) {
136                    timer && clearInterval(timer);
137                    timer = null;
138                    $this = null;
139                }
140            }
141        };
142        // start
143        if (getSeconds(endTimestamp) > 0) {
144            timer = setInterval(tick, 1000);
145        }
146        tick();
147
148        return this;
149    };
150
151
152    $.fn.scroll_top_button = function (animationTime) {
153
154        var $this = $(this);
155        if ($this.length === 0) {
156            return this;
157        }
158
159        $(window).scroll(function () {
160            if ($(this).scrollTop() > 0) {
161                $this.addClass('active');
162            } else {
163                $this.removeClass('active');
164            }
165        });
166
167        $this.on('click', function (event) {
168            event.preventDefault();
169            $('html, body').animate({
170                scrollTop: 0,
171            }, animationTime || 200);
172        });
173    };
174
175
176    var DROPDOWN_DEFAULTS = {
177        animationType: 'slide',
178        animationTime: 200,
179    };
180    $.fn.jq_dropdown = function (options) {
181        var $this = $(this);
182
183        if ($this.length > 1) {
184            $this.each(function () {
185                $(this).jq_dropdown(options);
186            });
187            return this;
188        }
189
190        options = $.extend({}, DROPDOWN_DEFAULTS, options);
191
192        function show($menu) {
193            switch (options.animationType) {
194                case 'slide':
195                    $menu.slideDown(options.animationTime);
196                    break;
197                case 'fade':
198                    $menu.fadeIn(options.animationTime);
199                    break;
200                default:
201                    $menu.show();
202                    break;
203            }
204        }
205
206        function hide($menu) {
207            switch (options.animationType) {
208                case 'slide':
209                    $menu.slideUp(options.animationTime);
210                    break;
211                case 'fade':
212                    $menu.fadeOut(options.animationTime);
213                    break;
214                default:
215                    $menu.hide();
216                    break;
217            }
218        }
219
220        function open() {
221            var $menu = $this.find('.dd__menu');
222            show($menu);
223            $this.addClass('open');
224
225            setTimeout(function () {
226                $document.one('click', function (event) {
227                    close();
228                });
229            }, 1);
230        }
231
232        function close() {
233            var $menu = $this.find('.dd__menu');
234
235            $this.removeClass('open');
236            hide($menu);
237        }
238
239        function isOpen() {
240            return $this.hasClass('open');
241        }
242
243        $this.on('click', '.dd__button', function () {
244            isOpen() ? close() : open();
245        });
246
247        $this.on('click', '.dd__menu', function () {
248            close();
249        });
250    };
251
252
253    var BUTTON_UP_DEFAULTS = {
254        scrollTime: 400,
255    };
256    $.fn.jq_button_up = function (options) {
257        var $this = $(this);
258
259        options = $.extend({}, BUTTON_UP_DEFAULTS, options);
260
261        $([document, document.documentElement, document.body]).on('scroll', function () {
262            var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
263            if (scrollTop > 0) {
264                $this.fadeIn();
265            } else {
266                $this.fadeOut();
267            }
268        });
269
270        $this.click(function (event) {
271            event.preventDefault();
272
273            $([document.documentElement, document.body]).animate({
274                scrollTop: 0,
275            }, options.scrollTime);
276        });
277    };
278
279
280    var GAMES_AJAX_DEFAULTS = {
281        form: '#filter_term',
282        links: null,
283        searchDelay: 300,
284        searchOnInput: true,
285        updateContainers: ['#games_list'],
286        clearGridBeforeUpdate: true,
287        loaderInGrid: true,
288
289        beforeUpdate: $.noop,
290        afterUpdate: $.noop,
291        onSubmit: $.noop,
292        onLink: $.noop,
293        resolveUrl: null,
294
295        pushState: true,
296    };
297    $.fn.games_ajax = function (options) {
298        var $this = $(this);
299
300        if ($this.length > 1) {
301            $this.each(function () {
302                $(this).games_ajax(options);
303            });
304            return this;
305        }
306
307        options = $.extend({}, GAMES_AJAX_DEFAULTS, options);
308
309        var $grid = $this;
310        var $form = $(options.form);
311
312        if (!$grid.length) throw new Error('games_ajax: $grid not found');
313        if (!$form.length) throw new Error('games_ajax: $form not found');
314
315        var $term_input = $form.find('input:visible');
316        var request = null;
317
318        $form.on('submit', function (event) {
319            event.preventDefault();
320            var $this = $(this);
321            var url = $this.attr('action');
322            if (options.resolveUrl) {
323                var params = $this.serializeArray();
324                url = options.resolveUrl(url, params);
325            } else {
326                var params = $this.serializeArray().filter(function (item) {
327                    return !!item.value;
328                }).map(function (item) {
329                    return encodeURIComponent(item.name) + '=' + encodeURIComponent(item.value);
330                });
331                if (params.length) {
332                    url += (url.indexOf('?') === -1 ? '?' : '&') + params.join('&');
333                }
334            }
335            update(url, false);
336            options.onSubmit.call(this);
337        });
338
339        if (options.searchOnInput) {
340            $term_input.on('input', search);
341            $form.find('select').on('change', search);
342        }
343
344        $form.find('input:radio').on('change', search);
345        $form.find('input:checkbox').on('change', search);
346
347        if (options.links) {
348            $document.on('click', options.links, function (event) {
349                event.preventDefault();
350                var url = $(this).attr('href');
351                update(url, true);
352                options.onLink.call(this);
353            });
354        }
355
356        var search_timer = null;
357
358        function search() {
359            if (options.searchDelay) {
360                search_timer && clearTimeout(search_timer);
361                search_timer = setTimeout(function () {
362                    $form.submit();
363                }, options.searchDelay);
364            } else {
365                $form.submit();
366            }
367        }
368
369        function abort() {
370            request && request.abort();
371            request = null;
372        }
373
374        function complete() {
375            $grid.removeLoader();
376            request = null;
377
378            options.afterUpdate();
379        }
380
381        function update(url, resetTerm) {
382            abort();
383
384            options.beforeUpdate();
385
386            // fix "%20" => "+"
387            url = url.replace(/\%20/g, '+');
388
389            request = $.ajax({
390                url: url,
391                method: 'get',
392                success: function (html) {
393                    options.loaderInGrid && $grid.removeLoader();
394
395                    // build page
396                    var $page = $('<div>' + html + '</div>');
397
398                    // update containers
399                    var $old, $new, selector;
400                    for (var i = 0; i < options.updateContainers.length; i++) {
401                        selector = options.updateContainers[i];
402
403                        $old = $document.find(selector);
404                        $new = $page.find(selector);
405
406                        if ($old.length && $new.length) {
407                            $old.html($new.html());
408                        }
409                    }
410
411                    // update form
412                    $old = $form;
413                    $new = $page.find(options.form);
414                    if ($old.length && $new.length) {
415                        $old.attr('action', $new.attr('action'));
416                    }
417
418                    // clear?
419                    $old = null;
420                    $new = null;
421
422                    if (resetTerm) {
423                        $term_input.val('');
424                    }
425
426                    // update url
427                    if (options.pushState) {
428                        history.pushState({}, '', url);
429                    }
430
431                    // afterUpdate
432                    window.dispatchEvent(new Event('resize'));
433                    window.dispatchEvent(new Event('scroll'));
434                    options.afterUpdate();
435
436                    // clear?
437                    $page.remove();
438                    $page = null;
439                },
440                error: function (err) {
441                },
442                complete: complete,
443            });
444
445            options.clearGridBeforeUpdate && $grid.empty();
446            options.loaderInGrid && $grid.addLoader();
447        }
448
449    };
450
451    var GAMES_SEARCH_DEFAULTS = {
452        url: null,
453        data: null,
454        showCount: 3,
455        showItemTemplate: '<div class="item">{id} / {title}</div>',
456        emptyText: '<div class="empty">empty</div>',
457        input: 'input',
458        content: '.dd__content',
459        searchInFields: ['fullGameName'],
460    };
461    $.fn.games_search = function (options) {
462        var $this = $(this);
463
464        if ($this.length > 1) {
465            $this.each(function () {
466                $(this).games_search(options);
467            });
468            return this;
469        }
470
471        options = $.extend({}, GAMES_SEARCH_DEFAULTS, options);
472
473        var $input = $this.find(options.input);
474        var $content = $this.find(options.content);
475        var loading = false;
476
477        function open() {
478            $this.addClass('open');
479            setTimeout(function () {
480                $document.on('click', checkClose);
481            }, 100);
482        }
483
484        function checkClose(event) {
485            if ($input.parent().has(event.target).length === 0) {
486                close();
487            }
488        }
489
490        function close() {
491            $this.removeClass('open');
492            $document.off('click', checkClose);
493        }
494
495        function focus(event) {
496            // make ajax request, cache games
497            if (options.data === null && options.url) {
498                options.data = [];
499                $.ajax({
500                    url: options.url,
501                    method: 'get',
502                    success: function (data) {
503                        options.data = data;
504                    },
505                    complete: function () {
506                        $content.removeLoader();
507                        loading = false;
508                        search();
509                    },
510                });
511                $content.addLoader();
512                loading = true;
513            }
514
515            search();
516        }
517
518        function change(event) {
519            search();
520        }
521
522        function search() {
523            var searchText = $input.val().toLowerCase();
524            if (searchText) {
525                open();
526            } else {
527                close();
528                return;
529            }
530
531            if (loading) {
532                // dont show results
533                return;
534            }
535
536            var results = [];
537            for (var i = 0; i < options.data.length; i++) {
538                var found = false;
539                var item = options.data[i];
540                for (var j = 0; j < options.searchInFields.length; j++) {
541                    var fieldName = options.searchInFields[j];
542                    if (typeof item[fieldName] === 'string') {
543                        if (item[fieldName].toLowerCase().indexOf(searchText) >= 0) {
544                            found = true;
545                            break;
546                        }
547                    }
548                }
549                if (found) {
550                    results.push(item);
551                    if (results.length >= options.showCount) {
552                        break;
553                    }
554                }
555            }
556
557
558            showResults(results);
559        }
560
561        function renderItem(item) {
562            var template = options.showItemTemplate;
563            var html = template.replace(/\{([\w\d\_]+)\}/gm, function (matchText, fieldName) {
564                if (fieldName === 'name') {
565                    fieldName = 'fullGameName';
566                }
567                if (item[fieldName] !== undefined) {
568                    return item[fieldName];
569                }
570                return matchText;
571            });
572            return $(html);
573        }
574
575        function showResults(items) {
576            if (items.length) {
577                var $scroll = $('<div class="dd__scroll"></div>');
578                $scroll.append(items.map(renderItem));
579                $content.empty().append($scroll);
580            } else {
581                $content.empty().append($(options.emptyText));
582            }
583        }
584
585        $input.on('focus', focus);
586        $input.on('input', change);
587    };
588
589
590    var TREE_MENU_DEFAULTS = {
591        submenuSelector: '.menu.sub',
592        itemSelector: '.item',
593        activeClass: 'hovered',
594        activateActiveDelay: 300,
595        animationTime: 300,
596    };
597    $.fn.tree_menu = function (options) {
598        var $this = $(this);
599
600        if ($this.length > 1) {
601            $this.each(function () {
602                $(this).tree_menu(options);
603            });
604            return this;
605        }
606
607        options = $.extend({}, TREE_MENU_DEFAULTS, options);
608
609        var $submenu = $this.next();
610        var activateActiveTimer = null;
611        var $prevmenu = null;
612        var showSub = true;
613
614        function resetTimer() {
615            activateActiveTimer && clearTimeout(activateActiveTimer);
616            activateActiveTimer = null;
617        }
618
619        function activate($item) {
620            resetTimer();
621            $this.find(options.itemSelector + '.' + options.activeClass).not($item).removeClass(options.activeClass);
622            $item.addClass(options.activeClass);
623
624            var $menu = $item.find(options.submenuSelector).eq(0);
625            if ($menu.length) {
626                // show it
627                var $tmp = $menu.clone();
628                $submenu.append($tmp);
629                if ($prevmenu) {
630                    $prevmenu.remove();
631                } else {
632                    $tmp.hide().slideDown(options.animationTime);
633                }
634                $prevmenu = $tmp;
635            } else {
636                if ($prevmenu) {
637                    $prevmenu.slideUp(options.animationTime, function () {
638                        $(this).remove();
639                    });
640                    $prevmenu = null;
641                }
642            }
643        }
644
645        function activateDefault() {
646            var $item = $this.find(options.itemSelector + '.active');
647            if ($item && $item.length) {
648                activate($item);
649            }
650        }
651
652        function activateDefaultDelayed() {
653            resetTimer();
654            activateActiveTimer = setTimeout(activateDefault, options.activateActiveDelay);
655        }
656
657        $this
658            .on('tap', options.itemSelector, function (event) {
659                var url = $(event.target).attr('href');
660                if (url) {
661                    location.replace(url);
662                    showSub = false
663                }
664            })
665            .on('mouseover', options.itemSelector, function (event) {
666                if (showSub == true){
667                    activate($(this));
668                }
669            })
670            .on('mouseleave', options.itemSelector, activateDefaultDelayed)
671        $submenu
672            .on('mouseover', resetTimer)
673            .on('mouseleave', activateDefaultDelayed);
674
675        activateDefault();
676    };
677
678
679    var TABULAR_MENU_DEFAULTS = {
680        menuItem: 'item',
681        activeClass: 'active',
682        initializedClass: 'initialized',
683        tabStretch: false,
684        autoplay: 0,
685    };
686    $.fn.tabular_menu = function (options) {
687        var $this = $(this);
688
689        if ($this.length > 1) {
690            $this.each(function () {
691                $(this).tree_menu(options);
692            });
693            return this;
694        }
695
696        options = $.extend({}, TABULAR_MENU_DEFAULTS, options);
697
698        var $items = $this.find('.' + options.menuItem);
699
700        function activate($item) {
701            $items.not($item).removeClass(options.activeClass).each(function () {
702                var content = $(this).attr('href');
703                $(content).hide();
704            });
705            $item.addClass(options.activeClass);
706            var content = $item.attr('href');
707            $(content).fadeIn();
708        }
709
710        // find active
711        var $active = null;
712        $items.each(function () {
713            if ($active === null && $(this).hasClass(options.activeClass)) {
714                $active = $(this);
715            }
716        });
717        if ($active === null) {
718            $active = $items.eq(0);
719        }
720
721        activate($active);
722
723        // init
724        (function () {
725            var $tabs = $items.map(function () {
726                return $($(this).attr('href'));
727            });
728
729            var maxHeight = 0;
730            $tabs.each(function () {
731                this.addClass(options.initializedClass);
732                maxHeight = Math.max(maxHeight, this.outerHeight());
733            });
734            if (options.tabStretch) {
735                $tabs.each(function () {
736                    this.css('min-height', maxHeight + 'px');
737                });
738            }
739            $tabs = null;
740        })();
741
742        $this.on('click', '.' + options.menuItem, function (event) {
743            event.preventDefault();
744            activate($(this));
745        });
746
747        function autoplayNext() {
748            var nextIndex = $items.index($items.filter('.active').get(0)) + 1;
749            if (nextIndex >= $items.length) {
750                nextIndex = nextIndex % $items.length;
751            }
752            $items.eq(nextIndex).click();
753        }
754
755        if (options.autoplay) {
756            var autoplayTimer = setInterval(autoplayNext, options.autoplay);
757        }
758    };
759
760    // .drag-slider-wrap > .drag-slider
761    var DRAG_SLIDER_DEFAULTS = {
762    };
763    $.fn.drag_slider = function (options) {
764        var $this = $(this);
765
766        if ($this.length > 1) {
767            $this.each(function () {
768                $(this).drag_slider(options);
769            });
770            return this;
771        }
772
773        options = $.extend({}, DRAG_SLIDER_DEFAULTS, options);
774
775        var $container = $this;
776        var isDown, isScroll, startX, scrollLeft;
777        var $slider = $container.find('.drag-slider');
778
779        function stopClick(e){
780            e.preventDefault();
781            e.stopPropagation();
782            e.stopImmediatePropagation();
783        }
784
785        $slider.on('mousedown', function (e) {
786            isDown = true;
787            isScroll = false;
788            startX = e.clientX;
789            scrollLeft = e.currentTarget.scrollLeft;
790            stopClick(e);
791        });
792        $slider.on('mouseleave', function () {
793            isDown = false;
794            isScroll = false;
795        });
796        $slider.on('mouseup', function (e) {
797            if (isScroll === true) {
798                $slider.one('click', stopClick, false);
799            }
800            isDown = false;
801            isScroll = false;
802        });
803        $slider.on('mousemove', function (e) {
804            if (isDown) {
805                var x = e.clientX;
806                var walk = x - startX;
807                e.currentTarget.scrollLeft = scrollLeft - walk;
808                if (walk) {
809                    isScroll = true;
810                }
811            }
812        });
813
814        function prev () {
815            var $item = $slider.children()
816            var scrollLeft = $slider.scrollLeft()
817
818            var left;
819            var scroledSlidesNum = scrollLeft / Math.floor($item.outerWidth());
820
821            left = Math.floor(scroledSlidesNum) * $item.outerWidth()
822            if (scroledSlidesNum - Math.floor(scroledSlidesNum) <= 0.3) {
823                left = Math.floor(scroledSlidesNum - 1) * $item.outerWidth()
824            }
825            $slider.animate({scrollLeft: left}, 200)
826        }
827
828        function next () {
829            var $item = $slider.children()
830            var scrollLeft = $slider.scrollLeft()
831
832            var left;
833            var scroledSlidesNum = scrollLeft / Math.floor($item.outerWidth());
834
835            left = Math.floor(scroledSlidesNum + 1) * $item.outerWidth()
836            if (scroledSlidesNum - Math.floor(scroledSlidesNum) >= 0.8) {
837                left = Math.ceil(scroledSlidesNum + 1) * $item.outerWidth();
838            }
839            $slider.animate({scrollLeft: left}, 200)
840        }
841
842        $container.on('click', '.prev', function (event) {
843            event.preventDefault();
844            prev();
845        });
846
847        $container.on('click', '.next', function (event) {
848            event.preventDefault();
849            next();
850        });
851    };
852})(jQuery);

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.