(function($){ 'use strict'; $.extend({ browserSelector: function(){ (function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(|\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg(g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v)|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v)|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|)|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera); var hasTouch='ontouchstart' in window||navigator.msMaxTouchPoints; var u=navigator.userAgent, ua=u.toLowerCase(), is=function (t){ return ua.indexOf(t) > -1; }, g='gecko', w='webkit', s='safari', o='opera', h=document.documentElement, b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua)) ? ('ie ie' + parseFloat(navigator.appVersion.split("MSIE")[1])):is('firefox/2') ? g + ' ff2':is('firefox/3.5') ? g + ' ff3 ff3_5':is('firefox/3') ? g + ' ff3':is('gecko/') ? g:is('opera') ? o + (/version\/(\d+)/.test(ua) ? ' ' + o + RegExp.jQuery1:(/opera(\s|\/)(\d+)/.test(ua) ? ' ' + o + RegExp.jQuery2:'')):is('konqueror') ? 'konqueror':is('chrome') ? w + ' chrome':is('iron') ? w + ' iron':is('applewebkit/') ? w + ' ' + s + (/version\/(\d+)/.test(ua) ? ' ' + s + RegExp.jQuery1:''):is('mozilla/') ? g:'', is('j2me') ? 'mobile':is('iphone') ? 'iphone':is('ipod') ? 'ipod':is('mac') ? 'mac':is('darwin') ? 'mac':is('webtv') ? 'webtv':is('win') ? 'win':is('freebsd') ? 'freebsd':(is('x11')||is('linux')) ? 'linux':'', 'js']; var c=b.join(' '); if($.browser.mobile){ c +=' mobile'; } if(hasTouch){ c +=' touch'; } h.className +=' ' + c; var isIE11 = !(window.ActiveXObject)&&"ActiveXObject" in window; if(isIE11){ $('html').removeClass('gecko').addClass('ie ie11'); return; }} }); $.browserSelector(); })(jQuery); (function($,sr){ 'use strict'; var debounce=function (func, threshold, execAsap){ var timeout; return function debounced (){ var obj=this, args=arguments; function delayed (){ if(!execAsap) func.apply(obj, args); timeout=null; } if(timeout) clearTimeout(timeout); else if(execAsap) func.apply(obj, args); timeout=setTimeout(delayed, threshold||100); };}; jQuery.fn[sr]=function(fn){ return fn ? this.bind('resize', debounce(fn)):this.trigger(sr); };})(jQuery,'smartresize'); jQuery.extend(jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d){ return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeOutQuad: function (x, t, b, c, d){ return -c *(t/=d)*(t-2) + b; }, easeInOutQuart: function (x, t, b, c, d){ if((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }}); window.theme={}; (function(theme, $){ 'use strict'; theme=theme||{}; $.extend(theme, { rtl: js_porto_vars.rtl=='1' ? true:false, rtl_browser: $('html').hasClass('browser-rtl'), ajax_url: js_porto_vars.ajax_url, request_error: js_porto_vars.request_error, change_logo: js_porto_vars.change_logo=='1' ? true:false, show_sticky_header: js_porto_vars.show_sticky_header=='1' ? true:false, show_sticky_header_tablet: js_porto_vars.show_sticky_header_tablet=='1' ? true:false, show_sticky_header_mobile: js_porto_vars.show_sticky_header_mobile=='1' ? true:false, category_ajax: js_porto_vars.category_ajax=='1' ? true:false, prdctfltr_ajax: js_porto_vars.prdctfltr_ajax=='1' ? true:false, show_minicart: js_porto_vars.show_minicart=='1' ? true:false, container_width: parseInt(js_porto_vars.container_width), grid_gutter_width: parseInt(js_porto_vars.grid_gutter_width), screen_lg: parseInt(js_porto_vars.screen_lg), slider_loop: js_porto_vars.slider_loop=='1' ? true:false, slider_autoplay: js_porto_vars.slider_autoplay=='1' ? true:false, slider_autoheight: js_porto_vars.slider_autoheight=='1' ? true:false, slider_speed: js_porto_vars.slider_speed ? js_porto_vars.slider_speed:5000, slider_nav: js_porto_vars.slider_nav=='1' ? true:false, slider_nav_hover: js_porto_vars.slider_nav_hover=='1' ? true:false, slider_margin: js_porto_vars.slider_margin=='1' ? 40:0, slider_dots: js_porto_vars.slider_dots=='1' ? true:false, slider_animatein: js_porto_vars.slider_animatein ? js_porto_vars.slider_animatein:'', slider_animateout: js_porto_vars.slider_animateout ? js_porto_vars.slider_animateout:'', product_thumbs_count: js_porto_vars.product_thumbs_count ? js_porto_vars.product_thumbs_count:4, product_zoom: js_porto_vars.product_zoom=='1' ? true:false, product_zoom_mobile: js_porto_vars.product_zoom_mobile=='1' ? true:false, product_image_popup: js_porto_vars.product_image_popup=='1' ? 'fadeOut':false, owlConfig: { rtl: js_porto_vars.rtl=='1' ? true:false, loop:js_porto_vars.slider_loop=='1' ? true:false, autoplay:js_porto_vars.slider_autoplay=='1' ? true:false, autoHeight:js_porto_vars.slider_autoheight=='1' ? true:false, autoplayTimeout: js_porto_vars.slider_speed ? js_porto_vars.slider_speed:5000, autoplayHoverPause:true, lazyLoad: true, nav: js_porto_vars.slider_nav=='1' ? true:false, navText: ["", ""], dots: js_porto_vars.slider_dots=='1' ? true:false, stagePadding: (js_porto_vars.slider_nav_hover!='1'&&js_porto_vars.slider_margin=='1') ? 40:0, animateOut: js_porto_vars.slider_animateout ? js_porto_vars.slider_animateout:'', animateIn: js_porto_vars.slider_animatein ? js_porto_vars.slider_animatein:'' }, sticky_nav_height: 0, getScrollbarWidth: function(){ if(this.scrollbarSize===undefined){ var scrollDiv=document.createElement("div"); scrollDiv.style.cssText='width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;'; document.body.appendChild(scrollDiv); this.scrollbarSize=scrollDiv.offsetWidth - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); } return this.scrollbarSize; }, isTablet: function(){ if($(window).width() < 992 - theme.getScrollbarWidth()) return true; return false; }, isMobile: function(){ if($(window).width() <=480 - theme.getScrollbarWidth()) return true; return false; }, refreshVCContent: function($elements){ if($elements){ $(window).trigger('resize'); } theme.refreshStickySidebar(true); if(typeof window.vc_js=='function') window.vc_js(); $(document.body).trigger('porto_refresh_vc_content', [$elements]); }, adminBarHeight: function(){ var $admin_bar=$('#wpadminbar'), adminbar_height=0; if($admin_bar.get(0)&&$admin_bar.is(':visible')){ adminbar_height=$('#wpadminbar').css('position')=='fixed' ? $('#wpadminbar').height():0; } return parseInt(adminbar_height); }, refreshStickySidebar: function(timeout){ var $sticky_sidebar=$('.sidebar [data-plugin-sticky]'); if($sticky_sidebar.get(0)){ if(timeout){ setTimeout(function(){ $sticky_sidebar.trigger('recalc.pin'); }, 400); }else{ $sticky_sidebar.trigger('recalc.pin'); }} }, scrolltoContainer: function($container){ if($container.get(0)){ var winWidth=$(window).width(); if(winWidth <=991 - theme.getScrollbarWidth()){ $('.sidebar-overlay').click(); } $('html, body').stop().animate({ scrollTop: $container.offset().top - theme.StickyHeader.sticky_height - theme.adminBarHeight() - theme.sticky_nav_height - 18 }, 600, 'easeOutQuad'); }} }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__accordion'; var Accordion=function($el, opts){ return this.initialize($el, opts); }; Accordion.defaults={ }; Accordion.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, Accordion.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ if(!($.isFunction($.fn.collapse))){ return this; } var $el=this.options.wrapper, $collapse=$el.find('.collapse'), collapsible=$el.data('collapsible'), active_num=$el.data('active-tab'); if($collapse.length > 0){ if(collapsible=='yes'){ $collapse.collapse({toggle: false, parent: '#' + $el.attr('id')}); }else if(!isNaN(active_num)&&active_num==parseInt(active_num)&&$el.find('.collapse').length > active_num){ $el.find('.collapse').collapse({toggle: false, parent: '#' + $el.attr('id')}); $el.find('.collapse').eq(active_num-1).collapse('toggle'); }else{ $el.find('.collapse').collapse({parent: '#' + $el.attr('id')}); }} return this; }}; $.extend(theme, { Accordion: Accordion }); $.fn.themeAccordion=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.Accordion($this, opts); }}); };}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__accordionMenu'; var AccordionMenu=function($el, opts){ return this.initialize($el, opts); }; AccordionMenu.defaults={ }; AccordionMenu.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, AccordionMenu.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var self=this, $el=this.options.wrapper; $el.find('li.menu-item.active').each(function(){ var $this=$(this); if($this.find('> .arrow').get(0)) $this.find('> .arrow').click(); }); $el.find('.arrow').on('click', function(){ var $this=$(this), $parent=$this.closest('li'); if(typeof self.options.open_one!='undefined'){ $parent.siblings('.open').children('.arrow').next().hide(); $parent.siblings('.open').removeClass('open'); $this.next().stop().toggle(); }else{ $this.next().stop().slideToggle(); } if($parent.hasClass('open')){ $parent.removeClass('open'); }else{ $parent.addClass('open'); }}); return this; }}; $.extend(theme, { AccordionMenu: AccordionMenu }); $.fn.themeAccordionMenu=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.AccordionMenu($this, opts); }}); };}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__animate'; var Animate=function($el, opts){ return this.initialize($el, opts); }; Animate.defaults={ accX: 0, accY: -150, delay: 1, duration: 1000 }; Animate.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, Animate.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var self=this, $el=this.options.wrapper, delay=0, duration=0; $el.addClass('appear-animation'); if(!$('html').hasClass('no-csstransitions')&&$(window).width() > (767 - theme.getScrollbarWidth())&&$.isFunction($.fn.appear)){ $el.appear(function(){ delay=Math.abs($el.attr('data-appear-animation-delay') ? $el.attr('data-appear-animation-delay'):self.options.delay); if(delay > 1){ $el.css('animation-delay', delay + 'ms'); } duration=Math.abs($el.attr('data-appear-animation-duration') ? $el.attr('data-appear-animation-duration'):self.options.duration); if(duration!=1000){ $el.css('animation-duration', duration + 'ms'); } $el.addClass($el.attr('data-appear-animation')); setTimeout(function(){ $el.addClass('appear-animation-visible'); }, delay); }, { accX: self.options.accX, accY: self.options.accY }); }else{ $el.addClass('appear-animation-visible'); } return this; }}; $.extend(theme, { Animate: Animate }); $.fn.themeAnimate=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.Animate($this, opts); }}); };}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__carousel'; var Carousel=function($el, opts){ return this.initialize($el, opts); }; Carousel.defaults=$.extend({}, { loop: true, navText: [], themeConfig: false, lazyLoad: true, lg: 0, md: 0, sm: 0, xs: 0, responsive: {}, single: false, rtl: theme.rtl }); var scrollWidth=theme.getScrollbarWidth(), w_sm=576 - scrollWidth, w_md=768 - scrollWidth, w_lg=992 - scrollWidth, w_xl=theme.screen_lg - scrollWidth, w_sl=1400 - scrollWidth; Carousel.defaults.responsive[0]={items: 1}; Carousel.defaults.responsive[w_sm]={items: 1, mergeFit: false}; Carousel.defaults.responsive[w_md]={items: 1, mergeFit: false}; Carousel.defaults.responsive[w_lg]={items: 1, mergeFit: false}; Carousel.defaults.responsive[w_xl]={items: 1, mergeFit: false}; Carousel.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ if((opts&&opts.themeConfig)||!opts){ this.options=$.extend(true, {}, Carousel.defaults, theme.owlConfig, opts, { wrapper: this.$el, themeConfig: true }); }else{ this.options=$.extend(true, {}, Carousel.defaults, opts, { wrapper: this.$el }); } return this; }, build: function(){ if(!($.isFunction($.fn.owlCarousel))){ return this; } var $el=this.options.wrapper, loop=this.options.loop, lg=this.options.lg ? this.options.lg:this.options.items, md=this.options.md ? this.options.md:this.options.items, sm=this.options.sm ? this.options.sm:this.options.items, xs=this.options.xs ? this.options.xs:this.options.items, single=this.options.single, zoom=$el.find('.zoom').get(0), responsive={}, items, count=$el.find('> *').length, fullscreen=typeof this.options.fullscreen=='undefined' ? false:this.options.fullscreen; if(fullscreen){ $el.children().width($(window).width()); $el.children().height($el.closest('.fullscreen-carousel').length ? $el.closest('.fullscreen-carousel').height():$(window).height()); $el.children().css('max-height', '100%'); $(window).on('resize', function(){ $el.find('.owl-item').children().width($(window).width()); $el.find('.owl-item').children().height($el.closest('.fullscreen-carousel').length ? $el.closest('.fullscreen-carousel').height():$(window).height()); $el.find('.owl-item').children().css('max-height', '100%'); }); } if(single){ items=1; }else{ items=this.options.items ? this.options.items:(lg ? lg:1); if(this.options.xl){ responsive[w_sl]={ items: this.options.xl, loop: (loop&&count > this.options.xl) ? true:false, mergeFit: this.options.mergeFit };} responsive[w_xl]={ items: items, loop: (loop&&count > items) ? true:false, mergeFit: this.options.mergeFit }; if(lg) responsive[w_lg]={ items: lg, loop: (loop&&count > lg) ? true:false, mergeFit: this.options.mergeFit_lg }; if(md) responsive[w_md]={ items: md, loop: (loop&&count > md) ? true:false, mergeFit: this.options.mergeFit_md }; if(sm) responsive[w_sm]={ items: sm, loop: (loop&&count > sm) ? true:false, mergeFit: this.options.mergeFit_sm }; if(xs) responsive[0]={ items: xs, loop: (loop&&count > xs) ? true:false, mergeFit: this.options.mergeFit_xs };} if(!$el.hasClass('show-nav-title')&&this.options.themeConfig&&theme.slider_nav&&theme.slider_nav_hover) $el.addClass('show-nav-hover'); this.options=$.extend(true, {}, this.options, { items: items, loop: (loop&&count > items) ? true:false, responsive: responsive, onInitialized: function(){ $el.find('.owl-stage-outer').css({ 'margin-left': this.options.stagePadding, 'margin-right': this.options.stagePadding }); if($el.hasClass('show-dots-title')&&($el.prev('.porto-u-heading, .vc_custom_heading, .slider-title').length||$el.closest('.slider-wrapper').prev('.porto-u-heading, .vc_custom_heading, .slider-title').length||$el.closest('.porto-recent-posts').prev('.porto-u-heading, .vc_custom_heading, .slider-title').length)){ var $obj=$el.prev('.porto-u-heading, .vc_custom_heading, .slider-title'); if(!$obj.length){ $obj=$el.closest('.slider-wrapper').prev('.porto-u-heading, .vc_custom_heading, .slider-title'); } if(!$obj.length){ $obj=$el.closest('.porto-recent-posts').prev('.porto-u-heading, .vc_custom_heading, .slider-title'); } try { var innerWidth=$obj.css('display', 'inline-block').width(); $obj.css('display', ''); if(innerWidth + 15 + $el.find('.owl-dots').width() <=$obj.width()){ $el.find('.owl-dots').css('left', innerWidth + 15 + ($el.width() - $obj.width()) / 2); $el.find('.owl-dots').css('top', -1 * $obj.height() / 2 - parseInt($obj.css('margin-bottom')) - $el.find('.owl-dots').height() / 2 + 2); }else{ $el.find('.owl-dots').css('position', 'static'); }} catch(e){}} }, touchDrag: (count==1) ? false:true, mouseDrag: (count==1) ? false:true }); if(this.options.autoHeight){ function calcOwlHeight(){ var h=0; $el.find('.owl-item.active').each(function(){ if(h < $(this).height()) h=$(this).height(); }); $el.find('.owl-stage-outer').height(h); } $(window).on('resize', function(){ calcOwlHeight(); }); $(window).on('load', function(){ calcOwlHeight(); }); } var links=false; if(zoom){ links=[]; var i=0; $el.find('.zoom').each(function(){ var slide={}, $zoom=$(this); slide.src=$zoom.data('src'); slide.title=$zoom.data('title'); links[i]=slide; $zoom.data('index', i); i++; }); } if($el.hasClass('show-nav-title')){ this.options.stagePadding=0; }else{ if(this.options.themeConfig&&theme.slider_nav&&theme.slider_nav_hover) $el.addClass('show-nav-hover'); if(this.options.themeConfig&&!theme.slider_nav_hover&&theme.slider_margin) $el.addClass('stage-margin'); } $el.owlCarousel(this.options); if(zoom&&links){ $el.on('click', '.zoom', function(e){ e.preventDefault(); if($.fn.magnificPopup){ $.magnificPopup.close(); $.magnificPopup.open($.extend(true, {}, theme.mfpConfig, { items: links, gallery: { enabled: true }, type: 'image' }), $(this).data('index')); } return false; }); } return this; }}; $.extend(theme, { Carousel: Carousel }); $.fn.themeCarousel=function(opts, zoom){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.Carousel($this, opts, zoom); }}); };}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__chartCircular'; var ChartCircular=function($el, opts){ return this.initialize($el, opts); }; ChartCircular.defaults={ accX: 0, accY: -150, delay: 1, barColor: '#0088CC', trackColor: '#f2f2f2', scaleColor: false, scaleLength: 5, lineCap: 'round', lineWidth: 13, size: 175, rotate: 0, animate: ({ duration: 2500, enabled: true }) }; ChartCircular.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, ChartCircular.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ if(!($.isFunction($.fn.appear))||!($.isFunction($.fn.easyPieChart))){ return this; } var self=this, $el=this.options.wrapper, value=($el.attr('data-percent') ? $el.attr('data-percent'):0), percentEl=$el.find('.percent'); if(!value) value=1; var labelValue=this.options.labelValue ? this.options.labelValue:value; $.extend(true, self.options, { onStep: function(from, to, currentValue){ percentEl.html(parseInt(labelValue * currentValue / value)); }}); $el.attr('data-percent', 0); $el.appear(function(){ $el.easyPieChart(self.options); setTimeout(function(){ $el.data('easyPieChart').update(value); $el.attr('data-percent', value); }, self.options.delay); }, { accX: self.options.accX, accY: self.options.accY }); return this; }}; $.extend(theme, { ChartCircular: ChartCircular }); $.fn.themeChartCircular=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.ChartCircular($this, opts); }}); };}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__fitVideo'; var FitVideo=function($el, opts){ return this.initialize($el, opts); }; FitVideo.defaults={ }; FitVideo.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, FitVideo.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ if(!($.isFunction($.fn.fitVids))){ return this; } var $el=this.options.wrapper; $el.fitVids(); $(window).on('resize', function(){ $el.fitVids(); }); return this; }}; $.extend(theme, { FitVideo: FitVideo }); $.fn.themeFitVideo=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.FitVideo($this, opts); }}); };}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__videobackground'; var PluginVideoBackground=function($el, opts){ return this.initialize($el, opts); }; PluginVideoBackground.defaults={ overlay: true, volume: 1, playbackRate: 1, muted: true, loop: true, autoplay: true, position: '50% 50%', posterType: 'detect' }; PluginVideoBackground.prototype={ initialize: function($el, opts){ this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, PluginVideoBackground.defaults, opts, { path: this.$el.data('video-path'), wrapper: this.$el }); return this; }, build: function(){ if(!($.isFunction($.fn.vide))||(!this.options.path)){ return this; } if(this.options.overlay){ this.options.wrapper.prepend($('
').addClass('video-overlay') ); } this.options.wrapper.vide(this.options.path, this.options); return this; }}; $.extend(theme, { PluginVideoBackground: PluginVideoBackground }); $.fn.themePluginVideoBackground=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new PluginVideoBackground($this, opts); }}); };}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__wordRotate'; var PluginWordRotate=function($el, opts){ return this.initialize($el, opts); }; PluginWordRotate.defaults={ delay: 2000, animDelay: 500, pauseOnHover: true, }; PluginWordRotate.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this.setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, PluginWordRotate.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var self=this, $el=this.options.wrapper, itemsWrapper=$el.find(".word-rotate-items"), items=itemsWrapper.find("> span"), firstItem=items.eq(0), firstItemClone=firstItem.clone().removeClass('active'), currentItem=1, currentTop=0, itemWidth=0, intervalId=null; itemsWrapper .width(firstItem.width() + "px") .append(firstItemClone); var setTimer=function(){ currentTop=(currentItem * $el.height()); currentItem++; items.removeClass('active').addClass('inactive'); if(currentItem <=items.length){ itemWidth=items.eq(currentItem-1).width(); items.eq(currentItem-1).removeClass('inactive').addClass('active'); }else{ itemWidth=items.eq(0).width(); items.eq(0).removeClass('inactive').addClass('active'); } itemsWrapper.animate({ top: -(currentTop) + "px", width: itemWidth + "px" }, self.options.animDelay, "easeOutQuad", function(){ if(currentItem > items.length){ itemsWrapper.css("top", 0); currentItem=1; }}); }; if(self.options.pauseOnHover){ itemsWrapper.on('mouseenter', function(){ if(intervalId!=null){ clearInterval(intervalId); }}).on('mouseleave', function(){ intervalId=setInterval(setTimer, self.options.delay); }); } $el.addClass("active"); intervalId=setInterval(setTimer, self.options.delay); return this; }}; $.extend(theme, { PluginWordRotate: PluginWordRotate }); $.fn.themePluginWordRotate=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new PluginWordRotate($this, opts); }}); }}).apply(this, [ window.theme, jQuery ]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__flickrZoom'; var FlickrZoom=function($el, opts){ return this.initialize($el, opts); }; FlickrZoom.defaults={ }; FlickrZoom.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, FlickrZoom.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var $el=this.options.wrapper, links=[], i=0, $flickr_links=$el.find('.flickr_badge_image > a'); $flickr_links.each(function(){ var slide={}, $image=$(this).find('> img'); slide.src=$image.attr('src').replace('_s.', '_b.'); slide.title=$image.attr('title'); links[i]=slide; i++; }); $flickr_links.on('click', function(e){ e.preventDefault(); if($.fn.magnificPopup){ $.magnificPopup.close(); $.magnificPopup.open($.extend(true, {}, theme.mfpConfig, { items: links, gallery: { enabled: true }, type: 'image' }), $flickr_links.index($(this))); }}); return this; }}; $.extend(theme, { FlickrZoom: FlickrZoom }); $.fn.themeFlickrZoom=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.FlickrZoom($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__lazyload'; var PluginLazyLoad=function($el, opts){ return this.initialize($el, opts); }; PluginLazyLoad.defaults={ effect: 'show', appearEffect: '', appear: function(elements_left, settings){ }, load: function(elements_left, settings){ $(this).addClass($.trim('lazy-load-loaded ' + settings.appearEffect)); }}; PluginLazyLoad.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, PluginLazyLoad.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ if(!($.isFunction($.fn.lazyload))){ return this; } var self=this; self.options.wrapper.lazyload(this.options); return this; }}; $.extend(theme, { PluginLazyLoad: PluginLazyLoad }); $.fn.themePluginLazyLoad=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new PluginLazyLoad($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var loadingOverlayTemplate=[ ' ' ].join(''); var LoadingOverlay=function($wrapper, options){ return this.initialize($wrapper, options); }; LoadingOverlay.prototype={ options: { css: {}}, initialize: function($wrapper, options){ this.$wrapper=$wrapper; this .setVars() .setOptions(options) .build() .events(); this.$wrapper.data('loadingOverlay', this); }, setVars: function(){ this.$overlay=this.$wrapper.find('.loading-overlay'); return this; }, setOptions: function(options){ if(!this.$overlay.get(0)){ this.matchProperties(); } this.options=$.extend(true, {}, this.options, options); this.loaderClass=this.getLoaderClass(this.options.css.backgroundColor); return this; }, build: function(){ if(!this.$overlay.closest(document.documentElement).get(0)){ if(!this.$cachedOverlay){ this.$overlay=$(loadingOverlayTemplate).clone(); if(this.options.css){ this.$overlay.css(this.options.css); this.$overlay.find('.loader').addClass(this.loaderClass); }}else{ this.$overlay=this.$cachedOverlay.clone(); } this.$wrapper.append(this.$overlay); } if(!this.$cachedOverlay){ this.$cachedOverlay=this.$overlay.clone(); } return this; }, events: function(){ var _self=this; if(this.options.startShowing){ _self.show(); } if(this.$wrapper.is('body')||this.options.hideOnWindowLoad){ $(window).on('load error', function(){ _self.hide(); }); } if(this.options.listenOn){ $(this.options.listenOn) .on('loading-overlay:show beforeSend.ic', function(e){ e.stopPropagation(); _self.show(); }) .on('loading-overlay:hide complete.ic', function(e){ e.stopPropagation(); _self.hide(); }); } this.$wrapper .on('loading-overlay:show beforeSend.ic', function(e){ e.stopPropagation(); _self.show(); }) .on('loading-overlay:hide complete.ic', function(e){ e.stopPropagation(); _self.hide(); }); return this; }, show: function(){ this.build(); this.position=this.$wrapper.css('position').toLowerCase(); if(this.position!='relative'||this.position!='absolute'||this.position!='fixed'){ this.$wrapper.css({ position: 'relative' }); } this.$wrapper.addClass('loading-overlay-showing'); }, hide: function(){ var _self=this; this.$wrapper.removeClass('loading-overlay-showing'); setTimeout(function(){ if(this.position!='relative'||this.position!='absolute'||this.position!='fixed'){ _self.$wrapper.css({ position: '' }); }}, 500); }, matchProperties: function(){ var i, l, properties; properties=[ 'backgroundColor', 'borderRadius' ]; l=properties.length; for(i=0; i < l; i++){ var obj={}; obj[ properties[ i ] ]=this.$wrapper.css(properties[ i ]); $.extend(this.options.css, obj); }}, getLoaderClass: function(backgroundColor){ if(!backgroundColor||backgroundColor==='transparent'||backgroundColor==='inherit'){ return 'black'; } var hexColor, r, g, b, yiq; var colorToHex=function(color){ var hex, rgb; if(color.indexOf('#') >- 1){ hex=color.replace('#', ''); }else{ rgb=color.match(/\d+/g); hex=('0' + parseInt(rgb[0], 10).toString(16)).slice(-2) + ('0' + parseInt(rgb[1], 10).toString(16)).slice(-2) + ('0' + parseInt(rgb[2], 10).toString(16)).slice(-2); } if(hex.length===3){ hex=hex + hex; } return hex; }; hexColor=colorToHex(backgroundColor); r=parseInt(hexColor.substr(0, 2), 16); g=parseInt(hexColor.substr(2, 2), 16); b=parseInt(hexColor.substr(4, 2), 16); yiq=((r * 299) + (g * 587) + (b * 114)) / 1000; return(yiq >=128) ? 'black':'white'; }}; $.extend(theme, { LoadingOverlay: LoadingOverlay }); $.fn.loadingOverlay=function(opts){ return this.each(function(){ var $this=$(this); var loadingOverlay=$this.data('loadingOverlay'); if(loadingOverlay){ return loadingOverlay; }else{ var options=opts||$this.data('loading-overlay-options')||{}; return new LoadingOverlay($this, options); }}); } $(function(){ $('[data-loading-overlay]').loadingOverlay(); }); }).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__masonry'; var Masonry=function($el, opts){ return this.initialize($el, opts); }; Masonry.defaults={ itemSelector: 'li', isOriginLeft:!theme.rtl }; Masonry.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, Masonry.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ if(!($.isFunction($.fn.isotope))){ return this; } var self=this, $el=this.options.wrapper; $el.isotope(this.options); if(this.options.callback){ $el.isotope('on', 'layoutComplete', function(){ if(typeof this.options.callback=='function'){ this.options.callback.call(); } $el.find('.porto-lazyload:not(.lazy-load-loaded)').trigger('appear'); }); } $el.isotope('layout'); self.resize(); $(window).on('resize', function(){ self.resize() }); return this; }, resize: function(){ var self=this, $el=this.options.wrapper; if(self.resizeTimer) clearTimeout(self.resizeTimer); self.resizeTimer=setTimeout(function(){ if($el.data('isotope')){ $el.isotope('layout'); } delete self.resizeTimer; }, 600); }}; $.extend(theme, { Masonry: Masonry }); $.fn.themeMasonry=function(opts){ return this.map(function(){ var $this=$(this); $this.waitForImages(function(){ if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.Masonry($this, opts); }}); }); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__previewImage'; var PreviewImage=function($el, opts){ return this.initialize($el, opts); }; PreviewImage.defaults={ }; PreviewImage.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, PreviewImage.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var $el=this.options.wrapper, image=$el.data('image'); if(image){ $el.css('background-image', 'url(' + image + ')'); } return this; }}; $.extend(theme, { PreviewImage: PreviewImage }); $.fn.themePreviewImage=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.PreviewImage($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__refreshVideoSize'; var RefreshVideoSize=function($el, opts){ return this.initialize($el, opts); }; RefreshVideoSize.defaults={ }; RefreshVideoSize.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, RefreshVideoSize.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var self=this, resizeTimer=false; setTimeout(function(){ self.refresh(); }, 100); $(window).on('resize', function(){ if(resizeTimer){ clearTimeout(resizeTimer); } resizeTimer=setTimeout(function(){ self.refresh(); }, 100); }); return this; }, refresh: function(){ var $el=this.options.wrapper, $video=$el.find('video'), h=$el.height(); if(!$video.get(0)){ return; } $video.css('width', '100%').css('height', 'auto'); var vh=$video.height(); if(vh < h){ $video.css('height', h); $video.css('width', h / vh * 100 + '%'); } return this; }}; $.extend(theme, { RefreshVideoSize: RefreshVideoSize }); $.fn.themeRefreshVideoSize=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.RefreshVideoSize($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__toggle'; var Toggle=function($el, opts){ return this.initialize($el, opts); }; Toggle.defaults={ }; Toggle.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, Toggle.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var $el=this.options.wrapper; if($el.hasClass('active')) $el.find("> div.toggle-content").stop().slideDown(350, function(){ $(this).attr('style', '').show(); }); $el.on('click', "> label", function(e){ var parentSection=$(this).parent(), parentWrapper=$(this).closest("div.toogle"), parentToggles=$(this).closest(".porto-toggles"), isAccordion=parentWrapper.hasClass("toogle-accordion"), toggleContent=parentSection.find("> div.toggle-content"); if(isAccordion&&typeof(e.originalEvent)!="undefined"){ parentWrapper.find("section.toggle.active > label").trigger("click"); } if(!parentSection.hasClass("active")){ if(parentToggles.length){ if(parentToggles.data('view')=='one-toggle'){ parentToggles.find('.toggle').each(function(){ $(this).removeClass('active'); $(this).find("> div.toggle-content").stop().slideUp(350, function(){ $(this).attr('style', '').hide(); }); }); }} toggleContent.stop().slideDown(350, function(){ $(this).attr('style', '').show(); theme.refreshVCContent(toggleContent); }); parentSection.addClass("active"); }else{ if(!parentToggles.length||parentToggles.data('view')!='one-toggle'){ toggleContent.stop().slideUp(350, function(){ $(this).attr('style', '').hide(); }); parentSection.removeClass("active"); }} }); return this; }}; $.extend(theme, { Toggle: Toggle }); $.fn.themeToggle=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.Toggle($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; theme=theme||{}; var instanceName='__parallax'; var Parallax=function($el, opts){ return this.initialize($el, opts); }; Parallax.defaults={ speed: 1.5, horizontalPosition: '50%', offset: 0 }; Parallax.prototype={ initialize: function($el, opts){ if($el.data(instanceName)){ return this; } this.$el=$el; this .setData() .setOptions(opts) .build(); return this; }, setData: function(){ this.$el.data(instanceName, this); return this; }, setOptions: function(opts){ this.options=$.extend(true, {}, Parallax.defaults, opts, { wrapper: this.$el }); return this; }, build: function(){ var self=this, $window=$(window), offset, yPos, bgpos; self.options.wrapper.removeAttr('style'); if(typeof self.options.wrapper.data('image-src')!='undefined') self.options.wrapper.css('background-image', 'url(' + self.options.wrapper.data('image-src') + ')'); if(!$.browser.mobile){ $window.on('scroll resize', function(){ offset=self.options.wrapper.offset(); yPos=-($window.scrollTop() - offset.top) / self.options.speed + (self.options.offset); bgpos=self.options.horizontalPosition + ' ' + yPos + 'px'; self.options.wrapper.css('background-position', bgpos); }); $window.trigger('scroll'); }else{ self.options.wrapper.addClass('parallax-disabled'); } return this; }}; $.extend(theme, { Parallax: Parallax }); $.fn.themeParallax=function(opts){ return this.map(function(){ var $this=$(this); if($this.data(instanceName)){ return $this.data(instanceName); }else{ return new theme.Parallax($this, opts); }}); }}).apply(this, [window.theme, jQuery]); (function(theme, $){ 'use strict'; $.fn.themePin=function (options){ var scrollY=0, lastScrollY=0, elements=[], disabled=false, $window=$(window), fixedSideTop=[], fixedSideBottom=[], prevDataTo=[]; options=options||{}; var recalculateLimits=function (){ for (var i=0, len=elements.length; i