0byt3m1n1
Path:
/
home1
/
aserty
/
public_html
/
beatlesmontreal.com
/
wp-contentebbd3f
/
wptouch-data
/
cache
/
[
Home
]
File: wptouch-f2dab6903ff2ab72e86deea2e2a43434d06d1a2e.js
//fgnass.github.com/spin.js#v1.2.7 !function(e,t,n){function o(e,n){var r=t.createElement(e||"div"),i;for(i in n)r[i]=n[i];return r}function u(e){for(var t=1,n=arguments.length;t<n;t++)e.appendChild(arguments[t]);return e}function f(e,t,n,r){var o=["opacity",t,~~(e*100),n,r].join("-"),u=.01+n/r*100,f=Math.max(1-(1-e)/t*(100-u),e),l=s.substring(0,s.indexOf("Animation")).toLowerCase(),c=l&&"-"+l+"-"||"";return i[o]||(a.insertRule("@"+c+"keyframes "+o+"{"+"0%{opacity:"+f+"}"+u+"%{opacity:"+e+"}"+(u+.01)+"%{opacity:1}"+(u+t)%100+"%{opacity:"+e+"}"+"100%{opacity:"+f+"}"+"}",a.cssRules.length),i[o]=1),o}function l(e,t){var i=e.style,s,o;if(i[t]!==n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(o=0;o<r.length;o++){s=r[o]+t;if(i[s]!==n)return s}}function c(e,t){for(var n in t)e.style[l(e,n)||n]=t[n];return e}function h(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)e[i]===n&&(e[i]=r[i])}return e}function p(e){var t={x:e.offsetLeft,y:e.offsetTop};while(e=e.offsetParent)t.x+=e.offsetLeft,t.y+=e.offsetTop;return t}var r=["webkit","Moz","ms","O"],i={},s,a=function(){var e=o("style",{type:"text/css"});return u(t.getElementsByTagName("head")[0],e),e.sheet||e.styleSheet}(),d={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto",position:"relative"},v=function m(e){if(!this.spin)return new m(e);this.opts=h(e||{},m.defaults,d)};v.defaults={},h(v.prototype,{spin:function(e){this.stop();var t=this,n=t.opts,r=t.el=c(o(0,{className:n.className}),{position:n.position,width:0,zIndex:n.zIndex}),i=n.radius+n.length+n.width,u,a;e&&(e.insertBefore(r,e.firstChild||null),a=p(e),u=p(r),c(r,{left:(n.left=="auto"?a.x-u.x+(e.offsetWidth>>1):parseInt(n.left,10)+i)+"px",top:(n.top=="auto"?a.y-u.y+(e.offsetHeight>>1):parseInt(n.top,10)+i)+"px"})),r.setAttribute("aria-role","progressbar"),t.lines(r,t.opts);if(!s){var f=0,l=n.fps,h=l/n.speed,d=(1-n.opacity)/(h*n.trail/100),v=h/n.lines;(function m(){f++;for(var e=n.lines;e;e--){var i=Math.max(1-(f+e*v)%h*d,n.opacity);t.opacity(r,n.lines-e,i,n)}t.timeout=t.el&&setTimeout(m,~~(1e3/l))})()}return t},stop:function(){var e=this.el;return e&&(clearTimeout(this.timeout),e.parentNode&&e.parentNode.removeChild(e),this.el=n),this},lines:function(e,t){function i(e,r){return c(o(),{position:"absolute",width:t.length+t.width+"px",height:t.width+"px",background:e,boxShadow:r,transformOrigin:"left",transform:"rotate("+~~(360/t.lines*n+t.rotate)+"deg) translate("+t.radius+"px"+",0)",borderRadius:(t.corners*t.width>>1)+"px"})}var n=0,r;for(;n<t.lines;n++)r=c(o(),{position:"absolute",top:1+~(t.width/2)+"px",transform:t.hwaccel?"translate3d(0,0,0)":"",opacity:t.opacity,animation:s&&f(t.opacity,t.trail,n,t.lines)+" "+1/t.speed+"s linear infinite"}),t.shadow&&u(r,c(i("#000","0 0 4px #000"),{top:"2px"})),u(e,u(r,i(t.color,"0 0 1px rgba(0,0,0,.1)")));return e},opacity:function(e,t,n){t<e.childNodes.length&&(e.childNodes[t].style.opacity=n)}}),function(){function e(e,t){return o("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',t)}var t=c(o("group"),{behavior:"url(#default#VML)"});!l(t,"transform")&&t.adj?(a.addRule(".spin-vml","behavior:url(#default#VML)"),v.prototype.lines=function(t,n){function s(){return c(e("group",{coordsize:i+" "+i,coordorigin:-r+" "+ -r}),{width:i,height:i})}function l(t,i,o){u(a,u(c(s(),{rotation:360/n.lines*t+"deg",left:~~i}),u(c(e("roundrect",{arcsize:n.corners}),{width:r,height:n.width,left:n.radius,top:-n.width>>1,filter:o}),e("fill",{color:n.color,opacity:n.opacity}),e("stroke",{opacity:0}))))}var r=n.length+n.width,i=2*r,o=-(n.width+n.length)*2+"px",a=c(s(),{position:"absolute",top:o,left:o}),f;if(n.shadow)for(f=1;f<=n.lines;f++)l(f,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(f=1;f<=n.lines;f++)l(f);return u(t,a)},v.prototype.opacity=function(e,t,n,r){var i=e.firstChild;r=r.shadow&&r.lines||0,i&&t+r<i.childNodes.length&&(i=i.childNodes[t+r],i=i&&i.firstChild,i=i&&i.firstChild,i&&(i.opacity=n))}):s=l(t,"animation")}(),typeof define=="function"&&define.amd?define(function(){return v}):e.Spinner=v}(window,document); /* You can now create a spinner using any of the variants below: $("#el").spin(); // Produces default Spinner using the text color of #el. $("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el. $("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color). $("#el").spin({ ... }); // Produces a Spinner using your custom settings. $("#el").spin(false); // Kills the spinner. */ (function($) { $.fn.spin = function(opts, color) { var presets = { "tiny": { lines: 8, length: 2, width: 2, radius: 3 }, "small": { lines: 8, length: 4, width: 3, radius: 5 }, "large": { lines: 10, length: 8, width: 4, radius: 8 } }; if (Spinner) { return this.each(function() { var $this = $(this), data = $this.data(); if (data.spinner) { data.spinner.stop(); delete data.spinner; } if (opts !== false) { if (typeof opts === "string") { if (opts in presets) { opts = presets[opts]; } else { opts = {}; } if (color) { opts.color = color; } } data.spinner = new Spinner($.extend({color: $this.css('color')}, opts)).spin(this); } }); } else { throw "Spinner class not available."; } }; })(jQuery); function wptouchFdnSetupMenu( menuContainer ) { menuContainer = jQuery( menuContainer ); menuContainer.find( 'li.menu-item ul' ).each( function() { if ( !jQuery( this ).children().length > 0 ) { jQuery( this ).remove(); } }); menuContainer.find( 'li.menu-item' ).has( 'ul' ).addClass( 'has_children' ).prepend( '<span></span>' ); jQuery( 'ul li.has_children span', menuContainer ).on( 'click', function( e ) { jQuery( this ).toggleClass( 'toggle' ).parent().toggleClass( 'open-tree' ); jQuery( this ).parent().find( 'ul' ).first().webkitSlideToggle(); e.preventDefault(); e.stopPropagation(); }); //If parent links are turned off var noParentLinks = jQuery( 'ul.no-parent-links' ); if ( jQuery( noParentLinks ).length ) { menuContainer.each( function(){ jQuery( noParentLinks, this ).off().on( 'click', 'li.has_children > a', function( e ){ jQuery( this ).parent().find( 'span' ).trigger( 'click' ); e.preventDefault(); e.stopPropagation(); }); }); } } // Setup show/hide menus function wptouchFdnSetupAllMenus() { jQuery( '.show-hide-menu, .slide-menu' ).each( function() { var menuId = jQuery( this ).prop( 'id' ); if ( menuId ) { wptouchFdnSetupMenu( '#' + menuId ); } }); } function wptouchDoFdnMenuReady() { wptouchFdnSetupAllMenus(); } jQuery( document ).ready( function() { wptouchDoFdnMenuReady(); } ); /* WPtouch Pro Foundation Base JS */ /* Description: This file holds all the default jQuery & Ajax functions for the Foundation parent theme on mobile & tablets, used by all child themes */ // Try to get out of frames! function wptouchFdnEscFrames() { if ( window.top != window.self && window.top.location.pathname.indexOf( 'customize.php' ) == '-1' ) { window.top.location = self.location.href; } } function wptouchFdnIfFixed() { if ( wptouchFdnHasFixedPos() ) { jQuery( 'body' ).addClass( 'has-fixed' ); } } function wptouchFdnBindBackButtons( buttonElement ) { if ( typeof( buttonElement ) === 'undefined' ) buttonElement = '.back-button'; jQuery( buttonElement ).on( 'click', function( e ) { history.back(); e.preventDefault(); }); } function wptouchFdnBindFwdButtons( buttonElement ) { if ( typeof( buttonElement ) === 'undefined' ) buttonElement = '.fwd-button'; jQuery( buttonElement ).on( 'click', function( e ) { history.forward(); e.preventDefault(); }); } // Try to make smaller elements nicer in posts function wptouchFdnCenterImages( elements, imgWidth ) { jQuery( elements ).each( function() { if ( !jQuery( this ).hasClass( 'aligncenter' ) && jQuery( this ).width() > imgWidth ) { jQuery( this ).not('.post-thumbnail').addClass( 'aligncenter' ); } }); } function wptouchFdnSetupSlideToggles() { jQuery( '.slide-toggle' ).each( function() { var targetId = jQuery( this ).attr( 'data-effect-target' ); wptouchFdnSlideToggle( this, '#' + targetId, 500 ); }); } /* Detect screen sizes and other device details and add or remove corresponding 'smartphone' or 'tablet' classes Using document.body.clientWidth because it's faster (and it's what jQuery uses under the hood, anyways) */ function wptouchFdnUpdateDevice() { var bodyEl = jQuery( 'body' ); // Update the body class if the device width is equal to or bigger than 768px if ( document.body.clientWidth < 768 && !bodyEl.hasClass( 'smartphone' ) ) { bodyEl.addClass( 'smartphone' ).removeClass( 'tablet' ); // Create a cookie for the device class so we can reference it via PHP afterwards if needed wptouchCreateCookie( 'wptouch-device-type', 'smartphone', 365 ); } else if ( document.body.clientWidth >= 768 && !bodyEl.hasClass( 'tablet' ) ) { bodyEl.addClass( 'tablet' ).removeClass( 'smartphone' ); // Create a cookie for the device class so we can reference it via PHP afterwards if needed wptouchCreateCookie( 'wptouch-device-type', 'tablet', 365 ); } } function wptouchFdnUpdateOrientation() { var bodyEl = jQuery( 'body' ); // Update scroll position slightly to fix fixed elements // var scrollPosition = bodyEl.scrollTop() + 1; // window.scrollTo( 0, scrollPosition, 100 ); // If it's a smartphone & the clientWidth is less than 480, assume it's portrait, else landscape (works for iPhone 5, as well ) if ( bodyEl.hasClass( 'smartphone' ) ) { if ( document.body.clientWidth < 480 ) { bodyEl.addClass( 'portrait' ).removeClass( 'landscape' ); wptouchCreateCookie( 'wptouch-device-orientation', 'portrait', 365 ); } else { bodyEl.addClass( 'landscape' ).removeClass( 'portrait' ); wptouchCreateCookie( 'wptouch-device-orientation', 'landscape', 365 ); } } // If it's a tablet & the clientWidth is less than 1024, assume it's portrait, else landscape if ( bodyEl.hasClass( 'tablet' ) ) { if ( document.body.clientWidth < 1024 ) { bodyEl.addClass( 'portrait' ).removeClass( 'landscape' ); wptouchCreateCookie( 'wptouch-device-orientation', 'portrait', 365 ); } else { bodyEl.addClass( 'landscape' ).removeClass( 'portrait' ); wptouchCreateCookie( 'wptouch-device-orientation', 'landscape', 365 ); } } } function wptouchFdnDoDeviceAndOrientationListener() { jQuery( window ).on( 'resize', function() { wptouchFdnUpdateDevice(); wptouchFdnUpdateOrientation(); }).resize(); } // Back to top links in themes function wptouchFdnSetupBackToTopLinks() { jQuery( 'body' ).on( 'click', '.back-to-top', function( e ){ jQuery( 'body, html' ).animate( { scrollTop: jQuery( 'body' ).offset().top }, 550 ); e.preventDefault(); }); } function wptouchFdnSetupShowHideToggles() { jQuery( '.show-hide-toggle' ).each( function() { var targetId = jQuery( this ).attr( 'data-effect-target' ); var closeId = jQuery( this ).attr( 'data-effect-close' ); var linkId = jQuery( this ).prop( 'id' ); jQuery( this ).on( 'click', function( e ) { if ( typeof( closeId ) !== 'undefined' ) { var originalId = jQuery( '#' + closeId ).attr( 'data-source-click' ); if ( typeof( originalId ) !== 'undefined' ) { jQuery( '#' + originalId ).removeClass( 'toggle-open' ); jQuery( '#' + closeId ).data( 'data-source-click', '' ); } jQuery( '#' + closeId ).hide(); } jQuery( this ).toggleClass( 'toggle-open' ); jQuery( '#' + targetId ).attr( 'data-source-click', linkId ).webkitSlideToggle(); e.preventDefault(); e.stopImmediatePropagation(); }); }); } function wptouchFdnSwitchToggle() { jQuery( '#switch' ).on( 'click', '.off', function() { jQuery( '.on' ).removeClass( 'active' ); jQuery( this ).addClass( 'active' ); }); } function wptouchFdnHandleShortcode() { if ( !navigator.standalone ) { jQuery( '.wptouch-shortcode-mobile-only' ).show(); } } function wptouchFdnSetupjQuery() { // jQuery function opacityToggle() jQuery.fn.opacityToggle = function( speed, easing, callback ) { return this.animate( { opacity: 'toggle' }, speed, easing, callback ); } // jQuery function webkitSlideToggle() jQuery.fn.webkitSlideToggle = function() { this.toggle(); } // jQuery function viewportCenter() jQuery.fn.viewportCenter = function() { this.css( 'position', 'absolute' ); this.css( 'top', ( ( jQuery( window ).height() - this.outerHeight() ) / 3 ) + jQuery( window ).scrollTop() + 'px' ); this.css( 'left', ( ( jQuery( window ).width() - this.outerWidth() ) / 2 ) + jQuery( window ).scrollLeft() + 'px' ); return this; } // Set form elements tabindex automagically jQuery( function() { var tabindex = 1; jQuery( 'input, select, textarea' ).each( function() { if ( this.type != "hidden" ) { var inputToTab = jQuery( this ); inputToTab.attr( 'tabindex', tabindex ); tabindex++; } }); }); } function wptouchFdnSetupWPML() { var wpmlLanguageSwitch = jQuery( '#wpml-language-chooser select' ); if ( wpmlLanguageSwitch.length ) { wpmlLanguageSwitch.change( function() { var switchLink = wpmlLanguageSwitch.val(); document.location.href = switchLink; }); } } function wptouchFdnBaseReady() { wptouchFdnEscFrames(); wptouchFdnIfFixed(); wptouchFdnBindBackButtons(); wptouchFdnBindFwdButtons(); wptouchFdnCenterImages( '.post img, .wp-caption', 105 ); wptouchFdnSetupSlideToggles(); wptouchFdnDoDeviceAndOrientationListener(); wptouchFdnSetupBackToTopLinks(); wptouchFdnSetupShowHideToggles(); wptouchFdnSwitchToggle(); wptouchFdnHandleShortcode(); wptouchFdnSetupjQuery(); wptouchFdnSetupWPML(); } jQuery( document ).ready( function() { wptouchFdnBaseReady(); } ); /* WPtouch Pro Public Foundation JavaScript Functions */ /* Description: These functions can be used in themes as needed */ function wptouchFdnIsiOS6() { return ( '-webkit-filter' in document.body.style ); } function wptouchFdnHasFixedPos() { if ('-webkit-overflow-scrolling' in document.body.style ){ return true; } else { return false; } } // Function for fade-toggling hidden elements function wptouchFdnShowHideToggle( linkTrigger, hiddenElement ) { jQuery( linkTrigger ).on( 'click', function( e ) { jQuery( linkTrigger ).toggleClass( 'toggle-open' ); jQuery( hiddenElement ).opacityToggle( 380 ); e.preventDefault(); }); } // Function for slide-toggling hidden elements function wptouchFdnSlideToggle( linkTrigger, hiddenElement, speed ) { jQuery( linkTrigger ).on( 'click', function( e ) { jQuery( linkTrigger ).toggleClass( 'toggle-open' ); jQuery( hiddenElement ).slideToggle( speed ); e.preventDefault(); }); } // Create a cookie function wptouchCreateCookie( name, value, days ) { if ( days ) { var date = new Date(); date.setTime( date.getTime() + ( days*24*60*60*1000 ) ); var expires = '; expires='+date.toGMTString(); } else var expires = ''; document.cookie = name+'='+value+expires+'; path='+wptouchMain.siteurl; } // Read a cookie function wptouchReadCookie( name ) { var nameEQ = name + "="; var ca = document.cookie.split( ';' ); for( var i=0; i < ca.length; i++ ) { var c = ca[i]; while ( c.charAt( 0 )==' ' ) c = c.substring( 1, c.length ); if ( c.indexOf( nameEQ ) == 0 ) return c.substring( nameEQ.length, c.length ); } return null; } // Erase a cookie function wptouchEraseCookie( name ) { wptouchCreateCookie( name, '', -1 ); } // List all cookies (useful in alerts for testing) function wptouchListCookies() { var theCookies = document.cookie.split(';'); var aString = ''; for (var i = 1 ; i <= theCookies.length; i++) { aString += i + ' ' + theCookies[i-1] + "\n"; } return aString; } /* WPtouch Foundation Google Fonts Code */ var googleBodyEls = ( 'form *' ); var googleHeadingEls = ( 'h1, h2, h3, h4, h5, h6' ); function addGoogleFontClasses() { jQuery( googleBodyEls ).addClass( 'body-font' ); jQuery( googleHeadingEls ).addClass( 'heading-font' ); } jQuery( document ).ready( function() { addGoogleFontClasses(); }); jQuery( document ).ajaxComplete( function() { addGoogleFontClasses(); }); function doFoundationLoadMoreReady() { var loadMoreLink = 'a.load-more-link'; jQuery( '#content' ).on( 'click', loadMoreLink, function( e ) { jQuery( loadMoreLink ).addClass( 'ajaxing' ).text( wptouchFdn.ajaxLoading ).prepend( '<span class="spinner"></span>' ); jQuery( '.spinner' ).spin( 'tiny' ); var loadMoreURL = jQuery( loadMoreLink ).attr( 'rel' ); jQuery( loadMoreLink ).after( "<span class='ajax-target'></span>" ); jQuery( '.ajax-target' ).load( loadMoreURL + ' #content > div, #content .load-more-link', function() { jQuery( '.ajax-target' ).replaceWith( jQuery( this ).html() ); jQuery( '.ajaxing' ).animate( { height: 'toggle' }, 200, 'linear', function(){ jQuery( this ).remove(); } ); }); e.preventDefault(); }); // Load More Comments var loadMoreComsLink = '.load-more-comments-wrap a'; jQuery( '.commentlist' ).on( 'click', loadMoreComsLink, function() { jQuery( loadMoreComsLink ).addClass( 'ajaxing' ).text( wptouchFdn.ajaxLoading ).prepend( '<span class="spinner"></span>' ); jQuery( '.spinner' ).spin( 'tiny' ); var loadMoreURL = jQuery( loadMoreComsLink ).prop( 'href' ); jQuery( loadMoreComsLink ).parent().after( "<span class='ajax-target'></span>" ); jQuery( '.ajax-target' ).load( loadMoreURL + ' ol.commentlist > li', function() { jQuery( '.ajax-target' ).replaceWith( jQuery( this ).html() ); jQuery( '.ajaxing' ).animate( { height: 'toggle' }, 200, 'linear', function(){ jQuery( this ).parent().remove(); } ); }); return false; }); // Load More Post Search Results var loadMorePostSearchLink = 'a.load-more-post-link'; jQuery( '#content' ).on( 'click', loadMorePostSearchLink, function( e ) { jQuery( loadMorePostSearchLink ).addClass( 'ajaxing' ).text( wptouchFdn.ajaxLoading ).prepend( '<span class="spinner"></span>' ); jQuery( '.spinner' ).spin( 'tiny' ); var loadMoreURL = jQuery( loadMorePostSearchLink ).attr( 'rel' ); jQuery( loadMorePostSearchLink ).after( "<span class='ajax-target'></span>" ); jQuery( '.ajax-target' ).load( loadMoreURL + ' #content #post-results, #content .load-more-post-link', function() { jQuery( '.ajax-target' ).replaceWith( jQuery( this ).html() ); jQuery( '.ajaxing' ).animate( { height: 'toggle' }, 200, 'linear', function(){ jQuery( this ).remove(); } ); }); e.preventDefault(); }); // Load More Page Search Results var loadMorePageSearchLink = 'a.load-more-page-link'; jQuery( '#content' ).on( 'click', loadMorePageSearchLink, function( e ) { jQuery( loadMorePageSearchLink ).addClass( 'ajaxing' ).text( wptouchFdn.ajaxLoading ).prepend( '<span class="spinner"></span>' ); jQuery( '.spinner' ).spin( 'tiny' ); var loadMoreURL = jQuery( loadMorePageSearchLink ).attr( 'rel' ); jQuery( loadMorePageSearchLink ).after( "<span class='ajax-target'></span>" ); jQuery( '.ajax-target' ).load( loadMoreURL + ' #content #page-results, #content .load-more-page-link', function() { jQuery( '.ajax-target' ).replaceWith( jQuery( this ).html() ); jQuery( '.ajaxing' ).animate( { height: 'toggle' }, 200, 'linear', function(){ jQuery( this ).remove(); } ); }); e.preventDefault(); }); } jQuery( document ).ready( function() { doFoundationLoadMoreReady(); }); /*! PushIt - v1.0 * An elegant transform-based off-canvas solution for providing left & right menus for mobile websites, complete with jQuery fallback. * Based on "Pushy" by Christopher Yee - http://christopheryee.ca/pushy/ * Modified for left and right menu support by BraveNewCode Inc. for WPtouch - http://www.wptouch.com */ // Let's get the current vendor prefix for each browser var prefix = (function() { var styles = window.getComputedStyle( document.documentElement, '' ), vendor = ( Array.prototype.slice.call( styles ).join( '' ).match( /-(moz|webkit|ms)-/ ) || ( styles.OLink === '' && ['', 'o'] ) )[1]; return { css: '-' + vendor + '-' } })(); ( function( $ ){ // Hey! Ow! Push it good! $.fn.pushIt = function( options ) { var settings = $.extend( { leftMenu: jQuery( '.pushit-left' ), rightMenu: jQuery( '.pushit-right' ), body: jQuery( 'body' ), container: jQuery( '.page-wrapper' ), // container element pushItActiveClass: 'pushit-active', // element to toggle site overlay containerClass: 'container-pushit', // container open menuBtn: jQuery('.menu-btn'), // css classe(s) to toggle the menu viewportWidth: jQuery( window ).width(), // Needed to position a right menu menuWidth: 240, // Menu width (default is 240px) menuSpeed: 330, // Speed of the menu transistion, in milliseconds bezierCurve: '.290, .050, .140, .870', // Menu transistion bezier pushed: false, lastAspect: false // Store last aspect ratio }, options ); var hasOverflowScroll = typeof( jQuery( 'body' )[0].style['-webkit-overflow-scrolling'] ) !== 'undefined'; if ( hasOverflowScroll ) { jQuery( 'body' ).addClass( 'has-overflow-scroll' ); } // Add the overlay div settings.body.append( '<div id="pushit-overlay"></div>' ); var pushitOverlay = jQuery( '#pushit-overlay' ); // Setup default positioning and width settings.leftMenu.addClass( 'pushit-left' ) .css( 'left', '-' + settings.menuWidth + 'px' ) .css( 'width', settings.menuWidth + 'px' ); // Setup default positioning and width settings.rightMenu.addClass( 'pushit-right' ) .css( 'width', settings.menuWidth + 'px' ) .css( 'left', settings.viewportWidth + 'px' ); // Make sure it's positioned relative & add the transition CSS for slide prep settings.container .css( 'position', 'relative' ) .css( prefix.css+'transition', prefix.css+'transform .'+settings.menuSpeed+'s cubic-bezier('+settings.bezierCurve+')' ); settings.lastAspect = getAspect(); // Add the transition CSS for slide prep jQuery( '.pushit' ) .css( prefix.css+'transition', prefix.css+'transform .'+settings.menuSpeed+'s cubic-bezier('+settings.bezierCurve+')' ); function getAspect() { if ( jQuery( window ).width() < jQuery( window ).height() ) { return 'portrait'; } else { return 'landscape'; } } function whichPushIt( clicked ){ var parent = clicked; if ( parent.hasClass( 'pushit-left' ) ) { return 'left'; } else { return 'right'; } } function oppositePushIt( direction ) { var direction = ( direction == 'left' ? 'right' : 'left' ); return direction; } function cleanUpPushit(){ setTimeout( function(){ // Cleanup memory usage! settings.container .css( prefix.css+'transform', '' ) .css( 'position', '' ) .css( 'overflow', '' ) .css( 'height', '' ); pushitOverlay.css( 'z-index', '-1' ); }, settings.menuSpeed + 300 ); } // Close menu when clicking container function pushitCloseListener() { pushitOverlay.one( 'click.pushit touchmove.pushit', function( e ){ e.preventDefault(); e.stopImmediatePropagation(); togglePushIt( settings.pushed ); pushitOverlay.off( 'click.pushit touchmove.pushit' ); }).css( 'z-index', '99' ); } function disableTouchMove(){ settings.container.on( 'touchmove', function( e ){ // e.preventDefault(); }); } function enableTouchMove(){ // settings.container.off( 'touchmove' ); } function repositionPushIt(){ var currentWindow = jQuery( window ); currentWindow.resize( function(){ // Move the right menu if it exists to a new position outside the viewport right if ( settings.rightMenu.length ) { settings.viewportWidth = currentWindow.width(); settings.rightMenu.css( 'left', settings.viewportWidth + 'px' ); } // Hide the menu if the aspect changes if ( settings.lastAspect != getAspect() ) { settings.lastAspect = getAspect(); // Close the menu on a rotate— no need to have the browser choke on render if ( jQuery( '.pushit-active' ).length ) { pushitOverlay.trigger( 'click' ); cleanUpPushit(); } } }); } function togglePushIt( clicked ){ settings.pushed = clicked; direction = whichPushIt( clicked ); var side = ('.pushit-' + direction ); var activeSide = jQuery( side ); jQuery( side ).toggleClass( 'pushit-open' ); // Left Menus // Open if ( side == '.pushit-left' && activeSide.hasClass( 'pushit-open' ) ) { disableTouchMove(); pushitCloseListener(); settings.container .height( window.innerHeight ) .css( 'position', 'fixed' ) .css( 'overflow', 'hidden' ); if ( prefix.css != '' ){ activeSide.css( prefix.css+'transform', 'translate3d(' + settings.menuWidth + 'px, 0, 0)' ); settings.container.css( prefix.css+'transform', 'translate3d(' + settings.menuWidth + 'px, 0, 0)' ); } else { activeSide.animate( { left: '0' }, settings.menuSpeed ); settings.container.animate( { left: settings.menuWidth }, settings.menuSpeed ); } // Closed } else if ( side == '.pushit-left' && !activeSide.hasClass( 'pushit-open' ) ) { enableTouchMove(); if ( prefix.css != '' ){ activeSide.css( prefix.css+'transform', 'translate3d(0, 0, 0)' ); settings.container.css( prefix.css+'transform', 'translate3d(0, 0, 0)' ); } else { activeSide.animate( { left: '-' + settings.menuWidth }, settings.menuSpeed ); settings.container.animate( { left: '0' }, settings.menuSpeed ); } cleanUpPushit(); } // Right Menus // Open if ( side == '.pushit-right' && jQuery( side ).hasClass( 'pushit-open' ) ) { disableTouchMove(); pushitCloseListener(); settings.container .height( window.innerHeight ) .css( 'position', 'fixed' ) .css( 'overflow', 'hidden' ); if ( prefix.css != '' ){ activeSide.css( prefix.css+'transform', 'translate3d(-' + settings.menuWidth + 'px, 0, 0)' ); settings.container.css( prefix.css+'transform', 'translate3d(-' + settings.menuWidth + 'px, 0, 0)' ); } else { activeSide.animate( { left: settings.viewportWidth - settings.menuWidth }, settings.menuSpeed ); settings.container.animate( { left: '-' + settings.menuWidth }, settings.menuSpeed ); } // Closed } else if ( side == '.pushit-right' && !jQuery( side ).hasClass( 'pushit-open' ) ) { enableTouchMove(); if ( prefix.css != '' ){ activeSide.css( prefix.css+'transform', 'translate3d(0, 0, 0)' ); settings.container.css( prefix.css+'transform', 'translate3d(0, 0, 0)' ); } else { activeSide.animate( { left: settings.viewportWidth }, settings.menuSpeed ); settings.container.animate( { left: '0' }, settings.menuSpeed ); } cleanUpPushit(); } settings.container.toggleClass( whichPushIt( clicked ) ); settings.body.toggleClass( settings.pushItActiveClass ); //toggle site overlay settings.container.toggleClass( settings.containerClass ); } repositionPushIt(); // Toggle menu settings.menuBtn.on( 'click.pushit-button', function( e ) { e.preventDefault(); e.stopImmediatePropagation(); menuTarget = '#' + jQuery( this ).attr( 'data-menu-target' ); togglePushIt( jQuery( menuTarget ).parent() ); }); } })( jQuery ); // WPtouch Basic Client-side Ajax Routines function WPtouchAjax( actionName, actionParams, callback ) { var ajaxData = { action: "wptouch_client_ajax", wptouch_action: actionName, wptouch_nonce: wptouchMain.security_nonce }; for ( name in actionParams ) { ajaxData[name] = actionParams[name]; } jQuery.post( wptouchMain.ajaxurl, ajaxData, function( result ) { callback( result ); }); } jQuery( 'table' ).parent( 'p,div' ).addClass( 'table-parent' ); jQuery( '#footer .back-to-top' ).click( function( e ) { e.preventDefault(); jQuery( window ).scrollTop( 0 ); }); function doWPtouchReady() { // Parse query vars json wptouchMain.query_vars = jQuery.parseJSON( wptouchMain.query_vars ); // Shortcode var shortcodeDiv = jQuery( '.wptouch-sc-content' ); if ( shortcodeDiv.length ) { // We have a shortcode var params = { post_id: shortcodeDiv.attr( 'data-post-id' ), post_content: jQuery( '.wptouch-orig-content' ).html(), post_nonce: wptouchMain.security_nonce }; jQuery.post( wptouchMain.current_shortcode_url + '¤t_time=' + jQuery.now(), params, function( result ) { shortcodeDiv.html( result ); jQuery( document ).trigger( 'wptouch_ajax_content_loaded' ); } ); } } jQuery( document ).ready( function() { doWPtouchReady(); }); // Add the preview code to load more URLs to ensure they load the WPtouch version of blog posts function wptouchCustomizerThemeReady(){ var loadMoreLnk = jQuery( 'a.load-more-link, a.infinite-link' ); var currentRel = loadMoreLnk.attr( 'rel' ); if ( loadMoreLnk.length ) { if( currentRel.indexOf( '?' ) > -1 ) { var toAppend = '&wptouch_preview_theme=enabled'; } else { var toAppend = '?wptouch_preview_theme=enabled'; } var newRel = currentRel + toAppend; jQuery( 'a.load-more-link, a.infinite-link' ).attr( 'rel', newRel ); } } jQuery( document ).ready( function() { wptouchCustomizerThemeReady(); }); /* * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010 * http://benalman.com/projects/jquery-bbq-plugin/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ (function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this); /* * jQuery hashchange event - v1.2 - 2/11/2010 * http://benalman.com/projects/jquery-hashchange-plugin/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ (function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=$.support.boxModel&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this); /*! * Isotope PACKAGED v2.2.0 * * Licensed GPLv3 for open source use * or Isotope Commercial License for commercial use * * http://isotope.metafizzy.co * Copyright 2015 Metafizzy */ (function(t){function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}function n(e,i){t.fn[e]=function(n){if("string"==typeof n){for(var s=o.call(arguments,1),a=0,u=this.length;u>a;a++){var p=this[a],h=t.data(p,e);if(h)if(t.isFunction(h[n])&&"_"!==n.charAt(0)){var f=h[n].apply(h,s);if(void 0!==f)return f}else r("no such method '"+n+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+n+"'")}return this}return this.each(function(){var o=t.data(this,e);o?(o.option(n),o._init()):(o=new i(this,n),t.data(this,e,o))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};return t.bridget=function(t,e){i(e),n(t,e)},t.bridget}}var o=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],i):"object"==typeof exports?i(require("jquery")):i(t.jQuery)})(window),function(t){function e(e){var i=t.event;return i.target=i.target||i.srcElement||e,i}var i=document.documentElement,o=function(){};i.addEventListener?o=function(t,e,i){t.addEventListener(e,i,!1)}:i.attachEvent&&(o=function(t,i,o){t[i+o]=o.handleEvent?function(){var i=e(t);o.handleEvent.call(o,i)}:function(){var i=e(t);o.call(t,i)},t.attachEvent("on"+i,t[i+o])});var n=function(){};i.removeEventListener?n=function(t,e,i){t.removeEventListener(e,i,!1)}:i.detachEvent&&(n=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(o){t[e+i]=void 0}});var r={bind:o,unbind:n};"function"==typeof define&&define.amd?define("eventie/eventie",r):"object"==typeof exports?module.exports=r:t.eventie=r}(window),function(){function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var o=t.prototype,n=this,r=n.EventEmitter;o.getListeners=function(t){var e,i,o=this._getEvents();if(t instanceof RegExp){e={};for(i in o)o.hasOwnProperty(i)&&t.test(i)&&(e[i]=o[i])}else e=o[t]||(o[t]=[]);return e},o.flattenListeners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},o.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},o.addListener=function(t,i){var o,n=this.getListenersAsObject(t),r="object"==typeof i;for(o in n)n.hasOwnProperty(o)&&-1===e(n[o],i)&&n[o].push(r?i:{listener:i,once:!1});return this},o.on=i("addListener"),o.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},o.once=i("addOnceListener"),o.defineEvent=function(t){return this.getListeners(t),this},o.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},o.removeListener=function(t,i){var o,n,r=this.getListenersAsObject(t);for(n in r)r.hasOwnProperty(n)&&(o=e(r[n],i),-1!==o&&r[n].splice(o,1));return this},o.off=i("removeListener"),o.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},o.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},o.manipulateListeners=function(t,e,i){var o,n,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(o=i.length;o--;)r.call(this,e,i[o]);else for(o in e)e.hasOwnProperty(o)&&(n=e[o])&&("function"==typeof n?r.call(this,o,n):s.call(this,o,n));return this},o.removeEvent=function(t){var e,i=typeof t,o=this._getEvents();if("string"===i)delete o[t];else if(t instanceof RegExp)for(e in o)o.hasOwnProperty(e)&&t.test(e)&&delete o[e];else delete this._events;return this},o.removeAllListeners=i("removeEvent"),o.emitEvent=function(t,e){var i,o,n,r,s=this.getListenersAsObject(t);for(n in s)if(s.hasOwnProperty(n))for(o=s[n].length;o--;)i=s[n][o],i.once===!0&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},o.trigger=i("emitEvent"),o.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},o.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},o._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},o._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return n.EventEmitter=r,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:n.EventEmitter=t}.call(this),function(t){function e(t){if(t){if("string"==typeof o[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e,n=0,r=i.length;r>n;n++)if(e=i[n]+t,"string"==typeof o[e])return e}}var i="Webkit Moz ms Ms O".split(" "),o=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return e}):"object"==typeof exports?module.exports=e:t.getStyleProperty=e}(window),function(t){function e(t){var e=parseFloat(t),i=-1===t.indexOf("%")&&!isNaN(e);return i&&e}function i(){}function o(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=s.length;i>e;e++){var o=s[e];t[o]=0}return t}function n(i){function n(){if(!d){d=!0;var o=t.getComputedStyle;if(p=function(){var t=o?function(t){return o(t,null)}:function(t){return t.currentStyle};return function(e){var i=t(e);return i||r("Style returned "+i+". Are you running this code in a hidden iframe on Firefox? "+"See http://bit.ly/getsizebug1"),i}}(),h=i("boxSizing")){var n=document.createElement("div");n.style.width="200px",n.style.padding="1px 2px 3px 4px",n.style.borderStyle="solid",n.style.borderWidth="1px 2px 3px 4px",n.style[h]="border-box";var s=document.body||document.documentElement;s.appendChild(n);var a=p(n);f=200===e(a.width),s.removeChild(n)}}}function a(t){if(n(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var i=p(t);if("none"===i.display)return o();var r={};r.width=t.offsetWidth,r.height=t.offsetHeight;for(var a=r.isBorderBox=!(!h||!i[h]||"border-box"!==i[h]),d=0,l=s.length;l>d;d++){var c=s[d],m=i[c];m=u(t,m);var y=parseFloat(m);r[c]=isNaN(y)?0:y}var g=r.paddingLeft+r.paddingRight,v=r.paddingTop+r.paddingBottom,_=r.marginLeft+r.marginRight,I=r.marginTop+r.marginBottom,z=r.borderLeftWidth+r.borderRightWidth,L=r.borderTopWidth+r.borderBottomWidth,x=a&&f,E=e(i.width);E!==!1&&(r.width=E+(x?0:g+z));var b=e(i.height);return b!==!1&&(r.height=b+(x?0:v+L)),r.innerWidth=r.width-(g+z),r.innerHeight=r.height-(v+L),r.outerWidth=r.width+_,r.outerHeight=r.height+I,r}}function u(e,i){if(t.getComputedStyle||-1===i.indexOf("%"))return i;var o=e.style,n=o.left,r=e.runtimeStyle,s=r&&r.left;return s&&(r.left=e.currentStyle.left),o.left=i,i=o.pixelLeft,o.left=n,s&&(r.left=s),i}var p,h,f,d=!1;return a}var r="undefined"==typeof console?i:function(t){console.error(t)},s=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],n):"object"==typeof exports?module.exports=n(require("desandro-get-style-property")):t.getSize=n(t.getStyleProperty)}(window),function(t){function e(t){"function"==typeof t&&(e.isReady?t():s.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==r.readyState;e.isReady||i||o()}function o(){e.isReady=!0;for(var t=0,i=s.length;i>t;t++){var o=s[t];o()}}function n(n){return"complete"===r.readyState?o():(n.bind(r,"DOMContentLoaded",i),n.bind(r,"readystatechange",i),n.bind(t,"load",i)),e}var r=t.document,s=[];e.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],n):"object"==typeof exports?module.exports=n(require("eventie")):t.docReady=n(t.eventie)}(window),function(t){function e(t,e){return t[s](e)}function i(t){if(!t.parentNode){var e=document.createDocumentFragment();e.appendChild(t)}}function o(t,e){i(t);for(var o=t.parentNode.querySelectorAll(e),n=0,r=o.length;r>n;n++)if(o[n]===t)return!0;return!1}function n(t,o){return i(t),e(t,o)}var r,s=function(){if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0,o=e.length;o>i;i++){var n=e[i],r=n+"MatchesSelector";if(t[r])return r}}();if(s){var a=document.createElement("div"),u=e(a,"div");r=u?e:n}else r=o;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return r}):"object"==typeof exports?module.exports=r:window.matchesSelector=r}(Element.prototype),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(i,o){return e(t,i,o)}):"object"==typeof exports?module.exports=e(t,require("doc-ready"),require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.docReady,t.matchesSelector)}(window,function(t,e,i){var o={};o.extend=function(t,e){for(var i in e)t[i]=e[i];return t},o.modulo=function(t,e){return(t%e+e)%e};var n=Object.prototype.toString;o.isArray=function(t){return"[object Array]"==n.call(t)},o.makeArray=function(t){var e=[];if(o.isArray(t))e=t;else if(t&&"number"==typeof t.length)for(var i=0,n=t.length;n>i;i++)e.push(t[i]);else e.push(t);return e},o.indexOf=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1},o.removeFrom=function(t,e){var i=o.indexOf(t,e);-1!=i&&t.splice(i,1)},o.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(t){return t instanceof HTMLElement}:function(t){return t&&"object"==typeof t&&1==t.nodeType&&"string"==typeof t.nodeName},o.setText=function(){function t(t,i){e=e||(void 0!==document.documentElement.textContent?"textContent":"innerText"),t[e]=i}var e;return t}(),o.getParent=function(t,e){for(;t!=document.body;)if(t=t.parentNode,i(t,e))return t},o.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},o.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},o.filterFindElements=function(t,e){t=o.makeArray(t);for(var n=[],r=0,s=t.length;s>r;r++){var a=t[r];if(o.isElement(a))if(e){i(a,e)&&n.push(a);for(var u=a.querySelectorAll(e),p=0,h=u.length;h>p;p++)n.push(u[p])}else n.push(a)}return n},o.debounceMethod=function(t,e,i){var o=t.prototype[e],n=e+"Timeout";t.prototype[e]=function(){var t=this[n];t&&clearTimeout(t);var e=arguments,r=this;this[n]=setTimeout(function(){o.apply(r,e),delete r[n]},i||100)}},o.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var r=t.console;return o.htmlInit=function(i,n){e(function(){for(var e=o.toDashed(n),s=document.querySelectorAll(".js-"+e),a="data-"+e+"-options",u=0,p=s.length;p>u;u++){var h,f=s[u],d=f.getAttribute(a);try{h=d&&JSON.parse(d)}catch(l){r&&r.error("Error parsing "+a+" on "+f.nodeName.toLowerCase()+(f.id?"#"+f.id:"")+": "+l);continue}var c=new i(f,h),m=t.jQuery;m&&m.data(f,n,c)}})},o}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(i,o,n,r){return e(t,i,o,n,r)}):"object"==typeof exports?module.exports=e(t,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(t.Outlayer={},t.Outlayer.Item=e(t,t.EventEmitter,t.getSize,t.getStyleProperty,t.fizzyUIUtils))}(window,function(t,e,i,o,n){function r(t){for(var e in t)return!1;return e=null,!0}function s(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var a=t.getComputedStyle,u=a?function(t){return a(t,null)}:function(t){return t.currentStyle},p=o("transition"),h=o("transform"),f=p&&h,d=!!o("perspective"),l={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[p],c=["transform","transition","transitionDuration","transitionProperty"],m=function(){for(var t={},e=0,i=c.length;i>e;e++){var n=c[e],r=o(n);r&&r!==n&&(t[n]=r)}return t}();n.extend(s.prototype,e.prototype),s.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},s.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},s.prototype.getSize=function(){this.size=i(this.element)},s.prototype.css=function(t){var e=this.element.style;for(var i in t){var o=m[i]||i;e[o]=t[i]}},s.prototype.getPosition=function(){var t=u(this.element),e=this.layout.options,i=e.isOriginLeft,o=e.isOriginTop,n=parseInt(t[i?"left":"right"],10),r=parseInt(t[o?"top":"bottom"],10);n=isNaN(n)?0:n,r=isNaN(r)?0:r;var s=this.layout.size;n-=i?s.paddingLeft:s.paddingRight,r-=o?s.paddingTop:s.paddingBottom,this.position.x=n,this.position.y=r},s.prototype.layoutPosition=function(){var t=this.layout.size,e=this.layout.options,i={},o=e.isOriginLeft?"paddingLeft":"paddingRight",n=e.isOriginLeft?"left":"right",r=e.isOriginLeft?"right":"left",s=this.position.x+t[o];s=e.percentPosition&&!e.isHorizontal?100*(s/t.width)+"%":s+"px",i[n]=s,i[r]="";var a=e.isOriginTop?"paddingTop":"paddingBottom",u=e.isOriginTop?"top":"bottom",p=e.isOriginTop?"bottom":"top",h=this.position.y+t[a];h=e.percentPosition&&e.isHorizontal?100*(h/t.height)+"%":h+"px",i[u]=h,i[p]="",this.css(i),this.emitEvent("layout",[this])};var y=d?function(t,e){return"translate3d("+t+"px, "+e+"px, 0)"}:function(t,e){return"translate("+t+"px, "+e+"px)"};s.prototype._transitionTo=function(t,e){this.getPosition();var i=this.position.x,o=this.position.y,n=parseInt(t,10),r=parseInt(e,10),s=n===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return this.layoutPosition(),void 0;var a=t-i,u=e-o,p={},h=this.layout.options;a=h.isOriginLeft?a:-a,u=h.isOriginTop?u:-u,p.transform=y(a,u),this.transition({to:p,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},s.prototype.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},s.prototype.moveTo=f?s.prototype._transitionTo:s.prototype.goTo,s.prototype.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},s.prototype._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},s.prototype._transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return this._nonTransition(t),void 0;var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var o=this.element.offsetHeight;o=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var g=h&&n.toDashed(h)+",opacity";s.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:g,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(l,this,!1))},s.prototype.transition=s.prototype[p?"_transition":"_nonTransition"],s.prototype.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},s.prototype.onotransitionend=function(t){this.ontransitionend(t)};var v={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};s.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,i=v[t.propertyName]||t.propertyName;if(delete e.ingProperties[i],r(e.ingProperties)&&this.disableTransition(),i in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[i]),i in e.onEnd){var o=e.onEnd[i];o.call(this),delete e.onEnd[i]}this.emitEvent("transitionEnd",[this])}},s.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(l,this,!1),this.isTransitioning=!1},s.prototype._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var _={transitionProperty:"",transitionDuration:""};return s.prototype.removeTransitionStyles=function(){this.css(_)},s.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},s.prototype.remove=function(){if(!p||!parseFloat(this.layout.options.transitionDuration))return this.removeElem(),void 0;var t=this;this.once("transitionEnd",function(){t.removeElem()}),this.hide()},s.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},s.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},s.prototype.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},s.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},s.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},s.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},s}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,o,n,r,s){return e(t,i,o,n,r,s)}):"object"==typeof exports?module.exports=e(t,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.eventie,t.EventEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,o,n,r){function s(t,e){var i=n.getQueryElement(t);if(!i)return a&&a.error("Bad element for "+this.constructor.namespace+": "+(i||t)),void 0;this.element=i,u&&(this.$element=u(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++h;this.element.outlayerGUID=o,f[o]=this,this._create(),this.options.isInitLayout&&this.layout()}var a=t.console,u=t.jQuery,p=function(){},h=0,f={};return s.namespace="outlayer",s.Item=r,s.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},n.extend(s.prototype,i.prototype),s.prototype.option=function(t){n.extend(this.options,t)},s.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},s.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},s.prototype._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,o=[],n=0,r=e.length;r>n;n++){var s=e[n],a=new i(s,this);o.push(a)}return o},s.prototype._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},s.prototype.getItemElements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},s.prototype.layout=function(){this._resetLayout(),this._manageStamps();var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},s.prototype._init=s.prototype.layout,s.prototype._resetLayout=function(){this.getSize()},s.prototype.getSize=function(){this.size=o(this.element)},s.prototype._getMeasurement=function(t,e){var i,r=this.options[t];r?("string"==typeof r?i=this.element.querySelector(r):n.isElement(r)&&(i=r),this[t]=i?o(i)[e]:r):this[t]=0},s.prototype.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},s.prototype._getItemsForLayout=function(t){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i];n.isIgnored||e.push(n)}return e},s.prototype._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){for(var i=[],o=0,n=t.length;n>o;o++){var r=t[o],s=this._getItemLayoutPosition(r);s.item=r,s.isInstant=e||r.isLayoutInstant,i.push(s)}this._processLayoutQueue(i)}},s.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},s.prototype._processLayoutQueue=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];this._positionItem(o.item,o.x,o.y,o.isInstant)}},s.prototype._positionItem=function(t,e,i,o){o?t.goTo(e,i):t.moveTo(e,i)},s.prototype._postLayout=function(){this.resizeContainer()},s.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))}},s.prototype._getContainerSize=p,s.prototype._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},s.prototype._emitCompleteOnItems=function(t,e){function i(){n.emitEvent(t+"Complete",[e])}function o(){s++,s===r&&i()}var n=this,r=e.length;if(!e||!r)return i(),void 0;for(var s=0,a=0,u=e.length;u>a;a++){var p=e[a];p.once(t,o)}},s.prototype.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},s.prototype.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},s.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;i>e;e++){var o=t[e];this.ignore(o)}}},s.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var o=t[e];n.removeFrom(this.stamps,o),this.unignore(o)}},s.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)):void 0},s.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._manageStamp(i)}}},s.prototype._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},s.prototype._manageStamp=p,s.prototype._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,n=o(t),r={left:e.left-i.left-n.marginLeft,top:e.top-i.top-n.marginTop,right:i.right-e.right-n.marginRight,bottom:i.bottom-e.bottom-n.marginBottom};return r},s.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},s.prototype.bindResize=function(){this.isResizeBound||(e.bind(t,"resize",this),this.isResizeBound=!0)},s.prototype.unbindResize=function(){this.isResizeBound&&e.unbind(t,"resize",this),this.isResizeBound=!1},s.prototype.onresize=function(){function t(){e.resize(),delete e.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var e=this;this.resizeTimeout=setTimeout(t,100)},s.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},s.prototype.needsResizeLayout=function(){var t=o(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},s.prototype.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},s.prototype.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},s.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},s.prototype.reveal=function(t){this._emitCompleteOnItems("reveal",t);for(var e=t&&t.length,i=0;e&&e>i;i++){var o=t[i];o.reveal()}},s.prototype.hide=function(t){this._emitCompleteOnItems("hide",t);for(var e=t&&t.length,i=0;e&&e>i;i++){var o=t[i];o.hide()}},s.prototype.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},s.prototype.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},s.prototype.getItem=function(t){for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];if(o.element===t)return o}},s.prototype.getItems=function(t){t=n.makeArray(t);for(var e=[],i=0,o=t.length;o>i;i++){var r=t[i],s=this.getItem(r);s&&e.push(s)}return e},s.prototype.remove=function(t){var e=this.getItems(t);if(this._emitCompleteOnItems("remove",e),e&&e.length)for(var i=0,o=e.length;o>i;i++){var r=e[i];r.remove(),n.removeFrom(this.items,r)}},s.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];o.destroy()}this.unbindResize();var n=this.element.outlayerGUID;delete f[n],delete this.element.outlayerGUID,u&&u.removeData(this.element,this.constructor.namespace)},s.data=function(t){t=n.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&f[e]},s.create=function(t,e){function i(){s.apply(this,arguments)}return Object.create?i.prototype=Object.create(s.prototype):n.extend(i.prototype,s.prototype),i.prototype.constructor=i,i.defaults=n.extend({},s.defaults),n.extend(i.defaults,e),i.prototype.settings={},i.namespace=t,i.data=s.data,i.Item=function(){r.apply(this,arguments)},i.Item.prototype=new r,n.htmlInit(i,t),u&&u.bridget&&u.bridget(t,i),i},s.Item=r,s}),function(t,e){"function"==typeof define&&define.amd?define("isotope/js/item",["outlayer/outlayer"],e):"object"==typeof exports?module.exports=e(require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.Item=e(t.Outlayer))}(window,function(t){function e(){t.Item.apply(this,arguments)}e.prototype=new t.Item,e.prototype._create=function(){this.id=this.layout.itemGUID++,t.Item.prototype._create.call(this),this.sortData={}},e.prototype.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var t=this.layout.options.getSortData,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortData[i]=o(this.element,this)}}};var i=e.prototype.destroy;return e.prototype.destroy=function(){i.apply(this,arguments),this.css({display:""})},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):"object"==typeof exports?module.exports=e(require("get-size"),require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.LayoutMode=e(t.getSize,t.Outlayer))}(window,function(t,e){function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filteredItems,this.size=t.size)}return function(){function t(t){return function(){return e.prototype[t].apply(this.isotope,arguments)}}for(var o=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout"],n=0,r=o.length;r>n;n++){var s=o[n];i.prototype[s]=t(s)}}(),i.prototype.needsVerticalResizeLayout=function(){var e=t(this.isotope.element),i=this.isotope.size&&e;return i&&e.innerHeight!=this.isotope.size.innerHeight},i.prototype._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},i.prototype.getColumnWidth=function(){this.getSegmentSize("column","Width")},i.prototype.getRowHeight=function(){this.getSegmentSize("row","Height")},i.prototype.getSegmentSize=function(t,e){var i=t+e,o="outer"+e;if(this._getMeasurement(i,o),!this[i]){var n=this.getFirstItemSize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},i.prototype.getFirstItemSize=function(){var e=this.isotope.filteredItems[0];return e&&e.element&&t(e.element)},i.prototype.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},i.prototype.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function o(){i.apply(this,arguments)}return o.prototype=new i,e&&(o.options=e),o.prototype.namespace=t,i.modes[t]=o,o},i}),function(t,e){"function"==typeof define&&define.amd?define("masonry/masonry",["outlayer/outlayer","get-size/get-size","fizzy-ui-utils/utils"],e):"object"==typeof exports?module.exports=e(require("outlayer"),require("get-size"),require("fizzy-ui-utils")):t.Masonry=e(t.Outlayer,t.getSize,t.fizzyUIUtils)}(window,function(t,e,i){var o=t.create("masonry");return o.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var t=this.cols;for(this.colYs=[];t--;)this.colYs.push(0);this.maxY=0},o.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var o=this.columnWidth+=this.gutter,n=this.containerWidth+this.gutter,r=n/o,s=o-n%o,a=s&&1>s?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},o.prototype.getContainerWidth=function(){var t=this.options.isFitWidth?this.element.parentNode:this.element,i=e(t);this.containerWidth=i&&i.innerWidth},o.prototype._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,o=e&&1>e?"round":"ceil",n=Math[o](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var r=this._getColGroup(n),s=Math.min.apply(Math,r),a=i.indexOf(r,s),u={x:this.columnWidth*a,y:s},p=s+t.size.outerHeight,h=this.cols+1-r.length,f=0;h>f;f++)this.colYs[a+f]=p;return u},o.prototype._getColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,o=0;i>o;o++){var n=this.colYs.slice(o,o+t);e[o]=Math.max.apply(Math,n)}return e},o.prototype._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this.options.isOriginLeft?o.left:o.right,r=n+i.outerWidth,s=Math.floor(n/this.columnWidth);s=Math.max(0,s);var a=Math.floor(r/this.columnWidth);a-=r%this.columnWidth?0:1,a=Math.min(this.cols-1,a);for(var u=(this.options.isOriginTop?o.top:o.bottom)+i.outerHeight,p=s;a>=p;p++)this.colYs[p]=Math.max(u,this.colYs[p])},o.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this.options.isFitWidth&&(t.width=this._getContainerFitWidth()),t},o.prototype._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.prototype.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!==this.containerWidth},o}),function(t,e){"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],e):"object"==typeof exports?module.exports=e(require("../layout-mode"),require("masonry-layout")):e(t.Isotope.LayoutMode,t.Masonry)}(window,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}var o=t.create("masonry"),n=o.prototype._getElementOffset,r=o.prototype.layout,s=o.prototype._getMeasurement;i(o.prototype,e.prototype),o.prototype._getElementOffset=n,o.prototype.layout=r,o.prototype._getMeasurement=s;var a=o.prototype.measureColumns;o.prototype.measureColumns=function(){this.items=this.isotope.filteredItems,a.call(this)};var u=o.prototype._manageStamp;return o.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,u.apply(this,arguments)},o}),function(t,e){"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],e):"object"==typeof exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){var e=t.create("fitRows");return e.prototype._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement("gutter","outerWidth") },e.prototype._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth+this.gutter,i=this.isotope.size.innerWidth+this.gutter;0!==this.x&&e+this.x>i&&(this.x=0,this.y=this.maxY);var o={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=e,o},e.prototype._getContainerSize=function(){return{height:this.maxY}},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],e):"object"==typeof exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){var e=t.create("vertical",{horizontalAlignment:0});return e.prototype._resetLayout=function(){this.y=0},e.prototype._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},e.prototype._getContainerSize=function(){return{height:this.y}},e}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","matches-selector/matches-selector","fizzy-ui-utils/utils","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],function(i,o,n,r,s,a){return e(t,i,o,n,r,s,a)}):"object"==typeof exports?module.exports=e(t,require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("fizzy-ui-utils"),require("./item"),require("./layout-mode"),require("./layout-modes/masonry"),require("./layout-modes/fit-rows"),require("./layout-modes/vertical")):t.Isotope=e(t,t.Outlayer,t.getSize,t.matchesSelector,t.fizzyUIUtils,t.Isotope.Item,t.Isotope.LayoutMode)}(window,function(t,e,i,o,n,r,s){function a(t,e){return function(i,o){for(var n=0,r=t.length;r>n;n++){var s=t[n],a=i.sortData[s],u=o.sortData[s];if(a>u||u>a){var p=void 0!==e[s]?e[s]:e,h=p?1:-1;return(a>u?1:-1)*h}}return 0}}var u=t.jQuery,p=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},h=document.documentElement,f=h.textContent?function(t){return t.textContent}:function(t){return t.innerText},d=e.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});d.Item=r,d.LayoutMode=s,d.prototype._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),e.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var t in s.modes)this._initLayoutMode(t)},d.prototype.reloadItems=function(){this.itemGUID=0,e.prototype.reloadItems.call(this)},d.prototype._itemize=function(){for(var t=e.prototype._itemize.apply(this,arguments),i=0,o=t.length;o>i;i++){var n=t[i];n.id=this.itemGUID++}return this._updateItemsSortData(t),t},d.prototype._initLayoutMode=function(t){var e=s.modes[t],i=this.options[t]||{};this.options[t]=e.options?n.extend(e.options,i):i,this.modes[t]=new e(this)},d.prototype.layout=function(){return!this._isLayoutInited&&this.options.isInitLayout?(this.arrange(),void 0):(this._layout(),void 0)},d.prototype._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},d.prototype.arrange=function(t){function e(){o.reveal(i.needReveal),o.hide(i.needHide)}this.option(t),this._getIsInstant();var i=this._filter(this.items);this.filteredItems=i.matches;var o=this;this._bindArrangeComplete(),this._isInstant?this._noTransition(e):e(),this._sort(),this._layout()},d.prototype._init=d.prototype.arrange,d.prototype._getIsInstant=function(){var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;return this._isInstant=t,t},d.prototype._bindArrangeComplete=function(){function t(){e&&i&&o&&n.emitEvent("arrangeComplete",[n.filteredItems])}var e,i,o,n=this;this.once("layoutComplete",function(){e=!0,t()}),this.once("hideComplete",function(){i=!0,t()}),this.once("revealComplete",function(){o=!0,t()})},d.prototype._filter=function(t){var e=this.options.filter;e=e||"*";for(var i=[],o=[],n=[],r=this._getFilterTest(e),s=0,a=t.length;a>s;s++){var u=t[s];if(!u.isIgnored){var p=r(u);p&&i.push(u),p&&u.isHidden?o.push(u):p||u.isHidden||n.push(u)}}return{matches:i,needReveal:o,needHide:n}},d.prototype._getFilterTest=function(t){return u&&this.options.isJQueryFiltering?function(e){return u(e.element).is(t)}:"function"==typeof t?function(e){return t(e.element)}:function(e){return o(e.element,t)}},d.prototype.updateSortData=function(t){var e;t?(t=n.makeArray(t),e=this.getItems(t)):e=this.items,this._getSorters(),this._updateItemsSortData(e)},d.prototype._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=l(i)}},d.prototype._updateItemsSortData=function(t){for(var e=t&&t.length,i=0;e&&e>i;i++){var o=t[i];o.updateSortData()}};var l=function(){function t(t){if("string"!=typeof t)return t;var i=p(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),r=n&&n[1],s=e(r,o),a=d.sortDataParsers[i[1]];return t=a?function(t){return t&&a(s(t))}:function(t){return t&&s(t)}}function e(t,e){var i;return i=t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&f(i)}}return t}();d.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},d.prototype._sort=function(){var t=this.options.sortBy;if(t){var e=[].concat.apply(t,this.sortHistory),i=a(e,this.options.sortAscending);this.filteredItems.sort(i),t!=this.sortHistory[0]&&this.sortHistory.unshift(t)}},d.prototype._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw Error("No layout mode: "+t);return e.options=this.options[t],e},d.prototype._resetLayout=function(){e.prototype._resetLayout.call(this),this._mode()._resetLayout()},d.prototype._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},d.prototype._manageStamp=function(t){this._mode()._manageStamp(t)},d.prototype._getContainerSize=function(){return this._mode()._getContainerSize()},d.prototype.needsResizeLayout=function(){return this._mode().needsResizeLayout()},d.prototype.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},d.prototype.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)}},d.prototype._filterRevealAdded=function(t){var e=this._filter(t);return this.hide(e.needHide),this.reveal(e.matches),this.layoutItems(e.matches,!0),e.matches},d.prototype.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;n>i;i++)o=e[i],this.element.appendChild(o.element);var r=this._filter(e).matches;for(i=0;n>i;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;n>i;i++)delete e[i].isLayoutInstant;this.reveal(r)}};var c=d.prototype.remove;return d.prototype.remove=function(t){t=n.makeArray(t);var e=this.getItems(t);c.call(this,t);var i=e&&e.length;if(i)for(var o=0;i>o;o++){var r=e[o];n.removeFrom(this.filteredItems,r)}},d.prototype.shuffle=function(){for(var t=0,e=this.items.length;e>t;t++){var i=this.items[t];i.sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},d.prototype._noTransition=function(t){var e=this.options.transitionDuration;this.options.transitionDuration=0;var i=t.call(this);return this.options.transitionDuration=e,i},d.prototype.getFilteredItemElements=function(){for(var t=[],e=0,i=this.filteredItems.length;i>e;e++)t.push(this.filteredItems[e].element);return t},d}); /* jQuery ImagesLoaded */ jQuery.fn.imagesLoaded=function(callback){var elems=this.find("img"),elems_src=[],self=this,len=elems.length;if(!elems.length){callback.call(this);return this}elems.one("load error",function(){if(--len===0){len=elems.length;elems.one("load error",function(){if(--len===0){callback.call(self)}}).each(function(){this.src=elems_src.shift()})}}).each(function(){elems_src.push(this.src);this.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="});return this}; /* jQuery BigText v1.2.0, May 2014 */ (function($){var defaultOptions={rotateText:null,fontSizeFactor:0.8,maximumFontSize:null,limitingDimension:'both',horizontalAlign:'center',verticalAlign:'center',textAlign:'center'};$.fn.bigText=function(options){return this.each(function(){options=$.extend({},defaultOptions,options);var $this=$(this);var $parent=$this.parent();$this.css({display:'inline-block',clear:'both','float':'left','font-size':(1000*options.fontSizeFactor)+'px','line-height':'1000px','white-space':'nowrap','text-align':options.textAlign,position:'relative',padding:0,margin:0,left:'50%',top:'50%'});var parentPadding={left:parseInt($parent.css('padding-left')),top:parseInt($parent.css('padding-top')),right:parseInt($parent.css('padding-right')),bottom:parseInt($parent.css('padding-bottom'))};var box={width:$this.outerWidth(),height:$this.outerHeight()};var rotateCSS={};if(options.rotateText!==null){if(typeof options.rotateText!=='number'){throw'bigText error: rotateText value must be a number'}var rotate='rotate('+options.rotateText+'deg)';rotateCSS={'-webkit-transform':rotate,'-ms-transform':rotate,'-moz-transform':rotate,'-o-transform':rotate,transform:rotate};$this.css(rotateCSS);var sin=Math.abs(Math.sin(options.rotateText*Math.PI/180));var cos=Math.abs(Math.cos(options.rotateText*Math.PI/180));box.width=$this.outerWidth()*cos+$this.outerHeight()*sin;box.height=$this.outerWidth()*sin+$this.outerHeight()*cos}var widthFactor=($parent.innerWidth()-parentPadding.left-parentPadding.right)/box.width;var heightFactor=($parent.innerHeight()-parentPadding.top-parentPadding.bottom)/box.height;var lineHeight;if(options.limitingDimension.toLowerCase()==='width'){lineHeight=Math.floor(widthFactor*1000);$parent.height(lineHeight)}else{if(options.limitingDimension.toLowerCase()==='height'){lineHeight=Math.floor(heightFactor*1000)}else{if(widthFactor<heightFactor){lineHeight=Math.floor(widthFactor*1000)}else{if(widthFactor>=heightFactor){lineHeight=Math.floor(heightFactor*1000)}}}}var fontSize=lineHeight*options.fontSizeFactor;if(options.maximumFontSize!==null&&fontSize>options.maximumFontSize){fontSize=options.maximumFontSize;lineHeight=fontSize/options.fontSizeFactor}$this.css({'font-size':Math.floor(fontSize)+'px','line-height':Math.ceil(lineHeight)+'px','margin-bottom':'0px','margin-right':'0px'});if(options.limitingDimension.toLowerCase()==='height'){$parent.width(($this.width()+4)+'px')}var endCSS={};switch(options.verticalAlign.toLowerCase()){case'top':endCSS.top='0%';break;case'bottom':endCSS.top='100%';endCSS['margin-top']=Math.floor(-$this.innerHeight())+'px';break;default:endCSS['margin-top']=Math.floor((-$this.innerHeight()/2))+'px';break}switch(options.horizontalAlign.toLowerCase()){case'left':endCSS.left='0%';break;case'right':endCSS.left='100%';endCSS['margin-left']=Math.floor(-$this.innerWidth())+'px';break;default:endCSS['margin-left']=Math.floor((-$this.innerWidth()/2))+'px';break}$this.css(endCSS);$this.css('visibility','visible')})}})(jQuery); /* WPtouch MobileStore Theme JS File */ var page_wrapper = jQuery( '.page-wrapper' ); var isCheckoutPage = jQuery( 'body' ).hasClass( 'woocommerce-checkout' ); var isCartPage = jQuery( 'body' ).hasClass( 'woocommerce-cart' ); var isAccountPage = jQuery( 'body' ).hasClass( 'woocommerce-account' ); var currentDomain = location.hostname.split('.').join('-'); // WooCommerce load more products link function mobilestoreLoadMore() { if ( jQuery( 'body' ).hasClass( 'ajax-pagination' ) ) { var loadMoreLink = 'a.load-more-products-link'; page_wrapper.on( 'click', loadMoreLink, function( e ) { var loadMoreURL = jQuery( this ).attr( 'rel' ); nextPage = loadMoreURL.split( '/' ); jQuery.bbq.pushState( { page: nextPage[ nextPage.length - 2 ] } ); var targetDiv = setupLoadMoreElements( jQuery( this ) ); targetDiv.hide().load( loadMoreURL + ' #content ul.products.main li, a.load-more-products-link', function() { var newProducts = jQuery( this ).children( 'li' ); newProducts.css( 'visibility', 'hidden' ).addClass( 'tappable' ); if ( wptouchReadCookie( currentDomain + '-mobilestore-layout' ) == 'vertical' ) { newProducts.addClass( 'vertical' ); } revealProducts( targetDiv, newProducts, false ); }); e.preventDefault(); }); } } // Load more products link handling function setupLoadMoreElements( loadMoreLink ) { loadMoreLink.addClass( 'ajaxing' ).text( wptouchFdn.ajaxLoading ).prepend( '<span class="spinner"></span>' ); jQuery( '.spinner' ).spin( 'tiny' ); loadMoreLink.after( "<span class='ajax-target'></span>" ); return jQuery( '.ajax-target' ); } // Appending new products with isotope() function revealProducts( targetDiv, newProducts, doScroll ) { var itemsToGet = jQuery( '#content' ).find( 'ul.products.main' ); itemsToGet.append( newProducts ).imagesLoaded( function() { newProducts.css( 'visibility', 'visible' ); itemsToGet.isotope( 'insert', newProducts ); if ( doScroll ) { jQuery( 'body' ).scrollTop( jQuery.bbq.getState( 'scroll' ) ); } }); jQuery( '.ajaxing' ).animate( { height: 'toggle' }, 200, 'linear', function(){ jQuery( this ).remove(); jQuery( 'a.load-more-products-link', targetDiv ).first().insertAfter( '#content' ); }); targetDiv.remove(); } // Figure out how many pages need to be added to the current view if using back in the browser (really helpful in Web-App Mode) function mobilestoreLoadStateElements( targetDiv, urlParts, startPage, maxPage, newProducts ) { urlParts[ urlParts.length - 2 ] = startPage; loadMoreURL = urlParts.join( '/' ); targetDiv.hide().load( loadMoreURL + ' #content ul.products.main li, a.load-more-products-link', function() { jQuery( this ).children( 'li' ).addClass( 'page' + startPage ); lastProducts = jQuery( newProducts ); newProducts = jQuery( this ).children( 'li' ); newProducts.addClass( 'tappable' ); newProducts = jQuery.merge( lastProducts, newProducts ); if ( startPage == maxPage ) { revealProducts( targetDiv, newProducts, true ); } else { startPage++; mobilestoreLoadStateElements( targetDiv, urlParts, startPage, maxPage, newProducts ); } }); } // Load the previous state now function mobilestoreRestoreState() { // Load extra content var lastPageLoaded = jQuery.bbq.getState( 'page' ); if ( lastPageLoaded && lastPageLoaded > 1 ) { var loadMoreLink = jQuery( 'a.load-more-products-link' ); var loadMoreURL = loadMoreLink.attr( 'rel' ); var loadMoreURLParts = loadMoreURL.split( '/' ); var targetDiv = setupLoadMoreElements( loadMoreLink ); mobilestoreLoadStateElements( targetDiv, loadMoreURLParts, 2, lastPageLoaded, jQuery() ); } } // The main isotope() gravy function mobilestoreIsotope() { jQuery( 'ul.products' ).each( function(){ var node = jQuery( this ); products = node.find( '> *' ).detach(); node.html( products ); }); // don't proceed if container has not been selected var container = jQuery( '#content ul.products.main' ); var firstLi = container.find( 'li' ).first(); if ( !container ) { return; } else { container.imagesLoaded( function() { if ( wptouchReadCookie( currentDomain + '-mobilestore-layout' ) == 'vertical' ) { var userLayout = 'vertical'; jQuery( 'li', container ).addClass( 'vertical' ); } else { var userLayout = 'masonry'; } // init Isotope jQuery( this ).find( 'li' ).css( 'visibility','visible' ); container.isotope({ itemSelector: 'li', layoutMode: userLayout }); // Now restore the page state if ( jQuery( 'body' ).hasClass( 'ajax-pagination' ) ) { mobilestoreRestoreState(); } }); } } // Bind the tappable module explicitly to these elements dynamically function mobilestoreBindTappableLinks(){ // Off-Canvas menu items, etc jQuery( '.pushit li, button, a.button, .products li, .sort-filter-buttons i' ).not( 'li.empty' ).each( function(){ jQuery( this ).addClass( 'tappable' ); }); } // Product gallery swapping for images changed by the variation select function mobilestoreHandleWooVariationImages(){ image = jQuery( '.images > img.attachment-shop_single' ); thumb = jQuery( '.thumbnails li' ).first().find( 'img' ); thumbs = jQuery( '.thumbnails img' ); jQuery( document ).on( 'found_variation', function( event, variation ){ full_image = variation.image_link; if ( full_image !== '' ) { image.attr( 'data-large-image', full_image ); thumb.attr( 'data-large-image', full_image ).attr( 'src', variation.image_src ); } else { // Restore the original image. full = image.attr( 'data-o_large' ); image.attr( 'src', image.attr( 'data-o_src' ) ).attr( 'data-large-image', full ); thumb.attr( 'data-large-image', full ).attr( 'src', image.attr( 'data-o_src' ) ); } thumbs.removeClass( 'active' ); thumbs.first().addClass( 'active' ); }); jQuery( document ).on( 'reset_image', function( event ) { full = image.attr( 'data-o_large' ); image.attr( 'src', image.attr( 'data-o_src' ) ).attr( 'data-large-image', full ); thumbs.removeClass( 'active' ); thumb.addClass( 'active' ).attr( 'data-large-image', full ).attr( 'src', image.attr( 'data-o_src' ) ); }); } // The main gallery multitouch magic function mobilestoreSetupHammer(){ // Process gallery images and get them out of anchors, setup for image swapping jQuery( ' .images a, .thumbnails a', '#content' ).each( function(){ var bigImg = jQuery( this ).attr( 'href' ); jQuery( 'img', this ).unwrap().attr( 'data-large-image', bigImg ).attr('data-o_large', bigImg ).addClass( 'gallery' ); }); // Process gallery images and get them out of anchors, setup for image swapping jQuery( ' .images a, .thumbnails a', '#content' ).each( function(){ var bigImg = jQuery( this ).attr( 'href' ); jQuery( 'img', this ).unwrap().attr( 'data-large-image', bigImg ).attr('data-o_large', bigImg ).addClass( 'gallery' ); }); var thumbDiv = jQuery( '#content .thumbnails' ); countThumbs = jQuery( 'li', thumbDiv ).length; if ( countThumbs > 0 ) { main_image = jQuery( '#content .images img.wp-post-image' ); // If there's a duplicate for the main image in the gallery, remove its thumbnail. thumbDiv.find( 'img[data-large-image="' + main_image.attr( 'data-large-image' ) + '"]' ).parent().remove(); var clonedLi = main_image.clone(); clonedLi.removeClass( 'wp-post-image' ).attr( 'id', 'image-' + countThumbs ).prependTo( '.thumbnails' ).wrap('<li></li>'); clonedLi.parent().addClass( 'active' ); var thumbDiv = jQuery( '#content' ).find( '.thumbnails' ); thumbDiv.css( 'visibility', 'visible' ); thumbDiv.on( 'click', 'li', function( e ){ e.preventDefault(); var thumbSmall = jQuery( 'img', this ).attr( 'src' ); var thumbLarge = jQuery( 'img', this ).attr( 'data-large-image' ); if ( !jQuery( this ).hasClass( 'active' ) ){ jQuery( 'li', thumbDiv ).removeClass( 'active' ); jQuery( this ).addClass( 'active' ); jQuery( 'img.wp-post-image', '#content' ).first() .attr( 'src', thumbSmall ) .attr( 'data-large-image', thumbLarge ); if ( jQuery( 'body' ).hasClass( 'can-zoom-images' ) ) { resetHammer(); } } }); } if ( jQuery( 'body' ).hasClass( 'can-zoom-images' ) ) { if ( navigator.userAgent.toLowerCase().indexOf( 'iphone' ) != -1 || navigator.userAgent.toLowerCase().indexOf( 'ipad' ) != -1 ) { jQuery( '.can-zoom-images .images img.wp-post-image' ).before( '<span class="zoomer wptouch-icon-resize-full"></span>' ); jQuery( '.images' ).on( 'click', '.zoomer', function(){ jQuery( '.images > img' ).trigger( 'doubletap' ); }); var productImgObjDiv = jQuery( '.product' ).find( '.images' ); var productImgObj = jQuery( 'img.wp-post-image.gallery', productImgObj ).get(0); var hammer_options = { preventDefault: false, transform_always_block: true, transform_min_scale: 1, drag_block_horizontal: true, drag_block_vertical: false, drag_min_distance: 0 }; var posX=0, posY=0, lastPosX=0, lastPosY=0, bufferX=0, bufferY=0, scale=1, last_scale, dragReady=0, position=jQuery( '.images img.wp-post-image.gallery' ).position(); function enableAnimation() { var mainImg = jQuery( '.images img.wp-post-image.gallery' ); mainImg.css( '-webkit-transition-duration', '220ms' ); mainImg.one( 'transitionend webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd', function(){ disableAnimation(); position = mainImg.position(); }); } function disableAnimation() { jQuery( '.images img.wp-post-image.gallery' ).css( '-webkit-transition-duration', '0' ); } function swapImage() { var mainImg = jQuery( 'img.wp-post-image.gallery', '.images' ); if ( mainImg.attr( 'src' ).indexOf( '300x300' ) != -1 && enableImageReplace ) { var fullsize = mainImg.attr( 'data-large-image' ); if ( mainImg.attr( 'src' ) != fullsize ) { mainImg.attr( 'src', fullsize ); } } } function applyTransform( image, transform ) { if ( image ) { if ( transform == 'translate3d(0px, 0px, 0) scale3d(1, 1, 0)' ) { transform = ''; } image.style.transform = transform; image.style.oTransform = transform; image.style.msTransform = transform; image.style.mozTransform = transform; image.style.webkitTransform = transform; } } function resetHammer() { enableAnimation(); posX=0, posY=0, lastPosX=0, lastPosY=0, bufferX=0, bufferY=0, scale=1, last_scale=1; applyTransform( productImgObj, 'translate3d(0px, 0px, 0) scale3d(1, 1, 0)' ); } productImgObjDiv.hammer( hammer_options ).on( 'touch touchend doubletap drag transform', function( ev ) { switch( ev.type ) { case 'touch': enableImageReplace = false; last_scale = scale; disableAnimation(); break; case 'touchend': enableImageReplace = false; if ( scale > 1 ) { enableAnimation(); boxHeight = productImgObjDiv.height(); boxWidth = productImgObjDiv.width(); position = productImgObjDiv.find( 'img.wp-post-image.gallery' ).position(); renderedWidth = productImgObj.width * scale; renderedX = position.left; renderedHeight = productImgObj.height * scale; renderedY = position.top; // Left edge snap if ( renderedX > 0 ) { posX = ( renderedWidth - productImgObj.width ) / 2; } // Right edge snap if ( renderedX + renderedWidth < boxWidth ) { correction = boxWidth - ( renderedX + renderedWidth ); posX = correction + renderedX + ( ( renderedWidth - productImgObj.width ) / 2 ); } // Top edge snap if ( renderedY > 0 ) { posY = ( renderedHeight - productImgObj.height ) / 2; } // Bottom edge snap if ( renderedY + renderedHeight < boxHeight ) { correction = boxHeight - ( renderedY + renderedHeight ); posY = correction + renderedY + ( ( renderedHeight - productImgObj.height ) / 2 ); } } lastPosX = posX; lastPosY = posY; if ( scale > 1 ) { enableImageReplace = true; swapImage(); } else { enableImageReplace = false; } break; case 'doubletap': if ( jQuery.inArray( ev, 'gesture' ) != -1 ) { ev.gesture.stopPropagation(); ev.gesture.preventDefault(); } ev.preventDefault(); enableImageReplace = false; enableAnimation(); if ( scale == 1 ) { scale = 2; enableImageReplace = true; swapImage(); jQuery( '.zoomer' ).fadeOut(); } else { posX=0, posY=0, lastPosX=0, lastPosY=0, bufferX=0, bufferY=0, scale=1, last_scale=1; jQuery( '.zoomer' ).fadeIn(); } break; case 'drag': enableImageReplace = false; if ( scale > 1 ) { ev.gesture.stopPropagation(); ev.gesture.preventDefault(); posX = ev.gesture.deltaX + lastPosX; posY = ev.gesture.deltaY + lastPosY; } break; case 'transform': ev.gesture.stopPropagation(); ev.gesture.preventDefault(); scale = Math.max( 1, Math.min( last_scale * ev.gesture.scale, 10 ) ); if ( scale > 10 ) { scale = 10; } if ( scale > 1.1 && scale < 10 ) { startrWidth = productImgObj.width * last_scale; startrHeight = productImgObj.height * last_scale; startposition = productImgObjDiv.find( 'img.wp-post-image.gallery' ).position(); startrX = position.left; startrY = position.top; boxWidth = productImgObjDiv.width(); boxHeight = productImgObjDiv.height(); boxCentreX = boxWidth / 2; boxCentreY = boxHeight / 2; imageCentreX = startrX + ( startrWidth / 2 ); imageCentreY = startrY + ( startrHeight / 2 ); startCentredPixelX = ( -1 * startrX ) + boxCentreX; startCentredPixelY = ( -1 * startrY ) + boxCentreY; // end endrWidth = productImgObj.width * scale; endrHeight = productImgObj.height * scale; endrX = imageCentreX - ( endrWidth / 2 ); endrY = imageCentreY - ( endrHeight / 2 ); endCentredPixelX = ( -1 * endrX ) + boxCentreX; endCentredPixelY = ( -1 * endrY ) + boxCentreY; // scaled point projectedCentredPixelX = ( startCentredPixelX * ev.gesture.scale ); projectedCentredPixelY = ( startCentredPixelY * ev.gesture.scale ); // correction correctionX = endCentredPixelX - projectedCentredPixelX; correctionY = endCentredPixelY - projectedCentredPixelY; posX = lastPosX + ( correctionX ); posY = lastPosY + ( correctionY ); jQuery( '.zoomer' ).fadeOut(); } else if ( scale == 1 ) { posX = 0; posY = 0; lastPosX = 0; lastPosY = 0; scale = 1; jQuery( '.zoomer' ).fadeIn(); } break; } if ( scale == 1 ) { productImgObjDiv.removeClass( 'zoomed' ); } else { productImgObjDiv.addClass( 'zoomed' ); } var transform = 'translate3d('+posX+'px, '+posY+'px, 0) ' + 'scale3d('+scale+', '+scale+', 0)'; applyTransform( productImgObj, transform ); }); } } // can zoom } function mobilestoreProductSummaryArea(){ // Change the inputs in the gallery summary to trigger the numeric keyboard jQuery( '#content input.qty' ).attr( 'type', 'number' ); // Remove the text labels, we're using icons instead for horizontal space savings jQuery( '.smartphone .woocommerce-tabs ul.tabs a' ).text( '' ); } // Make sure Add to Cart gets caught and triggers the mini-cart off-canvas menu function mobilestoreHandleAddToCart(){ if ( jQuery( 'body' ).hasClass( 'ajax-add-to-cart' ) ) { var cartEl = jQuery( 'form.cart' ); form_action = cartEl.attr( 'action' ); if ( !form_action ) { form_action = ''; } cartEl.attr( 'action', form_action + '?wptouch_mobilestore_action=add_to_cart&ajax=true' ); cartEl.append( '<input type="hidden" name="wptouch_ajax_cart" value="true" />' ); cartEl.on( 'click', 'button', function( e ){ e.preventDefault(); var action = window.location; add_to_cart_button = jQuery( this ); add_to_cart_button.attr( 'disabled', 'true' ).css( 'padding-left', '20px' ).spin( 'tiny' ); add_to_cart_button.children( 'div' ).css( 'left', '-5px' ); jQuery.post( action, cartEl.serialize(), function( data ) { jQuery( '.cart-btn' ).addClass( 'filled animated' ); data = jQuery.parseJSON( data ); if ( data.wptouch_mobilestore_action == 'success' ) { if ( jQuery( '#menu-right' ).length ) { if ( jQuery( 'form.cart' ).hasClass( 'variations_form' ) ) { product_id = jQuery( 'input[name=product_id]' ).val(); variation_id = jQuery( 'input[name=variation_id]' ).val(); product_item = '.product-' + product_id + '.variation-' + variation_id; } else { product_id = jQuery( 'input[name=add-to-cart] ' ).val(); product_item = '.product-' + product_id; } jQuery( '#menu-right' ).load( '?wptouch_mobilestore_action=refresh_cart', function() { jQuery( '#menu-right ' + product_item ).css('opacity', '0'); jQuery( '.cart-btn' ).click(); jQuery( 'form.cart' ).each( function() { this.reset(); }); setTimeout( function() { jQuery( '#menu-right ' + product_item ).animate( { opacity: 1 }, 500 ); add_to_cart_button.spin( false ).css( 'padding-left', '' ).removeAttr( 'disabled' ); }, 400 ); } ); } else { mobilestoreShowNotice( 'success', data.message ); add_to_cart_button.spin( false ).css( 'padding-left', '16px' ).removeAttr( 'disabled' ); } } else if ( data.wptouch_mobilestore_action == 'error' ) { mobilestoreShowNotice( 'fail', data.message ); add_to_cart_button.spin( false ).css( 'padding-left', '16px' ).removeAttr( 'disabled' ); } } ); }); } } // Mini-cart checkout button function mobilestoreMiniCartButtons(){ var edit_button = jQuery( '.button.edit_button' ); var checkout_button = jQuery( '.button.checkout_button' ); edit_button.on( 'click', function( e ) { window.location = jQuery( this ).attr( 'href' ); e.preventDefault(); }); checkout_button.on( 'click', function( e ){ checkout_url = jQuery( this ).attr( 'href' ); jQuery( this ).text( '' ).spin( { lines: 8, length: 1, width: 2, radius: 3, top: '-10px', left: '-2px' } ); setTimeout( function (){ window.location = checkout_url; }, 750 ); // in milliseconds e.preventDefault(); }); } // error message info when add to cart fails for some reason function mobilestoreShowNotice( state, message ) { var noticeEl = jQuery( '.notice' ); noticeEl.addClass( state ).html( message ).fadeIn( function() { setTimeout( function() { noticeEl.fadeOut(); }, 4000 ); }); } // Things to do only in Web App Mode function mobilestoreWebApp(){ if ( navigator.standalone ) { jQuery( 'body' ).prepend( '<span class="fixed-header-fill"></span>' ); } } // Magic to split the footer menu into 2 lists function mobilestoreSplitFooter(){ var num_cols = 2, container = jQuery( '.footer-menu ul' ), listItem = 'li', listClass = 'sub-list'; container.each( function() { var items_per_col = new Array(), items = jQuery( this ).find( listItem ), min_items_per_col = Math.floor( items.length / num_cols ), difference = items.length - ( min_items_per_col * num_cols ); for ( var i = 0; i < num_cols; i++ ) { if ( i < difference ) { items_per_col[i] = min_items_per_col + 1; } else { items_per_col[i] = min_items_per_col; } } for ( var i = 0; i < num_cols; i++ ) { jQuery( this ).append( jQuery( '<ul></ul>' ).addClass( listClass ) ); for ( var j = 0; j < items_per_col[i]; j++ ) { var pointer = 0; for ( var k = 0; k < i; k++ ) { pointer += items_per_col[k]; } jQuery( this ).find( '.' + listClass ).last().append( items[j + pointer] ); } } }); } // Move the footer below the switch function mobilestoreMoveFooterDiv(){ var poweredBy = jQuery( '.powered-by-msg' ); if ( poweredBy.is( 'div' ) ) { poweredBy.prepend( jQuery( '.wptouch-mobile-switch' ) ); } else { jQuery( '.footer' ).append( jQuery( '.wptouch-mobile-switch' ) ); } } // Custom serach capability (with recent searches) function mobilestoreHandleSearch(){ var recentSearch = jQuery( '.recent-searches' ); var recentSearchList = jQuery( 'ul', recentSearch ); var searchInput = jQuery( 'input#search-text' ); var searchTitle = searchInput.attr( 'title' ); recentSearches = JSON.parse( wptouchReadCookie( currentDomain + '-mobilestore-searches' ) ); if ( Array.isArray( recentSearches ) ) { var searchUrl = jQuery( '#searchform' ).attr( 'action' ); for ( var i = 0; i < recentSearches.length; i++ ) { newSearch = '<li><a href="' + searchUrl + '?s=' + recentSearches[ i ] + '&post_type=product">' + decodeURIComponent( recentSearches[ i ] ) + '</a></li>'; recentSearchList.append( newSearch ); } searchInput.on( 'focus', function(){ recentSearch.slideDown(); }).blur( function(){ jQuery( window ).one( 'scroll', function(){ recentSearch.animate( { height: 'toggle' }, 300 ); }); }); } recentSearch.on( 'click', 'h4 span', function(){ wptouchEraseCookie( currentDomain + '-mobilestore-searches' ); recentSearch.slideUp( 400 ); setTimeout( function(){ recentSearch.remove() }, 500 ); }); jQuery( '#searchform' ).submit( function( e ) { if ( !searchInput.val() ) { e.preventDefault(); } else { cookieVal = JSON.parse( wptouchReadCookie( currentDomain + '-mobilestore-searches' ) ); searchTerm = encodeURIComponent( searchInput.val() ); if ( !Array.isArray( cookieVal ) ) { cookieVal = new Array(); } if ( jQuery.inArray( searchTerm, cookieVal ) == -1 ) { cookieVal.unshift( searchTerm ); cookieVal = cookieVal.slice( 0, 5 ); wptouchCreateCookie( currentDomain + '-mobilestore-searches', JSON.stringify( cookieVal ), 90 ); } } }); } // Dynamic header text sizing to fit longer site titles function mobilestoreHandleHeaderText(){ var header = jQuery( '#header-area h1 span' ); jQuery( window ).load( function(){ header.bigText({ maximumFontSize: 26 }); }).on( 'resize', function(){ header.bigText({ maximumFontSize: 26 }); }); } function mobilestoreModifyQtyButtons(){ jQuery( '.summary .quantity .minus' ).parent().addClass( 'spinner' ); // Don't do buttons. Do links instead that we can happily intercept without WooCommerce events interfering. jQuery( 'input.plus' ).replaceWith( '<a class="button plus"><i class="wptouch-icon-plus"></i></a>' ); jQuery( 'input.minus' ).replaceWith( '<a class="button minus"><i class="wptouch-icon-minus"></i></a>' ); } // Modifications and enhancements to make a better mobile woo checkout function mobilestoreSetupCheckout() { // Most countries use numeric postal codes. Set the input appropriately with exceptions for countries with alphanumeric codes. function mobilestoreTogglePostalCodes( checkField, inputField ) { alphaNumerics = [ 'AR', 'BN', 'CA', 'MT', 'ND', 'NL', 'PE', 'SO', 'SZ', 'KR', 'GB', 'VE' ]; if ( alphaNumerics.indexOf( jQuery( checkField ).val() ) == -1 ) { jQuery( inputField ).attr( 'type', 'tel' ); } else { jQuery( inputField ).attr( 'type', 'text' ); } } if ( isCartPage ) { if ( !jQuery( 'body' ).hasClass('wc-2.2' ) ) { // WooCommerce 2.3 compatibility jQuery( 'div.quantity' ) .prepend( '<a class="button minus"><i class="wptouch-icon-minus"></i></button>') .append( '<a class="button plus"><i class="wptouch-icon-plus"></i></button>'); } // Fix cross-sell images jQuery( '.cross-sells' ).find( 'img' ).removeClass( 'aligncenter' ); jQuery( '#pay_with_amazon' ).remove(); var minuses = jQuery( '.minus' ); // WooCommerce outputs a 'remove' link to each cart item. Relocate it to allow us to swap with the minus control. jQuery( '.remove' ).each( function() { productQuantity = jQuery( this ).siblings( '.quantity' ); if ( productQuantity.is( 'div' ) ) { jQuery( this ).prependTo( productQuantity ).hide(); } }); // The minus control switches to remove when there's just one of the item in the cart. minuses.each( function() { qty = jQuery( this ).siblings( '.qty' ); if ( parseInt( qty.val() ) == 1 ) { jQuery( this ).addClass( 'delete' ).find( 'i' ).removeClass( 'wptouch-icon-minus' ).addClass( 'wptouch-icon-cancel' ); } }); // Make sure we see minus not remove after incrementing. jQuery( '.plus' ).click( function() { qty = jQuery( this ).siblings( '.qty' ); qty.val( parseInt( qty.val() ) + 1 ); linkURL = jQuery( this ).siblings( '.minus' ).removeClass( 'delete' ).find( 'i' ).addClass( 'wptouch-icon-minus' ).removeClass( 'wptouch-icon-cancel' ); }); // Decrement item counts when > 1, remove the item when count is 1. minuses.click( function( e ) { qty = jQuery( this ).siblings( '.qty' ); if ( qty.val() == 1 ) { e.stopImmediatePropagation(); e.preventDefault(); linkURL = jQuery( this ).siblings( '.remove' ).attr( 'href' ); jQuery( location ).attr( 'href', linkURL ); } else if ( qty.val() == 2 ) { jQuery( this ).addClass( 'delete' ).find( 'i' ).removeClass( 'wptouch-icon-minus' ).addClass( 'wptouch-icon-cancel' ); } qty.val( parseInt( qty.val() ) - 1 ); }); // Changed submit from <input> to <button>. But shipping calculator also submits the form. // Inject a hidden field with the correct proceed value to submit and head to checkout. jQuery( '#checkout_button' ).click( function( e ) { e.preventDefault(); jQuery( 'form.cart' ).append( '<input type="hidden" name="proceed" value="' + jQuery( this ).val() + '">' ).submit(); }); // If the site owner opted to use the select control for shipping, stage for CSS adjustments jQuery( 'select.shipping_method' ).parents( 'tr.shipping' ).addClass( 'select' ); } if ( isCheckoutPage ) { // Used for replacing optional elements with checkboxes and then removing them if option is enabled function mobilestoreRevealElement( e, targetElement ) { e.preventDefault(); targetElement.fadeIn(); jQuery( e.target ).remove(); } // Detect thank you page by checking for payment method display var customer_details = jQuery( '.customer_details' ); if ( customer_details.is( 'dl' ) ) { jQuery( 'body' ).addClass( 'woocommerce-thanks' ); customer_details.wrap( '<div id="customer_details"></div>' ).append( jQuery( '.addresses' ) ); } var amazon_wrapper = jQuery( '#pay_with_amazon' ); if ( amazon_wrapper.parent().is( 'div.woocommerce-info' ) ) { amazon_wrapper.parent().addClass( 'amazon-wrapper' ); } // Toggle the login area var login_toggle = jQuery( '.login-toggle' ); login_toggle.click( function( e ) { var startText = translated_strings.login_toggle_start; var closeText = '<i class="wptouch-icon-cancel-circled"></i>' + translated_strings.login_toggle_close; jQuery( 'form.login' ).slideToggle( 'fast', function(){ login_toggle.html( login_toggle.html() == closeText ? startText : closeText ); }); e.preventDefault(); }); // Add HTML5 input type email to billing and shipping email fields jQuery( 'input#billing_email, input#shipping_email' ).attr( 'type', 'email' ); // Move the billing field heading to the top of the form and stage for CSS. jQuery( '.woocommerce-billing-fields h3' ).prependTo( 'form[name=checkout]' ).attr( 'id', 'billing_fields_heading' ); // Swap the order of checkbox and label to meet best practices. jQuery( '#ship-to-different-address-checkbox' ).prependTo( '#ship-to-different-address' ); // Hide order comments and add control to reveal it. var comments_field = jQuery( '#order_comments_field' ); comments_field.hide().before( '<p class="form_row"><input type="checkbox" id="show_notes_field"> <label class="checkbox" for="show_notes_field">' + translated_strings.order_notes_link + '</label></p>' ); jQuery( '#show_notes_field' ).click( function( e ) { comments_field.toggle(); }); var payment_methods = jQuery( '.payment_methods' ); // When a payment method is selected, stage its parent for CSS. jQuery( 'input[checked]', payment_methods ).parent().addClass( 'active' ); // Toggle payment method detail display when selecting a method (WooCommerce uses the active class to show/hide). jQuery( 'body' ).on( 'click', '.payment_methods li', function( e ) { jQuery( 'li', jQuery( '.payment_methods' ) ).removeClass( 'active' ).children( 'div' ).css( 'display','none' ).end().children( 'input[type="radio"]' ).attr( 'checked', false ); jQuery( this ).addClass( 'active' ).children( 'div' ).css( 'display', 'block'); jQuery( this ).children( 'input[type="radio"]' ).attr( 'checked', true ); }); // If someone clicks the fake apply coupon button, move the coupon code to the real form and submit it. jQuery( '#order_review' ).on( 'click', '#mobilestore_apply_coupon', function( e ) { jQuery( '#coupon_code' ).val( jQuery( '#mobilestore_coupon' ).val() ); jQuery( '.mobilestore_checkout_coupon .coupon-button' ).click(); }); // Whenever AJAX requests finish – e.g., load, change shipping option, change country, etc. jQuery( document ).ajaxComplete( function() { // Configure numeric fields to use numeric keyboards jQuery( 'input[class*=number], input[class*=cvc], input[name*=phone]' ).attr( 'type', 'tel' ); mobilestoreTogglePostalCodes( '#billing_country', '#billing_postcode' ); mobilestoreTogglePostalCodes( '#shipping_country', '#shipping_postcode' ); // Fancy hide/show field labels won't work for selects. Rename their first options to read the same as the label. jQuery( '.woocommerce-checkout select' ).each( function() { if ( jQuery( this ).siblings( 'label' ).is( 'label' ) && ( jQuery( 'option', this ).first().text() == 'Select' || jQuery( 'option', this ).first().text() == '' ) ) { jQuery( 'option', this ).first().text( jQuery( this ).siblings( 'label' ).text() ); } }); // WooCommerce doesn't reliably configure label-field relationships which we need for the label show/hide. // Set them up (and add body-font for extra measure). jQuery( 'p.form-row input' ).each( function() { myId = jQuery( this ).attr( 'id' ); if ( !myId ) { myLabel = jQuery( this ).siblings( 'label' ); myLabel.addClass( 'body-font' ); myLabelTarget = myLabel.attr( 'for' ); jQuery( this ).attr( 'id', myLabelTarget ); } }); // Now apply our fancy hide/show labels with placeholder values. mobilestoreTransformLabels(); mobilestoreModifyCheckoutSelects(); jQuery( 'label img', '.payment_methods' ).each( function() { if( jQuery( this ).width() > 100 ) { jQuery( this ).prependTo( jQuery( this ).parent().siblings( '.payment_box' ) ); } }); // Stripe's label is very long. After applying our fancy hide/show labels, override the field's placeholder to be short. jQuery( '#stripe_card_csc, #authorize-net-cim-cc-cvv' ).attr( 'placeholder', translated_strings.cvc + ' *' ); // Icepay uses inline style and oddly positioned images. Correct. jQuery( 'li[class*="ICEPAY"]' ).each(function() { jQuery( this ).find( 'input, select' ).attr( 'style', '' ); jQuery( this ).find( 'img' ).appendTo( jQuery( this ).find( 'label' ) ); }); // Kill amazon checkout borders. jQuery( '.widget-container' ).find( 'iframe' ).css( 'border', 'none' ); }); } } function mobilestoreModifyCheckoutSelects(){ if ( isCartPage || isCheckoutPage || isAccountPage ) { var subject_fields = [ '#billing_country', '#shipping_country', '#billing_state', '#shipping_state' ]; for ( var i = 0; i < subject_fields.length; i++ ) { jQuery( subject_fields[ i ] ).siblings( 'i.wptouch-icon-arrow-combo' ).remove(); if ( jQuery( subject_fields[ i ] ).is( 'select' ) ) { jQuery( subject_fields[ i ] ).after( '<i class="wptouch-icon-arrow-combo"></i>' ); } } jQuery( 'select' ).change( function(){ mobilestoreModifyCheckoutSelects(); }); } } // Use placeholders instead of labels above form elements, and then reveal them when you intereact with the field function mobilestoreTransformLabels() { jQuery( 'label' ).each( function() { // e.preventDefault(); fieldTarget = jQuery( this ).attr( 'for' ); if ( typeof fieldTarget != 'undefined' ) { if ( fieldTarget.indexOf( '\%' ) != -1 ) { fieldTarget = fieldTarget.replace( /\%/g, '\\%' ); } var fieldName = jQuery( '#' + fieldTarget ).attr( 'name' ); if ( typeof fieldName == 'undefined' || fieldName.indexOf( 'attribute' ) == -1 ) { myTarget = jQuery( this ).attr( 'for' ); if ( jQuery( '#' + myTarget ).val() == '' ) { jQuery( this ).hide(); jQuery( '#' + myTarget ).addClass( 'label-hidden' ); } if ( !jQuery( '#' + myTarget ).is( 'select' ) ) { jQuery( '#' + myTarget ).attr( 'placeholder', jQuery( this ).text() ).keyup( function() { if ( jQuery( this ).val() != '' && jQuery( this ).hasClass( 'label-hidden' ) ) { jQuery( this ).removeClass( 'label-hidden' ).siblings( 'label' ).animate( { 'height': 'toggle' }, 400 ).css( 'display', 'block' ); } else if ( jQuery( this ).val() == '' ) { jQuery( this ).addClass( 'label-hidden' ); jQuery( this ).siblings( 'label' ).hide(); } }); } } } }); // Change the location of commentform labels to make them work with the above code^ jQuery( '#commentform label' ).each( function() { jQuery( this ).insertBefore( jQuery( this ).siblings( 'input' ) ); }); } function mobilestoreRatings(){ // Summary Rating Average var starDiv = jQuery( '.summary .star-rating' ); var starNumber = Math.round( jQuery( 'strong', starDiv ).text() ); starDiv.empty().text( 'Rating: ' ); // you can use empty() method for ( stars = 0; stars < starNumber; stars++ ) { starDiv.append('<i class="wptouch-icon-star"></i>'); } // Reviews var starRateDiv = jQuery( '.comment-text .star-rating span' ); starRateDiv.each( function(){ var starAmt = jQuery( 'strong', this ).text(); jQuery( this ).empty(); for ( stars = 0; stars < starAmt; stars++ ) { jQuery( this ).parent().append( '<i class="wptouch-icon-star"></i>' ); } }); var starsAnchors = jQuery( 'p.stars a' ); starsAnchors.on ( 'click', function(){ starsAnchors.removeClass( 'fill' ); jQuery( this ).prevAll( 'a' ).addClass( 'fill' ); }); } function mobileStoreWebAppBackButton(){ // If we're in Web-App-Mode if ( window.navigator.standalone ) { var startPosition = 0; var backButton = jQuery( '.back-button' ); if ( backButton.is( 'div' ) ) { jQuery( window ).scroll( function () { var newPosition = jQuery( this ).scrollTop(); if ( newPosition > startPosition ) { backButton.removeClass( 'visible' ); } else { if ( !backButton.hasClass( 'visible' ) ) { backButton.addClass( 'visible' ); } } startPosition = newPosition; }); } } } function mobilestoreSetScrollPos(){ page_wrapper.on( 'click', '#content ul.products a', function(){ scrollPos = jQuery( 'body' ).scrollTop(); jQuery.bbq.pushState( { scroll: scrollPos } ); }); } function mobileStoreSwitchLayout(){ if ( !wptouchReadCookie( currentDomain + '-mobilestore-layout' ) ) { if ( jQuery( 'body' ).hasClass( 'list-view' ) ) { wptouchCreateCookie( currentDomain + '-mobilestore-layout', 'vertical', 365 ); } else { wptouchCreateCookie( currentDomain + '-mobilestore-layout', 'masonry', 365 ); } } var layoutButtons = jQuery( '.layout-buttons' ); var container = jQuery( '.archive .products.main, .page .products.main, .single .products.main, .search .products.main' ); if ( wptouchReadCookie( currentDomain + '-mobilestore-layout' ) == 'vertical' ) { jQuery( 'i.layout-list', layoutButtons ).addClass( 'active' ); } else { jQuery( 'i.layout-masonry', layoutButtons ).addClass( 'active' ); } layoutButtons.on( 'click', 'i', function(){ jQuery( 'i', layoutButtons ).removeClass( 'active' ); jQuery( this ).addClass( 'active' ); if ( jQuery( this ).hasClass( 'layout-masonry' ) ) { jQuery( 'li', container ).removeClass( 'vertical' ); container.isotope({ layoutMode: 'masonry' }); wptouchCreateCookie( currentDomain + '-mobilestore-layout', 'masonry', 365 ); } else { jQuery( 'li', container ).addClass( 'vertical' ); container.isotope({ layoutMode: 'vertical' }); wptouchCreateCookie( currentDomain + '-mobilestore-layout', 'vertical', 365 ); } }); } function mobileStoreReplaceCachedMiniCart() { if ( jQuery( 'body' ).hasClass( 'infinity-cache-active' ) ) { jQuery( '#menu-right' ).load( '?wptouch_mobilestore_action=refresh_cart' ); } } function mobileStoreTabletChanges() { tabletPage = jQuery( 'body.tablet' ); tabletProductTop = jQuery( '.product-top ', tabletPage ); jQuery( 'h1', tabletProductTop ).prependTo('.summary'); jQuery( 'div[itemprop=offers]', tabletProductTop ).remove(); jQuery( '.summary', tabletPage ).insertBefore( tabletProductTop ); jQuery( '.summary', tabletPage ).css( 'min-height', tabletProductTop.height() ); } function mobilestoreOwlCarousel(){ if ( jQuery().owlCarousel ) { var use_rtl = false; if ( jQuery( 'body' ).hasClass( 'rtl' ) ) { use_rtl = true; } jQuery( '.product-carousel .carousel' ).owlCarousel({ rtl: use_rtl, dots: false, nav: false, items: 5, loop: false, margin: 10, stagePadding: 20, responsive: { 300: { items: 2 }, 340: { items: 3 }, 450: { items: 5 }, 900: { items: 7 } } }); jQuery( '.product-slider .carousel' ).owlCarousel({ rtl: use_rtl, nav: false, items: 1, loop: true, autoplay: true }); } } function mobilestoreReady() { mobilestoreHandleHeaderText(); mobilestoreLoadMore(); mobilestoreSetScrollPos(); mobilestoreIsotope(); mobileStoreSwitchLayout(); mobilestoreModifyQtyButtons(); mobilestoreSetupHammer(); mobilestoreHandleSearch(); mobilestoreHandleAddToCart(); mobilestoreMiniCartButtons(); mobileStoreReplaceCachedMiniCart(); mobilestoreProductSummaryArea(); mobilestoreRatings(); mobilestoreHandleWooVariationImages(); mobilestoreModifyCheckoutSelects(); mobilestoreTransformLabels(); mobilestoreSetupCheckout(); mobileStoreWebAppBackButton(); // mobileStoreTabletChanges(); mobilestoreWebApp(); mobilestoreOwlCarousel(); // Setup PushIt Menus jQuery( 'body' ).pushIt( { menuWidth: 270 } ); jQuery( '.back-to-top' ).appendTo( '.footer' ); mobilestoreSplitFooter(); mobilestoreMoveFooterDiv(); mobilestoreBindTappableLinks(); } jQuery( document ).ready( function() { mobilestoreReady(); });