PageSourceSearch

https://darksalmon-bee-319621.hostingersite.com/wp-content/themes/superio/js/functions.js?ver=20150330

js darksalmon-bee-319621.hostingersite.com collected 2026-10-03 04:19:30 UTC 25,147 bytes, 632 lines download raw bytes

1(function ($) {
2    "use strict";
3
4    if (!$.apusThemeExtensions)
5        $.apusThemeExtensions = {};
6    
7    function ApusThemeCore() {
8        var self = this;
9        // self.init();
10    };
11
12    ApusThemeCore.prototype = {
13        /**
14         *  Initialize
15         */
16        init: function() {
17            var self = this;
18            
19            self.preloadSite();
20
21            // slick init
22            self.initSlick($("[data-carousel=slick]"));
23
24            // Unveil init
25            setTimeout(function(){
26                self.layzyLoadImage();
27            }, 200);
28            
29            // isoto
30            self.initIsotope();
31
32            // Sticky Header
33            
34            self.initHeaderSticky('main-sticky-header');
35            if ( $('#main-container .layout-type-half-map').length <= 0 ) {
36                self.initHeaderSticky('header-mobile');
37            }
38
39            // back to top
40            self.backToTop();
41
42            // popup image
43            self.popupImage();
44
45            $('[data-toggle="tooltip"]').tooltip();
46
47            self.initMobileMenu();
48
49            self.mainMenuInit();
50            
51            self.dashboardMenu();
52
53            $(window).resize(function(){
54                setTimeout(function(){
55                    self.dashboardMenu();
56                }, 50);
57            });
58            
59            self.advanceFilter();
60            
61            $('.more').on('click', function(){
62                $('.wrapper-morelink').toggleClass('active');
63            });
64            
65
66            $(document.body).on('click', '.nav [data-toggle="dropdown"]' ,function(){
67                if ( this.href && this.href != '#'){
68                    window.location.href = this.href;
69                }
70            });
71
72            self.loadExtension();
73        },
74        /**
75         *  Extensions: Load scripts
76         */
77        loadExtension: function() {
78            var self = this;
79            
80            if ($.apusThemeExtensions.shop) {
81                $.apusThemeExtensions.shop.call(self);
82            }
83
84            if ($.apusThemeExtensions.job_map) {
85                $.apusThemeExtensions.job_map.call(self);
86            }
87
88            if ($.apusThemeExtensions.job) {
89                $.apusThemeExtensions.job.call(self);
90            }
91        },
92        initSlick: function(element) {
93            var self = this;
94            element.each( function(){
95                var config = {
96                    infinite: false,
97                    arrows: $(this).data( 'nav' ),
98                    dots: $(this).data( 'pagination' ),
99                    slidesToShow: 4,
100                    slidesToScroll: 4,
101                    prevArrow:"<button type='button' class='slick-arrow slick-prev'><i class='ti-angle-left' aria-hidden='true'></i></span><span class='textnav'>"+ superio_ajax.previous +"</span></button>",
102                    nextArrow:"<button type='button' class='slick-arrow slick-next'><span class='textnav'>"+ superio_ajax.next +"</span><i class='ti-angle-right' aria-hidden='true'></i></button>",
103                };
104            
105                var slick = $(this);
106                if( $(this).data('items') ){
107                    config.slidesToShow = $(this).data( 'items' );
108                    config.slidesToScroll = $(this).data( 'items' );
109                }
110                if( $(this).data('infinite') ){
111                    config.infinite = true;
112                }
113                if( $(this).data('autoplay') ){
114                    config.autoplay = true;
115                    config.autoplaySpeed = 1500;
116                    config.pauseOnHover = true;
117                }
118                if( $(this).data('disable_draggable') ){
119                    config.touchMove = false;
120                    config.draggable = false;
121                    config.swipe = false;
122                    config.swipeToSlide = false;
123                }
124                if( $(this).data('centermode') ){
125                    config.centerMode = true;
126                }
127                if( $(this).data('centerpadding') ){
128                    config.centerPadding = $(this).data('centerpadding');;
129                }
130                if( $(this).data('vertical') ){
131                    config.vertical = true;
132                }
133                if( $(this).data('rows') ){
134                    config.rows = $(this).data( 'rows' );
135                }
136                if( $(this).data('asnavfor') ){
137                    config.asNavFor = $(this).data( 'asnavfor' );
138                }
139                if( $(this).data('slidestoscroll') ){
140                    config.slidesToScroll = $(this).data( 'slidestoscroll' );
141                }
142                if( $(this).data('focusonselect') ){
143                    config.focusOnSelect = $(this).data( 'focusonselect' );
144                }
145                if ($(this).data('large')) {
146                    var desktop = $(this).data('large');
147                } else {
148                    var desktop = config.items;
149                }
150                if ($(this).data('smalldesktop')) {
151                    var smalldesktop = $(this).data('smalldesktop');
152                } else {
153                    if ($(this).data('large')) {
154                        var smalldesktop = $(this).data('large');
155                    } else{
156                        var smalldesktop = config.items;
157                    }
158                }
159                if ($(this).data('medium')) {
160                    var medium = $(this).data('medium');
161                } else {
162                    var medium = config.items;
163                }
164                if ($(this).data('smallmedium')) {
165                    var smallmedium = $(this).data('smallmedium');
166                } else {
167                    var smallmedium = 2;
168                }
169                if ($(this).data('extrasmall')) {
170                    var extrasmall = $(this).data('extrasmall');
171                } else {
172                    var extrasmall = 2;
173                }
174                if ($(this).data('smallest')) {
175                    var smallest = $(this).data('smallest');
176                } else {
177                    var smallest = 1;
178                }
179
180                if ($(this).data('slidestoscroll_large')) {
181                    var slidestoscroll_desktop = $(this).data('slidestoscroll_large');
182                } else {
183                    var slidestoscroll_desktop = config.slidesToScroll;
184                }
185                if ($(this).data('slidestoscroll_smalldesktop')) {
186                    var slidestoscroll_smalldesktop = $(this).data('slidestoscroll_smalldesktop');
187                } else {
188                    if ($(this).data('slidestoscroll_large')) {
189                        var slidestoscroll_smalldesktop = $(this).data('slidestoscroll_large');
190                    } else{
191                        var slidestoscroll_smalldesktop = config.items;
192                    }
193                }
194                if ($(this).data('slidestoscroll_medium')) {
195                    var slidestoscroll_medium = $(this).data('slidestoscroll_medium');
196                } else {
197                    var slidestoscroll_medium = config.items;
198                }
199                if ($(this).data('slidestoscroll_smallmedium')) {
200                    var slidestoscroll_smallmedium = $(this).data('slidestoscroll_smallmedium');
201                } else {
202                    var slidestoscroll_smallmedium = smallmedium;
203                }
204                if ($(this).data('slidestoscroll_extrasmall')) {
205                    var slidestoscroll_extrasmall = $(this).data('slidestoscroll_extrasmall');
206                } else {
207                    var slidestoscroll_extrasmall = extrasmall;
208                }
209                if ($(this).data('slidestoscroll_smallest')) {
210                    var slidestoscroll_smallest = $(this).data('slidestoscroll_smallest');
211                } else {
212                    var slidestoscroll_smallest = smallest;
213                }
214                config.responsive = [
215                    {
216                        breakpoint: 321,
217                        settings: {
218                            slidesToShow: smallest,
219                            slidesToScroll: slidestoscroll_smallest,
220                        }
221                    },
222                    {
223                        breakpoint: 480,
224                        settings: {
225                            slidesToShow: extrasmall,
226                            slidesToScroll: slidestoscroll_extrasmall,
227                        }
228                    },
229                    {
230                        breakpoint: 769,
231                        settings: {
232                            slidesToShow: smallmedium,
233                            slidesToScroll: slidestoscroll_smallmedium
234                        }
235                    },
236                    {
237                        breakpoint: 981,
238                        settings: {
239                            slidesToShow: medium,
240                            slidesToScroll: slidestoscroll_medium
241                        }
242                    },
243                    {
244                        breakpoint: 1200,
245                        settings: {
246                            slidesToShow: smalldesktop,
247                            slidesToScroll: slidestoscroll_smalldesktop
248                        }
249                    },
250                    {
251                        breakpoint: 1501,
252                        settings: {
253                            slidesToShow: desktop,
254                            slidesToScroll: slidestoscroll_desktop
255                        }
256                    }
257                ];
258                if ( $('html').attr('dir') == 'rtl' ) {
259                    config.rtl = true;
260                }
261
262                $(this).slick( config );
263
264            } );
265
266            // Fix slick in bootstrap tabs
267            $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
268                var target = $(e.target).attr("href");
269                var $slick = $("[data-carousel=slick]", target);
270
271                if ($slick.length > 0 && $slick.hasClass('slick-initialized')) {
272                    $slick.slick('refresh');
273                }
274                self.layzyLoadImage();
275            });
276        },
277        layzyLoadImage: function() {
278            $(window).off('scroll.unveil resize.unveil lookup.unveil');
279            var $images = $('.image-wrapper:not(.image-loaded) .unveil-image'); // Get un-loaded images only
280            if ($images.length) {
281                $images.unveil(1, function() {
282                    $(this).load(function() {
283                        $(this).parents('.image-wrapper').first().addClass('image-loaded');
284                        $(this).removeAttr('data-src');
285                        $(this).removeAttr('data-srcset');
286                        $(this).removeAttr('data-sizes');
287                    });
288                });
289            }
290
291            var $images = $('.product-image:not(.image-loaded) .unveil-image'); // Get un-loaded images only
292            if ($images.length) {
293                $images.unveil(1, function() {
294                    $(this).load(function() {
295                        $(this).parents('.product-image').first().addClass('image-loaded');
296                    });
297                });
298            }
299        },
300        initIsotope: function() {
301            $('.isotope-items').each(function(){  
302                var $container = $(this);
303                
304                $container.imagesLoaded( function(){
305                    $container.isotope({
306                        itemSelector : '.isotope-item',
307                        transformsEnabled: true,         // Important for videos
308                        masonry: {
309                            columnWidth: $container.data('columnwidth')
310                        }
311                    }); 
312                });
313            });
314
315            /*---------------------------------------------- 
316             *    Apply Filter        
317             *----------------------------------------------*/
318            $('.isotope-filter li a').on('click', function(){
319               
320                var parentul = $(this).parents('ul.isotope-filter').data('related-grid');
321                $(this).parents('ul.isotope-filter').find('li a').removeClass('active');
322                $(this).addClass('active');
323                var selector = $(this).attr('data-filter'); 
324                $('#'+parentul).isotope({ filter: selector }, function(){ });
325                
326                return(false);
327            });
328        },
329
330        initHeaderSticky: function(main_sticky_class) {
331            if ( $('.' + main_sticky_class).length ) {
332                if ( typeof Waypoint !== 'undefined' ) {
333                    if ( $('.' + main_sticky_class) && typeof Waypoint.Sticky !== 'undefined' ) {
334                        var sticky = new Waypoint.Sticky({
335                            element: $('.' + main_sticky_class)[0],
336                            wrapper: '<div class="main-sticky-header-wrapper">',
337                            offset: '-10px',
338                            stuckClass: 'sticky-header'
339                        });
340                    }
341                }
342            }
343        },
344        backToTop: function () {
345            $(window).scroll(function () {
346                if ($(this).scrollTop() > 400) {
347                    $('#back-to-top').addClass('active');
348                } else {
349                    $('#back-to-top').removeClass('active');
350                }
351            });
352            $('#back-to-top').on('click', function () {
353                $('html, body').animate({scrollTop: '0px'}, 800);
354                return false;
355            });
356        },
357        
358        popupImage: function() {
359            // popup
360            $(".popup-image").magnificPopup({type:'image'});
361            $('.popup-video').magnificPopup({
362                disableOn: 700,
363                type: 'iframe',
364                mainClass: 'mfp-fade',
365                removalDelay: 160,
366                preloader: false,
367                fixedContentPos: false
368            });
369
370            $('.candidate-detail-portfolio11').each(function(){
371                var tagID = $(this).attr('id');
372                $('#' + tagID).magnificPopup({
373                    delegate: '.popup-image-gallery',
374                    type: 'image',
375                    tLoading: 'Loading image #%curr%...',
376                    mainClass: 'mfp-img-mobile',
377                    gallery: {
378                        enabled: true,
379                        navigateByImgClick: true,
380                        preload: [0,1] // Will preload 0 - before current, and 1 after the current image
381                    }
382                });
383            });
384
385            $('body').on('click', '.close-magnific-popup', function() {
386                $.magnificPopup.close();
387            });
388        },
389        preloadSite: function() {
390            // preload page
391            if ( $('body').hasClass('apus-body-loading') ) {
392                setTimeout(function(){
393                    $('body').removeClass('apus-body-loading');
394                    $('.apus-page-loading').fadeOut(100);
395                }, 100);
396            }
397        },
398
399        initMobileMenu: function() {
400
401            // stick mobile
402            var self = this;
403
404            // mobile menu
405            $('.btn-toggle-canvas,.btn-showmenu').on('click', function (e) {
406                e.stopPropagation();
407                $('.apus-offcanvas').toggleClass('active');           
408                $('.over-dark').toggleClass('active');
409
410                $("#mobile-menu-container").slidingMenu({
411                    backLabel: superio_ajax.menu_back_text
412                });
413            });
414            $('body').on('click', function() {
415                if ($('.apus-offcanvas').hasClass('active')) {
416                    $('.apus-offcanvas').toggleClass('active');
417                    $('.over-dark').toggleClass('active');
418                }
419            });
420            $('.apus-offcanvas').on('click', function(e) {
421                e.stopPropagation();
422            });
423            
424            // $('.apus-offcanvas-body').perfectScrollbar();
425            
426            // sidebar mobile
427            if ($(window).width() < 992) {
428                $('.sidebar-wrapper > .sidebar-right, .sidebar-wrapper > .sidebar-left').perfectScrollbar();
429            }
430            $('body').on('click', '.mobile-sidebar-btn', function(){
431                if ( $('.sidebar-left').length > 0 ) {
432                    $('.sidebar-left').toggleClass('active');
433                } else if ( $('.sidebar-right').length > 0 ) {
434                    $('.sidebar-right').toggleClass('active');
435                }
436                $('.mobile-sidebar-panel-overlay').toggleClass('active');
437            });
438            $('body').on('click', '.mobile-sidebar-panel-overlay, .close-sidebar-btn', function(){
439                if ( $('.sidebar-left').length > 0 ) {
440                    $('.sidebar-left').removeClass('active');
441                } else if ( $('.sidebar-right').length > 0 ) {
442                    $('.sidebar-right').removeClass('active');
443                }
444                $('.mobile-sidebar-panel-overlay').removeClass('active');
445            });
446
447            $('#apus-header-mobile .btn-menu-account').on('click', function (e) {
448                e.stopPropagation();
449                $(this).closest('.top-wrapper-menu').toggleClass('active'); 
450            });
451            $('body').on('click', function() {
452                $('#apus-header-mobile .top-wrapper-menu').removeClass('active');
453            });
454            $('#apus-header-mobile .top-wrapper-menu .inner-top-menu').on('click', function(e) {
455                e.stopPropagation();
456            });
457            
458        },
459        advanceFilter: function() {
460            $('body').on('click', '.filter-job-top .toggle-adv', function(e){
461                e.preventDefault();
462                $('.filter-job-top .advance-fields').toggle('slow');
463            });
464        },
465        mainMenuInit: function() {
466            $('.apus-megamenu .megamenu .has-mega-menu.aligned-fullwidth').each(function(e){
467                var $this = $(this),
468                    i = $this.closest(".elementor-section"),
469                    a = $this.closest('.apus-megamenu');
470
471                if ( !$this.find('.elementor-element').hasClass('elementor-section-stretched') ) {
472                    $this.on('mouseenter', function(){
473                        var m = $(this).find('> .dropdown-menu .dropdown-menu-inner'),
474                            w = i.outerWidth();
475
476                        m.css({
477                            width: w,
478                            marginLeft: i.offset().left - $this.offset().left
479                        });
480                    });
481                }
482
483                
484            });
485
486            $('.apus-megamenu .megamenu').each(function(e){
487                var $this = $(this);
488                $this.find('.elementor-element').addClass('no-transparent');
489            });
490        },
491        dashboardMenu: function() {
492            $('body').on('click', '.together-sidebar-account', function(e){
493                e.preventDefault();
494                $('.inner-dashboard.container-fluid').toggleClass('active');
495            });
496
497            if ($(window).width() > 991) {
498                if ( $('#apus-header').length > 0 ) {
499                    var header_height = $('#apus-header').outerHeight();
500                    $('.inner-dashboard.container-fluid .sidebar-wrapper .sidebar').css({ 'top': header_height, 'height' : 'calc(100vh - ' + header_height + 'px)' });
501                }
502            } else {
503                if ( $('#apus-header-mobile').length > 0 ) {
504                    $('.inner-dashboard.container-fluid .sidebar-wrapper .sidebar').css({ 'top': 0, 'height' : 'calc(100vh)' });
505                }
506            }
507            $('.inner-dashboard.container-fluid aside.sidebar').perfectScrollbar();
508        },
509
510        setCookie: function(cname, cvalue, exdays) {
511            var d = new Date();
512            d.setTime(d.getTime() + (exdays*24*60*60*1000));
513            var expires = "expires="+d.toUTCString();
514            document.cookie = cname + "=" + cvalue + "; " + expires+";path=/";
515        },
516        getCookie: function(cname) {
517            var name = cname + "=";
518            var ca = document.cookie.split(';');
519            for(var i=0; i<ca.length; i++) {
520                var c = ca[i];
521                while (c.charAt(0)==' ') c = c.substring(1);
522                if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
523            }
524            return "";
525        }
526    }
527
528    $.apusThemeCore = ApusThemeCore.prototype;
529    
530    
531    $.fn.wrapStart = function(numWords){
532        return this.each(function(){
533            var $this = $(this);
534            var node = $this.contents().filter(function(){
535                return this.nodeType == 3;
536            }).first(),
537            text = node.text().trim(),
538            first = text.split(' ', 1).join(" ");
539            if (!node.length) return;
540            node[0].nodeValue = text.slice(first.length);
541            node.before('<b>' + first + '</b>');
542        });
543    };
544
545    $(document).ready(function() {
546        // Initialize script
547        var apusthemecore_init = new ApusThemeCore();
548        apusthemecore_init.init();
549
550        $('.mod-heading .widget-title > span').wrapStart(1);
551    });
552
553    jQuery(window).on("elementor/frontend/init", function() {
554        
555        var apusthemecore_init = new ApusThemeCore();
556
557        // General element
558        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_brands.default",
559            function($scope) {
560                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
561            }
562        );
563
564        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_features_box.default",
565            function($scope) {
566                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
567            }
568        );
569
570        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_instagram.default",
571            function($scope) {
572                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
573            }
574        );
575
576        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_posts.default",
577            function($scope) {
578                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
579            }
580        );
581
582        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_testimonials.default",
583            function($scope) {
584                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
585            }
586        );
587
588        // jobs elements
589        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_job_board_pro_jobs.default",
590            function($scope) {
591                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
592            }
593        );
594
595        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_job_board_pro_jobs_tabs.default",
596            function($scope) {
597                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
598            }
599        );
600
601        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_job_board_pro_candidates.default",
602            function($scope) {
603                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
604            }
605        );
606        
607        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_job_board_pro_employers.default",
608            function($scope) {
609                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
610            }
611        );
612
613        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_job_board_pro_jobs_vertical_carousel.default",
614            function($scope) {
615                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
616
617                $scope.find('.slick-carousel').on('wheel', (function(e) {
618                    e.preventDefault();
619
620                    if (e.originalEvent.deltaY < 0) {
621                        $(this).slick('slickPrev');
622                    } else {
623                        $(this).slick('slickNext');
624                    }
625                }));
626            }
627        );
628
629    });
630
631})(jQuery);
632

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.