Import legacy nurinda.co.id website

This commit is contained in:
dirga committed 2026-10-01 14:27:19 +07:00
1 parent 3f59bb9038
commit 6e21646ac4
13389 files changed
+3246690

No files matched your search

@@ -0,0 +1,63 @@
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
*
* Copyright � 2008 George McGinley Smith
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});
// Animation of elements appearance
jQuery( function( $ ) {
"use strict";
$( '.animate_fade, .animate_afc, .animate_afl, .animate_afr, .animate_aft, .animate_afb, .animate_wfc, ' +
'.animate_hfc, .animate_rfc, .animate_rfl, .animate_rfr' ).each( function() {
$us.scroll.addWaypoint( $( this ), '15%', function( $elm ) {
if ( ! $elm.hasClass( 'animate_start' ) ) {
setTimeout( function() {
$elm.addClass( 'animate_start' );
}, 20 );
}
} );
} );
$( '.wpb_animate_when_almost_visible' ).each( function() {
$us.scroll.addWaypoint( $( this ), '15%', function( $elm ) {
if ( ! $elm.hasClass( 'wpb_start_animation' ) ) {
setTimeout( function() {
$elm.addClass( 'wpb_start_animation' );
}, 20 );
}
} );
} );
} );
@@ -0,0 +1 @@
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return-(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return-0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});jQuery(function($){"use strict";$('.animate_fade, .animate_afc, .animate_afl, .animate_afr, .animate_aft, .animate_afb, .animate_wfc, '+'.animate_hfc, .animate_rfc, .animate_rfl, .animate_rfr').each(function(){$us.scroll.addWaypoint($(this),'15%',function($elm){if(!$elm.hasClass('animate_start')){setTimeout(function(){$elm.addClass('animate_start')},20)}})});$('.wpb_animate_when_almost_visible').each(function(){$us.scroll.addWaypoint($(this),'15%',function($elm){if(!$elm.hasClass('wpb_start_animation')){setTimeout(function(){$elm.addClass('wpb_start_animation')},20)}})})})
@@ -0,0 +1,76 @@
/**
* WordPress Comments Form
*
*/
! function( $ ) {
"use strict";
$us.CommnentsForm = function( container, options ) {
this.init( container, options );
};
$us.CommnentsForm.prototype = {
init: function( container, options ) {
this.$container = $( container );
this.$form = this.$container.find( 'form.comment-form' );
if ( ! this.$form.length ) {
return;
}
this.$jsonContainer = this.$container.find( '.us-comments-json' );
if ( ! this.$jsonContainer.length ) {
return;
}
this.jsonData = this.$jsonContainer[ 0 ].onclick() || {};
this.$jsonContainer.remove();
this.$fields = {
content: {
field: this.$form.find( 'textarea' ),
msg: this.jsonData.no_content_msg || 'Please enter a Message'
},
name: {
field: this.$form.find( '.for_text input[type="text"]' ),
msg: this.jsonData.no_name_msg || 'Please enter your Name'
},
email: {
field: this.$form.find( '.for_email input[type="email"]' ),
msg: this.jsonData.no_email_msg || 'Please enter a valid email address.'
}
};
this._events = {
formSubmit: this.formSubmit.bind( this )
};
this.$form.on( 'submit', this._events.formSubmit );
},
formSubmit: function( event ) {
// Clear errors
this.$form.find( '.w-form-row.check_wrong' ).removeClass( 'check_wrong' );
this.$form.find( '.w-form-state' ).html( '' );
// Do not send empty fields
for ( var i in this.$fields ) {
if ( this.$fields[ i ].field.length == 0 ) {
continue;
}
if ( this.$fields[ i ].field.val() == '' && this.$fields[ i ].field.attr( 'data-required' ) ) {
this.$fields[ i ].field.closest( '.w-form-row' ).toggleClass( 'check_wrong' );
this.$fields[ i ].field.closest( '.w-form-row' ).find( '.w-form-row-state' ).html( this.$fields[ i ].msg );
event.preventDefault();
}
}
}
};
$.fn.CommnentsForm = function( options ) {
return this.each( function() {
$( this ).data( 'CommnentsForm', new $us.CommnentsForm( this, options ) );
} );
};
$( function() {
$( '.w-post-elm.post_comments.layout_comments_template' ).CommnentsForm();
$( '.l-section.for_comments' ).CommnentsForm();
} );
}( jQuery );
@@ -0,0 +1,4 @@
!function($){"use strict";$us.CommnentsForm=function(container,options){this.init(container,options)};$us.CommnentsForm.prototype={init:function(container,options){this.$container=$(container);this.$form=this.$container.find('form.comment-form');if(!this.$form.length){return}
this.$jsonContainer=this.$container.find('.us-comments-json');if(!this.$jsonContainer.length){return}
this.jsonData=this.$jsonContainer[0].onclick()||{};this.$jsonContainer.remove();this.$fields={content:{field:this.$form.find('textarea'),msg:this.jsonData.no_content_msg||'Please enter a Message'},name:{field:this.$form.find('.for_text input[type="text"]'),msg:this.jsonData.no_name_msg||'Please enter your Name'},email:{field:this.$form.find('.for_email input[type="email"]'),msg:this.jsonData.no_email_msg||'Please enter a valid email address.'}};this._events={formSubmit:this.formSubmit.bind(this)};this.$form.on('submit',this._events.formSubmit)},formSubmit:function(event){this.$form.find('.w-form-row.check_wrong').removeClass('check_wrong');this.$form.find('.w-form-state').html('');for(var i in this.$fields){if(this.$fields[i].field.length==0){continue}
if(this.$fields[i].field.val()==''&&this.$fields[i].field.attr('data-required')){this.$fields[i].field.closest('.w-form-row').toggleClass('check_wrong');this.$fields[i].field.closest('.w-form-row').find('.w-form-row-state').html(this.$fields[i].msg);event.preventDefault()}}}};$.fn.CommnentsForm=function(options){return this.each(function(){$(this).data('CommnentsForm',new $us.CommnentsForm(this,options))})};$(function(){$('.w-post-elm.post_comments.layout_comments_template').CommnentsForm();$('.l-section.for_comments').CommnentsForm()})}(jQuery)
@@ -0,0 +1,257 @@
/**
* UpSolution Shortcode: us_cform
*/
jQuery( function( $ ) {
$( '.w-form.for_cform' ).each( function() {
var $container = $( this ),
$form = $container.find( 'form:first' ),
$submitBtn = $form.find( '.w-btn' ),
$resultField = $form.find( '.w-form-message' ),
options = $container.find( '.w-form-json' )[ 0 ].onclick(),
$requiredCheckboxes = $form.find( '.for_checkboxes.required' );
$container.find( '.w-form-json' ).remove();
$form.submit( function( event ) {
event.preventDefault();
// Prevent double-sending
if ( $submitBtn.hasClass( 'loading' ) ) {
return;
}
$resultField.usMod( 'type', false ).html( '' );
// Validation
var errors = 0;
$form.find( '[data-required="true"]' ).each( function() {
var $input = $( this ),
isEmpty = $input.is( '[type="checkbox"]' ) ? ( ! $input.is( ':checked' ) ) : ( $input.val() == '' ),
$row = $input.closest( '.w-form-row' );
// Skip checkboxes
if ( $row.hasClass( 'for_checkboxes' ) ) {
return true;
}
$row.toggleClass( 'check_wrong', isEmpty );
if ( isEmpty ) {
errors ++;
}
} );
// Count required checkboxes separately
if ( $requiredCheckboxes.length ) {
$requiredCheckboxes.each( function() {
var $input = $( this ).find( 'input[type="checkbox"]' ),
$row = $input.closest( '.w-form-row' ),
isEmpty = ! $input.is( ':checked' ) ? true : false;
$row.toggleClass( 'check_wrong', isEmpty );
if ( isEmpty ) {
errors ++;
}
} );
}
if ( errors != 0 ) {
return;
}
$submitBtn.addClass( 'loading' );
$.ajax( {
type: 'POST',
url: options.ajaxurl,
dataType: 'json',
data: $form.serialize(),
success: function( result ) {
if ( result.success ) {
$resultField.usMod( 'type', 'success' ).html( result.data );
$form.find( '.w-form-row.check_wrong' ).removeClass( 'check_wrong' );
$form.find( '.w-form-row.not-empty' ).removeClass( 'not-empty' );
$form.find( 'input[type="text"], input[type="email"], textarea' ).val( '' );
$form[ 0 ].reset();
} else {
$form.find( '.w-form-row.check_wrong' ).removeClass( 'check_wrong' );
if ( result.data && typeof result.data == 'object' ) {
for ( var fieldName in result.data ) {
if ( fieldName == 'empty_message' ) {
$resultField.usMod( 'type', 'error' );
continue;
}
if ( ! result.data.hasOwnProperty( fieldName ) ) {
continue;
}
fieldName = result.data[ fieldName ].name;
var $input = $form.find( '[name="' + fieldName + '"]' );
$input.closest( '.w-form-row' ).addClass( 'check_wrong' )
}
} else {
$resultField.usMod( 'type', 'error' ).html( result.data );
}
}
},
complete: function() {
$submitBtn.removeClass( 'loading' );
}
} );
} );
} );
} );
/**
* UpSolution Login Widget: widget_us_login
*
*/
! function( $ ) {
"use strict";
$us.WLogin = function( container, options ) {
this.init( container, options );
};
$us.WLogin.prototype = {
init: function( container, options ) {
this.$container = $( container );
// Prevent double init
if ( this.$container.data( 'loginInit' ) == 1 ) {
return;
}
this.$container.data( 'loginInit', 1 );
this.$form = this.$container.find( '.w-form' );
this.$profile = this.$container.find( '.w-profile' );
this.$preloader = this.$container.find( 'div.g-preloader' );
this.$submitBtn = this.$form.find( '.w-btn' );
this.$username = this.$form.find( '.for_text input[type="text"]' );
this.$password = this.$form.find( '.for_password input[type="password"]' );
this.$nonceVal = this.$form.find( '#us_login_nonce' ).val();
this.$resultField = this.$form.find( '.w-form-message' );
this.$jsonContainer = this.$container.find( '.w-profile-json' );
this.jsonData = this.$jsonContainer[ 0 ].onclick() || {};
this.$jsonContainer.remove();
this.ajaxUrl = this.jsonData.ajax_url || '';
this.logoutRedirect = this.jsonData.logout_redirect || '/';
this.loginRedirect = this.jsonData.login_redirect || '';
this._events = {
formSubmit: this.formSubmit.bind( this )
};
this.$form.on( 'submit', this._events.formSubmit );
$.ajax( {
type: 'post',
url: this.ajaxUrl,
data: {
action: 'us_ajax_user_info',
logout_redirect: this.logoutRedirect
},
success: function( result ) {
if ( result.success ) {
var $avatar = this.$profile.find( '.w-profile-avatar' ),
$name = this.$profile.find( '.w-profile-name' ),
$logoutLink = this.$profile.find( '.w-profile-link.for_logout' );
$avatar.html( result.data.avatar );
$name.html( result.data.name );
$logoutLink.attr( 'href', result.data.logout_url );
this.$profile.removeClass( 'hidden' );
} else {
this.$form.removeClass( 'hidden' );
}
this.$preloader.addClass( 'hidden' );
}.bind( this )
} );
},
formSubmit: function( event ) {
event.preventDefault();
// Prevent double-sending
if ( this.$submitBtn.hasClass( 'loading' ) ) {
return;
}
// Clear errors
this.$resultField.usMod( 'type', false ).html( '' );
this.$form.find( '.w-form-row.check_wrong' ).removeClass( 'check_wrong' );
this.$form.find( '.w-form-state' ).html( '' );
// Prevent sending data with empty username
if ( this.$form.find( '.for_text input[type="text"]' ).val() == '' ) {
this.$username.closest( '.w-form-row' ).toggleClass( 'check_wrong' );
return;
}
this.$submitBtn.addClass( 'loading' );
$.ajax( {
type: 'post',
url: this.ajaxUrl,
dataType: 'json',
data: {
action: 'us_ajax_login',
username: this.$username.val(),
password: this.$password.val(),
us_login_nonce: this.$nonceVal
},
success: function( result ) {
if ( result.success ) {
document.location.href = this.loginRedirect;
} else {
if ( result.data.code == 'invalid_username' ) {
var $rowLog = this.$username.closest( '.w-form-row' );
$rowLog.toggleClass( 'check_wrong' );
$rowLog.find( '.w-form-row-state' ).html( result.data.message ? result.data.message : '' );
} else if ( result.data.code == 'incorrect_password' || result.data.code == 'empty_password' ) {
var $rowPwd = this.$password.closest( '.w-form-row' );
$rowPwd.toggleClass( 'check_wrong' );
$rowPwd.find( '.w-form-row-state' ).html( result.data.message ? result.data.message : '' );
} else {
this.$resultField.usMod( 'type', 'error' ).html( result.data.message );
}
}
this.$submitBtn.removeClass( 'loading' );
}.bind( this ),
} );
}
};
$.fn.wUsLogin = function( options ) {
return this.each( function() {
$( this ).data( 'wUsLogin', new $us.WLogin( this, options ) );
} );
};
$( function() {
$( '.widget_us_login' ).wUsLogin();
} );
}( jQuery );
/**
* Form customs
*/
jQuery( function( $ ) {
// Add not-empty class when filling form fields
$( 'input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="search"], input[type="url"], input[type="password"], textarea' ).each( function( index, input ) {
var $input = $( input ),
$row = $input.closest( '.w-form-row' );
if ( $input.attr( 'type' ) == 'hidden' ) {
return;
}
$row.toggleClass( 'not-empty', $input.val() != '' );
$input.on( 'input', function() {
$row.toggleClass( 'not-empty', $input.val() != '' );
} );
} );
// Add focused class for all form fields
$( document ).on( 'focus', '.w-form-row-field input, .w-form-row-field textarea', function() {
$( this ).closest( '.w-form-row' ).addClass( 'focused' );
} );
$( document ).on( 'blur', '.w-form-row-field input, .w-form-row-field textarea', function() {
$( this ).closest( '.w-form-row' ).removeClass( 'focused' );
} );
} );
+13
View File
@@ -0,0 +1,13 @@
jQuery(function($){$('.w-form.for_cform').each(function(){var $container=$(this),$form=$container.find('form:first'),$submitBtn=$form.find('.w-btn'),$resultField=$form.find('.w-form-message'),options=$container.find('.w-form-json')[0].onclick(),$requiredCheckboxes=$form.find('.for_checkboxes.required');$container.find('.w-form-json').remove();$form.submit(function(event){event.preventDefault();if($submitBtn.hasClass('loading')){return}
$resultField.usMod('type',!1).html('');var errors=0;$form.find('[data-required="true"]').each(function(){var $input=$(this),isEmpty=$input.is('[type="checkbox"]')?(!$input.is(':checked')):($input.val()==''),$row=$input.closest('.w-form-row');if($row.hasClass('for_checkboxes')){return!0}
$row.toggleClass('check_wrong',isEmpty);if(isEmpty){errors ++}});if($requiredCheckboxes.length){$requiredCheckboxes.each(function(){var $input=$(this).find('input[type="checkbox"]'),$row=$input.closest('.w-form-row'),isEmpty=!$input.is(':checked')?!0:!1;$row.toggleClass('check_wrong',isEmpty);if(isEmpty){errors ++}})}
if(errors!=0){return}
$submitBtn.addClass('loading');$.ajax({type:'POST',url:options.ajaxurl,dataType:'json',data:$form.serialize(),success:function(result){if(result.success){$resultField.usMod('type','success').html(result.data);$form.find('.w-form-row.check_wrong').removeClass('check_wrong');$form.find('.w-form-row.not-empty').removeClass('not-empty');$form.find('input[type="text"], input[type="email"], textarea').val('');$form[0].reset()}else{$form.find('.w-form-row.check_wrong').removeClass('check_wrong');if(result.data&&typeof result.data=='object'){for(var fieldName in result.data){if(fieldName=='empty_message'){$resultField.usMod('type','error');continue}
if(!result.data.hasOwnProperty(fieldName)){continue}
fieldName=result.data[fieldName].name;var $input=$form.find('[name="'+fieldName+'"]');$input.closest('.w-form-row').addClass('check_wrong')}}else{$resultField.usMod('type','error').html(result.data)}}},complete:function(){$submitBtn.removeClass('loading')}})})})});!function($){"use strict";$us.WLogin=function(container,options){this.init(container,options)};$us.WLogin.prototype={init:function(container,options){this.$container=$(container);if(this.$container.data('loginInit')==1){return}
this.$container.data('loginInit',1);this.$form=this.$container.find('.w-form');this.$profile=this.$container.find('.w-profile');this.$preloader=this.$container.find('div.g-preloader');this.$submitBtn=this.$form.find('.w-btn');this.$username=this.$form.find('.for_text input[type="text"]');this.$password=this.$form.find('.for_password input[type="password"]');this.$nonceVal=this.$form.find('#us_login_nonce').val();this.$resultField=this.$form.find('.w-form-message');this.$jsonContainer=this.$container.find('.w-profile-json');this.jsonData=this.$jsonContainer[0].onclick()||{};this.$jsonContainer.remove();this.ajaxUrl=this.jsonData.ajax_url||'';this.logoutRedirect=this.jsonData.logout_redirect||'/';this.loginRedirect=this.jsonData.login_redirect||'';this._events={formSubmit:this.formSubmit.bind(this)};this.$form.on('submit',this._events.formSubmit);$.ajax({type:'post',url:this.ajaxUrl,data:{action:'us_ajax_user_info',logout_redirect:this.logoutRedirect},success:function(result){if(result.success){var $avatar=this.$profile.find('.w-profile-avatar'),$name=this.$profile.find('.w-profile-name'),$logoutLink=this.$profile.find('.w-profile-link.for_logout');$avatar.html(result.data.avatar);$name.html(result.data.name);$logoutLink.attr('href',result.data.logout_url);this.$profile.removeClass('hidden')}else{this.$form.removeClass('hidden')}
this.$preloader.addClass('hidden')}.bind(this)})},formSubmit:function(event){event.preventDefault();if(this.$submitBtn.hasClass('loading')){return}
this.$resultField.usMod('type',!1).html('');this.$form.find('.w-form-row.check_wrong').removeClass('check_wrong');this.$form.find('.w-form-state').html('');if(this.$form.find('.for_text input[type="text"]').val()==''){this.$username.closest('.w-form-row').toggleClass('check_wrong');return}
this.$submitBtn.addClass('loading');$.ajax({type:'post',url:this.ajaxUrl,dataType:'json',data:{action:'us_ajax_login',username:this.$username.val(),password:this.$password.val(),us_login_nonce:this.$nonceVal},success:function(result){if(result.success){document.location.href=this.loginRedirect}else{if(result.data.code=='invalid_username'){var $rowLog=this.$username.closest('.w-form-row');$rowLog.toggleClass('check_wrong');$rowLog.find('.w-form-row-state').html(result.data.message?result.data.message:'')}else if(result.data.code=='incorrect_password'||result.data.code=='empty_password'){var $rowPwd=this.$password.closest('.w-form-row');$rowPwd.toggleClass('check_wrong');$rowPwd.find('.w-form-row-state').html(result.data.message?result.data.message:'')}else{this.$resultField.usMod('type','error').html(result.data.message)}}
this.$submitBtn.removeClass('loading')}.bind(this),})}};$.fn.wUsLogin=function(options){return this.each(function(){$(this).data('wUsLogin',new $us.WLogin(this,options))})};$(function(){$('.widget_us_login').wUsLogin()})}(jQuery);jQuery(function($){$('input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="search"], input[type="url"], input[type="password"], textarea').each(function(index,input){var $input=$(input),$row=$input.closest('.w-form-row');if($input.attr('type')=='hidden'){return}
$row.toggleClass('not-empty',$input.val()!='');$input.on('input',function(){$row.toggleClass('not-empty',$input.val()!='')})});$(document).on('focus','.w-form-row-field input, .w-form-row-field textarea',function(){$(this).closest('.w-form-row').addClass('focused')});$(document).on('blur','.w-form-row-field input, .w-form-row-field textarea',function(){$(this).closest('.w-form-row').removeClass('focused')})})
@@ -0,0 +1,550 @@
/*!
* imagesLoaded PACKAGED v4.1.4
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
!function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){if(Array.isArray(e))return e;var t="object"==typeof e&&"number"==typeof e.length;return t?d.call(e):[e]}function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var s=e;return"string"==typeof e&&(s=document.querySelectorAll(e)),s?(this.elements=n(s),this.options=i({},this.options),"function"==typeof t?r=t:i(this.options,t),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(this.check.bind(this))):void a.error("Bad element for imagesLoaded "+(s||e))}function r(e){this.img=e}function s(e,t){this.url=e,this.element=t,this.img=new Image}var h=e.jQuery,a=e.console,d=Array.prototype.slice;o.prototype=Object.create(t.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=e.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var u={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},o.prototype.addImage=function(e){var t=new r(e);this.images.push(t)},o.prototype.addBackground=function(e,t){var i=new s(e,t);this.images.push(i)},o.prototype.check=function(){function e(e,i,n){setTimeout(function(){t.progress(e,i,n)})}var t=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(t){t.once("progress",e),t.check()}):void this.complete()},o.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,e,t)},o.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},r.prototype=Object.create(t.prototype),r.prototype.check=function(){var e=this.getIsImageComplete();return e?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},r.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},r.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var e=this.getIsImageCompleteLine truncated
/**
* UpSolution Theme Core JavaScript Code
*
* @requires jQuery
*/
if ( window.$us === undefined ) {
window.$us = {};
}
/**
* Retrieve/set/erase dom modificator class <mod>_<value> for UpSolution CSS Framework
* @param {String} mod Modificator namespace
* @param {String} [value] Value
* @returns {string|jQuery}
*/
jQuery.fn.usMod = function( mod, value ) {
if ( this.length == 0 ) {
return this;
}
// Remove class modificator
if ( value === false ) {
this.get( 0 ).className = this.get( 0 ).className.replace( new RegExp( '(^| )' + mod + '\_[a-zA-Z0-9\_\-]+( |$)' ), '$2' );
return this;
}
var pcre = new RegExp( '^.*?' + mod + '\_([a-zA-Z0-9\_\-]+).*?$' ),
arr;
// Retrieve modificator
if ( value === undefined ) {
return ( arr = pcre.exec( this.get( 0 ).className ) ) ? arr[ 1 ] : false;
}
// Set modificator
else {
this.usMod( mod, false ).get( 0 ).className += ' ' + mod + '_' + value;
return this;
}
};
/**
* Convert data from PHP to boolean the right way
* @param {mixed} value
* @returns {Boolean}
*/
$us.toBool = function( value ) {
if ( typeof value == 'string' ) {
return ( value == 'true' || value == 'True' || value == 'TRUE' || value == '1' );
}
if ( typeof value == 'boolean' ) {
return value;
}
return ! ! parseInt( value );
};
$us.getScript = function( url, callback ) {
if ( ! $us.ajaxLoadJs ) {
callback();
return false;
}
if ( $us.loadedScripts === undefined ) {
$us.loadedScripts = {};
$us.loadedScriptsFunct = {};
}
if ( $us.loadedScripts[ url ] === 'loaded' ) {
callback();
return;
} else if ( $us.loadedScripts[ url ] === 'loading' ) {
$us.loadedScriptsFunct[ url ].push( callback );
return;
}
$us.loadedScripts[ url ] = 'loading';
$us.loadedScriptsFunct[ url ] = [];
$us.loadedScriptsFunct[ url ].push( callback )
var complete = function() {
for ( var i = 0; i < $us.loadedScriptsFunct[ url ].length; i ++ ) {
$us.loadedScriptsFunct[ url ][ i ]();
}
$us.loadedScripts[ url ] = 'loaded';
};
var options = {
dataType: "script",
cache: true,
url: url,
complete: complete
};
return jQuery.ajax( options );
};
// Detecting IE browser
$us.detectIE = function() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf( 'MSIE ' );
if ( msie > 0 ) {
// IE 10 or older => return version number
return parseInt( ua.substring( msie + 5, ua.indexOf( '.', msie ) ), 10 );
}
var trident = ua.indexOf( 'Trident/' );
if ( trident > 0 ) {
// IE 11 => return version number
var rv = ua.indexOf( 'rv:' );
return parseInt( ua.substring( rv + 3, ua.indexOf( '.', rv ) ), 10 );
}
var edge = ua.indexOf( 'Edge/' );
if ( edge > 0 ) {
// Edge (IE 12+) => return version number
return parseInt( ua.substring( edge + 5, ua.indexOf( '.', edge ) ), 10 );
}
// other browser
return false;
};
// Fixing hovers for devices with both mouse and touch screen
jQuery.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( navigator.userAgent );
jQuery( 'html' ).toggleClass( 'no-touch', ! jQuery.isMobile );
jQuery( 'html' ).toggleClass( 'ie11', $us.detectIE() == 11 );
/**
* Commonly used jQuery objects
*/
! function( $ ) {
$us.$window = $( window );
$us.$document = $( document );
$us.$html = $( 'html' );
$us.$body = $( '.l-body:first' );
$us.$htmlBody = $us.$html.add( $us.$body );
$us.$canvas = $( '.l-canvas:first' );
}( jQuery );
// Extending Lazy Load
if ( jQuery.lazyLoadXT !== undefined && jQuery.lazyLoadXT.updateEvent !== undefined ) {
jQuery.lazyLoadXT.updateEvent = jQuery.lazyLoadXT.updateEvent + ' click uslazyloadevent';
}
/**
* $us.canvas
*
* All the needed data and functions to work with overall canvas.
*/
! function( $ ) {
"use strict";
function USCanvas( options ) {
// Setting options
var defaults = {
disableEffectsWidth: 900,
responsive: true,
backToTopDisplay: 100
};
this.options = $.extend( {}, defaults, options || {} );
// Commonly used dom elements
this.$header = $us.$canvas.find( '.l-header' );
this.$main = $us.$canvas.find( '.l-main' );
this.$sections = $us.$canvas.find( '.l-section' );
this.$firstSection = this.$sections.first();
this.$secondSection = this.$sections.eq( 1 );
this.$fullscreenSections = this.$sections.filter( '.height_full' );
this.$topLink = $( '.w-toplink' );
// Canvas modificators
this.type = $us.$canvas.usMod( 'type' );
// Initial header position
this._headerPos = this.$header.usMod( 'pos' );
// Current header position
this.headerPos = this._headerPos;
this.headerInitialPos = $us.$body.usMod( 'headerinpos' );
this.headerBg = this.$header.usMod( 'bg' );
this.rtl = $us.$body.hasClass( 'rtl' );
// Will be used to count fullscreen sections heights and proper scroll positions
this.scrolledOccupiedHeight = 0;
// Used to prevent resize events on scroll for Android browsers
this.isScrolling = false;
this.scrollTimeout = false;
this.isAndroid = /Android/i.test( navigator.userAgent );
// If in iframe...
if ( $us.$body.hasClass( 'us_iframe' ) ) {
// change links so they lead to main window
$( 'a:not([target])' ).each( function() {
$( this ).attr( 'target', '_parent' )
} );
// hide preloader
jQuery( function( $ ) {
var $framePreloader = $( '.l-popup-box-content .g-preloader', window.parent.document );
$framePreloader.hide();
} );
}
// Boundable events
this._events = {
scroll: this.scroll.bind( this ),
resize: this.resize.bind( this )
};
$us.$window.on( 'scroll', this._events.scroll );
$us.$window.on( 'resize load', this._events.resize );
// Complex logics requires two initial renders: before inner elements render and after
setTimeout( this._events.resize, 25 );
setTimeout( this._events.resize, 75 );
}
USCanvas.prototype = {
/**
* Scroll-driven logics
*/
scroll: function() {
var scrollTop = parseInt( $us.$window.scrollTop() );
// Show/hide go to top link
this.$topLink.toggleClass( 'active', ( scrollTop >= this.winHeight * this.options.backToTopDisplay / 100 ) );
if ( this.isAndroid ) {
this.isScrolling = true;
if ( this.scrollTimeout ) {
clearTimeout( this.scrollTimeout );
}
this.scrollTimeout = setTimeout( function() {
this.isScrolling = false;
}.bind( this ), 100 );
}
},
/**
* Resize-driven logics
*/
resize: function() {
// Window dimensions
this.winHeight = parseInt( $us.$window.height() );
this.winWidth = parseInt( $us.$window.width() );
// Disabling animation on mobile devices
$us.$body.toggleClass( 'disable_effects', ( this.winWidth < this.options.disableEffectsWidth ) );
// Vertical centering of fullscreen sections in IE 11
var ieVersion = $us.detectIE();
if ( ( ieVersion !== false && ieVersion == 11 ) && ( this.$fullscreenSections.length > 0 && ! this.isScrolling ) ) {
var adminBar = $( '#wpadminbar' ),
adminBarHeight = ( adminBar.length ) ? adminBar.height() : 0;
this.$fullscreenSections.each( function( index, section ) {
var $section = $( section ),
sectionHeight = this.winHeight,
isFirstSection = ( index == 0 && $section.is( this.$firstSection ) );
// First section
if ( isFirstSection ) {
sectionHeight -= $section.offset().top;
}
// 2+ sections
else {
sectionHeight -= $us.header.scrolledOccupiedHeight + adminBarHeight;
}
if ( $section.hasClass( 'valign_center' ) ) {
var $sectionH = $section.find( '.l-section-h' ),
sectionTopPadding = parseInt( $section.css( 'padding-top' ) ),
contentHeight = $sectionH.outerHeight(),
topMargin;
$sectionH.css( 'margin-top', '' );
// Section was extended by extra top padding that is overlapped by fixed solid header and not
// visible
var sectionOverlapped = isFirstSection && $us.header.pos == 'fixed' && $us.header.bg != 'transparent' && $us.header.orientation != 'ver';
if ( sectionOverlapped ) {
// Part of first section is overlapped by header
topMargin = Math.max( 0, ( sectionHeight - sectionTopPadding - contentHeight ) / 2 );
} else {
topMargin = Math.max( 0, ( sectionHeight - contentHeight ) / 2 - sectionTopPadding );
}
$sectionH.css( 'margin-top', topMargin || '' );
}
}.bind( this ) );
$us.$canvas.trigger( 'contentChange' );
}
// If the page is loaded in iframe
if ( $us.$body.hasClass( 'us_iframe' ) ) {
var $frameContent = $( '.l-popup-box-content', window.parent.document ),
outerHeight = $us.$body.outerHeight( true );
if ( outerHeight > 0 && $( window.parent ).height() > outerHeight ) {
$frameContent.css( 'height', outerHeight );
} else {
$frameContent.css( 'height', '' );
}
}
// Fix scroll glitches that could occur after the resize
this.scroll();
}
};
$us.canvas = new USCanvas( $us.canvasOptions || {} );
}( jQuery );
/**
* CSS-analog of jQuery slideDown/slideUp/fadeIn/fadeOut functions (for better rendering)
*/
! function() {
/**
* Remove the passed inline CSS attributes.
*
* Usage: $elm.resetInlineCSS('height', 'width');
*/
jQuery.fn.resetInlineCSS = function() {
for ( var index = 0; index < arguments.length; index ++ ) {
this.css( arguments[ index ], '' );
}
return this;
};
jQuery.fn.clearPreviousTransitions = function() {
// Stopping previous events, if there were any
var prevTimers = ( this.data( 'animation-timers' ) || '' ).split( ',' );
if ( prevTimers.length >= 2 ) {
this.resetInlineCSS( 'transition' );
prevTimers.map( clearTimeout );
this.removeData( 'animation-timers' );
}
return this;
};
/**
*
* @param {Object} css key-value pairs of animated css
* @param {Number} duration in milliseconds
* @param {Function} onFinish
* @param {String} easing CSS easing name
* @param {Number} delay in milliseconds
*/
jQuery.fn.performCSSTransition = function( css, duration, onFinish, easing, delay ) {
duration = duration || 250;
delay = delay || 25;
easing = easing || 'ease';
var $this = this,
transition = [];
this.clearPreviousTransitions();
for ( var attr in css ) {
if ( ! css.hasOwnProperty( attr ) ) {
continue;
}
transition.push( attr + ' ' + ( duration / 1000 ) + 's ' + easing );
}
transition = transition.join( ', ' );
$this.css( {
transition: transition
} );
// Starting the transition with a slight delay for the proper application of CSS transition properties
var timer1 = setTimeout( function() {
$this.css( css );
}, delay );
var timer2 = setTimeout( function() {
$this.resetInlineCSS( 'transition' );
if ( typeof onFinish == 'function' ) {
onFinish();
}
}, duration + delay );
this.data( 'animation-timers', timer1 + ',' + timer2 );
};
// Height animations
jQuery.fn.slideDownCSS = function( duration, onFinish, easing, delay ) {
if ( this.length == 0 ) {
return;
}
var $this = this;
this.clearPreviousTransitions();
// Grabbing paddings
this.resetInlineCSS( 'padding-top', 'padding-bottom' );
var timer1 = setTimeout( function() {
var paddingTop = parseInt( $this.css( 'padding-top' ) ),
paddingBottom = parseInt( $this.css( 'padding-bottom' ) );
// Grabbing the "auto" height in px
$this.css( {
visibility: 'hidden',
position: 'absolute',
height: 'auto',
'padding-top': 0,
'padding-bottom': 0,
display: 'block'
} );
var height = $this.height();
$this.css( {
overflow: 'hidden',
height: '0px',
opacity: 0,
visibility: '',
position: ''
} );
$this.performCSSTransition( {
opacity: 1,
height: height + paddingTop + paddingBottom,
'padding-top': paddingTop,
'padding-bottom': paddingBottom
}, duration, function() {
$this.resetInlineCSS( 'overflow' ).css( 'height', 'auto' );
if ( typeof onFinish == 'function' ) {
onFinish();
}
}, easing, delay );
}, 25 );
this.data( 'animation-timers', timer1 + ',null' );
};
jQuery.fn.slideUpCSS = function( duration, onFinish, easing, delay ) {
if ( this.length == 0 ) {
return;
}
this.clearPreviousTransitions();
this.css( {
height: this.outerHeight(),
overflow: 'hidden',
'padding-top': this.css( 'padding-top' ),
'padding-bottom': this.css( 'padding-bottom' )
} );
var $this = this;
this.performCSSTransition( {
height: 0,
opacity: 0,
'padding-top': 0,
'padding-bottom': 0
}, duration, function() {
$this.resetInlineCSS( 'overflow', 'padding-top', 'padding-bottom' ).css( {
display: 'none'
} );
if ( typeof onFinish == 'function' ) {
onFinish();
}
}, easing, delay );
};
// Opacity animations
jQuery.fn.fadeInCSS = function( duration, onFinish, easing, delay ) {
if ( this.length == 0 ) {
return;
}
this.clearPreviousTransitions();
this.css( {
opacity: 0,
display: 'block'
} );
this.performCSSTransition( {
opacity: 1
}, duration, onFinish, easing, delay );
};
jQuery.fn.fadeOutCSS = function( duration, onFinish, easing, delay ) {
if ( this.length == 0 ) {
return;
}
var $this = this;
this.performCSSTransition( {
opacity: 0
}, duration, function() {
$this.css( 'display', 'none' );
if ( typeof onFinish == 'function' ) {
onFinish();
}
}, easing, delay );
};
}();
jQuery( function( $ ) {
"use strict";
// Force popup opening on links with ref
if ( $( 'a[ref=magnificPopup][class!=direct-link]' ).length != 0 ) {
$us.getScript( $us.templateDirectoryUri + '/framework/js/vendor/magnific-popup.js', function() {
$( 'a[ref=magnificPopup][class!=direct-link]' ).magnificPopup( {
type: 'image',
removalDelay: 300,
mainClass: 'mfp-fade',
fixedContentPos: true
} );
} );
}
// Hide background images until are loaded
jQuery( '.l-section-img' ).each( function() {
var $this = $( this ),
img = new Image(),
bgImg = $this.css( 'background-image' ) || '';
// If the background image CSS seems to be valid, preload an image and then show it
if ( bgImg.match( /url\(['"]*(.*?)['"]*\)/i ) ) {
img.onload = function() {
if ( ! $this.hasClass( 'loaded' ) ) {
$this.addClass( 'loaded' );
}
};
img.src = bgImg.replace( /url\(['"]*(.*?)['"]*\)/i, '$1' );
// If we cannot parse the background image CSS, just add loaded class to the background tag so a background
// image is shown anyways
} else {
$this.addClass( 'loaded' );
}
} );
/* YouTube/Vimeo background */
$( window ).on( 'resize load', function() {
var $container = $( '.with_youtube, .with_vimeo' );
if ( ! $container.length ) {
return;
}
$container.each( function() {
this.$container = $( this );
var $frame = this.$container.find( 'iframe' ),
cHeight = this.$container.innerHeight(),
cWidth = this.$container.innerWidth(),
fWidth = '',
fHeight = '';
if ( cWidth / cHeight < 16 / 9 ) {
fWidth = cHeight * ( 16 / 9 );
fHeight = cHeight;
} else {
fWidth = cWidth;
fHeight = fWidth * ( 9 / 16 );
}
$frame.css( {
'width': Math.round( fWidth ),
'height': Math.round( fHeight ),
} );
} );
} );
} );
+35
View File
@@ -0,0 +1,35 @@
!function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){if(Array.isArray(e))return e;var t="object"==typeof e&&"number"==typeof e.length;return t?d.call(e):[e]}function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var s=e;return"string"==typeof e&&(s=document.querySelectorAll(e)),s?(this.elements=n(s),this.options=i({},this.options),"function"==typeof t?r=t:i(this.options,t),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(this.check.bind(this))):void a.error("Bad element for imagesLoaded "+(s||e))}function r(e){this.img=e}function s(e,t){this.url=e,this.element=t,this.img=new Image}var h=e.jQuery,a=e.console,d=Array.prototype.slice;o.prototype=Object.create(t.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=e.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var u={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},o.prototype.addImage=function(e){var t=new r(e);this.images.push(t)},o.prototype.addBackground=function(e,t){var i=new s(e,t);this.images.push(i)},o.prototype.check=function(){function e(e,i,n){setTimeout(function(){t.progress(e,i,n)})}var t=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(t){t.once("progress",e),t.check()}):void this.complete()},o.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,e,t)},o.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},r.prototype=Object.create(t.prototype),r.prototype.check=function(){var e=this.getIsImageComplete();return e?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},r.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},r.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var e=this.getIsImageCompleteLine truncated
jQuery.fn.usMod=function(mod,value){if(this.length==0){return this}
if(value===!1){this.get(0).className=this.get(0).className.replace(new RegExp('(^| )'+mod+'\_[a-zA-Z0-9\_\-]+( |$)'),'$2');return this}
var pcre=new RegExp('^.*?'+mod+'\_([a-zA-Z0-9\_\-]+).*?$'),arr;if(value===undefined){return(arr=pcre.exec(this.get(0).className))?arr[1]:!1}
else{this.usMod(mod,!1).get(0).className+=' '+mod+'_'+value;return this}};$us.toBool=function(value){if(typeof value=='string'){return(value=='true'||value=='True'||value=='TRUE'||value=='1')}
if(typeof value=='boolean'){return value}
return!!parseInt(value)};$us.getScript=function(url,callback){if(!$us.ajaxLoadJs){callback();return!1}
if($us.loadedScripts===undefined){$us.loadedScripts={};$us.loadedScriptsFunct={}}
if($us.loadedScripts[url]==='loaded'){callback();return}else if($us.loadedScripts[url]==='loading'){$us.loadedScriptsFunct[url].push(callback);return}
$us.loadedScripts[url]='loading';$us.loadedScriptsFunct[url]=[];$us.loadedScriptsFunct[url].push(callback)
var complete=function(){for(var i=0;i<$us.loadedScriptsFunct[url].length;i ++){$us.loadedScriptsFunct[url][i]()}
$us.loadedScripts[url]='loaded'};var options={dataType:"script",cache:!0,url:url,complete:complete};return jQuery.ajax(options)};$us.detectIE=function(){var ua=window.navigator.userAgent;var msie=ua.indexOf('MSIE ');if(msie>0){return parseInt(ua.substring(msie+5,ua.indexOf('.',msie)),10)}
var trident=ua.indexOf('Trident/');if(trident>0){var rv=ua.indexOf('rv:');return parseInt(ua.substring(rv+3,ua.indexOf('.',rv)),10)}
var edge=ua.indexOf('Edge/');if(edge>0){return parseInt(ua.substring(edge+5,ua.indexOf('.',edge)),10)}
return!1};jQuery.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);jQuery('html').toggleClass('no-touch',!jQuery.isMobile);jQuery('html').toggleClass('ie11',$us.detectIE()==11);!function($){$us.$window=$(window);$us.$document=$(document);$us.$html=$('html');$us.$body=$('.l-body:first');$us.$htmlBody=$us.$html.add($us.$body);$us.$canvas=$('.l-canvas:first')}(jQuery);if(jQuery.lazyLoadXT!==undefined&&jQuery.lazyLoadXT.updateEvent!==undefined){jQuery.lazyLoadXT.updateEvent=jQuery.lazyLoadXT.updateEvent+' click uslazyloadevent'}
!function($){"use strict";function USCanvas(options){var defaults={disableEffectsWidth:900,responsive:!0,backToTopDisplay:100};this.options=$.extend({},defaults,options||{});this.$header=$us.$canvas.find('.l-header');this.$main=$us.$canvas.find('.l-main');this.$sections=$us.$canvas.find('.l-section');this.$firstSection=this.$sections.first();this.$secondSection=this.$sections.eq(1);this.$fullscreenSections=this.$sections.filter('.height_full');this.$topLink=$('.w-toplink');this.type=$us.$canvas.usMod('type');this._headerPos=this.$header.usMod('pos');this.headerPos=this._headerPos;this.headerInitialPos=$us.$body.usMod('headerinpos');this.headerBg=this.$header.usMod('bg');this.rtl=$us.$body.hasClass('rtl');this.scrolledOccupiedHeight=0;this.isScrolling=!1;this.scrollTimeout=!1;this.isAndroid=/Android/i.test(navigator.userAgent);if($us.$body.hasClass('us_iframe')){$('a:not([target])').each(function(){$(this).attr('target','_parent')});jQuery(function($){var $framePreloader=$('.l-popup-box-content .g-preloader',window.parent.document);$framePreloader.hide()})}
this._events={scroll:this.scroll.bind(this),resize:this.resize.bind(this)};$us.$window.on('scroll',this._events.scroll);$us.$window.on('resize load',this._events.resize);setTimeout(this._events.resize,25);setTimeout(this._events.resize,75)}
USCanvas.prototype={scroll:function(){var scrollTop=parseInt($us.$window.scrollTop());this.$topLink.toggleClass('active',(scrollTop>=this.winHeight*this.options.backToTopDisplay/100));if(this.isAndroid){this.isScrolling=!0;if(this.scrollTimeout){clearTimeout(this.scrollTimeout)}
this.scrollTimeout=setTimeout(function(){this.isScrolling=!1}.bind(this),100)}},resize:function(){this.winHeight=parseInt($us.$window.height());this.winWidth=parseInt($us.$window.width());$us.$body.toggleClass('disable_effects',(this.winWidth<this.options.disableEffectsWidth));var ieVersion=$us.detectIE();if((ieVersion!==!1&&ieVersion==11)&&(this.$fullscreenSections.length>0&&!this.isScrolling)){var adminBar=$('#wpadminbar'),adminBarHeight=(adminBar.length)?adminBar.height():0;this.$fullscreenSections.each(function(index,section){var $section=$(section),sectionHeight=this.winHeight,isFirstSection=(index==0&&$section.is(this.$firstSection));if(isFirstSection){sectionHeight-=$section.offset().top}
else{sectionHeight-=$us.header.scrolledOccupiedHeight+adminBarHeight}
if($section.hasClass('valign_center')){var $sectionH=$section.find('.l-section-h'),sectionTopPadding=parseInt($section.css('padding-top')),contentHeight=$sectionH.outerHeight(),topMargin;$sectionH.css('margin-top','');var sectionOverlapped=isFirstSection&&$us.header.pos=='fixed'&&$us.header.bg!='transparent'&&$us.header.orientation!='ver';if(sectionOverlapped){topMargin=Math.max(0,(sectionHeight-sectionTopPadding-contentHeight)/2)}else{topMargin=Math.max(0,(sectionHeight-contentHeight)/2-sectionTopPadding)}
$sectionH.css('margin-top',topMargin||'')}}.bind(this));$us.$canvas.trigger('contentChange')}
if($us.$body.hasClass('us_iframe')){var $frameContent=$('.l-popup-box-content',window.parent.document),outerHeight=$us.$body.outerHeight(!0);if(outerHeight>0&&$(window.parent).height()>outerHeight){$frameContent.css('height',outerHeight)}else{$frameContent.css('height','')}}
this.scroll()}};$us.canvas=new USCanvas($us.canvasOptions||{})}(jQuery);!function(){jQuery.fn.resetInlineCSS=function(){for(var index=0;index<arguments.length;index ++){this.css(arguments[index],'')}
return this};jQuery.fn.clearPreviousTransitions=function(){var prevTimers=(this.data('animation-timers')||'').split(',');if(prevTimers.length>=2){this.resetInlineCSS('transition');prevTimers.map(clearTimeout);this.removeData('animation-timers')}
return this};jQuery.fn.performCSSTransition=function(css,duration,onFinish,easing,delay){duration=duration||250;delay=delay||25;easing=easing||'ease';var $this=this,transition=[];this.clearPreviousTransitions();for(var attr in css){if(!css.hasOwnProperty(attr)){continue}
transition.push(attr+' '+(duration/1000)+'s '+easing)}
transition=transition.join(', ');$this.css({transition:transition});var timer1=setTimeout(function(){$this.css(css)},delay);var timer2=setTimeout(function(){$this.resetInlineCSS('transition');if(typeof onFinish=='function'){onFinish()}},duration+delay);this.data('animation-timers',timer1+','+timer2)};jQuery.fn.slideDownCSS=function(duration,onFinish,easing,delay){if(this.length==0){return}
var $this=this;this.clearPreviousTransitions();this.resetInlineCSS('padding-top','padding-bottom');var timer1=setTimeout(function(){var paddingTop=parseInt($this.css('padding-top')),paddingBottom=parseInt($this.css('padding-bottom'));$this.css({visibility:'hidden',position:'absolute',height:'auto','padding-top':0,'padding-bottom':0,display:'block'});var height=$this.height();$this.css({overflow:'hidden',height:'0px',opacity:0,visibility:'',position:''});$this.performCSSTransition({opacity:1,height:height+paddingTop+paddingBottom,'padding-top':paddingTop,'padding-bottom':paddingBottom},duration,function(){$this.resetInlineCSS('overflow').css('height','auto');if(typeof onFinish=='function'){onFinish()}},easing,delay)},25);this.data('animation-timers',timer1+',null')};jQuery.fn.slideUpCSS=function(duration,onFinish,easing,delay){if(this.length==0){return}
this.clearPreviousTransitions();this.css({height:this.outerHeight(),overflow:'hidden','padding-top':this.css('padding-top'),'padding-bottom':this.css('padding-bottom')});var $this=this;this.performCSSTransition({height:0,opacity:0,'padding-top':0,'padding-bottom':0},duration,function(){$this.resetInlineCSS('overflow','padding-top','padding-bottom').css({display:'none'});if(typeof onFinish=='function'){onFinish()}},easing,delay)};jQuery.fn.fadeInCSS=function(duration,onFinish,easing,delay){if(this.length==0){return}
this.clearPreviousTransitions();this.css({opacity:0,display:'block'});this.performCSSTransition({opacity:1},duration,onFinish,easing,delay)};jQuery.fn.fadeOutCSS=function(duration,onFinish,easing,delay){if(this.length==0){return}
var $this=this;this.performCSSTransition({opacity:0},duration,function(){$this.css('display','none');if(typeof onFinish=='function'){onFinish()}},easing,delay)}}();jQuery(function($){"use strict";if($('a[ref=magnificPopup][class!=direct-link]').length!=0){$us.getScript($us.templateDirectoryUri+'/framework/js/vendor/magnific-popup.js',function(){$('a[ref=magnificPopup][class!=direct-link]').magnificPopup({type:'image',removalDelay:300,mainClass:'mfp-fade',fixedContentPos:!0})})}
jQuery('.l-section-img').each(function(){var $this=$(this),img=new Image(),bgImg=$this.css('background-image')||'';if(bgImg.match(/url\(['"]*(.*?)['"]*\)/i)){img.onload=function(){if(!$this.hasClass('loaded')){$this.addClass('loaded')}};img.src=bgImg.replace(/url\(['"]*(.*?)['"]*\)/i,'$1')}else{$this.addClass('loaded')}});$(window).on('resize load',function(){var $container=$('.with_youtube, .with_vimeo');if(!$container.length){return}
$container.each(function(){this.$container=$(this);var $frame=this.$container.find('iframe'),cHeight=this.$container.innerHeight(),cWidth=this.$container.innerWidth(),fWidth='',fHeight='';if(cWidth/cHeight<16/9){fWidth=cHeight*(16/9);fHeight=cHeight}else{fWidth=cWidth;fHeight=fWidth*(9/16)}
$frame.css({'width':Math.round(fWidth),'height':Math.round(fHeight),})})})})
@@ -0,0 +1,328 @@
/**
* $us.header
* Dev note: should be initialized after $us.canvas
*/
! function( $ ) {
"use strict";
function USHeader( settings ) {
this.settings = settings || {};
this.state = 'default'; // 'tablets' / 'mobiles'
this.$container = $us.$canvas.find( '.l-header' );
// Will be used to count fullscreen sections heights and proper scroll positions
this.scrolledOccupiedHeight = 0;
if ( this.$container.length == 0 ) {
return;
}
this.$topCell = this.$container.find( '.l-subheader.at_top .l-subheader-cell:first' );
this.$middleCell = this.$container.find( '.l-subheader.at_middle .l-subheader-cell:first' );
this.$bottomCell = this.$container.find( '.l-subheader.at_bottom .l-subheader-cell:first' );
this.$showBtn = $( '.w-header-show:first' );
this.orientation = $us.$body.usMod( 'header' );
this.pos = this.$container.usMod( 'pos' ); // 'fixed' / 'static'
this.bg = this.$container.usMod( 'bg' ); // 'solid' / 'transparent'
this.shadow = this.$container.usMod( 'shadow' ); // 'none' / 'thin' / 'wide'
// Will be used to count fullscreen sections heights and proper scroll positions
this.scrolledOccupiedHeight = 0;
// Breakpoints
this.tabletsBreakpoint = parseInt( settings.tablets && settings.tablets.options && settings.tablets.options.breakpoint ) || 900;
this.mobilesBreakpoint = parseInt( settings.mobiles && settings.mobiles.options && settings.mobiles.options.breakpoint ) || 600;
this._events = {
scroll: this.scroll.bind( this ),
resize: this.resize.bind( this ),
contentChange: function() {
this._countScrollable();
}.bind( this ),
hideMobileVerticalHeader: function( e ) {
if ( $.contains( this.$container[ 0 ], e.target ) ) {
return;
}
$us.$body
.off( $.isMobile ? 'touchstart' : 'click', this._events.hideMobileVerticalHeader );
setTimeout( function() {
$us.$body.removeClass( 'header-show' );
}, 10 );
}.bind( this )
};
this.$elms = {};
this.$places = {
hidden: this.$container.find( '.l-subheader.for_hidden' )
};
this.$container.find( '.l-subheader-cell' ).each( function( index, cell ) {
var $cell = $( cell );
this.$places[ $cell.parent().parent().usMod( 'at' ) + '_' + $cell.usMod( 'at' ) ] = $cell;
}.bind( this ) );
var regexp = /(^| )ush_([a-z_]+)_([0-9]+)( |$)/;
this.$container.find( '[class*=ush_]' ).each( function( index, elm ) {
var $elm = $( elm ),
matches = regexp.exec( $elm.attr( 'class' ) );
if ( ! matches ) {
return;
}
var id = matches[ 2 ] + ':' + matches[ 3 ];
this.$elms[ id ] = $elm;
if ( $elm.is( '.w-vwrapper, .w-hwrapper' ) ) {
this.$places[ id ] = $elm;
}
}.bind( this ) );
// TODO Objects with the header elements
$us.$window.on( 'scroll', this._events.scroll );
$us.$window.on( 'resize load', this._events.resize );
this.resize();
$us.$canvas.on( 'contentChange', function() {
if ( this.orientation == 'ver' ) {
this.docHeight = $us.$document.height();
}
}.bind( this ) );
this.$container.on( 'contentChange', this._events.contentChange );
this.$showBtn.on( 'click', function( e ) {
if ( $us.$body.hasClass( 'header-show' ) ) {
return;
}
e.stopPropagation();
$us.$body
.addClass( 'header-show' )
.on( $.isMobile ? 'touchstart' : 'click', this._events.hideMobileVerticalHeader );
}.bind( this ) );
}
$.extend( USHeader.prototype, {
scroll: function() {
var scrollTop = parseInt( $us.$window.scrollTop() );
if ( this.pos == 'fixed' ) {
if ( this.orientation == 'hor' ) {
if ( ( $us.canvas.headerInitialPos == 'bottom' || $us.canvas.headerInitialPos == 'below' ) && ( $us.$body.usMod( 'state' ) == 'default' ) ) {
if ( this.adminBarHeight ) {
scrollTop += this.adminBarHeight;
}
if ( scrollTop >= this.headerTop ) {
if ( ! this.$container.hasClass( 'sticky' ) ) {
this.$container.addClass( 'sticky' );
}
if ( this.applyHeaderTop && this.$container.css( 'top' ) != '' ) {
this.$container.css( 'top', '' );
}
} else if ( scrollTop < this.headerTop ) {
if ( this.$container.hasClass( 'sticky' ) ) {
this.$container.removeClass( 'sticky' );
}
if ( this.applyHeaderTop && this.$container.css( 'top' ) != this.headerTop ) {
this.$container.css( 'top', this.headerTop );
}
}
} else {
this.$container.toggleClass( 'sticky', scrollTop >= ( parseInt( this.settings[ this.state ].options.scroll_breakpoint ) || 100 ) );
}
} else if ( ! jQuery.isMobile && this.$container.hasClass( 'scrollable' ) && this.docHeight > this.headerHeight + this.htmlTopMargin ) {
var scrollRangeDiff = this.headerHeight - $us.canvas.winHeight + this.htmlTopMargin;
if ( this._sidedHeaderScrollRange === undefined ) {
this._sidedHeaderScrollRange = [ 0, scrollRangeDiff ];
}
if ( scrollTop <= this._sidedHeaderScrollRange[ 0 ] ) {
this._sidedHeaderScrollRange[ 0 ] = Math.max( 0, scrollTop );
this._sidedHeaderScrollRange[ 1 ] = this._sidedHeaderScrollRange[ 0 ] + scrollRangeDiff;
this.$container.css( {
position: 'fixed',
top: this.htmlTopMargin
} );
}
else if ( this._sidedHeaderScrollRange[ 0 ] < scrollTop && scrollTop < this._sidedHeaderScrollRange[ 1 ] ) {
this.$container.css( {
position: 'absolute',
top: this._sidedHeaderScrollRange[ 0 ]
} );
}
else if ( this._sidedHeaderScrollRange[ 1 ] <= scrollTop ) {
this._sidedHeaderScrollRange[ 1 ] = Math.min( this.docHeight - $us.canvas.winHeight, scrollTop );
this._sidedHeaderScrollRange[ 0 ] = this._sidedHeaderScrollRange[ 1 ] - scrollRangeDiff;
this.$container.css( {
position: 'fixed',
top: $us.canvas.winHeight - this.headerHeight
} );
}
}
}
},
resize: function() {
var newState = 'default';
if ( window.innerWidth < this.tabletsBreakpoint ) {
newState = ( window.innerWidth < this.mobilesBreakpoint ) ? 'mobiles' : 'tablets';
}
this.setState( newState );
if ( this.pos == 'fixed' && this.orientation == 'hor' ) {
var isSticky = this.$container.hasClass( 'sticky' );
this.$container.addClass( 'notransition' );
if ( ! isSticky ) {
this.$container.addClass( 'sticky' );
}
this.scrolledOccupiedHeight = this.$container.height();
if ( ! isSticky ) {
this.$container.removeClass( 'sticky' );
}
// Removing with a small delay to prevent css glitch
setTimeout( function() {
this.$container.removeClass( 'notransition' );
}.bind( this ), 50 );
} else /*if (this.orientation == 'ver' || this.pos == 'static')*/ {
this.scrolledOccupiedHeight = 0;
}
if ( this.orientation == 'hor' ) {
if ( this.pos == 'fixed' && ( $us.canvas.headerInitialPos == 'bottom' || $us.canvas.headerInitialPos == 'below' ) && ( $us.$body.usMod( 'state' ) == 'default' ) ) {
var adminBar = $( '#wpadminbar' );
this.adminBarHeight = ( adminBar.length ) ? adminBar.height() : 0;
this.headerTop = $us.canvas.$firstSection.outerHeight() + this.adminBarHeight;
if ( $us.canvas.headerInitialPos == 'bottom' ) {
this.headerTop = this.headerTop - this.$container.outerHeight();
}
if ( ! $us.canvas.$firstSection.hasClass( 'height_full' ) ) {
this.$container.css( 'bottom', 'auto' );
this.applyHeaderTop = true;
this.$container.css( 'top', this.headerTop );
}
} else {
this.applyHeaderTop = false;
this.$container.css( 'top', '' );
}
} else {
this.applyHeaderTop = false;
this.$container.css( 'top', '' );
}
this._countScrollable();
this.scroll();
},
setState: function( newState ) {
if ( newState == this.state ) {
return;
}
var newOrientation = this.settings[ newState ].options.orientation || 'hor',
newPos = $us.toBool( this.settings[ newState ].options.sticky ) ? 'fixed' : 'static',
newBg = $us.toBool( this.settings[ newState ].options.transparent ) ? 'transparent' : 'solid',
newShadow = this.settings[ newState ].options.shadow || 'thin';
if ( newOrientation == 'ver' ) {
newPos = 'fixed';
newBg = 'solid';
}
this.state = newState;
// Don't change the order: orientation -> pos -> bg -> layout
this._setOrientation( newOrientation );
this._setPos( newPos );
this._setBg( newBg );
this._setShadow( newShadow );
this._setLayout( this.settings[ newState ].layout || {} );
$us.$body.usMod( 'state', newState );
if ( newState == 'default' ) {
$us.$body.removeClass( 'header-show' );
}
// Updating the menu because of dependencies
if ( $us.nav !== undefined ) {
$us.nav.resize();
}
},
_setOrientation: function( newOrientation ) {
if ( newOrientation == this.orientation ) {
return;
}
$us.$body.usMod( 'header', newOrientation );
this.orientation = newOrientation;
},
_countScrollable: function() {
if ( this.orientation == 'ver' && this.pos == 'fixed' && this.state == 'default' ) {
this.docHeight = $us.$document.height();
this.htmlTopMargin = parseInt( $us.$html.css( 'margin-top' ) );
this.headerHeight = this.$topCell.height() + this.$middleCell.height() + this.$bottomCell.height();
if ( this.headerHeight > $us.canvas.winHeight - this.htmlTopMargin ) {
this.$container.addClass( 'scrollable' );
} else if ( this.$container.hasClass( 'scrollable' ) ) {
this.$container.removeClass( 'scrollable' ).resetInlineCSS( 'position', 'top', 'bottom' );
delete this._sidedHeaderScrollRange;
}
if ( this.headerHeight + this.htmlTopMargin >= this.docHeight ) {
this.$container.css( {
position: 'absolute',
top: 0
} );
}
} else if ( this.$container.hasClass( 'scrollable' ) ) {
this.$container.removeClass( 'scrollable' ).resetInlineCSS( 'position', 'top', 'bottom' );
delete this._sidedHeaderScrollRange;
}
},
_setPos: function( newPos ) {
if ( newPos == this.pos ) {
return;
}
this.$container.usMod( 'pos', newPos );
if ( newPos == 'static' ) {
this.$container.removeClass( 'sticky' );
}
this.pos = newPos;
this._countScrollable();
},
_setBg: function( newBg ) {
if ( newBg == this.bg ) {
return;
}
this.$container.usMod( 'bg', newBg );
this.bg = newBg;
},
_setShadow: function( newShadow ) {
if ( newShadow == this.shadow ) {
return;
}
this.$container.usMod( 'shadow', newShadow );
this.shadow = newShadow;
},
/**
* Recursive function to place elements based on their ids
* @param {Array} elms
* @param {jQuery} $place
* @private
*/
_placeElements: function( elms, $place ) {
for ( var i = 0; i < elms.length; i ++ ) {
var elmId;
if ( typeof elms[ i ] == 'object' ) {
// Wrapper
elmId = elms[ i ][ 0 ];
if ( this.$places[ elmId ] === undefined || this.$elms[ elmId ] === undefined ) {
continue;
}
this.$elms[ elmId ].appendTo( $place );
this._placeElements( elms[ i ].shift(), this.$places[ elmId ] );
} else {
// Element
elmId = elms[ i ];
if ( this.$elms[ elmId ] === undefined ) {
continue;
}
this.$elms[ elmId ].appendTo( $place );
}
}
},
_setLayout: function( newLayout ) {
// Retrieving the currently shown layout structure
var curLayout = {};
$.each( this.$places, function( place, $place ) {
}.bind( this ) );
for ( var place in newLayout ) {
if ( ! newLayout.hasOwnProperty( place ) || this.$places[ place ] === undefined ) {
continue;
}
this._placeElements( newLayout[ place ], this.$places[ place ] );
}
}
} );
$us.header = new USHeader( $us.headerSettings || {} );
}( jQuery );
+30
View File
@@ -0,0 +1,30 @@
!function($){"use strict";function USHeader(settings){this.settings=settings||{};this.state='default';this.$container=$us.$canvas.find('.l-header');this.scrolledOccupiedHeight=0;if(this.$container.length==0){return}
this.$topCell=this.$container.find('.l-subheader.at_top .l-subheader-cell:first');this.$middleCell=this.$container.find('.l-subheader.at_middle .l-subheader-cell:first');this.$bottomCell=this.$container.find('.l-subheader.at_bottom .l-subheader-cell:first');this.$showBtn=$('.w-header-show:first');this.orientation=$us.$body.usMod('header');this.pos=this.$container.usMod('pos');this.bg=this.$container.usMod('bg');this.shadow=this.$container.usMod('shadow');this.scrolledOccupiedHeight=0;this.tabletsBreakpoint=parseInt(settings.tablets&&settings.tablets.options&&settings.tablets.options.breakpoint)||900;this.mobilesBreakpoint=parseInt(settings.mobiles&&settings.mobiles.options&&settings.mobiles.options.breakpoint)||600;this._events={scroll:this.scroll.bind(this),resize:this.resize.bind(this),contentChange:function(){this._countScrollable()}.bind(this),hideMobileVerticalHeader:function(e){if($.contains(this.$container[0],e.target)){return}
$us.$body.off($.isMobile?'touchstart':'click',this._events.hideMobileVerticalHeader);setTimeout(function(){$us.$body.removeClass('header-show')},10)}.bind(this)};this.$elms={};this.$places={hidden:this.$container.find('.l-subheader.for_hidden')};this.$container.find('.l-subheader-cell').each(function(index,cell){var $cell=$(cell);this.$places[$cell.parent().parent().usMod('at')+'_'+$cell.usMod('at')]=$cell}.bind(this));var regexp=/(^| )ush_([a-z_]+)_([0-9]+)( |$)/;this.$container.find('[class*=ush_]').each(function(index,elm){var $elm=$(elm),matches=regexp.exec($elm.attr('class'));if(!matches){return}
var id=matches[2]+':'+matches[3];this.$elms[id]=$elm;if($elm.is('.w-vwrapper, .w-hwrapper')){this.$places[id]=$elm}}.bind(this));$us.$window.on('scroll',this._events.scroll);$us.$window.on('resize load',this._events.resize);this.resize();$us.$canvas.on('contentChange',function(){if(this.orientation=='ver'){this.docHeight=$us.$document.height()}}.bind(this));this.$container.on('contentChange',this._events.contentChange);this.$showBtn.on('click',function(e){if($us.$body.hasClass('header-show')){return}
e.stopPropagation();$us.$body.addClass('header-show').on($.isMobile?'touchstart':'click',this._events.hideMobileVerticalHeader)}.bind(this))}
$.extend(USHeader.prototype,{scroll:function(){var scrollTop=parseInt($us.$window.scrollTop());if(this.pos=='fixed'){if(this.orientation=='hor'){if(($us.canvas.headerInitialPos=='bottom'||$us.canvas.headerInitialPos=='below')&&($us.$body.usMod('state')=='default')){if(this.adminBarHeight){scrollTop+=this.adminBarHeight}
if(scrollTop>=this.headerTop){if(!this.$container.hasClass('sticky')){this.$container.addClass('sticky')}
if(this.applyHeaderTop&&this.$container.css('top')!=''){this.$container.css('top','')}}else if(scrollTop<this.headerTop){if(this.$container.hasClass('sticky')){this.$container.removeClass('sticky')}
if(this.applyHeaderTop&&this.$container.css('top')!=this.headerTop){this.$container.css('top',this.headerTop)}}}else{this.$container.toggleClass('sticky',scrollTop>=(parseInt(this.settings[this.state].options.scroll_breakpoint)||100))}}else if(!jQuery.isMobile&&this.$container.hasClass('scrollable')&&this.docHeight>this.headerHeight+this.htmlTopMargin){var scrollRangeDiff=this.headerHeight-$us.canvas.winHeight+this.htmlTopMargin;if(this._sidedHeaderScrollRange===undefined){this._sidedHeaderScrollRange=[0,scrollRangeDiff]}
if(scrollTop<=this._sidedHeaderScrollRange[0]){this._sidedHeaderScrollRange[0]=Math.max(0,scrollTop);this._sidedHeaderScrollRange[1]=this._sidedHeaderScrollRange[0]+scrollRangeDiff;this.$container.css({position:'fixed',top:this.htmlTopMargin})}
else if(this._sidedHeaderScrollRange[0]<scrollTop&&scrollTop<this._sidedHeaderScrollRange[1]){this.$container.css({position:'absolute',top:this._sidedHeaderScrollRange[0]})}
else if(this._sidedHeaderScrollRange[1]<=scrollTop){this._sidedHeaderScrollRange[1]=Math.min(this.docHeight-$us.canvas.winHeight,scrollTop);this._sidedHeaderScrollRange[0]=this._sidedHeaderScrollRange[1]-scrollRangeDiff;this.$container.css({position:'fixed',top:$us.canvas.winHeight-this.headerHeight})}}}},resize:function(){var newState='default';if(window.innerWidth<this.tabletsBreakpoint){newState=(window.innerWidth<this.mobilesBreakpoint)?'mobiles':'tablets'}
this.setState(newState);if(this.pos=='fixed'&&this.orientation=='hor'){var isSticky=this.$container.hasClass('sticky');this.$container.addClass('notransition');if(!isSticky){this.$container.addClass('sticky')}
this.scrolledOccupiedHeight=this.$container.height();if(!isSticky){this.$container.removeClass('sticky')}
setTimeout(function(){this.$container.removeClass('notransition')}.bind(this),50)}else{this.scrolledOccupiedHeight=0}
if(this.orientation=='hor'){if(this.pos=='fixed'&&($us.canvas.headerInitialPos=='bottom'||$us.canvas.headerInitialPos=='below')&&($us.$body.usMod('state')=='default')){var adminBar=$('#wpadminbar');this.adminBarHeight=(adminBar.length)?adminBar.height():0;this.headerTop=$us.canvas.$firstSection.outerHeight()+this.adminBarHeight;if($us.canvas.headerInitialPos=='bottom'){this.headerTop=this.headerTop-this.$container.outerHeight()}
if(!$us.canvas.$firstSection.hasClass('height_full')){this.$container.css('bottom','auto');this.applyHeaderTop=!0;this.$container.css('top',this.headerTop)}}else{this.applyHeaderTop=!1;this.$container.css('top','')}}else{this.applyHeaderTop=!1;this.$container.css('top','')}
this._countScrollable();this.scroll()},setState:function(newState){if(newState==this.state){return}
var newOrientation=this.settings[newState].options.orientation||'hor',newPos=$us.toBool(this.settings[newState].options.sticky)?'fixed':'static',newBg=$us.toBool(this.settings[newState].options.transparent)?'transparent':'solid',newShadow=this.settings[newState].options.shadow||'thin';if(newOrientation=='ver'){newPos='fixed';newBg='solid'}
this.state=newState;this._setOrientation(newOrientation);this._setPos(newPos);this._setBg(newBg);this._setShadow(newShadow);this._setLayout(this.settings[newState].layout||{});$us.$body.usMod('state',newState);if(newState=='default'){$us.$body.removeClass('header-show')}
if($us.nav!==undefined){$us.nav.resize()}},_setOrientation:function(newOrientation){if(newOrientation==this.orientation){return}
$us.$body.usMod('header',newOrientation);this.orientation=newOrientation},_countScrollable:function(){if(this.orientation=='ver'&&this.pos=='fixed'&&this.state=='default'){this.docHeight=$us.$document.height();this.htmlTopMargin=parseInt($us.$html.css('margin-top'));this.headerHeight=this.$topCell.height()+this.$middleCell.height()+this.$bottomCell.height();if(this.headerHeight>$us.canvas.winHeight-this.htmlTopMargin){this.$container.addClass('scrollable')}else if(this.$container.hasClass('scrollable')){this.$container.removeClass('scrollable').resetInlineCSS('position','top','bottom');delete this._sidedHeaderScrollRange}
if(this.headerHeight+this.htmlTopMargin>=this.docHeight){this.$container.css({position:'absolute',top:0})}}else if(this.$container.hasClass('scrollable')){this.$container.removeClass('scrollable').resetInlineCSS('position','top','bottom');delete this._sidedHeaderScrollRange}},_setPos:function(newPos){if(newPos==this.pos){return}
this.$container.usMod('pos',newPos);if(newPos=='static'){this.$container.removeClass('sticky')}
this.pos=newPos;this._countScrollable()},_setBg:function(newBg){if(newBg==this.bg){return}
this.$container.usMod('bg',newBg);this.bg=newBg},_setShadow:function(newShadow){if(newShadow==this.shadow){return}
this.$container.usMod('shadow',newShadow);this.shadow=newShadow},_placeElements:function(elms,$place){for(var i=0;i<elms.length;i ++){var elmId;if(typeof elms[i]=='object'){elmId=elms[i][0];if(this.$places[elmId]===undefined||this.$elms[elmId]===undefined){continue}
this.$elms[elmId].appendTo($place);this._placeElements(elms[i].shift(),this.$places[elmId])}else{elmId=elms[i];if(this.$elms[elmId]===undefined){continue}
this.$elms[elmId].appendTo($place)}}},_setLayout:function(newLayout){var curLayout={};$.each(this.$places,function(place,$place){}.bind(this));for(var place in newLayout){if(!newLayout.hasOwnProperty(place)||this.$places[place]===undefined){continue}
this._placeElements(newLayout[place],this.$places[place])}}});$us.header=new USHeader($us.headerSettings||{})}(jQuery)
@@ -0,0 +1,294 @@
/*
* Horparallax
*
* @version 1.0
*
* Copyright 2017 UpSolution
*/
! function( $ ) {
/*
********* Horparallax class definition ***********/
var Horparallax = function( container, options ) {
// Context
var that = this;
this.$window = $( window );
this.container = $( container );
// Apply options
if ( container.onclick != undefined ) {
options = $.extend( {}, container.onclick() || {}, typeof options == 'object' && options );
this.container.removeProp( 'onclick' );
}
options = $.extend( {}, $.fn.horparallax.defaults, typeof options == 'object' && options );
this.options = options;
this.bg = this.container.find( options.bgSelector );
// Count sizes
this.containerWidth = this.container.outerWidth();
this.containerHeight = this.container.outerHeight();
this.bgWidth = this.bg.outerWidth();
this.windowHeight = this.$window.height();
// Count frame rate
this._frameRate = Math.round( 1000 / this.options.fps );
// To fix IE bug that handles mousemove before mouseenter
this.mouseInside = false;
// Mouse events for desktop browsers
if ( ! ( 'ontouchstart' in window ) || ! ( 'DeviceOrientationEvent' in window ) ) {
this.container
.mouseenter( function( e ) {
// To fix IE bug that handles mousemove before mouseenter
that.mouseInside = true;
var offset = that.container.offset(),
coord = ( e.pageX - offset.left ) / that.containerWidth;
that.cancel();
that._hoverAnimation = true;
that._hoverFrom = that.now;
that._hoverTo = coord;
that.start( that._hoverTo );
} )
.mousemove( function( e ) {
// To fix IE bug that handles mousemove before mouseenter
if ( ! that.mouseInside ) {
return;
}
// Reducing processor load for too frequent event calls
if ( that._lastFrame + that._frameRate > Date.now() ) {
return;
}
var offset = that.container.offset(),
coord = ( e.pageX - offset.left ) / that.containerWidth;
// Handle hover animation
if ( that._hoverAnimation ) {
that._hoverTo = coord;
return;
}
that.set( coord );
that._lastFrame = Date.now();
} )
.mouseleave( function( e ) {
that.mouseInside = false;
that.cancel();
that.start( that.options.basePoint );
} );
}
// Handle resize
this.$window.resize( function() {
that.handleResize();
} );
// Device orientation events for touch devices
this._orientationDriven = ( 'ontouchstart' in window && 'DeviceOrientationEvent' in window );
if ( this._orientationDriven ) {
// Check if container is visible
this._checkIfVisible();
window.addEventListener( "deviceorientation", function( e ) {
// Reducing processor load for too frequent event calls
if ( ! that.visible || that._lastFrame + that._frameRate > Date.now() ) {
return;
}
that._deviceOrientationChange( e );
that._lastFrame = Date.now();
} );
this.$window.resize( function() {
that._checkIfVisible();
} );
this.$window.scroll( function() {
that._checkIfVisible();
} );
}
// Set to basepoint
this.set( this.options.basePoint );
this._lastFrame = Date.now();
};
Horparallax.prototype = {
/**
* Event to fire on deviceorientation change
* @private
*/
_deviceOrientationChange: function( e ) {
var gamma = e.gamma,
beta = e.beta,
x, y;
switch ( window.orientation ) {
case - 90:
beta = Math.max( - 45, Math.min( 45, beta ) );
x = ( beta + 45 ) / 90;
break;
case 90:
beta = Math.max( - 45, Math.min( 45, beta ) );
x = ( 45 - beta ) / 90;
break;
case 180:
gamma = Math.max( - 45, Math.min( 45, gamma ) );
x = ( gamma + 45 ) / 90;
break;
case 0:
default:
// Upside down
if ( gamma < - 90 || gamma > 90 ) {
gamma = Math.abs( e.gamma ) / e.gamma * ( 180 - Math.abs( e.gamma ) );
}
gamma = Math.max( - 45, Math.min( 45, gamma ) );
x = ( 45 - gamma ) / 90;
break;
}
this.set( x );
},
/**
* Handle container resize
*/
handleResize: function() {
this.containerWidth = this.container.outerWidth();
this.containerHeight = this.container.outerHeight();
this.bgWidth = this.bg.outerWidth();
this.windowHeight = this.$window.height();
this.set( this.now );
},
/**
* Update container visibility status (to prevent unnessesary rendering)
* @private
*/
_checkIfVisible: function() {
var scrollTop = this.$window.scrollTop(),
containerTop = this.container.offset().top;
this.visible = ( containerTop + this.containerHeight > scrollTop && containerTop < scrollTop + this.windowHeight );
},
/**
* Render horparallax frame.
* @param {Array} x is ranged in [0, 1]
*/
set: function( x ) {
this.bg.css( 'left', ( this.containerWidth - this.bgWidth ) * x );
this.now = x;
return this;
},
/**
* Step value computing function, read more at http://mootools.net/docs/core/Fx/Fx
* @param {Number} from
* @param {Number} to
* @param {Number} delta
* @return {Number}
*/
compute: function( from, to, delta ) {
if ( this._hoverAnimation ) {
return ( this._hoverTo - this._hoverFrom ) * delta + this._hoverFrom;
}
return ( to - from ) * delta + from;
},
/**
* Start animation to certain point
* @param {Array} to
* @return {Horparallax}
*/
start: function( to ) {
var from = this.now,
that = this;
this.container
.css( 'delta', 0 )
.animate( {
delta: 1
}, {
duration: this.options.duration,
easing: this.options.easing,
complete: function() {
that._hoverAnimation = false;
},
step: function( delta ) {
that.set( that.compute( from, to, delta ) );
},
queue: false
} );
return this;
},
/**
* Cancel animation
* @return {Horparallax}
*/
cancel: function() {
this._hoverAnimation = false;
this.container.stop( true, false );
return this;
}
};
// EaseOutElastic easing
if ( $.easing.easeOutElastic == undefined ) {
/**
* Original function by George McGinley Smith
* @link http://gsgd.co.uk/sandbox/jquery/easing/
*/
$.easing.easeOutElastic = function( x, t, b, c, d ) {
var s = 1.70158, p = 0, a = c;
if ( t == 0 ) {
return b;
}
if ( ( t /= d ) == 1 ) {
return b + c;
}
if ( ! p ) {
p = d * .3;
}
if ( a < Math.abs( c ) ) {
a = c;
var s = p / 4;
}
else {
var s = p / ( 2 * Math.PI ) * Math.asin( c / a );
}
return a * Math.pow( 2, - 10 * t ) * Math.sin( ( t * d - s ) * ( 2 * Math.PI ) / p ) + c + b;
};
}
$.fn.horparallax = function( options ) {
return this.each( function() {
var $this = $( this ),
data = $this.data( 'horparallax' );
if ( ! data ) {
$this.data( 'horparallax', ( data = new Horparallax( this, options ) ) )
}
} );
};
$.fn.horparallax.defaults = {
/**
* @var {Number} Frame per second limit for rendering
*/
fps: 60,
/**
* @var {Number} Point for basic position (after the cursor moves out of the container)
*/
basePoint: .5,
/**
* @var {Number} Return to base point duration
*/
duration: 500,
/**
* @var {String} Background layer selector
*/
bgSelector: '.l-section-img',
/**
* @var {Function} Returning-to-basepoint easing
*/
easing: 'swing'// 'easeOutElastic'
};
$.fn.horparallax.Constructor = Horparallax;
$( function() {
jQuery( '.parallax_hor' ).horparallax();
} );
}( jQuery );
@@ -0,0 +1,17 @@
!function($){var Horparallax=function(container,options){var that=this;this.$window=$(window);this.container=$(container);if(container.onclick!=undefined){options=$.extend({},container.onclick()||{},typeof options=='object'&&options);this.container.removeProp('onclick')}
options=$.extend({},$.fn.horparallax.defaults,typeof options=='object'&&options);this.options=options;this.bg=this.container.find(options.bgSelector);this.containerWidth=this.container.outerWidth();this.containerHeight=this.container.outerHeight();this.bgWidth=this.bg.outerWidth();this.windowHeight=this.$window.height();this._frameRate=Math.round(1000/this.options.fps);this.mouseInside=!1;if(!('ontouchstart' in window)||!('DeviceOrientationEvent' in window)){this.container.mouseenter(function(e){that.mouseInside=!0;var offset=that.container.offset(),coord=(e.pageX-offset.left)/that.containerWidth;that.cancel();that._hoverAnimation=!0;that._hoverFrom=that.now;that._hoverTo=coord;that.start(that._hoverTo)}).mousemove(function(e){if(!that.mouseInside){return}
if(that._lastFrame+that._frameRate>Date.now()){return}
var offset=that.container.offset(),coord=(e.pageX-offset.left)/that.containerWidth;if(that._hoverAnimation){that._hoverTo=coord;return}
that.set(coord);that._lastFrame=Date.now()}).mouseleave(function(e){that.mouseInside=!1;that.cancel();that.start(that.options.basePoint)})}
this.$window.resize(function(){that.handleResize()});this._orientationDriven=('ontouchstart' in window&&'DeviceOrientationEvent' in window);if(this._orientationDriven){this._checkIfVisible();window.addEventListener("deviceorientation",function(e){if(!that.visible||that._lastFrame+that._frameRate>Date.now()){return}
that._deviceOrientationChange(e);that._lastFrame=Date.now()});this.$window.resize(function(){that._checkIfVisible()});this.$window.scroll(function(){that._checkIfVisible()})}
this.set(this.options.basePoint);this._lastFrame=Date.now()};Horparallax.prototype={_deviceOrientationChange:function(e){var gamma=e.gamma,beta=e.beta,x,y;switch(window.orientation){case-90:beta=Math.max(-45,Math.min(45,beta));x=(beta+45)/90;break;case 90:beta=Math.max(-45,Math.min(45,beta));x=(45-beta)/90;break;case 180:gamma=Math.max(-45,Math.min(45,gamma));x=(gamma+45)/90;break;case 0:default:if(gamma<-90||gamma>90){gamma=Math.abs(e.gamma)/e.gamma*(180-Math.abs(e.gamma))}
gamma=Math.max(-45,Math.min(45,gamma));x=(45-gamma)/90;break}
this.set(x)},handleResize:function(){this.containerWidth=this.container.outerWidth();this.containerHeight=this.container.outerHeight();this.bgWidth=this.bg.outerWidth();this.windowHeight=this.$window.height();this.set(this.now)},_checkIfVisible:function(){var scrollTop=this.$window.scrollTop(),containerTop=this.container.offset().top;this.visible=(containerTop+this.containerHeight>scrollTop&&containerTop<scrollTop+this.windowHeight)},set:function(x){this.bg.css('left',(this.containerWidth-this.bgWidth)*x);this.now=x;return this},compute:function(from,to,delta){if(this._hoverAnimation){return(this._hoverTo-this._hoverFrom)*delta+this._hoverFrom}
return(to-from)*delta+from},start:function(to){var from=this.now,that=this;this.container.css('delta',0).animate({delta:1},{duration:this.options.duration,easing:this.options.easing,complete:function(){that._hoverAnimation=!1},step:function(delta){that.set(that.compute(from,to,delta))},queue:!1});return this},cancel:function(){this._hoverAnimation=!1;this.container.stop(!0,!1);return this}};if($.easing.easeOutElastic==undefined){$.easing.easeOutElastic=function(x,t,b,c,d){var s=1.70158,p=0,a=c;if(t==0){return b}
if((t/=d)==1){return b+c}
if(!p){p=d*.3}
if(a<Math.abs(c)){a=c;var s=p/4}
else{var s=p/(2*Math.PI)*Math.asin(c/a)}
return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b}}
$.fn.horparallax=function(options){return this.each(function(){var $this=$(this),data=$this.data('horparallax');if(!data){$this.data('horparallax',(data=new Horparallax(this,options)))}})};$.fn.horparallax.defaults={fps:60,basePoint:.5,duration:500,bgSelector:'.l-section-img',easing:'swing'};$.fn.horparallax.Constructor=Horparallax;$(function(){jQuery('.parallax_hor').horparallax()})}(jQuery)
@@ -0,0 +1,214 @@
/*
Plugin: jQuery Parallax
Version 1.1.3
Author: Ian Lunn
Twitter: @IanLunn
Author URL: http://www.ianlunn.co.uk/
Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/
(Contains lots of UpSolution's modifications)
Dual licensed under the MIT and GPL licenses:
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html
*/
( function( $ ) {
var $window = $( window ),
windowHeight = $window.height();
$.fn.parallax = function( xposParam ) {
this.each( function() {
var $container = $( this ),
$this = $container.children( '.l-section-img' ),
speedFactor,
offsetFactor = 0,
getHeight,
topOffset = 0,
containerHeight = 0,
containerWidth = 0,
// Disable parallax on certain screen/img ratios
disableParallax = false,
parallaxIsDisabled = false,
// Base image width and height (if can be achieved)
baseImgHeight = 0,
baseImgWidth = 0,
// Backgroud-size cover? and current image size (counted)
isBgCover = ( $this.css( 'background-size' ) == 'cover' ),
originalBgPos = $this.css( 'background-position' ),
curImgHeight = 0,
reversed = $container.hasClass( 'parallaxdir_reversed' ),
baseSpeedFactor = reversed ? - 0.1 : 0.61,
xpos,
outerHeight = true;
if ( $this.length == 0 ) {
return;
}
// setup defaults if arguments aren't specified
if ( xposParam === undefined ) {
xpos = "50%";
} else {
xpos = xposParam;
}
if ( $container.hasClass( 'parallax_xpos_right' ) ) {
xpos = "100%";
} else if ( $container.hasClass( 'parallax_xpos_left' ) ) {
xpos = "0%";
}
if ( outerHeight ) {
getHeight = function( jqo ) {
return jqo.outerHeight( true );
};
} else {
getHeight = function( jqo ) {
return jqo.height();
};
}
// Count background image size
function getBackgroundSize( callback ) {
var img = new Image(),
// here we will place image's width and height
width, height,
// here we get the size of the background and split it to array
backgroundSize = ( $this.css( 'background-size' ) || ' ' ).split( ' ' ),
backgroundWidthAttr = $this.attr( 'data-img-width' ),
backgroundHeightAttr = $this.attr( 'data-img-height' );
if ( backgroundWidthAttr != '' ) {
width = parseInt( backgroundWidthAttr );
}
if ( backgroundHeightAttr != '' ) {
height = parseInt( backgroundHeightAttr );
}
if ( width !== undefined && height !== undefined ) {
// Image is not needed
return callback( { width: width, height: height } );
}
// checking if width was set to pixel value
if ( /px/.test( backgroundSize[ 0 ] ) ) {
width = parseInt( backgroundSize[ 0 ] );
}
// checking if width was set to percent value
if ( /%/.test( backgroundSize[ 0 ] ) ) {
width = $this.parent().width() * ( parseInt( backgroundSize[ 0 ] ) / 100 );
}
// checking if height was set to pixel value
if ( /px/.test( backgroundSize[ 1 ] ) ) {
height = parseInt( backgroundSize[ 1 ] );
}
// checking if height was set to percent value
if ( /%/.test( backgroundSize[ 1 ] ) ) {
height = $this.parent().height() * ( parseInt( backgroundSize[ 0 ] ) / 100 );
}
if ( width !== undefined && height !== undefined ) {
// Image is not needed
return callback( { width: width, height: height } );
}
// Image is needed
img.onload = function() {
// check if width was set earlier, if not then set it now
if ( typeof width == 'undefined' ) {
width = this.width;
}
// do the same with height
if ( typeof height == 'undefined' ) {
height = this.height;
}
// call the callback
callback( { width: width, height: height } );
};
// extract image source from css using one, simple regex
// src should be set AFTER onload handler
img.src = ( $this.css( 'background-image' ) || '' ).replace( /url\(['"]*(.*?)['"]*\)/g, '$1' );
}
function update() {
if ( disableParallax ) {
if ( ! parallaxIsDisabled ) {
$this.css( 'backgroundPosition', originalBgPos );
$container.usMod( 'parallax', 'fixed' );
parallaxIsDisabled = true;
}
return;
} else {
if ( parallaxIsDisabled ) {
$container.usMod( 'parallax', 'ver' );
parallaxIsDisabled = false;
}
}
if ( isNaN( speedFactor ) ) {
return;
}
var pos = $window.scrollTop();
// Check if totally above or totally below viewport
if ( ( topOffset + containerHeight < pos ) || ( pos < topOffset - windowHeight ) ) {
return;
}
$this.css( 'backgroundPosition', xpos + " " + ( offsetFactor + speedFactor * ( topOffset - pos ) ) + "px" );
}
function resize() {
setTimeout( function() {
windowHeight = $window.height();
containerHeight = getHeight( $this );
containerWidth = $this.width();
if ( $window.width() < $us.canvasOptions.disableEffectsWidth ) {
disableParallax = true;
} else {
disableParallax = false;
if ( isBgCover ) {
if ( baseImgWidth / baseImgHeight <= containerWidth / containerHeight ) {
// Resizing by width
curImgHeight = baseImgHeight * ( $this.width() / baseImgWidth );
disableParallax = false;
}
else {
disableParallax = true;
}
}
}
// Improving speed factor to prevent showing image limits
if ( curImgHeight !== 0 ) {
if ( baseSpeedFactor >= 0 ) {
speedFactor = Math.min( baseSpeedFactor, curImgHeight / windowHeight );
offsetFactor = Math.min( 0, .5 * ( windowHeight - curImgHeight - speedFactor * ( windowHeight - containerHeight ) ) );
} else {
speedFactor = Math.min( baseSpeedFactor, ( windowHeight - containerHeight ) / ( windowHeight + containerHeight ) );
offsetFactor = Math.max( 0, speedFactor * containerHeight );
}
} else {
speedFactor = baseSpeedFactor;
offsetFactor = 0;
}
topOffset = $this.offset().top;
update();
}, 10 );
}
getBackgroundSize( function( sz ) {
curImgHeight = baseImgHeight = sz.height;
baseImgWidth = sz.width;
resize();
} );
$window.bind( { scroll: update, load: resize, resize: resize } );
resize();
} );
};
jQuery( '.parallax_ver' ).parallax( '50%' );
} )( jQuery );
@@ -0,0 +1,25 @@
(function($){var $window=$(window),windowHeight=$window.height();$.fn.parallax=function(xposParam){this.each(function(){var $container=$(this),$this=$container.children('.l-section-img'),speedFactor,offsetFactor=0,getHeight,topOffset=0,containerHeight=0,containerWidth=0,disableParallax=!1,parallaxIsDisabled=!1,baseImgHeight=0,baseImgWidth=0,isBgCover=($this.css('background-size')=='cover'),originalBgPos=$this.css('background-position'),curImgHeight=0,reversed=$container.hasClass('parallaxdir_reversed'),baseSpeedFactor=reversed?-0.1:0.61,xpos,outerHeight=!0;if($this.length==0){return}
if(xposParam===undefined){xpos="50%"}else{xpos=xposParam}
if($container.hasClass('parallax_xpos_right')){xpos="100%"}else if($container.hasClass('parallax_xpos_left')){xpos="0%"}
if(outerHeight){getHeight=function(jqo){return jqo.outerHeight(!0)}}else{getHeight=function(jqo){return jqo.height()}}
function getBackgroundSize(callback){var img=new Image(),width,height,backgroundSize=($this.css('background-size')||' ').split(' '),backgroundWidthAttr=$this.attr('data-img-width'),backgroundHeightAttr=$this.attr('data-img-height');if(backgroundWidthAttr!=''){width=parseInt(backgroundWidthAttr)}
if(backgroundHeightAttr!=''){height=parseInt(backgroundHeightAttr)}
if(width!==undefined&&height!==undefined){return callback({width:width,height:height})}
if(/px/.test(backgroundSize[0])){width=parseInt(backgroundSize[0])}
if(/%/.test(backgroundSize[0])){width=$this.parent().width()*(parseInt(backgroundSize[0])/100)}
if(/px/.test(backgroundSize[1])){height=parseInt(backgroundSize[1])}
if(/%/.test(backgroundSize[1])){height=$this.parent().height()*(parseInt(backgroundSize[0])/100)}
if(width!==undefined&&height!==undefined){return callback({width:width,height:height})}
img.onload=function(){if(typeof width=='undefined'){width=this.width}
if(typeof height=='undefined'){height=this.height}
callback({width:width,height:height})};img.src=($this.css('background-image')||'').replace(/url\(['"]*(.*?)['"]*\)/g,'$1')}
function update(){if(disableParallax){if(!parallaxIsDisabled){$this.css('backgroundPosition',originalBgPos);$container.usMod('parallax','fixed');parallaxIsDisabled=!0}
return}else{if(parallaxIsDisabled){$container.usMod('parallax','ver');parallaxIsDisabled=!1}}
if(isNaN(speedFactor)){return}
var pos=$window.scrollTop();if((topOffset+containerHeight<pos)||(pos<topOffset-windowHeight)){return}
$this.css('backgroundPosition',xpos+" "+(offsetFactor+speedFactor*(topOffset-pos))+"px")}
function resize(){setTimeout(function(){windowHeight=$window.height();containerHeight=getHeight($this);containerWidth=$this.width();if($window.width()<$us.canvasOptions.disableEffectsWidth){disableParallax=!0}else{disableParallax=!1;if(isBgCover){if(baseImgWidth/baseImgHeight<=containerWidth/containerHeight){curImgHeight=baseImgHeight*($this.width()/baseImgWidth);disableParallax=!1}
else{disableParallax=!0}}}
if(curImgHeight!==0){if(baseSpeedFactor>=0){speedFactor=Math.min(baseSpeedFactor,curImgHeight/windowHeight);offsetFactor=Math.min(0,.5*(windowHeight-curImgHeight-speedFactor*(windowHeight-containerHeight)))}else{speedFactor=Math.min(baseSpeedFactor,(windowHeight-containerHeight)/(windowHeight+containerHeight));offsetFactor=Math.max(0,speedFactor*containerHeight)}}else{speedFactor=baseSpeedFactor;offsetFactor=0}
topOffset=$this.offset().top;update()},10)}
getBackgroundSize(function(sz){curImgHeight=baseImgHeight=sz.height;baseImgWidth=sz.width;resize()});$window.bind({scroll:update,load:resize,resize:resize});resize()})};jQuery('.parallax_ver').parallax('50%')})(jQuery)
@@ -0,0 +1,17 @@
/**
* UpSolution Element: l-preloader
*/
! function( $ ) {
"use strict";
if ( $( '.l-preloader' ).length ) {
$( 'document' ).ready( function() {
setTimeout( function() {
$( '.l-preloader' ).addClass( 'done' );
}, 500 );
setTimeout( function() {
$( '.l-preloader' ).addClass( 'hidden' );
}, 1000 ); // 500 ms after 'done' class is added
} );
}
}( jQuery );
@@ -0,0 +1 @@
!function($){"use strict";if($('.l-preloader').length){$('document').ready(function(){setTimeout(function(){$('.l-preloader').addClass('done')},500);setTimeout(function(){$('.l-preloader').addClass('hidden')},1000)})}}(jQuery)
@@ -0,0 +1,472 @@
/**
* $us.scroll
*
* ScrollSpy, Smooth scroll links and hash-based scrolling all-in-one
*
* @requires $us.canvas
*/
! function( $ ) {
"use strict";
function USScroll( options ) {
// Setting options
var defaults = {
/**
* @param {String|jQuery} Selector or object of hash scroll anchors that should be attached on init
*/
attachOnInit: '.menu-item a[href*="#"], .menu-item[href*="#"], a.w-btn[href*="#"], .w-text a[href*="#"], ' + '.vc_icon_element a[href*="#"], .vc_custom_heading a[href*="#"], a.w-grid-item-anchor[href*="#"], .w-toplink, ' + '.w-image a[href*="#"], .w-iconbox a[href*="#"], .w-comments-title a[href*="#"], a.smooth-scroll[href*="#"]',
/**
* @param {String} Classname that will be toggled on relevant buttons
*/
buttonActiveClass: 'active',
/**
* @param {String} Classname that will be toggled on relevant menu items
*/
menuItemActiveClass: 'current-menu-item',
/**
* @param {String} Classname that will be toggled on relevant menu ancestors
*/
menuItemAncestorActiveClass: 'current-menu-ancestor',
/**
* @param {Number} Duration of scroll animation
*/
animationDuration: $us.canvasOptions.scrollDuration,
/**
* @param {String} Easing for scroll animation
*/
animationEasing: 'easeInOutExpo'
};
this.options = $.extend( {}, defaults, options || {} );
// Hash blocks with targets and activity indicators
this.blocks = {};
// Is scrolling to some specific block at the moment?
this.isScrolling = false;
// Waypoints that will be called at certain scroll position
this.waypoints = [];
// Sticky rows
this.stickyRows = [];//$('.l-section.type_sticky');
// Boundable events
this._events = {
cancel: this.cancel.bind( this ), scroll: this.scroll.bind( this ), resize: this.resize.bind( this )
};
this._canvasTopOffset = 0;
$us.$window.on( 'resize load', this._events.resize );
setTimeout( this._events.resize, 75 );
$us.$window.on( 'scroll', this._events.scroll );
setTimeout( this._events.scroll, 75 );
if ( this.options.attachOnInit ) {
this.attach( this.options.attachOnInit );
}
$( '.l-section.type_sticky' ).each( function( key, row ) {
var $row = $( row ), $rowGap = $row.next( '.l-section-gap' ), stickyRow = {
$row: $row, $rowGap: $rowGap
};
this._countStickyRow( stickyRow );
this.stickyRows.push( stickyRow );
}.bind( this ) );
// Recount scroll positions on any content changes
$us.$canvas.on( 'contentChange', this._countAllPositions.bind( this ) );
// Handling initial document hash
if ( document.location.hash && document.location.hash.indexOf( '#!' ) == - 1 ) {
var hash = document.location.hash, scrollPlace = ( this.blocks[ hash ] !== undefined ) ? hash : undefined;
if ( scrollPlace === undefined ) {
try {
var $target = $( hash );
if ( $target.length != 0 ) {
scrollPlace = $target;
}
}
catch ( error ) {
//Do not have to do anything here since scrollPlace is already undefined
}
}
if ( scrollPlace !== undefined ) {
// While page loads, its content changes, and we'll keep the proper scroll on each sufficient content
// change until the page finishes loading or user scrolls the page manually
var keepScrollPositionTimer = setInterval( function() {
this.scrollTo( scrollPlace );
}.bind( this ), 100 );
var clearHashEvents = function() {
// Content size still may change via other script right after page load
setTimeout( function() {
clearInterval( keepScrollPositionTimer );
$us.canvas.resize();
this._countAllPositions();
this.scrollTo( scrollPlace );
}.bind( this ), 100 );
$us.$window.off( 'load touchstart mousewheel DOMMouseScroll touchstart', clearHashEvents );
}.bind( this );
$us.$window.on( 'load touchstart mousewheel DOMMouseScroll touchstart', clearHashEvents );
}
}
}
USScroll.prototype = {
/**
* Count hash's target position and store it properly
*
* @param {String} hash
* @private
*/
_countPosition: function( hash ) {
var targetTop = this.blocks[ hash ].target.offset().top;
if ( this.blocks[ hash ].target.is( '.l-section.sticky' ) ) {
this.blocks[ hash ].target.removeClass( 'sticky' );
targetTop = this.blocks[ hash ].target.offset().top;
this.blocks[ hash ].target.addClass( 'sticky' );
}
this.blocks[ hash ].top = Math.ceil( targetTop - this._canvasTopOffset );
if ( $us.header.headerTop === undefined || ( $us.header.headerTop > 0 && targetTop > $us.header.headerTop ) ) {
this.blocks[ hash ].top = this.blocks[ hash ].top - $us.header.scrolledOccupiedHeight;
}
if ( this.stickyRows[ 0 ] !== undefined && window.innerWidth > this.stickyRows[ 0 ].disableWidth && targetTop > this.stickyRows[ 0 ].originalTop ) {
this.blocks[ hash ].top = this.blocks[ hash ].top - this.stickyRows[ 0 ].height;
}
this.blocks[ hash ].bottom = this.blocks[ hash ].top + this.blocks[ hash ].target.outerHeight( false );
},
/**
* Count all targets' positions for proper scrolling
*
* @private
*/
_countAllPositions: function() {
// Take into account #wpadminbar (and others possible) offset
this._canvasTopOffset = $us.$canvas.offset().top;
// Counting stickyRows
for ( var i = 0; i < this.stickyRows.length; i ++ ) {
this._countStickyRow( this.stickyRows[ i ] );
}
// Counting blocks
for ( var hash in this.blocks ) {
if ( ! this.blocks.hasOwnProperty( hash ) ) {
continue;
}
this._countPosition( hash );
}
// Counting waypoints
for ( var i = 0; i < this.waypoints.length; i ++ ) {
this._countWaypoint( this.waypoints[ i ] );
}
},
/**
* Indicate scroll position by hash
*
* @param {String} activeHash
* @private
*/
_indicatePosition: function( activeHash ) {
var activeMenuAncestors = [];
for ( var hash in this.blocks ) {
if ( ! this.blocks.hasOwnProperty( hash ) ) {
continue;
}
if ( this.blocks[ hash ].buttons !== undefined ) {
this.blocks[ hash ].buttons.toggleClass( this.options.buttonActiveClass, hash === activeHash );
}
if ( this.blocks[ hash ].menuItems !== undefined ) {
this.blocks[ hash ].menuItems.toggleClass( this.options.menuItemActiveClass, hash === activeHash );
}
if ( this.blocks[ hash ].menuAncestors !== undefined ) {
this.blocks[ hash ].menuAncestors.removeClass( this.options.menuItemAncestorActiveClass );
}
}
if ( this.blocks[ activeHash ] !== undefined && this.blocks[ activeHash ].menuAncestors !== undefined ) {
this.blocks[ activeHash ].menuAncestors.addClass( this.options.menuItemAncestorActiveClass );
}
},
/**
* Attach anchors so their targets will be listened for possible scrolls
*
* @param {String|jQuery} anchors Selector or list of anchors to attach
*/
attach: function( anchors ) {
// Location pattern to check absolute URLs for current location
var locationPattern = new RegExp( '^' + location.pathname.replace( /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&" ) + '#' );
var $anchors = $( anchors );
if ( $anchors.length == 0 ) {
return;
}
$anchors.each( function( index, anchor ) {
var $anchor = $( anchor ), href = $anchor.attr( 'href' ), hash = $anchor.prop( 'hash' );
// Ignoring ajax links
if ( hash.indexOf( '#!' ) != - 1 ) {
return;
}
// Checking if the hash is connected with the current page
if ( ! ( // Link type: #something
href.charAt( 0 ) == '#' || // Link type: /#something
( href.charAt( 0 ) == '/' && locationPattern.test( href ) ) || // Link type:
// http://example.com/some/path/#something
href.indexOf( location.host + location.pathname + '#' ) > - 1 ) ) {
return;
}
// Do we have an actual target, for which we'll need to count geometry?
if ( hash != '' && hash != '#' ) {
// Attach target
if ( this.blocks[ hash ] === undefined ) {
var $target = $( hash ), $type = '';
// Don't attach anchors that actually have no target
if ( $target.length == 0 ) {
return;
}
// If it's the only row in a section, than use section instead
if ( $target.hasClass( 'g-cols' ) && $target.parent().children().length == 1 ) {
$target = $target.closest( '.l-section' );
}
// If it's tabs or tour item, then use tabs container
if ( $target.hasClass( 'w-tabs-section' ) ) {
var $newTarget = $target.closest( '.w-tabs' );
if ( ! $newTarget.hasClass( 'accordion' ) ) {
$target = $newTarget;
$type = 'tab';
}
}
this.blocks[ hash ] = {
target: $target, type: $type
};
this._countPosition( hash );
}
// Attach activity indicator
if ( $anchor.parent().length > 0 && $anchor.parent().hasClass( 'menu-item' ) ) {
var $menuIndicator = $anchor.closest( '.menu-item' );
this.blocks[ hash ].menuItems = ( this.blocks[ hash ].menuItems || $() ).add( $menuIndicator );
var $menuAncestors = $menuIndicator.parents( '.menu-item-has-children' );
if ( $menuAncestors.length > 0 ) {
this.blocks[ hash ].menuAncestors = ( this.blocks[ hash ].menuAncestors || $() ).add( $menuAncestors );
}
} else {
this.blocks[ hash ].buttons = ( this.blocks[ hash ].buttons || $() ).add( $anchor );
}
}
$anchor.on( 'click', function( event ) {
event.preventDefault();
this.scrollTo( hash, true );
//If it's tabs
if ( typeof this.blocks[ hash ] !== 'undefined' ) {
if ( this.blocks[ hash ].type == 'tab' ) {
var $linkedSection = this.blocks[ hash ].target.find( '.w-tabs-section[id="' + hash.substr( 1 ) + '"]' );
if ( $linkedSection.length && ( ! $linkedSection.hasClass( 'active' ) ) ) {
var $header = $linkedSection.find( '.w-tabs-section-header' );
$header.click();
}
}
}
}.bind( this ) );
}.bind( this ) );
},
/**
* Scroll page to a certain position or hash
*
* @param {Number|String|jQuery} place
* @param {Boolean} animate
*/
scrollTo: function( place, animate ) {
var placeType, newY;
// Scroll to top
if ( place == '' || place == '#' ) {
newY = 0;
placeType = 'top';
}
// Scroll by hash
else if ( this.blocks[ place ] !== undefined ) {
newY = this.blocks[ place ].top;
placeType = 'hash';
} else if ( place instanceof $ ) {
if ( place.hasClass( 'w-tabs-section' ) ) {
var newPlace = place.closest( '.w-tabs' );
if ( ! newPlace.hasClass( 'accordion' ) ) {
place = newPlace;
}
}
newY = Math.floor( place.offset().top - this._canvasTopOffset );
if ( $us.header.headerTop === undefined || ( $us.header.headerTop > 0 && place.offset().top > $us.header.headerTop ) ) {
newY = newY - $us.header.scrolledOccupiedHeight;
}
placeType = 'element';
} else {
newY = Math.floor( place - this._canvasTopOffset );
if ( $us.header.headerTop === undefined || ( $us.header.headerTop > 0 && place > $us.header.headerTop ) ) {
newY = newY - $us.header.scrolledOccupiedHeight;
}
}
var indicateActive = function() {
if ( placeType == 'hash' ) {
this._indicatePosition( place );
} else {
this.scroll();
}
}.bind( this );
if ( animate ) {
this.isScrolling = true;
// Fix for iPads since scrollTop returns 0 all the time
if ( navigator.userAgent.match( /iPad/i ) != null && $( '.us_iframe' ).length && placeType == 'hash' ) {
$( place )[ 0 ].scrollIntoView( { behavior: "smooth", block: "start" } );
}
$us.$htmlBody.stop( true, false ).animate( {
scrollTop: newY + 'px'
}, {
duration: this.options.animationDuration, easing: this.options.animationEasing, always: function() {
$us.$window.off( 'keydown mousewheel DOMMouseScroll touchstart', this._events.cancel );
this.isScrolling = false;
indicateActive();
}.bind( this )
} );
// Allow user to stop scrolling manually
$us.$window.on( 'keydown mousewheel DOMMouseScroll touchstart', this._events.cancel );
} else {
$us.$htmlBody.stop( true, false ).scrollTop( newY );
indicateActive();
}
},
/**
* Cancel scroll
*/
cancel: function() {
$us.$htmlBody.stop( true, false );
},
/**
* Add new waypoint
*
* @param {jQuery} $elm object with the element
* @param {mixed} offset Offset from bottom of screen in pixels ('100') or percents ('20%')
* @param {Function} fn The function that will be called
*/
addWaypoint: function( $elm, offset, fn ) {
$elm = ( $elm instanceof $ ) ? $elm : $( $elm );
if ( $elm.length == 0 ) {
return;
}
if ( typeof offset != 'string' || offset.indexOf( '%' ) == - 1 ) {
// Not percent: using pixels
offset = parseInt( offset );
}
var waypoint = {
$elm: $elm, offset: offset, fn: fn
};
this._countWaypoint( waypoint );
this.waypoints.push( waypoint );
},
/**
*
* @param {Object} waypoint
* @private
*/
_countWaypoint: function( waypoint ) {
var elmTop = waypoint.$elm.offset().top, winHeight = $us.$window.height();
if ( typeof waypoint.offset == 'number' ) {
// Offset is defined in pixels
waypoint.scrollPos = elmTop - winHeight + waypoint.offset;
} else {
// Offset is defined in percents
waypoint.scrollPos = elmTop - winHeight + winHeight * parseInt( waypoint.offset ) / 100;
}
},
/**
*
* @param {Object} stickyRow
* @private
*/
_countStickyRow: function( stickyRow ) {
var isSticky = false;
if ( stickyRow.$row.hasClass( 'sticky' ) ) {
isSticky = true;
stickyRow.$row.removeClass( 'sticky' );
}
stickyRow.disableWidth = ( stickyRow.$row.data( 'sticky-disable-width' ) !== undefined ) ? stickyRow.$row.data( 'sticky-disable-width' ) : 900;
stickyRow.originalTop = stickyRow.$row.offset().top;
stickyRow.top = stickyRow.$row.offset().top - this._canvasTopOffset;
if ( $us.header.headerTop === undefined || ( $us.header.headerTop > 0 && stickyRow.top > $us.header.headerTop ) ) {
stickyRow.top = stickyRow.top - $us.header.scrolledOccupiedHeight;
}
stickyRow.height = stickyRow.$row.outerHeight();
if ( stickyRow.$row.is( '.l-main .l-section:first-child' ) ) {
stickyRow.height = stickyRow.height - parseInt( stickyRow.$row.css( 'padding-top' ) );
}
if ( isSticky ) {
stickyRow.$row.addClass( 'sticky' );
}
},
/**
* Scroll handler
*/
scroll: function() {
var scrollTop = parseInt( $us.$window.scrollTop() );
if ( ! this.isScrolling ) {
var activeHash;
for ( var hash in this.blocks ) {
if ( ! this.blocks.hasOwnProperty( hash ) ) {
continue;
}
if ( scrollTop >= ( this.blocks[ hash ].top - 1 ) && scrollTop < ( this.blocks[ hash ].bottom - 1 ) ) {
activeHash = hash;
break;
}
}
this._indicatePosition( activeHash );
}
// Handling sticky rows
for ( var i = 0; i < this.stickyRows.length; i ++ ) {
if ( this.stickyRows[ i ].top < scrollTop && window.innerWidth > this.stickyRows[ i ].disableWidth ) {
this.stickyRows[ i ].$row.addClass( 'sticky' );
this.stickyRows[ i ].$rowGap.css( 'height', this.stickyRows[ i ].height );
} else {
this.stickyRows[ i ].$row.removeClass( 'sticky' );
this.stickyRows[ i ].$rowGap.css( 'height', null );
}
}
// Handling waypoints
for ( var i = 0; i < this.waypoints.length; i ++ ) {
if ( this.waypoints[ i ].scrollPos < scrollTop ) {
this.waypoints[ i ].fn( this.waypoints[ i ].$elm );
this.waypoints.splice( i, 1 );
i --;
}
}
},
/**
* Resize handler
*/
resize: function() {
// Delaying the resize event to prevent glitches
setTimeout( function() {
this._countAllPositions();
this.scroll();
}.bind( this ), 150 );
this._countAllPositions();
this.scroll();
}
};
$( function() {
$us.scroll = new USScroll( $us.scrollOptions || {} );
} );
}( jQuery );
+37
View File
@@ -0,0 +1,37 @@
!function($){"use strict";function USScroll(options){var defaults={attachOnInit:'.menu-item a[href*="#"], .menu-item[href*="#"], a.w-btn[href*="#"], .w-text a[href*="#"], '+'.vc_icon_element a[href*="#"], .vc_custom_heading a[href*="#"], a.w-grid-item-anchor[href*="#"], .w-toplink, '+'.w-image a[href*="#"], .w-iconbox a[href*="#"], .w-comments-title a[href*="#"], a.smooth-scroll[href*="#"]',buttonActiveClass:'active',menuItemActiveClass:'current-menu-item',menuItemAncestorActiveClass:'current-menu-ancestor',animationDuration:$us.canvasOptions.scrollDuration,animationEasing:'easeInOutExpo'};this.options=$.extend({},defaults,options||{});this.blocks={};this.isScrolling=!1;this.waypoints=[];this.stickyRows=[];this._events={cancel:this.cancel.bind(this),scroll:this.scroll.bind(this),resize:this.resize.bind(this)};this._canvasTopOffset=0;$us.$window.on('resize load',this._events.resize);setTimeout(this._events.resize,75);$us.$window.on('scroll',this._events.scroll);setTimeout(this._events.scroll,75);if(this.options.attachOnInit){this.attach(this.options.attachOnInit)}
$('.l-section.type_sticky').each(function(key,row){var $row=$(row),$rowGap=$row.next('.l-section-gap'),stickyRow={$row:$row,$rowGap:$rowGap};this._countStickyRow(stickyRow);this.stickyRows.push(stickyRow)}.bind(this));$us.$canvas.on('contentChange',this._countAllPositions.bind(this));if(document.location.hash&&document.location.hash.indexOf('#!')==-1){var hash=document.location.hash,scrollPlace=(this.blocks[hash]!==undefined)?hash:undefined;if(scrollPlace===undefined){try{var $target=$(hash);if($target.length!=0){scrollPlace=$target}}
catch(error){}}
if(scrollPlace!==undefined){var keepScrollPositionTimer=setInterval(function(){this.scrollTo(scrollPlace)}.bind(this),100);var clearHashEvents=function(){setTimeout(function(){clearInterval(keepScrollPositionTimer);$us.canvas.resize();this._countAllPositions();this.scrollTo(scrollPlace)}.bind(this),100);$us.$window.off('load touchstart mousewheel DOMMouseScroll touchstart',clearHashEvents)}.bind(this);$us.$window.on('load touchstart mousewheel DOMMouseScroll touchstart',clearHashEvents)}}}
USScroll.prototype={_countPosition:function(hash){var targetTop=this.blocks[hash].target.offset().top;if(this.blocks[hash].target.is('.l-section.sticky')){this.blocks[hash].target.removeClass('sticky');targetTop=this.blocks[hash].target.offset().top;this.blocks[hash].target.addClass('sticky')}
this.blocks[hash].top=Math.ceil(targetTop-this._canvasTopOffset);if($us.header.headerTop===undefined||($us.header.headerTop>0&&targetTop>$us.header.headerTop)){this.blocks[hash].top=this.blocks[hash].top-$us.header.scrolledOccupiedHeight}
if(this.stickyRows[0]!==undefined&&window.innerWidth>this.stickyRows[0].disableWidth&&targetTop>this.stickyRows[0].originalTop){this.blocks[hash].top=this.blocks[hash].top-this.stickyRows[0].height}
this.blocks[hash].bottom=this.blocks[hash].top+this.blocks[hash].target.outerHeight(!1)},_countAllPositions:function(){this._canvasTopOffset=$us.$canvas.offset().top;for(var i=0;i<this.stickyRows.length;i ++){this._countStickyRow(this.stickyRows[i])}
for(var hash in this.blocks){if(!this.blocks.hasOwnProperty(hash)){continue}
this._countPosition(hash)}
for(var i=0;i<this.waypoints.length;i ++){this._countWaypoint(this.waypoints[i])}},_indicatePosition:function(activeHash){var activeMenuAncestors=[];for(var hash in this.blocks){if(!this.blocks.hasOwnProperty(hash)){continue}
if(this.blocks[hash].buttons!==undefined){this.blocks[hash].buttons.toggleClass(this.options.buttonActiveClass,hash===activeHash)}
if(this.blocks[hash].menuItems!==undefined){this.blocks[hash].menuItems.toggleClass(this.options.menuItemActiveClass,hash===activeHash)}
if(this.blocks[hash].menuAncestors!==undefined){this.blocks[hash].menuAncestors.removeClass(this.options.menuItemAncestorActiveClass)}}
if(this.blocks[activeHash]!==undefined&&this.blocks[activeHash].menuAncestors!==undefined){this.blocks[activeHash].menuAncestors.addClass(this.options.menuItemAncestorActiveClass)}},attach:function(anchors){var locationPattern=new RegExp('^'+location.pathname.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")+'#');var $anchors=$(anchors);if($anchors.length==0){return}
$anchors.each(function(index,anchor){var $anchor=$(anchor),href=$anchor.attr('href'),hash=$anchor.prop('hash');if(hash.indexOf('#!')!=-1){return}
if(!(href.charAt(0)=='#'||(href.charAt(0)=='/'&&locationPattern.test(href))||href.indexOf(location.host+location.pathname+'#')>-1)){return}
if(hash!=''&&hash!='#'){if(this.blocks[hash]===undefined){var $target=$(hash),$type='';if($target.length==0){return}
if($target.hasClass('g-cols')&&$target.parent().children().length==1){$target=$target.closest('.l-section')}
if($target.hasClass('w-tabs-section')){var $newTarget=$target.closest('.w-tabs');if(!$newTarget.hasClass('accordion')){$target=$newTarget;$type='tab'}}
this.blocks[hash]={target:$target,type:$type};this._countPosition(hash)}
if($anchor.parent().length>0&&$anchor.parent().hasClass('menu-item')){var $menuIndicator=$anchor.closest('.menu-item');this.blocks[hash].menuItems=(this.blocks[hash].menuItems||$()).add($menuIndicator);var $menuAncestors=$menuIndicator.parents('.menu-item-has-children');if($menuAncestors.length>0){this.blocks[hash].menuAncestors=(this.blocks[hash].menuAncestors||$()).add($menuAncestors)}}else{this.blocks[hash].buttons=(this.blocks[hash].buttons||$()).add($anchor)}}
$anchor.on('click',function(event){event.preventDefault();this.scrollTo(hash,!0);if(typeof this.blocks[hash]!=='undefined'){if(this.blocks[hash].type=='tab'){var $linkedSection=this.blocks[hash].target.find('.w-tabs-section[id="'+hash.substr(1)+'"]');if($linkedSection.length&&(!$linkedSection.hasClass('active'))){var $header=$linkedSection.find('.w-tabs-section-header');$header.click()}}}}.bind(this))}.bind(this))},scrollTo:function(place,animate){var placeType,newY;if(place==''||place=='#'){newY=0;placeType='top'}
else if(this.blocks[place]!==undefined){newY=this.blocks[place].top;placeType='hash'}else if(place instanceof $){if(place.hasClass('w-tabs-section')){var newPlace=place.closest('.w-tabs');if(!newPlace.hasClass('accordion')){place=newPlace}}
newY=Math.floor(place.offset().top-this._canvasTopOffset);if($us.header.headerTop===undefined||($us.header.headerTop>0&&place.offset().top>$us.header.headerTop)){newY=newY-$us.header.scrolledOccupiedHeight}
placeType='element'}else{newY=Math.floor(place-this._canvasTopOffset);if($us.header.headerTop===undefined||($us.header.headerTop>0&&place>$us.header.headerTop)){newY=newY-$us.header.scrolledOccupiedHeight}}
var indicateActive=function(){if(placeType=='hash'){this._indicatePosition(place)}else{this.scroll()}}.bind(this);if(animate){this.isScrolling=!0;if(navigator.userAgent.match(/iPad/i)!=null&&$('.us_iframe').length&&placeType=='hash'){$(place)[0].scrollIntoView({behavior:"smooth",block:"start"})}
$us.$htmlBody.stop(!0,!1).animate({scrollTop:newY+'px'},{duration:this.options.animationDuration,easing:this.options.animationEasing,always:function(){$us.$window.off('keydown mousewheel DOMMouseScroll touchstart',this._events.cancel);this.isScrolling=!1;indicateActive()}.bind(this)});$us.$window.on('keydown mousewheel DOMMouseScroll touchstart',this._events.cancel)}else{$us.$htmlBody.stop(!0,!1).scrollTop(newY);indicateActive()}},cancel:function(){$us.$htmlBody.stop(!0,!1)},addWaypoint:function($elm,offset,fn){$elm=($elm instanceof $)?$elm:$($elm);if($elm.length==0){return}
if(typeof offset!='string'||offset.indexOf('%')==-1){offset=parseInt(offset)}
var waypoint={$elm:$elm,offset:offset,fn:fn};this._countWaypoint(waypoint);this.waypoints.push(waypoint)},_countWaypoint:function(waypoint){var elmTop=waypoint.$elm.offset().top,winHeight=$us.$window.height();if(typeof waypoint.offset=='number'){waypoint.scrollPos=elmTop-winHeight+waypoint.offset}else{waypoint.scrollPos=elmTop-winHeight+winHeight*parseInt(waypoint.offset)/100}},_countStickyRow:function(stickyRow){var isSticky=!1;if(stickyRow.$row.hasClass('sticky')){isSticky=!0;stickyRow.$row.removeClass('sticky')}
stickyRow.disableWidth=(stickyRow.$row.data('sticky-disable-width')!==undefined)?stickyRow.$row.data('sticky-disable-width'):900;stickyRow.originalTop=stickyRow.$row.offset().top;stickyRow.top=stickyRow.$row.offset().top-this._canvasTopOffset;if($us.header.headerTop===undefined||($us.header.headerTop>0&&stickyRow.top>$us.header.headerTop)){stickyRow.top=stickyRow.top-$us.header.scrolledOccupiedHeight}
stickyRow.height=stickyRow.$row.outerHeight();if(stickyRow.$row.is('.l-main .l-section:first-child')){stickyRow.height=stickyRow.height-parseInt(stickyRow.$row.css('padding-top'))}
if(isSticky){stickyRow.$row.addClass('sticky')}},scroll:function(){var scrollTop=parseInt($us.$window.scrollTop());if(!this.isScrolling){var activeHash;for(var hash in this.blocks){if(!this.blocks.hasOwnProperty(hash)){continue}
if(scrollTop>=(this.blocks[hash].top-1)&&scrollTop<(this.blocks[hash].bottom-1)){activeHash=hash;break}}
this._indicatePosition(activeHash)}
for(var i=0;i<this.stickyRows.length;i ++){if(this.stickyRows[i].top<scrollTop&&window.innerWidth>this.stickyRows[i].disableWidth){this.stickyRows[i].$row.addClass('sticky');this.stickyRows[i].$rowGap.css('height',this.stickyRows[i].height)}else{this.stickyRows[i].$row.removeClass('sticky');this.stickyRows[i].$rowGap.css('height',null)}}
for(var i=0;i<this.waypoints.length;i ++){if(this.waypoints[i].scrollPos<scrollTop){this.waypoints[i].fn(this.waypoints[i].$elm);this.waypoints.splice(i,1);i --}}},resize:function(){setTimeout(function(){this._countAllPositions();this.scroll()}.bind(this),150);this._countAllPositions();this.scroll()}};$(function(){$us.scroll=new USScroll($us.scrollOptions||{})})}(jQuery)
@@ -0,0 +1,252 @@
/**
* UpSolution Element: Counter
*/
! function( $ ) {
/**
* Counter Number part animations
* @param container
* @constructor
*/
var USCounterNumber = function( container ) {
this.$container = $( container );
this.initialString = this.$container.html() + '';
this.finalString = this.$container.data( 'final' ) + '';
this.format = this.getFormat( this.initialString, this.finalString );
if ( this.format.decMark ) {
var pattern = new RegExp( '[^0-9\/' + this.format.decMark + ']+', 'g' );
this.initial = parseFloat( this.initialString.replace( pattern, '' ).replace( this.format.decMark, '.' ) );
this.final = parseFloat( this.finalString.replace( pattern, '' ).replace( this.format.decMark, '.' ) );
} else {
this.initial = parseInt( this.initialString.replace( /[^0-9]+/g, '' ) );
this.final = parseInt( this.finalString.replace( /[^0-9]+/g, '' ) );
}
if ( this.format.accounting ) {
if ( this.initialString.length > 0 && this.initialString[ 0 ] == '(' ) {
this.initial = - this.initial;
}
if ( this.finalString.length > 0 && this.finalString[ 0 ] == '(' ) {
this.final = - this.final;
}
}
};
USCounterNumber.prototype = {
/**
* Function to be called at each animation frame
* @param now float Relative state between 0 and 1
*/
step: function( now ) {
var value = ( 1 - now ) * this.initial + this.final * now,
intPart = Math[ this.format.decMark ? 'floor' : 'round' ]( value ).toString(),
result = '';
if ( this.format.zerofill ) {
intPart = '0'.repeat( this.format.intDigits - intPart.length ) + intPart;
}
if ( this.format.groupMark ) {
if ( this.format.indian ) {
result += intPart.replace( /(\d)(?=(\d\d)+\d$)/g, '$1' + this.format.groupMark );
} else {
result += intPart.replace( /\B(?=(\d{3})+(?!\d))/g, this.format.groupMark );
}
} else {
result += intPart;
}
if ( this.format.decMark ) {
var decimalPart = ( value % 1 ).toFixed( this.format.decDigits ).substring( 2 );
result += this.format.decMark + decimalPart;
}
if ( this.format.accounting && result.length > 0 && result[ 0 ] == '-' ) {
result = '(' + result.substring( 1 ) + ')';
}
this.$container.html( result );
},
/**
* Get number format based on initial and final number strings
* @param initial string
* @param final string
* @returns {{groupMark, decMark, accounting, zerofill, indian}}
*/
getFormat: function( initial, final ) {
var iFormat = this._getFormat( initial ),
fFormat = this._getFormat( final ),
// Final format has more priority
format = $.extend( {}, iFormat, fFormat );
// Group marks detector is more precise, so using it in controversial cases
if ( format.groupMark == format.decMark ) {
delete format.groupMark;
}
return format;
},
/**
* Get number format based on a single number string
* @param str string
* @returns {{groupMark, decMark, accounting, zerofill, indian}}
* @private
*/
_getFormat: function( str ) {
var marks = str.replace( /[0-9\(\)\-]+/g, '' ),
format = {};
if ( str.charAt( 0 ) == '(' ) {
format.accounting = true;
}
if ( /^0[0-9]/.test( str ) ) {
format.zerofill = true;
}
str = str.replace( /[\(\)\-]/g, '' );
if ( marks.length != 0 ) {
if ( marks.length > 1 ) {
format.groupMark = marks.charAt( 0 );
if ( marks.charAt( 0 ) != marks.charAt( marks.length - 1 ) ) {
format.decMark = marks.charAt( marks.length - 1 );
}
if ( str.split( format.groupMark ).length > 2 && str.split( format.groupMark )[ 1 ].length == 2 ) {
format.indian = true;
}
} else/*if (marks.length == 1)*/ {
format[ ( ( str.length - str.indexOf( marks ) - 1 ) == 3 ) ? 'groupMark' : 'decMark' ] = marks;
}
if ( format.decMark ) {
format.decDigits = str.length - str.indexOf( format.decMark ) - 1;
}
}
if ( format.zerofill ) {
format.intDigits = str.replace( /[^\d]+/g, '' ).length - ( format.decDigits || 0 );
}
return format;
}
};
/**
* Counter Number part animations
* @param container
* @constructor
*/
var USCounterText = function( container ) {
this.$container = $( container );
this.initial = this.$container.text() + '';
this.final = this.$container.data( 'final' ) + '';
this.partsStates = this.getStates( this.initial, this.final );
this.len = 1 / ( this.partsStates.length - 1 );
// Text value won't be changed on each frame, so we'll update it only on demand
this.curState = 0;
};
USCounterText.prototype = {
/**
* Function to be called at each animation frame
* @param now float Relative state between 0 and 1
*/
step: function( now ) {
var state = Math.round( Math.max( 0, now / this.len ) );
if ( state == this.curState ) {
return;
}
this.$container.html( this.partsStates[ state ] );
this.curState = state;
},
/**
* Slightly modified Wagner-Fischer algorithm to obtain the shortest edit distance with intermediate states
* @param initial string The initial string
* @param final string The final string
* @returns {Array}
* @private
*/
getStates: function( initial, final ) {
var dist = [],
i, j;
for ( i = 0; i <= initial.length; i ++ ) {
dist[ i ] = [ i ];
}
for ( j = 1; j <= final.length; j ++ ) {
dist[ 0 ][ j ] = j;
for ( i = 1; i <= initial.length; i ++ ) {
dist[ i ][ j ] = ( initial[ i - 1 ] === final[ j - 1 ] ) ? dist[ i - 1 ][ j - 1 ] : ( Math.min( dist[ i - 1 ][ j ], dist[ i ][ j - 1 ], dist[ i - 1 ][ j - 1 ] ) + 1 );
}
}
// Obtaining the intermediate states
var states = [ final ];
for ( i = initial.length, j = final.length; i > 0 || j > 0; i --, j -- ) {
var min = dist[ i ][ j ];
if ( i > 0 ) {
min = Math.min( min, dist[ i - 1 ][ j ], ( j > 0 ) ? dist[ i - 1 ][ j - 1 ] : min );
}
if ( j > 0 ) {
min = Math.min( min, dist[ i ][ j - 1 ] );
}
if ( min >= dist[ i ][ j ] ) {
continue;
}
if ( min == dist[ i ][ j - 1 ] ) {
// Remove
states.unshift( states[ 0 ].substring( 0, j - 1 ) + states[ 0 ].substring( j ) );
i ++;
} else if ( min == dist[ i - 1 ][ j - 1 ] ) {
// Modify
states.unshift( states[ 0 ].substring( 0, j - 1 ) + initial[ i - 1 ] + states[ 0 ].substring( j ) );
} else if ( min == dist[ i - 1 ][ j ] ) {
// Insert
states.unshift( states[ 0 ].substring( 0, j ) + initial[ i - 1 ] + states[ 0 ].substring( j ) );
j ++;
}
}
return states;
}
};
/**
*
* @param container
* @constructor
*/
var USCounter = function( container ) {
// Commonly used DOM elements
this.$container = $( container );
this.parts = [];
this.duration = parseInt( this.$container.data( 'duration' ) || 2000 );
this.$container.find( '.w-counter-value-part' ).each( function( index, part ) {
var $part = $( part );
// Skipping the ones that won't be changed
if ( $part.html() + '' == $part.data( 'final' ) + '' ) {
return;
}
var type = $part.usMod( 'type' );
if ( type == 'number' ) {
this.parts.push( new USCounterNumber( $part ) );
} else {
this.parts.push( new USCounterText( $part ) );
}
}.bind( this ) );
if ( window.$us !== undefined && window.$us.scroll !== undefined ) {
// Animate element when it becomes visible
$us.scroll.addWaypoint( this.$container, '15%', this.animate.bind( this ) );
} else {
// No waypoints available: animate right from the start
this.animate();
}
};
USCounter.prototype = {
animate: function( duration ) {
this.$container.css( 'w-counter', 0 ).animate( { 'w-counter': 1 }, {
duration: this.duration,
step: this.step.bind( this )
} );
},
/**
* Function to be called at each animation frame
* @param now float Relative state between 0 and 1
*/
step: function( now ) {
for ( var i = 0; i < this.parts.length; i ++ ) {
this.parts[ i ].step( now );
}
}
};
$.fn.wCounter = function( options ) {
return this.each( function() {
$( this ).data( 'wItext', new USCounter( this, options ) );
} );
};
$( function() {
$( '.w-counter' ).wCounter();
} );
}( jQuery );
@@ -0,0 +1,22 @@
!function($){var USCounterNumber=function(container){this.$container=$(container);this.initialString=this.$container.html()+'';this.finalString=this.$container.data('final')+'';this.format=this.getFormat(this.initialString,this.finalString);if(this.format.decMark){var pattern=new RegExp('[^0-9\/'+this.format.decMark+']+','g');this.initial=parseFloat(this.initialString.replace(pattern,'').replace(this.format.decMark,'.'));this.final=parseFloat(this.finalString.replace(pattern,'').replace(this.format.decMark,'.'))}else{this.initial=parseInt(this.initialString.replace(/[^0-9]+/g,''));this.final=parseInt(this.finalString.replace(/[^0-9]+/g,''))}
if(this.format.accounting){if(this.initialString.length>0&&this.initialString[0]=='('){this.initial=-this.initial}
if(this.finalString.length>0&&this.finalString[0]=='('){this.final=-this.final}}};USCounterNumber.prototype={step:function(now){var value=(1-now)*this.initial+this.final*now,intPart=Math[this.format.decMark?'floor':'round'](value).toString(),result='';if(this.format.zerofill){intPart='0'.repeat(this.format.intDigits-intPart.length)+intPart}
if(this.format.groupMark){if(this.format.indian){result+=intPart.replace(/(\d)(?=(\d\d)+\d$)/g,'$1'+this.format.groupMark)}else{result+=intPart.replace(/\B(?=(\d{3})+(?!\d))/g,this.format.groupMark)}}else{result+=intPart}
if(this.format.decMark){var decimalPart=(value%1).toFixed(this.format.decDigits).substring(2);result+=this.format.decMark+decimalPart}
if(this.format.accounting&&result.length>0&&result[0]=='-'){result='('+result.substring(1)+')'}
this.$container.html(result)},getFormat:function(initial,final){var iFormat=this._getFormat(initial),fFormat=this._getFormat(final),format=$.extend({},iFormat,fFormat);if(format.groupMark==format.decMark){delete format.groupMark}
return format},_getFormat:function(str){var marks=str.replace(/[0-9\(\)\-]+/g,''),format={};if(str.charAt(0)=='('){format.accounting=!0}
if(/^0[0-9]/.test(str)){format.zerofill=!0}
str=str.replace(/[\(\)\-]/g,'');if(marks.length!=0){if(marks.length>1){format.groupMark=marks.charAt(0);if(marks.charAt(0)!=marks.charAt(marks.length-1)){format.decMark=marks.charAt(marks.length-1)}
if(str.split(format.groupMark).length>2&&str.split(format.groupMark)[1].length==2){format.indian=!0}}else{format[((str.length-str.indexOf(marks)-1)==3)?'groupMark':'decMark']=marks}
if(format.decMark){format.decDigits=str.length-str.indexOf(format.decMark)-1}}
if(format.zerofill){format.intDigits=str.replace(/[^\d]+/g,'').length-(format.decDigits||0)}
return format}};var USCounterText=function(container){this.$container=$(container);this.initial=this.$container.text()+'';this.final=this.$container.data('final')+'';this.partsStates=this.getStates(this.initial,this.final);this.len=1/(this.partsStates.length-1);this.curState=0};USCounterText.prototype={step:function(now){var state=Math.round(Math.max(0,now/this.len));if(state==this.curState){return}
this.$container.html(this.partsStates[state]);this.curState=state},getStates:function(initial,final){var dist=[],i,j;for(i=0;i<=initial.length;i ++){dist[i]=[i]}
for(j=1;j<=final.length;j ++){dist[0][j]=j;for(i=1;i<=initial.length;i ++){dist[i][j]=(initial[i-1]===final[j-1])?dist[i-1][j-1]:(Math.min(dist[i-1][j],dist[i][j-1],dist[i-1][j-1])+1)}}
var states=[final];for(i=initial.length,j=final.length;i>0||j>0;i --,j --){var min=dist[i][j];if(i>0){min=Math.min(min,dist[i-1][j],(j>0)?dist[i-1][j-1]:min)}
if(j>0){min=Math.min(min,dist[i][j-1])}
if(min>=dist[i][j]){continue}
if(min==dist[i][j-1]){states.unshift(states[0].substring(0,j-1)+states[0].substring(j));i ++}else if(min==dist[i-1][j-1]){states.unshift(states[0].substring(0,j-1)+initial[i-1]+states[0].substring(j))}else if(min==dist[i-1][j]){states.unshift(states[0].substring(0,j)+initial[i-1]+states[0].substring(j));j ++}}
return states}};var USCounter=function(container){this.$container=$(container);this.parts=[];this.duration=parseInt(this.$container.data('duration')||2000);this.$container.find('.w-counter-value-part').each(function(index,part){var $part=$(part);if($part.html()+''==$part.data('final')+''){return}
var type=$part.usMod('type');if(type=='number'){this.parts.push(new USCounterNumber($part))}else{this.parts.push(new USCounterText($part))}}.bind(this));if(window.$us!==undefined&&window.$us.scroll!==undefined){$us.scroll.addWaypoint(this.$container,'15%',this.animate.bind(this))}else{this.animate()}};USCounter.prototype={animate:function(duration){this.$container.css('w-counter',0).animate({'w-counter':1},{duration:this.duration,step:this.step.bind(this)})},step:function(now){for(var i=0;i<this.parts.length;i ++){this.parts[i].step(now)}}};$.fn.wCounter=function(options){return this.each(function(){$(this).data('wItext',new USCounter(this,options))})};$(function(){$('.w-counter').wCounter()})}(jQuery)
@@ -0,0 +1,80 @@
/**
* UpSolution Element: Dropdown
*/
( function( $ ) {
"use strict";
$.fn.wDropdown = function() {
return this.each( function() {
var $this = $( this ),
$list = $this.find( '.w-dropdown-list' ),
$current = $this.find( '.w-dropdown-current' ),
$currentAnchor = $current.find( 'a' ),
$anchors = $this.find( 'a' ),
openEventName = 'click',
closeEventName = 'mouseup touchstart mousewheel DOMMouseScroll touchstart',
justOpened = false;
if ( $this.hasClass( 'open_on_hover' ) ) {
openEventName = 'mouseenter';
closeEventName = 'mouseleave';
}
var closeList = function() {
$this.removeClass( 'opened' );
$us.$window.off( closeEventName, closeListEvent );
};
var closeListEvent = function( e ) {
if ( closeEventName != 'mouseleave' && $this.has( e.target ).length !== 0 ) {
return;
}
e.stopPropagation();
e.preventDefault();
closeList();
};
var openList = function() {
$this.addClass( 'opened' );
if ( closeEventName == 'mouseleave' ) {
$this.on( closeEventName, closeListEvent );
} else {
$us.$window.on( closeEventName, closeListEvent );
}
justOpened = true;
window.setTimeout( function() {
justOpened = false;
}, 500 );
};
var openListEvent = function( e ) {
if ( openEventName == 'click' && $this.hasClass( 'opened' ) && ! justOpened ) {
closeList();
return;
}
openList();
};
$current.on( openEventName, openListEvent );
$anchors.on( 'focus.upsolution', function() {
openList();
} );
$this.on( 'keydown', function( e ) {
var keyCode = e.keyCode || e.which;
if ( keyCode == 9 ) {
var $target = $( e.target ) ? $( e.target ) : {},
index = $anchors.index( $target );
if ( e.shiftKey ) {
if ( index === 0 ) {
closeList();
}
} else {
if ( index === $anchors.length - 1 ) {
closeList();
}
}
}
} );
} );
};
$( function() {
$( '.w-dropdown' ).wDropdown();
} );
} )( jQuery );
@@ -0,0 +1,5 @@
(function($){"use strict";$.fn.wDropdown=function(){return this.each(function(){var $this=$(this),$list=$this.find('.w-dropdown-list'),$current=$this.find('.w-dropdown-current'),$currentAnchor=$current.find('a'),$anchors=$this.find('a'),openEventName='click',closeEventName='mouseup touchstart mousewheel DOMMouseScroll touchstart',justOpened=!1;if($this.hasClass('open_on_hover')){openEventName='mouseenter';closeEventName='mouseleave'}
var closeList=function(){$this.removeClass('opened');$us.$window.off(closeEventName,closeListEvent)};var closeListEvent=function(e){if(closeEventName!='mouseleave'&&$this.has(e.target).length!==0){return}
e.stopPropagation();e.preventDefault();closeList()};var openList=function(){$this.addClass('opened');if(closeEventName=='mouseleave'){$this.on(closeEventName,closeListEvent)}else{$us.$window.on(closeEventName,closeListEvent)}
justOpened=!0;window.setTimeout(function(){justOpened=!1},500)};var openListEvent=function(e){if(openEventName=='click'&&$this.hasClass('opened')&&!justOpened){closeList();return}
openList()};$current.on(openEventName,openListEvent);$anchors.on('focus.upsolution',function(){openList()});$this.on('keydown',function(e){var keyCode=e.keyCode||e.which;if(keyCode==9){var $target=$(e.target)?$(e.target):{},index=$anchors.index($target);if(e.shiftKey){if(index===0){closeList()}}else{if(index===$anchors.length-1){closeList()}}}})})};$(function(){$('.w-dropdown').wDropdown()})})(jQuery)
@@ -0,0 +1,146 @@
/**
* UpSolution Element: FlipBox
*/
! function( $ ) {
"use strict";
$us.WFlipBox = function( container ) {
// Common dom elements
this.$container = $( container );
this.$front = this.$container.find( '.w-flipbox-front' );
this.$frontH = this.$container.find( '.w-flipbox-front-h' );
this.$back = this.$container.find( '.w-flipbox-back' );
this.$backH = this.$container.find( '.w-flipbox-back-h' );
this.$btn = this.$container.find( '.w-btn' );
// Simplified animation for IE11
if ( ! ! window.MSInputMethodContext && ! ! document.documentMode ) {
this.$container.usMod( 'animation', 'cardflip' ).find( '.w-flipbox-h' ).css( {
'transition-duration': '0s',
'-webkit-transition-duration': '0s'
} );
}
// In chrome cube flip animation makes button not clickable. Replacing it with cube tilt
var isWebkit = 'WebkitAppearance' in document.documentElement.style;
if ( isWebkit && this.$container.usMod( 'animation' ) === 'cubeflip' && this.$btn.length ) {
this.$container.usMod( 'animation', 'cubetilt' );
}
// For diagonal cube animations height should equal width (heometrical restriction)
var animation = this.$container.usMod( 'animation' ),
direction = this.$container.usMod( 'direction' );
this.forceSquare = ( animation == 'cubeflip' && [ 'ne', 'se', 'sw', 'nw' ].indexOf( direction ) != - 1 );
// Container height is determined by the maximum content height
this.autoSize = ( this.$front[ 0 ].style.height == '' && ! this.forceSquare );
// Content is centered
this.centerContent = ( this.$container.usMod( 'valign' ) == 'center' );
if ( this._events === undefined ) {
this._events = {};
}
$.extend( this._events, {
resize: this.resize.bind( this )
} );
if ( this.centerContent || this.autoSize ) {
this.padding = parseInt( this.$front.css( 'padding-top' ) );
}
if ( this.centerContent || this.forceSquare || this.autoSize ) {
$us.$window.bind( 'resize load', this._events.resize );
this.resize();
}
this.makeHoverable( '.w-btn' );
// Fixing css3 animations rendering glitch on page load
setTimeout( function() {
this.$back.css( 'display', '' );
this.resize();
}.bind( this ), 250 );
};
$us.WFlipBox.prototype = {
resize: function() {
var width = this.$container.width(),
height;
if ( this.autoSize || this.centerContent ) {
var frontContentHeight = this.$frontH.height(),
backContentHeight = this.$backH.height();
}
// Changing the whole container height
if ( this.forceSquare || this.autoSize ) {
height = this.forceSquare ? width : ( Math.max( frontContentHeight, backContentHeight ) + 2 * this.padding );
this.$front.css( 'height', height + 'px' );
} else {
height = this.$container.height();
}
if ( this.centerContent ) {
this.$front.css( 'padding-top', Math.max( this.padding, ( height - frontContentHeight ) / 2 ) );
this.$back.css( 'padding-top', Math.max( this.padding, ( height - backContentHeight ) / 2 ) );
}
},
makeHoverable: function( exclude ) {
if ( this._events === undefined ) {
this._events = {};
}
if ( jQuery.isMobile ) {
// Mobile: Touch hover
this._events.touchHoverStart = function() {
this.$container.toggleClass( 'hover' );
}.bind( this );
this.$container.on( 'touchstart', this._events.touchHoverStart );
if ( exclude ) {
this._events.touchHoverPrevent = function( e ) {
e.stopPropagation();
};
this.$container.find( exclude ).on( 'touchstart', this._events.touchHoverPrevent );
}
} else {
// Desktop: Mouse hover
this._mouseInside = false;
this._focused = false;
$.extend( this._events, {
mouseHoverStart: function() {
this.$container.addClass( 'hover' );
this._mouseInside = true;
}.bind( this ),
mouseHoverEnd: function() {
if ( ! this._focused ) {
this.$container.removeClass( 'hover' );
}
this._mouseInside = false;
}.bind( this ),
focus: function() {
this.$container.addClass( 'hover' );
this._focused = true;
}.bind( this ),
blur: function() {
if ( ! this._mouseInside ) {
this.$container.removeClass( 'hover' );
}
this._focused = false;
}.bind( this )
} );
this.$container.on( 'mouseenter', this._events.mouseHoverStart );
this.$container.on( 'mouseleave', this._events.mouseHoverEnd );
this.$focusable = this.$container.find( 'a' ).addBack( 'a' );
this.$focusable.on( 'focus', this._events.focus );
this.$focusable.on( 'blur', this._events.blur );
}
}
};
$.fn.wFlipBox = function( options ) {
return this.each( function() {
$( this ).data( 'wFlipBox', new $us.WFlipBox( this, options ) );
} );
};
$( function() {
$( '.w-flipbox' ).wFlipBox();
} );
}( jQuery );
@@ -0,0 +1,11 @@
!function($){"use strict";$us.WFlipBox=function(container){this.$container=$(container);this.$front=this.$container.find('.w-flipbox-front');this.$frontH=this.$container.find('.w-flipbox-front-h');this.$back=this.$container.find('.w-flipbox-back');this.$backH=this.$container.find('.w-flipbox-back-h');this.$btn=this.$container.find('.w-btn');if(!!window.MSInputMethodContext&&!!document.documentMode){this.$container.usMod('animation','cardflip').find('.w-flipbox-h').css({'transition-duration':'0s','-webkit-transition-duration':'0s'})}
var isWebkit='WebkitAppearance' in document.documentElement.style;if(isWebkit&&this.$container.usMod('animation')==='cubeflip'&&this.$btn.length){this.$container.usMod('animation','cubetilt')}
var animation=this.$container.usMod('animation'),direction=this.$container.usMod('direction');this.forceSquare=(animation=='cubeflip'&&['ne','se','sw','nw'].indexOf(direction)!=-1);this.autoSize=(this.$front[0].style.height==''&&!this.forceSquare);this.centerContent=(this.$container.usMod('valign')=='center');if(this._events===undefined){this._events={}}
$.extend(this._events,{resize:this.resize.bind(this)});if(this.centerContent||this.autoSize){this.padding=parseInt(this.$front.css('padding-top'))}
if(this.centerContent||this.forceSquare||this.autoSize){$us.$window.bind('resize load',this._events.resize);this.resize()}
this.makeHoverable('.w-btn');setTimeout(function(){this.$back.css('display','');this.resize()}.bind(this),250)};$us.WFlipBox.prototype={resize:function(){var width=this.$container.width(),height;if(this.autoSize||this.centerContent){var frontContentHeight=this.$frontH.height(),backContentHeight=this.$backH.height()}
if(this.forceSquare||this.autoSize){height=this.forceSquare?width:(Math.max(frontContentHeight,backContentHeight)+2*this.padding);this.$front.css('height',height+'px')}else{height=this.$container.height()}
if(this.centerContent){this.$front.css('padding-top',Math.max(this.padding,(height-frontContentHeight)/2));this.$back.css('padding-top',Math.max(this.padding,(height-backContentHeight)/2))}},makeHoverable:function(exclude){if(this._events===undefined){this._events={}}
if(jQuery.isMobile){this._events.touchHoverStart=function(){this.$container.toggleClass('hover')}.bind(this);this.$container.on('touchstart',this._events.touchHoverStart);if(exclude){this._events.touchHoverPrevent=function(e){e.stopPropagation()};this.$container.find(exclude).on('touchstart',this._events.touchHoverPrevent)}}else{this._mouseInside=!1;this._focused=!1;$.extend(this._events,{mouseHoverStart:function(){this.$container.addClass('hover');this._mouseInside=!0}.bind(this),mouseHoverEnd:function(){if(!this._focused){this.$container.removeClass('hover')}
this._mouseInside=!1}.bind(this),focus:function(){this.$container.addClass('hover');this._focused=!0}.bind(this),blur:function(){if(!this._mouseInside){this.$container.removeClass('hover')}
this._focused=!1}.bind(this)});this.$container.on('mouseenter',this._events.mouseHoverStart);this.$container.on('mouseleave',this._events.mouseHoverEnd);this.$focusable=this.$container.find('a').addBack('a');this.$focusable.on('focus',this._events.focus);this.$focusable.on('blur',this._events.blur)}}};$.fn.wFlipBox=function(options){return this.each(function(){$(this).data('wFlipBox',new $us.WFlipBox(this,options))})};$(function(){$('.w-flipbox').wFlipBox()})}(jQuery)
@@ -0,0 +1,52 @@
/**
* UpSolution Element: Gallery
* Used for regular WordPress gallery design improvement
*/
jQuery( function( $ ) {
$( '.w-gallery.link_file .w-gallery-list' ).each( function() {
$us.getScript( $us.templateDirectoryUri + '/framework/js/vendor/magnific-popup.js', function() {
$( this ).magnificPopup( {
type: 'image',
delegate: 'a.w-gallery-item',
gallery: {
enabled: true,
navigateByImgClick: true,
preload: [ 0, 1 ],
tPrev: $us.langOptions.magnificPopup.tPrev, // Alt text on left arrow
tNext: $us.langOptions.magnificPopup.tNext, // Alt text on right arrow
tCounter: $us.langOptions.magnificPopup.tCounter // Markup for "1 of 7" counter
},
removalDelay: 300,
mainClass: 'mfp-fade',
fixedContentPos: true
} );
}.bind( this ) );
} );
// Applying isotope to gallery
$( '.w-gallery.type_masonry' ).each( function( index, gallery ) {
$us.getScript( $us.templateDirectoryUri + '/framework/js/vendor/isotope.js', function() {
var $container = $( $( gallery ).find( '.w-gallery-list' ) ),
isotopeOptions = {
layoutMode: 'masonry',
isOriginLeft: ! $( 'body' ).hasClass( 'rtl' )
};
if ( $container.parents( '.w-tabs-section-content-h' ).length ) {
isotopeOptions.transitionDuration = 0;
}
$container.imagesLoaded( function() {
$container.isotope( isotopeOptions );
$container.isotope();
} );
$us.$canvas.on( 'contentChange', function() {
$container.imagesLoaded( function() {
$container.isotope();
} );
} );
} );
} );
} );
@@ -0,0 +1,2 @@
jQuery(function($){$('.w-gallery.link_file .w-gallery-list').each(function(){$us.getScript($us.templateDirectoryUri+'/framework/js/vendor/magnific-popup.js',function(){$(this).magnificPopup({type:'image',delegate:'a.w-gallery-item',gallery:{enabled:!0,navigateByImgClick:!0,preload:[0,1],tPrev:$us.langOptions.magnificPopup.tPrev,tNext:$us.langOptions.magnificPopup.tNext,tCounter:$us.langOptions.magnificPopup.tCounter},removalDelay:300,mainClass:'mfp-fade',fixedContentPos:!0})}.bind(this))});$('.w-gallery.type_masonry').each(function(index,gallery){$us.getScript($us.templateDirectoryUri+'/framework/js/vendor/isotope.js',function(){var $container=$($(gallery).find('.w-gallery-list')),isotopeOptions={layoutMode:'masonry',isOriginLeft:!$('body').hasClass('rtl')};if($container.parents('.w-tabs-section-content-h').length){isotopeOptions.transitionDuration=0}
$container.imagesLoaded(function(){$container.isotope(isotopeOptions);$container.isotope()});$us.$canvas.on('contentChange',function(){$container.imagesLoaded(function(){$container.isotope()})})})})})
@@ -0,0 +1,215 @@
/**
* UpSolution Element: Google Maps
*
* Used for [us_gmaps] shortcode
*/
! function( $ ) {
"use strict";
$us.WMapsGeocodesCounter = 0; // counter of total geocode requests number
$us.WMapsGeocodesRunning = false;
$us.WMapsCurrentGeocode = 0; // current processing geocode
$us.WMapsGeocodesMax = 5; // max number of simultaneous geocode requests allowed
$us.WMapsGeocodesStack = {};
$us.WMapsRunGeoCode = function() {
if ( $us.WMapsCurrentGeocode <= $us.WMapsGeocodesCounter ) {
$us.WMapsGeocodesRunning = true;
if ( $us.WMapsGeocodesStack[ $us.WMapsCurrentGeocode ] != null ) {
$us.WMapsGeocodesStack[ $us.WMapsCurrentGeocode ]();
}
} else {
$us.WMapsGeocodesRunning = false;
}
};
$us.WMaps = function( container, options ) {
this.$container = $( container );
// Prevent double init
if ( this.$container.data( 'mapInit' ) == 1 ) {
return;
}
this.$container.data( 'mapInit', 1 );
var $jsonContainer = this.$container.find( '.w-map-json' ),
jsonOptions = $jsonContainer[ 0 ].onclick() || {},
$jsonStyleContainer = this.$container.find( '.w-map-style-json' ),
jsonStyleOptions,
shouldRunGeoCode = false;
$jsonContainer.remove();
if ( $jsonStyleContainer.length ) {
jsonStyleOptions = $jsonStyleContainer[ 0 ].onclick() || {};
$jsonStyleContainer.remove();
}
// Setting options
var defaults = {};
this.options = $.extend( {}, defaults, jsonOptions, options );
this._events = {
redraw: this.redraw.bind( this )
};
var gmapsOptions = {
el: '#' + this.$container.attr( 'id' ),
lat: 0,
lng: 0,
zoom: this.options.zoom,
type: this.options.type,
height: this.options.height + 'px',
width: '100%',
mapTypeId: google.maps.MapTypeId[ this.options.maptype ]
};
if ( this.options.hideControls ) {
gmapsOptions.disableDefaultUI = true;
}
if ( this.options.disableZoom ) {
gmapsOptions.scrollwheel = false;
}
if ( this.options.disableDragging && ( ! $us.$html.hasClass( 'no-touch' ) ) ) {
gmapsOptions.draggable = false;
}
if ( this.options.mapBgColor ) {
gmapsOptions.backgroundColor = this.options.mapBgColor;
}
this.GMapsObj = new GMaps( gmapsOptions );
if ( jsonStyleOptions != null && jsonStyleOptions != {} ) {
this.GMapsObj.map.setOptions( { styles: jsonStyleOptions } );
}
var matches = this.options.address.match( /^(-?\d+.\d+)\s?,?\s?(-?\d+.\d+)$/ ),
that = this;
if ( matches ) {
this.options.latitude = matches[ 1 ];
this.options.longitude = matches[ 2 ];
this.GMapsObj.setCenter( this.options.latitude, this.options.longitude );
} else {
var mapGeoCode = function() {
GMaps.geocode( {
address: that.options.address,
callback: function( results, status ) {
if ( status == 'OK' ) {
var latlng = results[ 0 ].geometry.location;
that.options.latitude = latlng.lat();
that.options.longitude = latlng.lng();
that.GMapsObj.setCenter( that.options.latitude, that.options.longitude );
$us.WMapsCurrentGeocode ++;
$us.WMapsRunGeoCode();
} else if ( status == "OVER_QUERY_LIMIT" ) {
setTimeout( function() {
$us.WMapsRunGeoCode()
}, 2000 );
}
}
} );
};
shouldRunGeoCode = true;
$us.WMapsGeocodesStack[ $us.WMapsGeocodesCounter ] = mapGeoCode;
$us.WMapsGeocodesCounter ++;
}
// Map Markers
$.each( this.options.markers, function( i, val ) {
var markerOptions = {};
if ( that.options.icon != null || that.options.markers[ i ].marker_img != null ) {
var url, size, width, height;
if ( that.options.markers[ i ].marker_img != null ) {
url = that.options.markers[ i ].marker_img[ 0 ];
width = parseInt( that.options.markers[ i ].marker_size[ 0 ] );
height = parseInt( that.options.markers[ i ].marker_size[ 1 ] );
size = new google.maps.Size( width, height );
} else {
url = that.options.icon.url;
size = new google.maps.Size( that.options.icon.size[ 0 ], that.options.icon.size[ 1 ] );
}
markerOptions.icon = {
url: url,
size: size,
scaledSize: size,
};
}
if ( that.options.markers[ i ] != null ) {
var matches = that.options.markers[ i ].address.match( /^(-?\d+.\d+)\s?,?\s?(-?\d+.\d+)$/ );
if ( matches ) {
markerOptions.lat = matches[ 1 ];
markerOptions.lng = matches[ 2 ];
markerOptions.infoWindow = { content: that.options.markers[ i ].html };
var marker = that.GMapsObj.addMarker( markerOptions );
if ( that.options.markers[ i ].infowindow ) {
marker.infoWindow.open( that.GMapsObj.map, marker );
}
} else {
var markerGeoCode = function() {
GMaps.geocode( {
address: that.options.markers[ i ].address,
callback: function( results, status ) {
if ( status == 'OK' ) {
var latlng = results[ 0 ].geometry.location;
markerOptions.lat = latlng.lat();
markerOptions.lng = latlng.lng();
markerOptions.infoWindow = { content: that.options.markers[ i ].html };
var marker = that.GMapsObj.addMarker( markerOptions );
if ( that.options.markers[ i ].infowindow ) {
marker.infoWindow.open( that.GMapsObj.map, marker );
}
$us.WMapsCurrentGeocode ++;
$us.WMapsRunGeoCode();
} else if ( status == "OVER_QUERY_LIMIT" ) {
setTimeout( function() {
$us.WMapsRunGeoCode()
}, 2000 );
}
}
} );
};
shouldRunGeoCode = true;
$us.WMapsGeocodesStack[ $us.WMapsGeocodesCounter ] = markerGeoCode;
$us.WMapsGeocodesCounter ++;
}
}
} );
if ( shouldRunGeoCode && ( ! $us.WMapsGeocodesRunning ) ) {
$us.WMapsRunGeoCode();
}
$us.$canvas.on( 'contentChange', this._events.redraw );
// In case some toggler was opened before the actual page load
$us.$window.load( this._events.redraw );
};
$us.WMaps.prototype = {
// Fixing hidden and other breaking-cases maps
redraw: function() {
if ( this.$container.is( ':hidden' ) ) {
return;
}
this.GMapsObj.refresh();
if ( this.options.latitude != null && this.options.longitude != null ) {
this.GMapsObj.setCenter( this.options.latitude, this.options.longitude );
}
}
};
$.fn.wMaps = function( options ) {
return this.each( function() {
$( this ).data( 'wMaps', new $us.WMaps( this, options ) );
} );
};
$( function() {
var $wMap = $( '.w-map.provider_google' );
if ( $wMap.length ) {
$us.getScript( $us.templateDirectoryUri + '/framework/js/vendor/gmaps.js', function() {
$wMap.wMaps();
} );
}
} );
}( jQuery );
@@ -0,0 +1,14 @@
!function($){"use strict";$us.WMapsGeocodesCounter=0;$us.WMapsGeocodesRunning=!1;$us.WMapsCurrentGeocode=0;$us.WMapsGeocodesMax=5;$us.WMapsGeocodesStack={};$us.WMapsRunGeoCode=function(){if($us.WMapsCurrentGeocode<=$us.WMapsGeocodesCounter){$us.WMapsGeocodesRunning=!0;if($us.WMapsGeocodesStack[$us.WMapsCurrentGeocode]!=null){$us.WMapsGeocodesStack[$us.WMapsCurrentGeocode]()}}else{$us.WMapsGeocodesRunning=!1}};$us.WMaps=function(container,options){this.$container=$(container);if(this.$container.data('mapInit')==1){return}
this.$container.data('mapInit',1);var $jsonContainer=this.$container.find('.w-map-json'),jsonOptions=$jsonContainer[0].onclick()||{},$jsonStyleContainer=this.$container.find('.w-map-style-json'),jsonStyleOptions,shouldRunGeoCode=!1;$jsonContainer.remove();if($jsonStyleContainer.length){jsonStyleOptions=$jsonStyleContainer[0].onclick()||{};$jsonStyleContainer.remove()}
var defaults={};this.options=$.extend({},defaults,jsonOptions,options);this._events={redraw:this.redraw.bind(this)};var gmapsOptions={el:'#'+this.$container.attr('id'),lat:0,lng:0,zoom:this.options.zoom,type:this.options.type,height:this.options.height+'px',width:'100%',mapTypeId:google.maps.MapTypeId[this.options.maptype]};if(this.options.hideControls){gmapsOptions.disableDefaultUI=!0}
if(this.options.disableZoom){gmapsOptions.scrollwheel=!1}
if(this.options.disableDragging&&(!$us.$html.hasClass('no-touch'))){gmapsOptions.draggable=!1}
if(this.options.mapBgColor){gmapsOptions.backgroundColor=this.options.mapBgColor}
this.GMapsObj=new GMaps(gmapsOptions);if(jsonStyleOptions!=null&&jsonStyleOptions!={}){this.GMapsObj.map.setOptions({styles:jsonStyleOptions})}
var matches=this.options.address.match(/^(-?\d+.\d+)\s?,?\s?(-?\d+.\d+)$/),that=this;if(matches){this.options.latitude=matches[1];this.options.longitude=matches[2];this.GMapsObj.setCenter(this.options.latitude,this.options.longitude)}else{var mapGeoCode=function(){GMaps.geocode({address:that.options.address,callback:function(results,status){if(status=='OK'){var latlng=results[0].geometry.location;that.options.latitude=latlng.lat();that.options.longitude=latlng.lng();that.GMapsObj.setCenter(that.options.latitude,that.options.longitude);$us.WMapsCurrentGeocode ++;$us.WMapsRunGeoCode()}else if(status=="OVER_QUERY_LIMIT"){setTimeout(function(){$us.WMapsRunGeoCode()},2000)}}})};shouldRunGeoCode=!0;$us.WMapsGeocodesStack[$us.WMapsGeocodesCounter]=mapGeoCode;$us.WMapsGeocodesCounter ++}
$.each(this.options.markers,function(i,val){var markerOptions={};if(that.options.icon!=null||that.options.markers[i].marker_img!=null){var url,size,width,height;if(that.options.markers[i].marker_img!=null){url=that.options.markers[i].marker_img[0];width=parseInt(that.options.markers[i].marker_size[0]);height=parseInt(that.options.markers[i].marker_size[1]);size=new google.maps.Size(width,height)}else{url=that.options.icon.url;size=new google.maps.Size(that.options.icon.size[0],that.options.icon.size[1])}
markerOptions.icon={url:url,size:size,scaledSize:size,}}
if(that.options.markers[i]!=null){var matches=that.options.markers[i].address.match(/^(-?\d+.\d+)\s?,?\s?(-?\d+.\d+)$/);if(matches){markerOptions.lat=matches[1];markerOptions.lng=matches[2];markerOptions.infoWindow={content:that.options.markers[i].html};var marker=that.GMapsObj.addMarker(markerOptions);if(that.options.markers[i].infowindow){marker.infoWindow.open(that.GMapsObj.map,marker)}}else{var markerGeoCode=function(){GMaps.geocode({address:that.options.markers[i].address,callback:function(results,status){if(status=='OK'){var latlng=results[0].geometry.location;markerOptions.lat=latlng.lat();markerOptions.lng=latlng.lng();markerOptions.infoWindow={content:that.options.markers[i].html};var marker=that.GMapsObj.addMarker(markerOptions);if(that.options.markers[i].infowindow){marker.infoWindow.open(that.GMapsObj.map,marker)}
$us.WMapsCurrentGeocode ++;$us.WMapsRunGeoCode()}else if(status=="OVER_QUERY_LIMIT"){setTimeout(function(){$us.WMapsRunGeoCode()},2000)}}})};shouldRunGeoCode=!0;$us.WMapsGeocodesStack[$us.WMapsGeocodesCounter]=markerGeoCode;$us.WMapsGeocodesCounter ++}}});if(shouldRunGeoCode&&(!$us.WMapsGeocodesRunning)){$us.WMapsRunGeoCode()}
$us.$canvas.on('contentChange',this._events.redraw);$us.$window.load(this._events.redraw)};$us.WMaps.prototype={redraw:function(){if(this.$container.is(':hidden')){return}
this.GMapsObj.refresh();if(this.options.latitude!=null&&this.options.longitude!=null){this.GMapsObj.setCenter(this.options.latitude,this.options.longitude)}}};$.fn.wMaps=function(options){return this.each(function(){$(this).data('wMaps',new $us.WMaps(this,options))})};$(function(){var $wMap=$('.w-map.provider_google');if($wMap.length){$us.getScript($us.templateDirectoryUri+'/framework/js/vendor/gmaps.js',function(){$wMap.wMaps()})}})}(jQuery)
@@ -0,0 +1,592 @@
/**
* UpSolution Element: Grid
*/
( function( $ ) {
"use strict";
$us.WGrid = function( container, options ) {
this.init( container, options );
};
$us.WGrid.prototype = {
init: function( container, options ) {
// Commonly used dom elements
this.$container = $( container );
this.$filters = this.$container.find( '.g-filters-item' );
this.$list = this.$container.find( '.w-grid-list' );
this.$items = this.$container.find( '.w-grid-item' );
this.$pagination = this.$container.find( '.pagination' );
this.$loadmore = this.$container.find( '.g-loadmore' );
this.$preloader = this.$container.find( '.w-grid-preloader' );
this.curFilterTaxonomy = '';
this.paginationType = this.$pagination.length ? 'regular' : ( this.$loadmore.length ? 'ajax' : 'none' );
this.filterTaxonomyName = this.$list.data( 'filter_taxonomy_name' ) ? this.$list.data( 'filter_taxonomy_name' ) : 'category';
this.loading = false;
// Prevent double init
if ( this.$container.data( 'gridInit' ) == 1 ) {
return;
}
this.$container.data( 'gridInit', 1 );
var $jsonContainer = this.$container.find( '.w-grid-json' );
if ( $jsonContainer.length ) {
this.ajaxData = $jsonContainer[ 0 ].onclick() || {};
this.ajaxUrl = this.ajaxData.ajax_url || '';
$jsonContainer.remove();
}
this.carouselSettings = this.ajaxData.carousel_settings;
this.breakpoints = this.ajaxData.carousel_breakpoints || {};
if ( this.$list.hasClass( 'owl-carousel' ) ) {
$us.getScript( $us.templateDirectoryUri + '/framework/js/vendor/owl.carousel.js', function() {
this.carouselOptions = {
mouseDrag: ! jQuery.isMobile,
items: parseInt( this.carouselSettings.items ),
rtl: $( '.l-body' ).hasClass( 'rtl' ),
nav: this.carouselSettings.nav,
navElement: 'div',
navText: [ this.carouselSettings.navPrev, this.carouselSettings.navNext ],
dots: this.carouselSettings.dots,
loop: this.carouselSettings.center,
rewind: true,
center: this.carouselSettings.center,
autoplay: this.carouselSettings.autoplay,
autoplayTimeout: this.carouselSettings.timeout,
autoHeight: this.carouselSettings.autoHeight,
slideBy: this.carouselSettings.slideby,
smartSpeed: this.carouselSettings.speed,
slideTransition: this.carouselSettings.transition,
autoplayHoverPause: true,
responsive: this.breakpoints
};
if ( this.carouselSettings.autoplay == 1 ) {
this.carouselOptions.loop = 1;
}
if ( this.carouselSettings.smooth_play == 1 ) {
this.carouselOptions.slideTransition = 'linear';
this.carouselOptions.autoplaySpeed = this.carouselSettings.timeout;
this.carouselOptions.slideBy = 1;
this.carouselOptions.loop = 1;
}
this.$list.owlCarousel( this.carouselOptions );
this.$list.on('changed.owl.carousel', function(event) {
$(document).trigger('uslazyloadevent');
});
}.bind( this ) );
}
if ( this.$container.hasClass( 'popup_page' ) ) {
if ( this.ajaxData == undefined ) {
return;
}
this.lightboxTimer = null;
this.$lightboxOverlay = this.$container.find( '.l-popup-overlay' );
this.$lightboxWrap = this.$container.find( '.l-popup-wrap' );
this.$lightboxBox = this.$container.find( '.l-popup-box' );
this.$lightboxContent = this.$container.find( '.l-popup-box-content' );
this.$lightboxContentPreloader = this.$lightboxContent.find( '.g-preloader' );
this.$lightboxContentFrame = this.$container.find( '.l-popup-box-content-frame' );
this.$lightboxNextArrow = this.$container.find( '.l-popup-arrow.to_next' );
this.$lightboxPrevArrow = this.$container.find( '.l-popup-arrow.to_prev' );
this.$container.find( '.l-popup-closer' ).click( function() {
this.hideLightbox();
}.bind( this ) );
this.$container.find( '.l-popup-box' ).click( function() {
this.hideLightbox();
}.bind( this ) );
this.$container.find( '.l-popup-box-content' ).click( function( e ) {
e.stopPropagation();
}.bind( this ) );
this.originalURL = window.location.href;
this.lightboxOpened = false;
if ( this.$list.hasClass( 'owl-carousel' ) ) {
$us.getScript( $us.templateDirectoryUri + '/framework/js/vendor/owl.carousel.js', function() {
this.initLightboxAnchors();
}.bind( this ) );
} else {
this.initLightboxAnchors();
}
$( window ).on( 'resize', function() {
if ( this.lightboxOpened && $us.$window.width() < $us.canvasOptions.disableEffectsWidth ) {
this.hideLightbox();
}
}.bind( this ) );
}
if ( this.$list.hasClass( 'owl-carousel' ) ) {
return;
}
if ( this.paginationType != 'none' || this.$filters.length ) {
if ( this.ajaxData == undefined ) {
return;
}
this.templateVars = this.ajaxData.template_vars || {};
if ( this.filterTaxonomyName ) {
this.initialFilterTaxonomy = this.$list.data( 'filter_default_taxonomies' ) ? this.$list.data( 'filter_default_taxonomies' ).split( ',' ) : '';
this.curFilterTaxonomy = this.initialFilterTaxonomy;
}
this.curPage = this.ajaxData.current_page || 1;
this.perpage = this.ajaxData.perpage || this.$items.length;
this.infiniteScroll = this.ajaxData.infinite_scroll || 0;
}
if ( this.$container.hasClass( 'with_isotope' ) ) {
$us.getScript( $us.templateDirectoryUri + '/framework/js/vendor/isotope.js', function() {
this.$list.imagesLoaded( function() {
var smallestItemSelector,
isotopeOptions = {
itemSelector: '.w-grid-item',
layoutMode: ( this.$container.hasClass( 'isotope_fit_rows' ) ) ? 'fitRows' : 'masonry',
isOriginLeft: ! $( '.l-body' ).hasClass( 'rtl' )
};
if ( this.$list.find( '.size_1x1' ).length ) {
smallestItemSelector = '.size_1x1';
} else if ( this.$list.find( '.size_1x2' ).length ) {
smallestItemSelector = '.size_1x2';
} else if ( this.$list.find( '.size_2x1' ).length ) {
smallestItemSelector = '.size_2x1';
} else if ( this.$list.find( '.size_2x2' ).length ) {
smallestItemSelector = '.size_2x2';
}
if ( smallestItemSelector ) {
isotopeOptions.masonry = { columnWidth: smallestItemSelector };
}
this.$list.isotope( isotopeOptions );
this.$list.isotope();
if ( this.paginationType == 'ajax' ) {
this.initAjaxPagination();
}
$us.$canvas.on( 'lazyload contentChange', function() {
this.$list.imagesLoaded( function() {
this.$list.isotope( 'layout' );
}.bind( this ) );
}.bind( this ) );
}.bind( this ) );
}.bind( this ) );
} else if ( this.paginationType == 'ajax' ) {
this.initAjaxPagination();
}
this.$filters.each( function( index, filter ) {
var $filter = $( filter ),
taxonomy = $filter.data( 'taxonomy' );
$filter.on( 'click', function() {
if ( taxonomy != this.curFilterTaxonomy ) {
if ( this.loading ) {
return;
}
this.setState( 1, taxonomy );
this.$filters.removeClass( 'active' );
$filter.addClass( 'active' );
}
}.bind( this ) )
}.bind( this ) );
},
initLightboxAnchors: function() {
this.$anchors = this.$list.find( '.w-grid-item-anchor' );
this.$anchors.on( 'click', function( e ) {
var $clicked = $( e.target ),
$item = $clicked.closest( '.w-grid-item' ),
$anchor = $item.find( '.w-grid-item-anchor' ),
itemUrl = $anchor.attr( 'href' );
if ( ! $item.hasClass( 'custom-link' ) ) {
if ( $us.$window.width() >= $us.canvasOptions.disableEffectsWidth ) {
e.stopPropagation();
e.preventDefault();
this.openLightboxItem( itemUrl, $item );
}
}
}.bind( this ) );
},
// Pagination and Filters functions
initAjaxPagination: function() {
this.$loadmore.on( 'click', function() {
if ( this.curPage < this.ajaxData.max_num_pages ) {
this.setState( this.curPage + 1 );
}
}.bind( this ) );
if ( this.infiniteScroll ) {
$us.scroll.addWaypoint( this.$loadmore, '-70%', function() {
this.$loadmore.click();
}.bind( this ) );
}
},
setState: function( page, taxonomy ) {
if ( this.loading ) {
return;
}
this.loading = true;
if ( this.$filters.length ) {
taxonomy = taxonomy || this.curFilterTaxonomy;
if ( taxonomy == '*' ) {
taxonomy = this.initialFilterTaxonomy;
}
if ( taxonomy != '' ) {
var newTaxArgs = {
'taxonomy': this.filterTaxonomyName,
'field': 'slug',
'terms': taxonomy
},
taxQueryFound = false;
if ( this.templateVars.query_args.tax_query == undefined ) {
this.templateVars.query_args.tax_query = [];
} else {
$.each( this.templateVars.query_args.tax_query, function( index, taxArgs ) {
if ( taxArgs != null && taxArgs.taxonomy == this.filterTaxonomyName ) {
this.templateVars.query_args.tax_query[ index ] = newTaxArgs;
taxQueryFound = true;
return false;
}
}.bind( this ) );
}
if ( ! taxQueryFound ) {
this.templateVars.query_args.tax_query.push( newTaxArgs );
}
} else if ( this.templateVars.query_args.tax_query != undefined ) {
$.each( this.templateVars.query_args.tax_query, function( index, taxArgs ) {
if ( taxArgs != null && taxArgs.taxonomy == this.filterTaxonomyName ) {
this.templateVars.query_args.tax_query[ index ] = null;
return false;
}
}.bind( this ) );
}
}
this.templateVars.query_args.paged = page;
if ( this.paginationType == 'ajax' ) {
if ( page == 1 ) {
this.$loadmore.addClass( 'done' );
} else {
this.$loadmore.addClass( 'loading' );
}
}
if ( this.paginationType != 'ajax' || page == 1 ) {
this.$preloader.addClass( 'active' );
if ( this.$list.data( 'isotope' ) ) {
this.$list.isotope( 'remove', this.$container.find( '.w-grid-item' ) );
this.$list.isotope( 'layout' );
} else {
this.$container.find( '.w-grid-item' ).remove();
}
}
this.ajaxData.template_vars = JSON.stringify( this.templateVars );
$.ajax( {
type: 'post',
url: this.ajaxData.ajax_url,
data: this.ajaxData,
success: function( html ) {
var $result = $( html ),
$container = $result.find( '.w-grid-list' ),
$items = $container.children(),
isotope = this.$list.data( 'isotope' ),
smallestItemSelector;
$container.imagesLoaded( function() {
this.beforeAppendItems( $items );
$items.appendTo( this.$list );
$container.remove();
var $sliders = $items.find( '.w-slider' );
this.afterAppendItems( $items );
if ( isotope ) {
isotope.appended( $items );
}
if ( $sliders.length ) {
$us.getScript( $us.templateDirectoryUri + '/framework/js/vendor/royalslider.js', function() {
$sliders.each( function( index, slider ) {
$( slider ).wSlider().find( '.royalSlider' ).data( 'royalSlider' ).ev.on( 'rsAfterInit', function() {
if ( isotope ) {
this.$list.isotope( 'layout' );
}
} );
}.bind( this ) );
}.bind( this ) );
}
if ( isotope ) {
if ( this.$list.find( '.size_1x1' ).length ) {
smallestItemSelector = '.size_1x1';
} else if ( this.$list.find( '.size_1x2' ).length ) {
smallestItemSelector = '.size_1x2';
} else if ( this.$list.find( '.size_2x1' ).length ) {
smallestItemSelector = '.size_2x1';
} else if ( this.$list.find( '.size_2x2' ).length ) {
smallestItemSelector = '.size_2x2';
}
if ( smallestItemSelector && isotope.options.masonry ) {
isotope.options.masonry.columnWidth = smallestItemSelector;
}
this.$list.isotope( 'layout' );
}
if ( this.paginationType == 'ajax' ) {
if ( page == 1 ) {
var $jsonContainer = $result.find( '.w-grid-json' );
if ( $jsonContainer.length ) {
var ajaxData = $jsonContainer[ 0 ].onclick() || {};
this.ajaxData.max_num_pages = ajaxData.max_num_pages || this.ajaxData.max_num_pages;
} else {
this.ajaxData.max_num_pages = 1;
}
}
if ( this.templateVars.query_args.paged >= this.ajaxData.max_num_pages ) {
this.$loadmore.addClass( 'done' );
} else {
this.$loadmore.removeClass( 'done' );
this.$loadmore.removeClass( 'loading' );
}
if ( this.infiniteScroll ) {
$us.scroll.addWaypoint( this.$loadmore, '-70%', function() {
this.$loadmore.click();
}.bind( this ) );
}
}
if ( this.$container.hasClass( 'popup_page' ) ) {
$.each( $items, function( index, item ) {
var $loadedItem = $( item ),
$anchor = $loadedItem.find( '.w-grid-item-anchor' ),
itemUrl = $anchor.attr( 'href' );
if ( ! $loadedItem.hasClass( 'custom-link' ) ) {
$anchor.click( function( e ) {
if ( $us.$window.width() >= $us.canvasOptions.disableEffectsWidth ) {
e.stopPropagation();
e.preventDefault();
this.openLightboxItem( itemUrl, $loadedItem );
}
}.bind( this ) );
}
}.bind( this ) );
}
// Resize canvas to avoid Parallax calculation issues
$us.$canvas.resize();
this.$preloader.removeClass( 'active' );
}.bind( this ) );
this.loading = false;
}.bind( this ),
error: function() {
this.$loadmore.removeClass( 'loading' );
}.bind( this )
} );
this.curPage = page;
this.curFilterTaxonomy = taxonomy;
},
// Lightbox Functions
_hasScrollbar: function() {
return document.documentElement.scrollHeight > document.documentElement.clientHeight;
},
_getScrollbarSize: function() {
if ( $us.scrollbarSize === undefined ) {
var scrollDiv = document.createElement( 'div' );
scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
document.body.appendChild( scrollDiv );
$us.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
document.body.removeChild( scrollDiv );
}
return $us.scrollbarSize;
},
openLightboxItem: function( itemUrl, $item ) {
this.showLightbox();
var $nextItem = $item.nextAll( 'article:visible:not(.custom-link)' ).first(),
$prevItem = $item.prevAll( 'article:visible:not(.custom-link)' ).first();
if ( $nextItem.length != 0 ) {
this.$lightboxNextArrow.show();
this.$lightboxNextArrow.attr( 'title', $nextItem.find( '.w-grid-item-title' ).text() );
this.$lightboxNextArrow.off( 'click' ).click( function( e ) {
var $nextItemAnchor = $nextItem.find( '.w-grid-item-anchor' ),
nextItemUrl = $nextItemAnchor.attr( 'href' );
e.stopPropagation();
e.preventDefault();
this.openLightboxItem( nextItemUrl, $nextItem );
}.bind( this ) );
} else {
this.$lightboxNextArrow.attr( 'title', '' );
this.$lightboxNextArrow.hide();
}
if ( $prevItem.length != 0 ) {
this.$lightboxPrevArrow.show();
this.$lightboxPrevArrow.attr( 'title', $prevItem.find( '.w-grid-item-title' ).text() );
this.$lightboxPrevArrow.off( 'click' ).click( function( e ) {
var $prevItemAnchor = $prevItem.find( '.w-grid-item-anchor' ),
prevItemUrl = $prevItemAnchor.attr( 'href' );
e.stopPropagation();
e.preventDefault();
this.openLightboxItem( prevItemUrl, $prevItem );
}.bind( this ) );
} else {
this.$lightboxPrevArrow.attr( 'title', '' );
this.$lightboxPrevArrow.hide();
}
if ( itemUrl.indexOf( '?' ) !== - 1 ) {
this.$lightboxContentFrame.attr( 'src', itemUrl + '&us_iframe=1' );
} else {
this.$lightboxContentFrame.attr( 'src', itemUrl + '?us_iframe=1' );
}
// Replace window location with item's URL // TODO: bring back history replacement before production
//if (history.replaceState) {
// history.replaceState(null, null, itemUrl);
//}
this.$lightboxContentFrame.load( function() {
this.lightboxContentLoaded();
}.bind( this ) );
},
lightboxContentLoaded: function() {
this.$lightboxContentPreloader.css( 'display', 'none' );
},
showLightbox: function() {
clearTimeout( this.lightboxTimer );
this.$lightboxOverlay.appendTo( $us.$body ).show();
this.$lightboxWrap.appendTo( $us.$body ).show();
this.lightboxOpened = true;
this.$lightboxContentPreloader.css( 'display', 'block' );
// this.$lightboxContentFrame.css('display', 'none');
// this.$lightboxContentFrame.css('width', this.$lightboxContent.width());
$us.$html.addClass( 'usoverlay_fixed' );
if ( ! $.isMobile ) {
// Storing the value for the whole popup visibility session
this.windowHasScrollbar = this._hasScrollbar();
if ( this.windowHasScrollbar && this._getScrollbarSize() ) {
$us.$html.css( 'margin-right', this._getScrollbarSize() );
}
}
this.lightboxTimer = setTimeout( function() {
this.afterShowLightbox();
}.bind( this ), 25 );
},
afterShowLightbox: function() {
clearTimeout( this.lightboxTimer );
this.$lightboxOverlay.addClass( 'active' );
this.$lightboxBox.addClass( 'active' );
$us.$canvas.trigger( 'contentChange' );
$us.$window.trigger( 'resize' );
},
hideLightbox: function() {
clearTimeout( this.lightboxTimer );
this.lightboxOpened = false;
this.$lightboxOverlay.removeClass( 'active' );
this.$lightboxBox.removeClass( 'active' );
// Replace window location back to original URL
if ( history.replaceState ) {
history.replaceState( null, null, this.originalURL );
}
this.lightboxTimer = setTimeout( function() {
this.afterHideLightbox();
}.bind( this ), 500 );
},
afterHideLightbox: function() {
clearTimeout( this.lightboxTimer );
this.$lightboxOverlay.appendTo( this.$container ).hide();
this.$lightboxWrap.appendTo( this.$container ).hide();
this.$lightboxContentFrame.attr( 'src', 'about:blank' );
$us.$html.removeClass( 'usoverlay_fixed' );
if ( ! $.isMobile ) {
if ( this.windowHasScrollbar ) {
$us.$html.css( 'margin-right', '' );
}
}
},
/**
* Overloadable function for themes
* @param $items
*/
beforeAppendItems: function( $items ) {
},
afterAppendItems: function( $items ) {
}
};
$.fn.wGrid = function( options ) {
return this.each( function() {
$( this ).data( 'wGrid', new $us.WGrid( this, options ) );
} );
};
$( '.w-grid-list' ).each( function() {
var $list = $( this );
$us.getScript( $us.templateDirectoryUri + '/framework/js/vendor/magnific-popup.js', function() {
var delegateStr = 'a[ref=magnificPopupGrid]:visible',
popupOptions;
if ( $list.hasClass( 'owl-carousel' ) ) {
delegateStr = '.owl-item:not(.cloned) a[ref=magnificPopupGrid]';
}
popupOptions = {
type: 'image',
delegate: delegateStr,
gallery: {
enabled: true,
navigateByImgClick: true,
preload: [ 0, 1 ],
tPrev: $us.langOptions.magnificPopup.tPrev, // Alt text on left arrow
tNext: $us.langOptions.magnificPopup.tNext, // Alt text on right arrow
tCounter: $us.langOptions.magnificPopup.tCounter // Markup for "1 of 7" counter
},
removalDelay: 300,
mainClass: 'mfp-fade',
fixedContentPos: true
};
$list.magnificPopup( popupOptions );
if ( $list.hasClass( 'owl-carousel' ) ) {
$us.getScript( $us.templateDirectoryUri + '/framework/js/vendor/owl.carousel.js', function() {
$( '.owl-item.cloned' ).click( function( e ) {
e.preventDefault();
e.stopPropagation();
var $gridItem = $( this ).find( '.w-grid-item' ),
id = $gridItem.data( 'id' ),
$originalGridItem = $list.find( '.owl-item:not(.cloned) > .w-grid-item[data-id=' + id + ']' ),
$originalOwlItem = $originalGridItem.parent(),
index = $list.find( '.owl-item:not(.cloned)' ).index( $originalOwlItem );
$list.magnificPopup( 'open', index );
} );
} );
}
} );
} );
} )( jQuery );
@@ -0,0 +1,40 @@
(function($){"use strict";$us.WGrid=function(container,options){this.init(container,options)};$us.WGrid.prototype={init:function(container,options){this.$container=$(container);this.$filters=this.$container.find('.g-filters-item');this.$list=this.$container.find('.w-grid-list');this.$items=this.$container.find('.w-grid-item');this.$pagination=this.$container.find('.pagination');this.$loadmore=this.$container.find('.g-loadmore');this.$preloader=this.$container.find('.w-grid-preloader');this.curFilterTaxonomy='';this.paginationType=this.$pagination.length?'regular':(this.$loadmore.length?'ajax':'none');this.filterTaxonomyName=this.$list.data('filter_taxonomy_name')?this.$list.data('filter_taxonomy_name'):'category';this.loading=!1;if(this.$container.data('gridInit')==1){return}
this.$container.data('gridInit',1);var $jsonContainer=this.$container.find('.w-grid-json');if($jsonContainer.length){this.ajaxData=$jsonContainer[0].onclick()||{};this.ajaxUrl=this.ajaxData.ajax_url||'';$jsonContainer.remove()}
this.carouselSettings=this.ajaxData.carousel_settings;this.breakpoints=this.ajaxData.carousel_breakpoints||{};if(this.$list.hasClass('owl-carousel')){$us.getScript($us.templateDirectoryUri+'/framework/js/vendor/owl.carousel.js',function(){this.carouselOptions={mouseDrag:!jQuery.isMobile,items:parseInt(this.carouselSettings.items),rtl:$('.l-body').hasClass('rtl'),nav:this.carouselSettings.nav,navElement:'div',navText:[this.carouselSettings.navPrev,this.carouselSettings.navNext],dots:this.carouselSettings.dots,loop:this.carouselSettings.center,rewind:!0,center:this.carouselSettings.center,autoplay:this.carouselSettings.autoplay,autoplayTimeout:this.carouselSettings.timeout,autoHeight:this.carouselSettings.autoHeight,slideBy:this.carouselSettings.slideby,smartSpeed:this.carouselSettings.speed,slideTransition:this.carouselSettings.transition,autoplayHoverPause:!0,responsive:this.breakpoints};if(this.carouselSettings.autoplay==1){this.carouselOptions.loop=1}
if(this.carouselSettings.smooth_play==1){this.carouselOptions.slideTransition='linear';this.carouselOptions.autoplaySpeed=this.carouselSettings.timeout;this.carouselOptions.slideBy=1;this.carouselOptions.loop=1}
this.$list.owlCarousel(this.carouselOptions);this.$list.on('changed.owl.carousel',function(event){$(document).trigger('uslazyloadevent')})}.bind(this))}
if(this.$container.hasClass('popup_page')){if(this.ajaxData==undefined){return}
this.lightboxTimer=null;this.$lightboxOverlay=this.$container.find('.l-popup-overlay');this.$lightboxWrap=this.$container.find('.l-popup-wrap');this.$lightboxBox=this.$container.find('.l-popup-box');this.$lightboxContent=this.$container.find('.l-popup-box-content');this.$lightboxContentPreloader=this.$lightboxContent.find('.g-preloader');this.$lightboxContentFrame=this.$container.find('.l-popup-box-content-frame');this.$lightboxNextArrow=this.$container.find('.l-popup-arrow.to_next');this.$lightboxPrevArrow=this.$container.find('.l-popup-arrow.to_prev');this.$container.find('.l-popup-closer').click(function(){this.hideLightbox()}.bind(this));this.$container.find('.l-popup-box').click(function(){this.hideLightbox()}.bind(this));this.$container.find('.l-popup-box-content').click(function(e){e.stopPropagation()}.bind(this));this.originalURL=window.location.href;this.lightboxOpened=!1;if(this.$list.hasClass('owl-carousel')){$us.getScript($us.templateDirectoryUri+'/framework/js/vendor/owl.carousel.js',function(){this.initLightboxAnchors()}.bind(this))}else{this.initLightboxAnchors()}
$(window).on('resize',function(){if(this.lightboxOpened&&$us.$window.width()<$us.canvasOptions.disableEffectsWidth){this.hideLightbox()}}.bind(this))}
if(this.$list.hasClass('owl-carousel')){return}
if(this.paginationType!='none'||this.$filters.length){if(this.ajaxData==undefined){return}
this.templateVars=this.ajaxData.template_vars||{};if(this.filterTaxonomyName){this.initialFilterTaxonomy=this.$list.data('filter_default_taxonomies')?this.$list.data('filter_default_taxonomies').split(','):'';this.curFilterTaxonomy=this.initialFilterTaxonomy}
this.curPage=this.ajaxData.current_page||1;this.perpage=this.ajaxData.perpage||this.$items.length;this.infiniteScroll=this.ajaxData.infinite_scroll||0}
if(this.$container.hasClass('with_isotope')){$us.getScript($us.templateDirectoryUri+'/framework/js/vendor/isotope.js',function(){this.$list.imagesLoaded(function(){var smallestItemSelector,isotopeOptions={itemSelector:'.w-grid-item',layoutMode:(this.$container.hasClass('isotope_fit_rows'))?'fitRows':'masonry',isOriginLeft:!$('.l-body').hasClass('rtl')};if(this.$list.find('.size_1x1').length){smallestItemSelector='.size_1x1'}else if(this.$list.find('.size_1x2').length){smallestItemSelector='.size_1x2'}else if(this.$list.find('.size_2x1').length){smallestItemSelector='.size_2x1'}else if(this.$list.find('.size_2x2').length){smallestItemSelector='.size_2x2'}
if(smallestItemSelector){isotopeOptions.masonry={columnWidth:smallestItemSelector}}
this.$list.isotope(isotopeOptions);this.$list.isotope();if(this.paginationType=='ajax'){this.initAjaxPagination()}
$us.$canvas.on('lazyload contentChange',function(){this.$list.imagesLoaded(function(){this.$list.isotope('layout')}.bind(this))}.bind(this))}.bind(this))}.bind(this))}else if(this.paginationType=='ajax'){this.initAjaxPagination()}
this.$filters.each(function(index,filter){var $filter=$(filter),taxonomy=$filter.data('taxonomy');$filter.on('click',function(){if(taxonomy!=this.curFilterTaxonomy){if(this.loading){return}
this.setState(1,taxonomy);this.$filters.removeClass('active');$filter.addClass('active')}}.bind(this))}.bind(this))},initLightboxAnchors:function(){this.$anchors=this.$list.find('.w-grid-item-anchor');this.$anchors.on('click',function(e){var $clicked=$(e.target),$item=$clicked.closest('.w-grid-item'),$anchor=$item.find('.w-grid-item-anchor'),itemUrl=$anchor.attr('href');if(!$item.hasClass('custom-link')){if($us.$window.width()>=$us.canvasOptions.disableEffectsWidth){e.stopPropagation();e.preventDefault();this.openLightboxItem(itemUrl,$item)}}}.bind(this))},initAjaxPagination:function(){this.$loadmore.on('click',function(){if(this.curPage<this.ajaxData.max_num_pages){this.setState(this.curPage+1)}}.bind(this));if(this.infiniteScroll){$us.scroll.addWaypoint(this.$loadmore,'-70%',function(){this.$loadmore.click()}.bind(this))}},setState:function(page,taxonomy){if(this.loading){return}
this.loading=!0;if(this.$filters.length){taxonomy=taxonomy||this.curFilterTaxonomy;if(taxonomy=='*'){taxonomy=this.initialFilterTaxonomy}
if(taxonomy!=''){var newTaxArgs={'taxonomy':this.filterTaxonomyName,'field':'slug','terms':taxonomy},taxQueryFound=!1;if(this.templateVars.query_args.tax_query==undefined){this.templateVars.query_args.tax_query=[]}else{$.each(this.templateVars.query_args.tax_query,function(index,taxArgs){if(taxArgs!=null&&taxArgs.taxonomy==this.filterTaxonomyName){this.templateVars.query_args.tax_query[index]=newTaxArgs;taxQueryFound=!0;return!1}}.bind(this))}
if(!taxQueryFound){this.templateVars.query_args.tax_query.push(newTaxArgs)}}else if(this.templateVars.query_args.tax_query!=undefined){$.each(this.templateVars.query_args.tax_query,function(index,taxArgs){if(taxArgs!=null&&taxArgs.taxonomy==this.filterTaxonomyName){this.templateVars.query_args.tax_query[index]=null;return!1}}.bind(this))}}
this.templateVars.query_args.paged=page;if(this.paginationType=='ajax'){if(page==1){this.$loadmore.addClass('done')}else{this.$loadmore.addClass('loading')}}
if(this.paginationType!='ajax'||page==1){this.$preloader.addClass('active');if(this.$list.data('isotope')){this.$list.isotope('remove',this.$container.find('.w-grid-item'));this.$list.isotope('layout')}else{this.$container.find('.w-grid-item').remove()}}
this.ajaxData.template_vars=JSON.stringify(this.templateVars);$.ajax({type:'post',url:this.ajaxData.ajax_url,data:this.ajaxData,success:function(html){var $result=$(html),$container=$result.find('.w-grid-list'),$items=$container.children(),isotope=this.$list.data('isotope'),smallestItemSelector;$container.imagesLoaded(function(){this.beforeAppendItems($items);$items.appendTo(this.$list);$container.remove();var $sliders=$items.find('.w-slider');this.afterAppendItems($items);if(isotope){isotope.appended($items)}
if($sliders.length){$us.getScript($us.templateDirectoryUri+'/framework/js/vendor/royalslider.js',function(){$sliders.each(function(index,slider){$(slider).wSlider().find('.royalSlider').data('royalSlider').ev.on('rsAfterInit',function(){if(isotope){this.$list.isotope('layout')}})}.bind(this))}.bind(this))}
if(isotope){if(this.$list.find('.size_1x1').length){smallestItemSelector='.size_1x1'}else if(this.$list.find('.size_1x2').length){smallestItemSelector='.size_1x2'}else if(this.$list.find('.size_2x1').length){smallestItemSelector='.size_2x1'}else if(this.$list.find('.size_2x2').length){smallestItemSelector='.size_2x2'}
if(smallestItemSelector&&isotope.options.masonry){isotope.options.masonry.columnWidth=smallestItemSelector}
this.$list.isotope('layout')}
if(this.paginationType=='ajax'){if(page==1){var $jsonContainer=$result.find('.w-grid-json');if($jsonContainer.length){var ajaxData=$jsonContainer[0].onclick()||{};this.ajaxData.max_num_pages=ajaxData.max_num_pages||this.ajaxData.max_num_pages}else{this.ajaxData.max_num_pages=1}}
if(this.templateVars.query_args.paged>=this.ajaxData.max_num_pages){this.$loadmore.addClass('done')}else{this.$loadmore.removeClass('done');this.$loadmore.removeClass('loading')}
if(this.infiniteScroll){$us.scroll.addWaypoint(this.$loadmore,'-70%',function(){this.$loadmore.click()}.bind(this))}}
if(this.$container.hasClass('popup_page')){$.each($items,function(index,item){var $loadedItem=$(item),$anchor=$loadedItem.find('.w-grid-item-anchor'),itemUrl=$anchor.attr('href');if(!$loadedItem.hasClass('custom-link')){$anchor.click(function(e){if($us.$window.width()>=$us.canvasOptions.disableEffectsWidth){e.stopPropagation();e.preventDefault();this.openLightboxItem(itemUrl,$loadedItem)}}.bind(this))}}.bind(this))}
$us.$canvas.resize();this.$preloader.removeClass('active')}.bind(this));this.loading=!1}.bind(this),error:function(){this.$loadmore.removeClass('loading')}.bind(this)});this.curPage=page;this.curFilterTaxonomy=taxonomy},_hasScrollbar:function(){return document.documentElement.scrollHeight>document.documentElement.clientHeight},_getScrollbarSize:function(){if($us.scrollbarSize===undefined){var scrollDiv=document.createElement('div');scrollDiv.style.cssText='width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';document.body.appendChild(scrollDiv);$us.scrollbarSize=scrollDiv.offsetWidth-scrollDiv.clientWidth;document.body.removeChild(scrollDiv)}
return $us.scrollbarSize},openLightboxItem:function(itemUrl,$item){this.showLightbox();var $nextItem=$item.nextAll('article:visible:not(.custom-link)').first(),$prevItem=$item.prevAll('article:visible:not(.custom-link)').first();if($nextItem.length!=0){this.$lightboxNextArrow.show();this.$lightboxNextArrow.attr('title',$nextItem.find('.w-grid-item-title').text());this.$lightboxNextArrow.off('click').click(function(e){var $nextItemAnchor=$nextItem.find('.w-grid-item-anchor'),nextItemUrl=$nextItemAnchor.attr('href');e.stopPropagation();e.preventDefault();this.openLightboxItem(nextItemUrl,$nextItem)}.bind(this))}else{this.$lightboxNextArrow.attr('title','');this.$lightboxNextArrow.hide()}
if($prevItem.length!=0){this.$lightboxPrevArrow.show();this.$lightboxPrevArrow.attr('title',$prevItem.find('.w-grid-item-title').text());this.$lightboxPrevArrow.off('click').click(function(e){var $prevItemAnchor=$prevItem.find('.w-grid-item-anchor'),prevItemUrl=$prevItemAnchor.attr('href');e.stopPropagation();e.preventDefault();this.openLightboxItem(prevItemUrl,$prevItem)}.bind(this))}else{this.$lightboxPrevArrow.attr('title','');this.$lightboxPrevArrow.hide()}
if(itemUrl.indexOf('?')!==-1){this.$lightboxContentFrame.attr('src',itemUrl+'&us_iframe=1')}else{this.$lightboxContentFrame.attr('src',itemUrl+'?us_iframe=1')}
this.$lightboxContentFrame.load(function(){this.lightboxContentLoaded()}.bind(this))},lightboxContentLoaded:function(){this.$lightboxContentPreloader.css('display','none')},showLightbox:function(){clearTimeout(this.lightboxTimer);this.$lightboxOverlay.appendTo($us.$body).show();this.$lightboxWrap.appendTo($us.$body).show();this.lightboxOpened=!0;this.$lightboxContentPreloader.css('display','block');$us.$html.addClass('usoverlay_fixed');if(!$.isMobile){this.windowHasScrollbar=this._hasScrollbar();if(this.windowHasScrollbar&&this._getScrollbarSize()){$us.$html.css('margin-right',this._getScrollbarSize())}}
this.lightboxTimer=setTimeout(function(){this.afterShowLightbox()}.bind(this),25)},afterShowLightbox:function(){clearTimeout(this.lightboxTimer);this.$lightboxOverlay.addClass('active');this.$lightboxBox.addClass('active');$us.$canvas.trigger('contentChange');$us.$window.trigger('resize')},hideLightbox:function(){clearTimeout(this.lightboxTimer);this.lightboxOpened=!1;this.$lightboxOverlay.removeClass('active');this.$lightboxBox.removeClass('active');if(history.replaceState){history.replaceState(null,null,this.originalURL)}
this.lightboxTimer=setTimeout(function(){this.afterHideLightbox()}.bind(this),500)},afterHideLightbox:function(){clearTimeout(this.lightboxTimer);this.$lightboxOverlay.appendTo(this.$container).hide();this.$lightboxWrap.appendTo(this.$container).hide();this.$lightboxContentFrame.attr('src','about:blank');$us.$html.removeClass('usoverlay_fixed');if(!$.isMobile){if(this.windowHasScrollbar){$us.$html.css('margin-right','')}}},beforeAppendItems:function($items){},afterAppendItems:function($items){}};$.fn.wGrid=function(options){return this.each(function(){$(this).data('wGrid',new $us.WGrid(this,options))})};$('.w-grid-list').each(function(){var $list=$(this);$us.getScript($us.templateDirectoryUri+'/framework/js/vendor/magnific-popup.js',function(){var delegateStr='a[ref=magnificPopupGrid]:visible',popupOptions;if($list.hasClass('owl-carousel')){delegateStr='.owl-item:not(.cloned) a[ref=magnificPopupGrid]'}
popupOptions={type:'image',delegate:delegateStr,gallery:{enabled:!0,navigateByImgClick:!0,preload:[0,1],tPrev:$us.langOptions.magnificPopup.tPrev,tNext:$us.langOptions.magnificPopup.tNext,tCounter:$us.langOptions.magnificPopup.tCounter},removalDelay:300,mainClass:'mfp-fade',fixedContentPos:!0};$list.magnificPopup(popupOptions);if($list.hasClass('owl-carousel')){$us.getScript($us.templateDirectoryUri+'/framework/js/vendor/owl.carousel.js',function(){$('.owl-item.cloned').click(function(e){e.preventDefault();e.stopPropagation();var $gridItem=$(this).find('.w-grid-item'),id=$gridItem.data('id'),$originalGridItem=$list.find('.owl-item:not(.cloned) > .w-grid-item[data-id='+id+']'),$originalOwlItem=$originalGridItem.parent(),index=$list.find('.owl-item:not(.cloned)').index($originalOwlItem);$list.magnificPopup('open',index)})})}})})})(jQuery)
@@ -0,0 +1,144 @@
/**
* UpSolution Element: Interactive Text
*/
! function( $ ) {
"use strict";
$us.WItext = function( container ) {
this.$container = $( container );
var data = this.$container[ 0 ].onclick() || {};
this.$container.removeAttr( 'onclick' );
this.type = this.$container.usMod( 'type' );
this.animateChars = ( this.type.substring( this.type.length - 5 ) == 'Chars' );
if ( this.animateChars ) {
this.type = this.type.substring( 0, this.type.length - 5 );
}
this.duration = parseInt( data.duration ) || 1000;
this.delay = parseInt( data.delay ) || 5000;
this.dynamicColor = ( data.dynamicColor || '' );
this.$parts = this.$container.find( '.w-itext-part' );
if ( this.$parts.length == 0 ) {
return;
} // No animated parts
this.parts = [];
this.partsStates = []; // part index => text states
this.animateParts = []; // animation index => animated parts indexes
this.$parts.css( {
'-webkit-transition-duration': this.duration + 'ms',
'transition-duration': this.duration + 'ms'
} ).each( function( partIndex, part ) {
this.parts[ partIndex ] = $( part );
this.partsStates[ partIndex ] = part.onclick() || [];
this.parts[ partIndex ].removeAttr( 'onclick' );
$.map( part.className.match( /changesat_[0-9]+/g ), function( elm ) {
var animIndex = parseInt( elm.replace( 'changesat_', '' ) );
if ( this.animateParts[ animIndex ] === undefined ) {
this.animateParts[ animIndex ] = [];
}
this.animateParts[ animIndex ].push( partIndex );
}.bind( this ) );
}.bind( this ) );
this.active = 0;
this.maxActive = this.partsStates[ 0 ].length - 1;
this._events = {
animate: this.animate.bind( this ),
postAnimate: this.postAnimate.bind( this )
};
// Start animation
this.timer = setTimeout( this._events.animate, this.delay );
};
$us.WItext.prototype = {
animate: function() {
var nextState = ( this.active == this.maxActive ) ? 0 : ( this.active + 1 );
for ( var partIndex = 0; partIndex < this.parts.length; partIndex ++ ) {
if ( this.partsStates[ partIndex ][ this.active ] != this.partsStates[ partIndex ][ nextState ] ) {
this.parts[ partIndex ].addClass( 'dynamic' );
if ( this.dynamicColor ) {
this.parts[ partIndex ].css( 'color', this.dynamicColor );
}
this._animatePart( partIndex );
} else {
this.parts[ partIndex ].removeClass( 'dynamic' );
if ( this.dynamicColor ) {
this.parts[ partIndex ].css( 'color', '' );
}
}
}
this.timer = setTimeout( this._events.postAnimate, this.duration + this.delay / 2 );
},
/**
* Animate a certain dynamic part
* @param partIndex
* @private
*/
_animatePart: function( partIndex ) {
// Preparing part for animation
var nextState = ( this.active == this.maxActive ) ? 0 : ( this.active + 1 ),
nextValue = this.partsStates[ partIndex ][ nextState ],
$curSpan = this.parts[ partIndex ].wrapInner( '<span></span>' ).children( 'span' ),
$nextSpan = $( '<span class="measure"></span>' ).html( nextValue.replace( ' ', '&nbsp;' ) ).appendTo( this.parts[ partIndex ] ),
nextWidth = $nextSpan.width(),
outType = ( this.type == 'flipInX' ) ? 'flipOutX' : 'fadeOut',
i;
// Measuring the future part width
this.parts[ partIndex ].addClass( 'notransition' ).css( 'width', this.parts[ partIndex ].width() );
setTimeout( function() {
this.parts[ partIndex ].removeClass( 'notransition' ).css( 'width', nextWidth );
}.bind( this ), 25 );
$curSpan.css( {
position: 'absolute',
left: 0,
top: 0,
'-webkit-transition-duration': ( this.duration / 5 ) + 'ms',
'transition-duration': ( this.duration / 5 ) + 'ms'
} ).addClass( 'animated_' + outType );
$nextSpan.css( 'width', nextWidth ).removeClass( 'measure' ).prependTo( this.parts[ partIndex ] );
if ( this.animateChars ) {
$nextSpan.empty();
var $chars = [],
charDuration = Math.floor( this.duration / nextValue.length );
for ( i = 0; i < nextValue.length; i ++ ) {
$chars.push( $( '<span>' + ( ( nextValue[ i ] != ' ' ) ? nextValue[ i ] : '&nbsp;' ) + '</span>' ).css( {
'-webkit-transition-duration': charDuration + 'ms',
'transition-duration': charDuration + 'ms'
} ).appendTo( $nextSpan ) );
}
$.each( $chars, function( index, char ) {
setTimeout( function() {
$( char ).addClass( 'animated_' + this.type );
}.bind( this ), charDuration * index );
}.bind( this ) );
} else {
$nextSpan.wrapInner( '<span></span>' ).children( 'span' ).css( {
'-webkit-transition-duration': this.duration + 'ms',
'transition-duration': this.duration + 'ms'
} ).addClass( 'animated_' + this.type );
}
setTimeout( this._cleanupPartAnimation.bind( this, partIndex ), this.duration + this.delay / 2 );
},
/**
* Clean up a certain part from animation
* @param partIndex
* @private
*/
_cleanupPartAnimation: function( partIndex ) {
var nextState = ( this.active == this.maxActive ) ? 0 : ( this.active + 1 ),
nextValue = this.partsStates[ partIndex ][ nextState ];
this.parts[ partIndex ].addClass( 'notransition' ).css( 'width', '' ).html( nextValue.replace( ' ', '&nbsp;' ) );
},
postAnimate: function() {
this.active = ( this.active == this.maxActive ) ? 0 : ( this.active + 1 );
this.timer = setTimeout( this._events.animate, this.delay / 2 );
}
};
$.fn.wItext = function( options ) {
return this.each( function() {
$( this ).data( 'wItext', new $us.WItext( this, options ) );
} );
};
$( function() {
$( '.w-itext' ).wItext();
} );
}( jQuery );
@@ -0,0 +1,8 @@
!function($){"use strict";$us.WItext=function(container){this.$container=$(container);var data=this.$container[0].onclick()||{};this.$container.removeAttr('onclick');this.type=this.$container.usMod('type');this.animateChars=(this.type.substring(this.type.length-5)=='Chars');if(this.animateChars){this.type=this.type.substring(0,this.type.length-5)}
this.duration=parseInt(data.duration)||1000;this.delay=parseInt(data.delay)||5000;this.dynamicColor=(data.dynamicColor||'');this.$parts=this.$container.find('.w-itext-part');if(this.$parts.length==0){return}
this.parts=[];this.partsStates=[];this.animateParts=[];this.$parts.css({'-webkit-transition-duration':this.duration+'ms','transition-duration':this.duration+'ms'}).each(function(partIndex,part){this.parts[partIndex]=$(part);this.partsStates[partIndex]=part.onclick()||[];this.parts[partIndex].removeAttr('onclick');$.map(part.className.match(/changesat_[0-9]+/g),function(elm){var animIndex=parseInt(elm.replace('changesat_',''));if(this.animateParts[animIndex]===undefined){this.animateParts[animIndex]=[]}
this.animateParts[animIndex].push(partIndex)}.bind(this))}.bind(this));this.active=0;this.maxActive=this.partsStates[0].length-1;this._events={animate:this.animate.bind(this),postAnimate:this.postAnimate.bind(this)};this.timer=setTimeout(this._events.animate,this.delay)};$us.WItext.prototype={animate:function(){var nextState=(this.active==this.maxActive)?0:(this.active+1);for(var partIndex=0;partIndex<this.parts.length;partIndex ++){if(this.partsStates[partIndex][this.active]!=this.partsStates[partIndex][nextState]){this.parts[partIndex].addClass('dynamic');if(this.dynamicColor){this.parts[partIndex].css('color',this.dynamicColor)}
this._animatePart(partIndex)}else{this.parts[partIndex].removeClass('dynamic');if(this.dynamicColor){this.parts[partIndex].css('color','')}}}
this.timer=setTimeout(this._events.postAnimate,this.duration+this.delay/2)},_animatePart:function(partIndex){var nextState=(this.active==this.maxActive)?0:(this.active+1),nextValue=this.partsStates[partIndex][nextState],$curSpan=this.parts[partIndex].wrapInner('<span></span>').children('span'),$nextSpan=$('<span class="measure"></span>').html(nextValue.replace(' ','&nbsp;')).appendTo(this.parts[partIndex]),nextWidth=$nextSpan.width(),outType=(this.type=='flipInX')?'flipOutX':'fadeOut',i;this.parts[partIndex].addClass('notransition').css('width',this.parts[partIndex].width());setTimeout(function(){this.parts[partIndex].removeClass('notransition').css('width',nextWidth)}.bind(this),25);$curSpan.css({position:'absolute',left:0,top:0,'-webkit-transition-duration':(this.duration/5)+'ms','transition-duration':(this.duration/5)+'ms'}).addClass('animated_'+outType);$nextSpan.css('width',nextWidth).removeClass('measure').prependTo(this.parts[partIndex]);if(this.animateChars){$nextSpan.empty();var $chars=[],charDuration=Math.floor(this.duration/nextValue.length);for(i=0;i<nextValue.length;i ++){$chars.push($('<span>'+((nextValue[i]!=' ')?nextValue[i]:'&nbsp;')+'</span>').css({'-webkit-transition-duration':charDuration+'ms','transition-duration':charDuration+'ms'}).appendTo($nextSpan))}
$.each($chars,function(index,char){setTimeout(function(){$(char).addClass('animated_'+this.type)}.bind(this),charDuration*index)}.bind(this))}else{$nextSpan.wrapInner('<span></span>').children('span').css({'-webkit-transition-duration':this.duration+'ms','transition-duration':this.duration+'ms'}).addClass('animated_'+this.type)}
setTimeout(this._cleanupPartAnimation.bind(this,partIndex),this.duration+this.delay/2)},_cleanupPartAnimation:function(partIndex){var nextState=(this.active==this.maxActive)?0:(this.active+1),nextValue=this.partsStates[partIndex][nextState];this.parts[partIndex].addClass('notransition').css('width','').html(nextValue.replace(' ','&nbsp;'))},postAnimate:function(){this.active=(this.active==this.maxActive)?0:(this.active+1);this.timer=setTimeout(this._events.animate,this.delay/2)}};$.fn.wItext=function(options){return this.each(function(){$(this).data('wItext',new $us.WItext(this,options))})};$(function(){$('.w-itext').wItext()})}(jQuery)
@@ -0,0 +1,187 @@
/**
* UpSolution Element: Leaflet Maps
*
* Used for [us_gmaps] shortcode
*
* Leaflet JS Official Docs https://leafletjs.com/
*/
! function( $ ) {
"use strict";
$us.WLmaps = function( container, options ) {
this.init( container, options );
};
$us.WLmaps.prototype = {
init: function( container, options ) {
this.$container = $( container );
this.mapId = this.$container.attr( 'id' );
var $jsonContainer = this.$container.find( '.w-map-json' ),
jsonOptions = $jsonContainer[ 0 ].onclick() || {},
defaults = {};
$jsonContainer.remove();
this.options = $.extend( {}, defaults, jsonOptions, options );
this._events = {
redraw: this.redraw.bind( this ),
};
$us.$canvas.on( 'contentChange', this._events.redraw );
this.beforeRender();
},
beforeRender: function() {
var matches = this.options.address.match( /^(\d+.\d+)\s?,?\s?(\d+.\d+)$/ );
if ( matches ) {
this.center = [ matches[ 1 ], matches[ 2 ] ];
this.renderMap();
} else {
this.geocoder( this.options.address );
}
},
redraw: function() {
if ( ! this.lmap || this.$container.is( ':hidden' ) ) {
return;
}
this.lmap.invalidateSize( true );
},
geocoder: function( request, markerOptions, popup ) {
var endPoint = "https://nominatim.openstreetmap.org/search?format=json&limit=1&q=",
that = this;
// Get coordinates from the search engine
$.getJSON( endPoint + encodeURI( request ), function( json ) {
// First Success
} ).done( function( json ) {
if ( ! json.length ) {
// Return in case no coordinates were found
return;
}
// Get Coordinates
var bBox = json[ 0 ].boundingbox;
if ( ! markerOptions ) {
// Get coordinates to set map center and add 1st marker
that.center = [ bBox[ 1 ], bBox[ 3 ] ];
that.renderMap();
} else {
that.marker = L.marker( [ bBox[ 1 ], bBox[ 3 ] ], markerOptions ).addTo( that.lmap );
// Add marker popups
if ( popup ) {
that.marker.bindPopup( popup );
}
}
} );
},
renderMap: function() {
var lmapsOptions = {
// Basic Map setup
center: this.center,
zoom: this.options.zoom,
};
if ( this.options.hideControls ) {
// Hide zooming buttons
lmapsOptions.zoomControl = false;
}
if ( this.options.disableZoom ) {
// Disable Mouse Zooming
lmapsOptions.scrollWheelZoom = false;
}
// Main map object
this.lmap = L.map( this.mapId, lmapsOptions );
// Add a Raster layer to the map
L.tileLayer( this.options.style ).addTo( this.lmap );
this.renderMarkers();
if ( this.options.disableDragging && ( ! $us.$html.hasClass( 'no-touch' ) ) ) {
// Disable dragging on mobiles
this.lmap.dragging.disable();
}
},
renderMarkers: function() {
if ( this.options.markers.length ) {
// Add markers
var mainOptions = {};
for ( var i = 0; i < this.options.markers.length; i ++ ) {
if ( i == 0 ) {
// Handle first marker separately
if ( this.options.icon != null ) {
var mainMarkerSizes = this.options.icon.size[ 0 ],
markerImg = L.icon( {
iconUrl: this.options.icon.url,
iconSize: mainMarkerSizes,
} );
// Set icon offset
markerImg.options.iconAnchor = [ mainMarkerSizes / 2, mainMarkerSizes ];
// Set popup offset
markerImg.options.popupAnchor = [ 0, - mainMarkerSizes ];
// Push Marker Icons to Options object
mainOptions.icon = markerImg;
}
// Add main marker with calculated coordinates
var marker = L.marker( this.center, mainOptions ).addTo( this.lmap );
// Add a popup to the 1st marker
if ( this.options.markers[ i ].html ) {
if ( this.options.markers[ i ].infowindow ) {
marker.bindPopup( this.options.markers[ i ].html ).openPopup();
} else {
marker.bindPopup( this.options.markers[ i ].html );
}
}
} else {
var markerOptions = {};
// All markers but first
if ( this.options.markers[ i ].marker_img != null ) {
var markerSizes = this.options.markers[ i ].marker_size[ 0 ],
markerImg = L.icon( {
iconUrl: this.options.markers[ i ].marker_img[ 0 ],
iconSize: markerSizes,
} );
// Set icon offset
markerImg.options.iconAnchor = [ markerSizes / 2, markerSizes ];
// Set popup offset
markerImg.options.popupAnchor = [ 0, - markerSizes ];
markerOptions.icon = markerImg;
} else {
markerOptions = mainOptions;
}
var matches = this.options.markers[ i ].address.match( /^(-?\d+.\d+)\s?,?\s?(-?\d+.\d+)$/ );
if ( matches ) {
this.marker = L.marker( [ matches[ 1 ], matches[ 2 ] ], markerOptions ).addTo( this.lmap );
if ( this.options.markers[ i ].html ) {
// Add a popup if marker has some text
this.marker.bindPopup( this.options.markers[ i ].html )
}
} else {
this.geocoder( this.options.markers[ i ].address, markerOptions, this.options.markers[ i ].html );
}
}
}
}
}
};
$.fn.WLmaps = function( options ) {
return this.each( function() {
$( this ).data( 'wLmaps', new $us.WLmaps( this, options ) );
} );
};
$( function() {
var $wLmap = $( '.w-map.provider_osm' );
if ( $wLmap.length ) {
$us.getScript( $us.templateDirectoryUri + '/framework/js/vendor/leaflet.js', function() {
$wLmap.WLmaps();
} );
}
} );
}( jQuery );
@@ -0,0 +1,7 @@
!function($){"use strict";$us.WLmaps=function(container,options){this.init(container,options)};$us.WLmaps.prototype={init:function(container,options){this.$container=$(container);this.mapId=this.$container.attr('id');var $jsonContainer=this.$container.find('.w-map-json'),jsonOptions=$jsonContainer[0].onclick()||{},defaults={};$jsonContainer.remove();this.options=$.extend({},defaults,jsonOptions,options);this._events={redraw:this.redraw.bind(this),};$us.$canvas.on('contentChange',this._events.redraw);this.beforeRender()},beforeRender:function(){var matches=this.options.address.match(/^(\d+.\d+)\s?,?\s?(\d+.\d+)$/);if(matches){this.center=[matches[1],matches[2]];this.renderMap()}else{this.geocoder(this.options.address)}},redraw:function(){if(!this.lmap||this.$container.is(':hidden')){return}
this.lmap.invalidateSize(!0)},geocoder:function(request,markerOptions,popup){var endPoint="https://nominatim.openstreetmap.org/search?format=json&limit=1&q=",that=this;$.getJSON(endPoint+encodeURI(request),function(json){}).done(function(json){if(!json.length){return}
var bBox=json[0].boundingbox;if(!markerOptions){that.center=[bBox[1],bBox[3]];that.renderMap()}else{that.marker=L.marker([bBox[1],bBox[3]],markerOptions).addTo(that.lmap);if(popup){that.marker.bindPopup(popup)}}})},renderMap:function(){var lmapsOptions={center:this.center,zoom:this.options.zoom,};if(this.options.hideControls){lmapsOptions.zoomControl=!1}
if(this.options.disableZoom){lmapsOptions.scrollWheelZoom=!1}
this.lmap=L.map(this.mapId,lmapsOptions);L.tileLayer(this.options.style).addTo(this.lmap);this.renderMarkers();if(this.options.disableDragging&&(!$us.$html.hasClass('no-touch'))){this.lmap.dragging.disable()}},renderMarkers:function(){if(this.options.markers.length){var mainOptions={};for(var i=0;i<this.options.markers.length;i ++){if(i==0){if(this.options.icon!=null){var mainMarkerSizes=this.options.icon.size[0],markerImg=L.icon({iconUrl:this.options.icon.url,iconSize:mainMarkerSizes,});markerImg.options.iconAnchor=[mainMarkerSizes/2,mainMarkerSizes];markerImg.options.popupAnchor=[0,-mainMarkerSizes];mainOptions.icon=markerImg}
var marker=L.marker(this.center,mainOptions).addTo(this.lmap);if(this.options.markers[i].html){if(this.options.markers[i].infowindow){marker.bindPopup(this.options.markers[i].html).openPopup()}else{marker.bindPopup(this.options.markers[i].html)}}}else{var markerOptions={};if(this.options.markers[i].marker_img!=null){var markerSizes=this.options.markers[i].marker_size[0],markerImg=L.icon({iconUrl:this.options.markers[i].marker_img[0],iconSize:markerSizes,});markerImg.options.iconAnchor=[markerSizes/2,markerSizes];markerImg.options.popupAnchor=[0,-markerSizes];markerOptions.icon=markerImg}else{markerOptions=mainOptions}
var matches=this.options.markers[i].address.match(/^(-?\d+.\d+)\s?,?\s?(-?\d+.\d+)$/);if(matches){this.marker=L.marker([matches[1],matches[2]],markerOptions).addTo(this.lmap);if(this.options.markers[i].html){this.marker.bindPopup(this.options.markers[i].html)}}else{this.geocoder(this.options.markers[i].address,markerOptions,this.options.markers[i].html)}}}}}};$.fn.WLmaps=function(options){return this.each(function(){$(this).data('wLmaps',new $us.WLmaps(this,options))})};$(function(){var $wLmap=$('.w-map.provider_osm');if($wLmap.length){$us.getScript($us.templateDirectoryUri+'/framework/js/vendor/leaflet.js',function(){$wLmap.WLmaps()})}})}(jQuery)
@@ -0,0 +1,397 @@
/**
* $us.nav
*
* Header navigation with all the possible states
*
* @requires $us.canvas
*/
! function( $ ) {
$us.Nav = function( container, options ) {
this.init( container, options );
};
$us.mobileNavOpened = 0;
$us.Nav.prototype = {
init: function( container, options ) {
// Commonly used dom elements
this.$nav = $( container );
if ( this.$nav.length == 0 ) {
return;
}
this.$control = this.$nav.find( '.w-nav-control' );
this.$close = this.$nav.find( '.w-nav-close' );
this.$items = this.$nav.find( '.menu-item' );
this.$list = this.$nav.find( '.w-nav-list.level_1' );
this.$subItems = this.$list.find( '.menu-item-has-children' );
this.$subAnchors = this.$list.find( '.menu-item-has-children > .w-nav-anchor' );
this.$subLists = this.$list.find( '.menu-item-has-children > .w-nav-list' );
this.$anchors = this.$nav.find( '.w-nav-anchor' );
this.$arrows = $( '.w-nav-arrow' );
var adminBar = $( '#wpadminbar' );
this.adminBarHeight = ( adminBar.length ) ? adminBar.height() : 0;
// Setting options
this.options = this.$nav.find( '.w-nav-options:first' )[ 0 ].onclick() || {};
// In case the nav doesn't exist, do nothing
if ( this.$nav.length == 0 ) {
return;
}
this.type = this.$nav.usMod( 'type' );
this.layout = this.$nav.usMod( 'layout' );
this.mobileOpened = false;
// Mobile menu toggler
this.$control.on( 'click', function() {
this.mobileOpened = ! this.mobileOpened;
if ( ! this.options.mobileBehavior ) {
// Making arrows focusable
this.$arrows.attr( 'tabindex', 0 );
}
this.$anchors.each( function() {
// Making empty links focusable and clickable to open a dropdown
if ( $( this ).attr( 'href' ) == undefined ) {
$( this ).attr( 'href', 'javascript:void(0)' );
}
} );
if ( this.layout != 'dropdown' ) {
this.$anchors.removeAttr( 'tabindex' );
}
if ( this.mobileOpened ) {
// Closing all other menus if present
$( '.l-header .w-nav' ).not( container ).each( function() {
$( this ).trigger( 'USNavClose' );
} );
// Closing opened sublists
this.$control.addClass( 'active' );
this.$items.filter( '.opened' ).removeClass( 'opened' );
this.$subLists.resetInlineCSS( 'display', 'height' );
if ( this.layout == 'dropdown' ) {
this.$list.slideDownCSS( 250, this._events.contentChanged );
}
$us.mobileNavOpened ++;
} else {
this.$control.removeClass( 'active' );
if ( this.layout == 'dropdown' ) {
this.$list.slideUpCSS( 250, this._events.contentChanged );
}
if ( ! this.options.mobileBehavior ) {
this.$arrows.removeAttr( 'tabindex' );
}
if ( this.layout != 'dropdown' ) {
this.$anchors.attr( 'tabindex', - 1 );
}
$us.mobileNavOpened --;
}
$us.$canvas.trigger( 'contentChange' );
}.bind( this ) );
this.$control.on( 'focusin', function( e ) {
if ( this.type != 'mobile' || this.layout == 'dropdown' ) {
return;
}
this.$anchors.attr( 'tabindex', - 1 );
}.bind( this ) );
// Close
this.$close.on( 'click', function() {
this.mobileOpened = false;
this.$control.removeClass( 'active' );
$us.mobileNavOpened --;
$us.$canvas.trigger( 'contentChange' );
}.bind( this ) );
// Close on ESC key pressed
$us.$document.keyup( function( e ) {
if ( e.keyCode == 27 ) {
if ( this.mobileOpened ) {
if ( this.layout == 'dropdown' ) {
this.$list.slideUpCSS( 250, this._events.contentChanged );
}
this.mobileOpened = false;
this.$control.removeClass( 'active' );
if ( ! this.options.mobileBehavior ) {
this.$arrows.removeAttr( 'tabindex' );
}
if ( this.layout != 'dropdown' ) {
this.$anchors.attr( 'tabindex', - 1 );
}
$us.mobileNavOpened --;
$us.$canvas.trigger( 'contentChange' );
}
}
}.bind( this ) );
// Bindable events
this._events = {
// Mobile submenu togglers
menuToggler: function( $item, show ) {
if ( this.type != 'mobile' ) {
return;
}
var $sublist = $item.children( '.w-nav-list' );
if ( show ) {
$item.addClass( 'opened' );
$sublist.slideDownCSS( 250, this._events.contentChanged );
} else {
$item.removeClass( 'opened' );
$sublist.slideUpCSS( 250, this._events.contentChanged );
}
}.bind( this ),
focusHandler: function( e ) {
if ( this.type == 'mobile' ) {
return;
}
var $item = $( e.target ).closest( '.menu-item' ),
$target = $( e.target );
$item.parents( '.menu-item' ).addClass( 'opened' );
$item.on( 'mouseleave', function() {
$target.blur();
} );
}.bind( this ),
blurHandler: function( e ) {
if ( this.type == 'mobile' ) {
return;
}
var $item = $( e.target ).closest( '.menu-item' );
$item.parents( '.menu-item' ).removeClass( 'opened' );
}.bind( this ),
clickHandler: function( e ) {
if ( this.type != 'mobile' ) {
return;
}
e.stopPropagation();
e.preventDefault();
var $item = $( e.currentTarget ).closest( '.menu-item' ),
isOpened = $item.hasClass( 'opened' );
this._events.menuToggler( $item, ! isOpened );
}.bind( this ),
keyDownHandler: function( e ) {
if ( this.type != 'mobile' ) {
return;
}
var keyCode = e.keyCode || e.which;
// Enter Handler for arrows
if ( keyCode == 13 ) {
var $target = $( e.target ),
$item = $target.closest( '.menu-item' ),
isOpened = $item.hasClass( 'opened' );
if ( ! $target.is( this.$arrows ) ) {
return;
}
e.stopPropagation();
e.preventDefault();
this._events.menuToggler( $item, ! isOpened );
}
// Tab handler
if ( keyCode == 9 ) {
var $target = $( e.target ) ? $( e.target ) : {},
i = this.$anchors.index( $target ),
isDropdownLayout = this.layout == 'dropdown' ? true : false,
closeMenu = function() {
// Close whole dropdown when going outside
if ( this.mobileOpened ) {
if ( isDropdownLayout ) {
this.$list.slideUpCSS( 250, this._events.contentChanged );
}
this.mobileOpened = false;
this.$control.removeClass( 'active' );
$us.mobileNavOpened --;
$us.$canvas.trigger( 'contentChange' );
if ( ! this.options.mobileBehavior ) {
this.$arrows.removeAttr( 'tabindex' );
}
if ( this.layout != 'dropdown' ) {
this.$anchors.attr( 'tabindex', - 1 );
}
}
}.bind( this );
if ( e.shiftKey ) {
if ( ( i === this.$anchors.length - 1 ) && this.layout != 'dropdown' ) {
this.$anchors.attr( 'tabindex', - 1 );
}
if ( i === 0 ) {
closeMenu();
}
} else {
if ( i === this.$anchors.length - 1 ) {
closeMenu();
}
}
}
}.bind( this ),
resize: this.resize.bind( this ),
contentChanged: function() {
if ( this.type == 'mobile' && $us.header.orientation == 'hor' && $us.canvas.headerPos == 'fixed' && this.layout == 'fixed' ) {
this.setFixedMobileMaxHeight();
}
$us.header.$container.trigger( 'contentChange' );
}.bind( this ),
close: function() {
if ( this.$list != undefined && jQuery.fn.slideUpCSS != undefined && this.mobileOpened && this.type == 'mobile' ) {
this.mobileOpened = false;
if ( this.layout == 'dropdown' && this.headerOrientation == 'hor' ) {
this.$list.slideUpCSS( 250 );
}
$us.mobileNavOpened --;
$us.$canvas.trigger( 'contentChange' );
}
}.bind( this )
};
// Toggle on item clicks
if ( this.options.mobileBehavior ) {
this.$subAnchors.on( 'click', this._events.clickHandler );
}
// Toggle on arrows
else {
this.$list.find( '.menu-item-has-children > .w-nav-anchor > .w-nav-arrow' ).on( 'click', this._events.clickHandler );
this.$list.find( '.menu-item-has-children > .w-nav-anchor > .w-nav-arrow' ).on( 'click', this._events.keyDownHandler );
}
// Mark all the togglable items
this.$subItems.each( function() {
var $this = $( this ),
$parentItem = $this.parent().closest( '.menu-item' );
if ( $parentItem.length == 0 || $parentItem.usMod( 'columns' ) === false ) {
$this.addClass( 'togglable' );
}
} );
// Touch screen handling for desktop type
if ( ! $us.$html.hasClass( 'no-touch' ) ) {
this.$list.find( '.menu-item-has-children.togglable > .w-nav-anchor' ).on( 'click', function( e ) {
if ( this.type == 'mobile' ) {
return;
}
e.preventDefault();
var $this = $( e.currentTarget ),
$item = $this.parent(),
$list = $item.children( '.w-nav-list' );
// Second tap: going to the URL
if ( $item.hasClass( 'opened' ) ) {
return location.assign( $this.attr( 'href' ) );
}
$item.addClass( 'opened' );
var outsideClickEvent = function( e ) {
if ( $.contains( $item[ 0 ], e.target ) ) {
return;
}
$item.removeClass( 'opened' );
$us.$body.off( 'touchstart', outsideClickEvent );
};
$us.$body.on( 'touchstart', outsideClickEvent );
}.bind( this ) );
}
// Close on click outside of level 1 menu list
$( $us.$document ).on( 'mouseup touchend', function( e ) {
if ( this.mobileOpened && this.type == 'mobile' ) {
if ( ! this.$control.is( e.target ) && this.$control.has( e.target ).length === 0 && ! this.$list.is( e.target ) && this.$list.has( e.target ).length === 0 ) {
this.mobileOpened = false;
this.$control.removeClass( 'active' );
this.$items.filter( '.opened' ).removeClass( 'opened' );
this.$subLists.slideUpCSS( 250 );
if ( this.layout == 'dropdown' && this.headerOrientation == 'hor' ) {
this.$list.slideUpCSS( 250 );
}
$us.mobileNavOpened --;
$us.$canvas.trigger( 'contentChange' );
}
}
}.bind( this ) );
// Accessibility
this.$anchors.on( 'focus.upsolution', this._events.focusHandler );
this.$anchors.on( 'blur.upsolution', this._events.blurHandler );
this.$nav.on( 'keydown.upsolution', this._events.keyDownHandler );
// Close menu on anchor clicks
this.$anchors.on( 'click', function( e ) {
if ( this.type != 'mobile' || $us.header.orientation != 'hor' ) {
return;
}
// Toggled the item
if ( this.options.mobileBehavior && $( e.currentTarget ).closest( '.menu-item' ).hasClass( 'menu-item-has-children' ) ) {
return;
}
this.mobileOpened = false;
this.$control.removeClass( 'active' );
if ( this.layout == 'dropdown' ) {
this.$list.slideUpCSS( 250 );
}
$us.mobileNavOpened --;
$us.$canvas.trigger( 'contentChange' );
}.bind( this ) );
$us.$window.on( 'resize', this._events.resize );
setTimeout( function() {
this.resize();
$us.header.$container.trigger( 'contentChange' );
}.bind( this ), 50 );
this.$nav.on( 'USNavClose', this._events.close );
},
/**
* Count proper dimensions
*/
setFixedMobileMaxHeight: function() {
//var listTop = Math.min(this.$list.position().top, $us.header.scrolledOccupiedHeight);
this.$list.css( 'max-height', $us.canvas.winHeight - this.adminBarHeight - $us.header.scrolledOccupiedHeight + 'px' );
},
/**
* Resize handler
*/
resize: function() {
if ( this.$nav.length == 0 ) {
return;
}
var nextType = ( window.innerWidth < this.options.mobileWidth ) ? 'mobile' : 'desktop';
if ( $us.header.orientation != this.headerOrientation || nextType != this.type ) {
// Clearing the previous state
this.$subLists.resetInlineCSS( 'display', 'height' );
if ( this.headerOrientation == 'hor' && this.type == 'mobile' ) {
this.$list.resetInlineCSS( 'display', 'height', 'max-height', 'opacity' );
}
// Closing opened sublists
this.$items.removeClass( 'opened' );
this.headerOrientation = $us.header.orientation;
this.type = nextType;
this.$nav.usMod( 'type', nextType );
if ( ! this.options.mobileBehavior ) {
this.$arrows.removeAttr( 'tabindex' );
}
if ( this.layout != 'dropdown' ) {
this.$anchors.removeAttr( 'tabindex' );
}
}
// Max-height limitation for fixed header layouts
var adminBar = $( '#wpadminbar' ),
isHeaderFixed = this.$nav.closest( 'header' ).hasClass( 'pos_fixed' );
this.adminBarHeight = ( adminBar.length ) ? adminBar.height() : 0;
if ( $us.header.orientation == 'hor' && this.type == 'mobile' && this.layout == 'dropdown' && isHeaderFixed ) {
this.setFixedMobileMaxHeight();
}
this.$list.removeClass( 'hide_for_mobiles' );
}
};
$.fn.usNav = function( options ) {
return this.each( function() {
$( this ).data( 'usNav', new $us.Nav( this, options ) );
} );
};
$( '.l-header .w-nav' ).usNav();
}( jQuery );
@@ -0,0 +1,41 @@
!function($){$us.Nav=function(container,options){this.init(container,options)};$us.mobileNavOpened=0;$us.Nav.prototype={init:function(container,options){this.$nav=$(container);if(this.$nav.length==0){return}
this.$control=this.$nav.find('.w-nav-control');this.$close=this.$nav.find('.w-nav-close');this.$items=this.$nav.find('.menu-item');this.$list=this.$nav.find('.w-nav-list.level_1');this.$subItems=this.$list.find('.menu-item-has-children');this.$subAnchors=this.$list.find('.menu-item-has-children > .w-nav-anchor');this.$subLists=this.$list.find('.menu-item-has-children > .w-nav-list');this.$anchors=this.$nav.find('.w-nav-anchor');this.$arrows=$('.w-nav-arrow');var adminBar=$('#wpadminbar');this.adminBarHeight=(adminBar.length)?adminBar.height():0;this.options=this.$nav.find('.w-nav-options:first')[0].onclick()||{};if(this.$nav.length==0){return}
this.type=this.$nav.usMod('type');this.layout=this.$nav.usMod('layout');this.mobileOpened=!1;this.$control.on('click',function(){this.mobileOpened=!this.mobileOpened;if(!this.options.mobileBehavior){this.$arrows.attr('tabindex',0)}
this.$anchors.each(function(){if($(this).attr('href')==undefined){$(this).attr('href','javascript:void(0)')}});if(this.layout!='dropdown'){this.$anchors.removeAttr('tabindex')}
if(this.mobileOpened){$('.l-header .w-nav').not(container).each(function(){$(this).trigger('USNavClose')});this.$control.addClass('active');this.$items.filter('.opened').removeClass('opened');this.$subLists.resetInlineCSS('display','height');if(this.layout=='dropdown'){this.$list.slideDownCSS(250,this._events.contentChanged)}
$us.mobileNavOpened ++}else{this.$control.removeClass('active');if(this.layout=='dropdown'){this.$list.slideUpCSS(250,this._events.contentChanged)}
if(!this.options.mobileBehavior){this.$arrows.removeAttr('tabindex')}
if(this.layout!='dropdown'){this.$anchors.attr('tabindex',-1)}
$us.mobileNavOpened --}
$us.$canvas.trigger('contentChange')}.bind(this));this.$control.on('focusin',function(e){if(this.type!='mobile'||this.layout=='dropdown'){return}
this.$anchors.attr('tabindex',-1)}.bind(this));this.$close.on('click',function(){this.mobileOpened=!1;this.$control.removeClass('active');$us.mobileNavOpened --;$us.$canvas.trigger('contentChange')}.bind(this));$us.$document.keyup(function(e){if(e.keyCode==27){if(this.mobileOpened){if(this.layout=='dropdown'){this.$list.slideUpCSS(250,this._events.contentChanged)}
this.mobileOpened=!1;this.$control.removeClass('active');if(!this.options.mobileBehavior){this.$arrows.removeAttr('tabindex')}
if(this.layout!='dropdown'){this.$anchors.attr('tabindex',-1)}
$us.mobileNavOpened --;$us.$canvas.trigger('contentChange')}}}.bind(this));this._events={menuToggler:function($item,show){if(this.type!='mobile'){return}
var $sublist=$item.children('.w-nav-list');if(show){$item.addClass('opened');$sublist.slideDownCSS(250,this._events.contentChanged)}else{$item.removeClass('opened');$sublist.slideUpCSS(250,this._events.contentChanged)}}.bind(this),focusHandler:function(e){if(this.type=='mobile'){return}
var $item=$(e.target).closest('.menu-item'),$target=$(e.target);$item.parents('.menu-item').addClass('opened');$item.on('mouseleave',function(){$target.blur()})}.bind(this),blurHandler:function(e){if(this.type=='mobile'){return}
var $item=$(e.target).closest('.menu-item');$item.parents('.menu-item').removeClass('opened')}.bind(this),clickHandler:function(e){if(this.type!='mobile'){return}
e.stopPropagation();e.preventDefault();var $item=$(e.currentTarget).closest('.menu-item'),isOpened=$item.hasClass('opened');this._events.menuToggler($item,!isOpened)}.bind(this),keyDownHandler:function(e){if(this.type!='mobile'){return}
var keyCode=e.keyCode||e.which;if(keyCode==13){var $target=$(e.target),$item=$target.closest('.menu-item'),isOpened=$item.hasClass('opened');if(!$target.is(this.$arrows)){return}
e.stopPropagation();e.preventDefault();this._events.menuToggler($item,!isOpened)}
if(keyCode==9){var $target=$(e.target)?$(e.target):{},i=this.$anchors.index($target),isDropdownLayout=this.layout=='dropdown'?!0:!1,closeMenu=function(){if(this.mobileOpened){if(isDropdownLayout){this.$list.slideUpCSS(250,this._events.contentChanged)}
this.mobileOpened=!1;this.$control.removeClass('active');$us.mobileNavOpened --;$us.$canvas.trigger('contentChange');if(!this.options.mobileBehavior){this.$arrows.removeAttr('tabindex')}
if(this.layout!='dropdown'){this.$anchors.attr('tabindex',-1)}}}.bind(this);if(e.shiftKey){if((i===this.$anchors.length-1)&&this.layout!='dropdown'){this.$anchors.attr('tabindex',-1)}
if(i===0){closeMenu()}}else{if(i===this.$anchors.length-1){closeMenu()}}}}.bind(this),resize:this.resize.bind(this),contentChanged:function(){if(this.type=='mobile'&&$us.header.orientation=='hor'&&$us.canvas.headerPos=='fixed'&&this.layout=='fixed'){this.setFixedMobileMaxHeight()}
$us.header.$container.trigger('contentChange')}.bind(this),close:function(){if(this.$list!=undefined&&jQuery.fn.slideUpCSS!=undefined&&this.mobileOpened&&this.type=='mobile'){this.mobileOpened=!1;if(this.layout=='dropdown'&&this.headerOrientation=='hor'){this.$list.slideUpCSS(250)}
$us.mobileNavOpened --;$us.$canvas.trigger('contentChange')}}.bind(this)};if(this.options.mobileBehavior){this.$subAnchors.on('click',this._events.clickHandler)}
else{this.$list.find('.menu-item-has-children > .w-nav-anchor > .w-nav-arrow').on('click',this._events.clickHandler);this.$list.find('.menu-item-has-children > .w-nav-anchor > .w-nav-arrow').on('click',this._events.keyDownHandler)}
this.$subItems.each(function(){var $this=$(this),$parentItem=$this.parent().closest('.menu-item');if($parentItem.length==0||$parentItem.usMod('columns')===!1){$this.addClass('togglable')}});if(!$us.$html.hasClass('no-touch')){this.$list.find('.menu-item-has-children.togglable > .w-nav-anchor').on('click',function(e){if(this.type=='mobile'){return}
e.preventDefault();var $this=$(e.currentTarget),$item=$this.parent(),$list=$item.children('.w-nav-list');if($item.hasClass('opened')){return location.assign($this.attr('href'))}
$item.addClass('opened');var outsideClickEvent=function(e){if($.contains($item[0],e.target)){return}
$item.removeClass('opened');$us.$body.off('touchstart',outsideClickEvent)};$us.$body.on('touchstart',outsideClickEvent)}.bind(this))}
$($us.$document).on('mouseup touchend',function(e){if(this.mobileOpened&&this.type=='mobile'){if(!this.$control.is(e.target)&&this.$control.has(e.target).length===0&&!this.$list.is(e.target)&&this.$list.has(e.target).length===0){this.mobileOpened=!1;this.$control.removeClass('active');this.$items.filter('.opened').removeClass('opened');this.$subLists.slideUpCSS(250);if(this.layout=='dropdown'&&this.headerOrientation=='hor'){this.$list.slideUpCSS(250)}
$us.mobileNavOpened --;$us.$canvas.trigger('contentChange')}}}.bind(this));this.$anchors.on('focus.upsolution',this._events.focusHandler);this.$anchors.on('blur.upsolution',this._events.blurHandler);this.$nav.on('keydown.upsolution',this._events.keyDownHandler);this.$anchors.on('click',function(e){if(this.type!='mobile'||$us.header.orientation!='hor'){return}
if(this.options.mobileBehavior&&$(e.currentTarget).closest('.menu-item').hasClass('menu-item-has-children')){return}
this.mobileOpened=!1;this.$control.removeClass('active');if(this.layout=='dropdown'){this.$list.slideUpCSS(250)}
$us.mobileNavOpened --;$us.$canvas.trigger('contentChange')}.bind(this));$us.$window.on('resize',this._events.resize);setTimeout(function(){this.resize();$us.header.$container.trigger('contentChange')}.bind(this),50);this.$nav.on('USNavClose',this._events.close)},setFixedMobileMaxHeight:function(){this.$list.css('max-height',$us.canvas.winHeight-this.adminBarHeight-$us.header.scrolledOccupiedHeight+'px')},resize:function(){if(this.$nav.length==0){return}
var nextType=(window.innerWidth<this.options.mobileWidth)?'mobile':'desktop';if($us.header.orientation!=this.headerOrientation||nextType!=this.type){this.$subLists.resetInlineCSS('display','height');if(this.headerOrientation=='hor'&&this.type=='mobile'){this.$list.resetInlineCSS('display','height','max-height','opacity')}
this.$items.removeClass('opened');this.headerOrientation=$us.header.orientation;this.type=nextType;this.$nav.usMod('type',nextType);if(!this.options.mobileBehavior){this.$arrows.removeAttr('tabindex')}
if(this.layout!='dropdown'){this.$anchors.removeAttr('tabindex')}}
var adminBar=$('#wpadminbar'),isHeaderFixed=this.$nav.closest('header').hasClass('pos_fixed');this.adminBarHeight=(adminBar.length)?adminBar.height():0;if($us.header.orientation=='hor'&&this.type=='mobile'&&this.layout=='dropdown'&&isHeaderFixed){this.setFixedMobileMaxHeight()}
this.$list.removeClass('hide_for_mobiles')}};$.fn.usNav=function(options){return this.each(function(){$(this).data('usNav',new $us.Nav(this,options))})};$('.l-header .w-nav').usNav()}(jQuery)
@@ -0,0 +1,28 @@
/**
* UpSolution Element: Message
*/
( function( $ ) {
"use strict";
$.fn.usMessage = function() {
return this.each( function() {
var $this = $( this ),
$closer = $this.find( '.w-message-close' );
$closer.click( function() {
$this.wrap( '<div></div>' );
var $wrapper = $this.parent();
$wrapper.css( { overflow: 'hidden', height: $this.outerHeight( true ) } );
$wrapper.performCSSTransition( {
height: 0
}, 300, function() {
$wrapper.remove();
$us.$canvas.trigger( 'contentChange' );
}, 'cubic-bezier(.4,0,.2,1)' );
} );
} );
};
$( function() {
$( '.w-message' ).usMessage();
} );
} )( jQuery );
@@ -0,0 +1 @@
(function($){"use strict";$.fn.usMessage=function(){return this.each(function(){var $this=$(this),$closer=$this.find('.w-message-close');$closer.click(function(){$this.wrap('<div></div>');var $wrapper=$this.parent();$wrapper.css({overflow:'hidden',height:$this.outerHeight(!0)});$wrapper.performCSSTransition({height:0},300,function(){$wrapper.remove();$us.$canvas.trigger('contentChange')},'cubic-bezier(.4,0,.2,1)')})})};$(function(){$('.w-message').usMessage()})})(jQuery)
@@ -0,0 +1,279 @@
/**
* UpSolution Element: Page Scroller
*/
( function( $ ) {
"use strict";
$us.PageScroller = function( container, options ) {
this.init( container, options );
};
$us.PageScroller.prototype = {
init: function( container, options ) {
var defaults = {
coolDown: 100,
animationDuration: 1000,
animationEasing: 'easeInOutExpo'
},
scrollTop = parseInt( $us.$window.scrollTop() );
this.options = $.extend( {}, defaults, options );
this.$container = $( container );
this._canvasTopOffset = $us.$canvas.offset().top;
this.activeSection = 0;
this.sections = [];
this.dots = [];
this.scrolls = [];
this.usingDots = false;
this.isTouch = ( ( 'ontouchstart' in window ) || ( navigator.msMaxTouchPoints > 0 ) || ( navigator.maxTouchPoints ) );
this.disableWidth = ( this.$container.data( 'disablewidth' ) !== undefined ) ? this.$container.data( 'disablewidth' ) : 768;
if ( this.$container.data( 'speed' ) !== undefined ) {
this.options.animationDuration = this.$container.data( 'speed' );
}
// Adding header if isn't sticky
if ( $us.canvas.headerPos == 'static' && $us.header.orientation == 'hor' ) {
$us.canvas.$header.each( function() {
var $section = $us.canvas.$header,
section = {
$section: $section
};
this._countPosition( section );
this.sections.push( section );
}.bind( this ) );
}
// Adding canvas sections
$us.$canvas.find( '.l-section' ).each( function( key, elm ) {
var $section = $( elm ),
section = {
$section: $section
};
this._countPosition( section );
this.sections.push( section );
}.bind( this ) );
// Adding dots for canvas sections
this.$dotsContainer = this.$container.find( '.w-scroller-dots' );
if ( this.$dotsContainer.length ) {
this.usingDots = true;
this.$firstDot = this.$dotsContainer.find( '.w-scroller-dot' ).first();
for ( var i = 1; i < this.sections.length; i ++ ) {
this.$firstDot.clone().appendTo( this.$dotsContainer );
}
this.$dots = this.$dotsContainer.find( '.w-scroller-dot' );
this.$dots.each( function( key, elm ) {
var $dot = $( elm );
this.dots[ key ] = $dot;
$dot.click( function() {
this.scrollTo( key );
this.$dots.removeClass( 'active' );
$dot.addClass( 'active' );
}.bind( this ) );
}.bind( this ) );
this.dots[ this.activeSection ].addClass( 'active' );
this.$dotsContainer.addClass( 'show' );
}
// Adding footer sections
$( '.l-footer > .l-section' ).each( function( key, elm ) {
var $section = $( elm ),
section = {
$section: $section
};
this._countPosition( section );
this.sections.push( section );
}.bind( this ) );
this._attachEvents();
// Boundable events
this._events = {
scroll: this.scroll.bind( this ),
resize: this.resize.bind( this )
};
$us.$canvas.on( 'contentChange', this._events.resize );
$us.$window.on( 'resize load', this._events.resize );
$us.$window.on( 'resize load scroll', this._events.scroll );
setTimeout( this._events.resize, 100 );
},
getScrollSpeed: function( number ) {
var sum = 0;
var lastElements = this.scrolls.slice( Math.max( this.scrolls.length - number, 1 ) );
for ( var i = 0; i < lastElements.length; i ++ ) {
sum = sum + lastElements[ i ];
}
return Math.ceil( sum / number );
},
_attachEvents: function() {
$us.$document.off( 'mousewheel DOMMouseScroll MozMousePixelScroll' );
$us.$canvas.off( 'touchstart touchmove' );
if ( $us.$window.width() > this.disableWidth && $us.mobileNavOpened <= 0 && ( ! $us.$html.hasClass( 'cloverlay_fixed' ) ) ) {
$us.$document.on( 'mousewheel DOMMouseScroll MozMousePixelScroll', function( e ) {
e.preventDefault();
var currentTime = new Date().getTime(),
target = this.activeSection,
direction = e.originalEvent.wheelDelta || - e.originalEvent.detail,
speedEnd, speedMiddle, isAccelerating;
if ( this.scrolls.length > 149 ) {
this.scrolls.shift();
}
this.scrolls.push( Math.abs( direction ) );
if ( ( currentTime - this.previousMouseWheelTime ) > this.options.coolDown ) {
this.scrolls = [];
}
this.previousMouseWheelTime = currentTime;
speedEnd = this.getScrollSpeed( 10 );
speedMiddle = this.getScrollSpeed( 70 );
isAccelerating = speedEnd >= speedMiddle;
if ( isAccelerating ) {
if ( direction < 0 ) {
target ++;
} else if ( direction > 0 ) {
target --;
}
if ( this.sections[ target ] == undefined ) {
return;
}
this.scrollTo( target );
this.lastScroll = currentTime;
}
}.bind( this ) );
if ( $.isMobile || this.isTouch ) {
$us.$canvas.on( 'touchstart', function( event ) {
var e = event.originalEvent;
if ( typeof e.pointerType === 'undefined' || e.pointerType != 'mouse' ) {
this.touchStartY = e.touches[ 0 ].pageY;
}
}.bind( this ) );
$us.$canvas.on( 'touchmove', function( event ) {
event.preventDefault();
var currentTime = new Date().getTime(),
e = event.originalEvent,
target = this.activeSection;
this.touchEndY = e.touches[ 0 ].pageY;
if ( Math.abs( this.touchStartY - this.touchEndY ) > ( $us.$window.height() / 50 ) ) {
if ( this.touchStartY > this.touchEndY ) {
target ++;
} else if ( this.touchEndY > this.touchStartY ) {
target --;
}
if ( this.sections[ target ] == undefined ) {
return;
}
this.scrollTo( target );
this.lastScroll = currentTime;
}
}.bind( this ) );
}
}
},
_countPosition: function( section ) {
section.top = section.$section.offset().top - this._canvasTopOffset;
if ( $us.header.headerTop === undefined || ( $us.header.headerTop > 0 && section.top > $us.header.headerTop ) ) {
section.top = section.top - $us.header.scrolledOccupiedHeight;
}
section.bottom = section.top + section.$section.outerHeight( false );
},
_countAllPositions: function() {
for ( var section in this.sections ) {
if ( this.sections[ section ].$section.length ) {
this._countPosition( this.sections[ section ] );
}
}
},
scrollTo: function( target ) {
var currentTime = new Date().getTime();
if ( this.previousScrollTime !== undefined && ( currentTime - this.previousScrollTime < this.options.animationDuration ) ) {
return;
}
this.previousScrollTime = currentTime;
if ( this.usingDots ) {
this.$dots.removeClass( 'active' );
if ( this.dots[ target ] !== undefined ) {
this.dots[ target ].addClass( 'active' );
}
}
$us.$htmlBody.stop( true, false ).animate( {
scrollTop: this.sections[ target ][ 'top' ] + 'px'
}, {
duration: this.options.animationDuration,
easing: this.options.animationEasing,
always: function() {
this.activeSection = target;
}.bind( this )
} );
},
resize: function() {
this._attachEvents();
// Delaying the resize event to prevent glitches
setTimeout( function() {
this._countAllPositions();
// this.scrollTo(this.activeSection);
}.bind( this ), 150 );
this._countAllPositions();
// this.scrollTo(this.activeSection);
},
scroll: function() {
var currentTime = new Date().getTime();
if ( ( currentTime - this.lastScroll ) < ( this.options.coolDown + this.options.animationDuration ) ) {
return;
}
if ( this.scrollTimeout ) {
clearTimeout( this.scrollTimeout );
}
this.scrollTimeout = setTimeout( function() {
var scrollTop = parseInt( $us.$window.scrollTop() );
for ( var section in this.sections ) {
if ( scrollTop >= ( this.sections[ section ].top - 1 ) && scrollTop < ( this.sections[ section ].bottom - 1 ) ) {
this.activeSection = section;
break;
}
}
if ( this.usingDots ) {
this.$dots.removeClass( 'active' );
if ( this.dots[ this.activeSection ] !== undefined ) {
this.dots[ this.activeSection ].addClass( 'active' );
}
}
}.bind( this ), 500 );
}
};
$.fn.usPageScroller = function( options ) {
return this.each( function() {
$( this ).data( 'usPageScroller', new $us.PageScroller( this, options ) );
} );
};
$( function() {
$( '.w-scroller' ).usPageScroller();
} );
} )( jQuery );
@@ -0,0 +1,18 @@
(function($){"use strict";$us.PageScroller=function(container,options){this.init(container,options)};$us.PageScroller.prototype={init:function(container,options){var defaults={coolDown:100,animationDuration:1000,animationEasing:'easeInOutExpo'},scrollTop=parseInt($us.$window.scrollTop());this.options=$.extend({},defaults,options);this.$container=$(container);this._canvasTopOffset=$us.$canvas.offset().top;this.activeSection=0;this.sections=[];this.dots=[];this.scrolls=[];this.usingDots=!1;this.isTouch=(('ontouchstart' in window)||(navigator.msMaxTouchPoints>0)||(navigator.maxTouchPoints));this.disableWidth=(this.$container.data('disablewidth')!==undefined)?this.$container.data('disablewidth'):768;if(this.$container.data('speed')!==undefined){this.options.animationDuration=this.$container.data('speed')}
if($us.canvas.headerPos=='static'&&$us.header.orientation=='hor'){$us.canvas.$header.each(function(){var $section=$us.canvas.$header,section={$section:$section};this._countPosition(section);this.sections.push(section)}.bind(this))}
$us.$canvas.find('.l-section').each(function(key,elm){var $section=$(elm),section={$section:$section};this._countPosition(section);this.sections.push(section)}.bind(this));this.$dotsContainer=this.$container.find('.w-scroller-dots');if(this.$dotsContainer.length){this.usingDots=!0;this.$firstDot=this.$dotsContainer.find('.w-scroller-dot').first();for(var i=1;i<this.sections.length;i ++){this.$firstDot.clone().appendTo(this.$dotsContainer)}
this.$dots=this.$dotsContainer.find('.w-scroller-dot');this.$dots.each(function(key,elm){var $dot=$(elm);this.dots[key]=$dot;$dot.click(function(){this.scrollTo(key);this.$dots.removeClass('active');$dot.addClass('active')}.bind(this))}.bind(this));this.dots[this.activeSection].addClass('active');this.$dotsContainer.addClass('show')}
$('.l-footer > .l-section').each(function(key,elm){var $section=$(elm),section={$section:$section};this._countPosition(section);this.sections.push(section)}.bind(this));this._attachEvents();this._events={scroll:this.scroll.bind(this),resize:this.resize.bind(this)};$us.$canvas.on('contentChange',this._events.resize);$us.$window.on('resize load',this._events.resize);$us.$window.on('resize load scroll',this._events.scroll);setTimeout(this._events.resize,100)},getScrollSpeed:function(number){var sum=0;var lastElements=this.scrolls.slice(Math.max(this.scrolls.length-number,1));for(var i=0;i<lastElements.length;i ++){sum=sum+lastElements[i]}
return Math.ceil(sum/number)},_attachEvents:function(){$us.$document.off('mousewheel DOMMouseScroll MozMousePixelScroll');$us.$canvas.off('touchstart touchmove');if($us.$window.width()>this.disableWidth&&$us.mobileNavOpened<=0&&(!$us.$html.hasClass('cloverlay_fixed'))){$us.$document.on('mousewheel DOMMouseScroll MozMousePixelScroll',function(e){e.preventDefault();var currentTime=new Date().getTime(),target=this.activeSection,direction=e.originalEvent.wheelDelta||-e.originalEvent.detail,speedEnd,speedMiddle,isAccelerating;if(this.scrolls.length>149){this.scrolls.shift()}
this.scrolls.push(Math.abs(direction));if((currentTime-this.previousMouseWheelTime)>this.options.coolDown){this.scrolls=[]}
this.previousMouseWheelTime=currentTime;speedEnd=this.getScrollSpeed(10);speedMiddle=this.getScrollSpeed(70);isAccelerating=speedEnd>=speedMiddle;if(isAccelerating){if(direction<0){target ++}else if(direction>0){target --}
if(this.sections[target]==undefined){return}
this.scrollTo(target);this.lastScroll=currentTime}}.bind(this));if($.isMobile||this.isTouch){$us.$canvas.on('touchstart',function(event){var e=event.originalEvent;if(typeof e.pointerType==='undefined'||e.pointerType!='mouse'){this.touchStartY=e.touches[0].pageY}}.bind(this));$us.$canvas.on('touchmove',function(event){event.preventDefault();var currentTime=new Date().getTime(),e=event.originalEvent,target=this.activeSection;this.touchEndY=e.touches[0].pageY;if(Math.abs(this.touchStartY-this.touchEndY)>($us.$window.height()/50)){if(this.touchStartY>this.touchEndY){target ++}else if(this.touchEndY>this.touchStartY){target --}
if(this.sections[target]==undefined){return}
this.scrollTo(target);this.lastScroll=currentTime}}.bind(this))}}},_countPosition:function(section){section.top=section.$section.offset().top-this._canvasTopOffset;if($us.header.headerTop===undefined||($us.header.headerTop>0&&section.top>$us.header.headerTop)){section.top=section.top-$us.header.scrolledOccupiedHeight}
section.bottom=section.top+section.$section.outerHeight(!1)},_countAllPositions:function(){for(var section in this.sections){if(this.sections[section].$section.length){this._countPosition(this.sections[section])}}},scrollTo:function(target){var currentTime=new Date().getTime();if(this.previousScrollTime!==undefined&&(currentTime-this.previousScrollTime<this.options.animationDuration)){return}
this.previousScrollTime=currentTime;if(this.usingDots){this.$dots.removeClass('active');if(this.dots[target]!==undefined){this.dots[target].addClass('active')}}
$us.$htmlBody.stop(!0,!1).animate({scrollTop:this.sections[target].top+'px'},{duration:this.options.animationDuration,easing:this.options.animationEasing,always:function(){this.activeSection=target}.bind(this)})},resize:function(){this._attachEvents();setTimeout(function(){this._countAllPositions()}.bind(this),150);this._countAllPositions()},scroll:function(){var currentTime=new Date().getTime();if((currentTime-this.lastScroll)<(this.options.coolDown+this.options.animationDuration)){return}
if(this.scrollTimeout){clearTimeout(this.scrollTimeout)}
this.scrollTimeout=setTimeout(function(){var scrollTop=parseInt($us.$window.scrollTop());for(var section in this.sections){if(scrollTop>=(this.sections[section].top-1)&&scrollTop<(this.sections[section].bottom-1)){this.activeSection=section;break}}
if(this.usingDots){this.$dots.removeClass('active');if(this.dots[this.activeSection]!==undefined){this.dots[this.activeSection].addClass('active')}}}.bind(this),500)}};$.fn.usPageScroller=function(options){return this.each(function(){$(this).data('usPageScroller',new $us.PageScroller(this,options))})};$(function(){$('.w-scroller').usPageScroller()})})(jQuery)
@@ -0,0 +1,128 @@
/**
* UpSolution Element: Modal Popup
*/
! function( $ ) {
"use strict";
$us.WPopup = function( container ) {
this.$container = $( container );
this._events = {
show: this.show.bind( this ),
afterShow: this.afterShow.bind( this ),
hide: this.hide.bind( this ),
preventHide: function( e ) {
e.stopPropagation();
},
afterHide: this.afterHide.bind( this ),
keyup: function( e ) {
if ( e.key == "Escape" ) {
this.hide();
}
}.bind( this )
};
// Event name for triggering CSS transition finish
this.transitionEndEvent = ( navigator.userAgent.search( /webkit/i ) > 0 ) ? 'webkitTransitionEnd' : 'transitionend';
this.isFixed = ! jQuery.isMobile;
this.$trigger = this.$container.find( '.w-popup-trigger' );
this.triggerType = this.$trigger.usMod( 'type' );
if ( this.triggerType == 'load' ) {
var delay = this.$trigger.data( 'delay' ) || 2;
setTimeout( this.show.bind( this ), delay * 1000 );
} else if ( this.triggerType == 'selector' ) {
var selector = this.$trigger.data( 'selector' );
if ( selector ) {
$us.$body.on( 'click', selector, this._events.show );
}
} else {
this.$trigger.on( 'click', this._events.show );
}
this.$wrap = this.$container.find( '.w-popup-wrap' )
.usMod( 'pos', this.isFixed ? 'fixed' : 'absolute' )
.on( 'click', this._events.hide );
this.$box = this.$container.find( '.w-popup-box' );
this.$overlay = this.$container.find( '.w-popup-overlay' )
.usMod( 'pos', this.isFixed ? 'fixed' : 'absolute' )
.on( 'click', this._events.hide );
this.$container.find( '.w-popup-closer' ).on( 'click', this._events.hide );
this.$box.on( 'click', this._events.preventHide );
this.timer = null;
};
$us.WPopup.prototype = {
_hasScrollbar: function() {
return document.documentElement.scrollHeight > document.documentElement.clientHeight;
},
_getScrollbarSize: function() {
if ( $us.scrollbarSize === undefined ) {
var scrollDiv = document.createElement( 'div' );
scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
document.body.appendChild( scrollDiv );
$us.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
document.body.removeChild( scrollDiv );
}
return $us.scrollbarSize;
},
show: function() {
clearTimeout( this.timer );
this.$overlay.appendTo( $us.$body ).show();
this.$wrap.appendTo( $us.$body ).css( 'display', 'flex' );
if ( this.isFixed ) {
$us.$html.addClass( 'usoverlay_fixed' );
// Storing the value for the whole popup visibility session
this.windowHasScrollbar = this._hasScrollbar();
if ( this.windowHasScrollbar && this._getScrollbarSize() ) {
$us.$html.css( 'margin-right', this._getScrollbarSize() );
}
} else {
this.$overlay.css( {
height: $us.$document.height()
} );
this.$wrap.css( 'top', $us.$window.scrollTop() );
}
$us.$body.on( 'keyup', this._events.keyup );
this.timer = setTimeout( this._events.afterShow, 25 );
},
afterShow: function() {
clearTimeout( this.timer );
this.$overlay.addClass( 'active' );
this.$box.addClass( 'active' );
if ( window.$us !== undefined && $us.$canvas !== undefined ) {
$us.$canvas.trigger( 'contentChange' );
}
$us.$window.trigger( 'resize' );
},
hide: function() {
clearTimeout( this.timer );
$us.$body.off( 'keyup', this._events.keyup );
this.$box.on( this.transitionEndEvent, this._events.afterHide );
this.$overlay.removeClass( 'active' );
this.$box.removeClass( 'active' );
// Closing it anyway
this.timer = setTimeout( this._events.afterHide, 1000 );
},
afterHide: function() {
clearTimeout( this.timer );
this.$box.off( this.transitionEndEvent, this._events.afterHide );
this.$overlay.appendTo( this.$container ).hide();
this.$wrap.appendTo( this.$container ).hide();
if ( this.isFixed ) {
$us.$html.removeClass( 'usoverlay_fixed' );
if ( this.windowHasScrollbar ) {
$us.$html.css( 'margin-right', '' );
}
$us.$window.trigger( 'resize' );
}
},
};
$.fn.wPopup = function( options ) {
return this.each( function() {
$( this ).data( 'wPopup', new $us.WPopup( this, options ) );
} );
};
$( function() {
$( '.w-popup' ).wPopup();
} );
}( jQuery );
@@ -0,0 +1,6 @@
!function($){"use strict";$us.WPopup=function(container){this.$container=$(container);this._events={show:this.show.bind(this),afterShow:this.afterShow.bind(this),hide:this.hide.bind(this),preventHide:function(e){e.stopPropagation()},afterHide:this.afterHide.bind(this),keyup:function(e){if(e.key=="Escape"){this.hide()}}.bind(this)};this.transitionEndEvent=(navigator.userAgent.search(/webkit/i)>0)?'webkitTransitionEnd':'transitionend';this.isFixed=!jQuery.isMobile;this.$trigger=this.$container.find('.w-popup-trigger');this.triggerType=this.$trigger.usMod('type');if(this.triggerType=='load'){var delay=this.$trigger.data('delay')||2;setTimeout(this.show.bind(this),delay*1000)}else if(this.triggerType=='selector'){var selector=this.$trigger.data('selector');if(selector){$us.$body.on('click',selector,this._events.show)}}else{this.$trigger.on('click',this._events.show)}
this.$wrap=this.$container.find('.w-popup-wrap').usMod('pos',this.isFixed?'fixed':'absolute').on('click',this._events.hide);this.$box=this.$container.find('.w-popup-box');this.$overlay=this.$container.find('.w-popup-overlay').usMod('pos',this.isFixed?'fixed':'absolute').on('click',this._events.hide);this.$container.find('.w-popup-closer').on('click',this._events.hide);this.$box.on('click',this._events.preventHide);this.timer=null};$us.WPopup.prototype={_hasScrollbar:function(){return document.documentElement.scrollHeight>document.documentElement.clientHeight},_getScrollbarSize:function(){if($us.scrollbarSize===undefined){var scrollDiv=document.createElement('div');scrollDiv.style.cssText='width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';document.body.appendChild(scrollDiv);$us.scrollbarSize=scrollDiv.offsetWidth-scrollDiv.clientWidth;document.body.removeChild(scrollDiv)}
return $us.scrollbarSize},show:function(){clearTimeout(this.timer);this.$overlay.appendTo($us.$body).show();this.$wrap.appendTo($us.$body).css('display','flex');if(this.isFixed){$us.$html.addClass('usoverlay_fixed');this.windowHasScrollbar=this._hasScrollbar();if(this.windowHasScrollbar&&this._getScrollbarSize()){$us.$html.css('margin-right',this._getScrollbarSize())}}else{this.$overlay.css({height:$us.$document.height()});this.$wrap.css('top',$us.$window.scrollTop())}
$us.$body.on('keyup',this._events.keyup);this.timer=setTimeout(this._events.afterShow,25)},afterShow:function(){clearTimeout(this.timer);this.$overlay.addClass('active');this.$box.addClass('active');if(window.$us!==undefined&&$us.$canvas!==undefined){$us.$canvas.trigger('contentChange')}
$us.$window.trigger('resize')},hide:function(){clearTimeout(this.timer);$us.$body.off('keyup',this._events.keyup);this.$box.on(this.transitionEndEvent,this._events.afterHide);this.$overlay.removeClass('active');this.$box.removeClass('active');this.timer=setTimeout(this._events.afterHide,1000)},afterHide:function(){clearTimeout(this.timer);this.$box.off(this.transitionEndEvent,this._events.afterHide);this.$overlay.appendTo(this.$container).hide();this.$wrap.appendTo(this.$container).hide();if(this.isFixed){$us.$html.removeClass('usoverlay_fixed');if(this.windowHasScrollbar){$us.$html.css('margin-right','')}
$us.$window.trigger('resize')}},};$.fn.wPopup=function(options){return this.each(function(){$(this).data('wPopup',new $us.WPopup(this,options))})};$(function(){$('.w-popup').wPopup()})}(jQuery)
@@ -0,0 +1,56 @@
/**
* UpSolution Element: Progbar
*/
( function( $ ) {
$.fn.wProgbar = function() {
return this.each( function() {
var $container = $( this ),
count = $container.data( 'count' ) + '',
$titleCount = $container.find( '.w-progbar-title-count' ),
$barCount = $container.find( '.w-progbar-bar-count' );
// Prevent double init
if ( $container.data( 'progBarInit' ) == 1 ) {
return;
}
$container.data( 'progBarInit', 1 );
if ( count === null ) {
count = 50;
}
if ( /bot|googlebot|crawler|spider|robot|crawling/i.test( navigator.userAgent ) ) {
$container.removeClass( 'initial' );
$titleCount.html( count + '%' );
$barCount.html( count + '%' );
return;
}
$titleCount.html( '0%' );
$barCount.html( '0%' );
$us.scroll.addWaypoint( this, '15%', function() {
var current = 0,
step = 40,
stepValue = count / 40,
interval = setInterval( function() {
current += stepValue;
step --;
$titleCount.html( current.toFixed( 0 ) + '%' );
$barCount.html( current.toFixed( 0 ) + '%' );
if ( step <= 0 ) {
$titleCount.html( count + '%' );
$barCount.html( count + '%' );
window.clearInterval( interval );
}
}, 20 );
$container.removeClass( 'initial' );
} );
} );
};
$( function() {
jQuery( '.w-progbar' ).wProgbar();
} );
} )( jQuery );
@@ -0,0 +1,4 @@
(function($){$.fn.wProgbar=function(){return this.each(function(){var $container=$(this),count=$container.data('count')+'',$titleCount=$container.find('.w-progbar-title-count'),$barCount=$container.find('.w-progbar-bar-count');if($container.data('progBarInit')==1){return}
$container.data('progBarInit',1);if(count===null){count=50}
if(/bot|googlebot|crawler|spider|robot|crawling/i.test(navigator.userAgent)){$container.removeClass('initial');$titleCount.html(count+'%');$barCount.html(count+'%');return}
$titleCount.html('0%');$barCount.html('0%');$us.scroll.addWaypoint(this,'15%',function(){var current=0,step=40,stepValue=count/40,interval=setInterval(function(){current+=stepValue;step --;$titleCount.html(current.toFixed(0)+'%');$barCount.html(current.toFixed(0)+'%');if(step<=0){$titleCount.html(count+'%');$barCount.html(count+'%');window.clearInterval(interval)}},20);$container.removeClass('initial')})})};$(function(){jQuery('.w-progbar').wProgbar()})})(jQuery)
@@ -0,0 +1,144 @@
/**
* UpSolution Element: Sharing Buttons
*/
! function( $ ) {
"use strict";
function WShare( selector ) {
var $this = $( selector ),
$parent = $this.parent(),
first_image_src,
opt = {
url: window.location,
text: document.title,
lang: document.documentElement.lang,
image: $( 'meta[name="og:image"]' ).attr( 'content' ) || ''
};
if ( window.selectedText ) {
opt.text = window.selectedText;
}
if ( $parent.attr( 'data-sharing-url' ) !== undefined && $parent.attr( 'data-sharing-url' ) !== '' ) {
opt.url = $parent.attr( 'data-sharing-url' );
}
if ( $parent.attr( 'data-sharing-image' ) !== undefined && $parent.attr( 'data-sharing-image' ) !== '' ) {
opt.image = $parent.attr( 'data-sharing-image' );
}
if ( opt.image === '' || opt.image === undefined ) {
first_image_src = $( 'img' ).first().attr( 'src' );
if ( first_image_src !== undefined && first_image_src !== '' ) {
opt.image = first_image_src;
}
}
if ( $this.hasClass( 'facebook' ) ) {
window.open( "https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent( opt.url ) + "&quote=" + encodeURIComponent( opt.text ) + "", "facebook", "toolbar=0, status=0, width=900, height=500" );
} else if ( $this.hasClass( 'twitter' ) ) {
window.open( "https://twitter.com/intent/tweet?text=" + encodeURIComponent( opt.text ) + "&url=" + encodeURIComponent( opt.url ), "twitter", "toolbar=0, status=0, width=650, height=360" );
} else if ( $this.hasClass( 'linkedin' ) ) {
window.open( 'https://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent( opt.url ), 'linkedin', 'toolbar=no,width=550,height=550' );
} else if ( $this.hasClass( 'whatsapp' ) ) {
if ( jQuery.isMobile ) {
window.open( "https://api.whatsapp.com/send?text=" + encodeURIComponent( opt.text + ' ' + opt.url ), "whatsapp", "toolbar=0, status=0, width=900, height=500" );
} else {
window.open( "https://web.whatsapp.com/send?text=" + encodeURIComponent( opt.text + ' ' + opt.url ), "whatsapp", "toolbar=0, status=0, width=900, height=500" );
}
} else if ( $this.hasClass( 'xing' ) ) {
window.open( "https://www.xing.com/spi/shares/new?url=" + encodeURIComponent( opt.url ), "xing", "toolbar=no, status=0, width=900, height=500" );
} else if ( $this.hasClass( 'reddit' ) ) {
window.open( "https://www.reddit.com/submit?url=" + encodeURIComponent( opt.url ) + "&title=" + encodeURIComponent( opt.text ), "reddit", "toolbar=no, status=0, width=900, height=500" );
} else if ( $this.hasClass( 'pinterest' ) ) {
window.open( 'https://www.pinterest.com/pin/create/button/?url=' + encodeURIComponent( opt.url ) + '&media=' + encodeURIComponent( opt.image ) + '&description=' + encodeURIComponent( opt.text ), 'pinterest', 'toolbar=no,width=700,height=300' );
} else if ( $this.hasClass( 'vk' ) ) {
window.open( 'https://vk.com/share.php?url=' + encodeURIComponent( opt.url ) + '&title=' + encodeURIComponent( opt.text ) + '&description=&image=' + encodeURIComponent( opt.image ),'vk','toolbar=no,width=700,height=300' );
} else if ( $this.hasClass( 'email' ) ) {
window.location = 'mailto:?subject=' + opt.text + '&body=' + encodeURIComponent ( opt.url );
}
}
// Enable sharing via text selection
if ( $( '.w-sharing-tooltip' ).length ) {
var activeArea = '.l-main';
// If Allow sharing in post content only
if ( $( '.w-sharing-tooltip' ).attr( 'data-sharing-area' ) === 'post_content' ) {
activeArea = '.w-post-elm.post_content';
}
// Close tooltip if click anywhere on page
$( 'body' ).not( activeArea ).bind( 'mouseup', function() {
var selection;
if ( window.getSelection ) {
selection = window.getSelection();
} else if ( document.selection ) {
selection = document.selection.createRange();
}
if ( selection.toString() === '' ) {
$( ".w-sharing-tooltip.active:visible" ).hide();
}
} );
// Open tooltip
$( activeArea ).bind( 'mouseup', function( e ) {
var selection, tooltip = '', url, $copy2clipboard = $( '.w-sharing-item.copy2clipboard' );
if ( window.getSelection ) {
selection = window.getSelection();
} else if ( document.selection ) {
selection = document.selection.createRange();
}
$( ".w-sharing-tooltip" ).each( function() {
if ( $( this ).hasClass( 'active' ) ) {
tooltip = this;
}
} );
// mark first tooltip as active
if ( tooltip === '' ) {
$( ".w-sharing-tooltip:first" ).addClass( 'active' );
$( ".w-sharing-tooltip.active" ).appendTo( "body" );
tooltip = ".w-sharing-tooltip.active";
}
//copy selected text to window.selectedText and show tooltip
if ( selection.toString() !== '' ) {
window.selectedText = selection.toString();
$( tooltip ).css( {
"display": "inline-block", "left": e.pageX, "top": e.pageY - 50,
} );
} else {
window.selectedText = '';
$( tooltip ).hide();
}
//if copy
$copy2clipboard.on( 'click', function() {
// get url
if ( $copy2clipboard.parent().attr( 'data-sharing-url' ) !== undefined && $copy2clipboard.parent().attr( 'data-sharing-url' ) !== '' ) {
url = $copy2clipboard.parent().attr( 'data-sharing-url' );
} else {
url = window.location;
}
// create hidden selection
var el = document.createElement( 'textarea' );
el.value = window.selectedText + ' ' + url;
el.setAttribute( 'readonly', '' );
el.style.position = 'absolute';
el.style.left = '-9999px';
document.body.appendChild( el );
el.select();
document.execCommand( 'copy' );
document.body.removeChild( el );
$( tooltip ).hide();
} );
} );
}
$( '.w-sharing-item' ).on( 'click', function() {
WShare( this );
$( '.w-sharing-tooltip' ).hide();
} );
}( jQuery );
@@ -0,0 +1,13 @@
!function($){"use strict";function WShare(selector){var $this=$(selector),$parent=$this.parent(),first_image_src,opt={url:window.location,text:document.title,lang:document.documentElement.lang,image:$('meta[name="og:image"]').attr('content')||''};if(window.selectedText){opt.text=window.selectedText}
if($parent.attr('data-sharing-url')!==undefined&&$parent.attr('data-sharing-url')!==''){opt.url=$parent.attr('data-sharing-url')}
if($parent.attr('data-sharing-image')!==undefined&&$parent.attr('data-sharing-image')!==''){opt.image=$parent.attr('data-sharing-image')}
if(opt.image===''||opt.image===undefined){first_image_src=$('img').first().attr('src');if(first_image_src!==undefined&&first_image_src!==''){opt.image=first_image_src}}
if($this.hasClass('facebook')){window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(opt.url)+"&quote="+encodeURIComponent(opt.text)+"","facebook","toolbar=0, status=0, width=900, height=500")}else if($this.hasClass('twitter')){window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(opt.text)+"&url="+encodeURIComponent(opt.url),"twitter","toolbar=0, status=0, width=650, height=360")}else if($this.hasClass('linkedin')){window.open('https://www.linkedin.com/shareArticle?mini=true&url='+encodeURIComponent(opt.url),'linkedin','toolbar=no,width=550,height=550')}else if($this.hasClass('whatsapp')){if(jQuery.isMobile){window.open("https://api.whatsapp.com/send?text="+encodeURIComponent(opt.text+' '+opt.url),"whatsapp","toolbar=0, status=0, width=900, height=500")}else{window.open("https://web.whatsapp.com/send?text="+encodeURIComponent(opt.text+' '+opt.url),"whatsapp","toolbar=0, status=0, width=900, height=500")}}else if($this.hasClass('xing')){window.open("https://www.xing.com/spi/shares/new?url="+encodeURIComponent(opt.url),"xing","toolbar=no, status=0, width=900, height=500")}else if($this.hasClass('reddit')){window.open("https://www.reddit.com/submit?url="+encodeURIComponent(opt.url)+"&title="+encodeURIComponent(opt.text),"reddit","toolbar=no, status=0, width=900, height=500")}else if($this.hasClass('pinterest')){window.open('https://www.pinterest.com/pin/create/button/?url='+encodeURIComponent(opt.url)+'&media='+encodeURIComponent(opt.image)+'&description='+encodeURIComponent(opt.text),'pinterest','toolbar=no,width=700,height=300')}else if($this.hasClass('vk')){window.open('https://vk.com/share.php?url='+encodeURIComponent(opt.url)+'&title='+encodeURIComponent(opt.text)+'&description=&image='+encodeURIComponent(opt.image),'vk','toolbar=no,width=700,height=300')}else if($this.hasClass('email')){window.location='mailto:?subject='+opt.text+'&body='+encodeURIComponent(opt.url)}}
if($('.w-sharing-tooltip').length){var activeArea='.l-main';if($('.w-sharing-tooltip').attr('data-sharing-area')==='post_content'){activeArea='.w-post-elm.post_content'}
$('body').not(activeArea).bind('mouseup',function(){var selection;if(window.getSelection){selection=window.getSelection()}else if(document.selection){selection=document.selection.createRange()}
if(selection.toString()===''){$(".w-sharing-tooltip.active:visible").hide()}});$(activeArea).bind('mouseup',function(e){var selection,tooltip='',url,$copy2clipboard=$('.w-sharing-item.copy2clipboard');if(window.getSelection){selection=window.getSelection()}else if(document.selection){selection=document.selection.createRange()}
$(".w-sharing-tooltip").each(function(){if($(this).hasClass('active')){tooltip=this}});if(tooltip===''){$(".w-sharing-tooltip:first").addClass('active');$(".w-sharing-tooltip.active").appendTo("body");tooltip=".w-sharing-tooltip.active"}
if(selection.toString()!==''){window.selectedText=selection.toString();$(tooltip).css({"display":"inline-block","left":e.pageX,"top":e.pageY-50,})}else{window.selectedText='';$(tooltip).hide()}
$copy2clipboard.on('click',function(){if($copy2clipboard.parent().attr('data-sharing-url')!==undefined&&$copy2clipboard.parent().attr('data-sharing-url')!==''){url=$copy2clipboard.parent().attr('data-sharing-url')}else{url=window.location}
var el=document.createElement('textarea');el.value=window.selectedText+' '+url;el.setAttribute('readonly','');el.style.position='absolute';el.style.left='-9999px';document.body.appendChild(el);el.select();document.execCommand('copy');document.body.removeChild(el);$(tooltip).hide()})})}
$('.w-sharing-item').on('click',function(){WShare(this);$('.w-sharing-tooltip').hide()})}(jQuery)
@@ -0,0 +1,66 @@
/**
* UpSolution Element: Slider
*/
( function( $ ) {
$.fn.wSlider = function() {
return this.each( function() {
$us.getScript( $us.templateDirectoryUri + '/framework/js/vendor/royalslider.js', function() {
var $this = $( this ),
$frame = $this.find( '.w-slider-h' ),
$slider = $this.find( '.royalSlider' ),
$options = $this.find( '.w-slider-json' ),
options = $options[ 0 ].onclick() || {};
// Prevent double init
if ( $this.data( 'sliderInit' ) == 1 ) {
return;
}
$this.data( 'sliderInit', 1 );
$options.remove();
if ( ! $.fn.royalSlider ) {
return;
}
// Always apply certain fit option for grid listing slider
if ( $this.parent().hasClass( 'w-post-elm' ) ) {
options[ 'imageScaleMode' ] = 'fill';
}
options[ 'usePreloader' ] = false;
$slider.royalSlider( options );
var slider = $slider.data( 'royalSlider' );
if ( options.fullscreen && options.fullscreen.enabled ) {
// Moving royal slider to the very end of body element to allow a proper fullscreen
var rsEnterFullscreen = function() {
$slider.appendTo( $( 'body' ) );
slider.ev.off( 'rsEnterFullscreen', rsEnterFullscreen );
slider.ev.on( 'rsExitFullscreen', rsExitFullscreen );
slider.updateSliderSize();
};
slider.ev.on( 'rsEnterFullscreen', rsEnterFullscreen );
var rsExitFullscreen = function() {
$slider.prependTo( $frame );
slider.ev.off( 'rsExitFullscreen', rsExitFullscreen );
slider.ev.on( 'rsEnterFullscreen', rsEnterFullscreen );
};
}
slider.ev.on( 'rsAfterContentSet', function() {
slider.slides.forEach( function( slide ) {
$( slide.content.find( 'img' )[ 0 ] ).attr( 'alt', slide.caption.attr( 'data-alt' ) );
} );
} );
$us.$canvas.on( 'contentChange', function() {
$slider.parent().imagesLoaded( function() {
slider.updateSliderSize();
} );
} );
}.bind( this ) );
} );
};
$( function() {
jQuery( '.w-slider' ).wSlider();
} );
} )( jQuery );
@@ -0,0 +1,5 @@
(function($){$.fn.wSlider=function(){return this.each(function(){$us.getScript($us.templateDirectoryUri+'/framework/js/vendor/royalslider.js',function(){var $this=$(this),$frame=$this.find('.w-slider-h'),$slider=$this.find('.royalSlider'),$options=$this.find('.w-slider-json'),options=$options[0].onclick()||{};if($this.data('sliderInit')==1){return}
$this.data('sliderInit',1);$options.remove();if(!$.fn.royalSlider){return}
if($this.parent().hasClass('w-post-elm')){options.imageScaleMode='fill'}
options.usePreloader=!1;$slider.royalSlider(options);var slider=$slider.data('royalSlider');if(options.fullscreen&&options.fullscreen.enabled){var rsEnterFullscreen=function(){$slider.appendTo($('body'));slider.ev.off('rsEnterFullscreen',rsEnterFullscreen);slider.ev.on('rsExitFullscreen',rsExitFullscreen);slider.updateSliderSize()};slider.ev.on('rsEnterFullscreen',rsEnterFullscreen);var rsExitFullscreen=function(){$slider.prependTo($frame);slider.ev.off('rsExitFullscreen',rsExitFullscreen);slider.ev.on('rsEnterFullscreen',rsEnterFullscreen)}}
slider.ev.on('rsAfterContentSet',function(){slider.slides.forEach(function(slide){$(slide.content.find('img')[0]).attr('alt',slide.caption.attr('data-alt'))})});$us.$canvas.on('contentChange',function(){$slider.parent().imagesLoaded(function(){slider.updateSliderSize()})})}.bind(this))})};$(function(){jQuery('.w-slider').wSlider()})})(jQuery)
@@ -0,0 +1,396 @@
/**
* UpSolution Element: Tabs
*
* @requires $us.canvas
*/
!function( $ ) {
"use strict";
$us.WTabs = function( container, options ) {
this.init( container, options );
};
$us.WTabs.prototype = {
init: function( container, options ) {
// Setting options
var defaults = {
duration: 300,
easing: 'cubic-bezier(.78,.13,.15,.86)'
};
this.options = $.extend( {}, defaults, options );
this.isRtl = $( '.l-body' ).hasClass( 'rtl' );
// Commonly used dom elements
this.$container = $( container );
this.$tabsList = this.$container.find( '.w-tabs-list:first' );
this.$tabs = this.$tabsList.find( '.w-tabs-item' );
this.$tabsH = this.$tabsList.find( '.w-tabs-item-h' );
this.$sectionsWrapper = this.$container.find( '.w-tabs-sections:first' );
this.$sectionsHelper = this.$sectionsWrapper.children();
this.$sections = this.$sectionsHelper.find( '.w-tabs-section' );
this.$headers = this.$sections.children( '.w-tabs-section-header' );
this.$contents = this.$sections.children( '.w-tabs-section-content' );
this.$line_charts = this.$container.find( ".vc_line-chart" );
this.$round_charts = this.$container.find( ".vc_round-chart" );
// Class variables
this.width = 0;
this.tabWidths = [];
this.isTogglable = ( this.$container.usMod( 'type' ) == 'togglable' );
// Basic layout
this.basicLayout = this.$container.hasClass( 'accordion' ) ? 'accordion' : ( this.$container.usMod( 'layout' ) || 'default' );
// Current active layout (may be switched to 'accordion')
this.curLayout = this.basicLayout;
this.responsive = $us.canvas.options.responsive;
// Array of active tabs indexes
this.active = [];
this.activeOnInit = [];
this.definedActive = [];
this.count = this.$tabs.length;
// Container width at which we should switch to accordion layout
this.minWidth = 0;
if ( this.count == 0 ) {
return;
}
// Preparing arrays of jQuery objects for easier manipulating in future
this.tabs = $.map( this.$tabs.toArray(), $ );
this.sections = $.map( this.$sections.toArray(), $ );
this.headers = $.map( this.$headers.toArray(), $ );
this.contents = $.map( this.$contents.toArray(), $ );
$.each( this.tabs, function( index ) {
if ( this.sections[ index ].hasClass( 'content-empty' ) ) {
this.tabs[ index ].hide();
this.sections[ index ].hide();
}
if ( this.tabs[ index ].hasClass( 'active' ) ) {
this.active.push( index );
this.activeOnInit.push( index );
}
if ( this.tabs[ index ].hasClass( 'defined-active' ) ) {
this.definedActive.push( index );
}
this.tabs[ index ].add( this.headers[ index ] ).on( 'click', function( e ) {
e.preventDefault();
// Toggling accordion sections
if ( this.curLayout == 'accordion' && this.isTogglable ) {
// Cannot toggle the only active item
this.toggleSection( index );
}
// Setting tabs active item
else {
if ( index != this.active[ 0 ] ) {
this.headerClicked = true;
this.openSection( index );
} else if ( this.curLayout == 'accordion' ) {
this.contents[ index ].css( 'display', 'block' ).slideUp( this.options.duration, this._events.contentChanged );
this.tabs[ index ].removeClass( 'active' );
this.sections[ index ].removeClass( 'active' );
this.active[ 0 ] = undefined;
}
}
}.bind( this ) );
}.bind( this ) );
this.$tabsH.on( 'click', function( e ) {
e.preventDefault();
} );
// Boundable events
this._events = {
resize: this.resize.bind( this ),
hashchange: this.hashchange.bind( this ),
contentChanged: function() {
$us.$canvas.trigger( 'contentChange' );
// TODO: check if we can do this without hardcoding line charts init here;
this.$line_charts.length && jQuery.fn.vcLineChart && this.$line_charts.vcLineChart( { reload: !1 } );
this.$round_charts.length && jQuery.fn.vcRoundChart && this.$round_charts.vcRoundChart( { reload: !1 } );
}.bind( this )
};
// Starting everything
this.switchLayout( this.curLayout );
$us.$window.on( 'resize', this._events.resize );
$us.$window.on( 'hashchange', this._events.hashchange );
$us.$document.on( 'ready', this._events.resize );
$us.$document.on( 'ready', function() {
setTimeout( this._events.resize, 50 );
setTimeout( function() {
// Open tab on page load by hash
if ( window.location.hash ) {
var hash = window.location.hash.substr( 1 ),
$linkedSection = this.$container.find( '.w-tabs-section[id="' + hash + '"]' );
if ( $linkedSection.length && ( !$linkedSection.hasClass( 'active' ) ) ) {
var $header = $linkedSection.find( '.w-tabs-section-header' );
$header.click();
}
}
}.bind( this ), 150 );
}.bind( this ) );
// Support for external links to tabs
$.each( this.tabs, function( index ) {
if ( this.headers[ index ].attr( 'href' ) != undefined ) {
var tabHref = this.headers[ index ].attr( 'href' ),
tabHeader = this.headers[ index ];
$( 'a[href="' + tabHref + '"]' ).on( 'click', function( e ) {
e.preventDefault();
if ( $( this ).hasClass( 'w-tabs-section-header', 'w-tabs-item-h' ) ) {
return;
}
tabHeader.click();
} );
}
}.bind( this ) );
this.$container.addClass( 'initialized' );
},
hashchange: function() {
if ( window.location.hash ) {
var hash = window.location.hash.substr( 1 ),
$linkedSection = this.$container.find( '.w-tabs-section[id="' + hash + '"]' );
if ( $linkedSection.length && ( !$linkedSection.hasClass( 'active' ) ) ) {
var $header = $linkedSection.find( '.w-tabs-section-header' );
$header.click();
}
}
},
switchLayout: function( to ) {
this.cleanUpLayout( this.curLayout );
this.prepareLayout( to );
this.curLayout = to;
},
/**
* Clean up layout's special inline styles and/or dom elements
* @param from
*/
cleanUpLayout: function( from ) {
if ( from == 'default' || from == 'timeline' || from == 'modern' || from == 'trendy' ) {
this.$sectionsWrapper.clearPreviousTransitions().resetInlineCSS( 'width', 'height' );
this.$sectionsHelper.clearPreviousTransitions().resetInlineCSS( 'position', 'width', 'left' );
this.$sections.resetInlineCSS( 'width', 'display' );
this.$container.removeClass( 'autoresize' );
} else if ( from == 'accordion' ) {
this.$container.removeClass( 'accordion' );
this.$sections.resetInlineCSS( 'display' );
this.$contents.resetInlineCSS( 'height', 'padding-top', 'padding-bottom', 'display', 'opacity' );
} else if ( from == 'ver' ) {
this.$contents.resetInlineCSS( 'height', 'padding-top', 'padding-bottom', 'display', 'opacity' );
}
},
/**
* Apply layout's special inline styles and/or dom elements
* @param to
*/
prepareLayout: function( to ) {
if ( to != 'accordion' && this.active[ 0 ] == undefined ) {
this.active[ 0 ] = this.activeOnInit[ 0 ];
if ( this.active[ 0 ] != undefined ) {
this.tabs[ this.active[ 0 ] ].addClass( 'active' );
this.sections[ this.active[ 0 ] ].addClass( 'active' );
}
}
if ( to == 'default' || to == 'timeline' || to == 'modern' || to == 'trendy' ) {
this.$container.addClass( 'autoresize' );
this.$sectionsHelper.css( 'position', 'absolute' );
} else if ( to == 'accordion' ) {
this.$container.addClass( 'accordion' );
this.$contents.hide();
if ( this.curLayout != 'accordion' && this.active[ 0 ] != undefined && this.active[ 0 ] != this.definedActive[ 0 ] ) {
this.tabs[ this.active[ 0 ] ].removeClass( 'active' );
this.sections[ this.active[ 0 ] ].removeClass( 'active' );
this.active[ 0 ] = this.definedActive[ 0 ];
}
for ( var i = 0; i < this.active.length; i ++ ) {
if ( this.contents[ this.active[ i ] ] !== undefined ) {
this.tabs[ this.active[ i ] ].addClass( 'active' );
this.sections[ this.active[ i ] ].addClass( 'active' );
this.contents[ this.active[ i ] ].show();
}
}
} else if ( to == 'ver' ) {
this.$contents.hide();
this.contents[ this.active[ 0 ] ].show();
}
},
/**
* Measure needed sizes and store them to this.tabWidths variable
*
* TODO Count minWidth here as well
*/
measure: function() {
if ( this.basicLayout == 'ver' ) {
// Measuring minimum tabs width
this.$tabsList.css( 'width', 0 );
var minTabWidth = this.$tabsList.outerWidth( true );
this.$tabsList.css( 'width', '' );
// Measuring the mininum content width
this.$container.addClass( 'measure' );
var minContentWidth = this.$sectionsWrapper.outerWidth( true );
this.$container.removeClass( 'measure' );
// Measuring minimum tabs width for percent-based sizes
var navWidth = this.$container.usMod( 'navwidth' );
if ( navWidth != 'auto' ) {
// Percent-based measure
minTabWidth = Math.max( minTabWidth, minContentWidth * parseInt( navWidth ) / ( 100 - parseInt( navWidth ) ) );
}
this.minWidth = Math.max( 480, minContentWidth + minTabWidth + 1 );
} else {
this.tabWidths = [];
// We hide active line temporarily to count tab sizes properly
this.$container.addClass( 'measure' );
for ( var index = 0; index < this.tabs.length; index ++ ) {
this.tabWidths.push( this.tabs[ index ].outerWidth( true ) );
}
this.$container.removeClass( 'measure' );
if ( this.basicLayout == 'default' || this.basicLayout == 'timeline' || this.basicLayout == 'modern' || this.basicLayout == 'trendy' ) {
// Array sum
this.minWidth = this.tabWidths.reduce( function( pv, cv ) {
return pv + cv;
}, 0 );
}
}
},
/**
* Open tab section
*
* @param index int
*/
openSection: function( index ) {
if ( this.sections[ index ] === undefined ) {
return;
}
if ( this.curLayout == 'default' || this.curLayout == 'timeline' || this.curLayout == 'modern' || this.curLayout == 'trendy' ) {
this.$container.addClass( 'autoresize' );
this.$sections.removeClass( 'active' ).css( 'display', 'none' );
this.sections[ index ].stop( true, true ).fadeIn( this.options.duration, function() {
$( this ).addClass( 'active' );
} );
} else if ( this.curLayout == 'accordion' ) {
if ( this.contents[ this.active[ 0 ] ] !== undefined ) {
this.contents[ this.active[ 0 ] ].css( 'display', 'block' ).slideUp( this.options.duration );
}
this.contents[ index ].css( 'display', 'none' ).slideDown( this.options.duration, this._events.contentChanged );
// Scrolling to the opened section at small window dimensions
if ( $us.canvas.winWidth < 768 && this.headerClicked == true ) {
var newTop = this.headers[ 0 ].offset().top;
for ( var i = 0; i < index; i ++ ) {
newTop += this.headers[ i ].outerHeight();
}
$us.scroll.scrollTo( newTop, true );
this.headerClicked = false;
}
this.$sections.removeClass( 'active' );
this.sections[ index ].addClass( 'active' );
} else if ( this.curLayout == 'ver' ) {
if ( this.contents[ this.active[ 0 ] ] !== undefined ) {
this.contents[ this.active[ 0 ] ].css( 'display', 'none' );
}
this.contents[ index ].css( 'display', 'none' ).stop( true, true ).fadeIn( this.options.duration, this._events.contentChanged );
this.$sections.removeClass( 'active' );
this.sections[ index ].addClass( 'active' );
}
this._events.contentChanged();
this.$tabs.removeClass( 'active' );
this.tabs[ index ].addClass( 'active' );
this.active[ 0 ] = index;
},
/**
* Toggle some togglable accordion section
*
* @param index
*/
toggleSection: function( index ) {
// (!) Can only be used within accordion state
var indexPos = $.inArray( index, this.active );
if ( indexPos != - 1 ) {
this.contents[ index ].css( 'display', 'block' ).slideUp( this.options.duration, this._events.contentChanged );
this.tabs[ index ].removeClass( 'active' );
this.sections[ index ].removeClass( 'active' );
this.active.splice( indexPos, 1 );
} else {
this.contents[ index ].css( 'display', 'none' ).slideDown( this.options.duration, this._events.contentChanged );
this.tabs[ index ].addClass( 'active' );
this.sections[ index ].addClass( 'active' );
this.active.push( index );
}
},
/**
* Resize-driven logics
*/
resize: function() {
this.width = this.$container.width();
this.$tabsList.removeClass( 'hidden' );
// Basic layout may be overriden
if ( this.responsive ) {
// if (this.basicLayout == 'ver' && this.curLayout != 'ver') this.switchLayout('ver');
if ( this.curLayout != 'accordion' ) {
this.measure();
}
var nextLayout = ( this.width < this.minWidth ) ? 'accordion' : this.basicLayout;
if ( nextLayout !== this.curLayout ) {
this.switchLayout( nextLayout );
}
}
// Fixing tabs display
if ( this.curLayout == 'default' || this.curLayout == 'timeline' || this.curLayout == 'modern' || this.curLayout == 'trendy' ) {
this.$container.addClass( 'autoresize' );
this.$sectionsWrapper.css( 'width', this.width );
this.$sectionsHelper.css( 'width', this.count * this.width );
this.$sections.css( 'width', this.width );
if ( this.contents[ this.active[ 0 ] ] !== undefined ) {
this.$sectionsHelper.css( 'left', - this.width * ( this.isRtl ? ( this.count - this.active[ 0 ] - 1 ) : this.active[ 0 ] ) );
var height = this.sections[ this.active[ 0 ] ].height();
this.$sectionsWrapper.css( 'height', height );
}
}
this._events.contentChanged();
}
};
$.fn.wTabs = function( options ) {
return this.each( function() {
$( this ).data( 'wTabs', new $us.WTabs( this, options ) );
} );
};
}( jQuery );
/* RevSlider support for our tabs */
jQuery( function( $ ) {
$( '.w-tabs .rev_slider' ).each( function() {
var $slider = $( this );
$slider.bind( "revolution.slide.onloaded", function( e ) {
$us.$canvas.on( 'contentChange', function() {
$slider.revredraw();
} );
} );
} );
} );
@@ -0,0 +1,20 @@
!function($){"use strict";$us.WTabs=function(container,options){this.init(container,options)};$us.WTabs.prototype={init:function(container,options){var defaults={duration:300,easing:'cubic-bezier(.78,.13,.15,.86)'};this.options=$.extend({},defaults,options);this.isRtl=$('.l-body').hasClass('rtl');this.$container=$(container);this.$tabsList=this.$container.find('.w-tabs-list:first');this.$tabs=this.$tabsList.find('.w-tabs-item');this.$tabsH=this.$tabsList.find('.w-tabs-item-h');this.$sectionsWrapper=this.$container.find('.w-tabs-sections:first');this.$sectionsHelper=this.$sectionsWrapper.children();this.$sections=this.$sectionsHelper.find('.w-tabs-section');this.$headers=this.$sections.children('.w-tabs-section-header');this.$contents=this.$sections.children('.w-tabs-section-content');this.$line_charts=this.$container.find(".vc_line-chart");this.$round_charts=this.$container.find(".vc_round-chart");this.width=0;this.tabWidths=[];this.isTogglable=(this.$container.usMod('type')=='togglable');this.basicLayout=this.$container.hasClass('accordion')?'accordion':(this.$container.usMod('layout')||'default');this.curLayout=this.basicLayout;this.responsive=$us.canvas.options.responsive;this.active=[];this.activeOnInit=[];this.definedActive=[];this.count=this.$tabs.length;this.minWidth=0;if(this.count==0){return}
this.tabs=$.map(this.$tabs.toArray(),$);this.sections=$.map(this.$sections.toArray(),$);this.headers=$.map(this.$headers.toArray(),$);this.contents=$.map(this.$contents.toArray(),$);$.each(this.tabs,function(index){if(this.sections[index].hasClass('content-empty')){this.tabs[index].hide();this.sections[index].hide()}
if(this.tabs[index].hasClass('active')){this.active.push(index);this.activeOnInit.push(index)}
if(this.tabs[index].hasClass('defined-active')){this.definedActive.push(index)}
this.tabs[index].add(this.headers[index]).on('click',function(e){e.preventDefault();if(this.curLayout=='accordion'&&this.isTogglable){this.toggleSection(index)}
else{if(index!=this.active[0]){this.headerClicked=!0;this.openSection(index)}else if(this.curLayout=='accordion'){this.contents[index].css('display','block').slideUp(this.options.duration,this._events.contentChanged);this.tabs[index].removeClass('active');this.sections[index].removeClass('active');this.active[0]=undefined}}}.bind(this))}.bind(this));this.$tabsH.on('click',function(e){e.preventDefault()});this._events={resize:this.resize.bind(this),hashchange:this.hashchange.bind(this),contentChanged:function(){$us.$canvas.trigger('contentChange');this.$line_charts.length&&jQuery.fn.vcLineChart&&this.$line_charts.vcLineChart({reload:!1});this.$round_charts.length&&jQuery.fn.vcRoundChart&&this.$round_charts.vcRoundChart({reload:!1})}.bind(this)};this.switchLayout(this.curLayout);$us.$window.on('resize',this._events.resize);$us.$window.on('hashchange',this._events.hashchange);$us.$document.on('ready',this._events.resize);$us.$document.on('ready',function(){setTimeout(this._events.resize,50);setTimeout(function(){if(window.location.hash){var hash=window.location.hash.substr(1),$linkedSection=this.$container.find('.w-tabs-section[id="'+hash+'"]');if($linkedSection.length&&(!$linkedSection.hasClass('active'))){var $header=$linkedSection.find('.w-tabs-section-header');$header.click()}}}.bind(this),150)}.bind(this));$.each(this.tabs,function(index){if(this.headers[index].attr('href')!=undefined){var tabHref=this.headers[index].attr('href'),tabHeader=this.headers[index];$('a[href="'+tabHref+'"]').on('click',function(e){e.preventDefault();if($(this).hasClass('w-tabs-section-header','w-tabs-item-h')){return}
tabHeader.click()})}}.bind(this));this.$container.addClass('initialized')},hashchange:function(){if(window.location.hash){var hash=window.location.hash.substr(1),$linkedSection=this.$container.find('.w-tabs-section[id="'+hash+'"]');if($linkedSection.length&&(!$linkedSection.hasClass('active'))){var $header=$linkedSection.find('.w-tabs-section-header');$header.click()}}},switchLayout:function(to){this.cleanUpLayout(this.curLayout);this.prepareLayout(to);this.curLayout=to},cleanUpLayout:function(from){if(from=='default'||from=='timeline'||from=='modern'||from=='trendy'){this.$sectionsWrapper.clearPreviousTransitions().resetInlineCSS('width','height');this.$sectionsHelper.clearPreviousTransitions().resetInlineCSS('position','width','left');this.$sections.resetInlineCSS('width','display');this.$container.removeClass('autoresize')}else if(from=='accordion'){this.$container.removeClass('accordion');this.$sections.resetInlineCSS('display');this.$contents.resetInlineCSS('height','padding-top','padding-bottom','display','opacity')}else if(from=='ver'){this.$contents.resetInlineCSS('height','padding-top','padding-bottom','display','opacity')}},prepareLayout:function(to){if(to!='accordion'&&this.active[0]==undefined){this.active[0]=this.activeOnInit[0];if(this.active[0]!=undefined){this.tabs[this.active[0]].addClass('active');this.sections[this.active[0]].addClass('active')}}
if(to=='default'||to=='timeline'||to=='modern'||to=='trendy'){this.$container.addClass('autoresize');this.$sectionsHelper.css('position','absolute')}else if(to=='accordion'){this.$container.addClass('accordion');this.$contents.hide();if(this.curLayout!='accordion'&&this.active[0]!=undefined&&this.active[0]!=this.definedActive[0]){this.tabs[this.active[0]].removeClass('active');this.sections[this.active[0]].removeClass('active');this.active[0]=this.definedActive[0]}
for(var i=0;i<this.active.length;i ++){if(this.contents[this.active[i]]!==undefined){this.tabs[this.active[i]].addClass('active');this.sections[this.active[i]].addClass('active');this.contents[this.active[i]].show()}}}else if(to=='ver'){this.$contents.hide();this.contents[this.active[0]].show()}},measure:function(){if(this.basicLayout=='ver'){this.$tabsList.css('width',0);var minTabWidth=this.$tabsList.outerWidth(!0);this.$tabsList.css('width','');this.$container.addClass('measure');var minContentWidth=this.$sectionsWrapper.outerWidth(!0);this.$container.removeClass('measure');var navWidth=this.$container.usMod('navwidth');if(navWidth!='auto'){minTabWidth=Math.max(minTabWidth,minContentWidth*parseInt(navWidth)/(100-parseInt(navWidth)))}
this.minWidth=Math.max(480,minContentWidth+minTabWidth+1)}else{this.tabWidths=[];this.$container.addClass('measure');for(var index=0;index<this.tabs.length;index ++){this.tabWidths.push(this.tabs[index].outerWidth(!0))}
this.$container.removeClass('measure');if(this.basicLayout=='default'||this.basicLayout=='timeline'||this.basicLayout=='modern'||this.basicLayout=='trendy'){this.minWidth=this.tabWidths.reduce(function(pv,cv){return pv+cv},0)}}},openSection:function(index){if(this.sections[index]===undefined){return}
if(this.curLayout=='default'||this.curLayout=='timeline'||this.curLayout=='modern'||this.curLayout=='trendy'){this.$container.addClass('autoresize');this.$sections.removeClass('active').css('display','none');this.sections[index].stop(!0,!0).fadeIn(this.options.duration,function(){$(this).addClass('active')})}else if(this.curLayout=='accordion'){if(this.contents[this.active[0]]!==undefined){this.contents[this.active[0]].css('display','block').slideUp(this.options.duration)}
this.contents[index].css('display','none').slideDown(this.options.duration,this._events.contentChanged);if($us.canvas.winWidth<768&&this.headerClicked==!0){var newTop=this.headers[0].offset().top;for(var i=0;i<index;i ++){newTop+=this.headers[i].outerHeight()}
$us.scroll.scrollTo(newTop,!0);this.headerClicked=!1}
this.$sections.removeClass('active');this.sections[index].addClass('active')}else if(this.curLayout=='ver'){if(this.contents[this.active[0]]!==undefined){this.contents[this.active[0]].css('display','none')}
this.contents[index].css('display','none').stop(!0,!0).fadeIn(this.options.duration,this._events.contentChanged);this.$sections.removeClass('active');this.sections[index].addClass('active')}
this._events.contentChanged();this.$tabs.removeClass('active');this.tabs[index].addClass('active');this.active[0]=index},toggleSection:function(index){var indexPos=$.inArray(index,this.active);if(indexPos!=-1){this.contents[index].css('display','block').slideUp(this.options.duration,this._events.contentChanged);this.tabs[index].removeClass('active');this.sections[index].removeClass('active');this.active.splice(indexPos,1)}else{this.contents[index].css('display','none').slideDown(this.options.duration,this._events.contentChanged);this.tabs[index].addClass('active');this.sections[index].addClass('active');this.active.push(index)}},resize:function(){this.width=this.$container.width();this.$tabsList.removeClass('hidden');if(this.responsive){if(this.curLayout!='accordion'){this.measure()}
var nextLayout=(this.width<this.minWidth)?'accordion':this.basicLayout;if(nextLayout!==this.curLayout){this.switchLayout(nextLayout)}}
if(this.curLayout=='default'||this.curLayout=='timeline'||this.curLayout=='modern'||this.curLayout=='trendy'){this.$container.addClass('autoresize');this.$sectionsWrapper.css('width',this.width);this.$sectionsHelper.css('width',this.count*this.width);this.$sections.css('width',this.width);if(this.contents[this.active[0]]!==undefined){this.$sectionsHelper.css('left',-this.width*(this.isRtl?(this.count-this.active[0]-1):this.active[0]));var height=this.sections[this.active[0]].height();this.$sectionsWrapper.css('height',height)}}
this._events.contentChanged()}};$.fn.wTabs=function(options){return this.each(function(){$(this).data('wTabs',new $us.WTabs(this,options))})}}(jQuery);jQuery(function($){$('.w-tabs .rev_slider').each(function(){var $slider=$(this);$slider.bind("revolution.slide.onloaded",function(e){$us.$canvas.on('contentChange',function(){$slider.revredraw()})})})})
@@ -0,0 +1,31 @@
jQuery( function( $ ) {
"use strict";
/* Ultimate Addons for WPBakery Page Builder integration */
jQuery( '.upb_bg_img, .upb_color, .upb_grad, .upb_content_iframe, .upb_content_video, .upb_no_bg' ).each( function() {
var $bg = jQuery( this ),
$prev = $bg.prev();
if ( $prev.length == 0 ) {
var $parent = $bg.parent(),
$parentParent = $parent.parent(),
$prevParentParent = $parentParent.prev();
if ( $prevParentParent.length ) {
$bg.insertAfter( $prevParentParent );
if ( $parent.children().length == 0 ) {
$parentParent.remove();
}
}
}
} );
$( '.g-cols > .ult-item-wrap' ).each( function( index, elm ) {
var $elm = jQuery( elm );
$elm.replaceWith( $elm.children() );
} );
jQuery( '.overlay-show' ).click( function() {
window.setTimeout( function() {
$us.$canvas.trigger( 'contentChange' );
}, 1000 );
} );
} );
@@ -0,0 +1 @@
jQuery(function($){"use strict";jQuery('.upb_bg_img, .upb_color, .upb_grad, .upb_content_iframe, .upb_content_video, .upb_no_bg').each(function(){var $bg=jQuery(this),$prev=$bg.prev();if($prev.length==0){var $parent=$bg.parent(),$parentParent=$parent.parent(),$prevParentParent=$parentParent.prev();if($prevParentParent.length){$bg.insertAfter($prevParentParent);if($parent.children().length==0){$parentParent.remove()}}}});$('.g-cols > .ult-item-wrap').each(function(index,elm){var $elm=jQuery(elm);$elm.replaceWith($elm.children())});jQuery('.overlay-show').click(function(){window.setTimeout(function(){$us.$canvas.trigger('contentChange')},1000)})})
@@ -0,0 +1,136 @@
/**
* UpSolution Element: w-cart
*
* @requires $us.canvas
* @requires $us.nav
*/
jQuery( function( $ ) {
var $cart = $( '.w-cart' );
if ( $cart.length == 0 ) {
return;
}
var $quantity = $cart.find( '.w-cart-quantity' );
var us_accessibility = function() {
$cart.find( 'a' ).on( 'focus.upsolution', function() {
$( this ).closest( '.w-cart' ).addClass( 'opened' );
} );
$cart.find( 'a' ).on( 'blur.upsolution', function() {
$( this ).closest( '.w-cart' ).removeClass( 'opened' );
} );
};
us_accessibility();
var updateCart = function() {
if ( $cart.hasClass( 'opened' ) ) {
$cart.removeClass( 'opened' );
}
var $mini_cart_amount = $cart.find( '.us_mini_cart_amount' ).first(),
mini_cart_amount = $mini_cart_amount.text();
if ( mini_cart_amount !== undefined ) {
mini_cart_amount = mini_cart_amount + '';
mini_cart_amount = mini_cart_amount.match( /\d+/g );
if ( mini_cart_amount > 0 ) {
$quantity.html( mini_cart_amount );
$cart.removeClass( 'empty' );
} else {
$quantity.html( '0' );
$cart.addClass( 'empty' );
}
} else {
// fallback in case our action wasn't fired somehow
var $quantities = $cart.find( '.quantity' ),
total = 0;
$quantities.each( function() {
var quantity,
text = $( this ).text() + '',
matches = text.match( /\d+/g );
if ( matches ) {
quantity = parseInt( matches[ 0 ], 10 );
total += quantity;
}
} );
if ( total > 0 ) {
$quantity.html( total );
$cart.removeClass( 'empty' );
} else {
$quantity.html( '0' );
$cart.addClass( 'empty' );
}
}
};
updateCart();
$( document.body ).bind( 'wc_fragments_loaded', function() {
updateCart();
us_accessibility();
} );
$( document.body ).bind( 'wc_fragments_refreshed', function() {
updateCart();
us_accessibility();
} );
var $notification = $cart.find( '.w-cart-notification' ),
$productName = $notification.find( '.product-name' ),
$cartLink = $cart.find( '.w-cart-link' ),
$dropdown = $cart.find( '.w-cart-dropdown' ),
$quantity = $cart.find( '.w-cart-quantity' ),
productName = $productName.text(),
showFn = 'fadeInCSS',
hideFn = 'fadeOutCSS',
opened = false;
$notification.on( 'click', function() {
$notification[ hideFn ]();
} );
jQuery( 'body' ).bind( 'added_to_cart', function( event, fragments, cart_hash, $button ) {
if ( event === undefined ) {
return;
}
updateCart();
productName = $button.closest( '.product' ).find( '.woocommerce-loop-product__title' ).text();
$productName.html( productName );
$notification.addClass( 'shown' );
$notification.on( 'mouseenter', function() {
$notification.removeClass( 'shown' );
} );
var newTimerId = setTimeout( function() {
$notification.removeClass( 'shown' );
$notification.off( 'mouseenter' );
}, 3000 );
} );
if ( $.isMobile ) {
var outsideClickEvent = function( e ) {
if ( jQuery.contains( $cart[ 0 ], e.target ) ) {
return;
}
$cart.removeClass( 'opened' );
$us.$body.off( 'touchstart', outsideClickEvent );
opened = false;
};
$cartLink.on( 'click', function( e ) {
if ( ! opened ) {
e.preventDefault();
$cart.addClass( 'opened' );
$us.$body.on( 'touchstart', outsideClickEvent );
} else {
$cart.removeClass( 'opened' );
$us.$body.off( 'touchstart', outsideClickEvent );
}
opened = ! opened;
} );
}
} );
@@ -0,0 +1,6 @@
jQuery(function($){var $cart=$('.w-cart');if($cart.length==0){return}
var $quantity=$cart.find('.w-cart-quantity');var us_accessibility=function(){$cart.find('a').on('focus.upsolution',function(){$(this).closest('.w-cart').addClass('opened')});$cart.find('a').on('blur.upsolution',function(){$(this).closest('.w-cart').removeClass('opened')})};us_accessibility();var updateCart=function(){if($cart.hasClass('opened')){$cart.removeClass('opened')}
var $mini_cart_amount=$cart.find('.us_mini_cart_amount').first(),mini_cart_amount=$mini_cart_amount.text();if(mini_cart_amount!==undefined){mini_cart_amount=mini_cart_amount+'';mini_cart_amount=mini_cart_amount.match(/\d+/g);if(mini_cart_amount>0){$quantity.html(mini_cart_amount);$cart.removeClass('empty')}else{$quantity.html('0');$cart.addClass('empty')}}else{var $quantities=$cart.find('.quantity'),total=0;$quantities.each(function(){var quantity,text=$(this).text()+'',matches=text.match(/\d+/g);if(matches){quantity=parseInt(matches[0],10);total+=quantity}});if(total>0){$quantity.html(total);$cart.removeClass('empty')}else{$quantity.html('0');$cart.addClass('empty')}}};updateCart();$(document.body).bind('wc_fragments_loaded',function(){updateCart();us_accessibility()});$(document.body).bind('wc_fragments_refreshed',function(){updateCart();us_accessibility()});var $notification=$cart.find('.w-cart-notification'),$productName=$notification.find('.product-name'),$cartLink=$cart.find('.w-cart-link'),$dropdown=$cart.find('.w-cart-dropdown'),$quantity=$cart.find('.w-cart-quantity'),productName=$productName.text(),showFn='fadeInCSS',hideFn='fadeOutCSS',opened=!1;$notification.on('click',function(){$notification[hideFn]()});jQuery('body').bind('added_to_cart',function(event,fragments,cart_hash,$button){if(event===undefined){return}
updateCart();productName=$button.closest('.product').find('.woocommerce-loop-product__title').text();$productName.html(productName);$notification.addClass('shown');$notification.on('mouseenter',function(){$notification.removeClass('shown')});var newTimerId=setTimeout(function(){$notification.removeClass('shown');$notification.off('mouseenter')},3000)});if($.isMobile){var outsideClickEvent=function(e){if(jQuery.contains($cart[0],e.target)){return}
$cart.removeClass('opened');$us.$body.off('touchstart',outsideClickEvent);opened=!1};$cartLink.on('click',function(e){if(!opened){e.preventDefault();$cart.addClass('opened');$us.$body.on('touchstart',outsideClickEvent)}else{$cart.removeClass('opened');$us.$body.off('touchstart',outsideClickEvent)}
opened=!opened})}})
+2
View File
@@ -0,0 +1,2 @@
"use strict";!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(["jquery","googlemaps!"],b):a.GMaps=b()}(this,function(){var a=function(a,b){var c;if(a===b)return a;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a},b=function(a,b){var c,d=Array.prototype.slice.call(arguments,2),e=[],f=a.length;if(Array.prototype.map&&a.map===Array.prototype.map)e=Array.prototype.map.call(a,function(a){var c=d.slice(0);return c.splice(0,0,a),b.apply(this,c)});else for(c=0;f>c;c++)callback_params=d,callback_params.splice(0,0,a[c]),e.push(b.apply(this,callback_params));return e},c=function(a){var b,c=[];for(b=0;b<a.length;b++)c=c.concat(a[b]);return c},d=function(a,b){var c=a[0],d=a[1];return b&&(c=a[1],d=a[0]),new google.maps.LatLng(c,d)},f=function(a,b){var c;for(c=0;c<a.length;c++)a[c]instanceof google.maps.LatLng||(a[c].length>0&&"object"==typeof a[c][0]?a[c]=f(a[c],b):a[c]=d(a[c],b));return a},g=function(a,b){var c,d=a.replace(".","");return c="jQuery"in this&&b?$("."+d,b)[0]:document.getElementsByClassName(d)[0]},h=function(a,b){var c,a=a.replace("#","");return c="jQuery"in window&&b?$("#"+a,b)[0]:document.getElementById(a)},i=function(a){var b=0,c=0;if(a.offsetParent)do b+=a.offsetLeft,c+=a.offsetTop;while(a=a.offsetParent);return[b,c]},j=function(b){var c=document,d=function(b){if("object"!=typeof window.google||!window.google.maps)return"object"==typeof window.console&&window.console.error&&console.error("Google Maps API is required. Please register the following JavaScript library https://maps.googleapis.com/maps/api/js."),function(){};if(!this)return new d(b);b.zoom=b.zoom||15,b.mapType=b.mapType||"roadmap";var e,f=function(a,b){return void 0===a?b:a},j=this,k=["bounds_changed","center_changed","click","dblclick","drag","dragend","dragstart","idle","maptypeid_changed","projection_changed","resize","tilesloaded","zoom_changed"],l=["mousemove","mouseout","mouseover"],m=["el","lat","lng","mapType","width","height","markerClusterer","enableNewStyle"],n=b.el||b.div,o=b.markerClusterer,p=google.maps.MapTypeId[b.mapType.toUpperCase()],q=new google.maps.LatLng(b.lat,b.lng),r=f(b.zoomControl,!0),s=b.zoomControlOpt||{style:"DEFAULT",position:"TOP_LEFT"},t=s.style||"DEFAULT",u=s.position||"TOP_LEFT",v=f(b.panControl,!0),w=f(b.mapTypeControl,!0),x=f(b.scaleControl,!0),y=f(b.streetViewControl,!0),z=f(z,!0),A={},B={zoom:this.zoom,center:q,mapTypeId:p},C={panControl:v,zoomControl:r,zoomControlOptions:{style:google.maps.ZoomControlStyle[t],position:google.maps.ControlPosition[u]},mapTypeControl:w,scaleControl:x,streetViewControl:y,overviewMapControl:z};if("string"==typeof b.el||"string"==typeof b.div?n.indexOf("#")>-1?this.el=h(n,b.context):this.el=g.apply(this,[n,b.context]):this.el=n,"undefined"==typeof this.el||null===this.el)throw"No element defined.";for(window.context_menu=window.context_menu||{},window.context_menu[j.el.id]={},this.controls=[],this.overlays=[],this.layers=[],this.singleLayers={},this.markers=[],this.polylines=[],this.routes=[],this.polygons=[],this.infoWindow=null,this.overlay_el=null,this.zoom=b.zoom,this.registered_events={},this.el.style.width=b.width||this.el.scrollWidth||this.el.offsetWidth,this.el.style.height=b.height||this.el.scrollHeight||this.el.offsetHeight,google.maps.visualRefresh=b.enableNewStyle,e=0;e<m.length;e++)delete b[m[e]];for(1!=b.disableDefaultUI&&(B=a(B,C)),A=a(B,b),e=0;e<k.length;e++)delete A[k[e]];for(e=0;e<l.length;e++)delete A[l[e]];this.map=new google.maps.Map(this.el,A),o&&(this.markerClusterer=o.apply(this,[this.map]));var D=function(a,b){var c="",d=window.context_menu[j.el.id][a];for(var e in d)if(d.hasOwnProperty(e)){var f=d[e];c+='<li><a id="'+a+"_"+e+'" href="#">'+f.title+"</a></li>"}if(h("gmaps_context_menu")){var g=h("gmaps_context_menu");g.innerHTML=c;var e,k=g.getElementsByTagName("a"),l=k.length;for(e=0;l>e;e++){var m=k[e],n=function(c){c.preventDefault(),d[this.id.replace(a+"_","")].action.apply(j,[b]),j.hideContextMenu()};google.maps.event.clearListeners(m,"click"),google.maps.event.addDomListenerOnce(m,"click",n,!1)}var o=i.apply(this,[j.el]),p=o[0]+b.pixel.x-15,q=o[1]+b.pixel.y-15;g.style.left=p+"px",g.style.top=q+"px"}};this.buildContextMenu=function(a,b){if("marker"===a){b.pixel={};var c=new google.maps.OverlayView;c.setMap(j.map),c.draw=function(){var d=c.getProjection(),e=b.marker.getPosition();b.pixel=d.fromLatLngToContainerPixel(e),D(a,b)}}else D(a,b);var d=h("gmaps_context_menu");setTimeout(function(){d.style.display="block"},0)},this.setContextMenu=function(a){window.context_menu[j.el.id][a.control]={};var b,d=c.createElement("ul");for(b in a.options)if(a.options.hasOwnProperty(b)){var e=a.options[b];window.context_menu[j.el.id][a.control][e.name]={title:e.title,action:e.action}}d.id="gmaps_context_menu",d.style.display="none",d.style.position="absolute",d.style.minWidth="100px",d.style.background="white",d.style.listStyle="none",d.style.padding="8px",d.style.boxShadow="2px 2px 6px #ccc",h("gmaps_context_mLine truncated
//# sourceMappingURL=gmaps.min.js.map
+12
View File
@@ -0,0 +1,12 @@
/*!
* Isotope PACKAGED v3.0.6
*
* Licensed GPLv3 for open source use
* or Isotope Commercial License for commercial use
*
* https://isotope.metafizzy.co
* Copyright 2010-2018 Metafizzy
*/
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,s,a){function u(t,e,o){var n,s="$()."+i+'("'+e+'")';return t.each(function(t,u){var h=a.data(u,i);if(!h)return void r(i+" not initialized. Cannot call methods, i.e. "+s);var d=h[e];if(!d||"_"==e.charAt(0))return void r(s+" is not a valid method");var l=d.apply(h,o);n=void 0===n?l:n}),void 0!==n?n:t}function h(t,e){t.each(function(t,o){var n=a.data(o,i);n?(n.option(e),n._init()):(n=new s(o,e),a.data(o,i,n))})}a=a||e||t.jQuery,a&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=n.call(arguments,1);return u(this,t,e)}return h(this,t),this},o(a))}function o(t){!t||t&&t.bridget||(t.bridget=i)}var n=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return o(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},o=i[t]=i[t]||[];return o.indexOf(e)==-1&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},o=i[t]=i[t]||{};return o[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return o!=-1&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var o=this._onceEvents&&this._onceEvents[t],n=0;n<i.length;n++){var s=i[n],r=o&&o[s];r&&(this.off(t,s),delete o[s]),s.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<h;e++){var i=u[e];t[i]=0}return t}function o(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function n(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var n=o(e);r=200==Math.round(t(n.width)),s.isBoxSizeOuter=r,i.removeChild(e)}}function s(e){if(n(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var s=o(e);if("none"==s.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==s.boxSizing,l=0;l<h;l++){var f=u[l],c=s[f],m=parseFloat(c);a[f]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,y=a.paddingTop+a.paddingBottom,g=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,I=d&&r,x=t(s.width);x!==!1&&(a.width=x+(I?0:p+_));var S=t(s.height);return S!==!1&&(a.height=S+(I?0:y+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(y+z),a.outerWidth=a.width+g,a.outerHeight=a.height+v,a}}var r,a="undefined"==typeof console?e:function(t){console.error(t)},u=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],h=u.length,d=!1;return s}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var o=e[i],n=o+"MatchesSelector";if(t[n])return n}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var o=Array.prototype.slice;i.makeArray=function(Line truncated
}:"function"==typeof t?function(e){return t(e.element)}:function(e){return o(e.element,t)}},l.updateSortData=function(t){var e;t?(t=n.makeArray(t),e=this.getItems(t)):e=this.items,this._getSorters(),this._updateItemsSortData(e)},l._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=f(i)}},l._updateItemsSortData=function(t){for(var e=t&&t.length,i=0;e&&i<e;i++){var o=t[i];o.updateSortData()}};var f=function(){function t(t){if("string"!=typeof t)return t;var i=h(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),s=n&&n[1],r=e(s,o),a=d.sortDataParsers[i[1]];return t=a?function(t){return t&&a(r(t))}:function(t){return t&&r(t)}}function e(t,e){return t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&i.textContent}}return t}();d.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},l._sort=function(){if(this.options.sortBy){var t=n.makeArray(this.options.sortBy);this._getIsSameSortBy(t)||(this.sortHistory=t.concat(this.sortHistory));var e=a(this.sortHistory,this.options.sortAscending);this.filteredItems.sort(e)}},l._getIsSameSortBy=function(t){for(var e=0;e<t.length;e++)if(t[e]!=this.sortHistory[e])return!1;return!0},l._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw new Error("No layout mode: "+t);return e.options=this.options[t],e},l._resetLayout=function(){e.prototype._resetLayout.call(this),this._mode()._resetLayout()},l._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},l._manageStamp=function(t){this._mode()._manageStamp(t)},l._getContainerSize=function(){return this._mode()._getContainerSize()},l.needsResizeLayout=function(){return this._mode().needsResizeLayout()},l.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},l.prepended=function(t){var e=this._itemize(t);if(e.length){this._resetLayout(),this._manageStamps();var i=this._filterRevealAdded(e);this.layoutItems(this.filteredItems),this.filteredItems=i.concat(this.filteredItems),this.items=e.concat(this.items)}},l._filterRevealAdded=function(t){var e=this._filter(t);return this.hide(e.needHide),this.reveal(e.matches),this.layoutItems(e.matches,!0),e.matches},l.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;i<n;i++)o=e[i],this.element.appendChild(o.element);var s=this._filter(e).matches;for(i=0;i<n;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;i<n;i++)delete e[i].isLayoutInstant;this.reveal(s)}};var c=l.remove;return l.remove=function(t){t=n.makeArray(t);var e=this.getItems(t);c.call(this,t);for(var i=e&&e.length,o=0;i&&o<i;o++){var s=e[o];n.removeFrom(this.filteredItems,s)}},l.shuffle=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},l._noTransition=function(t,e){var i=this.options.transitionDuration;this.options.transitionDuration=0;var o=t.apply(this,e);return this.options.transitionDuration=i,o},l.getFilteredItemElements=function(){return this.filteredItems.map(function(t){return t.element})},d});
@@ -0,0 +1,2 @@
/* Lazy Load XT 1.1.0 | MIT License */
!function(a,b,c,d){function e(a,b){return a[b]===d?t[b]:a[b]}function f(){var a=b.pageYOffset;return a===d?r.scrollTop:a}function g(a,b){var c=t["on"+a];c&&(w(c)?c.call(b[0]):(c.addClass&&b.addClass(c.addClass),c.removeClass&&b.removeClass(c.removeClass))),b.trigger("lazy"+a,[b]),k()}function h(b){g(b.type,a(this).off(p,h))}function i(c){if(z.length){c=c||t.forceLoad,A=1/0;var d,e,i=f(),j=b.innerHeight||r.clientHeight,k=b.innerWidth||r.clientWidth;for(d=0,e=z.length;e>d;d++){var l,m=z[d],q=m[0],s=m[n],u=!1,v=c||y(q,o)<0;if(a.contains(r,q)){if(c||!s.visibleOnly||q.offsetWidth||q.offsetHeight){if(!v){var x=q.getBoundingClientRect(),B=s.edgeX,C=s.edgeY;l=x.top+i-C-j,v=i>=l&&x.bottom>-C&&x.left<=k+B&&x.right>-B}if(v){m.on(p,h),g("show",m);var D=s.srcAttr,E=w(D)?D(m):q.getAttribute(D);E&&(q.src=E),u=!0}else A>l&&(A=l)}}else u=!0;u&&(y(q,o,0),z.splice(d--,1),e--)}e||g("complete",a(r))}}function j(){B>1?(B=1,i(),setTimeout(j,t.throttle)):B=0}function k(a){z.length&&(a&&"scroll"===a.type&&a.currentTarget===b&&A>=f()||(B||setTimeout(j,0),B=2))}function l(){v.lazyLoadXT()}function m(){i(!0)}var n="lazyLoadXT",o="lazied",p="load error",q="lazy-hidden",r=c.documentElement||c.body,s=b.onscroll===d||!!b.operamini||!r.getBoundingClientRect,t={autoInit:!0,selector:"img[data-src]",blankImage:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",throttle:99,forceLoad:s,loadEvent:"pageshow",updateEvent:"load orientationchange resize scroll touchmove focus",forceEvent:"lazyloadall",oninit:{removeClass:"lazy"},onshow:{addClass:q},onload:{removeClass:q,addClass:"lazy-loaded"},onerror:{removeClass:q},checkDuplicates:!0},u={srcAttr:"data-src",edgeX:0,edgeY:0,visibleOnly:!0},v=a(b),w=a.isFunction,x=a.extend,y=a.data||function(b,c){return a(b).data(c)},z=[],A=0,B=0;a[n]=x(t,u,a[n]),a.fn[n]=function(c){c=c||{};var d,f=e(c,"blankImage"),h=e(c,"checkDuplicates"),i=e(c,"scrollContainer"),j=e(c,"show"),l={};a(i).on("scroll",k);for(d in u)l[d]=e(c,d);return this.each(function(d,e){if(e===b)a(t.selector).lazyLoadXT(c);else{var i=h&&y(e,o),m=a(e).data(o,j?-1:1);if(i)return void k();f&&"IMG"===e.tagName&&!e.src&&(e.src=f),m[n]=x({},l),g("init",m),z.push(m),k()}})},a(c).ready(function(){g("start",v),v.on(t.updateEvent,k).on(t.forceEvent,m),a(c).on(t.updateEvent,k),t.autoInit&&(v.on(t.loadEvent,l),l())})}(window.jQuery||window.Zepto||window.$,window,document);
@@ -0,0 +1 @@
!function(a,b,c,d){function e(a,b){return a[b]===d?t[b]:a[b]}function f(){var a=b.pageYOffset;return a===d?r.scrollTop:a}function g(a,b){var c=t["on"+a];c&&(w(c)?c.call(b[0]):(c.addClass&&b.addClass(c.addClass),c.removeClass&&b.removeClass(c.removeClass))),b.trigger("lazy"+a,[b]),k()}function h(b){g(b.type,a(this).off(p,h))}function i(c){if(z.length){c=c||t.forceLoad,A=1/0;var d,e,i=f(),j=b.innerHeight||r.clientHeight,k=b.innerWidth||r.clientWidth;for(d=0,e=z.length;e>d;d++){var l,m=z[d],q=m[0],s=m[n],u=!1,v=c||y(q,o)<0;if(a.contains(r,q)){if(c||!s.visibleOnly||q.offsetWidth||q.offsetHeight){if(!v){var x=q.getBoundingClientRect(),B=s.edgeX,C=s.edgeY;l=x.top+i-C-j,v=i>=l&&x.bottom>-C&&x.left<=k+B&&x.right>-B}if(v){m.on(p,h),g("show",m);var D=s.srcAttr,E=w(D)?D(m):q.getAttribute(D);E&&(q.src=E),u=!0}else A>l&&(A=l)}}else u=!0;u&&(y(q,o,0),z.splice(d--,1),e--)}e||g("complete",a(r))}}function j(){B>1?(B=1,i(),setTimeout(j,t.throttle)):B=0}function k(a){z.length&&(a&&"scroll"===a.type&&a.currentTarget===b&&A>=f()||(B||setTimeout(j,0),B=2))}function l(){v.lazyLoadXT()}function m(){i(!0)}var n="lazyLoadXT",o="lazied",p="load error",q="lazy-hidden",r=c.documentElement||c.body,s=b.onscroll===d||!!b.operamini||!r.getBoundingClientRect,t={autoInit:!0,selector:"img[data-src]",blankImage:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",throttle:99,forceLoad:s,loadEvent:"pageshow",updateEvent:"load orientationchange resize scroll touchmove focus",forceEvent:"lazyloadall",oninit:{removeClass:"lazy"},onshow:{addClass:q},onload:{removeClass:q,addClass:"lazy-loaded"},onerror:{removeClass:q},checkDuplicates:!0},u={srcAttr:"data-src",edgeX:0,edgeY:0,visibleOnly:!0},v=a(b),w=a.isFunction,x=a.extend,y=a.data||function(b,c){return a(b).data(c)},z=[],A=0,B=0;a[n]=x(t,u,a[n]),a.fn[n]=function(c){c=c||{};var d,f=e(c,"blankImage"),h=e(c,"checkDuplicates"),i=e(c,"scrollContainer"),j=e(c,"show"),l={};a(i).on("scroll",k);for(d in u)l[d]=e(c,d);return this.each(function(d,e){if(e===b)a(t.selector).lazyLoadXT(c);else{var i=h&&y(e,o),m=a(e).data(o,j?-1:1);if(i)return void k();f&&"IMG"===e.tagName&&!e.src&&(e.src=f),m[n]=x({},l),g("init",m),z.push(m),k()}})},a(c).ready(function(){g("start",v),v.on(t.updateEvent,k).on(t.forceEvent,m),a(c).on(t.updateEvent,k),t.autoInit&&(v.on(t.loadEvent,l),l())})}(window.jQuery||window.Zepto||window.$,window,document)
+5
View File
@@ -0,0 +1,5 @@
/* @preserve
* Leaflet 1.3.4+Detached: 0e566b2ad5e696ba9f79a9d48a7e51c8f4892441.0e566b2, a JS library for interactive maps. http://leafletjs.com
* (c) 2010-2018 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.L={})}(this,function(t){"use strict";function i(t){var i,e,n,o;for(e=1,n=arguments.length;e<n;e++){o=arguments[e];for(i in o)t[i]=o[i]}return t}function e(t,i){var e=Array.prototype.slice;if(t.bind)return t.bind.apply(t,e.call(arguments,1));var n=e.call(arguments,2);return function(){return t.apply(i,n.length?n.concat(e.call(arguments)):arguments)}}function n(t){return t._leaflet_id=t._leaflet_id||++ei,t._leaflet_id}function o(t,i,e){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(e,o),o=!1)},s=function(){n?o=arguments:(t.apply(e,arguments),setTimeout(r,i),n=!0)}}function s(t,i,e){var n=i[1],o=i[0],s=n-o;return t===n&&e?t:((t-o)%s+s)%s+o}function r(){return!1}function a(t,i){var e=Math.pow(10,void 0===i?6:i);return Math.round(t*e)/e}function h(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function u(t){return h(t).split(/\s+/)}function l(t,i){t.hasOwnProperty("options")||(t.options=t.options?ii(t.options):{});for(var e in i)t.options[e]=i[e];return t.options}function c(t,i,e){var n=[];for(var o in t)n.push(encodeURIComponent(e?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(i&&-1!==i.indexOf("?")?"&":"?")+n.join("&")}function _(t,i){return t.replace(ni,function(t,e){var n=i[e];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(i)),n})}function d(t,i){for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1}function p(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}function m(t){var i=+new Date,e=Math.max(0,16-(i-ri));return ri=i+e,window.setTimeout(t,e)}function f(t,i,n){if(!n||ai!==m)return ai.call(window,e(t,i));t.call(i)}function g(t){t&&hi.call(window,t)}function v(){}function y(t){if("undefined"!=typeof L&&L&&L.Mixin){t=oi(t)?t:[t];for(var i=0;i<t.length;i++)t[i]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}function x(t,i,e){this.x=e?Math.round(t):t,this.y=e?Math.round(i):i}function w(t,i,e){return t instanceof x?t:oi(t)?new x(t[0],t[1]):void 0===t||null===t?t:"object"==typeof t&&"x"in t&&"y"in t?new x(t.x,t.y):new x(t,i,e)}function P(t,i){if(t)for(var e=i?[t,i]:t,n=0,o=e.length;n<o;n++)this.extend(e[n])}function b(t,i){return!t||t instanceof P?t:new P(t,i)}function T(t,i){if(t)for(var e=i?[t,i]:t,n=0,o=e.length;n<o;n++)this.extend(e[n])}function z(t,i){return t instanceof T?t:new T(t,i)}function M(t,i,e){if(isNaN(t)||isNaN(i))throw new Error("Invalid LatLng object: ("+t+", "+i+")");this.lat=+t,this.lng=+i,void 0!==e&&(this.alt=+e)}function C(t,i,e){return t instanceof M?t:oi(t)&&"object"!=typeof t[0]?3===t.length?new M(t[0],t[1],t[2]):2===t.length?new M(t[0],t[1]):null:void 0===t||null===t?t:"object"==typeof t&&"lat"in t?new M(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===i?null:new M(t,i,e)}function S(t,i,e,n){if(oi(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=i,this._c=e,this._d=n}function Z(t,i,e,n){return new S(t,i,e,n)}function E(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function k(t,i){var e,n,o,s,r,a,h="";for(e=0,o=t.length;e<o;e++){for(n=0,s=(r=t[e]).length;n<s;n++)a=r[n],h+=(n?"L":"M")+a.x+" "+a.y;h+=i?Ji?"z":"x":""}return h||"M0 0"}function A(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}function B(t,i,e,n){return"touchstart"===i?O(t,e,n):"touchmove"===i?W(t,e,n):"touchend"===i&&H(t,e,n),this}function I(t,i,e){var n=t["_leaflet_"+i+e];return"touchstart"===i?t.removeEventListener(te,n,!1):"touchmove"===i?t.removeEventListener(ie,n,!1):"touchend"===i&&(t.removeEventListener(ee,n,!1),t.removeEventListener(ne,n,!1)),this}function O(t,i,n){var o=e(function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(oe.indexOf(t.target.tagName)<0))return;Pt(t)}j(t,i)});t["_leaflet_touchstart"+n]=o,t.addEventListener(te,o,!1),re||(document.documentElement.addEventListener(te,R,!0),document.documentElement.addEventListener(ie,N,!0),document.documentElement.addEventListener(ee,D,!0),document.documentElement.addEventListener(ne,D,!0),re=!0)}function R(t){se[t.pointerId]=t,ae++}function N(t){se[t.pointerId]&&(se[t.pointerId]=t)}function D(t){delete se[t.pointerId],ae--}function j(t,i){t.touches=[];for(var e in se)t.touches.push(se[e]);t.changedTouches=[t],i(t)}function W(t,i,e){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&j(t,i)};t["_leaflet_touchmove"+e]=n,t.addEventListener(ie,n,!1)}function H(t,i,e){var n=function(t){j(t,i)};t["_leaflet_touchend"+e]=n,t.addEventListener(ee,n,!1),t.addEventListener(ne,n,!1)}function F(t,i,e){function n(t){var i;if(Vi){if(!bi||"mouse"===t.pointerType)return;i=ae}else i=t.touches.length;if(!(i>1)){var e=Date.now(),n=e-(s||e);r=t.touches?t.touches[0]:Line truncated
@@ -0,0 +1,4 @@
4/*! Magnific Popup - v1.1.0 - 2016-02-20
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2016 Dmitry Semenov; */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)},updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innLine truncated
@@ -0,0 +1,7 @@
/**
* Owl Carousel v2.3.4
* Copyright 2013-2018 David Deutsch
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
*/
!function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g>0;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i,g-=1;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c<b;)d=f[c-1]||0,e=this._widths[this.relative(c)]+this.settings.margin,f.push(d+e*a);this._coordinates=f}},{filter:["width","items","settings"],run:function(){var a=this.settings.stagePadding,b=this._coordinates,c={width:Math.ceil(Math.abs(b[b.length-1]))+2*a,"padding-left":a||"","padding-right":a||""};this.$stage.css(c)}},{filter:["width","items","settings"],run:function(a){var b=this._coordinates.length,c=!this.settings.autoWidth,d=this.$stage.children();if(c&&a.items.merge)for(;b--;)a.css.width=this._widths[this.relative(b)],d.eq(b).css(a.css);else c&&(a.css.width=a.items.width,d.css(a.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(a){a.current=a.current?this.$stage.children().index(a.current):0,a.current=Math.max(this.minimum(),Math.min(this.maximum(),a.current)),this.reset(a.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;c<d;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],e.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$elemeLine truncated
animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&"position"===a.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype._next=function(d){this._call=b.setTimeout(a.proxy(this._next,this,d),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||c.hidden||this._core.next(d||this._core.settings.autoplaySpeed)},e.prototype.read=function(){return(new Date).getTime()-this._time},e.prototype.play=function(c,d){var e;this._core.is("rotating")||this._core.enter("rotating"),c=c||this._core.settings.autoplayTimeout,e=Math.min(this._time%(this._timeout||c),c),this._paused?(this._time=this.read(),this._paused=!1):b.clearTimeout(this._call),this._time+=this.read()%c-e,this._timeout=c,this._call=b.setTimeout(a.proxy(this._next,this,d),c-e)},e.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,b.clearTimeout(this._call),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,b.clearTimeout(this._call))},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreLine truncated
@@ -0,0 +1,136 @@
// jQuery RoyalSlider plugin. (c) Dmitry Semenov http://dimsemenov.com
// jquery.royalslider v9.5.9
(function(l){function v(b,e){var d,a=this,c=window.navigator,g=c.userAgent.toLowerCase();a.uid=l.rsModules.uid++;a.ns=".rs"+a.uid;var f=document.createElement("div").style,h=["webkit","Moz","ms","O"],k="",m=0;for(d=0;d<h.length;d++){var p=h[d];!k&&p+"Transform"in f&&(k=p);p=p.toLowerCase();window.requestAnimationFrame||(window.requestAnimationFrame=window[p+"RequestAnimationFrame"],window.cancelAnimationFrame=window[p+"CancelAnimationFrame"]||window[p+"CancelRequestAnimationFrame"])}window.requestAnimationFrame||
(window.requestAnimationFrame=function(a,b){var c=(new Date).getTime(),d=Math.max(0,16-(c-m)),f=window.setTimeout(function(){a(c+d)},d);m=c+d;return f});window.cancelAnimationFrame||(window.cancelAnimationFrame=function(a){clearTimeout(a)});a.isIPAD=g.match(/(ipad)/);a.isIOS=a.isIPAD||g.match(/(iphone|ipod)/);d=function(a){a=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||0>a.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||
[];return{browser:a[1]||"",version:a[2]||"0"}}(g);h={};d.browser&&(h[d.browser]=!0,h.version=d.version);h.chrome&&(h.webkit=!0);a._browser=h;a.isAndroid=-1<g.indexOf("android");a.slider=l(b);a.ev=l(a);a._doc=l(document);a.st=l.extend({},l.fn.royalSlider.defaults,e);a._currAnimSpeed=a.st.transitionSpeed;a._minPosOffset=0;!a.st.allowCSS3||h.webkit&&!a.st.allowCSS3OnWebkit||(d=k+(k?"T":"t"),a._useCSS3Transitions=d+"ransform"in f&&d+"ransition"in f,a._useCSS3Transitions&&(a._use3dTransform=k+(k?"P":"p")+
"erspective"in f));k=k.toLowerCase();a._vendorPref="-"+k+"-";a._slidesHorizontal="vertical"===a.st.slidesOrientation?!1:!0;a._reorderProp=a._slidesHorizontal?"left":"top";a._sizeProp=a._slidesHorizontal?"width":"height";a._prevNavItemId=-1;a._isMove="fade"===a.st.transitionType?!1:!0;a._isMove||(a.st.sliderDrag=!1,a._fadeZIndex=10);a._opacityCSS="z-index:0; display:none; opacity:0;";a._newSlideId=0;a._sPosition=0;a._nextSlidePos=0;l.each(l.rsModules,function(b,c){"uid"!==b&&c.call(a)});a.slides=[];
a._idCount=0;(a.st.slides?l(a.st.slides):a.slider.children().detach()).each(function(){a._parseNode(this,!0)});a.st.randomizeSlides&&a.slides.sort(function(){return.5-Math.random()});a.numSlides=a.slides.length;a._refreshNumPreloadImages();a.st.startSlideId?a.st.startSlideId>a.numSlides-1&&(a.st.startSlideId=a.numSlides-1):a.st.startSlideId=0;a._newSlideId=a.staticSlideId=a.currSlideId=a._realId=a.st.startSlideId;a.currSlide=a.slides[a.currSlideId];a._accelerationPos=0;a.pointerMultitouch=!1;a.slider.addClass((a._slidesHorizontal?
"rsHor":"rsVer")+(a._isMove?"":" rsFade"));f='<div class="rsOverflow"><div class="rsContainer">';a.slidesSpacing=a.st.slidesSpacing;a._slideSize=(a._slidesHorizontal?a.slider.width():a.slider.height())+a.st.slidesSpacing;a._preload=0<a._numPreloadImages;1>=a.numSlides&&(a._loop=!1);a._loopHelpers=a._loop&&a._isMove?2===a.numSlides?1:2:0;a._maxImages=6>a.numSlides?a.numSlides:6;a._currBlockIndex=0;a._idOffset=0;a.slidesJQ=[];for(d=0;d<a.numSlides;d++)a.slidesJQ.push(l('<div style="'+(a._isMove?"":
d!==a.currSlideId?a._opacityCSS:"z-index:0;")+'" class="rsSlide "></div>'));a._sliderOverflow=f=l(f+"</div></div>");k=function(b,c,d,f,e){a._downEvent=b+c;a._moveEvent=b+d;a._upEvent=b+f;e&&(a._cancelEvent=b+e)};d=c.pointerEnabled;a.pointerEnabled=d||c.msPointerEnabled;a.pointerEnabled?(a.hasTouch=!1,a._lastItemFriction=.2,a.pointerMultitouch=1<c[(d?"m":"msM")+"axTouchPoints"],d?k("pointer","down","move","up","cancel"):k("MSPointer","Down","Move","Up","Cancel")):(a.isIOS?a._downEvent=a._moveEvent=
a._upEvent=a._cancelEvent="":k("mouse","down","move","up"),"ontouchstart"in window||"createTouch"in document?(a.hasTouch=!0,a._downEvent+=" touchstart",a._moveEvent+=" touchmove",a._upEvent+=" touchend",a._cancelEvent+=" touchcancel",a._lastItemFriction=.5,a.st.sliderTouch&&(a._hasDrag=!0)):(a.hasTouch=!1,a._lastItemFriction=.2));a.st.sliderDrag&&(a._hasDrag=!0,h.msie||h.opera?a._grabCursor=a._grabbingCursor="move":h.mozilla?(a._grabCursor="-moz-grab",a._grabbingCursor="-moz-grabbing"):h.webkit&&
-1!=c.platform.indexOf("Mac")&&(a._grabCursor="-webkit-grab",a._grabbingCursor="-webkit-grabbing"),a._setGrabCursor());a.slider.html(f);a._controlsContainer=a.st.controlsInside?a._sliderOverflow:a.slider;a._slidesContainer=a._sliderOverflow.children(".rsContainer");a.pointerEnabled&&a._slidesContainer.css((d?"":"-ms-")+"touch-action",a._slidesHorizontal?"pan-y":"pan-x");a._preloader=l('<div class="rsPreloader"></div>');c=a._slidesContainer.children(".rsSlide");a._currHolder=a.slidesJQ[a.currSlideId];
a._selectedSlideHolder=0;a._eventCallbacks={dragStart:function(b){a._onDragStart(b)},dragStartThumb:function(b){a._onDragStart(b,!0)},touchmoveFix:function(){}};a._useCSS3Transitions?(a._TP="transition-property",a._TD="transition-duration",a._TTF="transition-timing-function",a._yProp=a._xProp=a._vendorPref+"transform",a._use3dTransform?(h.webkit&&!h.chrome&&a.slider.addClass("rsWebkit3d"),a._tPref1="translate3d(",a._tPref2="px, ",a._tPref3="px, 0px)"):(a._tPref1="translate(",a._tPref2="px, ",a._tPref3=
"px)"),a._isMove?a._slidesContainer[a._vendorPref+a._TP]=a._vendorPref+"transform":(h={},h[a._vendorPref+a._TP]="opacity",h[a._vendorPref+a._TD]=a.st.transitionSpeed+"ms",h[a._vendorPref+a._TTF]=a.st.css3easeInOut,c.css(h))):(a._xProp="left",a._yProp="top");a._slidesHorizontal&&a.slider.css("touch-action","pan-y");var n;l(window).on("resize"+a.ns,function(){n&&clearTimeout(n);n=setTimeout(function(){a.updateSliderSize()},50)});a.ev.trigger("rsAfterPropsSetup");a.updateSliderSize();a.st.keyboardNavEnabled&&
a._bindKeyboardNav();a.st.arrowsNavHideOnTouch&&(a.hasTouch||a.pointerMultitouch)&&(a.st.arrowsNav=!1);a.st.arrowsNav&&(c=a._controlsContainer,l('<div class="rsArrow rsArrowLeft"><div class="rsArrowIcn"></div></div><div class="rsArrow rsArrowRight"><div class="rsArrowIcn"></div></div>').appendTo(c),a._arrowLeft=c.children(".rsArrowLeft").click(function(b){b.preventDefault();a.prev()}),a._arrowRight=c.children(".rsArrowRight").click(function(b){b.preventDefault();a.next()}),a.st.arrowsNavAutoHide&&
!a.hasTouch&&(a._arrowLeft.addClass("rsHidden"),a._arrowRight.addClass("rsHidden"),c.one("mousemove.arrowshover",function(){a._arrowLeft.removeClass("rsHidden");a._arrowRight.removeClass("rsHidden")}),c.hover(function(){a._arrowsAutoHideLocked||(a._arrowLeft.removeClass("rsHidden"),a._arrowRight.removeClass("rsHidden"))},function(){a._arrowsAutoHideLocked||(a._arrowLeft.addClass("rsHidden"),a._arrowRight.addClass("rsHidden"))})),a.ev.on("rsOnUpdateNav",function(){a._updateArrowsNav()}),a._updateArrowsNav());
a.hasTouch&&a.st.sliderTouch||!a.hasTouch&&a.st.sliderDrag?(a._bindPassiveEvent(a._slidesContainer[0],a._downEvent,a._eventCallbacks.dragStart,!1),a._bindPassiveEvent(a.slider[0],a._moveEvent,a._eventCallbacks.touchmoveFix,!1)):a.dragSuccess=!1;var r=["rsPlayBtnIcon","rsPlayBtn","rsCloseVideoBtn","rsCloseVideoIcn"];a._slidesContainer.click(function(b){if(!a.dragSuccess){var c=l(b.target).attr("class");if(-1!==l.inArray(c,r)&&a.toggleVideo())return!1;if(a.st.navigateByClick&&!a._blockActions){if(l(b.target).closest(".rsNoDrag",
a._currHolder).length)return!0;a._mouseNext(b)}a.ev.trigger("rsSlideClick",b)}}).on("click.rs","a",function(b){if(a.dragSuccess)return!1;a._blockActions=!0;setTimeout(function(){a._blockActions=!1},3)});a.ev.trigger("rsAfterInit")}l.rsModules||(l.rsModules={uid:0});v.prototype={constructor:v,_mouseNext:function(b){b=b[this._slidesHorizontal?"pageX":"pageY"]-this._sliderOffset;b>=this._nextSlidePos?this.next():0>b&&this.prev()},_refreshNumPreloadImages:function(){var b=this.st.numImagesToPreload;if(this._loop=
this.st.loop)2===this.numSlides?(this._loop=!1,this.st.loopRewind=!0):2>this.numSlides&&(this.st.loopRewind=this._loop=!1);this._loop&&0<b&&(4>=this.numSlides?b=1:this.st.numImagesToPreload>(this.numSlides-1)/2&&(b=Math.floor((this.numSlides-1)/2)));this._numPreloadImages=b},_parseNode:function(b,e){function d(b,d){d?c.images.push(b.attr(d)):c.images.push(b.text());if(g){g=!1;c.caption="src"===d?b.attr("alt"):b.contents();c.image=c.images[0];c.videoURL=b.attr("data-rsVideo");var f=b.attr("data-rsw"),
e=b.attr("data-rsh");"undefined"!==typeof f&&!1!==f&&"undefined"!==typeof e&&!1!==e?(c.iW=parseInt(f,10),c.iH=parseInt(e,10)):a.st.imgWidth&&a.st.imgHeight&&(c.iW=a.st.imgWidth,c.iH=a.st.imgHeight)}}var a=this,c={},g=!0;b=l(b);a._currContent=b;a.ev.trigger("rsBeforeParseNode",[b,c]);if(!c.stopParsing){b=a._currContent;c.id=a._idCount;c.contentAdded=!1;a._idCount++;c.images=[];c.isBig=!1;if(!c.hasCover){if(b.hasClass("rsImg")){var f=b;var h=!0}else f=b.find(".rsImg"),f.length&&(h=!0);h?(c.bigImage=
f.eq(0).attr("data-rsBigImg"),f.each(function(){var a=l(this);a.is("a")?d(a,"href"):a.is("img")?d(a,"src"):d(a)})):b.is("img")&&(b.addClass("rsImg rsMainSlideImage"),d(b,"src"))}f=b.find(".rsCaption");f.length&&(c.caption=f.remove());c.content=b;a.ev.trigger("rsAfterParseNode",[b,c]);e&&a.slides.push(c);0===c.images.length&&(c.isLoaded=!0,c.isRendered=!1,c.isLoading=!1,c.images=null);return c}},_bindKeyboardNav:function(){var b=this,e,d,a=function(a){37===a?b.prev():39===a&&b.next()};b._doc.on("keydown"+
b.ns,function(c){if(!b.st.keyboardNavEnabled)return!0;if(!(b._isDragging||(d=c.keyCode,37!==d&&39!==d||e))){if(document.activeElement&&/(INPUT|SELECT|TEXTAREA)/i.test(document.activeElement.tagName))return!0;b.isFullscreen&&c.preventDefault();a(d);e=setInterval(function(){a(d)},700)}}).on("keyup"+b.ns,function(a){e&&(clearInterval(e),e=null)})},goTo:function(b,e){b!==this.currSlideId&&this._moveTo(b,this.st.transitionSpeed,!0,!e)},destroy:function(b){this.ev.trigger("rsBeforeDestroy");this._doc.off("keydown"+
this.ns+" keyup"+this.ns);this._eventCallbacks.dragMove&&(this._unbindPassiveEvent(document,this._moveEvent,this._eventCallbacks.dragMove,!0),this._unbindPassiveEvent(document,this._upEvent,this._eventCallbacks.dragRelease,!0));this._eventCallbacks.downEvent&&(this._unbindPassiveEvent(this._slidesContainer[0],this._downEvent,this._eventCallbacks.dragStart,!1),this._unbindPassiveEvent(this.slider[0],this._moveEvent,this._eventCallbacks.touchmoveFix,!1));this._slidesContainer.off(this._downEvent+" click");
this.slider.data("royalSlider",null);l.removeData(this.slider,"royalSlider");l(window).off("resize"+this.ns);this.loadingTimeout&&clearTimeout(this.loadingTimeout);b&&this.slider.remove();this.ev=this.slider=this.slides=null},_updateBlocksContent:function(b,e){function d(d,e,g){d.isAdded?(a(e,d),c(e,d)):(g||(g=f.slidesJQ[e]),d.holder?g=d.holder:(g=f.slidesJQ[e]=l(g),d.holder=g),d.appendOnLoaded=!1,c(e,d,g),a(e,d),f._addBlockToContainer(d,g,b),d.isAdded=!0)}function a(a,c){c.contentAdded||(f.setItemHtml(c,
b),b||(c.contentAdded=!0))}function c(a,b,c){f._isMove&&(c||(c=f.slidesJQ[a]),c.css(f._reorderProp,(a+f._idOffset+x)*f._slideSize))}function g(a){if(m){if(a>p-1)return g(a-p);if(0>a)return g(p+a)}return a}var f=this,h,k,m=f._loop,p=f.numSlides;if(!isNaN(e))return g(e);var n=f.currSlideId,r=b?Math.abs(f._prevSlideId-f.currSlideId)>=f.numSlides-1?0:1:f._numPreloadImages,t=Math.min(2,r),w=!1,u=!1;for(k=n;k<n+1+t;k++){var q=g(k);if((h=f.slides[q])&&(!h.isAdded||!h.positionSet)){w=!0;break}}for(k=n-1;k>
n-1-t;k--)if(q=g(k),(h=f.slides[q])&&(!h.isAdded||!h.positionSet)){u=!0;break}if(w)for(k=n;k<n+r+1;k++){q=g(k);var x=Math.floor((f._realId-(n-k))/f.numSlides)*f.numSlides;(h=f.slides[q])&&d(h,q)}if(u)for(k=n-1;k>n-1-r;k--)q=g(k),x=Math.floor((f._realId-(n-k))/p)*p,(h=f.slides[q])&&d(h,q);if(!b)for(t=g(n-r),n=g(n+r),r=t>n?0:t,k=0;k<p;k++)t>n&&k>t-1||!(k<r||k>n)||(h=f.slides[k])&&h.holder&&(h.holder.detach(),h.isAdded=!1)},setItemHtml:function(b,e){var d=this,a=function(){if(!b.images)b.isRendered=
!0,b.isLoaded=!0,b.isLoading=!1,f(!0);else if(!b.isLoading){if(b.content.hasClass("rsImg")){var a=b.content;var e=!0}else a=b.content.find(".rsImg:not(img)");a&&!a.is("img")&&a.each(function(){var a=l(this),c='<img class="rsImg" src="'+(a.is("a")?a.attr("href"):a.text())+'" />';e?b.content=l(c):a.replaceWith(c)});a=e?b.content:b.content.find("img.rsImg");k();a.eq(0).addClass("rsMainSlideImage");b.iW&&b.iH&&(b.isLoaded||d._resizeImage(b),f());b.isLoading=!0;if(b.isBig)l("<img />").on("load.rs error.rs",
function(a){l(this).off("load.rs error.rs");c([this],!0)}).attr("src",b.image);else{b.loaded=[];b.numStartedLoad=0;a=function(a){l(this).off("load.rs error.rs");b.loaded.push(this);b.loaded.length===b.numStartedLoad&&c(b.loaded,!1)};for(var g=0;g<b.images.length;g++){var h=l("<img />");b.numStartedLoad++;h.on("load.rs error.rs",a).attr("src",b.images[g])}}}},c=function(a,c){if(a.length){var d=a[0];if(c!==b.isBig)(d=b.holder.children())&&1<d.length&&m();else if(b.iW&&b.iH)g();else if(b.iW=d.width,
b.iH=d.height,b.iW&&b.iH)g();else{var e=new Image;e.onload=function(){e.width?(b.iW=e.width,b.iH=e.height,g()):setTimeout(function(){e.width&&(b.iW=e.width,b.iH=e.height);g()},1E3)};e.src=d.src}}else g()},g=function(){b.isLoaded=!0;b.isLoading=!1;f();m();h()},f=function(){if(!b.isAppended&&d.ev){var a=d.st.visibleNearby,c=b.id-d._newSlideId;e||b.appendOnLoaded||!d.st.fadeinLoadedSlide||0!==c&&(!(a||d._isAnimating||d._isDragging)||-1!==c&&1!==c)||(a={visibility:"visible",opacity:0},a[d._vendorPref+
"transition"]="opacity 400ms ease-in-out",b.content.css(a),setTimeout(function(){b.content.css("opacity",1)},16));b.holder.find(".rsPreloader").length?b.holder.append(b.content):b.holder.html(b.content);b.isAppended=!0;b.isLoaded&&(d._resizeImage(b),h());b.sizeReady||(b.sizeReady=!0,setTimeout(function(){d.ev.trigger("rsMaybeSizeReady",b)},100))}},h=function(){!b.loadedTriggered&&d.ev&&(b.isLoaded=b.loadedTriggered=!0,b.holder.trigger("rsAfterContentSet"),d.ev.trigger("rsAfterContentSet",b))},k=function(){d.st.usePreloader&&
b.holder.html(d._preloader.clone())},m=function(a){d.st.usePreloader&&(a=b.holder.find(".rsPreloader"),a.length&&a.remove())};b.isLoaded?f():e?!d._isMove&&b.images&&b.iW&&b.iH?a():(b.holder.isWaiting=!0,k(),b.holder.slideId=-99):a()},_addBlockToContainer:function(b,e,d){this._slidesContainer.append(b.holder);b.appendOnLoaded=!1},_onDragStart:function(b,e){var d=this,a="touchstart"===b.type;d._isTouchGesture=a;d.ev.trigger("rsDragStart");if(l(b.target).closest(".rsNoDrag",d._currHolder).length)return d.dragSuccess=
!1,!0;!e&&d._isAnimating&&(d._wasAnimating=!0,d._stopAnimation());d.dragSuccess=!1;if(d._isDragging)a&&(d._multipleTouches=!0);else{a&&(d._multipleTouches=!1);d._setGrabbingCursor();if(a){var c=b.touches;if(c&&0<c.length){var g=c[0];1<c.length&&(d._multipleTouches=!0)}else return}else g=b;d._isDragging=!0;d._eventCallbacks.dragMove&&(d._unbindPassiveEvent(document,d._moveEvent,d._eventCallbacks.dragMove,!0),d._unbindPassiveEvent(document,d._upEvent,d._eventCallbacks.dragRelease,!0));d._eventCallbacks.dragMove=
function(a){d._onDragMove(a,e)};d._eventCallbacks.dragRelease=function(a){d._onDragRelease(a,e)};d._bindPassiveEvent(document,d._moveEvent,d._eventCallbacks.dragMove,!0);d._bindPassiveEvent(document,d._upEvent,d._eventCallbacks.dragRelease,!0);d._currMoveAxis="";d._hasMoved=!1;d._pageX=g.pageX;d._pageY=g.pageY;d._startPagePos=d._accelerationPos=(e?d._thumbsHorizontal:d._slidesHorizontal)?g.pageX:g.pageY;d._horDir=0;d._verDir=0;d._currRenderPosition=e?d._thumbsPosition:d._sPosition;d._startTime=(new Date).getTime();
if(a)d._sliderOverflow.on(d._cancelEvent,function(a){d._onDragRelease(a,e)})}},_renderMovement:function(b,e){if(this._checkedAxis){var d=this._renderMoveTime,a=b.pageX-this._pageX,c=b.pageY-this._pageY,g=this._currRenderPosition+a,f=this._currRenderPosition+c,h=e?this._thumbsHorizontal:this._slidesHorizontal;g=h?g:f;f=this._currMoveAxis;this._hasMoved=!0;this._pageX=b.pageX;this._pageY=b.pageY;"x"===f&&0!==a?this._horDir=0<a?1:-1:"y"===f&&0!==c&&(this._verDir=0<c?1:-1);f=h?this._pageX:this._pageY;
a=h?a:c;e?g>this._thumbsMinPosition?g=this._currRenderPosition+a*this._lastItemFriction:g<this._thumbsMaxPosition&&(g=this._currRenderPosition+a*this._lastItemFriction):this._loop||(0>=this.currSlideId&&0<f-this._startPagePos&&(g=this._currRenderPosition+a*this._lastItemFriction),this.currSlideId>=this.numSlides-1&&0>f-this._startPagePos&&(g=this._currRenderPosition+a*this._lastItemFriction));this._currRenderPosition=g;200<d-this._startTime&&(this._startTime=d,this._accelerationPos=f);e?this._setThumbsPosition(this._currRenderPosition):
this._isMove&&this._setPosition(this._currRenderPosition)}},_onDragMove:function(b,e){var d=this,a="touchmove"===b.type;if(!d._isTouchGesture||a){if(a){if(d._lockAxis)return;var c=b.touches;if(c){if(1<c.length)return;var g=c[0]}else return}else g=b;d._hasMoved||(d._useCSS3Transitions&&(e?d._thumbsContainer:d._slidesContainer).css(d._vendorPref+d._TD,"0s"),function h(){d._isDragging&&(d._animFrame=requestAnimationFrame(h),d._renderMoveEvent&&d._renderMovement(d._renderMoveEvent,e))}());if(d._checkedAxis)b.preventDefault(),
d._renderMoveTime=(new Date).getTime(),d._renderMoveEvent=g;else if(c=e?d._thumbsHorizontal:d._slidesHorizontal,g=Math.abs(g.pageX-d._pageX)-Math.abs(g.pageY-d._pageY)-(c?-7:7),7<g){if(c)b.preventDefault(),d._currMoveAxis="x";else if(a){d._completeGesture(b);return}d._checkedAxis=!0}else if(-7>g){if(!c)b.preventDefault(),d._currMoveAxis="y";else if(a){d._completeGesture(b);return}d._checkedAxis=!0}}},_completeGesture:function(b,e){this._lockAxis=!0;this._hasMoved=this._isDragging=!1;this._onDragRelease(b)},
_onDragRelease:function(b,e){function d(a){return 100>a?100:500<a?500:a}function a(a,b){if(c._isMove||e)u=(-c._realId-c._idOffset)*c._slideSize,g=Math.abs(c._sPosition-u),c._currAnimSpeed=g/b,a&&(c._currAnimSpeed+=250),c._currAnimSpeed=d(c._currAnimSpeed),c._animateTo(u,!1)}var c=this,g;var f=-1<b.type.indexOf("touch");if(!c._isTouchGesture||f)if(c._isTouchGesture=!1,c.ev.trigger("rsDragRelease"),c._renderMoveEvent=null,c._isDragging=!1,c._lockAxis=!1,c._checkedAxis=!1,c._renderMoveTime=0,cancelAnimationFrame(c._animFrame),
c._hasMoved&&(e?c._setThumbsPosition(c._currRenderPosition):c._isMove&&c._setPosition(c._currRenderPosition)),c._eventCallbacks.dragMove&&(c._unbindPassiveEvent(document,c._moveEvent,c._eventCallbacks.dragMove,!0),c._unbindPassiveEvent(document,c._upEvent,c._eventCallbacks.dragRelease,!0)),f&&c._sliderOverflow.off(c._cancelEvent),c._setGrabCursor(),!c._hasMoved&&!c._multipleTouches&&e&&c._thumbsEnabled){var h=l(b.target).closest(".rsNavItem");h.length&&c.goTo(h.index())}else{h=e?c._thumbsHorizontal:
c._slidesHorizontal;if(!c._hasMoved||"y"===c._currMoveAxis&&h||"x"===c._currMoveAxis&&!h)if(!e&&c._wasAnimating){c._wasAnimating=!1;if(c.st.navigateByClick){c._mouseNext(b);c.dragSuccess=!0;return}c.dragSuccess=!0}else{c._wasAnimating=!1;c.dragSuccess=!1;return}else c.dragSuccess=!0;c._wasAnimating=!1;c._currMoveAxis="";var k=c.st.minSlideOffset;f=f?b.changedTouches[0]:b;var m=h?f.pageX:f.pageY,p=c._startPagePos,n=c.currSlideId,r=c.numSlides,t=h?c._horDir:c._verDir,v=c._loop;f=m-c._accelerationPos;
h=(new Date).getTime()-c._startTime;h=Math.abs(f)/h;if(0===t||1>=r)a(!0,h);else{if(!v&&!e)if(0>=n){if(0<t){a(!0,h);return}}else if(n>=r-1&&0>t){a(!0,h);return}if(e){var u=c._thumbsPosition;if(u>c._thumbsMinPosition)u=c._thumbsMinPosition;else if(u<c._thumbsMaxPosition)u=c._thumbsMaxPosition;else{m=h*h/.006;var q=-c._thumbsPosition;p=c._thumbsContainerSize-c._thumbsViewportSize+c._thumbsPosition;0<f&&m>q?(q+=c._thumbsViewportSize/(15/(m/h*.003)),h=h*q/m,m=q):0>f&&m>p&&(p+=c._thumbsViewportSize/(15/
(m/h*.003)),h=h*p/m,m=p);q=Math.max(Math.round(h/.003),50);u+=m*(0>f?-1:1);if(u>c._thumbsMinPosition){c._animateThumbsTo(u,q,!0,c._thumbsMinPosition,200);return}if(u<c._thumbsMaxPosition){c._animateThumbsTo(u,q,!0,c._thumbsMaxPosition,200);return}}c._animateThumbsTo(u,q,!0)}else q=function(a){var b=Math.floor(a/c._slideSize);a-b*c._slideSize>k&&b++;return b},p+k<m?0>t?a(!1,h):(q=q(m-p),c._moveTo(c.currSlideId-q,d(Math.abs(c._sPosition-(-c._realId-c._idOffset+q)*c._slideSize)/h),!1,!0,!0)):p-k>m?0<
t?a(!1,h):(q=q(p-m),c._moveTo(c.currSlideId+q,d(Math.abs(c._sPosition-(-c._realId-c._idOffset-q)*c._slideSize)/h),!1,!0,!0)):a(!1,h)}}},_setPosition:function(b){b=this._sPosition=b;this._useCSS3Transitions?this._slidesContainer.css(this._xProp,this._tPref1+(this._slidesHorizontal?b+this._tPref2+0:0+this._tPref2+b)+this._tPref3):this._slidesContainer.css(this._slidesHorizontal?this._xProp:this._yProp,b)},updateSliderSize:function(b){if(this.slider){if(this.st.autoScaleSlider){var e=this.st.autoScaleSliderWidth,
d=this.st.autoScaleSliderHeight;if(this.st.autoScaleHeight){var a=this.slider.width();a!=this.width&&(this.slider.css("height",d/e*a),a=this.slider.width());var c=this.slider.height()}else c=this.slider.height(),c!=this.height&&(this.slider.css("width",e/d*c),c=this.slider.height()),a=this.slider.width()}else a=this.slider.width(),c=this.slider.height();if(b||a!=this.width||c!=this.height){this.width=a;this.height=c;this._wrapWidth=a;this._wrapHeight=c;this.ev.trigger("rsBeforeSizeSet");this.ev.trigger("rsAfterSizePropSet");
this._sliderOverflow.css({width:this._wrapWidth,height:this._wrapHeight});this._slideSize=(this._slidesHorizontal?this._wrapWidth:this._wrapHeight)+this.st.slidesSpacing;this._imagePadding=this.st.imageScalePadding;for(a=0;a<this.slides.length;a++)b=this.slides[a],b.positionSet=!1,b&&b.images&&b.isLoaded&&(b.isRendered=!1,this._resizeImage(b));if(this._cloneHolders)for(a=0;a<this._cloneHolders.length;a++)b=this._cloneHolders[a],b.holder.css(this._reorderProp,(b.id+this._idOffset)*this._slideSize);
this._updateBlocksContent();this._isMove&&(this._useCSS3Transitions&&this._slidesContainer.css(this._vendorPref+"transition-duration","0s"),this._setPosition((-this._realId-this._idOffset)*this._slideSize));this.ev.trigger("rsOnUpdateNav")}this._sliderOffset=this._sliderOverflow.offset();this._sliderOffset=this._sliderOffset[this._reorderProp]}},appendSlide:function(b,e){var d=this._parseNode(b);if(isNaN(e)||e>this.numSlides)e=this.numSlides;this.slides.splice(e,0,d);this.slidesJQ.splice(e,0,l('<div style="'+
(this._isMove?"position:absolute;":this._opacityCSS)+'" class="rsSlide"></div>'));e<=this.currSlideId&&this.currSlideId++;this.ev.trigger("rsOnAppendSlide",[d,e]);this._refreshSlides(e);e===this.currSlideId&&this.ev.trigger("rsAfterSlideChange")},removeSlide:function(b){var e=this.slides[b];e&&(e.holder&&e.holder.remove(),b<this.currSlideId&&this.currSlideId--,this.slides.splice(b,1),this.slidesJQ.splice(b,1),this.ev.trigger("rsOnRemoveSlide",[b]),this._refreshSlides(b),b===this.currSlideId&&this.ev.trigger("rsAfterSlideChange"))},
_refreshSlides:function(b){var e=this;b=e.numSlides;b=0>=e._realId?0:Math.floor(e._realId/b);e.numSlides=e.slides.length;0===e.numSlides?(e.currSlideId=e._idOffset=e._realId=0,e.currSlide=e._oldHolder=null):e._realId=b*e.numSlides+e.currSlideId;for(b=0;b<e.numSlides;b++)e.slides[b].id=b;e.currSlide=e.slides[e.currSlideId];e._currHolder=e.slidesJQ[e.currSlideId];e.currSlideId>=e.numSlides?e.goTo(e.numSlides-1):0>e.currSlideId&&e.goTo(0);e._refreshNumPreloadImages();e._isMove&&e._slidesContainer.css(e._vendorPref+
e._TD,"0ms");e._refreshSlidesTimeout&&clearTimeout(e._refreshSlidesTimeout);e._refreshSlidesTimeout=setTimeout(function(){e._isMove&&e._setPosition((-e._realId-e._idOffset)*e._slideSize);e._updateBlocksContent();e._isMove||e._currHolder.css({display:"block",opacity:1})},14);e.ev.trigger("rsOnUpdateNav")},_setGrabCursor:function(){this._hasDrag&&this._isMove&&(this._grabCursor?this._sliderOverflow.css("cursor",this._grabCursor):(this._sliderOverflow.removeClass("grabbing-cursor"),this._sliderOverflow.addClass("grab-cursor")))},
_setGrabbingCursor:function(){this._hasDrag&&this._isMove&&(this._grabbingCursor?this._sliderOverflow.css("cursor",this._grabbingCursor):(this._sliderOverflow.removeClass("grab-cursor"),this._sliderOverflow.addClass("grabbing-cursor")))},next:function(b){this._moveTo("next",this.st.transitionSpeed,!0,!b)},prev:function(b){this._moveTo("prev",this.st.transitionSpeed,!0,!b)},_moveTo:function(b,e,d,a,c){var g=this;g.ev.trigger("rsBeforeMove",[b,a]);var f="next"===b?g.currSlideId+1:"prev"===b?g.currSlideId-
1:b=parseInt(b,10);if(!g._loop){if(0>f){g._doBackAndForthAnim("left",!a);return}if(f>=g.numSlides){g._doBackAndForthAnim("right",!a);return}}g._isAnimating&&(g._stopAnimation(!0),d=!1);var h=f-g.currSlideId;f=g._prevSlideId=g.currSlideId;var k=g.currSlideId+h;a=g._realId;var m;g._loop?(k=g._updateBlocksContent(!1,k),a+=h):a=k;g._newSlideId=k;g._oldHolder=g.slidesJQ[g.currSlideId];g._realId=a;g.currSlideId=g._newSlideId;g.currSlide=g.slides[g.currSlideId];g._currHolder=g.slidesJQ[g.currSlideId];k=
g.st.slidesDiff;var l=0<h;h=Math.abs(h);var n=Math.floor(f/g._numPreloadImages),r=Math.floor((f+(l?k:-k))/g._numPreloadImages);n=(l?Math.max(n,r):Math.min(n,r))*g._numPreloadImages+(l?g._numPreloadImages-1:0);n>g.numSlides-1?n=g.numSlides-1:0>n&&(n=0);f=l?n-f:f-n;f>g._numPreloadImages&&(f=g._numPreloadImages);if(h>f+k)for(g._idOffset+=(h-(f+k))*(l?-1:1),e*=1.4,f=0;f<g.numSlides;f++)g.slides[f].positionSet=!1;g._currAnimSpeed=e;g._updateBlocksContent(!0);c||(m=!0);var t=(-a-g._idOffset)*g._slideSize;
m?setTimeout(function(){g._isWorking=!1;g._animateTo(t,b,!1,d);g.ev.trigger("rsOnUpdateNav")},0):(g._animateTo(t,b,!1,d),g.ev.trigger("rsOnUpdateNav"))},_updateArrowsNav:function(){this.st.arrowsNav&&(1>=this.numSlides?(this._arrowLeft.css("display","none"),this._arrowRight.css("display","none")):(this._arrowLeft.css("display","block"),this._arrowRight.css("display","block"),this._loop||this.st.loopRewind||(0===this.currSlideId?this._arrowLeft.addClass("rsArrowDisabled"):this._arrowLeft.removeClass("rsArrowDisabled"),
this.currSlideId===this.numSlides-1?this._arrowRight.addClass("rsArrowDisabled"):this._arrowRight.removeClass("rsArrowDisabled"))))},_animateTo:function(b,e,d,a,c){function g(){var a;k&&(a=k.data("rsTimeout"))&&(k!==m&&k.css({opacity:0,display:"none",zIndex:0}),clearTimeout(a),k.data("rsTimeout",""));if(a=m.data("rsTimeout"))clearTimeout(a),m.data("rsTimeout","")}var f=this,h={};isNaN(f._currAnimSpeed)&&(f._currAnimSpeed=400);f._sPosition=f._currRenderPosition=b;f.ev.trigger("rsBeforeAnimStart");
if(f._useCSS3Transitions)if(f._isMove)f._currAnimSpeed=parseInt(f._currAnimSpeed,10),d=f._vendorPref+f._TTF,h[f._vendorPref+f._TD]=f._currAnimSpeed+"ms",h[d]=a?l.rsCSS3Easing[f.st.easeInOut]:l.rsCSS3Easing[f.st.easeOut],f._slidesContainer.css(h),a||!f.hasTouch?setTimeout(function(){f._setPosition(b)},5):f._setPosition(b);else{f._currAnimSpeed=f.st.transitionSpeed;var k=f._oldHolder;var m=f._currHolder;m.data("rsTimeout")&&m.css("opacity",0);g();k&&k.data("rsTimeout",setTimeout(function(){h[f._vendorPref+
f._TD]="0ms";h.zIndex=0;h.display="none";k.data("rsTimeout","");k.css(h);setTimeout(function(){k.css("opacity",0)},16)},f._currAnimSpeed+60));h.display="block";h.zIndex=f._fadeZIndex;h.opacity=0;h[f._vendorPref+f._TD]="0ms";h[f._vendorPref+f._TTF]=l.rsCSS3Easing[f.st.easeInOut];m.css(h);m.data("rsTimeout",setTimeout(function(){m.css(f._vendorPref+f._TD,f._currAnimSpeed+"ms");m.data("rsTimeout",setTimeout(function(){m.css("opacity",1);m.data("rsTimeout","")},20))},20))}else f._isMove?(h[f._slidesHorizontal?
f._xProp:f._yProp]=b+"px",f._slidesContainer.animate(h,f._currAnimSpeed,a?f.st.easeInOut:f.st.easeOut)):(k=f._oldHolder,m=f._currHolder,m.stop(!0,!0).css({opacity:0,display:"block",zIndex:f._fadeZIndex}),f._currAnimSpeed=f.st.transitionSpeed,m.animate({opacity:1},f._currAnimSpeed,f.st.easeInOut),g(),k&&k.data("rsTimeout",setTimeout(function(){k.stop(!0,!0).css({opacity:0,display:"none",zIndex:0})},f._currAnimSpeed+60)));f._isAnimating=!0;f.loadingTimeout&&clearTimeout(f.loadingTimeout);f.loadingTimeout=
c?setTimeout(function(){f.loadingTimeout=null;c.call()},f._currAnimSpeed+60):setTimeout(function(){f.loadingTimeout=null;f._animationComplete(e)},f._currAnimSpeed+60)},_stopAnimation:function(b){this._isAnimating=!1;clearTimeout(this.loadingTimeout);if(this._isMove)if(!this._useCSS3Transitions)this._slidesContainer.stop(!0),this._sPosition=parseInt(this._slidesContainer.css(this._slidesHorizontal?this._xProp:this._yProp),10);else{if(!b){b=this._sPosition;var e=this._currRenderPosition=this._getTransformProp();
this._slidesContainer.css(this._vendorPref+this._TD,"0ms");b!==e&&this._setPosition(e)}}else 20<this._fadeZIndex?this._fadeZIndex=10:this._fadeZIndex++},_getTransformProp:function(){var b=window.getComputedStyle(this._slidesContainer.get(0),null).getPropertyValue(this._vendorPref+"transform").replace(/^matrix\(/i,"").split(/, |\)$/g),e=0===b[0].indexOf("matrix3d");return parseInt(b[this._slidesHorizontal?e?12:4:e?13:5],10)},_getCSS3Prop:function(b,e){return this._useCSS3Transitions?this._tPref1+(e?
b+this._tPref2+0:0+this._tPref2+b)+this._tPref3:b},_animationComplete:function(b){this._isMove||(this._currHolder.css("z-index",0),this._fadeZIndex=10);this._isAnimating=!1;this.staticSlideId=this.currSlideId;this._updateBlocksContent();this._slidesMoved=!1;this.ev.trigger("rsAfterSlideChange")},_doBackAndForthAnim:function(b,e){var d=this,a=(-d._realId-d._idOffset)*d._slideSize;if(0!==d.numSlides&&!d._isAnimating)if(d.st.loopRewind)d.goTo("left"===b?d.numSlides-1:0,e);else if(d._isMove){d._currAnimSpeed=
200;var c=function(){d._isAnimating=!1};d._animateTo(a+("left"===b?30:-30),"",!1,!0,function(){d._isAnimating=!1;d._animateTo(a,"",!1,!0,c)})}},_detectPassiveSupport:function(){var b=this;if(!b._passiveChecked){b._passiveChecked=!0;b._passiveParam=!1;try{var e=Object.defineProperty({},"passive",{get:function(){b._passiveParam={passive:!1}}});window.addEventListener("testPassive",null,e);window.removeEventListener("testPassive",null,e)}catch(d){}}},_bindPassiveEvent:function(b,e,d,a){this._detectPassiveSupport();
e=e.split(" ");for(var c=0;c<e.length;c++)e[c]&&2<e[c].length&&b.addEventListener(e[c],d,a?this._passiveParam:!1)},_unbindPassiveEvent:function(b,e,d,a){this._detectPassiveSupport();e=e.split(" ");for(var c=0;c<e.length;c++)e[c]&&2<e[c].length&&b.removeEventListener(e[c],d,a?this._passiveParam:!1)},_resizeImage:function(b,e){if(!b.isRendered){var d=b.content,a="rsMainSlideImage",c=l.isFunction(this.st.imageAlignCenter)?this.st.imageAlignCenter(b):this.st.imageAlignCenter,g=l.isFunction(this.st.imageScaleMode)?
this.st.imageScaleMode(b):this.st.imageScaleMode;if(b.videoURL)if(a="rsVideoContainer","fill"!==g)var f=!0;else{var h=d;h.hasClass(a)||(h=h.find("."+a));h.css({width:"100%",height:"100%"});a="rsMainSlideImage"}d.hasClass(a)||(d=d.find("."+a));if(d){var k=b.iW,m=b.iH;b.isRendered=!0;if("none"!==g||c){a="fill"!==g?this._imagePadding:0;h=this._wrapWidth-2*a;var p=this._wrapHeight-2*a,n={};"fit-if-smaller"===g&&(k>h||m>p)&&(g="fit");if("fill"===g||"fit"===g){var r=h/k;var t=p/m;r="fill"==g?r>t?r:t:"fit"==
g?r<t?r:t:1;k=Math.ceil(k*r,10);m=Math.ceil(m*r,10)}"none"!==g&&(n.width=k,n.height=m,f&&d.find(".rsImg").css({width:"100%",height:"100%"}));c&&(n.marginLeft=Math.floor((h-k)/2)+a,n.marginTop=Math.floor((p-m)/2)+a);d.css(n)}}}}};l.rsProto=v.prototype;l.fn.royalSlider=function(b){var e=arguments;return this.each(function(){var d=l(this);if("object"!==typeof b&&b){if((d=d.data("royalSlider"))&&d[b])return d[b].apply(d,Array.prototype.slice.call(e,1))}else d.data("royalSlider")||d.data("royalSlider",
new v(d,b))})};l.fn.royalSlider.defaults={slidesSpacing:8,startSlideId:0,loop:!1,loopRewind:!1,numImagesToPreload:4,fadeinLoadedSlide:!0,slidesOrientation:"horizontal",transitionType:"move",transitionSpeed:600,controlNavigation:"bullets",controlsInside:!0,arrowsNav:!0,arrowsNavAutoHide:!0,navigateByClick:!0,randomizeSlides:!1,sliderDrag:!0,sliderTouch:!0,keyboardNavEnabled:!1,fadeInAfterLoaded:!0,allowCSS3:!0,allowCSS3OnWebkit:!0,addActiveClass:!1,autoHeight:!1,easeOut:"easeOutSine",easeInOut:"easeInOutSine",
minSlideOffset:10,imageScaleMode:"fit-if-smaller",imageAlignCenter:!0,imageScalePadding:4,usePreloader:!0,autoScaleSlider:!1,autoScaleSliderWidth:800,autoScaleSliderHeight:400,autoScaleHeight:!0,arrowsNavHideOnTouch:!1,globalCaption:!1,slidesDiff:2};l.rsCSS3Easing={easeOutSine:"cubic-bezier(0.390, 0.575, 0.565, 1.000)",easeInOutSine:"cubic-bezier(0.445, 0.050, 0.550, 0.950)"};l.extend(jQuery.easing,{easeInOutSine:function(b,e,d,a,c){return-a/2*(Math.cos(Math.PI*e/c)-1)+d},easeOutSine:function(b,e,
d,a,c){return a*Math.sin(e/c*(Math.PI/2))+d},easeOutCubic:function(b,e,d,a,c){return a*((e=e/c-1)*e*e+1)+d}})})(jQuery,window);
// jquery.rs.bullets v1.0.1
(function(c){c.extend(c.rsProto,{_initBullets:function(){var a=this;"bullets"===a.st.controlNavigation&&(a.ev.one("rsAfterPropsSetup",function(){a._controlNavEnabled=!0;a.slider.addClass("rsWithBullets");for(var b='<div class="rsNav rsBullets">',e=0;e<a.numSlides;e++)b+='<div class="rsNavItem rsBullet"><span></span></div>';a._controlNav=b=c(b+"</div>");a._controlNavItems=b.appendTo(a.slider).children();a._controlNav.on("click.rs",".rsNavItem",function(b){a._thumbsDrag||a.goTo(c(this).index())})}),
a.ev.on("rsOnAppendSlide",function(b,c,d){d>=a.numSlides?a._controlNav.append('<div class="rsNavItem rsBullet"><span></span></div>'):a._controlNavItems.eq(d).before('<div class="rsNavItem rsBullet"><span></span></div>');a._controlNavItems=a._controlNav.children()}),a.ev.on("rsOnRemoveSlide",function(b,c){var d=a._controlNavItems.eq(c);d&&d.length&&(d.remove(),a._controlNavItems=a._controlNav.children())}),a.ev.on("rsOnUpdateNav",function(){var b=a.currSlideId;a._prevNavItem&&a._prevNavItem.removeClass("rsNavSelected");
b=a._controlNavItems.eq(b);b.addClass("rsNavSelected");a._prevNavItem=b}))}});c.rsModules.bullets=c.rsProto._initBullets})(jQuery);// jquery.rs.thumbnails v1.0.9
(function(g){g.extend(g.rsProto,{_initThumbs:function(){var a=this;"thumbnails"===a.st.controlNavigation&&(a._thumbsDefaults={drag:!0,touch:!0,orientation:"horizontal",navigation:!0,arrows:!0,arrowLeft:null,arrowRight:null,spacing:4,arrowsAutoHide:!1,appendSpan:!1,transitionSpeed:600,autoCenter:!0,fitInViewport:!0,firstMargin:!0,paddingTop:0,paddingBottom:0},a.st.thumbs=g.extend({},a._thumbsDefaults,a.st.thumbs),a._firstThumbMoved=!0,!1===a.st.thumbs.firstMargin?a.st.thumbs.firstMargin=0:!0===a.st.thumbs.firstMargin&&
(a.st.thumbs.firstMargin=a.st.thumbs.spacing),a.ev.on("rsBeforeParseNode",function(a,b,c){b=g(b);c.thumbnail=b.find(".rsTmb").remove();c.thumbnail.length?c.thumbnail=g(document.createElement("div")).append(c.thumbnail).html():(c.thumbnail=b.attr("data-rsTmb"),c.thumbnail||(c.thumbnail=b.find(".rsImg").attr("data-rsTmb")),c.thumbnail=c.thumbnail?'<img src="'+c.thumbnail+'"/>':"")}),a.ev.one("rsAfterPropsSetup",function(){a._createThumbs()}),a._prevNavItem=null,a.ev.on("rsOnUpdateNav",function(){var d=
g(a._controlNavItems[a.currSlideId]);d!==a._prevNavItem&&(a._prevNavItem&&(a._prevNavItem.removeClass("rsNavSelected"),a._prevNavItem=null),a._thumbsNavigation&&a._setCurrentThumb(a.currSlideId),a._prevNavItem=d.addClass("rsNavSelected"))}),a.ev.on("rsOnAppendSlide",function(d,b,c){d="<div"+a._thumbsMargin+' class="rsNavItem rsThumb">'+a._addThumbHTML+b.thumbnail+"</div>";a._useCSS3Transitions&&a._thumbsContainer.css(a._vendorPref+"transition-duration","0ms");c>=a.numSlides?a._thumbsContainer.append(d):
a._controlNavItems.eq(c).before(d);a._controlNavItems=a._thumbsContainer.children();a.updateThumbsSize(!0)}),a.ev.on("rsOnRemoveSlide",function(d,b){var c=a._controlNavItems.eq(b);c&&(a._useCSS3Transitions&&a._thumbsContainer.css(a._vendorPref+"transition-duration","0ms"),c.remove(),a._controlNavItems=a._thumbsContainer.children(),a.updateThumbsSize(!0))}))},_createThumbs:function(){var a=this,d="rsThumbs",b=a.st.thumbs,c="",f,e=b.spacing;a._controlNavEnabled=!0;a._thumbsHorizontal="vertical"===b.orientation?
!1:!0;a._thumbsMargin=f=e?' style="margin-'+(a._thumbsHorizontal?"right":"bottom")+":"+e+'px;"':"";a._thumbsPosition=0;a._isThumbsAnimating=!1;a._thumbsDrag=!1;a._thumbsNavigation=!1;a._thumbsArrows=b.arrows&&b.navigation;var h=a._thumbsHorizontal?"Hor":"Ver";a.slider.addClass("rsWithThumbs rsWithThumbs"+h);c+='<div class="rsNav rsThumbs rsThumbs'+h+'"><div class="'+d+'Container">';a._addThumbHTML=b.appendSpan?'<span class="thumbIco"></span>':"";for(var k=0;k<a.numSlides;k++)h=a.slides[k],c+="<div"+
f+' class="rsNavItem rsThumb">'+h.thumbnail+a._addThumbHTML+"</div>";c=g(c+"</div></div>");f={};b.paddingTop&&(f[a._thumbsHorizontal?"paddingTop":"paddingLeft"]=b.paddingTop);b.paddingBottom&&(f[a._thumbsHorizontal?"paddingBottom":"paddingRight"]=b.paddingBottom);c.css(f);a._thumbsContainer=g(c).find("."+d+"Container");a._thumbsArrows&&(d+="Arrow",b.arrowLeft?a._thumbsArrowLeft=b.arrowLeft:(a._thumbsArrowLeft=g('<div class="'+d+" "+d+'Left"><div class="'+d+'Icn"></div></div>'),c.append(a._thumbsArrowLeft)),
b.arrowRight?a._thumbsArrowRight=b.arrowRight:(a._thumbsArrowRight=g('<div class="'+d+" "+d+'Right"><div class="'+d+'Icn"></div></div>'),c.append(a._thumbsArrowRight)),a._thumbsArrowLeft.click(function(){var b=(Math.floor(a._thumbsPosition/a._thumbSize)+a._visibleThumbsPerView)*a._thumbSize+a.st.thumbs.firstMargin;a._animateThumbsTo(b>a._thumbsMinPosition?a._thumbsMinPosition:b)}),a._thumbsArrowRight.click(function(){var b=(Math.floor(a._thumbsPosition/a._thumbSize)-a._visibleThumbsPerView)*a._thumbSize+
a.st.thumbs.firstMargin;a._animateThumbsTo(b<a._thumbsMaxPosition?a._thumbsMaxPosition:b)}),b.arrowsAutoHide&&!a.hasTouch&&(a._thumbsArrowLeft.css("opacity",0),a._thumbsArrowRight.css("opacity",0),c.one("mousemove.rsarrowshover",function(){a._thumbsNavigation&&(a._thumbsArrowLeft.css("opacity",1),a._thumbsArrowRight.css("opacity",1))}),c.hover(function(){a._thumbsNavigation&&(a._thumbsArrowLeft.css("opacity",1),a._thumbsArrowRight.css("opacity",1))},function(){a._thumbsNavigation&&(a._thumbsArrowLeft.css("opacity",
0),a._thumbsArrowRight.css("opacity",0))})));a._controlNav=c;a._controlNavItems=a._thumbsContainer.children();a.msEnabled&&a.st.thumbs.navigation&&a._thumbsContainer.css("-ms-touch-action",a._thumbsHorizontal?"pan-y":"pan-x");a.slider.append(c);a._thumbsEnabled=!0;a._thumbsSpacing=e;b.navigation&&a._useCSS3Transitions&&a._thumbsContainer.css(a._vendorPref+"transition-property",a._vendorPref+"transform");a._controlNav.on("click.rs",".rsNavItem",function(b){a._thumbsDrag||a.goTo(g(this).index())});
a.ev.off("rsBeforeSizeSet.thumbs").on("rsBeforeSizeSet.thumbs",function(){a._realWrapSize=a._thumbsHorizontal?a._wrapHeight:a._wrapWidth;a.updateThumbsSize(!0)});a.ev.off("rsAutoHeightChange.thumbs").on("rsAutoHeightChange.thumbs",function(b,c){a.updateThumbsSize(!0,c)})},updateThumbsSize:function(a,d){var b=this._controlNavItems.first(),c={},f=this._controlNavItems.length;this._thumbSize=(this._thumbsHorizontal?b.outerWidth():b.outerHeight())+this._thumbsSpacing;this._thumbsContainerSize=f*this._thumbSize-
this._thumbsSpacing;c[this._thumbsHorizontal?"width":"height"]=this._thumbsContainerSize+this._thumbsSpacing;this._thumbsViewportSize=this._thumbsHorizontal?this._controlNav.width():void 0!==d?d:this._controlNav.height();this._thumbsEnabled&&(this.isFullscreen||this.st.thumbs.fitInViewport)&&(this._thumbsHorizontal?this._wrapHeight=this._realWrapSize-this._controlNav.outerHeight():this._wrapWidth=this._realWrapSize-this._controlNav.outerWidth());this._thumbsViewportSize&&(this._thumbsMaxPosition=
-(this._thumbsContainerSize-this._thumbsViewportSize)-this.st.thumbs.firstMargin,this._thumbsMinPosition=this.st.thumbs.firstMargin,this._visibleThumbsPerView=Math.floor(this._thumbsViewportSize/this._thumbSize),this._thumbsContainerSize<this._thumbsViewportSize?(this.st.thumbs.autoCenter?this._setThumbsPosition((this._thumbsViewportSize-this._thumbsContainerSize)/2):this._setThumbsPosition(this._thumbsMinPosition),this.st.thumbs.arrows&&this._thumbsArrowLeft&&(this._thumbsArrowLeft.addClass("rsThumbsArrowDisabled"),
this._thumbsArrowRight.addClass("rsThumbsArrowDisabled")),this._thumbsDrag=this._thumbsNavigation=!1,this._unbindPassiveEvent(this._controlNav[0],this._downEvent,this._eventCallbacks.dragStartThumb,!1)):this.st.thumbs.navigation&&!this._thumbsNavigation&&(this._thumbsNavigation=!0,!this.hasTouch&&this.st.thumbs.drag||this.hasTouch&&this.st.thumbs.touch)&&(this._thumbsDrag=!0,this._bindPassiveEvent(this._controlNav[0],this._downEvent,this._eventCallbacks.dragStartThumb,!1)),this._thumbsContainer.css(c),
a&&d&&this._setCurrentThumb(this.currSlideId,!0))},setThumbsOrientation:function(a,d){this._thumbsEnabled&&(this.st.thumbs.orientation=a,this._controlNav.remove(),this.slider.removeClass("rsWithThumbsHor rsWithThumbsVer"),this._createThumbs(),this._unbindPassiveEvent(this._controlNav[0],this._downEvent,this._eventCallbacks.dragStartThumb,!1),d||this.updateSliderSize(!0))},_setThumbsPosition:function(a){this._thumbsPosition=a;this._useCSS3Transitions?this._thumbsContainer.css(this._xProp,this._tPref1+
(this._thumbsHorizontal?a+this._tPref2+0:0+this._tPref2+a)+this._tPref3):this._thumbsContainer.css(this._thumbsHorizontal?this._xProp:this._yProp,a)},_animateThumbsTo:function(a,d,b,c,f){var e=this;if(e._thumbsNavigation){d||(d=e.st.thumbs.transitionSpeed);e._thumbsPosition=a;e._thumbsAnimTimeout&&clearTimeout(e._thumbsAnimTimeout);e._isThumbsAnimating&&(e._useCSS3Transitions||e._thumbsContainer.stop(),b=!0);var h={};e._isThumbsAnimating=!0;e._useCSS3Transitions?(h[e._vendorPref+"transition-duration"]=
d+"ms",h[e._vendorPref+"transition-timing-function"]=b?g.rsCSS3Easing[e.st.easeOut]:g.rsCSS3Easing[e.st.easeInOut],e._thumbsContainer.css(h),e._setThumbsPosition(a)):(h[e._thumbsHorizontal?e._xProp:e._yProp]=a+"px",e._thumbsContainer.animate(h,d,b?"easeOutCubic":e.st.easeInOut));c&&(e._thumbsPosition=c);e._updateThumbsArrows();e._thumbsAnimTimeout=setTimeout(function(){e._isThumbsAnimating=!1;f&&(e._animateThumbsTo(c,f,!0),f=null)},d)}},_updateThumbsArrows:function(){this._thumbsArrows&&(this._thumbsPosition===
this._thumbsMinPosition?this._thumbsArrowLeft.addClass("rsThumbsArrowDisabled"):this._thumbsArrowLeft.removeClass("rsThumbsArrowDisabled"),this._thumbsPosition===this._thumbsMaxPosition?this._thumbsArrowRight.addClass("rsThumbsArrowDisabled"):this._thumbsArrowRight.removeClass("rsThumbsArrowDisabled"))},_setCurrentThumb:function(a,d){var b=0,c=a*this._thumbSize+2*this._thumbSize-this._thumbsSpacing+this._thumbsMinPosition;if(this._thumbsNavigation){this._firstThumbMoved&&(d=!0,this._firstThumbMoved=
!1);if(c+this._thumbsPosition>this._thumbsViewportSize){a===this.numSlides-1&&(b=1);var f=-a+this._visibleThumbsPerView-2+b;f=f*this._thumbSize+this._thumbsViewportSize%this._thumbSize+this._thumbsSpacing-this._thumbsMinPosition}else 0!==a?(a-1)*this._thumbSize<=-this._thumbsPosition+this._thumbsMinPosition&&a-1<=this.numSlides-this._visibleThumbsPerView&&(f=(-a+1)*this._thumbSize+this._thumbsMinPosition):f=this._thumbsMinPosition;f!==this._thumbsPosition&&(b=void 0===f?this._thumbsPosition:f,b>this._thumbsMinPosition?
this._setThumbsPosition(this._thumbsMinPosition):b<this._thumbsMaxPosition?this._setThumbsPosition(this._thumbsMaxPosition):void 0!==f&&(d?this._setThumbsPosition(f):this._animateThumbsTo(f)));this._updateThumbsArrows()}}});g.rsModules.thumbnails=g.rsProto._initThumbs})(jQuery);// jquery.rs.tabs v1.0.2
(function(e){e.extend(e.rsProto,{_initTabs:function(){var a=this;"tabs"===a.st.controlNavigation&&(a.ev.on("rsBeforeParseNode",function(a,d,b){d=e(d);b.thumbnail=d.find(".rsTmb").remove();b.thumbnail.length?b.thumbnail=e(document.createElement("div")).append(b.thumbnail).html():(b.thumbnail=d.attr("data-rsTmb"),b.thumbnail||(b.thumbnail=d.find(".rsImg").attr("data-rsTmb")),b.thumbnail=b.thumbnail?'<img src="'+b.thumbnail+'"/>':"")}),a.ev.one("rsAfterPropsSetup",function(){a._createTabs()}),a.ev.on("rsOnAppendSlide",
function(c,d,b){b>=a.numSlides?a._controlNav.append('<div class="rsNavItem rsTab">'+d.thumbnail+"</div>"):a._controlNavItems.eq(b).before('<div class="rsNavItem rsTab">'+item.thumbnail+"</div>");a._controlNavItems=a._controlNav.children()}),a.ev.on("rsOnRemoveSlide",function(c,d){var b=a._controlNavItems.eq(d);b&&(b.remove(),a._controlNavItems=a._controlNav.children())}),a.ev.on("rsOnUpdateNav",function(){var c=a.currSlideId;a._prevNavItem&&a._prevNavItem.removeClass("rsNavSelected");c=a._controlNavItems.eq(c);
c.addClass("rsNavSelected");a._prevNavItem=c}))},_createTabs:function(){var a=this;a._controlNavEnabled=!0;var c='<div class="rsNav rsTabs">';for(var d=0;d<a.numSlides;d++)c+='<div class="rsNavItem rsTab">'+a.slides[d].thumbnail+"</div>";c=e(c+"</div>");a._controlNav=c;a._controlNavItems=c.children(".rsNavItem");a.slider.append(c);a._controlNav.click(function(b){b=e(b.target).closest(".rsNavItem");b.length&&a.goTo(b.index())})}});e.rsModules.tabs=e.rsProto._initTabs})(jQuery);// jquery.rs.fullscreen v1.0.6
(function(c){c.extend(c.rsProto,{_initFullscreen:function(){var a=this;a._fullscreenDefaults={enabled:!1,keyboardNav:!0,buttonFS:!0,nativeFS:!1,doubleTap:!0};a.st.fullscreen=c.extend({},a._fullscreenDefaults,a.st.fullscreen);if(a.st.fullscreen.enabled)a.ev.one("rsBeforeSizeSet",function(){a._setupFullscreen()})},_setupFullscreen:function(){var a=this;a._fsKeyboard=!a.st.keyboardNavEnabled&&a.st.fullscreen.keyboardNav;if(a.st.fullscreen.nativeFS){var b={supportsFullScreen:!1,isFullScreen:function(){return!1},
requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",prefix:""},d=["webkit","moz","o","ms","khtml"];if("undefined"!=typeof document.cancelFullScreen)b.supportsFullScreen=!0;else for(var e=0,f=d.length;e<f;e++)if(b.prefix=d[e],"undefined"!=typeof document[b.prefix+"CancelFullScreen"]){b.supportsFullScreen=!0;break}b.supportsFullScreen?(a.nativeFS=!0,b.fullScreenEventName=b.prefix+"fullscreenchange"+a.ns,b.isFullScreen=function(){switch(this.prefix){case "":return document.fullScreen;
case "webkit":return document.webkitIsFullScreen;default:return document[this.prefix+"FullScreen"]}},b.requestFullScreen=function(a){return""===this.prefix?a.requestFullScreen():a[this.prefix+"RequestFullScreen"]()},b.cancelFullScreen=function(a){return""===this.prefix?document.cancelFullScreen():document[this.prefix+"CancelFullScreen"]()},a._fullScreenApi=b):a._fullScreenApi=!1}a.st.fullscreen.buttonFS&&(a._fsBtn=c('<div class="rsFullscreenBtn"><div class="rsFullscreenIcn"></div></div>').appendTo(a._controlsContainer).on("click.rs",
function(){a.isFullscreen?a.exitFullscreen():a.enterFullscreen()}))},enterFullscreen:function(a){var b=this;if(b._fullScreenApi)if(a)b._fullScreenApi.requestFullScreen(c("html")[0]);else{b._doc.on(b._fullScreenApi.fullScreenEventName,function(a){b._fullScreenApi.isFullScreen()?b.enterFullscreen(!0):b.exitFullscreen(!0)});b._fullScreenApi.requestFullScreen(c("html")[0]);return}if(!b._isFullscreenUpdating){b._isFullscreenUpdating=!0;b._doc.on("keyup"+b.ns+"fullscreen",function(a){27===a.keyCode&&b.exitFullscreen()});
b._fsKeyboard&&b._bindKeyboardNav();a=c(window);b._fsScrollTopOnEnter=a.scrollTop();b._fsScrollLeftOnEnter=a.scrollLeft();b._htmlStyle=c("html").attr("style");b._bodyStyle=c("body").attr("style");b._sliderStyle=b.slider.attr("style");c("body, html").css({overflow:"hidden",height:"100%",width:"100%",margin:"0",padding:"0"});b.slider.addClass("rsFullscreen");var d;for(d=0;d<b.numSlides;d++)a=b.slides[d],a.isRendered=!1,a.bigImage&&(a.isBig=!0,a.isMedLoaded=a.isLoaded,a.isMedLoading=a.isLoading,a.medImage=
a.image,a.medIW=a.iW,a.medIH=a.iH,a.slideId=-99,a.bigImage!==a.medImage&&(a.sizeType="big"),a.isLoaded=a.isBigLoaded,a.isLoading=!1,a.image=a.bigImage,a.images[0]=a.bigImage,a.iW=a.bigIW,a.iH=a.bigIH,a.isAppended=a.contentAdded=!1,b._updateItemSrc(a));b.isFullscreen=!0;b._isFullscreenUpdating=!1;b.updateSliderSize();b.ev.trigger("rsEnterFullscreen")}},exitFullscreen:function(a){var b=this;if(b._fullScreenApi){if(!a){b._fullScreenApi.cancelFullScreen(c("html")[0]);return}b._doc.off(b._fullScreenApi.fullScreenEventName)}if(!b._isFullscreenUpdating){b._isFullscreenUpdating=
!0;b._doc.off("keyup"+b.ns+"fullscreen");b._fsKeyboard&&b._doc.off("keydown"+b.ns);c("html").attr("style",b._htmlStyle||"");c("body").attr("style",b._bodyStyle||"");var d;for(d=0;d<b.numSlides;d++)a=b.slides[d],a.isRendered=!1,a.bigImage&&(a.isBig=!1,a.slideId=-99,a.isBigLoaded=a.isLoaded,a.isBigLoading=a.isLoading,a.bigImage=a.image,a.bigIW=a.iW,a.bigIH=a.iH,a.isLoaded=a.isMedLoaded,a.isLoading=!1,a.image=a.medImage,a.images[0]=a.medImage,a.iW=a.medIW,a.iH=a.medIH,a.isAppended=a.contentAdded=!1,
b._updateItemSrc(a,!0),a.bigImage!==a.medImage&&(a.sizeType="med"));b.isFullscreen=!1;a=c(window);a.scrollTop(b._fsScrollTopOnEnter);a.scrollLeft(b._fsScrollLeftOnEnter);b._isFullscreenUpdating=!1;b.slider.removeClass("rsFullscreen");b.updateSliderSize();setTimeout(function(){b.updateSliderSize()},1);b.ev.trigger("rsExitFullscreen")}},_updateItemSrc:function(a,b){var d=a.isLoaded||a.isLoading?'<img class="rsImg rsMainSlideImage" src="'+a.image+'"/>':'<a class="rsImg rsMainSlideImage" href="'+a.image+
'"></a>';a.content.hasClass("rsImg")?a.content=c(d):a.content.find(".rsImg").eq(0).replaceWith(d);a.isLoaded||a.isLoading||!a.holder||a.holder.html(a.content)}});c.rsModules.fullscreen=c.rsProto._initFullscreen})(jQuery);// jquery.rs.autoplay v1.0.5
(function(b){b.extend(b.rsProto,{_initAutoplay:function(){var a=this,d;a._autoPlayDefaults={enabled:!1,stopAtAction:!0,pauseOnHover:!0,delay:2E3};!a.st.autoPlay&&a.st.autoplay&&(a.st.autoPlay=a.st.autoplay);a.st.autoPlay=b.extend({},a._autoPlayDefaults,a.st.autoPlay);a.st.autoPlay.enabled&&(a.ev.on("rsBeforeParseNode",function(a,c,f){c=b(c);if(d=c.attr("data-rsDelay"))f.customDelay=parseInt(d,10)}),a.ev.one("rsAfterInit",function(){a._setupAutoPlay()}),a.ev.on("rsBeforeDestroy",function(){a.stopAutoPlay();
a.slider.off("mouseenter mouseleave");b(window).off("blur"+a.ns+" focus"+a.ns)}))},_setupAutoPlay:function(){var a=this;a.startAutoPlay();a.ev.on("rsAfterContentSet",function(b,e){a._isDragging||a._isAnimating||!a._autoPlayEnabled||e!==a.currSlide||a._play()});a.ev.on("rsDragRelease",function(){a._autoPlayEnabled&&a._autoPlayPaused&&(a._autoPlayPaused=!1,a._play())});a.ev.on("rsAfterSlideChange",function(){a._autoPlayEnabled&&a._autoPlayPaused&&(a._autoPlayPaused=!1,a.currSlide.isLoaded&&a._play())});
a.ev.on("rsDragStart",function(){a._autoPlayEnabled&&(a.st.autoPlay.stopAtAction?a.stopAutoPlay():(a._autoPlayPaused=!0,a._pause()))});a.ev.on("rsBeforeMove",function(b,e,c){a._autoPlayEnabled&&(c&&a.st.autoPlay.stopAtAction?a.stopAutoPlay():(a._autoPlayPaused=!0,a._pause()))});a._pausedByVideo=!1;a.ev.on("rsVideoStop",function(){a._autoPlayEnabled&&(a._pausedByVideo=!1,a._play())});a.ev.on("rsVideoPlay",function(){a._autoPlayEnabled&&(a._autoPlayPaused=!1,a._pause(),a._pausedByVideo=!0)});b(window).on("blur"+
a.ns,function(){a._autoPlayEnabled&&(a._autoPlayPaused=!0,a._pause())}).on("focus"+a.ns,function(){a._autoPlayEnabled&&a._autoPlayPaused&&(a._autoPlayPaused=!1,a._play())});a.st.autoPlay.pauseOnHover&&(a._pausedByHover=!1,a.slider.hover(function(){a._autoPlayEnabled&&(a._autoPlayPaused=!1,a._pause(),a._pausedByHover=!0)},function(){a._autoPlayEnabled&&(a._pausedByHover=!1,a._play())}))},toggleAutoPlay:function(){this._autoPlayEnabled?this.stopAutoPlay():this.startAutoPlay()},startAutoPlay:function(){this._autoPlayEnabled=
!0;this.currSlide.isLoaded&&this._play()},stopAutoPlay:function(){this._pausedByVideo=this._pausedByHover=this._autoPlayPaused=this._autoPlayEnabled=!1;this._pause()},_play:function(){var a=this;a._pausedByHover||a._pausedByVideo||(a._autoPlayRunning=!0,a._autoPlayTimeout&&clearTimeout(a._autoPlayTimeout),a._autoPlayTimeout=setTimeout(function(){if(!a._loop&&!a.st.loopRewind){var b=!0;a.st.loopRewind=!0}a.next(!0);b&&(a.st.loopRewind=!1)},a.currSlide.customDelay?a.currSlide.customDelay:a.st.autoPlay.delay))},
_pause:function(){this._pausedByHover||this._pausedByVideo||(this._autoPlayRunning=!1,this._autoPlayTimeout&&(clearTimeout(this._autoPlayTimeout),this._autoPlayTimeout=null))}});b.rsModules.autoplay=b.rsProto._initAutoplay})(jQuery);// jquery.rs.video v1.1.3
(function(f){f.extend(f.rsProto,{_initVideo:function(){var a=this;a._videoDefaults={autoHideArrows:!0,autoHideControlNav:!1,autoHideBlocks:!1,autoHideCaption:!1,disableCSS3inFF:!0,youTubeCode:'<iframe src="https://www.youtube.com/embed/%id%?rel=1&showinfo=0&autoplay=1&wmode=transparent" frameborder="no"></iframe>',vimeoCode:'<iframe src="https://player.vimeo.com/video/%id%?byline=0&portrait=0&autoplay=1" frameborder="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'};a.st.video=
f.extend({},a._videoDefaults,a.st.video);a.ev.on("rsBeforeSizeSet",function(){a._isVideoPlaying&&setTimeout(function(){var b=a._currHolder;b=b.hasClass("rsVideoContainer")?b:b.find(".rsVideoContainer");a._videoFrameHolder&&a._videoFrameHolder.css({width:b.width(),height:b.height()})},32)});var d=a._browser.mozilla;a.ev.on("rsAfterParseNode",function(b,c,e){b=f(c);if(e.videoURL){a.st.video.disableCSS3inFF&&d&&(a._useCSS3Transitions=a._use3dTransform=!1);c=f('<div class="rsVideoContainer"></div>');
var g=f('<div class="rsBtnCenterer"><div class="rsPlayBtn"><div class="rsPlayBtnIcon"></div></div></div>');b.hasClass("rsImg")?e.content=c.append(b).append(g):e.content.find(".rsImg").wrap(c).after(g)}});a.ev.on("rsAfterSlideChange",function(){a.stopVideo()})},toggleVideo:function(){return this._isVideoPlaying?this.stopVideo():this.playVideo()},playVideo:function(){var a=this;if(!a._isVideoPlaying){var d=a.currSlide;if(!d.videoURL)return!1;a._playingVideoSlide=d;var b=a._currVideoContent=d.content;
d=d.videoURL;var c;if(d.match(/youtu\.be/i)||d.match(/youtube\.com/i)){var e=/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&\?]*).*/;(e=d.match(e))&&11==e[2].length&&(c=e[2]);void 0!==c&&(a._videoFrameHolder=a.st.video.youTubeCode.replace("%id%",c))}else d.match(/vimeo\.com/i)&&(e=/(www\.)?vimeo.com\/(\d+)($|\/)/,(e=d.match(e))&&(c=e[2]),void 0!==c&&(a._videoFrameHolder=a.st.video.vimeoCode.replace("%id%",c)));a.videoObj=f(a._videoFrameHolder);a.ev.trigger("rsOnCreateVideoElement",[d]);a.videoObj.length&&
(a._videoFrameHolder=f('<div class="rsVideoFrameHolder"><div class="rsPreloader"></div><div class="rsCloseVideoBtn"><div class="rsCloseVideoIcn"></div></div></div>'),a._videoFrameHolder.find(".rsPreloader").after(a.videoObj),b=b.hasClass("rsVideoContainer")?b:b.find(".rsVideoContainer"),a._videoFrameHolder.css({width:b.width(),height:b.height()}).find(".rsCloseVideoBtn").off("click.rsv").on("click.rsv",function(b){a.stopVideo();b.preventDefault();b.stopPropagation();return!1}),b.append(a._videoFrameHolder),
a.isIPAD&&b.addClass("rsIOSVideo"),a._toggleHiddenClass(!1),setTimeout(function(){a._videoFrameHolder.addClass("rsVideoActive")},10),a.ev.trigger("rsVideoPlay"),a._isVideoPlaying=!0);return!0}return!1},stopVideo:function(){var a=this;return a._isVideoPlaying?(a.isIPAD&&a.slider.find(".rsCloseVideoBtn").remove(),a._toggleHiddenClass(!0),setTimeout(function(){a.ev.trigger("rsOnDestroyVideoElement",[a.videoObj]);var d=a._videoFrameHolder.find("iframe");if(d.length)try{d.attr("src","")}catch(b){}a._videoFrameHolder.remove();
a._videoFrameHolder=null},16),a.ev.trigger("rsVideoStop"),a._isVideoPlaying=!1,!0):!1},_toggleHiddenClass:function(a,d){var b=[],c=this.st.video;c.autoHideArrows&&(this._arrowLeft&&(b.push(this._arrowLeft,this._arrowRight),this._arrowsAutoHideLocked=!a),this._fsBtn&&b.push(this._fsBtn));c.autoHideControlNav&&this._controlNav&&b.push(this._controlNav);c.autoHideBlocks&&this._playingVideoSlide.animBlocks&&b.push(this._playingVideoSlide.animBlocks);c.autoHideCaption&&this.globalCaption&&b.push(this.globalCaption);
this.slider[a?"removeClass":"addClass"]("rsVideoPlaying");if(b.length)for(c=0;c<b.length;c++)a?b[c].removeClass("rsHidden"):b[c].addClass("rsHidden")}});f.rsModules.video=f.rsProto._initVideo})(jQuery);// jquery.rs.animated-blocks v1.0.7
(function(k){k.extend(k.rsProto,{_initAnimatedBlocks:function(){function m(){var f=a.currSlide;if(a.currSlide&&a.currSlide.isLoaded&&a._slideWithBlocks!==f){if(0<a._animatedBlockTimeouts.length){for(b=0;b<a._animatedBlockTimeouts.length;b++)clearTimeout(a._animatedBlockTimeouts[b]);a._animatedBlockTimeouts=[]}if(0<a._blockAnimProps.length){var g;for(b=0;b<a._blockAnimProps.length;b++)if(g=a._blockAnimProps[b])a._useCSS3Transitions?(g.block.css(a._vendorPref+a._TD,"0s"),g.block.css(g.css)):g.block.stop(!0).css(g.css),
a._slideWithBlocks=null,f.animBlocksDisplayed=!1;a._blockAnimProps=[]}f.animBlocks&&(f.animBlocksDisplayed=!0,a._slideWithBlocks=f,a._animateBlocks(f.animBlocks))}}var a=this,b;a._blockDefaults={fadeEffect:!0,moveEffect:"top",moveOffset:20,speed:400,easing:"easeOutSine",delay:200};a.st.block=k.extend({},a._blockDefaults,a.st.block);a._blockAnimProps=[];a._animatedBlockTimeouts=[];a.ev.on("rsAfterInit",function(){m()});a.ev.on("rsBeforeParseNode",function(a,b,d){b=k(b);d.animBlocks=b.find(".rsABlock").css("display",
"none");d.animBlocks.length||(b.hasClass("rsABlock")?d.animBlocks=b.css("display","none"):d.animBlocks=!1)});a.ev.on("rsAfterContentSet",function(b,g){g.id===a.slides[a.currSlideId].id&&setTimeout(function(){m()},a.st.fadeinLoadedSlide?300:0)});a.ev.on("rsAfterSlideChange",function(){m()})},_updateAnimBlockProps:function(k,a){setTimeout(function(){k.css(a)},6)},_animateBlocks:function(m){var a=this,b,f,g,d,h,e,n;a._animatedBlockTimeouts=[];m.each(function(m){b=k(this);f={};g={};d=null;var c=b.attr("data-move-offset");
c=c?parseInt(c,10):a.st.block.moveOffset;if(0<c&&((e=b.data("move-effect"))?(e=e.toLowerCase(),"none"===e?e=!1:"left"!==e&&"top"!==e&&"bottom"!==e&&"right"!==e&&(e=a.st.block.moveEffect,"none"===e&&(e=!1))):e=a.st.block.moveEffect,e&&"none"!==e)){var p="right"===e||"left"===e?!0:!1;n=!1;if(a._useCSS3Transitions){var l=0;h=a._xProp}else p?isNaN(parseInt(b.css("right"),10))?h="left":(h="right",n=!0):isNaN(parseInt(b.css("bottom"),10))?h="top":(h="bottom",n=!0),h="margin-"+h,n&&(c=-c),a._useCSS3Transitions?
l=parseInt(b.css(h),10):(l=b.data("rs-start-move-prop"),void 0===l&&(l=parseInt(b.css(h),10),isNaN(l)&&(l=0),b.data("rs-start-move-prop",l)));g[h]=a._getCSS3Prop("top"===e||"left"===e?l-c:l+c,p);f[h]=a._getCSS3Prop(l,p)}c=b.attr("data-fade-effect");if(!c)c=a.st.block.fadeEffect;else if("none"===c.toLowerCase()||"false"===c.toLowerCase())c=!1;c&&(g.opacity=0,f.opacity=1);if(c||e)d={},d.hasFade=!!c,e&&(d.moveProp=h,d.hasMove=!0),d.speed=b.data("speed"),isNaN(d.speed)&&(d.speed=a.st.block.speed),d.easing=
b.data("easing"),d.easing||(d.easing=a.st.block.easing),d.css3Easing=k.rsCSS3Easing[d.easing],d.delay=b.data("delay"),isNaN(d.delay)&&(d.delay=a.st.block.delay*m);c={};a._useCSS3Transitions&&(c[a._vendorPref+a._TD]="0ms");c.moveProp=f.moveProp;c.opacity=f.opacity;c.display="none";a._blockAnimProps.push({block:b,css:c});a._updateAnimBlockProps(b,g);a._animatedBlockTimeouts.push(setTimeout(function(b,d,c,e){return function(){b.css("display","block");if(c){var f={};if(a._useCSS3Transitions){var g="";
c.hasMove&&(g+=c.moveProp);c.hasFade&&(c.hasMove&&(g+=", "),g+="opacity");f[a._vendorPref+a._TP]=g;f[a._vendorPref+a._TD]=c.speed+"ms";f[a._vendorPref+a._TTF]=c.css3Easing;b.css(f);setTimeout(function(){b.css(d)},24)}else setTimeout(function(){b.animate(d,c.speed,c.easing)},16)}delete a._animatedBlockTimeouts[e]}}(b,f,d,m),6>=d.delay?12:d.delay))})}});k.rsModules.animatedBlocks=k.rsProto._initAnimatedBlocks})(jQuery);// jquery.rs.auto-height v1.0.3
(function(b){b.extend(b.rsProto,{_initAutoHeight:function(){var a=this;if(a.st.autoHeight){var b,c,e,f=!0,d=function(d){e=a.slides[a.currSlideId];(b=e.holder)&&(c=b.height())&&void 0!==c&&c>(a.st.minAutoHeight||30)&&(a._wrapHeight=c,a._useCSS3Transitions||!d?a._sliderOverflow.css("height",c):a._sliderOverflow.stop(!0,!0).animate({height:c},a.st.transitionSpeed),a.ev.trigger("rsAutoHeightChange",c),f&&(a._useCSS3Transitions&&setTimeout(function(){a._sliderOverflow.css(a._vendorPref+"transition","height "+
a.st.transitionSpeed+"ms ease-in-out")},16),f=!1))};a.ev.on("rsMaybeSizeReady.rsAutoHeight",function(a,b){e===b&&d()});a.ev.on("rsAfterContentSet.rsAutoHeight",function(a,b){e===b&&d()});a.slider.addClass("rsAutoHeight");a.ev.one("rsAfterInit",function(){setTimeout(function(){d(!1);setTimeout(function(){a.slider.append('<div style="clear:both; float: none;"></div>')},16)},16)});a.ev.on("rsBeforeAnimStart",function(){d(!0)});a.ev.on("rsBeforeSizeSet",function(){setTimeout(function(){d(!1)},16)})}}});
b.rsModules.autoHeight=b.rsProto._initAutoHeight})(jQuery);// jquery.rs.global-caption v1.0.1
(function(b){b.extend(b.rsProto,{_initGlobalCaption:function(){var a=this;a.st.globalCaption&&(a.ev.on("rsAfterInit",function(){a.globalCaption=b('<div class="rsGCaption"></div>').appendTo(a.st.globalCaptionInside?a._sliderOverflow:a.slider);a.globalCaption.html(a.currSlide.caption||"")}),a.ev.on("rsBeforeAnimStart",function(){a.globalCaption.html(a.currSlide.caption||"")}))}});b.rsModules.globalCaption=b.rsProto._initGlobalCaption})(jQuery);// jquery.rs.active-class v1.0.1
(function(c){c.rsProto._initActiveClass=function(){var b,a=this;if(a.st.addActiveClass)a.ev.on("rsOnUpdateNav",function(){b&&clearTimeout(b);b=setTimeout(function(){a._oldHolder&&a._oldHolder.removeClass("rsActiveSlide");a._currHolder&&a._currHolder.addClass("rsActiveSlide");b=null},50)})};c.rsModules.activeClass=c.rsProto._initActiveClass})(jQuery);
// jquery.rs.deeplinking v1.0.6 + jQuery hashchange plugin v1.3 Copyright (c) 2010 Ben Alman
(function(b){b.extend(b.rsProto,{_initDeeplinking:function(){var a=this,h,d,f;a._hashDefaults={enabled:!1,change:!1,prefix:""};a.st.deeplinking=b.extend({},a._hashDefaults,a.st.deeplinking);if(a.st.deeplinking.enabled){var e=a.st.deeplinking.change,c=a.st.deeplinking.prefix,k="#"+c,g=function(){var a=window.location.hash;return a&&0<a.indexOf(c)&&(a=parseInt(a.substring(k.length),10),0<=a)?a-1:-1},l=g();-1!==l&&(a.st.startSlideId=l);e&&(b(window).on("hashchange"+a.ns,function(b){h||(b=g(),0>b||(b>
a.numSlides-1&&(b=a.numSlides-1),a.goTo(b)))}),a.ev.on("rsBeforeAnimStart",function(){d&&clearTimeout(d);f&&clearTimeout(f)}),a.ev.on("rsAfterSlideChange",function(){d&&clearTimeout(d);f&&clearTimeout(f);f=setTimeout(function(){h=!0;window.location.replace((""+window.location).split("#")[0]+k+(a.currSlideId+1));d=setTimeout(function(){h=!1;d=null},60)},400)}));a.ev.on("rsBeforeDestroy",function(){d=f=null;e&&b(window).off("hashchange"+a.ns)})}}});b.rsModules.deeplinking=b.rsProto._initDeeplinking})(jQuery);
(function(b,a,h){function d(a){a=a||location.href;return"#"+a.replace(/^[^#]*#?(.*)$/,"$1")}"$:nomunge";var f=document,e=b.event.special,c=f.documentMode,k="onhashchange"in a&&(c===h||7<c);b.fn.hashchange=function(a){return a?this.bind("hashchange",a):this.trigger("hashchange")};b.fn.hashchange.delay=50;e.hashchange=b.extend(e.hashchange,{setup:function(){if(k)return!1;b(g.start)},teardown:function(){if(k)return!1;b(g.stop)}});var g=function(){function l(){var f=d(),e=p(g);f!==g?(m(g=f,e),b(a).trigger("hashchange")):
e!==g&&(location.href=location.href.replace(/#.*/,"")+e);c=setTimeout(l,b.fn.hashchange.delay)}var e={},c,g=d(),n=function(a){return a},m=n,p=n;e.start=function(){c||l()};e.stop=function(){c&&clearTimeout(c);c=h};a.attachEvent&&!a.addEventListener&&!k&&function(){var a,c;e.start=function(){a||(c=(c=b.fn.hashchange.src)&&c+d(),a=b('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){c||m(d());l()}).attr("src",c||"javascript:0").insertAfter("body")[0].contentWindow,f.onpropertychange=
function(){try{"title"===event.propertyName&&(a.document.title=f.title)}catch(q){}})};e.stop=n;p=function(){return d(a.location.href)};m=function(c,e){var d=a.document,g=b.fn.hashchange.domain;c!==e&&(d.title=f.title,d.open(),g&&d.write('<script>document.domain="'+g+'"\x3c/script>'),d.close(),a.location.hash=c)}}();return e}()})(jQuery,this);// jquery.rs.visible-nearby v1.0.2
(function(d){d.rsProto._initVisibleNearby=function(){var a=this;a.st.visibleNearby&&a.st.visibleNearby.enabled&&(a._vnDefaults={enabled:!0,centerArea:.6,center:!0,breakpoint:0,breakpointCenterArea:.8,hiddenOverflow:!0,navigateByCenterClick:!1},a.st.visibleNearby=d.extend({},a._vnDefaults,a.st.visibleNearby),a.ev.one("rsAfterPropsSetup",function(){a._sliderVisibleNearbyWrap=a._sliderOverflow.css("overflow","visible").wrap('<div class="rsVisibleNearbyWrap"></div>').parent();a.st.visibleNearby.hiddenOverflow||
a._sliderVisibleNearbyWrap.css("overflow","visible");a._controlsContainer=a.st.controlsInside?a._sliderVisibleNearbyWrap:a.slider}),a.ev.on("rsAfterSizePropSet",function(){var c=a.st.visibleNearby;var b=c.breakpoint&&a.width<c.breakpoint?c.breakpointCenterArea:c.centerArea;a._slidesHorizontal?(a._wrapWidth*=b,a._sliderVisibleNearbyWrap.css({height:a._wrapHeight,width:a._wrapWidth/b}),a._minPosOffset=a._wrapWidth*(1-b)/2/b):(a._wrapHeight*=b,a._sliderVisibleNearbyWrap.css({height:a._wrapHeight/b,width:a._wrapWidth}),
a._minPosOffset=a._wrapHeight*(1-b)/2/b);c.navigateByCenterClick||(a._nextSlidePos=a._slidesHorizontal?a._wrapWidth:a._wrapHeight);c.center&&a._sliderOverflow.css("margin-"+(a._slidesHorizontal?"left":"top"),a._minPosOffset)}))};d.rsModules.visibleNearby=d.rsProto._initVisibleNearby})(jQuery);