PageSourceSearch

https://search.et.gr/wp-content/themes/citybook/assets/js/scripts.js

js et.gr collected 2026-09-24 08:58:31 UTC 18,572 bytes, 542 lines download raw bytes

1(function($){
2    "use strict"; 
3    //   all ------------------
4    function initCitybook() {
5        //   loader ------------------
6        $(".loader-wrap").fadeOut(300, function () {
7            $("#main-theme").animate({
8                opacity: "1"
9            }, 300);
10        });
11        if($('#top-menu').length){
12            $('#top-menu li.menu-item-has-children > a').append(' <i class="fas fa-caret-down"></i>')
13        }
14        //   Background image ------------------
15        var a = $(".bg");
16        a.each(function (a) {
17            if ($(this).attr("data-bg")) $(this).css("background-image", "url(" + $(this).data("bg") + ")");
18        });
19        //   scrollToFixed------------------
20        if($('.dashboard-content-col').outerHeight() > $(".fixed-bar").outerHeight()){
21            $(".fixed-bar").scrollToFixed({
22                minWidth: 1064,
23                marginTop: 90,
24                removeOffsets: true,
25                limit: function () {
26                    var a = $(".limit-box").offset().top - $(".fixed-bar").outerHeight() - 70;
27                    return a;
28                },
29                spacerClass: 'dashboard-fixed-spacer'
30            });
31        }
32            
33        $(".back-to-filters").scrollToFixed({
34            minWidth: 1224,
35            zIndex: 12,
36            marginTop: 130,
37            removeOffsets: true,
38            limit: function () {
39                var a = $(".limit-box").offset().top - $(".back-to-filters").outerHeight(true) - 10;
40                return a;
41            },
42            spacerClass: 'back-to-filter-fixed-spacer'
43        });
44        var adminbarheight = 0;
45        if($('#wpadminbar').length) adminbarheight = $('#wpadminbar').outerHeight()
46        if($(".scroll-nav-wrapper").length){
47            $(".scroll-nav-wrapper").each(function(){
48                var $lscn = $(this),
49                    mW = 769;
50                if($lscn.hasClass('lscroll-mobile-yes')) mW = 100
51
52                $lscn.scrollToFixed({
53                    minWidth: mW,
54                    zIndex: 12,
55                    marginTop: 80 + adminbarheight,
56                    removeOffsets: true,
57                    limit: function () {
58                        var a = $(".limit-box").offset().top - $(".scroll-nav-wrapper").outerHeight(true) - 10;
59                        return a;
60                    },
61                    spacerClass: 'scroll-nav-fixed-spacer'
62                });
63            })
64        }
65        
66                
67        //   Slick------------------
68    	var sbp = $('.swiper-button-prev'),
69    		sbn = $('.swiper-button-next');
70        $('.fw-carousel').slick({
71            dots: true,
72            infinite: true,
73            speed: 600,
74            slidesToShow: 1,
75            centerMode: false,
76            arrows: false,
77            variableWidth: true
78        });
79        sbp.on("click", function () {
80            $('.fw-carousel').slick('slickPrev');
81        })
82
83        sbn.on("click", function () {
84            $('.fw-carousel').slick('slickNext');
85        })
86        $('.slideshow-container').slick({
87            slidesToShow: 1,
88            autoplay: true,
89            autoplaySpeed: 5000,
90            arrows: false,
91            fade: true,
92            cssEase: 'ease-in',
93            infinite: true,
94            speed: 1000
95        });
96        $('.single-slider').slick({
97            infinite: true,
98            slidesToShow: 1,
99            dots: true,
100            arrows: false,
101            adaptiveHeight: true
102        });
103        sbp.on("click", function () {
104            $(this).closest(".single-slider-wrapper").find('.single-slider').slick('slickPrev');
105        });
106        sbn.on("click", function () {
107            $(this).closest(".single-slider-wrapper").find('.single-slider').slick('slickNext');
108        });
109
110        $('.slider-container').slick({
111            infinite: true,
112            slidesToShow: 1,
113            dots: true,
114            arrows: false,
115        });
116        sbp.on("click", function () {
117            $(this).closest(".slider-container-wrap").find('.slider-container').slick('slickPrev');
118
119        });
120        sbn.on("click", function () {
121            $(this).closest(".slider-container-wrap").find('.slider-container').slick('slickNext');
122        });
123        $('.single-carousel').slick({
124            infinite: true,
125            slidesToShow: 3,
126            dots: true,
127            arrows: false,
128            centerMode: true,
129            responsive: [{
130                    breakpoint: 1224,
131                    settings: {
132                        slidesToShow: 2,
133                        centerMode: false,
134                    }
135                },
136
137                {
138                    breakpoint: 768,
139                    settings: {
140                        slidesToShow: 1,
141                        centerMode: true,
142                    }
143                },
144                {
145                    breakpoint: 560,
146                    settings: {
147                        slidesToShow: 1,
148                        centerMode: false,
149                    }
150                }
151            ]
152
153        });
154        sbp.on("click", function () {
155            $(this).closest(".carousel ").find('.single-carousel').slick('slickPrev');
156
157        });
158        sbn.on("click", function () {
159            $(this).closest(".carousel").find('.single-carousel').slick('slickNext');
160        });
161        // $('.listing-carousel').slick({
162        //     infinite: true,
163        //     slidesToShow: 5,
164        //     slidesToScroll: 3,
165        //     dots: true,
166        //     arrows: false,
167        //     centerMode: true,
168        //     centerPadding: '0',
169        //     responsive: [{
170        //             breakpoint: 1500,
171        //             settings: {
172        //                 slidesToShow: 4,
173        //                 slidesToScroll: 2,
174        //             }
175        //         },
176        //         {
177        //             breakpoint: 1224,
178        //             settings: {
179        //                 slidesToShow: 3,
180        //                 slidesToScroll: 1,
181        //             }
182        //         },
183
184        //         {
185        //             breakpoint: 1024,
186        //             settings: {
187        //                 slidesToShow: 2,
188        //                 slidesToScroll: 1,
189        //             }
190        //         },
191        //         {
192        //             breakpoint: 800,
193        //             settings: {
194        //                 slidesToShow: 1,
195        //                 slidesToScroll: 1,
196        //             }
197        //         }
198        //     ]
199
200        // });
201        // sbp.on("click", function () {
202        //     $(this).closest(".list-carousel").find('.listing-carousel').slick('slickPrev');
203        // });
204        // sbn.on("click", function () {
205        //     $(this).closest(".list-carousel").find('.listing-carousel').slick('slickNext');
206        // });
207        $('.client-carousel').slick({
208            infinite: true,
209            slidesToShow: 5,
210            dots: false,
211            arrows: false,
212            centerMode: true,
213            responsive: [{
214                    breakpoint: 1224,
215                    settings: {
216                        slidesToShow: 4,
217                        centerMode: false,
218                    }
219                },
220
221                {
222                    breakpoint: 768,
223                    settings: {
224                        slidesToShow: 2,
225                        centerMode: true,
226                    }
227                },
228                {
229                    breakpoint: 560,
230                    settings: {
231                        slidesToShow: 1,
232                        centerMode: false,
233                    }
234                }
235            ]
236
237        });
238        $('.sp-cont-prev').on("click", function () {
239            $(this).closest(".spons-list").find('.client-carousel').slick('slickPrev');
240        });
241        $('.sp-cont-next').on("click", function () {
242            $(this).closest(".spons-list").find('.client-carousel').slick('slickNext');
243        });
244        //sidebar ad
245
246        $('.sidebar-ad-carousel').slick({
247            infinite: true,
248            slidesToShow: 1,
249            dots: true,
250            arrows: false,
251            centerMode: false,
252            autoplay: true,
253        });
254
255        
256        //   lightGallery------------------
257        $(".image-popup").lightGallery({
258            selector: "this",
259            cssEasing: "cubic-bezier(0.25, 0, 0.25, 1)",
260            download: false,
261            counter: false,
262
263            subHtmlSelectorRelative: true
264        });
265        var o = $(".lightgallery"),
266            p = o.data("looped");
267        o.lightGallery({
268            selector: ".lightgallery a.popup-image",
269            cssEasing: "cubic-bezier(0.25, 0, 0.25, 1)",
270            download: false,
271            loop: false,
272    		counter: false,
273
274            subHtmlSelectorRelative: true
275        });
276        //   appear------------------
277        $(".stats").appear(function () {
278            $(".num").countTo();
279        });
280        
281        
282        //   scroll to------------------
283        $(".custom-scroll-link").on("click", function () {
284            var a = 70 + $(".scroll-nav-wrapper").height() + adminbarheight;
285            if (location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") || location.hostname == this.hostname) {
286                var b = $(this.hash);
287                b = b.length ? b : $("[name=" + this.hash.slice(1) + "]");
288                if (b.length) {
289                    $("html,body").animate({
290                        scrollTop: b.offset().top - a
291                    }, {
292                        queue: false,
293                        duration: 1200,
294                        easing: "easeInOutExpo"
295                    });
296                    return false;
297                }
298            }
299        });
300        $(".scroll-init  ul ").singlePageNav({
301            filter: ":not(.external)",
302            updateHash: false,
303            offset: 120 + adminbarheight,
304            threshold: 120,
305            speed: 1200,
306            currentClass: "act-scrlink"
307        });
308        $('.scroll-init a').each(function(){
309            if(!$(this.hash).length){
310                $(this).parent().hide()
311            }
312        })
313        $(".to-top").on("click", function (a) {
314            a.preventDefault();
315            $("html, body").animate({
316                scrollTop: 0
317            }, 800);
318            return false;
319        });
320        // scroll animation ------------------
321        $(window).on("scroll", function (a) {
322            if ($(this).scrollTop() > 150) {
323                $(".to-top").fadeIn(500);
324            } else {
325                $(".to-top").fadeOut(500);
326            }
327        });
328        
329        
330      
331
332        // Styles ------------------
333        if ($("footer.main-footer").hasClass("fixed-footer")) {
334            $('<div class="height-emulator fl-wrap"></div>').appendTo("#main-theme");
335        }
336        function csselem() {
337            $(".height-emulator").css({
338                height: $(".fixed-footer").outerHeight(true)
339            });
340            $(".slideshow-container .slideshow-item").css({
341                height: $(".slideshow-container").outerHeight(true)
342            });
343            $(".slider-container .slider-item").css({
344                height: $(".slider-container").outerHeight(true)
345            });
346        }
347        csselem();
348        // Mob Menu------------------
349        $(".nav-button-wrap").on("click", function () {
350            $(".main-menu").toggleClass("vismobmenu");
351        });
352        function mobMenuInit() {
353            var ww = $(window).width();
354            if (ww < 1064) {
355                $(".menusb").remove();
356                $(".main-menu").removeClass("nav-holder");
357                $(".main-menu nav").clone().addClass("menusb").appendTo(".main-menu");
358                $(".menusb").slidingMenu();
359            } else {
360                $(".menusb").remove();
361                $(".main-menu").addClass("nav-holder");
362            }
363        }
364        mobMenuInit();
365        //   css ------------------
366        var $window = $(window);
367        $window.resize(function () {
368            csselem();
369            mobMenuInit();
370        });
371
372        $( document.body ).bind( 'added_to_cart', function( event, fragments, cart_hash ) {
373            if( fragments && fragments['div.widget_shopping_cart_content'] ){
374                var cart_content = fragments['div.widget_shopping_cart_content'];
375
376                if($(cart_content).find('.mini_cart_item')){
377                    var cart_quantity_total = 0;
378                    $(cart_content).find('.mini_cart_item').each(function(){
379                        cart_quantity_total += parseInt($('span.quantity', this).text());
380                    });
381
382                    $('.attr-nav .cart-link .cart-count').text(cart_quantity_total);
383                }
384            }
385        });
386        $( document.body ).bind( 'removed_from_cart', function( event, fragments, cart_hash ) {
387            if( fragments && fragments['div.widget_shopping_cart_content'] ){
388                var cart_content = fragments['div.widget_shopping_cart_content'];
389
390                if($(cart_content).find('.mini_cart_item')){
391                    var cart_quantity_total = 0;
392                    $(cart_content).find('.mini_cart_item').each(function(){
393                        cart_quantity_total += parseInt($('span.quantity', this).text());
394                    });
395
396                    $('.attr-nav .cart-link .cart-count').text(cart_quantity_total);
397                }
398            }
399        });
400
401        var wlwrp = $(".header-modal"),
402            wllink = $(".show-header-modal");
403
404        function showWishlist() {
405            wlwrp.fadeIn(1).addClass("vis-wishlist").removeClass("novis_wishlist")
406            wllink.addClass("scwllink");
407        }
408
409        function hideWishlist() {
410            wlwrp.fadeOut(1).removeClass("vis-wishlist").addClass("novis_wishlist");
411            wllink.removeClass("scwllink");
412        }
413        wllink.on("click", function() {
414            if (wlwrp.hasClass("novis_wishlist")) showWishlist();
415            else hideWishlist();
416        });
417        $(".close-header-modal").on("click", function() {
418            hideWishlist();
419        });
420      
421    }
422    //   Parallax ------------------
423    function initparallax() {
424        var a = {
425            Android: function () {
426                return navigator.userAgent.match(/Android/i);
427            },
428            BlackBerry: function () {
429                return navigator.userAgent.match(/BlackBerry/i);
430            },
431            iOS: function () {
432                return navigator.userAgent.match(/iPhone|iPad|iPod/i);
433            },
434            Opera: function () {
435                return navigator.userAgent.match(/Opera Mini/i);
436            },
437            Windows: function () {
438                return navigator.userAgent.match(/IEMobile/i);
439            },
440            any: function () {
441                return a.Android() || a.BlackBerry() || a.iOS() || a.Opera() || a.Windows();
442            }
443        };
444        var trueMobile = a.any();
445        if (null == trueMobile) {
446            var b = new Scrollax();
447            b.reload();
448            b.init();
449        }
450        if (trueMobile) $(".bgvid , .background-vimeo , .background-youtube-wrapper ").remove();
451    }
452
453    //   Init All ------------------
454    $(function () {
455        initCitybook();
456        initparallax();
457
458        // A sample code to draw a polygon on main gmap. Available from 1.0.6
459        // window.addEventListener('listingsMapInit', function(e){
460
461        //     // console.log(window.listingsMap)
462
463        //     // Define the LatLng coordinates for the polygon's path.
464        //     var triangleCoords = [
465        //       {lat: 25.774, lng: -80.190},
466        //       {lat: 18.466, lng: -66.118},
467        //       {lat: 32.321, lng: -64.757},
468        //       {lat: 25.774, lng: -80.190}
469        //     ];
470
471        //     // Construct the polygon.
472        //     var bermudaTriangle = new google.maps.Polygon({
473        //       paths: triangleCoords,
474        //       strokeColor: '#FF0000',
475        //       strokeOpacity: 0.8,
476        //       strokeWeight: 2,
477        //       fillColor: '#FF0000',
478        //       fillOpacity: 0.35
479        //     });
480        //     bermudaTriangle.setMap(window.listingsMap);
481
482
483        // });
484
485        // // A sample code to change map style
486        // // https://developers.google.com/maps/documentation/javascript/styling#style-example
487        // window.addEventListener('listingsMapInit', function(e){
488            
489        //     window.listingsMap.setOptions({
490        //         styles: [{
491        //             "featureType": "administrative",
492        //             "elementType": "labels.text.fill",
493        //             "stylers": [{
494        //                 "color": "#444444"
495        //             }]
496        //         }]
497        //     });
498
499
500        // });
501
502        // // A sample code to modify OpenStreetMap
503        // // window.addEventListener('listingsOSMMapInit', function(e){
504        // window.addEventListener('listingsOSMMapLoaded', function(e){
505
506            
507
508        //     // var openCycleMapLayer = new ol.layer.Tile({
509        //     //     source: new ol.source.OSM({
510        //     //       attributions: [
511        //     //         'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>',
512        //     //         ol.source.OSM.ATTRIBUTION
513        //     //       ],
514        //     //       url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' +
515        //     //           '?apikey=Your API key from http://www.thunderforest.com/docs/apikeys/ here'
516        //     //     })
517        //     //   });
518
519        //       var openSeaMapLayer = new ol.layer.Tile({
520        //         source: new ol.source.OSM({
521        //           attributions: [
522        //             'All maps © <a href="http://www.openseamap.org/">OpenSeaMap</a>',
523        //             ol.source.OSM.ATTRIBUTION
524        //           ],
525        //           opaque: false,
526        //           url: 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png'
527        //         })
528        //     });
529
530        //     // window.listingsOSMMap.addLayer(openCycleMapLayer)
531        //     window.listingsOSMMap.addLayer(openSeaMapLayer)
532
533        // });
534
535    });
536
537})(jQuery);
538
539
540document.addEventListener('gesturestart', function (e) {
541    e.preventDefault();
542});

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.