diff --git a/dist/spa-apis.js b/dist/spa-apis.js index cb92cad..bf76478 100644 --- a/dist/spa-apis.js +++ b/dist/spa-apis.js @@ -1,7 +1,7 @@ /*! * SPA v2.0.5 * A webapp framework for routing control and view transitions - * Copyright 2016 zhaoda + * Copyright 2017 zhaoda * Licensed under MIT */ @@ -1519,13 +1519,13 @@ route.init.call($page, pageData) // 打开之前还原spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { $('.spa-scroll', $page).addClass('spa-scroll-touch') } } // 关闭之后清除spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { $('.spa-scroll', $curPage).removeClass('spa-scroll-touch') } @@ -1571,7 +1571,7 @@ !isBack && (pageData.prevAnimate = animate) // 打开之前还原spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { $('.spa-scroll', $page).addClass('spa-scroll-touch') } @@ -1740,7 +1740,7 @@ panelOptions.init.call($panel, panelData) // 打开之前还原spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { // 带有-webkit-overflow-scrolling: touch // 这个属性,如果去修改z-index,会偶现闪屏现象。 // 不如一帧以后再添加这个class @@ -1768,7 +1768,7 @@ panelData.prevAnimate = animate // 打开之前还原spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { $('.spa-scroll', $panel).addClass('spa-scroll-touch') } diff --git a/dist/spa-apis.min.js b/dist/spa-apis.min.js index 5b8d969..82e2945 100644 --- a/dist/spa-apis.min.js +++ b/dist/spa-apis.min.js @@ -1,8 +1,8 @@ /*! * SPA v2.0.5 * A webapp framework for routing control and view transitions - * Copyright 2016 zhaoda + * Copyright 2017 zhaoda * Licensed under MIT */ -!function(a){"use strict";function t(a){return a=a||T.href,a.replace(/^[^#]*#?\/?(.*)\/?$/,"$1")}function e(a){return"[object RegExp]"==Object.prototype.toString.call(a)}function n(a){return a=a.replace(M,"\\$&").replace(q,"(?:$1)?").replace(W,function(a,t){return t?a:"([^/]+)"}).replace(_,"(.*?)"),"^"+a+"$"}function i(t,e){var n=t.exec(e).slice(1),i=[];return a.each(n,function(a,t){t&&i.push(decodeURIComponent(t))}),i}function o(a,t){U[a.data("id")],U[t.data("id")];a.css({zIndex:$}),t.css({zIndex:z})}function s(t,e,n,i){var o=a(".spa-page-body",t),s=(a(".spa-page-body",e),{});!B&&(n="defaultInOut"),J[n]||(n="defaultInOut"),k&&(k=!1,n="defaultInOut"),s.opacity=1,!K(n)&&B&&(s[B]="translate(0, 0) scale(1, 1)"),o.css(s),G[n].apply(t,[t,e,i])}function r(a){a.stopPropagation(),a.preventDefault()}if(!a.os){var p={},l=navigator.userAgent,c=(navigator.platform,l.match(/(Android);?[\s\/]+([\d.]+)?/)),u=l.match(/(iPad).*OS\s([\d_]+)/),d=l.match(/(iPod)(.*OS\s([\d_]+))?/),g=!u&&l.match(/(iPhone\sOS)\s([\d_]+)/);c&&(p.android=!0,p.version=c[2]),g&&!d&&(p.ios=p.iphone=!0,p.version=g[2].replace(/_/g,".")),u&&(p.ios=p.ipad=!0,p.version=u[2].replace(/_/g,".")),d&&(p.ios=p.ipod=!0,p.version=d[3]?d[3].replace(/_/g,"."):null),a.os=p}var f,h,m,v,b,y=a(window),w=a(document),T=window.location,x=window.history,I=!1,P=!1,k=!0,D={},O={},C=[],A=2e3,$=2001,z=2002,R=0,F={},L={},E=[],U={},S="body {position: relative; margin: 0; padding: 0; width: 100%; overflow: hidden;} .spa-fullscreen {position: absolute; left: 0; top: 0; margin: 0; padding: 0; width: 100%; visibility: hidden; overflow: hidden; z-index: -1; } .spa-page {position: absolute; left: 0; top: 0; bottom: 0; right: 0; margin: 0; padding: 0; overflow: hidden; z-index: 2000; -webkit-transform: translateZ(0); -webkit-backface-visibility: hidden; -webkit-transform-style: preserve-3d;} .spa-page-bg {position: absolute; left: 0; top: 0; bottom: 0; right: 0; margin: 0; padding: 0; } .spa-page-body {position: absolute; left: 0; top: 0; bottom: 0; right: 0; margin: 0; padding: 0; overflow: hidden; -webkit-transform: translateZ(0); -webkit-backface-visibility: hidden; -webkit-transform-style: preserve-3d;} .spa-scroll {overflow: auto;} .spa-scroll-touch {-webkit-overflow-scrolling: touch; } .spa-scroll-x {overflow-y: hidden;} .spa-scroll-y {overflow-x: hidden;} .spa-cover {display: none; position: absolute; left: 0; right: 0; top: 0; bottom: 0; text-align: center; z-index: 5000; } .spa-loader {display: none; position: absolute; left: 0; right: 0; top: 0; bottom: 0; text-align: center; overflow: hidden; z-index: 5001; }",H='
',j=".spa-loader-animate {position: absolute; top: 50%; left: 50%;} .spa-loader-animate .bg {position: absolute; width: 64px; height: 64px; margin: 0 auto; top: -32px; left: -32px; border-radius: 50%; background: #2C3E50; opacity: 0.5;} .spa-loader-animate .ball {display: block; float: left; padding: 8px; margin-top: -8px; margin-left: -10px; -webkit-border-radius: 50%; -moz-border-radius: 50%; -ms-border-radius: 50%; -o-border-radius: 50%; border-radius: 50%;} .spa-loader-animate span:nth-child(2) {background: #16A085; -webkit-animation: move-left 800ms ease-in-out infinite alternate; -moz-animation: move-left 800ms ease-in-out infinite alternate; -ms-animation: move-left 800ms ease-in-out infinite alternate; -animation: move-left 800ms ease-in-out infinite alternate;} .spa-loader-animate .ball:nth-child(3) {background: #E67E22; -webkit-animation: move-right 800ms ease-in-out infinite alternate; -moz-animation: move-right 800ms ease-in-out infinite alternate; -ms-animation: move-right 800ms ease-in-out infinite alternate; animation: move-right 800ms ease-in-out infinite alternate;} @-webkit-keyframes move-left {to {-webkit-transform: translate(20px, 0); transform: translate(20px, 0); background: #e85932;}} @-webkit-keyframes move-right {to {-webkit-transform: translate(-20px, 0); transform: translate(-20px, 0); background: #44bbcc;}}";a.spa={},a.spa.getViewData=function(a){return U[a.data("id")]},a.spa.getCurPage=function(){return b},a.spa.version="2.0.5",w.on("spa:addstyle",function(t,e){a("head").append('")}),function(){var t,e,n,i,o=function(){n=Math.max(y.height(),window.innerHeight),i=Math.max(y.width(),window.innerWidth),m.css({height:2*n}),window.scrollTo(0,0),f.data("innerHeight",window.innerHeight),n=Math.max(y.height(),window.innerHeight),m.height()!=n&&(f.css({width:i,height:n}),m.css({width:i,height:n}))};y.on("spa:adjustfullscreen"+(a.os.ios?" orientationchange":""),function(a){void 0!==t&&(cancelAnimationFrame(t),t=void 0),t=requestAnimationFrame(o)}),a.os.android&&y.on("orientationchange",function(a){clearTimeout(e),e=setTimeout(o,500)}),y.on("resize",function(a){clearTimeout(e),e=setTimeout(o,200)})}(),w.on("spa:scroll",function(t,e){var n=a(t.target),i=e&&e.direction||"";n.addClass("spa-scroll"+(i?" spa-scroll-"+i:""))}),w.on("spa:removescroll",function(t,e){var n=a(t.target);n.removeClass("spa-scroll spa-scroll-x spa-scroll-y")}),a.os.ios&&w.on("touchstart",".spa-scroll, .spa-scroll-x, .spa-scroll-y",function(t){var e=a(t.currentTarget),n=e.prop("scrollTop"),i=e.prop("scrollLeft"),o=e.height(),s=e.width(),r=e.prop("scrollHeight"),p=e.prop("scrollWidth");(e.hasClass("spa-scroll")||e.hasClass("spa-scroll-x"))&&(i<=0&&e.prop("scrollLeft",1),i+s>=p&&e.prop("scrollLeft",p-s-1)),(e.hasClass("spa-scroll")||e.hasClass("spa-scroll-y"))&&(n<=0&&e.prop("scrollTop",1),n+o>=r&&e.prop("scrollTop",n-1))}),y.on("popstate",function(a){if(I){if(v&&"block"===v.css("display"))return!1;if(b&&b.hasClass("spa-panel")){var e=b.data("id"),n=U[e],i=n.prevPage;return i.trigger("spa:openpage"),!1}var o=t();if(!C.length||C[C.length-1]!==o){C.push(o);var s=F[o],r=a.state||{};if(h&&(r=h,h=void 0),s){var p=s.data("id"),l=U[p];l.oldpushData=l.pushData,l.pushData=r,s.trigger("spa:openpage")}else w.trigger("spa:createpage",{hash:o,pushData:r})}}});var q=/\((.*?)\)/g,W=/(\(\?)?:\w+/g,_=/\*\w+/g,M=/[\-{}\[\]+?.,\\\^$|#\s]/g,Z={route:"",animate:"",classname:"",view:function(){return{title:"",body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};w.on("spa:route",function(t,i){var o=Array.prototype.slice.call(arguments,1);if(o.length>1)return a.each(o,function(a,t){w.trigger("spa:route",t)}),!1;var s=i.route||"";e(s)||(s=n(s)),i.animate&&!a.isFunction(i.animate)&&K(i.animate)&&(i.animate=""),D[s]=a.extend({},Z,i)});var B,Q,V,G={},J={};!function(){var a,t={"-webkit-transition":["-webkit-transform","webkitTransitionEnd"],"-moz-transition":["-moz-transform","transitionend"],"-ms-transition":["-ms-transform","msTransitionEnd"],"-o-transition":["-o-transform","oTransitionEnd"],transition:["transform","transitionend"]},e=document.createElement("div");for(a in t)if(void 0!==e.style[a]){Q=a,B=t[a][0],V=t[a][1];break}}(),a.fn.emulateTransition=function(t,e){var n=a(this);return requestAnimationFrame(function(){n.get(0).offsetWidth,t[Q]="0.4s",n.css(t).emulateTransitionEndBySpa(function(){t={},t[Q]="",n.css(t),e&&e()})}),n},a.fn.transition||(a.fn.transition=a.fn.emulateTransition),a.fn.emulateTransitionEndBySpa=function(t,e){var n,i=!1,o=a(this);e=e||500,o.one(V,function(){i=!0,clearTimeout(n),t.call(o)});var s=function(){i||o.trigger(V)};return n=setTimeout(s,e),o},G.defaultInOut=function(a,t,e){o(t,a),e()},w.on("spa:addTransitPageAnimates",function(t,e){var n=[];a.each(e,function(a,t){n.push(a)}),a.each(n,function(a,t){a%2===0?J[t]=n[a+1]:J[t]=n[a-1]}),a.extend(G,e)}),w.trigger("spa:addTransitPageAnimates",{fadeIn:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),{opacity:0}),r={opacity:1};s.opacity=0,i.css(s),o(e,t),i.emulateTransition(r,function(){n()})},fadeOut:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s={opacity:0};i.emulateTransition(s,function(){o(e,t),n()})},slideInLeft:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),{}),r={};s[B]="translate(100%, 0)",r[B]="translate(0%, 0)",i.css(s),o(e,t),i.emulateTransition(r,function(){n()})},slideOutRight:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s={};s[B]="translate(100%, 0)",i.emulateTransition(s,function(){o(e,t),n()})},slideInRight:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),{}),r={};s[B]="translate(-100%, 0)",r[B]="translate(0%, 0)",i.css(s),o(e,t),i.emulateTransition(r,function(){n()})},slideOutLeft:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s={};s[B]="translate(-100%, 0)",i.emulateTransition(s,function(){o(e,t),n()})},slideInUp:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),{}),r={};s[B]="translate(0, 100%)",r[B]="translate(0, 0%)",i.css(s),o(e,t),i.emulateTransition(r,function(){n()})},slideOutDown:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s={};s[B]="translate(0, 100%)",i.emulateTransition(s,function(){o(e,t),n()})},slideInDown:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),{}),r={};s[B]="translate(0, -100%)",r[B]="translate(0, 0%)",i.css(s),o(e,t),i.emulateTransition(r,function(){n()})},slideOutUp:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s={};s[B]="translate(0, -100%)",i.emulateTransition(s,function(){o(e,t),n()})},pushInLeft:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(100%, 0)",l[B]="translate(0%, 0)",c[B]="translate(-100%, 0)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushOutRight:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(-100%, 0)",l[B]="translate(0%, 0)",c[B]="translate(100%, 0)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushInRight:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(-100%, 0)",l[B]="translate(0%, 0)",c[B]="translate(100%, 0)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushOutLeft:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(100%, 0)",l[B]="translate(0%, 0)",c[B]="translate(-100%, 0)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushInUp:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(0, 100%)",l[B]="translate(0%, 0)",c[B]="translate(0, -100%)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushOutDown:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(0, -100%)",l[B]="translate(0%, 0)",c[B]="translate(0, 100%)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushInDown:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(0, -100%)",l[B]="translate(0%, 0)",c[B]="translate(0, 100%)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushOutUp:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(0, 100%)",l[B]="translate(0%, 0)",c[B]="translate(0, -100%)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},zoomIn:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),{}),r={};s[B]="scale(0, 0)",r[B]="scale(1, 1)",i.css(s),o(e,t),i.emulateTransition(r,function(){n()})},zoomOut:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s={};s[B]="scale(0, 0)",i.emulateTransition(s,function(){o(e,t),n()})},overlayInLeft:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),i.children().width()),r={left:"auto",width:s},p={};p[B]="translate(0px, 0)",i.css(r),s=2*s-i.prop("clientWidth"),r={width:s},r[B]="translate("+s+"px, 0)",i.css(r),o(e,t),i.emulateTransition(p,function(){n()})},overlayOutRight:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s=i.width(),r={},p={width:"auto",left:0};r[B]="translate("+s+"px, 0)",i.emulateTransition(r,function(){o(e,t),i.css(p),n()})},overlayInRight:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),i.children().width()),r={right:"auto",width:s},p={};p[B]="translate(0px, 0)",i.css(r),s=2*s-i.prop("clientWidth"),r={width:s},r[B]="translate("+(0-s)+"px, 0)",i.css(r),o(e,t),i.emulateTransition(p,function(){n()})},overlayOutLeft:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s=i.width(),r={},p={width:"auto",right:0};r[B]="translate("+(0-s)+"px, 0)",i.emulateTransition(r,function(){o(e,t),i.css(p),n()})},overlayInUp:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),i.children().height()),r={top:"auto",height:s},p={};p[B]="translate(0, 0px)",i.css(r),s=2*s-i.prop("clientHeight"),r={height:s},r[B]="translate(0, "+s+"px)",i.css(r),o(e,t),i.emulateTransition(p,function(){n()})},overlayOutDown:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s=i.height(),r={},p={height:"auto",top:0};r[B]="translate(0, "+s+"px)",i.emulateTransition(r,function(){o(e,t),i.css(p),n()})},overlayInDown:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),i.children().height()),r={bottom:"auto",height:s},p={};p[B]="translate(0, 0px)",i.css(r),s=2*s-i.prop("clientHeight"),r={height:s},r[B]="translate(0, "+(0-s)+"px)",i.css(r),o(e,t),i.emulateTransition(p,function(){n()})},overlayOutUp:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s=i.height(),r={},p={height:"auto",bottom:0};r[B]="translate(0, "+(0-s)+"px)",i.emulateTransition(r,function(){o(e,t),i.css(p),n()})},revealInLeft:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().width(),p={left:"auto",width:r},l={};p[B]="translate(0, 0)",i.css(p),r=2*i.width()-i.prop("clientWidth"),i.css({width:r}),l[B]="translate("+(0-r)+"px, 0)",o(t,e),s.emulateTransition(l,function(){o(e,t),n()})},revealOutRight:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=(s.width(),{});r[B]="translate(0px, 0)",o(e,t),i.emulateTransition(r,function(){s.css({width:"auto",left:0}),n()})},revealInRight:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().width(),p={right:"auto",width:r},l={};p[B]="translate(0, 0)",i.css(p),r=2*i.width()-i.prop("clientWidth"),i.css({width:r}),l[B]="translate("+r+"px, 0)",o(t,e),s.emulateTransition(l,function(){o(e,t),n()})},revealOutLeft:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=(s.width(),{});r[B]="translate(0px, 0)",o(e,t),i.emulateTransition(r,function(){s.css({width:"auto",right:0}),n()})},revealInUp:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().height(),p={top:"auto",height:r},l={};p[B]="translate(0, 0)",i.css(p),r=2*i.height()-i.prop("clientHeight"),i.css({height:r}),l[B]="translate(0, "+(0-r)+"px)",o(t,e),s.emulateTransition(l,function(){o(e,t),n()})},revealOutDown:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=(s.height(),{});r[B]="translate(0, 0px)",o(e,t),i.emulateTransition(r,function(){s.css({height:"auto",top:0}),n()})},revealInDown:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().height(),p={bottom:"auto",height:r},l={};p[B]="translate(0, 0)",i.css(p),r=2*i.height()-i.prop("clientHeight"),i.css({height:r}),l[B]="translate(0, "+r+"px)",o(t,e),s.emulateTransition(l,function(){o(e,t),n()})},revealOutUp:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=(s.height(),{});r[B]="translate(0, 0px)",o(e,t),i.emulateTransition(r,function(){s.css({height:"auto",bottom:0}),n()})},pushPartInLeft:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().width(),p=0,l={left:"auto",width:r},c={},u={};i.css(l),r=2*i.width()-i.prop("clientWidth"),l={width:r},l[B]="translate("+r+"px, 0)",c[B]="translate(0px, 0)",u[B]="translate("+(0-r)+"px, 0)",i.css(l),o(e,t),i.emulateTransition(c,function(){2==++p&&n()}),s.emulateTransition(u,function(){2==++p&&n()})},pushPartOutRight:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=s.width(),p=0,l={},c={},u={width:"auto",left:0};l[B]="translate(0px, 0)",c[B]="translate("+r+"px, 0)",o(e,t),i.emulateTransition(l,function(){2==++p&&n()}),s.emulateTransition(c,function(){s.css(u),2==++p&&n()})},pushPartInRight:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().width(),p=0,l={right:"auto",width:r},c={},u={};i.css(l),r=2*i.width()-i.prop("clientWidth"),l={width:r},l[B]="translate("+(0-r)+"px, 0)",u[B]="translate("+r+"px, 0)",c[B]="translate(0px, 0)",i.css(l),o(e,t),i.emulateTransition(c,function(){2==++p&&n()}),s.emulateTransition(u,function(){2==++p&&n()})},pushPartOutLeft:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=s.width(),p=0,l={},c={},u={width:"auto",right:0};l[B]="translate(0px, 0)",c[B]="translate("+(0-r)+"px, 0)",o(e,t),i.emulateTransition(l,function(){2==++p&&n()}),s.emulateTransition(c,function(){s.css(u),2==++p&&n()})},pushPartInUp:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().height(),p=0,l={top:"auto",height:r},c={},u={};i.css(l),r=2*i.height()-i.prop("clientHeight"),l={height:r},l[B]="translate(0, "+r+"px)",c[B]="translate(0, 0px)",u[B]="translate(0, "+(0-r)+"px)",i.css(l),o(e,t),i.emulateTransition(c,function(){2==++p&&n()}),s.emulateTransition(u,function(){2==++p&&n()})},pushPartOutDown:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=s.height(),p=0,l={},c={},u={height:"auto",top:0};l[B]="translate(0, 0px)",c[B]="translate(0, "+r+"px)",o(e,t),i.emulateTransition(l,function(){2==++p&&n()}),s.emulateTransition(c,function(){s.css(u),2==++p&&n()})},pushPartInDown:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().height(),p=0,l={bottom:"auto",height:r},c={},u={};i.css(l),r=2*i.height()-i.prop("clientHeight"),l={height:r},l[B]="translate(0, "+(0-r)+"px)",c[B]="translate(0, 0px)",u[B]="translate(0, "+r+"px)",i.css(l),o(e,t),i.emulateTransition(c,function(){2==++p&&n()}),s.emulateTransition(u,function(){2==++p&&n()})},pushPartOutUp:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=s.height(),p=0,l={},c={},u={height:"auto",bottom:0};l[B]="translate(0, 0px)",c[B]="translate(0, "+(0-r)+"px)",o(e,t),i.emulateTransition(l,function(){2==++p&&n()}),s.emulateTransition(c,function(){s.css(u),2==++p&&n()})}});var K=function(){var a=/^(overlay|reveal|pushPart).*$/;return function(t){return a.test(t)}}(),N=function(){var a=0;return function(){return a++}}();w.on("spa:createpage",function(t,n){w.trigger("spa:openloader");var o,s,r,p=n.hash,l=n.pushData;if(a.each(D,function(a,t){return s=new RegExp(a),s.test(p)?(o=a,r=t,!1):void(s=!1)}),e(s)){var c,u,d=(r.classname?" spa-page-"+r.classname:"")+(r.nocache?" no-cache":""),g=a('
'),f=N();g.data("id",f),c={id:f,hash:p,pushData:l,requestData:i(s,p),route:o,el:g},U[f]=c,!r.nocache&&w.trigger("spa:viewcache",{view:g}),u=r.view.call(g,c),a.isPlainObject(u)&&w.trigger("spa:initpage",[g,u])}}),w.on("spa:initpage",function(t,e,n){var i=e.data("id"),o=U[i],s=D[o.route];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,t){n[t]&&(s[t]=n[t])}),o.viewData=n,w.trigger("spa:closeloader"),a(".spa-page-body",e).html(n.body),f.append(e),e.trigger("spa:openpage")}),w.on("spa:openpage",".spa-page",function(e,n){var i=a(e.currentTarget),o=i.data("id"),r=U[o],p=D[r.route],l=r.hash,c=r.pushData,u=(r.oldpushData,r.requestData,r.viewData),d=c.title||u.title,g=!1,h=c.animate||p.animate;b||(f.append('
'),b=a(".spa-page-empty"));var m=b.data("id"),v=U[m]||{};if(!c.animate&&v.prevPage&&v.prevPage.data("id")===o){var T=v.prevAnimate;T&&!a.isFunction(T)&&(h=J[T]),g=!0}var x,I;if(b.hasClass("spa-panel")){var k=O[b.data("id")];x=k.beforeclose,I=k.afterclose}else if(v.route){var C=D[v.route];x=C.beforeclose,I=C.afterclose,w.trigger("spa:navigate",{hash:l,title:d,pushData:c,replace:!0})}var z=function(){i.data("spa:init")||(i.data("spa:init",!0),p.init.call(i,r),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",i).addClass("spa-scroll-touch")),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",b).removeClass("spa-scroll-touch"),I&&I.call(b,v),b.hasClass("no-cache")&&b.remove(),b.hasClass("spa-panel")?(b.css({zIndex:A}),r.prevPage&&r.prevPage.css({zIndex:$})):g||(r.prevPage=b),p.afteropen.call(i,r),b=i,r.hash!==t()?(P=!1,y.trigger("popstate")):(a.isFunction(n)&&n.call(i),P=!1)};x&&x.call(b,v),p.beforeopen.call(i,r),!g&&(r.prevAnimate=h),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",i).addClass("spa-scroll-touch"),g||v.prevPage&&v.prevPage.css({zIndex:A}),a.isFunction(h)?h(i,b,z):s(i,b,h,z),w.trigger("spa:viewcachesort",{view:i})});var X={id:"",animate:"",classname:"",view:function(){return{body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};w.on("spa:panel",function(t,e){var n=Array.prototype.slice.call(arguments,1);return n.length>1?(a.each(n,function(a,t){w.trigger("spa:panel",t)}),!1):void(e.id&&!O[e.id]&&(O[e.id]=a.extend({},X,e)))}),w.on("spa:createpanel",function(t,e,n){var i=O[e];if(i){w.trigger("spa:openloader");var o,s,r=i.classname?" spa-panel-"+i.classname:"",p=a('
');p.data("id",e),o={id:e,pushData:n,el:p},U[e]=o,w.trigger("spa:viewcache",{view:p}),s=i.view.call(p,o),a.isPlainObject(s)&&w.trigger("spa:initpanel",[p,s])}}),w.on("spa:initpanel",function(t,e,n){var i=e.data("id"),o=U[i],s=o.pushData,r=O[i];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,t){n[t]&&(r[t]=n[t])}),o.viewData=n,a(".spa-page-body",e).html(n.body),f.append(e),w.trigger("spa:closeloader"),e.trigger("spa:openpanel",[i,s])}),w.on("spa:openpanel",function(t,e,n){if(v&&"block"===v.css("display"))return!1;var i=L[e];if(n||(n={}),i){if(P)return!1;P=!0;var o=O[e],r=n.animate||o.animate;if(b.hasClass("spa-panel")){var p=U[b.data("id")].prevPage;return p.trigger("spa:openpage",[function(){w.trigger("spa:openpanel",[e,n])}]),!1}var l=U[e];l.oldpushData=l.pushData,l.pushData=n,o.beforeopen.call(i,l);var c=function(){i.data("spa:init")||(i.data("spa:init",!0),o.init.call(i,l),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&setTimeout(function(){a(".spa-scroll",i).addClass("spa-scroll-touch")},17)),i.data("closing",!1),l.prevPage=b,o.afteropen.call(i,l),b=i,P=!1};l.prevAnimate=r,a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",i).addClass("spa-scroll-touch");var u=b.data("id"),d=U[u]||{};d.prevPage&&d.prevPage.css({zIndex:A}),a.isFunction(r)?r(i,b,c):s(i,b,r,c),w.trigger("spa:viewcachesort",{view:i})}else w.trigger("spa:createpanel",[e,n])}),w.on("spa:closepanel",function(t,e){var n=a(t.target),i=n.data("id"),o=U[i];if(e&&e.id&&(n=a(".spa-panel-"+e.id)),!n.data("closing")&&(n.data("closing",!0),b.hasClass("spa-panel")&&b.data("id")===i)){var s=o.prevPage;s.trigger("spa:openpage")}}),w.on("click touchstart",".spa-panel",function(t){var e=a(t.currentTarget),n=a(t.target);(n.hasClass("spa-page-bg")||n.hasClass("spa-panel"))&&(t.stopPropagation(),t.preventDefault(),e.trigger("spa:closepanel"))}),w.on("spa:viewcachecount",function(a,t){t.count=1===t.count?2:t.count,R=t.count}),w.on("spa:viewcache",function(t,e){var n,i,o=e.view,s=o.data("id");if(o.hasClass("spa-panel")?(n="panel",i=s,L[i]=o):(n="page",i=U[s].hash,F[i]=o),E.unshift(n+":"+encodeURIComponent(i)),0!==R&&E.length>R){var r,p,l,c,u=E.splice(R);a.each(u,function(t,e){r=e.split(":",2),p=r[0],l=decodeURIComponent(r[1]),c="page"==p?F:L,a("img",c[l]).remove(),c[l].html("").remove(),delete c[l]})}}),w.on("spa:viewcachesort",function(a,t){var e,n,i,o,s=t.view,r=s.data("id");s.hasClass("spa-panel")?(e="panel",n=r):(e="page",n=U[r].hash),i=e+":"+encodeURIComponent(n),o=E.indexOf(i),o!==-1&&(E.splice(o,1),E.unshift(i))}),w.on("spa:navigate",function(t,e){var n=e.hash||"",i=e.title||"",o=e.pushData||{},s=e.replace||!1,r=e.url||"";if(i&&(document.title=i),n=r+"#"+n,s)x.replaceState(o,i,n);else{if(!b.hasClass("spa-panel")&&C.length&&"#"+C[C.length-1]===n)return;if(P)return!1;P=!0,x.pushState(o,i,n),!a.isEmptyObject(o)&&(h=o),y.trigger("popstate")}}),w.on("spa:loader",function(a,t){t.body&&(H=t.body),t.style&&(j=t.style)});var Y;w.on("spa:openloader",function(a){Y=setTimeout(function(){Y=void 0,v.show()},300)}),w.on("spa:closeloader",function(a){Y?(clearTimeout(Y),Y=void 0):v.hide()}),w.on("spa:boot",function(t,e){f=a("body"),w.trigger("spa:addstyle",S+j),f.append('
'+H+"
"),m=a(".spa-fullscreen"),w.trigger("spa:adjustfullscreen"),v=a(".spa-loader"),v.on("click select mousedown mousemove mouseup touchstart touchmove touchend",r),I=!0,y.trigger("popstate"),e&&e.callback&&e.callback()})}(window.Zepto||window.jQuery||window.$),function(){"use strict";for(var a=0,t=["ms","moz","webkit","o"],e=0;e'+c+"")}),function(){var b,c,d,e,f=function(){d=Math.max(t.height(),window.innerHeight),e=Math.max(t.width(),window.innerWidth),q.css({height:2*d}),window.scrollTo(0,0),o.data("innerHeight",window.innerHeight),d=Math.max(t.height(),window.innerHeight),q.height()!=d&&(o.css({width:e,height:d}),q.css({width:e,height:d}))};t.on("spa:adjustfullscreen"+(a.os.ios?" orientationchange":""),function(a){void 0!==b&&(cancelAnimationFrame(b),b=void 0),b=requestAnimationFrame(f)}),a.os.android&&t.on("orientationchange",function(a){clearTimeout(c),c=setTimeout(f,500)}),t.on("resize",function(a){clearTimeout(c),c=setTimeout(f,200)})}(),u.on("spa:scroll",function(b,c){var d=a(b.target),e=c&&c.direction||"";d.addClass("spa-scroll"+(e?" spa-scroll-"+e:""))}),u.on("spa:removescroll",function(b,c){var d=a(b.target);d.removeClass("spa-scroll spa-scroll-x spa-scroll-y")}),a.os.ios&&u.on("touchstart",".spa-scroll, .spa-scroll-x, .spa-scroll-y",function(b){var c=a(b.currentTarget),d=c.prop("scrollTop"),e=c.prop("scrollLeft"),f=c.height(),g=c.width(),h=c.prop("scrollHeight"),i=c.prop("scrollWidth");(c.hasClass("spa-scroll")||c.hasClass("spa-scroll-x"))&&(e<=0&&c.prop("scrollLeft",1),e+g>=i&&c.prop("scrollLeft",i-g-1)),(c.hasClass("spa-scroll")||c.hasClass("spa-scroll-y"))&&(d<=0&&c.prop("scrollTop",1),d+f>=h&&c.prop("scrollTop",d-1))}),t.on("popstate",function(a){if(x){if(r&&"block"===r.css("display"))return!1;if(s&&s.hasClass("spa-panel")){var c=s.data("id"),d=K[c],e=d.prevPage;return e.trigger("spa:openpage"),!1}var f=b();if(!C.length||C[C.length-1]!==f){C.push(f);var g=H[f],h=a.state||{};if(p&&(h=p,p=void 0),g){var i=g.data("id"),j=K[i];j.oldpushData=j.pushData,j.pushData=h,g.trigger("spa:openpage")}else u.trigger("spa:createpage",{hash:f,pushData:h})}}});var O=/\((.*?)\)/g,P=/(\(\?)?:\w+/g,Q=/\*\w+/g,R=/[\-{}\[\]+?.,\\\^$|#\s]/g,S={route:"",animate:"",classname:"",view:function(){return{title:"",body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};u.on("spa:route",function(b,e){var f=Array.prototype.slice.call(arguments,1);if(f.length>1)return a.each(f,function(a,b){u.trigger("spa:route",b)}),!1;var g=e.route||"";c(g)||(g=d(g)),e.animate&&!a.isFunction(e.animate)&&Y(e.animate)&&(e.animate=""),A[g]=a.extend({},S,e)});var T,U,V,W={},X={};!function(){var a,b={"-webkit-transition":["-webkit-transform","webkitTransitionEnd"],"-moz-transition":["-moz-transform","transitionend"],"-ms-transition":["-ms-transform","msTransitionEnd"],"-o-transition":["-o-transform","oTransitionEnd"],transition:["transform","transitionend"]},c=document.createElement("div");for(a in b)if(void 0!==c.style[a]){U=a,T=b[a][0],V=b[a][1];break}}(),a.fn.emulateTransition=function(b,c){var d=a(this);return requestAnimationFrame(function(){d.get(0).offsetWidth,b[U]="0.4s",d.css(b).emulateTransitionEndBySpa(function(){b={},b[U]="",d.css(b),c&&c()})}),d},a.fn.transition||(a.fn.transition=a.fn.emulateTransition),a.fn.emulateTransitionEndBySpa=function(b,c){var d,e=!1,f=a(this);c=c||500,f.one(V,function(){e=!0,clearTimeout(d),b.call(f)});var g=function(){e||f.trigger(V)};return d=setTimeout(g,c),f},W.defaultInOut=function(a,b,c){f(b,a),c()},u.on("spa:addTransitPageAnimates",function(b,c){var d=[];a.each(c,function(a,b){d.push(a)}),a.each(d,function(a,b){a%2===0?X[b]=d[a+1]:X[b]=d[a-1]}),a.extend(W,c)}),u.trigger("spa:addTransitPageAnimates",{fadeIn:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{opacity:0}),h={opacity:1};g.opacity=0,e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},fadeOut:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={opacity:0};e.emulateTransition(g,function(){f(c,b),d()})},slideInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(100%, 0)",h[T]="translate(0%, 0)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutRight:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(100%, 0)",e.emulateTransition(g,function(){f(c,b),d()})},slideInRight:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(-100%, 0)",h[T]="translate(0%, 0)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutLeft:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(-100%, 0)",e.emulateTransition(g,function(){f(c,b),d()})},slideInUp:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(0, 100%)",h[T]="translate(0, 0%)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutDown:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(0, 100%)",e.emulateTransition(g,function(){f(c,b),d()})},slideInDown:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(0, -100%)",h[T]="translate(0, 0%)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutUp:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(0, -100%)",e.emulateTransition(g,function(){f(c,b),d()})},pushInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(-100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(-100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(-100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(-100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, 100%)",j[T]="translate(0%, 0)",k[T]="translate(0, -100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, -100%)",j[T]="translate(0%, 0)",k[T]="translate(0, 100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, -100%)",j[T]="translate(0%, 0)",k[T]="translate(0, 100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, 100%)",j[T]="translate(0%, 0)",k[T]="translate(0, -100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},zoomIn:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="scale(0, 0)",h[T]="scale(1, 1)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},zoomOut:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="scale(0, 0)",e.emulateTransition(g,function(){f(c,b),d()})},overlayInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().width()),h={left:"auto",width:g},i={};i[T]="translate(0px, 0)",e.css(h),g=2*g-e.prop("clientWidth"),h={width:g},h[T]="translate("+g+"px, 0)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutRight:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.width(),h={},i={width:"auto",left:0};h[T]="translate("+g+"px, 0)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInRight:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().width()),h={right:"auto",width:g},i={};i[T]="translate(0px, 0)",e.css(h),g=2*g-e.prop("clientWidth"),h={width:g},h[T]="translate("+(0-g)+"px, 0)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutLeft:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.width(),h={},i={width:"auto",right:0};h[T]="translate("+(0-g)+"px, 0)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInUp:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().height()),h={top:"auto",height:g},i={};i[T]="translate(0, 0px)",e.css(h),g=2*g-e.prop("clientHeight"),h={height:g},h[T]="translate(0, "+g+"px)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutDown:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.height(),h={},i={height:"auto",top:0};h[T]="translate(0, "+g+"px)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInDown:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().height()),h={bottom:"auto",height:g},i={};i[T]="translate(0, 0px)",e.css(h),g=2*g-e.prop("clientHeight"),h={height:g},h[T]="translate(0, "+(0-g)+"px)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutUp:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.height(),h={},i={height:"auto",bottom:0};h[T]="translate(0, "+(0-g)+"px)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},revealInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i={left:"auto",width:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.width()-e.prop("clientWidth"),e.css({width:h}),j[T]="translate("+(0-h)+"px, 0)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.width(),{});h[T]="translate(0px, 0)",f(c,b),e.emulateTransition(h,function(){g.css({width:"auto",left:0}),d()})},revealInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i={right:"auto",width:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.width()-e.prop("clientWidth"),e.css({width:h}),j[T]="translate("+h+"px, 0)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.width(),{});h[T]="translate(0px, 0)",f(c,b),e.emulateTransition(h,function(){g.css({width:"auto",right:0}),d()})},revealInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i={top:"auto",height:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.height()-e.prop("clientHeight"),e.css({height:h}),j[T]="translate(0, "+(0-h)+"px)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.height(),{});h[T]="translate(0, 0px)",f(c,b),e.emulateTransition(h,function(){g.css({height:"auto",top:0}),d()})},revealInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i={bottom:"auto",height:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.height()-e.prop("clientHeight"),e.css({height:h}),j[T]="translate(0, "+h+"px)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.height(),{});h[T]="translate(0, 0px)",f(c,b),e.emulateTransition(h,function(){g.css({height:"auto",bottom:0}),d()})},pushPartInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i=0,j={left:"auto",width:h},k={},l={};e.css(j),h=2*e.width()-e.prop("clientWidth"),j={width:h},j[T]="translate("+h+"px, 0)",k[T]="translate(0px, 0)",l[T]="translate("+(0-h)+"px, 0)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.width(),i=0,j={},k={},l={width:"auto",left:0};j[T]="translate(0px, 0)",k[T]="translate("+h+"px, 0)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i=0,j={right:"auto",width:h},k={},l={};e.css(j),h=2*e.width()-e.prop("clientWidth"),j={width:h},j[T]="translate("+(0-h)+"px, 0)",l[T]="translate("+h+"px, 0)",k[T]="translate(0px, 0)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.width(),i=0,j={},k={},l={width:"auto",right:0};j[T]="translate(0px, 0)",k[T]="translate("+(0-h)+"px, 0)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i=0,j={top:"auto",height:h},k={},l={};e.css(j),h=2*e.height()-e.prop("clientHeight"),j={height:h},j[T]="translate(0, "+h+"px)",k[T]="translate(0, 0px)",l[T]="translate(0, "+(0-h)+"px)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.height(),i=0,j={},k={},l={height:"auto",top:0};j[T]="translate(0, 0px)",k[T]="translate(0, "+h+"px)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i=0,j={bottom:"auto",height:h},k={},l={};e.css(j),h=2*e.height()-e.prop("clientHeight"),j={height:h},j[T]="translate(0, "+(0-h)+"px)",k[T]="translate(0, 0px)",l[T]="translate(0, "+h+"px)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.height(),i=0,j={},k={},l={height:"auto",bottom:0};j[T]="translate(0, 0px)",k[T]="translate(0, "+(0-h)+"px)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})}});var Y=function(){var a=/^(overlay|reveal|pushPart).*$/;return function(b){return a.test(b)}}(),Z=function(){var a=0;return function(){return a++}}();u.on("spa:createpage",function(b,d){u.trigger("spa:openloader");var f,g,h,i=d.hash,j=d.pushData;if(a.each(A,function(a,b){return g=new RegExp(a),g.test(i)?(f=a,h=b,!1):void(g=!1)}),c(g)){var k,l,m=(h.classname?" spa-page-"+h.classname:"")+(h.nocache?" no-cache":""),n=a('
'),o=Z();n.data("id",o),k={id:o,hash:i,pushData:j,requestData:e(g,i),route:f,el:n},K[o]=k,!h.nocache&&u.trigger("spa:viewcache",{view:n}),l=h.view.call(n,k),a.isPlainObject(l)&&u.trigger("spa:initpage",[n,l])}}),u.on("spa:initpage",function(b,c,d){var e=c.data("id"),f=K[e],g=A[f.route];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,b){d[b]&&(g[b]=d[b])}),f.viewData=d,u.trigger("spa:closeloader"),a(".spa-page-body",c).html(d.body),o.append(c),c.trigger("spa:openpage")}),u.on("spa:openpage",".spa-page",function(c,d){var e=a(c.currentTarget),f=e.data("id"),h=K[f],i=A[h.route],j=h.hash,k=h.pushData,l=(h.oldpushData,h.requestData,h.viewData),m=k.title||l.title,n=!1,p=k.animate||i.animate;s||(o.append('
'),s=a(".spa-page-empty"));var q=s.data("id"),r=K[q]||{};if(!k.animate&&r.prevPage&&r.prevPage.data("id")===f){var v=r.prevAnimate;v&&!a.isFunction(v)&&(p=X[v]),n=!0}var w,x;if(s.hasClass("spa-panel")){var z=B[s.data("id")];w=z.beforeclose,x=z.afterclose}else if(r.route){var C=A[r.route];w=C.beforeclose,x=C.afterclose,u.trigger("spa:navigate",{hash:j,title:m,pushData:k,replace:!0})}var F=function(){e.data("spa:init")||(e.data("spa:init",!0),i.init.call(e,h),a.os.ios&&a(".spa-scroll",e).addClass("spa-scroll-touch")),a.os.ios&&a(".spa-scroll",s).removeClass("spa-scroll-touch"),x&&x.call(s,r),s.hasClass("no-cache")&&s.remove(),s.hasClass("spa-panel")?(s.css({zIndex:D}),h.prevPage&&h.prevPage.css({zIndex:E})):n||(h.prevPage=s),i.afteropen.call(e,h),s=e,h.hash!==b()?(y=!1,t.trigger("popstate")):(a.isFunction(d)&&d.call(e),y=!1)};w&&w.call(s,r),i.beforeopen.call(e,h),!n&&(h.prevAnimate=p),a.os.ios&&a(".spa-scroll",e).addClass("spa-scroll-touch"),n||r.prevPage&&r.prevPage.css({zIndex:D}),a.isFunction(p)?p(e,s,F):g(e,s,p,F),u.trigger("spa:viewcachesort",{view:e})});var $={id:"",animate:"",classname:"",view:function(){return{body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};u.on("spa:panel",function(b,c){var d=Array.prototype.slice.call(arguments,1);return d.length>1?(a.each(d,function(a,b){u.trigger("spa:panel",b)}),!1):void(c.id&&!B[c.id]&&(B[c.id]=a.extend({},$,c)))}),u.on("spa:createpanel",function(b,c,d){var e=B[c];if(e){u.trigger("spa:openloader");var f,g,h=e.classname?" spa-panel-"+e.classname:"",i=a('
');i.data("id",c),f={id:c,pushData:d,el:i},K[c]=f,u.trigger("spa:viewcache",{view:i}),g=e.view.call(i,f),a.isPlainObject(g)&&u.trigger("spa:initpanel",[i,g])}}),u.on("spa:initpanel",function(b,c,d){var e=c.data("id"),f=K[e],g=f.pushData,h=B[e];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,b){d[b]&&(h[b]=d[b])}),f.viewData=d,a(".spa-page-body",c).html(d.body),o.append(c),u.trigger("spa:closeloader"),c.trigger("spa:openpanel",[e,g])}),u.on("spa:openpanel",function(b,c,d){if(r&&"block"===r.css("display"))return!1;var e=I[c];if(d||(d={}),e){if(y)return!1;y=!0;var f=B[c],h=d.animate||f.animate;if(s.hasClass("spa-panel")){var i=K[s.data("id")].prevPage;return i.trigger("spa:openpage",[function(){u.trigger("spa:openpanel",[c,d])}]),!1}var j=K[c];j.oldpushData=j.pushData,j.pushData=d,f.beforeopen.call(e,j);var k=function(){e.data("spa:init")||(e.data("spa:init",!0),f.init.call(e,j),a.os.ios&&setTimeout(function(){a(".spa-scroll",e).addClass("spa-scroll-touch")},17)),e.data("closing",!1),j.prevPage=s,f.afteropen.call(e,j),s=e,y=!1};j.prevAnimate=h,a.os.ios&&a(".spa-scroll",e).addClass("spa-scroll-touch");var l=s.data("id"),m=K[l]||{};m.prevPage&&m.prevPage.css({zIndex:D}),a.isFunction(h)?h(e,s,k):g(e,s,h,k),u.trigger("spa:viewcachesort",{view:e})}else u.trigger("spa:createpanel",[c,d])}),u.on("spa:closepanel",function(b,c){var d=a(b.target),e=d.data("id"),f=K[e];if(c&&c.id&&(d=a(".spa-panel-"+c.id)),!d.data("closing")&&(d.data("closing",!0),s.hasClass("spa-panel")&&s.data("id")===e)){var g=f.prevPage;g.trigger("spa:openpage")}}),u.on("click touchstart",".spa-panel",function(b){var c=a(b.currentTarget),d=a(b.target);(d.hasClass("spa-page-bg")||d.hasClass("spa-panel"))&&(b.stopPropagation(),b.preventDefault(),c.trigger("spa:closepanel"))}),u.on("spa:viewcachecount",function(a,b){b.count=1===b.count?2:b.count,G=b.count}),u.on("spa:viewcache",function(b,c){var d,e,f=c.view,g=f.data("id");if(f.hasClass("spa-panel")?(d="panel",e=g,I[e]=f):(d="page",e=K[g].hash,H[e]=f),J.unshift(d+":"+encodeURIComponent(e)),0!==G&&J.length>G){var h,i,j,k,l=J.splice(G);a.each(l,function(b,c){h=c.split(":",2),i=h[0],j=decodeURIComponent(h[1]),k="page"==i?H:I,a("img",k[j]).remove(),k[j].html("").remove(),delete k[j]})}}),u.on("spa:viewcachesort",function(a,b){var c,d,e,f,g=b.view,h=g.data("id");g.hasClass("spa-panel")?(c="panel",d=h):(c="page",d=K[h].hash),e=c+":"+encodeURIComponent(d),f=J.indexOf(e),f!==-1&&(J.splice(f,1),J.unshift(e))}),u.on("spa:navigate",function(b,c){var d=c.hash||"",e=c.title||"",f=c.pushData||{},g=c.replace||!1,h=c.url||"";if(e&&(document.title=e),d=h+"#"+d,g)w.replaceState(f,e,d);else{if(!s.hasClass("spa-panel")&&C.length&&"#"+C[C.length-1]===d)return;if(y)return!1;y=!0,w.pushState(f,e,d),!a.isEmptyObject(f)&&(p=f),t.trigger("popstate")}}),u.on("spa:loader",function(a,b){b.body&&(M=b.body),b.style&&(N=b.style)});var _;u.on("spa:openloader",function(a){_=setTimeout(function(){_=void 0,r.show()},300)}),u.on("spa:closeloader",function(a){_?(clearTimeout(_),_=void 0):r.hide()}),u.on("spa:boot",function(b,c){o=a("body"),u.trigger("spa:addstyle",L+N),o.append('
'+M+"
"),q=a(".spa-fullscreen"),u.trigger("spa:adjustfullscreen"),r=a(".spa-loader"),r.on("click select mousedown mousemove mouseup touchstart touchmove touchend",h),x=!0,t.trigger("popstate"),c&&c.callback&&c.callback()})}(window.Zepto||window.jQuery||window.$),function(){"use strict";for(var a=0,b=["ms","moz","webkit","o"],c=0;c + * Copyright 2017 zhaoda * Licensed under MIT */ @@ -1519,13 +1519,13 @@ route.init.call($page, pageData) // 打开之前还原spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { $('.spa-scroll', $page).addClass('spa-scroll-touch') } } // 关闭之后清除spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { $('.spa-scroll', $curPage).removeClass('spa-scroll-touch') } @@ -1571,7 +1571,7 @@ !isBack && (pageData.prevAnimate = animate) // 打开之前还原spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { $('.spa-scroll', $page).addClass('spa-scroll-touch') } @@ -1740,7 +1740,7 @@ panelOptions.init.call($panel, panelData) // 打开之前还原spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { // 带有-webkit-overflow-scrolling: touch // 这个属性,如果去修改z-index,会偶现闪屏现象。 // 不如一帧以后再添加这个class @@ -1768,7 +1768,7 @@ panelData.prevAnimate = animate // 打开之前还原spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { $('.spa-scroll', $panel).addClass('spa-scroll-touch') } diff --git a/dist/spa.min.js b/dist/spa.min.js index 914fabe..758d758 100644 --- a/dist/spa.min.js +++ b/dist/spa.min.js @@ -1,8 +1,8 @@ /*! * SPA v2.0.5 * A webapp framework for routing control and view transitions - * Copyright 2016 zhaoda + * Copyright 2017 zhaoda * Licensed under MIT */ -!function(a){"use strict";function t(a){return a=a||T.href,a.replace(/^[^#]*#?\/?(.*)\/?$/,"$1")}function e(a){return"[object RegExp]"==Object.prototype.toString.call(a)}function n(a){return a=a.replace(M,"\\$&").replace(S,"(?:$1)?").replace($,function(a,t){return t?a:"([^/]+)"}).replace(_,"(.*?)"),"^"+a+"$"}function i(t,e){var n=t.exec(e).slice(1),i=[];return a.each(n,function(a,t){t&&i.push(decodeURIComponent(t))}),i}function o(a,t){H[a.data("id")],H[t.data("id")];a.css({zIndex:z}),t.css({zIndex:F})}function s(t,e,n,i){var o=a(".spa-page-body",t),s=(a(".spa-page-body",e),{});!B&&(n="defaultInOut"),J[n]||(n="defaultInOut"),D&&(D=!1,n="defaultInOut"),s.opacity=1,!K(n)&&B&&(s[B]="translate(0, 0) scale(1, 1)"),o.css(s),G[n].apply(t,[t,e,i])}function r(a){a.stopPropagation(),a.preventDefault()}if(!a.os){var p={},l=navigator.userAgent,c=(navigator.platform,l.match(/(Android);?[\s\/]+([\d.]+)?/)),u=l.match(/(iPad).*OS\s([\d_]+)/),d=l.match(/(iPod)(.*OS\s([\d_]+))?/),g=!u&&l.match(/(iPhone\sOS)\s([\d_]+)/);c&&(p.android=!0,p.version=c[2]),g&&!d&&(p.ios=p.iphone=!0,p.version=g[2].replace(/_/g,".")),u&&(p.ios=p.ipad=!0,p.version=u[2].replace(/_/g,".")),d&&(p.ios=p.ipod=!0,p.version=d[3]?d[3].replace(/_/g,"."):null),a.os=p}var h,f,m,v,b,y=a(window),w=a(document),T=window.location,x=window.history,I=!1,k=!1,D=!0,O={},P={},C=[],A=2e3,z=2001,F=2002,R=0,U={},L={},E=[],H={},q="body {position: relative; margin: 0; padding: 0; width: 100%; overflow: hidden;} .spa-fullscreen {position: absolute; left: 0; top: 0; margin: 0; padding: 0; width: 100%; visibility: hidden; overflow: hidden; z-index: -1; } .spa-page {position: absolute; left: 0; top: 0; bottom: 0; right: 0; margin: 0; padding: 0; overflow: hidden; z-index: 2000; -webkit-transform: translateZ(0); -webkit-backface-visibility: hidden; -webkit-transform-style: preserve-3d;} .spa-page-bg {position: absolute; left: 0; top: 0; bottom: 0; right: 0; margin: 0; padding: 0; } .spa-page-body {position: absolute; left: 0; top: 0; bottom: 0; right: 0; margin: 0; padding: 0; overflow: hidden; -webkit-transform: translateZ(0); -webkit-backface-visibility: hidden; -webkit-transform-style: preserve-3d;} .spa-scroll {overflow: auto;} .spa-scroll-touch {-webkit-overflow-scrolling: touch; } .spa-scroll-x {overflow-y: hidden;} .spa-scroll-y {overflow-x: hidden;} .spa-cover {display: none; position: absolute; left: 0; right: 0; top: 0; bottom: 0; text-align: center; z-index: 5000; } .spa-loader {display: none; position: absolute; left: 0; right: 0; top: 0; bottom: 0; text-align: center; overflow: hidden; z-index: 5001; }",W='
',j=".spa-loader-animate {position: absolute; top: 50%; left: 50%;} .spa-loader-animate .bg {position: absolute; width: 64px; height: 64px; margin: 0 auto; top: -32px; left: -32px; border-radius: 50%; background: #2C3E50; opacity: 0.5;} .spa-loader-animate .ball {display: block; float: left; padding: 8px; margin-top: -8px; margin-left: -10px; -webkit-border-radius: 50%; -moz-border-radius: 50%; -ms-border-radius: 50%; -o-border-radius: 50%; border-radius: 50%;} .spa-loader-animate span:nth-child(2) {background: #16A085; -webkit-animation: move-left 800ms ease-in-out infinite alternate; -moz-animation: move-left 800ms ease-in-out infinite alternate; -ms-animation: move-left 800ms ease-in-out infinite alternate; -animation: move-left 800ms ease-in-out infinite alternate;} .spa-loader-animate .ball:nth-child(3) {background: #E67E22; -webkit-animation: move-right 800ms ease-in-out infinite alternate; -moz-animation: move-right 800ms ease-in-out infinite alternate; -ms-animation: move-right 800ms ease-in-out infinite alternate; animation: move-right 800ms ease-in-out infinite alternate;} @-webkit-keyframes move-left {to {-webkit-transform: translate(20px, 0); transform: translate(20px, 0); background: #e85932;}} @-webkit-keyframes move-right {to {-webkit-transform: translate(-20px, 0); transform: translate(-20px, 0); background: #44bbcc;}}";a.spa={},a.spa.getViewData=function(a){return H[a.data("id")]},a.spa.getCurPage=function(){return b},a.spa.version="2.0.5",w.on("spa:addstyle",function(t,e){a("head").append('")}),function(){var t,e,n,i,o=function(){n=Math.max(y.height(),window.innerHeight),i=Math.max(y.width(),window.innerWidth),m.css({height:2*n}),window.scrollTo(0,0),h.data("innerHeight",window.innerHeight),n=Math.max(y.height(),window.innerHeight),m.height()!=n&&(h.css({width:i,height:n}),m.css({width:i,height:n}))};y.on("spa:adjustfullscreen"+(a.os.ios?" orientationchange":""),function(a){void 0!==t&&(cancelAnimationFrame(t),t=void 0),t=requestAnimationFrame(o)}),a.os.android&&y.on("orientationchange",function(a){clearTimeout(e),e=setTimeout(o,500)}),y.on("resize",function(a){clearTimeout(e),e=setTimeout(o,200)})}(),w.on("spa:scroll",function(t,e){var n=a(t.target),i=e&&e.direction||"";n.addClass("spa-scroll"+(i?" spa-scroll-"+i:""))}),w.on("spa:removescroll",function(t,e){var n=a(t.target);n.removeClass("spa-scroll spa-scroll-x spa-scroll-y")}),a.os.ios&&w.on("touchstart",".spa-scroll, .spa-scroll-x, .spa-scroll-y",function(t){var e=a(t.currentTarget),n=e.prop("scrollTop"),i=e.prop("scrollLeft"),o=e.height(),s=e.width(),r=e.prop("scrollHeight"),p=e.prop("scrollWidth");(e.hasClass("spa-scroll")||e.hasClass("spa-scroll-x"))&&(i<=0&&e.prop("scrollLeft",1),i+s>=p&&e.prop("scrollLeft",p-s-1)),(e.hasClass("spa-scroll")||e.hasClass("spa-scroll-y"))&&(n<=0&&e.prop("scrollTop",1),n+o>=r&&e.prop("scrollTop",n-1))}),y.on("popstate",function(a){if(I){if(v&&"block"===v.css("display"))return!1;if(b&&b.hasClass("spa-panel")){var e=b.data("id"),n=H[e],i=n.prevPage;return i.trigger("spa:openpage"),!1}var o=t();if(!C.length||C[C.length-1]!==o){C.push(o);var s=U[o],r=a.state||{};if(f&&(r=f,f=void 0),s){var p=s.data("id"),l=H[p];l.oldpushData=l.pushData,l.pushData=r,s.trigger("spa:openpage")}else w.trigger("spa:createpage",{hash:o,pushData:r})}}});var S=/\((.*?)\)/g,$=/(\(\?)?:\w+/g,_=/\*\w+/g,M=/[\-{}\[\]+?.,\\\^$|#\s]/g,Z={route:"",animate:"",classname:"",view:function(){return{title:"",body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};w.on("spa:route",function(t,i){var o=Array.prototype.slice.call(arguments,1);if(o.length>1)return a.each(o,function(a,t){w.trigger("spa:route",t)}),!1;var s=i.route||"";e(s)||(s=n(s)),i.animate&&!a.isFunction(i.animate)&&K(i.animate)&&(i.animate=""),O[s]=a.extend({},Z,i)});var B,Q,V,G={},J={};!function(){var a,t={"-webkit-transition":["-webkit-transform","webkitTransitionEnd"],"-moz-transition":["-moz-transform","transitionend"],"-ms-transition":["-ms-transform","msTransitionEnd"],"-o-transition":["-o-transform","oTransitionEnd"],transition:["transform","transitionend"]},e=document.createElement("div");for(a in t)if(void 0!==e.style[a]){Q=a,B=t[a][0],V=t[a][1];break}}(),a.fn.emulateTransition=function(t,e){var n=a(this);return requestAnimationFrame(function(){n.get(0).offsetWidth,t[Q]="0.4s",n.css(t).emulateTransitionEndBySpa(function(){t={},t[Q]="",n.css(t),e&&e()})}),n},a.fn.transition||(a.fn.transition=a.fn.emulateTransition),a.fn.emulateTransitionEndBySpa=function(t,e){var n,i=!1,o=a(this);e=e||500,o.one(V,function(){i=!0,clearTimeout(n),t.call(o)});var s=function(){i||o.trigger(V)};return n=setTimeout(s,e),o},G.defaultInOut=function(a,t,e){o(t,a),e()},w.on("spa:addTransitPageAnimates",function(t,e){var n=[];a.each(e,function(a,t){n.push(a)}),a.each(n,function(a,t){a%2===0?J[t]=n[a+1]:J[t]=n[a-1]}),a.extend(G,e)}),w.trigger("spa:addTransitPageAnimates",{fadeIn:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),{opacity:0}),r={opacity:1};s.opacity=0,i.css(s),o(e,t),i.emulateTransition(r,function(){n()})},fadeOut:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s={opacity:0};i.emulateTransition(s,function(){o(e,t),n()})},slideInLeft:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),{}),r={};s[B]="translate(100%, 0)",r[B]="translate(0%, 0)",i.css(s),o(e,t),i.emulateTransition(r,function(){n()})},slideOutRight:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s={};s[B]="translate(100%, 0)",i.emulateTransition(s,function(){o(e,t),n()})},slideInRight:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),{}),r={};s[B]="translate(-100%, 0)",r[B]="translate(0%, 0)",i.css(s),o(e,t),i.emulateTransition(r,function(){n()})},slideOutLeft:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s={};s[B]="translate(-100%, 0)",i.emulateTransition(s,function(){o(e,t),n()})},slideInUp:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),{}),r={};s[B]="translate(0, 100%)",r[B]="translate(0, 0%)",i.css(s),o(e,t),i.emulateTransition(r,function(){n()})},slideOutDown:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s={};s[B]="translate(0, 100%)",i.emulateTransition(s,function(){o(e,t),n()})},slideInDown:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),{}),r={};s[B]="translate(0, -100%)",r[B]="translate(0, 0%)",i.css(s),o(e,t),i.emulateTransition(r,function(){n()})},slideOutUp:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s={};s[B]="translate(0, -100%)",i.emulateTransition(s,function(){o(e,t),n()})},pushInLeft:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(100%, 0)",l[B]="translate(0%, 0)",c[B]="translate(-100%, 0)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushOutRight:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(-100%, 0)",l[B]="translate(0%, 0)",c[B]="translate(100%, 0)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushInRight:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(-100%, 0)",l[B]="translate(0%, 0)",c[B]="translate(100%, 0)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushOutLeft:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(100%, 0)",l[B]="translate(0%, 0)",c[B]="translate(-100%, 0)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushInUp:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(0, 100%)",l[B]="translate(0%, 0)",c[B]="translate(0, -100%)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushOutDown:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(0, -100%)",l[B]="translate(0%, 0)",c[B]="translate(0, 100%)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushInDown:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(0, -100%)",l[B]="translate(0%, 0)",c[B]="translate(0, 100%)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},pushOutUp:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=0,p={},l={},c={};p[B]="translate(0, 100%)",l[B]="translate(0%, 0)",c[B]="translate(0, -100%)",i.css(p),o(e,t),i.emulateTransition(l,function(){2==++r&&n()}),s.emulateTransition(c,function(){2==++r&&n()})},zoomIn:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),{}),r={};s[B]="scale(0, 0)",r[B]="scale(1, 1)",i.css(s),o(e,t),i.emulateTransition(r,function(){n()})},zoomOut:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s={};s[B]="scale(0, 0)",i.emulateTransition(s,function(){o(e,t),n()})},overlayInLeft:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),i.children().width()),r={left:"auto",width:s},p={};p[B]="translate(0px, 0)",i.css(r),s=2*s-i.prop("clientWidth"),r={width:s},r[B]="translate("+s+"px, 0)",i.css(r),o(e,t),i.emulateTransition(p,function(){n()})},overlayOutRight:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s=i.width(),r={},p={width:"auto",left:0};r[B]="translate("+s+"px, 0)",i.emulateTransition(r,function(){o(e,t),i.css(p),n()})},overlayInRight:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),i.children().width()),r={right:"auto",width:s},p={};p[B]="translate(0px, 0)",i.css(r),s=2*s-i.prop("clientWidth"),r={width:s},r[B]="translate("+(0-s)+"px, 0)",i.css(r),o(e,t),i.emulateTransition(p,function(){n()})},overlayOutLeft:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s=i.width(),r={},p={width:"auto",right:0};r[B]="translate("+(0-s)+"px, 0)",i.emulateTransition(r,function(){o(e,t),i.css(p),n()})},overlayInUp:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),i.children().height()),r={top:"auto",height:s},p={};p[B]="translate(0, 0px)",i.css(r),s=2*s-i.prop("clientHeight"),r={height:s},r[B]="translate(0, "+s+"px)",i.css(r),o(e,t),i.emulateTransition(p,function(){n()})},overlayOutDown:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s=i.height(),r={},p={height:"auto",top:0};r[B]="translate(0, "+s+"px)",i.emulateTransition(r,function(){o(e,t),i.css(p),n()})},overlayInDown:function(t,e,n){var i=a(".spa-page-body",t),s=(a(".spa-page-body",e),i.children().height()),r={bottom:"auto",height:s},p={};p[B]="translate(0, 0px)",i.css(r),s=2*s-i.prop("clientHeight"),r={height:s},r[B]="translate(0, "+(0-s)+"px)",i.css(r),o(e,t),i.emulateTransition(p,function(){n()})},overlayOutUp:function(t,e,n){var i=(a(".spa-page-body",t),a(".spa-page-body",e)),s=i.height(),r={},p={height:"auto",bottom:0};r[B]="translate(0, "+(0-s)+"px)",i.emulateTransition(r,function(){o(e,t),i.css(p),n()})},revealInLeft:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().width(),p={left:"auto",width:r},l={};p[B]="translate(0, 0)",i.css(p),r=2*i.width()-i.prop("clientWidth"),i.css({width:r}),l[B]="translate("+(0-r)+"px, 0)",o(t,e),s.emulateTransition(l,function(){o(e,t),n()})},revealOutRight:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=(s.width(),{});r[B]="translate(0px, 0)",o(e,t),i.emulateTransition(r,function(){s.css({width:"auto",left:0}),n()})},revealInRight:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().width(),p={right:"auto",width:r},l={};p[B]="translate(0, 0)",i.css(p),r=2*i.width()-i.prop("clientWidth"),i.css({width:r}),l[B]="translate("+r+"px, 0)",o(t,e),s.emulateTransition(l,function(){o(e,t),n()})},revealOutLeft:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=(s.width(),{});r[B]="translate(0px, 0)",o(e,t),i.emulateTransition(r,function(){s.css({width:"auto",right:0}),n()})},revealInUp:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().height(),p={top:"auto",height:r},l={};p[B]="translate(0, 0)",i.css(p),r=2*i.height()-i.prop("clientHeight"),i.css({height:r}),l[B]="translate(0, "+(0-r)+"px)",o(t,e),s.emulateTransition(l,function(){o(e,t),n()})},revealOutDown:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=(s.height(),{});r[B]="translate(0, 0px)",o(e,t),i.emulateTransition(r,function(){s.css({height:"auto",top:0}),n()})},revealInDown:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().height(),p={bottom:"auto",height:r},l={};p[B]="translate(0, 0)",i.css(p),r=2*i.height()-i.prop("clientHeight"),i.css({height:r}),l[B]="translate(0, "+r+"px)",o(t,e),s.emulateTransition(l,function(){o(e,t),n()})},revealOutUp:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=(s.height(),{});r[B]="translate(0, 0px)",o(e,t),i.emulateTransition(r,function(){s.css({height:"auto",bottom:0}),n()})},pushPartInLeft:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().width(),p=0,l={left:"auto",width:r},c={},u={};i.css(l),r=2*i.width()-i.prop("clientWidth"),l={width:r},l[B]="translate("+r+"px, 0)",c[B]="translate(0px, 0)",u[B]="translate("+(0-r)+"px, 0)",i.css(l),o(e,t),i.emulateTransition(c,function(){2==++p&&n()}),s.emulateTransition(u,function(){2==++p&&n()})},pushPartOutRight:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=s.width(),p=0,l={},c={},u={width:"auto",left:0};l[B]="translate(0px, 0)",c[B]="translate("+r+"px, 0)",o(e,t),i.emulateTransition(l,function(){2==++p&&n()}),s.emulateTransition(c,function(){s.css(u),2==++p&&n()})},pushPartInRight:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().width(),p=0,l={right:"auto",width:r},c={},u={};i.css(l),r=2*i.width()-i.prop("clientWidth"),l={width:r},l[B]="translate("+(0-r)+"px, 0)",u[B]="translate("+r+"px, 0)",c[B]="translate(0px, 0)",i.css(l),o(e,t),i.emulateTransition(c,function(){2==++p&&n()}),s.emulateTransition(u,function(){2==++p&&n()})},pushPartOutLeft:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=s.width(),p=0,l={},c={},u={width:"auto",right:0};l[B]="translate(0px, 0)",c[B]="translate("+(0-r)+"px, 0)",o(e,t),i.emulateTransition(l,function(){2==++p&&n()}),s.emulateTransition(c,function(){s.css(u),2==++p&&n()})},pushPartInUp:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().height(),p=0,l={top:"auto",height:r},c={},u={};i.css(l),r=2*i.height()-i.prop("clientHeight"),l={height:r},l[B]="translate(0, "+r+"px)",c[B]="translate(0, 0px)",u[B]="translate(0, "+(0-r)+"px)",i.css(l),o(e,t),i.emulateTransition(c,function(){2==++p&&n()}),s.emulateTransition(u,function(){2==++p&&n()})},pushPartOutDown:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=s.height(),p=0,l={},c={},u={height:"auto",top:0};l[B]="translate(0, 0px)",c[B]="translate(0, "+r+"px)",o(e,t),i.emulateTransition(l,function(){2==++p&&n()}),s.emulateTransition(c,function(){s.css(u),2==++p&&n()})},pushPartInDown:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=i.children().height(),p=0,l={bottom:"auto",height:r},c={},u={};i.css(l),r=2*i.height()-i.prop("clientHeight"),l={height:r},l[B]="translate(0, "+(0-r)+"px)",c[B]="translate(0, 0px)",u[B]="translate(0, "+r+"px)",i.css(l),o(e,t),i.emulateTransition(c,function(){2==++p&&n()}),s.emulateTransition(u,function(){2==++p&&n()})},pushPartOutUp:function(t,e,n){var i=a(".spa-page-body",t),s=a(".spa-page-body",e),r=s.height(),p=0,l={},c={},u={height:"auto",bottom:0};l[B]="translate(0, 0px)",c[B]="translate(0, "+(0-r)+"px)",o(e,t),i.emulateTransition(l,function(){2==++p&&n()}),s.emulateTransition(c,function(){s.css(u),2==++p&&n()})}});var K=function(){var a=/^(overlay|reveal|pushPart).*$/;return function(t){return a.test(t)}}(),N=function(){var a=0;return function(){return a++}}();w.on("spa:createpage",function(t,n){w.trigger("spa:openloader");var o,s,r,p=n.hash,l=n.pushData;if(a.each(O,function(a,t){return s=new RegExp(a),s.test(p)?(o=a,r=t,!1):void(s=!1)}),e(s)){var c,u,d=(r.classname?" spa-page-"+r.classname:"")+(r.nocache?" no-cache":""),g=a('
'),h=N();g.data("id",h),c={id:h,hash:p,pushData:l,requestData:i(s,p),route:o,el:g},H[h]=c,!r.nocache&&w.trigger("spa:viewcache",{view:g}),u=r.view.call(g,c),a.isPlainObject(u)&&w.trigger("spa:initpage",[g,u])}}),w.on("spa:initpage",function(t,e,n){var i=e.data("id"),o=H[i],s=O[o.route];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,t){n[t]&&(s[t]=n[t])}),o.viewData=n,w.trigger("spa:closeloader"),a(".spa-page-body",e).html(n.body),h.append(e),e.trigger("spa:openpage")}),w.on("spa:openpage",".spa-page",function(e,n){var i=a(e.currentTarget),o=i.data("id"),r=H[o],p=O[r.route],l=r.hash,c=r.pushData,u=(r.oldpushData,r.requestData,r.viewData),d=c.title||u.title,g=!1,f=c.animate||p.animate;b||(h.append('
'),b=a(".spa-page-empty"));var m=b.data("id"),v=H[m]||{};if(!c.animate&&v.prevPage&&v.prevPage.data("id")===o){var T=v.prevAnimate;T&&!a.isFunction(T)&&(f=J[T]),g=!0}var x,I;if(b.hasClass("spa-panel")){var D=P[b.data("id")];x=D.beforeclose,I=D.afterclose}else if(v.route){var C=O[v.route];x=C.beforeclose,I=C.afterclose,w.trigger("spa:navigate",{hash:l,title:d,pushData:c,replace:!0})}var F=function(){i.data("spa:init")||(i.data("spa:init",!0),p.init.call(i,r),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",i).addClass("spa-scroll-touch")),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",b).removeClass("spa-scroll-touch"),I&&I.call(b,v),b.hasClass("no-cache")&&b.remove(),b.hasClass("spa-panel")?(b.css({zIndex:A}),r.prevPage&&r.prevPage.css({zIndex:z})):g||(r.prevPage=b),p.afteropen.call(i,r),b=i,r.hash!==t()?(k=!1,y.trigger("popstate")):(a.isFunction(n)&&n.call(i),k=!1)};x&&x.call(b,v),p.beforeopen.call(i,r),!g&&(r.prevAnimate=f),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",i).addClass("spa-scroll-touch"),g||v.prevPage&&v.prevPage.css({zIndex:A}),a.isFunction(f)?f(i,b,F):s(i,b,f,F),w.trigger("spa:viewcachesort",{view:i})});var X={id:"",animate:"",classname:"",view:function(){return{body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};w.on("spa:panel",function(t,e){var n=Array.prototype.slice.call(arguments,1);return n.length>1?(a.each(n,function(a,t){w.trigger("spa:panel",t)}),!1):void(e.id&&!P[e.id]&&(P[e.id]=a.extend({},X,e)))}),w.on("spa:createpanel",function(t,e,n){var i=P[e];if(i){w.trigger("spa:openloader");var o,s,r=i.classname?" spa-panel-"+i.classname:"",p=a('
');p.data("id",e),o={id:e,pushData:n,el:p},H[e]=o,w.trigger("spa:viewcache",{view:p}),s=i.view.call(p,o),a.isPlainObject(s)&&w.trigger("spa:initpanel",[p,s])}}),w.on("spa:initpanel",function(t,e,n){var i=e.data("id"),o=H[i],s=o.pushData,r=P[i];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,t){n[t]&&(r[t]=n[t])}),o.viewData=n,a(".spa-page-body",e).html(n.body),h.append(e),w.trigger("spa:closeloader"),e.trigger("spa:openpanel",[i,s])}),w.on("spa:openpanel",function(t,e,n){if(v&&"block"===v.css("display"))return!1;var i=L[e];if(n||(n={}),i){if(k)return!1;k=!0;var o=P[e],r=n.animate||o.animate;if(b.hasClass("spa-panel")){var p=H[b.data("id")].prevPage;return p.trigger("spa:openpage",[function(){w.trigger("spa:openpanel",[e,n])}]),!1}var l=H[e];l.oldpushData=l.pushData,l.pushData=n,o.beforeopen.call(i,l);var c=function(){i.data("spa:init")||(i.data("spa:init",!0),o.init.call(i,l),a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&setTimeout(function(){a(".spa-scroll",i).addClass("spa-scroll-touch")},17)),i.data("closing",!1),l.prevPage=b,o.afteropen.call(i,l),b=i,k=!1};l.prevAnimate=r,a.os.ios&&parseInt(a.os.version.slice(0,1))>5&&a(".spa-scroll",i).addClass("spa-scroll-touch");var u=b.data("id"),d=H[u]||{};d.prevPage&&d.prevPage.css({zIndex:A}),a.isFunction(r)?r(i,b,c):s(i,b,r,c),w.trigger("spa:viewcachesort",{view:i})}else w.trigger("spa:createpanel",[e,n])}),w.on("spa:closepanel",function(t,e){var n=a(t.target),i=n.data("id"),o=H[i];if(e&&e.id&&(n=a(".spa-panel-"+e.id)),!n.data("closing")&&(n.data("closing",!0),b.hasClass("spa-panel")&&b.data("id")===i)){var s=o.prevPage;s.trigger("spa:openpage")}}),w.on("click touchstart",".spa-panel",function(t){var e=a(t.currentTarget),n=a(t.target);(n.hasClass("spa-page-bg")||n.hasClass("spa-panel"))&&(t.stopPropagation(),t.preventDefault(),e.trigger("spa:closepanel"))}),w.on("spa:viewcachecount",function(a,t){t.count=1===t.count?2:t.count,R=t.count}),w.on("spa:viewcache",function(t,e){var n,i,o=e.view,s=o.data("id");if(o.hasClass("spa-panel")?(n="panel",i=s,L[i]=o):(n="page",i=H[s].hash,U[i]=o),E.unshift(n+":"+encodeURIComponent(i)),0!==R&&E.length>R){var r,p,l,c,u=E.splice(R);a.each(u,function(t,e){r=e.split(":",2),p=r[0],l=decodeURIComponent(r[1]),c="page"==p?U:L,a("img",c[l]).remove(),c[l].html("").remove(),delete c[l]})}}),w.on("spa:viewcachesort",function(a,t){var e,n,i,o,s=t.view,r=s.data("id");s.hasClass("spa-panel")?(e="panel",n=r):(e="page",n=H[r].hash),i=e+":"+encodeURIComponent(n),o=E.indexOf(i),o!==-1&&(E.splice(o,1),E.unshift(i))}),w.on("spa:navigate",function(t,e){var n=e.hash||"",i=e.title||"",o=e.pushData||{},s=e.replace||!1,r=e.url||"";if(i&&(document.title=i),n=r+"#"+n,s)x.replaceState(o,i,n);else{if(!b.hasClass("spa-panel")&&C.length&&"#"+C[C.length-1]===n)return;if(k)return!1;k=!0,x.pushState(o,i,n),!a.isEmptyObject(o)&&(f=o),y.trigger("popstate")}}),w.on("spa:loader",function(a,t){t.body&&(W=t.body),t.style&&(j=t.style)});var Y;w.on("spa:openloader",function(a){Y=setTimeout(function(){Y=void 0,v.show()},300)}),w.on("spa:closeloader",function(a){Y?(clearTimeout(Y),Y=void 0):v.hide()}),w.on("spa:boot",function(t,e){h=a("body"),w.trigger("spa:addstyle",q+j),h.append('
'+W+"
"),m=a(".spa-fullscreen"),w.trigger("spa:adjustfullscreen"),v=a(".spa-loader"),v.on("click select mousedown mousemove mouseup touchstart touchmove touchend",r),I=!0,y.trigger("popstate"),e&&e.callback&&e.callback()})}(window.Zepto||window.jQuery||window.$),function(){"use strict";for(var a=0,t=["ms","moz","webkit","o"],e=0;e'+c+"")}),function(){var b,c,d,e,f=function(){d=Math.max(t.height(),window.innerHeight),e=Math.max(t.width(),window.innerWidth),q.css({height:2*d}),window.scrollTo(0,0),o.data("innerHeight",window.innerHeight),d=Math.max(t.height(),window.innerHeight),q.height()!=d&&(o.css({width:e,height:d}),q.css({width:e,height:d}))};t.on("spa:adjustfullscreen"+(a.os.ios?" orientationchange":""),function(a){void 0!==b&&(cancelAnimationFrame(b),b=void 0),b=requestAnimationFrame(f)}),a.os.android&&t.on("orientationchange",function(a){clearTimeout(c),c=setTimeout(f,500)}),t.on("resize",function(a){clearTimeout(c),c=setTimeout(f,200)})}(),u.on("spa:scroll",function(b,c){var d=a(b.target),e=c&&c.direction||"";d.addClass("spa-scroll"+(e?" spa-scroll-"+e:""))}),u.on("spa:removescroll",function(b,c){var d=a(b.target);d.removeClass("spa-scroll spa-scroll-x spa-scroll-y")}),a.os.ios&&u.on("touchstart",".spa-scroll, .spa-scroll-x, .spa-scroll-y",function(b){var c=a(b.currentTarget),d=c.prop("scrollTop"),e=c.prop("scrollLeft"),f=c.height(),g=c.width(),h=c.prop("scrollHeight"),i=c.prop("scrollWidth");(c.hasClass("spa-scroll")||c.hasClass("spa-scroll-x"))&&(e<=0&&c.prop("scrollLeft",1),e+g>=i&&c.prop("scrollLeft",i-g-1)),(c.hasClass("spa-scroll")||c.hasClass("spa-scroll-y"))&&(d<=0&&c.prop("scrollTop",1),d+f>=h&&c.prop("scrollTop",d-1))}),t.on("popstate",function(a){if(x){if(r&&"block"===r.css("display"))return!1;if(s&&s.hasClass("spa-panel")){var c=s.data("id"),d=K[c],e=d.prevPage;return e.trigger("spa:openpage"),!1}var f=b();if(!C.length||C[C.length-1]!==f){C.push(f);var g=H[f],h=a.state||{};if(p&&(h=p,p=void 0),g){var i=g.data("id"),j=K[i];j.oldpushData=j.pushData,j.pushData=h,g.trigger("spa:openpage")}else u.trigger("spa:createpage",{hash:f,pushData:h})}}});var O=/\((.*?)\)/g,P=/(\(\?)?:\w+/g,Q=/\*\w+/g,R=/[\-{}\[\]+?.,\\\^$|#\s]/g,S={route:"",animate:"",classname:"",view:function(){return{title:"",body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};u.on("spa:route",function(b,e){var f=Array.prototype.slice.call(arguments,1);if(f.length>1)return a.each(f,function(a,b){u.trigger("spa:route",b)}),!1;var g=e.route||"";c(g)||(g=d(g)),e.animate&&!a.isFunction(e.animate)&&Y(e.animate)&&(e.animate=""),A[g]=a.extend({},S,e)});var T,U,V,W={},X={};!function(){var a,b={"-webkit-transition":["-webkit-transform","webkitTransitionEnd"],"-moz-transition":["-moz-transform","transitionend"],"-ms-transition":["-ms-transform","msTransitionEnd"],"-o-transition":["-o-transform","oTransitionEnd"],transition:["transform","transitionend"]},c=document.createElement("div");for(a in b)if(void 0!==c.style[a]){U=a,T=b[a][0],V=b[a][1];break}}(),a.fn.emulateTransition=function(b,c){var d=a(this);return requestAnimationFrame(function(){d.get(0).offsetWidth,b[U]="0.4s",d.css(b).emulateTransitionEndBySpa(function(){b={},b[U]="",d.css(b),c&&c()})}),d},a.fn.transition||(a.fn.transition=a.fn.emulateTransition),a.fn.emulateTransitionEndBySpa=function(b,c){var d,e=!1,f=a(this);c=c||500,f.one(V,function(){e=!0,clearTimeout(d),b.call(f)});var g=function(){e||f.trigger(V)};return d=setTimeout(g,c),f},W.defaultInOut=function(a,b,c){f(b,a),c()},u.on("spa:addTransitPageAnimates",function(b,c){var d=[];a.each(c,function(a,b){d.push(a)}),a.each(d,function(a,b){a%2===0?X[b]=d[a+1]:X[b]=d[a-1]}),a.extend(W,c)}),u.trigger("spa:addTransitPageAnimates",{fadeIn:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{opacity:0}),h={opacity:1};g.opacity=0,e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},fadeOut:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={opacity:0};e.emulateTransition(g,function(){f(c,b),d()})},slideInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(100%, 0)",h[T]="translate(0%, 0)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutRight:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(100%, 0)",e.emulateTransition(g,function(){f(c,b),d()})},slideInRight:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(-100%, 0)",h[T]="translate(0%, 0)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutLeft:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(-100%, 0)",e.emulateTransition(g,function(){f(c,b),d()})},slideInUp:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(0, 100%)",h[T]="translate(0, 0%)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutDown:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(0, 100%)",e.emulateTransition(g,function(){f(c,b),d()})},slideInDown:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="translate(0, -100%)",h[T]="translate(0, 0%)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},slideOutUp:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="translate(0, -100%)",e.emulateTransition(g,function(){f(c,b),d()})},pushInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(-100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(-100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(-100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(100%, 0)",j[T]="translate(0%, 0)",k[T]="translate(-100%, 0)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, 100%)",j[T]="translate(0%, 0)",k[T]="translate(0, -100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, -100%)",j[T]="translate(0%, 0)",k[T]="translate(0, 100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, -100%)",j[T]="translate(0%, 0)",k[T]="translate(0, 100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},pushOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=0,i={},j={},k={};i[T]="translate(0, 100%)",j[T]="translate(0%, 0)",k[T]="translate(0, -100%)",e.css(i),f(c,b),e.emulateTransition(j,function(){2==++h&&d()}),g.emulateTransition(k,function(){2==++h&&d()})},zoomIn:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),{}),h={};g[T]="scale(0, 0)",h[T]="scale(1, 1)",e.css(g),f(c,b),e.emulateTransition(h,function(){d()})},zoomOut:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g={};g[T]="scale(0, 0)",e.emulateTransition(g,function(){f(c,b),d()})},overlayInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().width()),h={left:"auto",width:g},i={};i[T]="translate(0px, 0)",e.css(h),g=2*g-e.prop("clientWidth"),h={width:g},h[T]="translate("+g+"px, 0)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutRight:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.width(),h={},i={width:"auto",left:0};h[T]="translate("+g+"px, 0)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInRight:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().width()),h={right:"auto",width:g},i={};i[T]="translate(0px, 0)",e.css(h),g=2*g-e.prop("clientWidth"),h={width:g},h[T]="translate("+(0-g)+"px, 0)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutLeft:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.width(),h={},i={width:"auto",right:0};h[T]="translate("+(0-g)+"px, 0)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInUp:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().height()),h={top:"auto",height:g},i={};i[T]="translate(0, 0px)",e.css(h),g=2*g-e.prop("clientHeight"),h={height:g},h[T]="translate(0, "+g+"px)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutDown:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.height(),h={},i={height:"auto",top:0};h[T]="translate(0, "+g+"px)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},overlayInDown:function(b,c,d){var e=a(".spa-page-body",b),g=(a(".spa-page-body",c),e.children().height()),h={bottom:"auto",height:g},i={};i[T]="translate(0, 0px)",e.css(h),g=2*g-e.prop("clientHeight"),h={height:g},h[T]="translate(0, "+(0-g)+"px)",e.css(h),f(c,b),e.emulateTransition(i,function(){d()})},overlayOutUp:function(b,c,d){var e=(a(".spa-page-body",b),a(".spa-page-body",c)),g=e.height(),h={},i={height:"auto",bottom:0};h[T]="translate(0, "+(0-g)+"px)",e.emulateTransition(h,function(){f(c,b),e.css(i),d()})},revealInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i={left:"auto",width:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.width()-e.prop("clientWidth"),e.css({width:h}),j[T]="translate("+(0-h)+"px, 0)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.width(),{});h[T]="translate(0px, 0)",f(c,b),e.emulateTransition(h,function(){g.css({width:"auto",left:0}),d()})},revealInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i={right:"auto",width:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.width()-e.prop("clientWidth"),e.css({width:h}),j[T]="translate("+h+"px, 0)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.width(),{});h[T]="translate(0px, 0)",f(c,b),e.emulateTransition(h,function(){g.css({width:"auto",right:0}),d()})},revealInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i={top:"auto",height:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.height()-e.prop("clientHeight"),e.css({height:h}),j[T]="translate(0, "+(0-h)+"px)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.height(),{});h[T]="translate(0, 0px)",f(c,b),e.emulateTransition(h,function(){g.css({height:"auto",top:0}),d()})},revealInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i={bottom:"auto",height:h},j={};i[T]="translate(0, 0)",e.css(i),h=2*e.height()-e.prop("clientHeight"),e.css({height:h}),j[T]="translate(0, "+h+"px)",f(b,c),g.emulateTransition(j,function(){f(c,b),d()})},revealOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=(g.height(),{});h[T]="translate(0, 0px)",f(c,b),e.emulateTransition(h,function(){g.css({height:"auto",bottom:0}),d()})},pushPartInLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i=0,j={left:"auto",width:h},k={},l={};e.css(j),h=2*e.width()-e.prop("clientWidth"),j={width:h},j[T]="translate("+h+"px, 0)",k[T]="translate(0px, 0)",l[T]="translate("+(0-h)+"px, 0)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.width(),i=0,j={},k={},l={width:"auto",left:0};j[T]="translate(0px, 0)",k[T]="translate("+h+"px, 0)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInRight:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().width(),i=0,j={right:"auto",width:h},k={},l={};e.css(j),h=2*e.width()-e.prop("clientWidth"),j={width:h},j[T]="translate("+(0-h)+"px, 0)",l[T]="translate("+h+"px, 0)",k[T]="translate(0px, 0)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutLeft:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.width(),i=0,j={},k={},l={width:"auto",right:0};j[T]="translate(0px, 0)",k[T]="translate("+(0-h)+"px, 0)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i=0,j={top:"auto",height:h},k={},l={};e.css(j),h=2*e.height()-e.prop("clientHeight"),j={height:h},j[T]="translate(0, "+h+"px)",k[T]="translate(0, 0px)",l[T]="translate(0, "+(0-h)+"px)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.height(),i=0,j={},k={},l={height:"auto",top:0};j[T]="translate(0, 0px)",k[T]="translate(0, "+h+"px)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})},pushPartInDown:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=e.children().height(),i=0,j={bottom:"auto",height:h},k={},l={};e.css(j),h=2*e.height()-e.prop("clientHeight"),j={height:h},j[T]="translate(0, "+(0-h)+"px)",k[T]="translate(0, 0px)",l[T]="translate(0, "+h+"px)",e.css(j),f(c,b),e.emulateTransition(k,function(){2==++i&&d()}),g.emulateTransition(l,function(){2==++i&&d()})},pushPartOutUp:function(b,c,d){var e=a(".spa-page-body",b),g=a(".spa-page-body",c),h=g.height(),i=0,j={},k={},l={height:"auto",bottom:0};j[T]="translate(0, 0px)",k[T]="translate(0, "+(0-h)+"px)",f(c,b),e.emulateTransition(j,function(){2==++i&&d()}),g.emulateTransition(k,function(){g.css(l),2==++i&&d()})}});var Y=function(){var a=/^(overlay|reveal|pushPart).*$/;return function(b){return a.test(b)}}(),Z=function(){var a=0;return function(){return a++}}();u.on("spa:createpage",function(b,d){u.trigger("spa:openloader");var f,g,h,i=d.hash,j=d.pushData;if(a.each(A,function(a,b){return g=new RegExp(a),g.test(i)?(f=a,h=b,!1):void(g=!1)}),c(g)){var k,l,m=(h.classname?" spa-page-"+h.classname:"")+(h.nocache?" no-cache":""),n=a('
'),o=Z();n.data("id",o),k={id:o,hash:i,pushData:j,requestData:e(g,i),route:f,el:n},K[o]=k,!h.nocache&&u.trigger("spa:viewcache",{view:n}),l=h.view.call(n,k),a.isPlainObject(l)&&u.trigger("spa:initpage",[n,l])}}),u.on("spa:initpage",function(b,c,d){var e=c.data("id"),f=K[e],g=A[f.route];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,b){d[b]&&(g[b]=d[b])}),f.viewData=d,u.trigger("spa:closeloader"),a(".spa-page-body",c).html(d.body),o.append(c),c.trigger("spa:openpage")}),u.on("spa:openpage",".spa-page",function(c,d){var e=a(c.currentTarget),f=e.data("id"),h=K[f],i=A[h.route],j=h.hash,k=h.pushData,l=(h.oldpushData,h.requestData,h.viewData),m=k.title||l.title,n=!1,p=k.animate||i.animate;s||(o.append('
'),s=a(".spa-page-empty"));var q=s.data("id"),r=K[q]||{};if(!k.animate&&r.prevPage&&r.prevPage.data("id")===f){var v=r.prevAnimate;v&&!a.isFunction(v)&&(p=X[v]),n=!0}var w,x;if(s.hasClass("spa-panel")){var z=B[s.data("id")];w=z.beforeclose,x=z.afterclose}else if(r.route){var C=A[r.route];w=C.beforeclose,x=C.afterclose,u.trigger("spa:navigate",{hash:j,title:m,pushData:k,replace:!0})}var F=function(){e.data("spa:init")||(e.data("spa:init",!0),i.init.call(e,h),a.os.ios&&a(".spa-scroll",e).addClass("spa-scroll-touch")),a.os.ios&&a(".spa-scroll",s).removeClass("spa-scroll-touch"),x&&x.call(s,r),s.hasClass("no-cache")&&s.remove(),s.hasClass("spa-panel")?(s.css({zIndex:D}),h.prevPage&&h.prevPage.css({zIndex:E})):n||(h.prevPage=s),i.afteropen.call(e,h),s=e,h.hash!==b()?(y=!1,t.trigger("popstate")):(a.isFunction(d)&&d.call(e),y=!1)};w&&w.call(s,r),i.beforeopen.call(e,h),!n&&(h.prevAnimate=p),a.os.ios&&a(".spa-scroll",e).addClass("spa-scroll-touch"),n||r.prevPage&&r.prevPage.css({zIndex:D}),a.isFunction(p)?p(e,s,F):g(e,s,p,F),u.trigger("spa:viewcachesort",{view:e})});var $={id:"",animate:"",classname:"",view:function(){return{body:""}},init:function(){},beforeopen:function(){},afteropen:function(){},beforeclose:function(){},afterclose:function(){}};u.on("spa:panel",function(b,c){var d=Array.prototype.slice.call(arguments,1);return d.length>1?(a.each(d,function(a,b){u.trigger("spa:panel",b)}),!1):void(c.id&&!B[c.id]&&(B[c.id]=a.extend({},$,c)))}),u.on("spa:createpanel",function(b,c,d){var e=B[c];if(e){u.trigger("spa:openloader");var f,g,h=e.classname?" spa-panel-"+e.classname:"",i=a('
');i.data("id",c),f={id:c,pushData:d,el:i},K[c]=f,u.trigger("spa:viewcache",{view:i}),g=e.view.call(i,f),a.isPlainObject(g)&&u.trigger("spa:initpanel",[i,g])}}),u.on("spa:initpanel",function(b,c,d){var e=c.data("id"),f=K[e],g=f.pushData,h=B[e];a.each(["init","beforeopen","afteropen","beforeclose","afterclose"],function(a,b){d[b]&&(h[b]=d[b])}),f.viewData=d,a(".spa-page-body",c).html(d.body),o.append(c),u.trigger("spa:closeloader"),c.trigger("spa:openpanel",[e,g])}),u.on("spa:openpanel",function(b,c,d){if(r&&"block"===r.css("display"))return!1;var e=I[c];if(d||(d={}),e){if(y)return!1;y=!0;var f=B[c],h=d.animate||f.animate;if(s.hasClass("spa-panel")){var i=K[s.data("id")].prevPage;return i.trigger("spa:openpage",[function(){u.trigger("spa:openpanel",[c,d])}]),!1}var j=K[c];j.oldpushData=j.pushData,j.pushData=d,f.beforeopen.call(e,j);var k=function(){e.data("spa:init")||(e.data("spa:init",!0),f.init.call(e,j),a.os.ios&&setTimeout(function(){a(".spa-scroll",e).addClass("spa-scroll-touch")},17)),e.data("closing",!1),j.prevPage=s,f.afteropen.call(e,j),s=e,y=!1};j.prevAnimate=h,a.os.ios&&a(".spa-scroll",e).addClass("spa-scroll-touch");var l=s.data("id"),m=K[l]||{};m.prevPage&&m.prevPage.css({zIndex:D}),a.isFunction(h)?h(e,s,k):g(e,s,h,k),u.trigger("spa:viewcachesort",{view:e})}else u.trigger("spa:createpanel",[c,d])}),u.on("spa:closepanel",function(b,c){var d=a(b.target),e=d.data("id"),f=K[e];if(c&&c.id&&(d=a(".spa-panel-"+c.id)),!d.data("closing")&&(d.data("closing",!0),s.hasClass("spa-panel")&&s.data("id")===e)){var g=f.prevPage;g.trigger("spa:openpage")}}),u.on("click touchstart",".spa-panel",function(b){var c=a(b.currentTarget),d=a(b.target);(d.hasClass("spa-page-bg")||d.hasClass("spa-panel"))&&(b.stopPropagation(),b.preventDefault(),c.trigger("spa:closepanel"))}),u.on("spa:viewcachecount",function(a,b){b.count=1===b.count?2:b.count,G=b.count}),u.on("spa:viewcache",function(b,c){var d,e,f=c.view,g=f.data("id");if(f.hasClass("spa-panel")?(d="panel",e=g,I[e]=f):(d="page",e=K[g].hash,H[e]=f),J.unshift(d+":"+encodeURIComponent(e)),0!==G&&J.length>G){var h,i,j,k,l=J.splice(G);a.each(l,function(b,c){h=c.split(":",2),i=h[0],j=decodeURIComponent(h[1]),k="page"==i?H:I,a("img",k[j]).remove(),k[j].html("").remove(),delete k[j]})}}),u.on("spa:viewcachesort",function(a,b){var c,d,e,f,g=b.view,h=g.data("id");g.hasClass("spa-panel")?(c="panel",d=h):(c="page",d=K[h].hash),e=c+":"+encodeURIComponent(d),f=J.indexOf(e),f!==-1&&(J.splice(f,1),J.unshift(e))}),u.on("spa:navigate",function(b,c){var d=c.hash||"",e=c.title||"",f=c.pushData||{},g=c.replace||!1,h=c.url||"";if(e&&(document.title=e),d=h+"#"+d,g)w.replaceState(f,e,d);else{if(!s.hasClass("spa-panel")&&C.length&&"#"+C[C.length-1]===d)return;if(y)return!1;y=!0,w.pushState(f,e,d),!a.isEmptyObject(f)&&(p=f),t.trigger("popstate")}}),u.on("spa:loader",function(a,b){b.body&&(M=b.body),b.style&&(N=b.style)});var _;u.on("spa:openloader",function(a){_=setTimeout(function(){_=void 0,r.show()},300)}),u.on("spa:closeloader",function(a){_?(clearTimeout(_),_=void 0):r.hide()}),u.on("spa:boot",function(b,c){o=a("body"),u.trigger("spa:addstyle",L+N),o.append('
'+M+"
"),q=a(".spa-fullscreen"),u.trigger("spa:adjustfullscreen"),r=a(".spa-loader"),r.on("click select mousedown mousemove mouseup touchstart touchmove touchend",h),x=!0,t.trigger("popstate"),c&&c.callback&&c.callback()})}(window.Zepto||window.jQuery||window.$),function(){"use strict";for(var a=0,b=["ms","moz","webkit","o"],c=0;c 5) { + if($.os.ios) { $('.spa-scroll', $page).addClass('spa-scroll-touch') } } // 关闭之后清除spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { $('.spa-scroll', $curPage).removeClass('spa-scroll-touch') } @@ -1564,7 +1564,7 @@ !isBack && (pageData.prevAnimate = animate) // 打开之前还原spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { $('.spa-scroll', $page).addClass('spa-scroll-touch') } @@ -1733,7 +1733,7 @@ panelOptions.init.call($panel, panelData) // 打开之前还原spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { // 带有-webkit-overflow-scrolling: touch // 这个属性,如果去修改z-index,会偶现闪屏现象。 // 不如一帧以后再添加这个class @@ -1761,7 +1761,7 @@ panelData.prevAnimate = animate // 打开之前还原spa-scroll-touch - if($.os.ios && parseInt($.os.version.slice(0, 1)) > 5) { + if($.os.ios) { $('.spa-scroll', $panel).addClass('spa-scroll-touch') }