PageSourceSearch

https://www.kpu.go.id/frontend_assets/js/functions.js

js kpu.go.id collected 2026-09-24 08:58:45 UTC 103,645 bytes, 2,385 lines download raw bytes

1//----------------------------------------------------/
2//
3//      POLO - HTML5 Template
4//      Author: INSPIRO - Ardian Berisha
5//      Version: v4.5
6//      Update: 20/01/2019
7//
8//----------------------------------------------------/
9
10//Global var
11var INSPIRO = {},
12    $ = jQuery.noConflict();
13
14(function ($) {
15    // USE STRICT
16    "use strict";
17
18    //----------------------------------------------------/
19    // Predefined Global Variables
20    //----------------------------------------------------/
21    var $window = $(window),
22
23        //Theme
24        $theme_color = '#2250fc',
25
26        //Main
27        $body = $('body'),
28        $bodyInner = $('.body-inner'),
29        $section = $('section'),
30
31        //Header
32        $topbar = $('#topbar'),
33        $header = $('#header'),
34        $headerCurrentClasses = $header.attr('class'),
35
36        //Logo
37        headerLogo = $('#logo').find('.logo'),
38        headerLogoSrc = headerLogo.find('img').attr('src'),
39        headerLogoSrcDark = headerLogo.attr('data-src-dark'),
40        HeaderLogoSrcFixed = headerLogo.attr('data-src-fixed'),
41        HeaderLogoSrcResponsive = headerLogo.attr('data-src-responsive'),
42
43        //Main menu
44        $mainmenu = $('#mainMenu'),
45        $mainmenuitems = $mainmenu.find('li.dropdown > a'),
46        $mainsubmenuitems = $mainmenu.find('li.dropdown-submenu > a, li.dropdown-submenu > span'),
47
48        //sidebarOverlay
49        sidebarOverlay = $('#side-panel'),
50        $pageMenu = $('.page-menu'),
51
52        /*Footer*/
53        $footer = $('#footer'),
54        fullScreenPanel = $('#fullscreen-panel'),
55
56        //Window size control
57        $fullScreen = $('.fullscreen') || $('.section-fullscreen'),
58        $halfScreen = $('.halfscreen'), //Slider
59        $slider = $('#slider'),
60        $inspiroSlider = $('.inspiro-slider'),
61        $carousel = $('.carousel'),
62
63        /*Grid Layout*/
64        $gridLayout = $(".grid-layout"),
65        $gridFilter = $(".grid-filter"),
66
67        windowWidth = $window.width(),
68
69        $developmentMode = true;
70
71    //Check header exist
72    if ($header.length > 0) {
73        var $headerOffsetTop = $header.offset().top;
74    }
75
76    //Window breakpoints
77    $(window).breakpoints({
78        breakpoints: [{
79            "name": "xs",
80            "width": 0
81        }, {
82            "name": "sm",
83            "width": 576
84        }, {
85            "name": "md",
86            "width": 768
87        }, {
88            "name": "lg",
89            "width": 992
90        }, {
91            "name": "xl",
92            "width": 1200
93        }]
94    });
95
96    var currentBreakpoint = $(window).breakpoints("getBreakpoint");
97
98    $body.addClass('breakpoint-' + currentBreakpoint);
99
100    $(window).bind("breakpoint-change", function (breakpoint) {
101        $body.removeClass('breakpoint-' + breakpoint.from);
102        $body.addClass('breakpoint-' + breakpoint.to);
103    });
104
105    INSPIRO.core = {
106        functions: function () {
107            INSPIRO.core.scrollTop();
108            INSPIRO.core.screenSizeControl();
109            INSPIRO.core.rtlStatus();
110            INSPIRO.core.equalize();
111        },
112        scrollTop: function () {
113
114            var $scrollTop = $('#scrollTop');
115
116            if ($scrollTop.length > 0) {
117
118                var scrollOffset = $body.attr('data-offset') || 400;
119
120                if ($window.scrollTop() > scrollOffset) {
121                    $scrollTop.css({
122                        'bottom': '26px',
123                        'opacity': 1,
124                        'z-index': 1
125                    });
126                } else {
127                    $scrollTop.css({
128                        'bottom': '16px',
129                        'opacity': 0
130                    });
131                }
132
133                $scrollTop.off('click').on('click', function () {
134                    $('body,html').stop(true).animate({
135                        'scrollTop': 0
136                    }, 1000, 'easeInOutExpo');
137                    return false;
138                });
139            }
140        },
141
142        //chkd
143        screenSizeControl: function () {
144
145            if ($fullScreen.length > 0) {
146                $fullScreen.each(function () {
147                    var $elem = $(this),
148                        elemHeight = $window.height();
149
150                        
151                        $(window).breakpoints("greaterEqualTo", "lg", function () {
152                            $elem.css('height', elemHeight);
153                        });
154
155                        
156                        $(window).breakpoints("lessThan", "lg", function () {
157                            if($(".text-middle").length> 0) {
158                            var fullScreenContentHeight = $elem.find(".text-middle").height() + 100;
159                            console.log(fullScreenContentHeight);
160
161                            $elem.css({
162                                'height': fullScreenContentHeight,
163                                'padding': '60px 15px 120px'
164                            }); 
165                        }else {
166                            $elem.css('height', elemHeight);
167                        }
168                        });
169
170                });
171            }
172            if ($halfScreen.length > 0) {
173                $halfScreen.each(function () {
174                    var $elem = $(this),
175                        elemHeight = $window.height();
176                    $elem.css('height', elemHeight / 1.5);
177                });
178            }
179        },
180        //chkd
181        rtlStatus: function () {
182            var $rtlStatusCheck = $("html").attr("dir");
183            var $rtlStatus = false;
184            if ($rtlStatusCheck == "rtl") {
185                $('head').append('<link rel="stylesheet" type="text/css" href="css/rtl.css">');
186                $rtlStatus = true;
187            } else {
188                $rtlStatus = false;
189            }
190        },
191
192        equalize: function () {
193
194            var $equalize = $('.equalize');
195
196            if ($equalize.length > 0) {
197                $equalize.each(function () {
198
199                    var elem = $(this),
200                        selectorItem = elem.find(elem.attr('data-equalize-item')) || "> div",
201                        maxHeight = 0;
202
203                    selectorItem.each(function () {
204                        if ($(this).outerHeight(true) > maxHeight) {
205                            maxHeight = $(this).outerHeight(true);
206                        }
207                    });
208                    selectorItem.height(maxHeight);
209
210                });
211            }
212        }
213    };
214    INSPIRO.header = {
215        functions: function () {
216            INSPIRO.header.logoStatus();
217            INSPIRO.header.stickyHeader();
218            INSPIRO.header.topBar();
219            INSPIRO.header.search();
220            INSPIRO.header.mainMenu();
221            INSPIRO.header.pageMenu();
222            INSPIRO.header.sidebarOverlay();
223            INSPIRO.header.dotsMenu();
224            INSPIRO.header.onepageMenu();
225        },
226        logoStatus: function () {
227            $(window).breakpoints("greaterEqualTo", "lg", function () {
228                if ($header.hasClass('dark') && headerLogoSrcDark) {
229                    headerLogo.find('img').attr('src', headerLogoSrcDark);
230                } else {
231                    headerLogo.find('img').attr('src', headerLogoSrc);
232                }
233
234                if (HeaderLogoSrcFixed && $header.hasClass('header-sticky')) {
235                    headerLogo.find('img').attr('src', HeaderLogoSrcFixed);
236                }
237            });
238
239            $(window).breakpoints("lessThan", "lg", function () {
240                if ($header.hasClass('dark') && headerLogoSrcDark) {
241                    headerLogo.find('img').attr('src', headerLogoSrcDark);
242                }
243                if ($header.hasClass('dark') && $header.attr('data-transparent') == "true") {
244                    headerLogo.find('img').attr('src', headerLogoSrc);
245                }
246
247                if (HeaderLogoSrcResponsive) {
248                    headerLogo.find('img').attr('src', HeaderLogoSrcResponsive);
249                }
250            });
251        },
252        stickyHeader: function () {
253
254            var elem = $(this),
255                shrinkHeader = elem.attr('data-shrink') || 0,
256                shrinkHeaderActive = elem.attr('data-sticky-active') || 200,
257                scrollOnTop = $window.scrollTop();
258
259            if ($header.hasClass("header-modern")) {
260                shrinkHeader = 300;
261            }
262
263            $(window).breakpoints("greaterEqualTo", "lg", function () {
264
265                if (!$header.is(".header-disable-fixed, .header-always-fixed")) {
266                    if (scrollOnTop > $headerOffsetTop + shrinkHeader) {
267                        $header.addClass('header-sticky');
268                        if (scrollOnTop > $headerOffsetTop + shrinkHeaderActive) {
269                            $header.addClass('sticky-active');
270                            if ($header.hasClass('dark') && $header.attr('data-transparent') == "true" && !$body.hasClass('overlay-menu')) {
271                                $header.removeClass('dark');
272                            }
273                            INSPIRO.header.logoStatus();
274                        }
275                    } else {
276                        $header.removeClass().addClass($headerCurrentClasses);
277                        INSPIRO.header.logoStatus();
278                    }
279                }
280            });
281
282
283            $(window).breakpoints("lessThan", "lg", function () {
284
285                if ($header.attr('data-responsive-fixed') == "true") {
286                    if (scrollOnTop > $headerOffsetTop + shrinkHeader) {
287                        $header.addClass('header-sticky');
288                        if (scrollOnTop > $headerOffsetTop + shrinkHeaderActive) {
289                            $header.addClass('sticky-active');
290                            if ($header.hasClass('dark') && $header.attr('data-transparent') == "true" && !$body.hasClass('overlay-menu')) {
291                                $header.removeClass('dark');
292                            }
293                            INSPIRO.header.logoStatus();
294                        }
295                    } else {
296                        $header.removeClass().addClass($headerCurrentClasses);
297                        INSPIRO.header.logoStatus();
298                    }
299                }
300
301            });
302
303        },
304        //chkd
305        topBar: function () {
306            if ($topbar.length > 0) {
307                $("#topbar .topbar-dropdown .topbar-form").each(function (index, element) {
308                    if ($window.width() - ($(element).width() + $(element).offset().left) < 0) {
309                        $(element).addClass('dropdown-invert');
310                    }
311                });
312            }
313        },
314        search: function () {
315
316            var $search = $('#search');
317
318            if ($search.length > 0) {
319                var searchBtn = $('#btn-search'),
320                    searchBtnClose = $('#btn-search-close'),
321                    searchInput = $search.find('.form-control');
322
323                function openSearch() {
324                    $body.addClass('search-open');
325                    searchInput.focus();
326                }
327
328                function closeSearch() {
329                    $body.removeClass('search-open');
330                    searchInput.value = '';
331                }
332
333                searchBtn.on('click touchend', function () {
334                    openSearch();
335                    return false;
336                });
337                searchBtnClose.on('click touchend', function () {
338                    closeSearch();
339                    return false;
340                });
341
342                document.addEventListener('keyup', function (ev) {
343                    if (ev.keyCode == 27) {
344                        closeSearch();
345                    }
346                });
347            }
348        },
349        //chkd
350        mainMenu: function () {
351            if ($mainmenu.length > 0) {
352
353                if ($body.is('.breakpoint-lg, .breakpoint-xl')) {
354                    $("body #mainMenu.menu-onclick nav > ul > li.dropdown > a, body .dropdown-submenu > a, body .dropdown-submenu > span").on('click touchend', function (e) {
355                        $(this).parent('li').siblings().removeClass('hover-active').removeClass('current');
356                        $(this).parent('li').toggleClass('hover-active');
357                        return false;
358                    });
359
360                } else {
361                    $("#mainMenu nav > ul > li.dropdown > a, .dropdown-submenu > a, .dropdown-submenu > span, .page-menu nav > ul > li.dropdown > a").on('click touchend', function (e) {
362                        $(this).parent('li').siblings().removeClass('hover-active');
363                        $(this).parent('li').toggleClass('hover-active');
364                        return false;
365                    });
366                }
367
368                $("#mainMenu-trigger button").on('click touchend', function (e) {
369                    $body.toggleClass("mainMenu-open");
370                    $(this).toggleClass("toggle-active");
371                    if ($body.hasClass("mainMenu-open")) {
372                        $header.find("#mainMenu").css("max-height", $window.height() - $header.height());
373                    } else {
374                        $header.find("#mainMenu").css("max-height", 0);
375                    }
376                    return false;
377                });
378
379
380                $(window).breakpoints("greaterEqualTo", "lg", function () {
381                    /*invert menu fix*/
382                    var $menuLastItem = $("nav > ul > li:last-child"),
383                        $menuLastItemUl = $("nav > ul > li:last-child > ul"),
384                        $menuLastInvert = $menuLastItemUl.width() - $menuLastItem.width(),
385                        $menuItems = $("nav > ul > li").find(".dropdown-menu");
386
387                    $menuItems.css('display', 'block');
388                    $('.dropdown:not(.mega-menu-item) ul ul').each(function (index, element) {
389                        if ($window.width() - ($(element).width() + $(element).offset().left) < 0) {
390                            $(element).addClass('menu-invert');
391                        }
392                    });
393
394                    if ($window.width() - ($menuLastItemUl.width() + $menuLastItem.offset().left) < 0) {
395                        $menuLastItemUl.addClass('menu-last');
396                    }
397                    $menuItems.css('display', '');
398                });
399            }
400        },
401
402        /*Page Menu*/
403        pageMenu: function () {
404            if ($pageMenu.length > 0) {
405                $pageMenu.each(function () {
406                    $("#pageMenu-trigger").on("click", function () {
407                        $pageMenu.toggleClass("page-menu-active");
408                        $pageMenu.toggleClass("items-visible");
409                    });
410                });
411            }
412        },
413        sidebarOverlay: function () {
414            if (sidebarOverlay.length > 0) {
415                sidebarOverlay.css("opacity", 1);
416                $("#close-panel").on("click", function () {
417                    $body.removeClass("side-panel-active side-panel-push");
418                    $("#side-panel-trigger").removeClass("toggle-active");
419                });
420                var t = setTimeout(function () {
421                    INSPIRO.elements.gridLayoutRefresh();
422                }, 1000);
423            }
424        },
425        dotsMenu: function () {
426
427            var $dotsMenu = $('#dotsMenu'),
428                $dotsMenuItems = $dotsMenu.find("ul > li > a");
429
430            if ($dotsMenu.length > 0) {
431                $dotsMenuItems.on('click', function () {
432                    $dotsMenuItems.parent("li").removeClass('current');
433                    $(this).parent("li").addClass('current');
434                    return false;
435                });
436
437                $dotsMenuItems.parents("li").removeClass('current');
438                $dotsMenu.find('a[href="#' + INSPIRO.header.currentSection() + '"]').parent("li").addClass('current');
439            }
440        },
441        onepageMenu: function () {
442            if ($mainmenu.hasClass("menu-one-page")) {
443                var $currentMenuItem = "current";
444                $(window).on("scroll", function () {
445                    var $currentSection = INSPIRO.header.currentSection();
446                    $mainmenu.find("nav > ul > li > a").parents("li").removeClass($currentMenuItem);
447                    $mainmenu.find('nav > ul > li > a[href="#' + $currentSection + '"]').parent("li").addClass($currentMenuItem);
448                });
449            }
450        },
451
452        currentSection: function () {
453            var elemCurrent = "body";
454            $section.each(function () {
455                var elem = $(this),
456                    elemeId = elem.attr("id");
457
458                if ((elem.offset().top - $window.height() / 3 < $window.scrollTop()) && (elem.offset().top + elem.height() - $window.height() / 3 > $window.scrollTop())) {
459                    elemCurrent = elemeId;
460                }
461            });
462            return elemCurrent;
463        }
464    };
465    INSPIRO.slider = {
466        functions: function () {
467            INSPIRO.slider.inspiroSlider();
468            INSPIRO.slider.owlCarousel();
469        },
470        //chkd
471        sliderScreenSizeControl: function (elem) {
472
473            var headerHeight = $header.outerHeight(),
474                topbarHeight = $topbar.outerHeight() || 0,
475                windowHeight = $window.height(),
476                screenHeightExtra = headerHeight + topbarHeight,
477
478                $sliderClassOuter = ".owl-stage-outer",
479                $sliderClassStage = ".owl-stage",
480                $sliderClassSlide = ".slide",
481                sliderTargetElements = [elem, elem.find($sliderClassOuter), elem.find($sliderClassStage), elem.find($sliderClassSlide)],
482                sliderFullscreen = elem.hasClass('slider-fullscreen'),
483                screenRatio = elem.hasClass('slider-fullscreen') ? 1 : 1.2,
484                transparentHeader = $header.attr('data-transparent="true"') || $header.hasClass("header-modern"),
485                customHeight = elem.attr("data-height"),
486                responsiveHeightxs = elem.attr("data-height-xs") || 300;
487
488
489
490            $(window).breakpoints("greaterEqualTo", "lg", function () {
491                if (transparentHeader) {
492                    if (sliderFullscreen) {
493                        $.each(sliderTargetElements, function (index, divElem) {
494                            if ($topbar.length > 0) {
495
496                            } else {}
497                            divElem.css('height', $(window).height() + 'px');
498                        });
499                    } else {
500                        if (!$header.attr('data-transparent="true"')) {
501                            elem.find($sliderClassSlide).css('padding-top', screenHeightExtra + 'px');
502                        }
503                        if (!customHeight) {
504                            $.each(sliderTargetElements, function (index, divElem) {
505                                divElem.css('height', $(window).height() / screenRatio + 'px');
506                            });
507                        } else {
508                            $.each(sliderTargetElements, function (index, divElem) {
509                                divElem.css('height', customHeight + 'px');
510                            });
511
512                        }
513                    }
514                } else {
515                    if (sliderFullscreen) {
516                        $.each(sliderTargetElements, function (index, divElem) {
517                            divElem.css('height', $(window).height() + 'px');
518                        });
519
520                    } else {
521                        $.each(sliderTargetElements, function (index, divElem) {
522                            divElem.css('height', $(window).height() / screenRatio - screenHeightExtra + 'px');
523                        });
524                    }
525                    if (customHeight) {
526                        $.each(sliderTargetElements, function (index, divElem) {
527                            divElem.css('height', customHeight + 'px');
528                        });
529                    }
530                }
531            });
532
533
534            $(window).breakpoints("lessThan", "lg", function () {
535                $.each(sliderTargetElements, function (index, divElem) {
536                    divElem.css('height', responsiveHeightxs + 'px');
537                });
538            });
539        },
540        inspiroSlider: function () {
541
542            if ($inspiroSlider.length > 0) {
543
544                //Check if owlCarousel plugin is loaded
545                if (typeof $.fn.owlCarousel === 'undefined') {
546                    INSPIRO.elements.notification("Warning: jQuery owlCarousel plugin is missing in plugins.js file.", "warning")
547                    return true;
548                }
549
550                $inspiroSlider.each(function () {
551                    var elem = $(this),
552                        carouselNav = elem.attr('data-arrows'),
553                        carouselDots = elem.attr('data-dots'),
554                        carouselAutoPlay = elem.attr('data-autoplay'),
555                        carouselAutoplayTimeout = elem.attr('data-autoplay-timeout') || 5000,
556                        carouseAnimateIn = elem.attr('data-animate-in'),
557                        carouseAnimateOut = elem.attr('data-animate-out'),
558                        carouselLoop = elem.attr('data-loop'),
559                        carouselHoverPause = elem.attr('data-hover-pause'),
560                        carouselMargin = elem.attr('data-margin') || 0,
561                        carouselVideo = elem.attr('data-video'),
562                        carouselSmartSpeed = elem.attr('data-smart-speed') || 500,
563                        carouselDrag = elem.attr('data-drag') || true;
564
565
566                    elem.addClass("owl-carousel");
567                    //Kenburns effect
568                    elem.find('.slide').each(function () {
569                        if ($(this).hasClass("kenburns")) {
570                            var elemChild = $(this),
571                                elemChildImage = elemChild.css('background-image').replace(/.*\s?url\([\'\"]?/, '').replace(/[\'\"]?\).*/, '');
572                            elemChild.prepend('<div class="kenburns-bg" style="background-image:url(' + elemChildImage + ')"></div>');
573                        }
574                    });
575
576                    if (elem.find('.slide').length > 1) {
577
578                        elem.owlCarousel({
579                            items: 1,
580                            nav: carouselNav == 'false' ? false : true,
581                            dots: carouselDots == 'false' ? false : true,
582                            navText: ['<i class="icon-chevron-left1"></i>', '<i class="icon-chevron-right1"></i>'],
583                            autoplay: carouselAutoPlay == 'false' ? false : false,
584                            autoplayTimeout: Number(carouselAutoplayTimeout),
585                            autoplayHoverPause: carouselHoverPause == 'false' ? false : true,
586                            loop: carouselLoop == 'false' ? false : true,
587                            margin: Number(carouselMargin),
588                            smartSpeed: Number(carouselSmartSpeed),
589                            video: carouselVideo == 'false' ? false : true,
590                            animateIn: carouseAnimateIn,
591                            animateOut: carouseAnimateOut,
592                            rtl: INSPIRO.core.rtlStatus(),
593                            mouseDrag: carouselDrag,
594                            touchDrag: carouselDrag,
595                            pullDrag: false,
596                            freeDrag: false,
597                            callbacks: true,
598                            onInitialize: function (event) {
599                                var t = setTimeout(function () {
600                                    elem.find(".owl-item:not(.active) .slide > video").each(function () {
601                                        this.pause();
602                                    });
603                                    elem.find(".owl-item.active .slide .kenburns-bg").addClass("kenburns-bg-animate");
604
605                                    elem.addClass("slider-loaded");
606                                }, 100);
607
608
609                            },
610                            onResize: function (event) {
611                                INSPIRO.slider.sliderScreenSizeControl(elem);
612                            }
613                        });
614                        var $captions = elem.find('.slide-captions > *');
615                        $captions.each(function () {
616                            var $captionElem = $(this);
617                            var animationDuration = "600ms";
618                            if ($(this).attr("data-animation-duration")) {
619                                animationDuration = $(this).attr("data-animation-duration") + "ms";
620                            }
621                            $(this).css("animation-duration", animationDuration);
622                            $captionElem.addClass('slide-caption-hide');
623                        });
624                        $captions.each(function (index) {
625                            var $captionElem = $(this),
626                                captionDelay = $captionElem.attr("data-caption-delay") || index * 80,
627                                captionAnimation = $captionElem.attr('data-caption-animation') || "fadeInUp";
628                            var t = setTimeout(function () {
629                                $captionElem.removeClass('slide-caption-hide').addClass(captionAnimation);
630                            }, captionDelay);
631                        });
632                        elem.on('changed.owl.carousel', function (property) {
633                            var current = property.item.index,
634                                currentSlide = $(property.target).find(".owl-item").eq(current),
635                                currentSlideCaptions = currentSlide.find(".slide-captions > *"),
636                                currentSlideDark = currentSlide.find(".slide").hasClass("slide-dark"),
637                                currentSlideKenburns = currentSlide.find(".slide").hasClass("kenburns");
638                            if (currentSlideKenburns) {
639                                $(this).find(".kenburns-bg").addClass("kenburns-bg-animate");
640                            }
641                            currentSlideCaptions.each(function (index) {
642                                var $captionElem = $(this),
643                                    captionDelay = $captionElem.attr("data-caption-delay") || (index * 350 + 1000),
644                                    captionAnimation = $captionElem.attr('data-caption-animation') || "fadeInUp";
645                                var t = setTimeout(function () {
646                                    $captionElem.removeClass('slide-caption-hide').addClass(captionAnimation);
647                                }, captionDelay);
648                            });
649                            if ($window.width() > 992) {
650                                //Pause HTML5 Video
651                                if (currentSlide.find("video").length > 0) {
652                                    var t = setTimeout(function () {
653                                        currentSlide.find(".slide video").get(0).play();
654                                    }, 1000);
655                                }
656                            }
657                        });
658                        elem.on('change.owl.carousel', function (property) {
659                            var current = property.item.index,
660                                currentSlide = $(property.target).find(".owl-item").eq(current),
661                                currentSlideCaptions = $(property.target).find(".owl-item:not(.active)").find(".slide-captions > *"),
662                                currentSlideKenburns = currentSlide.find(".slide").hasClass("kenburns");
663                            currentSlideCaptions.each(function () {
664                                var $captionElem = $(this),
665                                    captionAnimation = $captionElem.attr('data-caption-animation') || "fadeInUp";
666                                $captionElem.removeClass(captionAnimation).addClass('slide-caption-hide');
667                            });
668                            elem.find(".slide video").each(function () {
669                                this.pause();
670                            });
671                            if (currentSlideKenburns) {
672                                $(this).find(".kenburns-bg").removeClass("kenburns-bg-animate");
673                            }
674                        });
675                    } else {
676                        elem.addClass("slider-loaded");
677                        var t = setTimeout(function () {
678                            elem.find('.slide').find(".kenburns-bg").addClass("kenburns-bg-animate");
679                        }, 200);
680                    }
681                    INSPIRO.slider.sliderScreenSizeControl(elem);
682
683                });
684            }
685        },
686
687        owlCarouselAjax: function () {
688            //Check if owlCarousel plugin is loaded
689            if (typeof $.fn.owlCarousel === 'undefined') {
690                INSPIRO.elements.notification("Warning: jQuery owlCarousel plugin is missing in plugins.js file.", "warning")
691                return true;
692            }
693            //Plugin Options
694            var elem = $(".carousel");
695            elem.options = {
696                nav: elem.attr('data-arrows'),
697                dots: elem.attr('data-dots'),
698                navText: ['<i class="icon-chevron-left1"></i>', '<i class="icon-chevron-right1"></i>'],
699                itemElement: elem.attr('data-item') || "div",
700                autoplay: elem.attr('data-autoplay'),
701                autoplayTimeout: elem.attr('data-autoplay-timeout') || 5000,
702                autoplayHoverPause: elem.attr('data-hoverpause'),
703                autoWidth: elem.attr('data-auto-width'),
704                loop: elem.attr('data-loop'),
705                smartSpeed: 350,
706                fluidSpeed: 260,
707                rtl: INSPIRO.core.rtlStatus()
708            };
709            //Initializing plugin and passing options
710            elem.owlCarousel({
711                items: 1,
712                nav: elem.options.nav == 'false' ? false : true,
713                dots: elem.options.dots == 'true' ? true : false,
714                navText: elem.options.navText,
715                itemElement: elem.options.itemElement,
716                autoplay: elem.options.autoPlay == 'true' ? true : false,
717                autoplayTimeout: Number(elem.options.autoplayTimeout),
718                autoplayHoverPause: elem.options.autoplayHoverPause == 'true' ? true : false,
719                loop: elem.options.loop == 'false' ? false : true,
720                smartSpeed: Number(elem.options.smartSpeed),
721                fluidSpeed: Number(elem.options.fluidSpeed),
722                rtl: elem.options.rtl,
723                onInitialize: function (event) {
724                    elem.addClass("carousel-loaded owl-carousel");
725                },
726            });
727        },
728        owlCarousel: function () {
729            if ($carousel.length > 0) {
730                //Check if owlCarousel plugin is loaded
731                if (typeof $.fn.owlCarousel === 'undefined') {
732                    INSPIRO.elements.notification("Warning: jQuery owlCarousel plugin is missing in plugins.js file.", "warning")
733                    return true;
734                }
735                $carousel.each(function () {
736                    var elem = $(this);
737                    //Plugin Options
738                    elem.options = {
739                        nav: elem.attr('data-arrows'),
740                        dots: elem.attr('data-dots'),
741                        navText: ['<i class="icon-chevron-left1"></i>', '<i class="icon-chevron-right1"></i>'],
742                        itemElement: elem.attr('data-item') || "div",
743                        autoplay: elem.attr('data-autoplay'),
744                        autoplayTimeout: elem.attr('data-autoplay-timeout') || 5000,
745                        autoplayHoverPause: elem.attr('data-hoverpause'),
746                        autoWidth: elem.attr('data-auto-width'),
747                        loop: elem.attr('data-loop'),
748                        margin: elem.attr('data-margin') || 20,
749                        items: elem.attr('data-items') || 4,
750                        itemsLg: elem.attr('data-items-lg'),
751                        itemsMd: elem.attr('data-items-md'),
752                        itemsSm: elem.attr('data-items-sm'),
753                        itemsXs: elem.attr('data-items-xs'),
754                        smartSpeed: 350,
755                        fluidSpeed: 260,
756                        video: elem.attr('data-video'),
757                        animateIn: elem.attr('data-animate-in'),
758                        animateOut: elem.attr('data-animate-out'),
759                        rtl: INSPIRO.core.rtlStatus()
760                    };
761
762                    //Calculate min/max on responsive breakpoints
763                    elem.options.itemsLg = elem.options.itemsLg || Math.min(Number(elem.options.items), Number(4));
764                    elem.options.itemsMd = elem.options.itemsMd || Math.min(Number(elem.options.itemsLg), Number(3));
765                    elem.options.itemsSm = elem.options.itemsSm || Math.min(Number(elem.options.itemsMd), Number(2));
766                    elem.options.itemsXs = elem.options.itemsXs || Math.min(Number(elem.options.itemsSm), Number(1));
767
768                    //Plugin Responsive options
769                    elem.responsive = {
770                        0: {
771                            items: Number(elem.options.itemsXs)
772                        },
773                        420: {
774                            items: Number(elem.options.itemsSm)
775                        },
776                        768: {
777                            items: Number(elem.options.itemsMd)
778                        },
779                        992: {
780                            items: Number(elem.options.itemsLg)
781                        },
782                        1200: {
783                            items: Number(elem.options.items)
784                        }
785                    };
786
787                    //Initializing plugin and passing options
788                    elem.owlCarousel({
789                        nav: elem.options.nav == 'false' ? false : true,
790                        dots: elem.options.dots == 'false' ? false : true,
791                        navText: elem.options.navText,
792                        itemElement: elem.options.itemElement,
793                        autoplay: elem.options.autoPlay == 'true' ? true : false,
794                        autoplayTimeout: elem.options.autoplayTimeout,
795                        autoplayHoverPause: elem.options.autoplayHoverPause == 'true' ? true : false,
796                        autoWidth: elem.options.autoWidth == 'true' ? true : false,
797                        loop: elem.options.loop == 'true' ? true : false,
798                        margin: Number(elem.options.margin),
799                        smartSpeed: Number(elem.options.smartSpeed),
800                        fluidSpeed: Number(elem.options.fluidSpeed),
801                        video: elem.options.video == 'true' ? true : false,
802                        animateIn: elem.options.animateIn,
803                        animateOut: elem.options.animateOut,
804                        rtl: elem.options.rtl,
805                        onInitialize: function (event) {
806                            elem.addClass("carousel-loaded owl-carousel");
807                        },
808                        responsive: elem.responsive
809                    });
810                });
811            }
812        },
813    };
814    INSPIRO.elements = {
815        functions: function () {
816            INSPIRO.elements.naTo();
817            INSPIRO.elements.morphext();
818            INSPIRO.elements.buttons();
819            INSPIRO.elements.accordion();
820            INSPIRO.elements.animations();
821            INSPIRO.elements.parallax();
822            INSPIRO.elements.responsiveVideos();
823            INSPIRO.elements.counters();
824            INSPIRO.elements.countdownTimer();
825            INSPIRO.elements.progressBar();
826            INSPIRO.elements.pieChart();
827            INSPIRO.elements.maps();
828            INSPIRO.elements.gridLayout();
829            INSPIRO.elements.tooltip();
830            INSPIRO.elements.popover();
831            INSPIRO.elements.magnificPopup();
832            INSPIRO.elements.yTPlayer();
833            INSPIRO.elements.vimeoPlayer();
834            INSPIRO.elements.modal();
835            INSPIRO.elements.sidebarFixed();
836            INSPIRO.elements.clipboard();
837            INSPIRO.elements.bootstrapSwitch();
838            INSPIRO.elements.countdown();
839            INSPIRO.elements.other();
840        },
841
842        other: function (context) {
843
844            if ($(".toggle-item").length > 0) {
845                $(".toggle-item").each(function () {
846                    var elem = $(this),
847                        toggleItemClass = elem.attr('data-class'),
848                        toggleItemClassTarget = elem.attr('data-target');
849
850                    elem.on("click", function () {
851                        if (toggleItemClass) {
852                            if (toggleItemClassTarget) {
853                                $(toggleItemClassTarget).toggleClass(toggleItemClass);
854                            } else {
855                                elem.toggleClass(toggleItemClass);
856                            }
857                        }
858                        elem.toggleClass("toggle-active");
859                        return false;
860                    });
861                });
862            }
863
864            /*Hover 3d Effect*/
865            if ($(".hover-3d").length > 0) {
866                $(".hover-3d").each(function () {
867                    var $elem = $(this),
868                        selector = $elem.attr("data-selector") || ".portfolio-item-wrap",
869                        shine = $elem.attr("data-shine") || false,
870                        sensitivity = $elem.attr("data-sensitivity") || 16;
871
872                    $elem.hover3d({
873                        selector: selector,
874                        shine: shine,
875                        sensitivity: Number(sensitivity)
876                    });
877                });
878            }
879
880            /*Dropdown popup invert*/
881            var $pDropdown = $(".p-dropdown");
882
883            if ($pDropdown.length > 0) {
884                $pDropdown.each(function () {
885                    var elem = $(this);
886                    if ($window.width() / 2 > elem.offset().left) {
887                        elem.addClass("p-dropdown-invert")
888                    }
889                });
890            }
891
892        },
893        naTo: function () {
894            $('a.scroll-to, #dotsMenu > ul > li > a, .menu-one-page nav > ul > li > a').on('click', function () {
895                var extraPaddingTop = 0,
896                    extraHeaderHeight = 0;
897
898                if (windowWidth <= 991) {
899
900                    $header.find("#mainMenu").css("max-height", 0);
901                    $body.toggleClass("mainMenu-open");
902                    $("#mainMenu-trigger button").toggleClass("toggle-active");
903
904                    if ($header.attr('data-responsive-fixed') === true) {
905                        extraHeaderHeight = $header.height();
906                    }
907
908                } else {
909                    if ($header.length > 0) {
910                        extraHeaderHeight = $header.height();
911                    }
912                }
913
914                if ($('.dashboard').length > 0) {
915                    extraPaddingTop = 30;
916                }
917
918                var $anchor = $(this);
919
920                $('html, body').stop(true, false).animate({
921                    scrollTop: ($($anchor.attr('href')).offset().top - (extraHeaderHeight + extraPaddingTop))
922                }, 1500, 'easeInOutExpo');
923                return false;
924
925            });
926
927
928
929        },
930        morphext: function () {
931
932            var $textRotator = $('.text-rotator');
933
934            if ($textRotator.length > 0) {
935
936                //Check if Morphext plugin is loaded
937                if (typeof $.fn.Morphext === 'undefined') {
938                    INSPIRO.elements.notification("Warning: jQuery Morphext plugin is missing in plugins.js file.", "warning")
939                    return true;
940                }
941
942                $textRotator.each(function () {
943                    var elem = $(this);
944
945                    //Plugin Options
946                    elem.options = {
947                        animation: elem.attr('data-animation') || "fadeIn",
948                        separator: elem.attr('data-separator') || ",",
949                        speed: elem.attr('data-speed') || 2000
950                    }
951
952                    //Initializing Morphext plugin and passing options
953                    elem.Morphext({
954                        animation: elem.options.animation,
955                        separator: elem.options.separator,
956                        speed: Number(elem.options.speed)
957                    });
958                });
959            }
960        },
961        buttons: function () {
962            //Button slide width
963            if ($(".btn-slide[data-width]")) {
964
965                $(".btn.btn-slide[data-width]").each(function () {
966                    var elem = $(this),
967                        elemWidth = elem.attr('data-width'),
968                        elemDefaultWidth;
969                    switch (true) {
970                        case elem.hasClass('btn-lg'):
971                            elemDefaultWidth = "60";
972                            break;
973                        case elem.hasClass('btn-sm'):
974                            elemDefaultWidth = "36";
975                            break;
976                        case elem.hasClass('btn-xs'):
977                            elemDefaultWidth = "28";
978                            break;
979                        default:
980                            elemDefaultWidth = "48";
981                            break;
982                    }
983                    elem.hover(function () {
984                        $(this).css("width", elemWidth + "px");
985                    }, function () {
986                        $(this).css("width", elemDefaultWidth + "px");
987                    });
988                });
989            }
990        },
991        accordion: function () {
992            var accordionType = "accordion",
993                toogleType = "toggle",
994                accordionItem = "ac-item",
995                itemActive = "ac-active",
996                itemTitle = "ac-title",
997                itemContent = "ac-content",
998                $accs = $("." + accordionItem);
999
1000            $accs.length && ($accs.each(function () {
1001                var $item = $(this);
1002                $item.hasClass(itemActive) ? $item.addClass(itemActive) : $item.find("." + itemContent).hide();
1003            }), $("." + itemTitle).on("click", function (e) {
1004                var $link = $(this),
1005                    $item = $link.parents("." + accordionItem),
1006                    $acc = $item.parents("." + accordionType);
1007                $item.hasClass(itemActive) ? $acc.hasClass(toogleType) ? ($item.removeClass(itemActive), $link.next("." + itemContent).slide
1007Up()) : ($acc.find("." + accordionItem).removeClass(itemActive), $acc.find("." + itemContent).slideUp()) : ($acc.hasClass(toogleType) || ($acc.find("." + accordionItem).removeClass(itemActive), $acc.find("." + itemContent).slideUp("fast")), $item.addClass(itemActive), $link.next("." + itemContent).slideToggle("fast")), e.preventDefault();
1008                return false;
1009            }));
1010        },
1011        animations: function () {
1012
1013            var $animate = $("[data-animate]");
1014
1015            if ($animate.length > 0) {
1016
1017                //Check if jQuery Waypoint plugin is loaded
1018                if (typeof Waypoint === 'undefined') {
1019                    INSPIRO.elements.notification("Warning: jQuery Waypoint plugin is missing in plugins.js file.", "warning")
1020                    return true;
1021                }
1022
1023                $animate.each(function () {
1024
1025                    var elem = $(this);
1026                    elem.addClass("animated");
1027
1028                    //Plugin Options
1029                    elem.options = {
1030                        animation: elem.attr("data-animate") || "fadeIn",
1031                        delay: elem.attr("data-animate-delay") || 200,
1032                        direction: ~elem.attr("data-animate").indexOf("Out") ? "back" : "forward",
1033                        offsetX: elem.attr("data-animate-offsetX") || 0,
1034                        offsetY: elem.attr("data-animate-offsetY") || -100
1035                    }
1036
1037                    //Initializing jQuery Waypoint plugin and passing options from data animations attributes
1038                    if (elem.options.direction == "forward") {
1039                        new Waypoint({
1040                            element: elem,
1041                            handler: function () {
1042                                var t = setTimeout(function () {
1043                                    elem.addClass(elem.options.animation + " visible");
1044                                }, elem.options.delay);
1045                            },
1046                            offset: '100%'
1047                        });
1048                    } else {
1049                        elem.addClass("visible");
1050                        elem.on("click", function () {
1051                            elem.addClass(elem.options.animation);
1052                            return false;
1053                        });
1054                    }
1055                    //Demo play
1056                    if (elem.parents('.demo-play-animations').length) {
1057                        elem.on("click", function () {
1058                            elem.removeClass(elem.options.animation);
1059                            var t = setTimeout(function () {
1060                                elem.addClass(elem.options.animation);
1061                            }, 50);
1062                            return false;
1063                        });
1064                    }
1065                });
1066            }
1067        },
1068        parallax: function () {
1069
1070            var $parallax = $('[data-parallax-image]');
1071
1072            if ($parallax.length > 0) {
1073
1074                //Check if scrolly plugin is loaded
1075                if (typeof $.fn.scrolly === 'undefined') {
1076                    INSPIRO.elements.notification("Warning: jQuery scrolly plugin is missing in plugins.js file.", "warning")
1077                    return true;
1078                }
1079
1080                $parallax.each(function () {
1081                    var $elem = $(this),
1082                        elemImageSrc = $elem.attr("data-parallax-image"),
1083                        elemImageVelocity = $elem.attr("data-velocity") || "-.090";
1084
1085                    $elem.prepend('<div class="parallax-container" data-lazy-background="' + elemImageSrc + '"  data-velocity="' + elemImageVelocity + '" style="background: url(' + elemImageSrc + ')"></div>');
1086
1087                    $(".parallax-container").lazy({
1088                        attribute: "data-lazy-background",
1089                        afterLoad: function (element) {
1090                            $elem.find(".parallax-container").addClass("img-loaded");
1091
1092                        }
1093                    });
1094
1095                    if ($body.hasClass('breakpoint-lg') || $body.hasClass('breakpoint-xl')) {
1096                        $elem.find(".parallax-container").scrolly({
1097                            bgParallax: true
1098                        });
1099
1100                    } else {
1101                        $elem.find(".parallax-container").addClass("parallax-responsive");
1102                    }
1103
1104                });
1105            }
1106        },
1107        responsiveVideos: function () {
1108
1109            //Check if fitVids plugin is loaded
1110            if (typeof $.fn.fitVids === 'undefined') {
1111                INSPIRO.elements.notification("Warning: jQuery fitVids plugin is missing in plugins.js file.", "warning")
1112                return true;
1113            }
1114
1115            //selecting elements
1116            var selectors = $("section, .content, .post-content, .video-js, .post-video, .video-wrap, .ajax-quick-view,#slider:not(.revslider-wrap)");
1117
1118            //Initializing jQuery fitVids plugin and pass selectors
1119            selectors.fitVids();
1120        },
1121        counters: function () {
1122
1123            var $counter = $('.counter');
1124
1125            if ($counter.length > 0) {
1126
1127                //Check if countTo plugin is loaded
1128                if (typeof $.fn.countTo === 'undefined') {
1129                    INSPIRO.elements.notification("Warning: jQuery countTo plugin is missing in plugins.js file.", "warning")
1130                    return true;
1131                }
1132                //Initializing countTo plugin 
1133                $counter.each(function () {
1134                    var $elem = $(this);
1135                    new Waypoint({
1136                        element: $elem,
1137                        handler: function () {
1138                            $elem.find('span').countTo();
1139                        },
1140                        offset: '104%'
1141                    });
1142                });
1143            }
1144        },
1145        countdownTimer: function () {
1146
1147            var $countdownTimer = $('.countdown');
1148
1149            if ($countdownTimer.length > 0) {
1150
1151                //Check if countdown plugin is loaded
1152                if (typeof $.fn.countdown === 'undefined') {
1153                    INSPIRO.elements.notification("Warning: jQuery countdown plugin is missing in plugins.js file.", "warning")
1154                    return true;
1155                }
1156
1157                var t = setTimeout(function () {
1158                    $('[data-countdown]').each(function () {
1159                        var $this = $(this),
1160                            finalDate = $(this).attr('data-countdown');
1161                        $this.countdown(finalDate, function (event) {
1162                            $this.html(event.strftime('<div class="countdown-container"><div class="countdown-box"><div class="number">%-D</div><span>Day%!d</span></div>' + '<div class="countdown-box"><div class="number">%H</div><span>Hours</span></div>' + '<div class="countdown-box"><div class="number">%M</div><span>Minutes</span></div>' + '<div class="countdown-box"><div class="number">%S</div><span>Seconds</span></div></div>'));
1163                        });
1164                    });
1165                }, 300);
1166            }
1167        },
1168        progressBar: function () {
1169
1170            var $progressBar = $('.p-progress-bar') || $('.progress-bar');
1171
1172            if ($progressBar.length > 0) {
1173                $progressBar.each(function (i, elem) {
1174                    var $elem = $(this),
1175                        percent = $elem.attr('data-percent') || "100",
1176                        delay = $elem.attr('data-delay') || "60",
1177                        type = $elem.attr('data-type') || "%";
1178                    if (!$elem.hasClass('progress-animated')) {
1179                        $elem.css({
1180                            'width': '0%'
1181                        });
1182                    }
1183                    var progressBarRun = function () {
1184                        $elem.animate({
1185                            'width': percent + '%'
1186                        }, 'easeInOutCirc').addClass('progress-animated');
1187                        $elem.delay(delay).append('<span class="progress-type">' + type + '</span><span class="progress-number animated fadeIn">' + percent + '</span>');
1188                    };
1189                    if ($body.hasClass('breakpoint-lg') || $body.hasClass('breakpoint-xl')) {
1190                        new Waypoint({
1191                            element: $(elem),
1192                            handler: function () {
1193                                var t = setTimeout(function () {
1194                                    progressBarRun();
1195                                }, delay);
1196                            },
1197                            offset: '100%'
1198                        });
1199                    } else {
1200                        progressBarRun();
1201                    }
1202                });
1203            }
1204        },
1205        pieChart: function () {
1206            var $pieChart = $('.pie-chart');
1207
1208            if ($pieChart.length > 0) {
1209
1210                //Check if easyPieChart plugin is loaded
1211                if (typeof $.fn.easyPieChart === 'undefined') {
1212                    INSPIRO.elements.notification("Warning: jQuery easyPieChart plugin is missing in plugins.js file.", "warning")
1213                    return true;
1214                }
1215
1216                $pieChart.each(function () {
1217                    var elem = $(this);
1218
1219                    //Plugin Options
1220                    elem.options = {
1221                        barColor: elem.attr('data-color') || $theme_color,
1222                        trackColor: elem.attr('data-trackcolor') || "rgba(0,0,0,0.10)",
1223                        scaleColor: elem.attr('data-scaleColor') || false,
1224                        scaleLength: elem.attr('data-scaleLength') || 5,
1225                        lineCap: elem.attr('data-lineCap') || 'square',
1226                        lineWidth: elem.attr('data-lineWidth') || 6,
1227                        size: elem.attr('data-size') || 160,
1228                        rotate: elem.attr('data-rotate') || 0,
1229                        animate: elem.attr('data-animate') || 2600,
1230                        elemEasing: elem.attr('data-easing') || 'easeInOutExpo'
1231                    }
1232
1233                    elem.find('span, i').css({
1234                        'width': elem.options.size + 'px',
1235                        'height': elem.options.size + 'px',
1236                        'line-height': elem.options.size + 'px'
1237                    });
1238
1239                    //Initializing jQuery easyPieChart plugin and passing options
1240                    new Waypoint({
1241                        element: elem,
1242                        handler: function () {
1243                            elem.easyPieChart({
1244                                barColor: elem.options.barColor,
1245                                trackColor: elem.options.trackColor,
1246                                scaleColor: elem.options.scaleColor,
1247                                scaleLength: elem.options.scaleLength,
1248                                lineCap: elem.options.lineCap,
1249                                lineWidth: Number(elem.options.lineWidth),
1250                                size: Number(elem.options.size),
1251                                rotate: Number(elem.options.rotate),
1252                                animate: Number(elem.options.animate),
1253                                elemEasing: elem.options.elemEasing,
1254                                onStep: function (from, to, percent) {
1255                                    elem.find('span.percent').text(Math.round(percent));
1256                                },
1257                            });
1258                        },
1259                        offset: '100%'
1260                    });
1261                });
1262            }
1263        },
1264        maps: function () {
1265
1266            var $map = $('.map');
1267
1268            if ($map.length > 0) {
1269
1270                //Check if gMap plugin is loaded
1271                if (typeof $.fn.gMap === 'undefined') {
1272                    INSPIRO.elements.notification("Warning: jQuery gMap plugin is missing in plugins.js file.", "warning")
1273                    return true;
1274                }
1275
1276                $map.each(function () {
1277                    var elem = $(this);
1278
1279                    //Plugin Options
1280                    elem.options = {
1281                        address: elem.attr('data-map-address') || "Melbourne, Australia",
1282                        maptype: elem.attr('data-map-type') || "ROADMAP",
1283                        zoom: elem.attr('data-map-zoom') || "14",
1284                        icon: elem.attr('data-map-icon') || "images/markers/marker2.png"
1285                    }
1286
1287                    var markers = [{
1288                        address: elem.options.address,
1289                        html: elem.options.address,
1290                        icon: {
1291                            image: elem.options.icon,
1292                            iconsize: [40, 63],
1293                            iconanchor: [18, 60],
1294                        },
1295                    }];
1296                    //Initialize gMap plugin and passing options
1297                    elem.gMap({
1298                        address: elem.options.address,
1299                        maptype: elem.options.maptype,
1300                        markers: markers,
1301                        zoom: Number(elem.options.zoom),
1302                        doubleclickzoom: true,
1303                        controls: {
1304                            panControl: true,
1305                            zoomControl: true,
1306                            mapTypeControl: false,
1307                            scaleControl: true,
1308                            streetViewControl: false,
1309                            overviewMapControl: true
1310                        },
1311                        styles: [{
1312                            featureType: "poi",
1313                            elementType: "labels",
1314                            stylers: [{
1315                                visibility: "off"
1316                            }]
1317                        }]
1318                    });
1319                });
1320            }
1321        },
1322        gridLayout: function () {
1323
1324            if ($gridLayout.length > 0) {
1325
1326                //Check if isotope plugin is loaded
1327                if (typeof $.fn.isotope === 'undefined') {
1328                    INSPIRO.elements.notification("Warning: jQuery isotope plugin is missing in plugins.js file.", "warning")
1329                    return true;
1330                }
1331
1332
1333                $gridLayout.each(function () {
1334                    var elem = $(this);
1335
1336                    elem.options = {
1337                        itemSelector: elem.attr('data-item') || "portfolio-item",
1338                        layoutMode: elem.attr('data-layout') || "masonry",
1339                        stagger: elem.attr('data-stagger') || 0,
1340                        autoHeight: elem.attr('data-auto-height') || true,
1341                        gridMargin: elem.attr('data-margin') || 20,
1342                        transitionDuration: elem.attr("data-transition") || "0.55s",
1343                        isOriginLeft: INSPIRO.core.rtlStatus()
1344                    }
1345
1346                    var gridXsMargin = elem.attr('data-xs-margin') || elem.options.gridMargin;
1347
1348                    $(window).breakpoints("lessThan", "lg", function () {
1349                        elem.options.gridMargin = gridXsMargin;
1350                    });
1351
1352                    if (elem.options.layoutMode == "fitRows") {
1353                        elem.options.gridMargin = (elem.options.gridMargin + 2);
1354                    } else {
1355                        var gridMargin2 = elem.options.gridMargin;
1356                    }
1357    
1358                    elem.css("margin", "0 -" + gridMargin2 + "px -" + elem.options.gridMargin + "px 0");
1359                    elem.find('.' + elem.options.itemSelector).css("padding", "0 " + elem.options.gridMargin + "px " + elem.options.gridMargin + "px 0");
1360
1361                    //chkd add lazy loading images
1362                    var t = setTimeout(function () {
1363                        elem.isotope({
1364                            layoutMode: elem.options.layoutMode,
1365                             transitionDuration: elem.options.transitionDuration,
1366                            stagger: Number(elem.options.stagger),
1367                            itemSelector: "." + elem.options.itemSelector,
1368                            isOriginLeft: elem.options.isOriginLeft,
1369                            autoHeight: elem.options.autoHeight,
1370                           /*   hiddenStyle: {
1371                                opacity: 0,
1372                                transform: "translate3d(0px, 60px, 0px)",
1373                            },
1374                            visibleStyle: {
1375                                opacity: 1,
1376                                transform: "translate3d(0px, 0px, 0px)",
1377                            }, */ 
1378                            masonry: {
1379                                // use outer width of grid-sizer for columnWidth
1380                                columnWidth: elem.find('.' + elem.options.itemSelector + ':not(.large-width)')[0],
1381                            }
1382                        }).addClass('grid-loaded');
1383
1384                        var iso = elem.data('isotope');
1385                        elem.isotope('reveal', iso.items);
1386
1387                    }, 100);
1388
1389                    $(window).on('resize', function () {
1390                        var t = setTimeout(function () {
1391                            INSPIRO.elements.gridLayoutRefresh();
1392                        }, 500);
1393                    });
1394
1395
1396                    /*Infinity Scroll*/
1397                    if (elem.next().hasClass("infinite-scroll")) {
1398                        INSPIRO.elements.gridLayoutInfinite(elem, elem.options.itemSelector, elem.options.gridMargin);
1399                    }
1400
1401
1402                    if ($gridFilter.length > 0) {
1403                        $gridFilter.each(function () {
1404                            var elemFilter = $(this),
1405                                $filterItem = elemFilter.find('a'),
1406                                elemFilterLayout = elemFilter.attr('data-layout'),
1407                                $filterItemActiveClass = "active";
1408    
1409                            $filterItem.on('click', function () {
1410    
1411                                elemFilter.find('li').removeClass($filterItemActiveClass);
1412                                $(this).parent('li').addClass($filterItemActiveClass);
1413    
1414                                var filterValue = $(this).attr('data-category');
1415                                    $(elemFilterLayout).isotope({
1416                                        filter: filterValue,
1417                                    });
1418    
1419                                if ($(".grid-active-title").length > 0) {
1420                                    $(".grid-active-title").empty().append($(this).text())
1421                                }
1422                                return false;
1423                            });
1424                        });
1425                    }
1426
1427
1428                });
1429                
1430            }
1431        },
1432        gridLayoutRefresh: function (elem) {
1433            if (!elem) {
1434                elem = $gridLayout;
1435            }
1436            if (elem.length > 0) {
1437                elem.each(function () {
1438                    var elem = $(this);
1439                    var t = setTimeout(function () {
1440                        elem.isotope('layout');
1441                    }, 300);
1442                });
1443            }
1444        },
1445        gridLayoutInfinite: function (element, elementSelector, elemGridMargin) {
1446
1447            //Check if infinitescroll plugin is loaded
1448            if (typeof $.fn.infinitescroll === 'undefined') {
1449                INSPIRO.elements.notification("Warning: jQuery infinitescroll plugin is missing in plugins.js file.", "warning")
1450                return true;
1451            }
1452
1453            var elem = element,
1454                gridItem = elementSelector,
1455                gridMargin = elemGridMargin,
1456                navSelector = "#pagination",
1457                loadMoreElem = $("#showMore"),
1458                loadMoreBtn = $("#showMore a.btn"),
1459                loadMoreBtnText = $("#showMore a.btn").html(),
1460                loadMoreMessage = $('<div class="infinite-scroll-message"><p class="animated visible fadeIn">No more posts to show</p></div>');
1461
1462            elem.infinitescroll({
1463                    itemSelector: "." + gridItem,
1464                    navSelector: navSelector,
1465                    nextSelector: navSelector + ' a:not(.btn)',
1466                    state: {
1467                        isDone: false
1468                    },
1469                    extraScrollPx: 10,
1470                    errorCallback: function () {
1471                        loadMoreElem.addClass("animated visible fadeOut");
1472                        var t = setTimeout(function () {
1473                            loadMoreElem.hide();
1474                            elem.after(loadMoreMessage);
1475                        }, 500);
1476                        var t = setTimeout(function () {
1477                            $(".infinite-scroll-message").addClass("animated visible fadeOut");
1478                        }, 3800);
1479                    },
1480                },
1481
1482                // Function called once the elements are retrieved
1483                function (newElements) {
1484                    loadMoreBtn.html(loadMoreBtnText);
1485
1486                    elem.css("margin", "0 -" + gridMargin + "px -" + gridMargin + "px 0");
1487                    elem.find('.' + gridItem).css("padding", "0 " + gridMargin + "px " + gridMargin + "px 0");
1488
1489                    INSPIRO.slider.owlCarouselAjax();
1490                    elem.isotope('appended', newElements);
1491                    INSPIRO.elements.gridLayoutRefresh();
1492
1493                });
1494
1495            if (loadMoreElem.length > 0) {
1496
1497                $window.unbind('.infscr');
1498                loadMoreBtn.click(function () {
1499                    loadMoreBtn.text("Loading...");
1500                    elem.infinitescroll('retrieve');
1501                    return false;
1502                });
1503            }
1504
1505
1506        },
1507        tooltip: function () {
1508
1509            var $tooltip = $('[data-toggle="tooltip"]');
1510            if ($tooltip.length > 0) {
1511
1512                //Check if tooltip plugin is loaded
1513                if (typeof $.fn.tooltip === 'undefined') {
1514                    INSPIRO.elements.notification("Warning: jQuery tooltip plugin is missing in plugins.js file.", "warning")
1515                    return true;
1516                }
1517                //Initialize Tooltip plugin function
1518                $tooltip.tooltip();
1519            }
1520        },
1521        popover: function () {
1522
1523            var $popover = $('[data-toggle="popover"]');
1524
1525            if ($popover.length > 0) {
1526
1527                //Check if popover plugin is loaded
1528                if (typeof $.fn.popover === 'undefined') {
1529                    INSPIRO.elements.notification("Warning: jQuery popover plugin is missing in plugins.js file.", "warning")
1530                    return true;
1531                }
1532                //Initialize Tooltip plugin function
1533                $popover.popover({
1534                    container: 'body',
1535                    html: true
1536                });
1537            }
1538        },
1539        magnificPopup: function () {
1540
1541            var $lightbox = $('[data-lightbox]');
1542
1543            if ($lightbox.length > 0) {
1544
1545                //Check if magnificPopup plugin is loaded
1546                if (typeof $.fn.magnificPopup === 'undefined') {
1547                    INSPIRO.elements.notification("Warning: jQuery magnificPopup plugin is missing in plugins.js file.", "warning")
1548                    return true;
1549                }
1550
1551                //Get lightbox data type
1552                var getType = {
1553                    image: {
1554                        type: 'image',
1555                        closeOnContentClick: true,
1556                        removalDelay: 500,
1557                        image: {
1558                            verticalFit: true
1559                        },
1560                        callbacks: {
1561                            beforeOpen: function () {
1562                                this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
1563                                this.st.mainClass = "mfp-zoom-out";
1564                            }
1565                        }
1566                    },
1567                    gallery: {
1568                        delegate: 'a[data-lightbox="gallery-image"], a[data-lightbox="gallery-image"]',
1569                        type: 'image',
1570                        image: {
1571                            verticalFit: true
1572                        },
1573                        gallery: {
1574                            enabled: true,
1575                            navigateByImgClick: true,
1576                            preload: [0, 1]
1577                        },
1578                        removalDelay: 500,
1579                        callbacks: {
1580                            beforeOpen: function () {
1581                                this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
1582                                this.st.mainClass = "mfp-zoom-out";
1583                            }
1584                        },
1585                    },
1586                    iframe: {
1587                        type: 'iframe',
1588                        removalDelay: 500,
1589                        callbacks: {
1590                            beforeOpen: function () {
1591                                this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
1592                                this.st.mainClass = "mfp-zoom-out";
1593                            }
1594                        }
1595                    },
1596                    ajax: {
1597                        type: 'ajax',
1598                        removalDelay: 500,
1599                        callbacks: {
1600                            ajaxContentAdded: function (mfpResponse) {
1601                                INSPIRO.slider.owlCarouselAjax();
1602                                INSPIRO.elements.responsiveVideos();
1603                                INSPIRO.elements.buttons();
1604                            }
1605                        }
1606                    },
1607                    inline: {
1608                        type: 'inline',
1609                        removalDelay: 500,
1610                        callbacks: {
1611                            beforeOpen: function () {
1612                                this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
1613                                this.st.mainClass = "mfp-zoom-out";
1614                            }
1615                        },
1616                        closeBtnInside: false,
1617                        fixedContentPos: true,
1618                        overflowY: 'scroll',
1619                    }
1620                }
1621
1622
1623                //Initializing jQuery magnificPopup plugin and passing options
1624                $lightbox.each(function () {
1625                    var elem = $(this),
1626                        elemType = elem.attr('data-lightbox');
1627
1628                    switch (elemType) {
1629                        case 'image':
1630                            elem.magnificPopup(getType.image);
1631                            break;
1632                        case 'gallery':
1633                            elem.magnificPopup(getType.gallery);
1634                            break;
1635                        case 'iframe':
1636                            elem.magnificPopup(getType.iframe);
1637                            break;
1638                        case 'ajax':
1639                            elem.magnificPopup(getType.ajax);
1640                            break;
1641                        case 'inline':
1642                            elem.magnificPopup(getType.inline);
1643                            break;
1644                    }
1645                });
1646            }
1647        },
1648
1649        yTPlayer: function () {
1650
1651            var $ytPlayer = $('.youtube-background');
1652
1653            if ($ytPlayer.length > 0) {
1654
1655                //Check if YTPlayer plugin is loaded
1656                if (typeof $.fn.YTPlayer === 'undefined') {
1657                    INSPIRO.elements.notification('<b>Warning</b><br> jQuery YTPlayer plugin is missing, please add this code line <b> &lt;script src=&quot;js/plugins/js/jquery.mb.YTPlayer.min.js&quot;&gt;&lt;/script&gt;</b>, before <b><--Template functions--></b>', "warning", 10000)
1658                    return true;
1659                }
1660
1661                $ytPlayer.each(function () {
1662
1663                    var elem = $(this);
1664
1665                    //Plugin Options
1666                    elem.options = {
1667                        videoURL: elem.attr('data-youtube-url'),
1668                        mute: elem.attr('data-youtube-mute'),
1669                        ratio: elem.attr('data-youtube-ratio') || '16/9',
1670                        quality: elem.attr('data-youtube-quality') || 'hd720',
1671                        opacity: elem.attr('data-youtube-opacity') || 1,
1672                        containment: elem.attr('data-youtube-container') || 'self',
1673                        optimizeDisplay: elem.attr('data-youtube-optimize'),
1674                        loop: elem.attr('data-youtube-loop'),
1675                        vol: elem.attr('data-youtube-volume') || 70,
1676                        startAt: elem.attr('data-youtube-start') || 0,
1677                        stopAt: elem.attr('data-youtube-stop') || 0,
1678                        autoPlay: elem.attr('data-youtube-autoplay'),
1679                        realfullscreen: elem.attr('data-youtube-fullscreen'),
1680                        showYTLogo: elem.attr('data-youtube-logo'),
1681                        showControls: elem.attr('data-youtube-control
1681s') || false
1682                    }
1683
1684                    //Initializing jQuery YTPlayer plugin and passing options
1685                    elem.YTPlayer({
1686                        videoURL: elem.options.videoURL,
1687                        mute: elem.options.mute == 'true' ? true : false,
1688                        ratio: elem.options.ratio,
1689                        quality: elem.options.quality,
1690                        opacity: Number(elem.options.opacity),
1691                        containment: elem.options.containment,
1692                        optimizeDisplay: elem.options.optimizeDisplay == 'false' ? false : true,
1693                        loop: elem.options.loop == 'false' ? false : true,
1694                        vol: Number(elem.options.vol),
1695                        startAt: Number(elem.options.startAt),
1696                        stopAt: Number(elem.options.stopAt),
1697                        autoPlay: elem.options.autoPlay == 'true' ? true : false,
1698                        realfullscreen: elem.options.realfullscreen == 'true' ? true : false,
1699                        showYTLogo: elem.options.showYTLogo == 'true' ? true : false,
1700                        showControls: elem.options.showControls == 'true' ? true : false
1701                    });
1702
1703                    if (!elem.options.autoPlay) {
1704                        elem.find("#youtube-background-controls").addClass("video-is-playing");
1705                    }
1706                    elem.on("YTPReady", function () {
1707                        $("#youtube-background-controls").on("click", function () {
1708                            if (!$(this).hasClass("video-is-playing")) {
1709                                $(this).addClass("video-is-playing");
1710                                elem.YTPPause();
1711                            } else {
1712                                $(this).removeClass("video-is-playing");
1713                                elem.YTPPlay();
1714                            }
1715                            return false;
1716                        });
1717                        var elemContainerHeight = elem.height();
1718                        if (elem.options.autoPause) {
1719                            $window.on('scroll', function () {
1720                                if ($window.scrollTop() > elemContainerHeight) {
1721                                    $("#youtube-background-controls").addClass("video-is-playing");
1722                                    elem.YTPPause();
1723                                }
1724                            });
1725                        }
1726                    });
1727                });
1728            }
1729        },
1730        vimeoPlayer: function () {
1731            var $vmPlayer = $('.vimeo-background');
1732
1733            if ($vmPlayer.length > 0) {
1734
1735                //Check if vimeo_player plugin is loaded
1736                if (typeof $.fn.vimeo_player === 'undefined') {
1737                    INSPIRO.elements.notification('<b>Warning</b><br> jQuery vimeo_player plugin is missing, please add this code line <b> &lt;script src=&quot;js/plugins/js/jquery.mb.vimeo_player.min.js&quot;&gt;&lt;/script&gt;</b>, before <b><--Template functions--></b>', "warning", 10000)
1738                    return true;
1739                }
1740
1741
1742                $vmPlayer.each(function () {
1743                    var elem = $(this),
1744                        elemVideo = elem.attr('data-vimeo-url') || null,
1745                        elemMute = elem.attr('data-vimeo-mute') || false,
1746                        elemRatio = elem.attr('data-vimeo-ratio') || '16/9',
1747                        elemQuality = elem.attr('data-vimeo-quality') || 'hd720',
1748                        elemOpacity = elem.attr('data-vimeo-opacity') || 1,
1749                        elemContainer = elem.attr('data-vimeo-container') || 'self',
1750                        elemOptimize = elem.attr('data-vimeo-optimize') || true,
1751                        elemLoop = elem.attr('data-vimeo-loop') || true,
1752                        elemVolume = elem.attr('data-vimeo-volume') || 70,
1753                        elemStart = elem.attr('data-vimeo-start') || 0,
1754                        elemStop = elem.attr('data-vimeo-stop') || 0,
1755                        elemAutoPlay = elem.attr('data-vimeo-autoplay') || true,
1756                        elemFullScreen = elem.attr('data-vimeo-fullscreen') || true,
1757                        elemControls = elem.attr('data-vimeo-controls') || false,
1758                        elemLogo = elem.attr('data-vimeo-logo') || false,
1759                        elemAutoPause = elem.attr('data-vimeo-autopause') || false;
1760
1761                    elem.vimeo_player({
1762                        videoURL: elemVideo,
1763                        mute: elemMute,
1764                        ratio: elemRatio,
1765                        quality: elemQuality,
1766                        opacity: elemOpacity,
1767                        containment: elemContainer,
1768                        optimizeDisplay: elemOptimize,
1769                        loop: elemLoop,
1770                        vol: elemVolume,
1771                        startAt: elemStart,
1772                        stopAt: elemStop,
1773                        autoPlay: elemAutoPlay,
1774                        realfullscreen: elemFullScreen,
1775                        showvmLogo: elemLogo,
1776                        showControls: elemControls
1777                    });
1778                });
1779            }
1780        },
1781        modal: function () {
1782
1783            //Check if magnificPopup plugin is loaded
1784            if (typeof $.fn.magnificPopup === 'undefined') {
1785                INSPIRO.elements.notification("Warning: jQuery magnificPopup plugin is missing in plugins.js file.", "warning")
1786                return true;
1787            }
1788
1789            var $modal = $(".modal"),
1790                $modalStrip = $(".modal-strip"),
1791                $btnModal = $(".btn-modal"),
1792                modalShow = "modal-auto-open",
1793                modalShowClass = "modal-active",
1794                modalDecline = $(".modal-close"),
1795                cookieNotify = $(".cookie-notify"),
1796                cookieConfirm = cookieNotify.find(".modal-confirm, .mfp-close");
1797
1798
1799            /*Modal*/
1800            if ($modal.length > 0) {
1801                $modal.each(function () {
1802                    var elem = $(this),
1803                        elemDelay = elem.attr("data-delay") || 3000,
1804                        elemCookieExpire = elem.attr("data-cookie-expire") || 365,
1805                        elemCookieName = elem.attr("data-cookie-name") || "coockieName",
1806                        elemCookieEnabled = elem.attr("data-cookie-enabled") || "false";
1807
1808
1809                    /*Modal Auto Show*/
1810                    if (elem.hasClass(modalShow)) {
1811
1812
1813                        /*Cookie Notify*/
1814                        var t = setTimeout(function () {
1815                            $.magnificPopup.open({
1816                                items: {
1817                                    src: elem
1818                                },
1819                                type: 'inline',
1820                                closeBtnInside: true,
1821                                callbacks: {
1822                                    beforeOpen: function () {
1823                                        this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
1824                                        this.st.mainClass = "mfp-zoom-out";
1825                                    },
1826                                    open: function () {
1827                                        if (elem.find("video").length > 0) {
1828                                            elem.find("video").get(0).play();
1829                                        }
1830                                    },
1831                                    close: function () {
1832                                        Cookies.set(elemCookieName, true, {
1833                                            expires: Number(elemCookieExpire)
1834                                        });
1835                                    }
1836                                }
1837                            }, 0);
1838                        }, elemDelay);
1839                    }
1840
1841                    /*Modal Dissmis Button*/
1842                    elem.find(modalDecline).click(function () {
1843                        $.magnificPopup.close();
1844                        return false;
1845                    });
1846                });
1847            }
1848            /*Modal Strip*/
1849            if ($modalStrip.length > 0) {
1850
1851                $modalStrip.each(function () {
1852                    var elem = $(this),
1853                        elemDelay = elem.attr("data-delay") || 3000,
1854                        elemCookieExpire = elem.attr("data-cookie-expire") || 365,
1855                        elemCookieName = elem.attr("data-cookie-name") || "coockieName2013",
1856                        elemCookieEnabled = elem.attr("data-cookie-enabled") || "false";
1857
1858                    /*Modal Auto Show*/
1859                    if (elem.hasClass(modalShow)) {
1860                        var modalElem = $(this);
1861                        var timeout = setTimeout(function () {
1862                            modalElem.addClass(modalShowClass);
1863                        }, elemDelay);
1864                    }
1865                    /*Modal Dissmis Button*/
1866                    elem.find(modalDecline).click(function () {
1867                        elem.removeClass(modalShowClass);
1868                        return false;
1869                    });
1870
1871
1872                    /*Cookie Notify*/
1873                    if (elem.hasClass("cookie-notify")) {
1874                        var timeout = setTimeout(function () {
1875                            if (elemCookieEnabled != true) {
1876                                cookieNotify.addClass(modalShowClass);
1877                            } else {
1878                                if (typeof Cookies.get(elemCookieName) == 'undefined') {
1879                                    cookieNotify.addClass(modalShowClass);
1880                                }
1881                            }
1882                        }, elemDelay);
1883
1884                        cookieConfirm.click(function () {
1885                            Cookies.set(elemCookieName, true, {
1886                                expires: Number(elemCookieExpire)
1887                            });
1888                            $.magnificPopup.close();
1889                            cookieNotify.removeClass(modalShowClass);
1890                            return false;
1891                        });
1892                    }
1893                });
1894            }
1895            /*Modal toggles*/
1896            if ($btnModal.length > 0) {
1897
1898                $btnModal.each(function () {
1899                    var elem = $(this),
1900                        modalTarget = elem.attr("data-modal");
1901                    elem.click(function () {
1902                        $(modalTarget).toggleClass(modalShowClass, 1000);
1903                        return false;
1904                    });
1905                });
1906            }
1907        },
1908
1909        notification: function (
1910            $message,
1911            $type,
1912            $delay,
1913            $spacing,
1914            $mouse_over,
1915            $allow_dismiss,
1916            $timer,
1917            $newest_on_top,
1918            $showProgressbar,
1919            $offsetX,
1920            $offsetY,
1921            $z_index,
1922            $animateEnter,
1923            $animateExit) {
1924
1925            var content = {};
1926            content.message = $message,
1927
1928                $.notify(content, {
1929                    type: $type || 'warning',
1930                    delay: $delay,
1931                    template: '<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-{0}" role="alert">' +
1932                        '<button type="button" aria-hidden="true" class="close" data-notify="dismiss"><i class="icon-x"></i></button>' +
1933                        '<span data-notify="icon"></span> ' +
1934                        '<span data-notify="title">{1}</span> ' +
1935                        '<span data-notify="message">{2}</span>' +
1936                        '<div class="progress" data-notify="progressbar">' +
1937                        '<div class="p-progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' +
1938                        '</div>' +
1939                        '<a href="{3}" target="{4}" data-notify="url"></a>' +
1940                        '</div>',
1941                    /* spacing: $spacing,
1942                mouse_over: $mouse_over,
1943                allow_dismiss: $allow_dismiss,
1944                timer: $timer,
1945                newest_on_top: $newest_on_top,
1946                showProgressbar: $showProgressbar,
1947                
1948                offset: {
1949                    x: $offsetX,
1950                    y: $offsetY
1951                },
1952               
1953                z_index: $z_index,
1954                animate: {
1955                    enter: 'animated ' + $animateEnter,
1956                    exit: 'animated ' + $animateExit
1957                } */
1958                });
1959        },
1960
1961        sidebarFixed: function () {
1962
1963            var $sidebarFixed = $('.sticky-sidebar');
1964
1965            if ($sidebarFixed.length > 0) {
1966
1967                //Check if theiaStickySidebar plugin is loaded
1968                if (typeof $.fn.theiaStickySidebar === 'undefined') {
1969                    INSPIRO.elements.notification("Warning: jQuery theiaStickySidebar plugin is missing in plugins.js file.", "warning")
1970                    return true;
1971                }
1972
1973                $sidebarFixed.each(function () {
1974                    var elem = $(this);
1975                    elem.options = {
1976                        additionalMarginTop: elem.attr('data-margin-top') || 120,
1977                        additionalMarginBottom: elem.attr('data-margin-bottom') || 50
1978                    }
1979                    //Initialize theiaStickySidebar plugin and passing options
1980                    elem.theiaStickySidebar({
1981                        additionalMarginTop: Number(elem.options.additionalMarginTop),
1982                        additionalMarginBottom: Number(elem.options.additionalMarginBottom)
1983                    });
1984                });
1985            }
1986        },
1987
1988        bootstrapSwitch: function () {
1989
1990            var $bootstrapSwitch = $('[data-switch=true]');
1991
1992            if ($bootstrapSwitch.length > 0) {
1993
1994                //Check if bootstrapSwitch plugin is loaded
1995                if (typeof $.fn.bootstrapSwitch === 'undefined') {
1996                    INSPIRO.elements.notification("Warning: jQuery bootstrapSwitch plugin is missing in plugins.js file.", "warning")
1997                    return true;
1998                }
1999                //Initialize jQuery BootstrapSwitch plugin
2000                $bootstrapSwitch.bootstrapSwitch();
2001            }
2002
2003
2004        },
2005
2006        clipboard: function () {
2007
2008            var $clipboardTarget = $('[data-clipboard-target]'),
2009                $clipboardText = $('[data-clipboard-text]');
2010
2011            if ($clipboardTarget.length > 0) {
2012
2013                //Check if ClipboardJS plugin is loaded
2014                if (typeof ClipboardJS === 'undefined') {
2015                    INSPIRO.elements.notification("Warning: jQuery ClipboardJS plugin is missing in plugins.js file.", "warning")
2016                    return true;
2017                }
2018
2019                if ($clipboardTarget) {
2020                    new ClipboardJS('[data-clipboard-target]');
2021                    clipboardInit($clipboardTarget);
2022                }
2023                if ($clipboardText) {
2024                    new ClipboardJS('[data-clipboard-text]');
2025                    clipboardInit($clipboardText);
2026                }
2027
2028                function clipboardInit(clipboardType) {
2029                    clipboardType.each(function () {
2030                        var elem = $(this),
2031                            title = elem.attr('data-original-title') || "Copy to clipboard",
2032                            titleSuccess = elem.attr('data-original-title-success') || "Copied!";
2033
2034                        elem.tooltip({
2035                            placement: 'top',
2036                            title: title
2037                        });
2038
2039                        elem.on('click touchend', function () {
2040                            elem.attr('data-original-title', titleSuccess).tooltip('show');
2041                        }).on('mouseleave untouched', function () {
2042                            elem.tooltip('hide').attr('data-original-title', title);
2043                            return false;
2044                        });
2045                    });
2046                }
2047            }
2048        },
2049
2050        countdown: function () {
2051
2052            var $countdown = $(".p-countdown");
2053
2054            if ($countdown.length > 0) {
2055                $countdown.each(function () {
2056                    var $elem = $(this),
2057                        $elemCount = $elem.find(".p-countdown-count"),
2058                        $elemShow = $elem.find(".p-countdown-show"),
2059                        $elemSeconds = $elem.attr("data-delay") || 5;
2060
2061                    $elemCount.find('.count-number').html($elemSeconds);
2062
2063                    new Waypoint({
2064                        element: $elem,
2065                        handler: function () {
2066                            var interval = setInterval(function () {
2067                                $elemSeconds--;
2068                                if ($elemSeconds == 0) {
2069                                    clearInterval(interval);
2070                                    $elemCount.fadeOut("slow");
2071                                    setTimeout(function () {
2072                                        $elemShow.fadeIn('show');
2073                                    }, 1000);
2074                                } else {
2075                                    $elemCount.find('.count-number').html($elemSeconds);
2076                                }
2077                            }, 1000);
2078                        },
2079                        offset: '100%'
2080                    });
2081                });
2082            }
2083        }
2084    };
2085    INSPIRO.widgets = {
2086        functions: function () {
2087            INSPIRO.widgets.twitter();
2088            INSPIRO.widgets.flickr();
2089            INSPIRO.widgets.instagram();
2090            INSPIRO.widgets.instagramComplete();
2091            INSPIRO.widgets.contactForm();
2092            INSPIRO.widgets.subscribeForm();
2093        },
2094        twitter: function () {
2095
2096            var $widget_twitter = $('.widget-tweeter') || $('.widget-twitter');
2097
2098            if ($widget_twitter.length > 0) {
2099
2100                //Check if twittie plugin is loaded
2101                if (typeof $.fn.twittie === 'undefined') {
2102                    INSPIRO.elements.notification("Warning: jQuery twittie plugin is missing in plugins.js file.", "warning")
2103                    return true;
2104                }
2105
2106                var t = setTimeout(function () {
2107                    $widget_twitter.each(function () {
2108                        var $elem = $(this),
2109                            twitterUsername = $elem.attr('data-username') || "ardianmusliu",
2110                            twitterLimit = $elem.attr('data-limit') || 2,
2111                            twitterDateFormat = $elem.attr('data-format') || '%b/%d/%Y',
2112                            twitterLoadingText = $elem.attr('data-loading-text') || 'Loading...',
2113                            twitterApiPAth = $elem.attr('data-loader') || "include/twitter/tweet.php",
2114                            twitterAvatar = $elem.attr('data-avatar') || false;
2115                        if (twitterAvatar == 'true') {
2116                            twitterAvatar = "{{avatar}}";
2117                        } else {
2118                            twitterAvatar = "";
2119                        }
2120                        $elem.append('<div id="twitter-cnt"></div>')
2121
2122                        $elem.find('#twitter-cnt').twittie({
2123                            'username': twitterUsername,
2124                            'count': twitterLimit,
2125                            'dateFormat': twitterDateFormat,
2126                            'template': twitterAvatar + '{{tweet}}<small>{{date}}</small>',
2127                            'apiPath': twitterApiPAth,
2128                            'loadingText': twitterLoadingText
2129                        });
2130                    });
2131                }, 2000);
2132            }
2133        },
2134        flickr: function () {
2135
2136            var $flickr_widget = $('.flickr-widget');
2137
2138            if ($flickr_widget.length > 0) {
2139
2140                //Check if jflickrfeed plugin is loaded
2141                if (typeof $.fn.jflickrfeed === 'undefined') {
2142                    INSPIRO.elements.notification("Warning: jQuery jflickrfeed plugin is missing in plugins.js file.", "warning")
2143                    return true;
2144                }
2145
2146                $flickr_widget.each(function () {
2147
2148                    var elem = $(this);
2149
2150                    elem.options = {
2151                        id: elem.attr('data-flickr-id') || "52617155@N08",
2152                        limit: elem.attr('data-flickr-images') || "9",
2153                        itemTemplate: '<a href="{{image}}" title="{{title}}"><img src="{{image_s}}" alt="{{title}}" /></a>'
2154                    }
2155
2156                    //Initializing jflickrfeed plugin and passing options
2157                    $flickr_widget.jflickrfeed({
2158                        limit: elem.options.limit,
2159                        qstrings: {
2160                            id: elem.options.id
2161                        },
2162                        itemTemplate: elem.options.itemTemplate
2163
2164                    }, function () {
2165                        var t = setTimeout(function () {
2166                            elem.addClass('flickr-widget-loaded');
2167                        }, 1000);
2168
2169                        elem.magnificPopup({
2170                            delegate: 'a',
2171                            type: 'image',
2172                            gallery: {
2173                                enabled: true
2174                            }
2175                        });
2176                    });
2177                });
2178            }
2179        },
2180
2181        instagram: function () {
2182
2183            var $widget_instagram = $('.widget-instagram');
2184            if ($widget_instagram.length > 0) {
2185
2186                //Check if spectragram plugin is loaded
2187                if (typeof $.fn.spectragram === 'undefined') {
2188                    INSPIRO.elements.notification("Warning: jQuery spectragram plugin is missing in plugins.js file.", "warning")
2189                    return true;
2190                }
2191
2192                $widget_instagram.each(function () {
2193
2194                    var elem = $(this),
2195                        instagramLimit = elem.attr('data-limit') || 12,
2196                        instagramColumns = elem.attr('data-col') || 3,
2197                        instagramAccessToken = elem.attr('data-token') || '5783726529.7f62efa.75dba27ec87c4317b90d7b2ae98dde88',
2198                        instagramItems = "#instagram-cnt",
2199                        instagramSize = elem.attr('data-size') || 'small', //The size of the photos. 'small', 'medium' or 'big'. Default: 'medium'
2200                        instagramGridColumns = "grid-" + instagramColumns;
2201
2202                    elem.append('<div id="instagram-cnt" class="' + instagramGridColumns + '"></div>');
2203
2204                    jQuery.fn.spectragram.accessData = {
2205                        accessToken: instagramAccessToken
2206                    };
2207
2208                    elem.find($(instagramItems)).spectragram('getUserFeed', {
2209                        size: instagramSize,
2210                        max: instagramLimit,
2211                        wrapEachWith: '',
2212                        complete: spectragramComplete
2213                    });
2214
2215                    var t = setTimeout(function () {
2216                        elem.addClass('widget-instagram-loaded');
2217                    }, 300);
2218
2219                    var spectragramComplete = function () {
2220
2221                        if ($gridLayout) {
2222                            var t = setTimeout(function () {
2223                                INSPIRO.elements.gridLayoutRefresh();
2224                            }, 300);
2225                        }
2226                    };
2227
2228                });
2229            }
2230        },
2231        instagramComplete: function () {
2232            if ($gridLayout) {
2233                var t = setTimeout(function () {
2234                    INSPIRO.elements.gridLayoutRefresh();
2235                }, 300);
2236            }
2237        },
2238        contactForm: function () {
2239
2240            var $contactForm = $(".widget-contact-form");
2241
2242            if ($contactForm.length > 0) {
2243
2244                //Check if validate plugin is loaded
2245                if (typeof $.fn.validate === 'undefined') {
2246                    INSPIRO.elements.notification("Warning: jQuery validate plugin is missing in plugins.js file.", "warning")
2247                    return true;
2248                }
2249
2250                //Check if ajaxSubmit plugin is loaded
2251                if (typeof $.fn.ajaxSubmit === 'undefined') {
2252                    INSPIRO.elements.notification("Warning: jQuery ajaxSubmit plugin is missing in plugins.js file.", "warning")
2253                    return true;
2254                }
2255
2256                $contactForm.each(function () {
2257                    var elem = $(this),
2258                        elemSuccessMessage = elem.attr('data-success-message') || "We have <strong>successfully</strong> received your Message and will get Back to you as soon as possible.";
2259
2260                    elem.validate({
2261                        submitHandler: function (form) {
2262                            var button = $(form).find('button#form-submit'),
2263                                buttonText = button.html();
2264
2265                            button.html('<i class="fa fa-refresh fa-spin"></i> Sending...');
2266
2267                            $(form).ajaxSubmit({
2268                                success: function (text) {
2269                                    if (text.response == 'success') {
2270                                        $.notify({
2271                                            message: elemSuccessMessage
2272                                        }, {
2273                                            type: 'success'
2274                                        });
2275                                        if ($(form).find('.g-recaptcha').children('div').length > 0) {
2276                                            grecaptcha.reset();
2277                                        }
2278                                        $(form)[0].reset();
2279                                        button.html(buttonText);
2280
2281                                    } else {
2282                                        $.notify({
2283                                            message: elem.attr('data-error-message') || text.message
2284                                        }, {
2285                                            type: 'danger'
2286                                        });
2287                                        var t = setTimeout(function () {
2288                                            button.html(buttonText);
2289                                        }, 1000);
2290                                    }
2291                                }
2292                            });
2293                        }
2294                    });
2295                });
2296            }
2297        },
2298        subscribeForm: function () {
2299
2300            var $subscribeForm = $(".widget-subscribe-form");
2301
2302            if ($subscribeForm.length > 0) {
2303
2304                //Check if validate plugin is loaded
2305                if (typeof $.fn.validate === 'undefined') {
2306                    INSPIRO.elements.notification("Warning: jQuery validate plugin is missing in plugins.js file.", "warning")
2307                    return true;
2308                }
2309
2310                //Check if ajaxSubmit plugin is loaded
2311                if (typeof $.fn.ajaxSubmit === 'undefined') {
2312                    INSPIRO.elements.notification("Warning: jQuery ajaxSubmit plugin is missing in plugins.js file.", "warning")
2313                    return true;
2314                }
2315
2316                $subscribeForm.each(function () {
2317                    var elem = $(this),
2318                        elemSuccessMessage = elem.attr('success-message') || "You have successfully subscribed to our mailing list.";
2319
2320                    elem.validate({
2321                        submitHandler: function (form) {
2322                            var addonIcon = elem.find('.input-group-prepend'),
2323                                addonIconText = addonIcon.html();
2324
2325                            addonIcon.html('<i class="fa fa-refresh fa-spin"></i>');
2326
2327                            $(form).ajaxSubmit({
2328                                dataType: 'json',
2329                                success: function (text) {
2330                                    if (text.response == 'success') {
2331                                        $.notify({
2332                                            message: elemSuccessMessage
2333                                        }, {
2334                                            type: 'success'
2335                                        });
2336                                        $(form)[0].reset();
2337                                        addonIcon.html(addonIconText);
2338
2339                                    } else {
2340                                        $.notify({
2341                                            message: text.message
2342                                        }, {
2343                                            type: 'warning'
2344                                        });
2345                                        addonIcon.html(addonIconText);
2346                                    }
2347                                }
2348                            });
2349                        }
2350                    });
2351                });
2352            }
2353        },
2354    };
2355
2356
2357
2358
2359    //Load Functions on document ready
2360    $(document).ready(function () {
2361        INSPIRO.core.functions();
2362        INSPIRO.header.functions();
2363        INSPIRO.slider.functions();
2364        INSPIRO.widgets.functions();
2365        INSPIRO.elements.functions();
2366
2367
2368    });
2369
2370    //Recall Functions on window scroll
2371    $window.on('scroll', function () {
2372        INSPIRO.header.logoStatus();
2373        INSPIRO.header.stickyHeader();
2374        INSPIRO.core.scrollTop();
2375        INSPIRO.header.dotsMenu();
2376    });
2377
2378    //Recall Functions on window resize
2379    $window.on('resize', function () {
2380        INSPIRO.header.stickyHeader();
2381        INSPIRO.core.screenSizeControl();
2382        INSPIRO.header.logoStatus();
2383    });
2384
2385})(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.