1// Avoid `console` errors in browsers that lack a console. 2(function() { 3 var method; 4 var noop = function noop() {}; 5 var methods = [ 6 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 7 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 8 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 9 'timeStamp', 'trace', 'warn' 10 ]; 11 var length = methods.length; 12 var console = (window.console = window.console || {}); 13 14 while (length--) { 15 method = methods[length]; 16 17 // Only stub undefined methods. 18 if (!console[method]) { 19 console[method] = noop; 20 } 21 } 22}()); 23 24 25// jQuery throttle / debounce - v1.1 - 3/7/2010 26(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this); 27 28 29/*! VelocityJS.org (1.3.1). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */ 30/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */ 31!function(a){"use strict";function b(a){var b=a.length,d=c.type(a);return"function"!==d&&!c.isWindow(a)&&(!(1!==a.nodeType||!b)||("array"===d||0===b||"number"==typeof b&&b>0&&b-1 in a))}if(!a.jQuery){var c=function(a,b){return new c.fn.init(a,b)};c.isWindow=function(a){return a&&a===a.window},c.type=function(a){return a?"object"==typeof a||"function"==typeof a?e[g.call(a)]||"object":typeof a:a+""},c.isArray=Array.isArray||function(a){return"array"===c.type(a)},c.isPlainObject=function(a){var b;if(!a||"object"!==c.type(a)||a.nodeType||c.isWindow(a))return!1;try{if(a.constructor&&!f.call(a,"constructor")&&!f.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(d){return!1}for(b in a);return void 0===b||f.call(a,b)},c.each=function(a,c,d){var e,f=0,g=a.length,h=b(a);if(d){if(h)for(;f<g&&(e=c.apply(a[f],d),e!==!1);f++);else for(f in a)if(a.hasOwnProperty(f)&&(e=c.apply(a[f],d),e===!1))break}else if(h)for(;f<g&&(e=c.call(a[f],f,a[f]),e!==!1);f++);else for(f in a)if(a.hasOwnProperty(f)&&(e=c.call(a[f],f,a[f]),e===!1))break;return a},c.data=function(a,b,e){if(void 0===e){var f=a[c.expando],g=f&&d[f];if(void 0===b)return g;if(g&&b in g)return g[b]}else if(void 0!==b){var h=a[c.expando]||(a[c.expando]=++c.uuid);return d[h]=d[h]||{},d[h][b]=e,e}},c.removeData=function(a,b){var e=a[c.expando],f=e&&d[e];f&&(b?c.each(b,function(a,b){delete f[b]}):delete d[e])},c.extend=function(){var a,b,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[i]||{},i++),"object"!=typeof h&&"function"!==c.type(h)&&(h={}),i===j&&(h=this,i--);i<j;i++)if(f=arguments[i])for(e in f)f.hasOwnProperty(e)&&(a=h[e],d=f[e],h!==d&&(k&&d&&(c.isPlainObject(d)||(b=c.isArray(d)))?(b?(b=!1,g=a&&c.isArray(a)?a:[]):g=a&&c.isPlainObject(a)?a:{},h[e]=c.extend(k,g,d)):void 0!==d&&(h[e]=d)));return h},c.queue=function(a,d,e){function f(a,c){var d=c||[];return a&&(b(Object(a))?!function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;)a[e++]=b[d++];if(c!==c)for(;void 0!==b[d];)a[e++]=b[d++];return a.length=e,a}(d,"string"==typeof a?[a]:a):[].push.call(d,a)),d}if(a){d=(d||"fx")+"queue";var g=c.data(a,d);return e?(!g||c.isArray(e)?g=c.data(a,d,f(e)):g.push(e),g):g||[]}},c.dequeue=function(a,b){c.each(a.nodeType?[a]:a,function(a,d){b=b||"fx";var e=c.queue(d,b),f=e.shift();"inprogress"===f&&(f=e.shift()),f&&("fx"===b&&e.unshift("inprogress"),f.call(d,function(){c.dequeue(d,b)}))})},c.fn=c.prototype={init:function(a){if(a.nodeType)return this[0]=a,this;throw new Error("Not a DOM node.")},offset:function(){var b=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:b.top+(a.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left
31:b.left+(a.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function a(a){for(var b=a.offsetParent||document;b&&"html"!==b.nodeType.toLowerCase&&"static"===b.style.position;)b=b.offsetParent;return b||document}var b=this[0],d=a(b),e=this.offset(),f=/^(?:body|html)$/i.test(d.nodeName)?{top:0,left:0}:c(d).offset();return e.top-=parseFloat(b.style.marginTop)||0,e.left-=parseFloat(b.style.marginLeft)||0,d.style&&(f.top+=parseFloat(d.style.borderTopWidth)||0,f.left+=parseFloat(d.style.borderLeftWidth)||0),{top:e.top-f.top,left:e.left-f.left}}};var d={};c.expando="velocity"+(new Date).getTime(),c.uuid=0;for(var e={},f=e.hasOwnProperty,g=e.toString,h="Boolean Number String Function Array Date RegExp Object Error".split(" "),i=0;i<h.length;i++)e["[object "+h[i]+"]"]=h[i].toLowerCase();c.fn.init.prototype=c.fn,a.Velocity={Utilities:c}}}(window),function(a){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a():"function"==typeof define&&define.amd?define(a):a()}(function(){"use strict";return function(a,b,c,d){function e(a){for(var b=-1,c=a?a.length:0,d=[];++b<c;){var e=a[b];e&&d.push(e)}return d}function f(a){return p.isWrapped(a)?a=[].slice.call(a):p.isNode(a)&&(a=[a]),a}function g(a){var b=m.data(a,"velocity");return null===b?d:b}function h(a){return function(b){return Math.round(b*a)*(1/a)}}function i(a,c,d,e){function f(a,b){return 1-3*b+3*a}function g(a,b){return 3*b-6*a}function h(a){return 3*a}function i(a,b,c){return((f(b,c)*a+g(b,c))*a+h(b))*a}function j(a,b,c){return 3*f(b,c)*a*a+2*g(b,c)*a+h(b)}function k(b,c){for(var e=0;e<p;++e){var f=j(c,a,d);if(0===f)return c;var g=i(c,a,d)-b;c-=g/f}return c}function l(){for(var b=0;b<t;++b)x[b]=i(b*u,a,d)}function m(b,c,e){var f,g,h=0;do g=c+(e-c)/2,f=i(g,a,d)-b,f>0?e=g:c=g;while(Math.abs(f)>r&&++h<s);return g}function n(b){for(var c=0,e=1,f=t-1;e!==f&&x[e]<=b;++e)c+=u;--e;var g=(b-x[e])/(x[e+1]-x[e]),h=c+g*u,i=j(h,a,d);return i>=q?k(b,h):0===i?h:m(b,c,c+u)}function o(){y=!0,a===c&&d===e||l()}var p=4,q=.001,r=1e-7,s=10,t=11,u=1/(t-1),v="Float32Array"in b;if(4!==arguments.length)return!1;for(var w=0;w<4;++w)if("number"!=typeof arguments[w]||isNaN(arguments[w])||!isFinite(arguments[w]))return!1;a=Math.min(a,1),d=Math.min(d,1),a=Math.max(a,0),d=Math.max(d,0);var x=v?new Float32Array(t):new Array(t),y=!1,z=function(b){return y||o(),a===c&&d===e?b:0===b?0:1===b?1:i(n(b),c,e)};z.getControlPoints=function(){return[{x:a,y:c},{x:d,y:e}]};var A="generateBezier("+[a,c,d,e]+")";return z.toString=function(){return A},z}function j(a,b){var c=a;return p.isString(a)?t.Easings[a]||(c=!1):c=p.isArray(a)&&1===a.length?h.apply(null,a):p.isArray(a)&&2===a.length?u.apply(null,a.concat([b])):!(!p.isArray(a)||4!==a.length)&&i.apply(null,a),c===!1&&(c=t.Easings[t.defaults.easing]?t.defaults.easing:s),c}function k(a){if(a){var b=t.timestamp&&a!==!0?a:(new Date).getTime(),c=t.State.calls.length;c>1e4&&(t.State.calls=e(t.State.calls),c=t.State.calls.length);for(var f=0;f<c;f++)if(t.State.calls[f]){var h=t.State.calls[f],i=h[0],j=h[2],n=h[3],o=!!n,q=null;n||(n=t.State.calls[f][3]=b-16);for(var r=Math.min((b-n)/j.duration,1),s=0,u=i.length;s<u;s++){var w=i[s],y=w.element;if(g(y)){var z=!1;if(j.display!==d&&null!==j.display&&"none"!==j.display){if("flex"===j.display){var A=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];m.each(A,function(a,b){v.setPropertyValue(y,"display",b)})}v.setPropertyValue(y,"display",j.display)}j.visibility!==d&&"hidden"!==j.visibility&&v.setPropertyValue(y,"visibility",j.visibility);for(var B in w)if(w.hasOwnProperty(B)&&"element"!==B){var C,D=w[B],E=p.isString(D.easing)?t.Easings[D.easing]:D.easing;if(1===r)C=D.endValue;else{var F=D.endValue-D.startValue;if(C=D.startValue+F*E(r,j,F),!o&&C===D.currentValue)continue}if(D.currentValue=C,"tween"===B)q=C;else{var G;if(v.Hooks.registered[B]){G=v.Hooks.getRoot(B);var H=g(y).rootPropertyValueCache[G];H&&(D.rootPropertyValue=H)}var I=v.setPropertyValue(y,B,D.currentValue+(0===parseFloat(C)?"":D.unitType),D.rootPropertyValue,D.scrollData);v.Hooks.registered[B]&&(v.Normalizations.registered[G]?g(y).rootPropertyValueCache[G]=v.Normalizations.registered[G]("extract",null,I[1]):g(y).rootPropertyValueCache[G]=I[1]),"transform"===I[0]&&(z=!0)}}j.mobileHA&&g(y).transformCache.translate3d===d&&(g(y).transformCache.translate3d="(0px, 0px, 0px)",z=!0),z&&v.flushTransformCache(y)}}j.display!==d&&"none"!==j.display&&(t.State.calls[f][2].display=!1),j.visibility!==d&&"hidden"
31!==j.visibility&&(t.State.calls[f][2].visibility=!1),j.progress&&j.progress.call(h[1],h[1],r,Math.max(0,n+j.duration-b),n,q),1===r&&l(f)}}t.State.isTicking&&x(k)}function l(a,b){if(!t.State.calls[a])return!1;for(var c=t.State.calls[a][0],e=t.State.calls[a][1],f=t.State.calls[a][2],h=t.State.calls[a][4],i=!1,j=0,k=c.length;j<k;j++){var l=c[j].element;b||f.loop||("none"===f.display&&v.setPropertyValue(l,"display",f.display),"hidden"===f.visibility&&v.setPropertyValue(l,"visibility",f.visibility));var n=g(l);if(f.loop!==!0&&(m.queue(l)[1]===d||!/\.velocityQueueEntryFlag/i.test(m.queue(l)[1]))&&n){n.isAnimating=!1,n.rootPropertyValueCache={};var o=!1;m.each(v.Lists.transforms3D,function(a,b){var c=/^scale/.test(b)?1:0,e=n.transformCache[b];n.transformCache[b]!==d&&new RegExp("^\\("+c+"[^.]").test(e)&&(o=!0,delete n.transformCache[b])}),f.mobileHA&&(o=!0,delete n.transformCache.translate3d),o&&v.flushTransformCache(l),v.Values.removeClass(l,"velocity-animating")}if(!b&&f.complete&&!f.loop&&j===k-1)try{f.complete.call(e,e)}catch(p){setTimeout(function(){throw p},1)}h&&f.loop!==!0&&h(e),n&&f.loop===!0&&!b&&(m.each(n.tweensContainer,function(a,b){if(/^rotate/.test(a)&&(parseFloat(b.startValue)-parseFloat(b.endValue))%360===0){var c=b.startValue;b.startValue=b.endValue,b.endValue=c}/^backgroundPosition/.test(a)&&100===parseFloat(b.endValue)&&"%"===b.unitType&&(b.endValue=0,b.startValue=100)}),t(l,"reverse",{loop:!0,delay:f.delay})),f.queue!==!1&&m.dequeue(l,f.queue)}t.State.calls[a]=!1;for(var q=0,r=t.State.calls.length;q<r;q++)if(t.State.calls[q]!==!1){i=!0;break}i===!1&&(t.State.isTicking=!1,delete t.State.calls,t.State.calls=[])}var m,n=function(){if(c.documentMode)return c.documentMode;for(var a=7;a>4;a--){var b=c.createElement("div");if(b.innerHTML="<!--[if IE "+a+"]><span></span><![endif]-->",b.getElementsByTagName("span").length)return b=null,a}return d}(),o=function(){var a=0;return b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame||function(b){var c,d=(new Date).getTime();return c=Math.max(0,16-(d-a)),a=d+c,setTimeout(function(){b(d+c)},c)}}(),p={isString:function(a){return"string"==typeof a},isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},isFunction:function(a){return"[object Function]"===Object.prototype.toString.call(a)},isNode:function(a){return a&&a.nodeType},isNodeList:function(a){return"object"==typeof a&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(a))&&a.length!==d&&(0===a.length||"object"==typeof a[0]&&a[0].nodeType>0)},isWrapped:function(a){return a&&(a.jquery||b.Zepto&&b.Zepto.zepto.isZ(a))},isSVG:function(a){return b.SVGElement&&a instanceof b.SVGElement},isEmptyObject:function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}},q=!1;if(a.fn&&a.fn.jquery?(m=a,q=!0):m=b.Velocity.Utilities,n<=8&&!q)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(n<=7)return void(jQuery.fn.velocity=jQuery.fn.animate);var r=400,s="swing",t={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:b.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:c.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:m,Redirects:{},Easings:{},Promise:b.Promise,defaults:{queue:"",duration:r,easing:s,begin:d,complete:d,progress:d,display:d,visibility:d,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0,promiseRe
vendor: 4,573 bytes, line 31
31jectEmpty:!0},init:function(a){m.data(a,"velocity",{isSVG:p.isSVG(a),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:3,patch:1},debug:!1,timestamp:!0};b.pageYOffset!==d?(t.State.scrollAnchor=b,t.State.scrollPropertyLeft="pageXOffset",t.State.scrollPropertyTop="pageYOffset"):(t.State.scrollAnchor=c.documentElement||c.body.parentNode||c.body,t.State.scrollPropertyLeft="scrollLeft",t.State.scrollPropertyTop="scrollTop");var u=function(){function a(a){return-a.tension*a.x-a.friction*a.v}function b(b,c,d){var e={x:b.x+d.dx*c,v:b.v+d.dv*c,tension:b.tension,friction:b.friction};return{dx:e.v,dv:a(e)}}function c(c,d){var e={dx:c.v,dv:a(c)},f=b(c,.5*d,e),g=b(c,.5*d,f),h=b(c,d,g),i=1/6*(e.dx+2*(f.dx+g.dx)+h.dx),j=1/6*(e.dv+2*(f.dv+g.dv)+h.dv);return c.x=c.x+i*d,c.v=c.v+j*d,c}return function d(a,b,e){var f,g,h,i={x:-1,v:0,tension:null,friction:null},j=[0],k=0,l=1e-4,m=.016;for(a=parseFloat(a)||500,b=parseFloat(b)||20,e=e||null,i.tension=a,i.friction=b,f=null!==e,f?(k=d(a,b),g=k/e*m):g=m;;)if(h=c(h||i,g),j.push(1+h.x),k+=16,!(Math.abs(h.x)>l&&Math.abs(h.v)>l))break;return f?function(a){return j[a*(j.length-1)|0]}:k}}();t.Easings={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},spring:function(a){return 1-Math.cos(4.5*a*Math.PI)*Math.exp(6*-a)}},m.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(a,b){t.Easings[b[0]]=i.apply(null,b[1])});var v=t.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var a=0;a<v.Lists.colors.length;a++){var b="color"===v.Lists.colors[a]?"0 0 0 1":"255 255 255 1";v.Hooks.templates[v.Lists.colors[a]]=["Red Green Blue Alpha",b]}var c,d,e;if(n)for(c in v.Hooks.templates)if(v.Hooks.templates.hasOwnProperty(c)){d=v.Hooks.templates[c],e=d[0].split(" ");var f=d[1].match(v.RegEx.valueSplit);"Color"===e[0]&&(e.push(e.shift()),f.push(f.shift()),v.Hooks.templates[c]=[e.join(" "),f.join(" ")])}for(c in v.Hooks.templates)if(v.Hooks.templates.hasOwnProperty(c)){d=v.Hooks.templates[c],e=d[0].split(" ");for(var g in e)if(e.hasOwnProperty(g)){var h=c+e[g],i=g;v.Hooks.registered[h]=[c,i]}}},getRoot:function(a){var b=v.Hooks.registered[a];return b?b[0]:a},cleanRootPropertyValue:function(a,b){return v.RegEx.valueUnwrap.test(b)&&(b=b.match(v.RegEx.valueUnwrap)[1]),v.Values.isCSSNullValue(b)&&(b=v.Hooks.templates[a][1]),b},extractValue:function(a,b){var c=v.Hooks.registered[a];if(c){var d=c[0],e=c[1];return b=v.Hooks.cleanRootPropertyValue(d,b),b.toString().match(v.RegEx.valueSplit)[e]}return b},injectValue:function(a,b,c){var d=v.Hooks.registered[a];if(d){var e,f,g=d[0],h=d[1];return c=v.Hooks.cleanRootPropertyValue(g,c),e=c.toString().match(v.RegEx.valueSplit),e[h]=b,f=e.join(" ")}return c}},Normalizations:{registered:{clip:function(a,b,c){switch(a){case"name":return"clip";case"extract":var d;return v.RegEx.wrappedValueAlreadyExtracted.test(c)?d=c:(d=c.toString().match(v.RegEx.valueUnwrap
vendor: 10,269 bytes, line 31
31),d=d?d[1].replace(/,(\s+)?/g," "):c),d;case"inject":return"rect("+c+")"}},blur:function(a,b,c){switch(a){case"name":return t.State.isFirefox?"filter":"-webkit-filter";case"extract":var d=parseFloat(c);if(!d&&0!==d){var e=c.toString().match(/blur\(([0-9]+[A-z]+)\)/i);d=e?e[1]:0}return d;case"inject":return parseFloat(c)?"blur("+c+")":"none"}},opacity:function(a,b,c){if(n<=8)switch(a){case"name":return"filter";case"extract":var d=c.toString().match(/alpha\(opacity=(.*)\)/i);return c=d?d[1]/100:1;case"inject":return b.style.zoom=1,parseFloat(c)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(c),10)+")"}else switch(a){case"name":return"opacity";case"extract":return c;case"inject":return c}}},register:function(){function a(a,b,c){var d="border-box"===v.getPropertyValue(b,"boxSizing").toString().toLowerCase();if(d===(c||!1)){var e,f,g=0,h="width"===a?["Left","Right"]:["Top","Bottom"],i=["padding"+h[0],"padding"+h[1],"border"+h[0]+"Width","border"+h[1]+"Width"];for(e=0;e<i.length;e++)f=parseFloat(v.getPropertyValue(b,i[e])),isNaN(f)||(g+=f);return c?-g:g}return 0}function b(b,c){return function(d,e,f){switch(d){case"name":return b;case"extract":return parseFloat(f)+a(b,e,c);case"inject":return parseFloat(f)-a(b,e,c)+"px"}}}n&&!(n>9)||t.State.isGingerbread||(v.Lists.transformsBase=v.Lists.transformsBase.concat(v.Lists.transforms3D));for(var c=0;c<v.Lists.transformsBase.length;c++)!function(){var a=v.Lists.transformsBase[c];v.Normalizations.registered[a]=function(b,c,e){switch(b){case"name":return"transform";case"extract":return g(c)===d||g(c).transformCache[a]===d?/^scale/i.test(a)?1:0:g(c).transformCache[a].replace(/[()]/g,"");case"inject":var f=!1;switch(a.substr(0,a.length-1)){case"translate":f=!/(%|px|em|rem|vw|vh|\d)$/i.test(e);break;case"scal":case"scale":t.State.isAndroid&&g(c).transformCache[a]===d&&e<1&&(e=1),f=!/(\d)$/i.test(e);break;case"skew":f=!/(deg|\d)$/i.test(e);break;case"rotate":f=!/(deg|\d)$/i.test(e)}return f||(g(c).transformCache[a]="("+e+")"),g(c).transformCache[a]}}}();for(var e=0;e<v.Lists.colors.length;e++)!function(){var a=v.Lists.colors[e];v.Normalizations.registered[a]=function(b,c,e){switch(b){case"name":return a;case"extract":var f;if(v.RegEx.wrappedValueAlreadyExtracted.test(e))f=e;else{var g,h={black:"rgb(0, 0, 0)",blue:"rgb(0, 0, 255)",gray:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",red:"rgb(255, 0, 0)",white:"rgb(255, 255, 255)"};/^[A-z]+$/i.test(e)?g=h[e]!==d?h[e]:h.black:v.RegEx.isHex.test(e)?g="rgb("+v.Values.hexToRgb(e).join(" ")+")":/^rgba?\(/i.test(e)||(g=h.black),f=(g||e).toString().match(v.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return(!n||n>8)&&3===f.split(" ").length&&(f+=" 1"),f;case"inject":return n<=8?4===e.split(" ").length&&(e=e.split(/\s+/).slice(0,3).join(" ")):3===e.split(" ").length&&(e+=" 1"),(n<=8?"rgb":"rgba")+"("+e.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}();v.Normalizations.registered.innerWidth=b("width",!0),v.Normalizations.registered.innerHeight=b("height",!0),v.Normalizations.registered.outerWidth=b("width"),v.Normalizations.registered.outerHeight=b("height")}},Names:{camelCase:function(a){return a.replace(/-(\w)/g,function(a,b){return b.toUpperCase()})},SVGAttribute:function(a){var b="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(n||t.State.isAndroid&&!t.State.isChrome)&&(b+="|transform"),new RegExp("^("+b+")$","i").test(a)},prefixCheck:function(a){if(t.State.prefixMatches[a])return[t.State.prefixMatches[a],!0];for(var b=["","Webkit","Moz","ms","O"],c=0,d=b.length;c<d;c++){var e;if(e=0===c?a:b[c]+a.replace(/^\w/,function(a){return a.toUpperCase()}),p.isString(t.State.prefixElement.style[e]))return t.State.prefixMatches[a]=e,[e,!0]}return[a,!1]}},Values:{hexToRgb:function(a){var b,c=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,d=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;return a=a.replace(c,function(a,b,c,d){return b+b+c+c+d+d}),b=d.exec(a),b?[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]:[0,0,0]},isCSSNullValue:function(a){return!a||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(a)},getUnitType:function(a){return/^(rotate|skew)/i.test(a)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(a)?"":"px"},getDisplayType:function(a){var b=a&&a.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(b)?"inline":/^(li)$/i.test(b)?"list-item":/^(tr)$/i.test(b)?"table-row":/^(table)$/i.test(b)?"table":/^(tbody)$/i.test(b)?"table-row-group":"block"},addClass:function(a,b){a.classList?a.classList.add(b):a.className+=(a.className.length?" ":"")+b},removeClass:function(a,b){a.classList?a.classList.remove(b):a.className=a.className.toString().replace(new RegExp("(^|\\s)"+b.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(a,c,e,f){function h(a,c){var e=0;if(n<=8)e=m.css(a,c);else{var i=!1;/^(width|height)$/.test(c)&&0===v.getPropertyValue(a,"display")&&(i=!0,v.setPropertyValue(a,"display",v.Values.getDisplayType(a)));var j=function(){i&&v.setPropertyValue(a,"display","none")};if(!f){if("height"===c&&"border-box"!==v.getPropertyValue(a,"boxSizing").toString().toLowerCase()){var k=a.offsetHeight-(parseFloat(v.getPropertyValue(a,"borderTopWidth"))||0)-(parseFloat(v.getPropertyValue(a,"borderBottomWidth"))||0)-(parseFloat(v.getPropertyValue(a,"paddingTop"))||0)-(parseFloat(v.getPropertyValue(a,"paddingBottom"))||0);return j(),k}if("width"===c&&"border-box"!==v.getPropertyValue(a,"boxSizing").toString().toLowerCase()){var l=a.offsetWidth-(parseFloat(v.getPropertyValue(a,"borderLeftWidth"))||0)-(parseFloat(v.getPropertyValue(a,"borderRightWidth"))||0)-(parseFloat(v.getPropertyValue(a,"paddingLeft"))||0)-(parseFloat(v.getPropertyValue(a,"paddingRight"))||0);return j(),l}}var o;o=g(a)===d?b.getComputedStyle(a,null):g(a).computedStyle?g(a).computedStyle:g(a).computedStyle=b.getComputedStyle(a,null),"borderColor"===c&&(c="borderTopColor"),e=9===n&&"filter"===c?o.getPropertyValue(c):o[c],""!==e&&null!==e||(e=a.style[c]),j()}if("auto"===e&&/^(top|right|bottom|left)$/i.test(c)){var p=h(a,"position");("fixed"===p||"absolute"===p&&/top|left/i.test(c))&&(e=m(a).position()[c]+"px")}return e}var i;if(v.Hooks.registered[c]){var j=c,k=v.Hooks.getRoot(j);e===d&&(e=v.getPropertyValue(a,v.Names.prefixCheck(k)[0])),v.Normalizations.registered[k]&&(e=v.Normalizations.registered[k]("extract",a,e)),i=v.Hooks.extractValue(j,e)}else if(v.Normalizations.registered[c]){var l,o;l=v.Normalizations.registered[c]("name",a),"transform"!==l&&(o=h(a,v.Names.prefixCheck(l)[0]),v.Values.isCSSNullValue(o)&&v.Hooks.templates[c]&&(o=v.Hooks.templates[c][1])),i=v.Normalizations.registered[c]("extract",a,o)}if(!/^[\d-]/.test(i)){var p=g(a);if(p&&p.isSVG&&v.Names.SVGAttribute(c))if(/^(height|width)$/i.test(c))try{i=a.getBBox()[c]}catch(q){i=0}else i=a.getAttribute(c);else i=h(a,v.Names.prefixCheck(c)[0])}return v.Values.isCSSNullValue(i)&&(i=0),t.debug>=2&&console.log("Get "+c+": "+i),i},setPropertyValue:function(a,c,d,e,f){var h=c;if("scroll"===c)f.container?f.container["scroll"+f.direction]=d:"Left"===f.direction?b.scrollTo(d,f.alternateValue):b.scrollTo(f.alternateValue,d);else if(v.Normalizations.registered[c]&&"transform"===v.Normalizations.registered[c]("name",a))v.Normalizations.registered[c]("inject",a,d),h="transform",d=g(a).transformCache[c];else{if(v.Hooks.registered[c]){var i=c,j=v.Hooks.getRoot(c);e=e||v.getPropertyValue(a,j),d=v.Hooks.injectValue(i,d,e),c=j}if(v.Normalizations.registered[c]&&(d=v.Normalizations.registered[c]("inject",a,d),c=v.Normalizations.registered[c]("name",a)),h=v.Names.prefixCheck(c)[0],n<=8)try{a.style[h]=d}catch(k){t.debug&&console.log("Browser does not support ["+d+"] for ["+h+"]")}else{var l=g(a);l&&l.isSVG&&v.Names.SVGAttribute(c)?a.setAttribute(c,d):a.style[h]=d}t.debug>=2&&console.log("Set "+c+" ("+h+"): "+d)}return[h,d]},flushTransformCache:function(a){var b="",c=g(a);if((n||t.State.isAndroid&&!t.State.isChrome)&&c&&c.isSVG){var d=function(b){return parseFloat(v.getPropertyValue(a,b))},e={translate:[d("translateX"),d("translateY")],skewX:[d("skewX")],skewY:[d("skewY")],scale:1!==d("scale")?[d("scale"),d("scale")]:[d("scaleX"),d("scaleY")],rotate:[d("rotateZ"),0,0]};m.each(g(a).transformCache,function(a){/^translate/i.test(a)?a="translate":/^scale/i.test(a)?a="scale":/^rotate/i.test(a)&&(a="rotate"),e[a]&&(b+=a+"("+e[a].join(" ")+") ",delete e[a])})}else{var f,h;m.each(g(a).transformCache,function(c){return f=g(a).transformCache[c],"transformPerspective"===c?(h=f,!0):(9===n&&"rotateZ"===c&&(c="rotate"),void(b+=c+f+" "))}),h&&(b="perspective"+h+" "+b)}v.setPropertyValue(a,"transform",b)}};v.Hooks.register(),v.Normalizations.register(),t.hook=function(a,b,c){var e;return a=f(a),m.each(a,function(a,f){if(g(f)===d&&t.init(f),c===d)e===d&&(e=v.getPropertyValue(f,b));else{var h=v.setPropertyValue(f,b,c);"transform"===h[0]&&t.CSS.flushTransformCache(f),e=h}}),e};var w=function(){function a(){return i?y.promise||null:n}function e(a,e){function f(f){var n,o;if(i.begin&&0===A)try{i.begin.call(q,q)}catch(r){setTimeout(function(){throw r},1)}if("scroll"===D){var w,x,B,C=/^x$/i.test(i.axis)?"Left":"Top",E=parseFloat(i.offset)||0;i.container?p.isWrapped(i.container)||p.isNode(i.container)?(i.container=i.container[0]||i.container,w=i.container["scroll"+C],B=w+m(a).position()[C.toLowerCase()]+E):i.container=null:(w=t.State.scrollAnchor[t.State["scrollProperty"+C]],x=t.State.scrollAnchor[t.State["scrollProperty"+("Left"===C?"Top":"Left")]],B=m(a).offset()[C.toLowerCase()]+E),l={scroll:{rootPropertyValue:!1,startValue:w,currentValue:w,endValue:B,unitType:"",easing:i.easing,scrollData:{container:i.container,direction:C,alternateValue:x}},element:a},t.debug&&console.log("tweensContainer (scroll): ",l.scroll,a)}else if("reverse"===D){if(n=g(a),!n)return;if(!n.tweensContainer)return void m.dequeue(a,i.queue);"none"===n.opts.display&&(n.opts.display="auto"),"hidden"===n.opts.visibility&&(n.opts.visibility="visible"),n.opts.loop=!1,n.opts.begin=null,n.opts.complete=null,u.easing||delete i.easing,u.duration||delete i.duration,i=m.extend({},n.opts,i),o=m.extend(!0,{},n?n.tweensContainer:null);
31for(var F in o)if(o.hasOwnProperty(F)&&"element"!==F){var G=o[F].startValue;o[F].startValue=o[F].currentValue=o[F].endValue,o[F].endValue=G,p.isEmptyObject(u)||(o[F].easing=i.easing),t.debug&&console.log("reverse tweensContainer ("+F+"): "+JSON.stringify(o[F]),a)}l=o}else if("start"===D){n=g(a),n&&n.tweensContainer&&n.isAnimating===!0&&(o=n.tweensContainer);var H,K=function(b,c){var f,g,h;return p.isFunction(b)&&(b=b.call(a,e,z)),p.isArray(b)?(f=b[0],!p.isArray(b[1])&&/^[\d-]/.test(b[1])||p.isFunction(b[1])||v.RegEx.isHex.test(b[1])?h=b[1]:(p.isString(b[1])&&!v.RegEx.isHex.test(b[1])||p.isArray(b[1]))&&(g=c?b[1]:j(b[1],i.duration),b[2]!==d&&(h=b[2]))):f=b,c||(g=g||i.easing),p.isFunction(f)&&(f=f.call(a,e,z)),p.isFunction(h)&&(h=h.call(a,e,z)),[f||0,g,h]},L=function(a){return!!p.isArray(a)&&(p.isFunction(a[0])&&(a[1]===d||p.isFunction(a[1])))};m.each(s,function(a,b){if(H||(H=RegExp("^"+v.Lists.colors.join("$|^")+"$")),H.test(v.Names.camelCase(a))&&!L(b)){var c=K(b,!0),e=c[0],f=c[1],g=c[2];if(v.RegEx.isHex.test(e)){for(var h=["Red","Green","Blue"],i=v.Values.hexToRgb(e),j=g?v.Values.hexToRgb(g):d,k=0;k<h.length;k++){var l=[i[k]];f&&l.push(f),j!==d&&l.push(j[k]),s[v.Names.camelCase(a)+h[k]]=l}delete s[a]}}});for(var M in s)if(s.hasOwnProperty(M)){var N=K(s[M]),O=N[0],P=N[1],Q=N[2];M=v.Names.camelCase(M);var R=v.Hooks.getRoot(M),S=!1;if(n&&n.isSVG||"tween"===R||v.Names.prefixCheck(R)[1]!==!1||v.Normalizations.registered[R]!==d){(i.display!==d&&null!==i.display&&"none"!==i.display||i.visibility!==d&&"hidden"!==i.visibility)&&/opacity|filter/.test(M)&&!Q&&0!==O&&(Q=0),i._cacheValues&&o&&o[M]?(Q===d&&(Q=o[M].endValue+o[M].unitType),S=n.rootPropertyValueCache[R]):v.Hooks.registered[M]?Q===d?(S=v.getPropertyValue(a,R),Q=v.getPropertyValue(a,M,S)):S=v.Hooks.templates[R][1]:Q===d&&(Q=v.getPropertyValue(a,M));var T,U,V,W=!1,X=function(a,b){var c,d;return d=(b||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(a){return c=a,""}),c||(c=v.Values.getUnitType(a)),[d,c]};T=X(M,Q),Q=T[0],V=T[1],T=X(M,O),O=T[0].replace(/^([+-\/*])=/,function(a,b){return W=b,""}),U=T[1],Q=parseFloat(Q)||0,O=parseFloat(O)||0,"%"===U&&(/^(fontSize|lineHeight)$/.test(M)?(O/=100,U="em"):/^scale/.test(M)?(O/=100,U=""):/(Red|Green|Blue)$/i.test(M)&&(O=O/100*255,U=""));var Y=function(){var d={myParent:a.parentNode||c.body,position:v.getPropertyValue(a,"position"),fontSize:v.getPropertyValue(a,"fontSize")},e=d.position===I.lastPosition&&d.myParent===I.lastParent,f=d.fontSize===I.lastFontSize;I.lastParent=d.myParent,I.lastPosition=d.position,I.lastFontSize=d.fontSize;var g=100,h={};if(f&&e)h.emToPx=I.lastEmToPx,h.percentToPxWidth=I.lastPercentToPxWidth,h.percentToPxHeight=I.lastPercentToPxHeight;else{var i=n&&n.isSVG?c.createElementNS("http://www.w3.org/2000/svg","rect"):c.createElement("div");t.init(i),d.myParent.appendChild(i),m.each(["overflow","overflowX","overflowY"],function(a,b){t.CSS.setPropertyValue(i,b,"hidden")}),t.CSS.setPropertyValue(i,"position",d.position),t.CSS.setPropertyValue(i,"fontSize",d.fontSize),t.CSS.setPropertyValue(i,"boxSizing","content-box"),m.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(a,b){t.CSS.setPropertyValue(i,b,g+"%")}),t.CSS.setPropertyValue(i,"paddingLeft",g+"em"),h.percentToPxWidth=I.lastPercentToPxWidth=(parseFloat(v.getPropertyValue(i,"width",null,!0))||1)/g,h.percentToPxHeight=I.lastPercentToPxHeight=(parseFloat(v.getPropertyValue(i,"height",null,!0))||1)/g,h.emToPx=I.lastEmToPx=(parseFloat(v.getPropertyValue(i,"paddingLeft"))||1)/g,d.myParent.removeChild(i)}return null===I.remToPx&&(I.remToPx=parseFloat(v.getPropertyValue(c.body,"fontSize"))||16),null===I.vwToPx&&(I.vwToPx=parseFloat(b.innerWidth)/100,I.vhToPx=parseFloat(b.innerHeight)/100),h.remToPx=I.remToPx,h.vwToPx=I.vwToPx,h.vhToPx=I.vhToPx,t.debug>=1&&console.log("Unit ratios: "+JSON.stringify(h),a),h};if(/[\/*]/.test(W))U=V;else if(V!==U&&0!==Q)if(0===O)U=V;else{h=h||Y();var Z=/margin|padding|left|right|width|text|word|letter/i.test(M)||/X$/.test(M)||"x"===M?"x":"y";switch(V){case"%":Q*="x"===Z?h.percentToPxWidth:h.percentToPxHeight;break;case"px":break;default:Q*=h[V+"ToPx"]}switch(U){case"%":Q*=1/("x"===Z?h.percentToPxWidth:h.percentToPxHeight);break;case"px":break;default:Q*=1/h[U+"ToPx"]}}switch(W){case"+":O=Q+O;break;case"-":O=Q-O;break;case"*":O=Q*O;break;case"/":O=Q/O}l[M]={rootPropertyValue:S,startValue:Q,currentValue:Q,endValue:O,unitType:U,easing:P},t.debug&&console.log("tweensContainer ("+M+"): "+JSON.stringify(l[M]),a)}else t.debug&&console.log("Skipping ["+R+"] due to a lack of browser support.")}l.element=a}l.element&&(v.Values.addClass(a,"velocity-animating"),J.push(l),n=g(
31a),n&&(""===i.queue&&(n.tweensContainer=l,n.opts=i),n.isAnimating=!0),A===z-1?(t.State.calls.push([J,q,i,null,y.resolver]),t.State.isTicking===!1&&(t.State.isTicking=!0,k())):A++)}var h,i=m.extend({},t.defaults,u),l={};switch(g(a)===d&&t.init(a),parseFloat(i.delay)&&i.queue!==!1&&m.queue(a,i.queue,function(b){t.velocityQueueEntryFlag=!0,g(a).delayTimer={setTimeout:setTimeout(b,parseFloat(i.delay)),next:b}}),i.duration.toString().toLowerCase()){case"fast":i.duration=200;break;case"normal":i.duration=r;break;case"slow":i.duration=600;break;default:i.duration=parseFloat(i.duration)||1}t.mock!==!1&&(t.mock===!0?i.duration=i.delay=1:(i.duration*=parseFloat(t.mock)||1,i.delay*=parseFloat(t.mock)||1)),i.easing=j(i.easing,i.duration),i.begin&&!p.isFunction(i.begin)&&(i.begin=null),i.progress&&!p.isFunction(i.progress)&&(i.progress=null),i.complete&&!p.isFunction(i.complete)&&(i.complete=null),i.display!==d&&null!==i.display&&(i.display=i.display.toString().toLowerCase(),"auto"===i.display&&(i.display=t.CSS.Values.getDisplayType(a))),i.visibility!==d&&null!==i.visibility&&(i.visibility=i.visibility.toString().toLowerCase()),i.mobileHA=i.mobileHA&&t.State.isMobile&&!t.State.isGingerbread,i.queue===!1?i.delay?setTimeout(f,i.delay):f():m.queue(a,i.queue,function(a,b){return b===!0?(y.promise&&y.resolver(q),!0):(t.velocityQueueEntryFlag=!0,void f(a))}),""!==i.queue&&"fx"!==i.queue||"inprogress"===m.queue(a)[0]||m.dequeue(a)}var h,i,n,o,q,s,u,x=arguments[0]&&(arguments[0].p||m.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||p.isString(arguments[0].properties));p.isWrapped(this)?(i=!1,o=0, 32q=this,n=this):(i=!0,o=1,q=x?arguments[0].elements||arguments[0].e:arguments[0]);var y={promise:null,resolver:null,rejecter:null};if(i&&t.Promise&&(y.promise=new t.Promise(function(a,b){y.resolver=a,y.rejecter=b})),x?(s=arguments[0].properties||arguments[0].p,u=arguments[0].options||arguments[0].o):(s=arguments[o],u=arguments[o+1]),q=f(q),!q)return void(y.promise&&(s&&u&&u.promiseRejectEmpty===!1?y.resolver():y.rejecter()));var z=q.length,A=0;if(!/^(stop|finish|finishAll)$/i.test(s)&&!m.isPlainObject(u)){var B=o+1;u={};for(var C=B;C<arguments.length;C++)p.isArray(arguments[C])||!/^(fast|normal|slow)$/i.test(arguments[C])&&!/^\d/.test(arguments[C])?p.isString(arguments[C])||p.isArray(arguments[C])?u.easing=arguments[C]:p.isFunction(arguments[C])&&(u.complete=arguments[C]):u.duration=arguments[C]}var D;switch(s){case"scroll":D="scroll";break;case"reverse":D="reverse";break;case"finish":case"finishAll":case"stop":m.each(q,function(a,b){g(b)&&g(b).delayTimer&&(clearTimeout(g(b).delayTimer.setTimeout),g(b).delayTimer.next&&g(b).delayTimer.next(),delete g(b).delayTimer),"finishAll"!==s||u!==!0&&!p.isString(u)||(m.each(m.queue(b,p.isString(u)?u:""),function(a,b){p.isFunction(b)&&b()}),m.queue(b,p.isString(u)?u:"",[]))});var E=[];return m.each(t.State.calls,function(a,b){b&&m.each(b[1],function(c,e){var f=u===d?"":u;return f!==!0&&b[2].queue!==f&&(u!==d||b[2].queue!==!1)||void m.each(q,function(c,d){if(d===e)if((u===!0||p.isString(u))&&(m.each(m.queue(d,p.isString(u)?u:""),function(a,b){p.isFunction(b)&&b(null,!0)}),m.queue(d,p.isString(u)?u:"",[])),"stop"===s){var h=g(d);h&&h.tweensContainer&&f!==!1&&m.each(h.tweensContainer,function(a,b){b.endValue=b.currentValue}),E.push(a)}else"finish"!==s&&"finishAll"!==s||(b[2].duration=1)})})}),"stop"===s&&(m.each(E,function(a,b){l(b,!0)}),y.promise&&y.resolver(q)),a();default:if(!m.isPlainObject(s)||p.isEmptyObject(s)){if(p.isString(s)&&t.Redirects[s]){h=m.extend({},u);var F=h.duration,G=h.delay||0;return h.backwards===!0&&(q=m.extend(!0,[],q).reverse()),m.each(q,function(a,b){parseFloat(h.stagger)?h.delay=G+parseFloat(h.stagger)*a:p.isFunction(h.stagger)&&(h.delay=G+h.stagger.call(b,a,z)),h.drag&&(h.duration=parseFloat(F)||(/^(callout|transition)/.test(s)?1e3:r),h.duration=Math.max(h.duration*(h.backwards?1-a/z:(a+1)/z),.75*h.duration,200)),t.Redirects[s].call(b,b,h||{},a,z,q,y.promise?y:d)}),a()}var H="Velocity: First argument ("+s+") was not a property map, a known action, or a registered redirect. Aborting.";return y.promise?y.rejecter(new Error(H)):console.log(H),a()}D="start"}var I={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},J=[];m.each(q,function(a,b){p.isNode(b)&&e(b,a)}),h=m.extend({},t.defaults,u),h.loop=parseInt(h.loop,10);var K=2*h.loop-1;if(h.loop)for(var L=0;L<K;L++){var M={delay:h.delay,progress:h.progress};L===K-1&&(M.display=h.display,M.visibility=h.visibility,M.complete=h.complete),w(q,"reverse",M)}return a()};t=m.extend(w,t),t.animate=w;var x=b.requestAnimationFrame||o;return t.State.isMobile||c.hidden===d||c.addEventListener("visibilitychange",function(){c.hidden?(x=function(a){return setTimeout(function(){a(!0)},16)},k()):x=b.requestAnimationFrame||o}),a.Velocity=t,a!==b&&(a.fn.velocity=w,a.fn.velocity.defaults=t.defaults),m.each(["Down","Up"],function(a,b){t.Redirects["slide"+b]=function(a,c,e,f,g,h){var i=m.extend({},c),j=i.begin,k=i.complete,l={},n={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""};i.display===d&&(i.display="Down"===b?"inline"===t.CSS.Values.getDisplayType(a)?"inline-block":"block":"none"),i.begin=function(){0===e&&j&&j.call(g,g);for(var c in n)if(n.hasOwnProperty(c)){l[c]=a.style[c];var d=v.getPropertyValue(a,c);n[c]="Down"===b?[d,0]:[0,d]}l.overflow=a.style.overflow,a.style.overflow="hidden"},i.complete=function(){for(var b in l)l.hasOwnProperty(b)&&(a.style[b]=l[b]);e===f-1&&(k&&k.call(g,g),h&&h.resolver(g))},t(a,n,i)}}),m.each(["In","Out"],function(a,b){t.Redirects["fade"+b]=function(a,c,e,f,g,h){var i=m.extend({},c),j=i.complete,k={opacity:"In"===b?1:0};0!==e&&(i.begin=null),e!==f-1?i.complete=null:i.complete=function(){j&&j.call(g,g),h&&h.resolver(g)}
32,i.display===d&&(i.display="In"===b?"auto":"none"),t(this,k,i)}}),t}(window.jQuery||window.Zepto||window,window,document)}); 33 34 35/*! Hammer.JS - v2.0.8 - 2016-04-23 36 * http://hammerjs.github.io/ 37 * 38 * Copyright (c) 2016 Jorik Tangelder; 39 * Licensed under the MIT license */
vendor: 20,623 bytes, lines 39-41
39 40!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"\n"+d+" AT \n";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return ua++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h(function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a},"extend","Use `assign`."),ta=h(function(a,b){return sa(a,b,!0)},"merge","Use `assign`."),ua=1,va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=rb,this.tryEmit()},b.interval,this),ob):rb}return tb},failTimeout:function(){return this._timer=e(function(){this.state=tb},this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ha.VERSION="2.0.8",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]}),this}},emit:function(a,b){this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIRECTION_HORIZONTAL:Na,DIRECTION_VERTICAL:Oa,DIRECTION_ALL:Pa,Manager:ia,Input:x,TouchAction:V,TouchInput:P,MouseInput:L,PointerEventInput:M,TouchMouseInput:R,SingleTouchInput:N,Recognizer:Y,AttrRecognizer:aa,Tap:ga,Pan:ba,Swipe:fa,Pinch:ca,Rotate:ea,Press:da,on:m,off:n,each:g,merge:ta,extend:sa,assign:la,inherit:i,bindFn:j,prefixed:u});var wb="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};wb.Hammer=ha,"function"==typeof define&&define.amd?define(function(){return ha}):"undefined"!=typeof module&&module.exports?module.exports=ha:a[c]=ha}(window,document,"Hammer"); 41//# sourceMappingURL=hammer.min.js.map
41 42 43 44/*! 45* FitVids 1.1 46* 47* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com 48* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ 49* Released under the WTFPL license - http://sam.zoy.org/wtfpl/ 50* 51*/ 52 53(function( $ ){ 54 55 'use strict'; 56 57 $.fn.fitVids = function( options ) { 58 var settings = { 59 customSelector: null, 60 ignore: null 61 }; 62 63 if(!document.getElementById('fit-vids-style')) { 64 // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js 65 var head = document.head || document.getElementsByTagName('head')[0]; 66 var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}'; 67 var div = document.createElement("div"); 68 div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>'; 69 head.appendChild(div.childNodes[1]); 70 } 71 72 if ( options ) { 73 $.extend( settings, options ); 74 } 75 76 return this.each(function(){ 77 var selectors = [ 78 'iframe[src*="player.vimeo.com"]', 79 'iframe[src*="youtube.com"]', 80 'iframe[src*="youtube-nocookie.com"]', 81 'iframe[src*="kickstarter.com"][src*="video.html"]', 82 'object', 83 'embed' 84 ]; 85 86 if (settings.customSelector) { 87 selectors.push(settings.customSelector); 88 } 89 90 var ignoreList = '.fitvidsignore'; 91 92 if(settings.ignore) { 93 ignoreList = ignoreList + ', ' + settings.ignore; 94 } 95 96 var $allVideos = $(this).find(selectors.join(',')); 97 $allVideos = $allVideos.not('object object'); // SwfObj conflict patch 98 $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video. 99 100 $allVideos.each(function(count){ 101 var $this = $(this); 102 if($this.parents(ignoreList).length > 0) { 103 return; // Disable FitVids on this video. 104 } 105 if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; } 106 if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width')))) 107 { 108 $this.attr('height', 9); 109 $this.attr('width', 16); 110 } 111 var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(), 112 width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(), 113 aspectRatio = height / width; 114 if(!$this.attr('id')){ 115 var videoID = 'fitvid' + count; 116 $this.attr('id', videoID); 117 } 118 $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%'); 119 $this.removeAttr('height').removeAttr('width'); 120 }); 121 }); 122 }; 123// Works with either jQuery or Zepto 124})( window.jQuery || window.Zepto ); 125 126 127/* Placeholders.js v4.0.1 */ 128/*! 129 * The MIT License 130 * 131 * Copyright (c) 2012 James Allardice 132 * 133 * Permission is hereby granted, free of charge, to any person obtaining a copy 134 * of this software and associated documentation files (the "Software"), to 135 * deal in the Software without restriction, including without limitation the 136 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 137 * sell copies of the Software, and to permit persons to whom the Software is 138 * furnished to do so, subject to the following conditions: 139 * 140 * The above copyright notice and this permission notice shall be included in 141 * all copies or substantial portions of the Software. 142 * 143 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 144 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 145 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 146 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 147 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 148 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 149 * IN THE SOFTWARE. 150 */ 151!function(a){"use strict";function b(){}function c(){try{return document.activeElement}catch(a){}}function d(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return!0;return!1}function e(a,b,c){return a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):void 0}function f(a,b){var c;a.createTextRange?(c=a.createTextRange(),c.move("character",b),c.select()):a.selectionStart&&(a.focus(),a.setSelectionRange(b,b))}function g(a,b){try{return a.type=b,!0}catch(c){return!1}}function h(a,b){if(a&&a.getAttribute(B))b(a);else for(var c,d=a?a.getElementsByTagName("input"):N,e=a?a.getElementsByTagName("textarea"):O,f=d?d.length:0,g=e?e.length:0,h=f+g,i=0;h>i;i++)c=f>i?d[i]:e[i-f],b(c)}function i(a){h(a,k)}function j(a){h(a,l)}function k(a,b){var c=!!b&&a.value!==b,d=a.value===a.getAttribute(B);if((c||d)&&"true"===a.getAttribute(C)){a.removeAttribute(C),a.value=a.value.replace(a.getAttribute(B),""),a.className=a.className.replace(A,"");var e=a.getAttribute(I);parseInt(e,10)>=0&&(a.setAttribute("maxLength",e),a.removeAttribute(I));var f=a.getAttribute(D);return f&&(a.type=f),!0}return!1}function l(a){var b=a.getAttribute(B);if(""===a.value&&b){a.setAttribute(C,"true"),a.value=b,a.className+=" "+z;var c=a.getAttribute(I);c||(a.setAttribute(I,a.maxLength),a.removeAttribute("maxLength"));var d=a.getAttribute(D);return d?a.type="text":"password"===a.type&&g(a,"text")&&a.setAttribute(D,"password"),!0}return!1}function m(a){return function(){P&&a.value===a.getAttribute(B)&&"true"===a.getAttribute(C)?f(a,0):k(a)}}function n(a){return function(){l(a)}}function o(a){return function(){i(a)}}function p(a){return function(b){return v=a.value,"true"===a.getAttribute(C)&&v===a.getAttribute(B)&&d(x,b.keyCode)?(b.preventDefault&&b.preventDefault(),!1):void 0}}
151function q(a){return function(){k(a,v),""===a.value&&(a.blur(),f(a,0))}}function r(a){return function(){a===c()&&a.value===a.getAttribute(B)&&"true"===a.getAttribute(C)&&f(a,0)}}function s(a){var b=a.form;b&&"string"==typeof b&&(b=document.getElementById(b),b.getAttribute(E)||(e(b,"submit",o(b)),b.setAttribute(E,"true"))),e(a,"focus",m(a)),e(a,"blur",n(a)),P&&(e(a,"keydown",p(a)),e(a,"keyup",q(a)),e(a,"click",r(a))),a.setAttribute(F,"true"),a.setAttribute(B,T),(P||a!==c())&&l(a)}var t=document.createElement("input"),u=void 0!==t.placeholder;if(a.Placeholders={nativeSupport:u,disable:u?b:i,enable:u?b:j},!u){var v,w=["text","search","url","tel","email","password","number","textarea"],x=[27,33,34,35,36,37,38,39,40,8,46],y="#ccc",z="placeholdersjs",A=new RegExp("(?:^|\\s)"+z+"(?!\\S)"),B="data-placeholder-value",C="data-placeholder-active",D="data-placeholder-type",E="data-placeholder-submit",F="data-placeholder-bound",G="data-placeholder-focus",H="data-placeholder-live",I="data-placeholder-maxlength",J=100,K=document.getElementsByTagName("head")[0],L=document.documentElement,M=a.Placeholders,N=document.getElementsByTagName("input"),O=document.getElementsByTagName("textarea"),P="false"===L.getAttribute(G),Q="false"!==L.getAttribute(H),R=document.createElement("style");R.type="text/css";var S=document.createTextNode("."+z+" {color:"+y+";}");R.styleSheet?R.styleSheet.cssText=S.nodeValue:R.appendChild(S),K.insertBefore(R,K.firstChild);for(var T,U,V=0,W=N.length+O.length;W>V;V++)U=V<N.length?N[V]:O[V-N.length],T=U.attributes.placeholder,T&&(T=T.nodeValue,T&&d(w,U.type)&&s(U));var X=setInterval(function(){for(var a=0,b=N.length+O.length;b>a;a++)U=a<N.length?N[a]:O[a-N.length],T=U.attributes.placeholder,T?(T=T.nodeValue,T&&d(w,U.type)&&(U.getAttribute(F)||s(U),(T!==U.getAttribute(B)||"password"===U.type&&!U.getAttribute(D))&&("password"===U.type&&!U.getAttribute(D)&&g(U,"text")&&U.setAttribute(D,"password"),U.value===U.getAttribute(B)&&(U.value=T),U.setAttribute(B,T)))):U.getAttribute(C)&&(k(U),U.removeAttribute(B));Q||clearInterval(X)},J);e(a,"beforeunload",function(){M.disable()})}}(this),function(a,b){"use strict";var c=a.fn.val,d=a.fn.prop;b.Placeholders.nativeSupport||(a.fn.val=function(a){var b=c.apply(this,arguments),d=this.eq(0).data("placeholder-value");return void 0===a&&this.eq(0).data("placeholder-active")&&b===d?"":b},a.fn.prop=function(a,b){return void 0===b&&this.eq(0).data("placeholder-active")&&"value"===a?"":d.apply(this,arguments)})}(jQuery,this); 152 153 154( function( $ ) { 155 156 var pluginName = 'Slidr', 157 defaults = { 158 slides: '.slidr', 159 navid: '', 160 navclass: '', 161 active: 'current', 162 nextprev: false, 163 navitoparent: false, 164 navitoelm: false, 165 resizeslides: false, 166 speed: 500, 167 changespeed: 7000, 168 automate: false, 169 interrupt: true, 170 animation: 'fade' 171 }, 172 args = {}; 173 174 function Slidr( element, args ) { 175 176 this.wrapper = $( element ); 177 this.args = $.extend( {}, defaults, args ); 178 179 this.init(); 180 181 } 182 183 Slidr.prototype.init = function() { 184 185 var base = this; 186 187 this.containerWidth = this.wrapper.width(), 188 this.slidesCollection = $( this.args.slides, this.wrapper ); 189 this.activeClass = '.' + this.args.active; 190 this.activeidx = 0; 191 this.animated = false; 192 this.Hammer = null; 193 this.resizer = null; 194 195 this.slidesCollection 196 .eq( 0 ) 197 .addClass( this.args.active ); 198 199 if( this.args.resizeslides ) 200 this.resizeSlides(); 201 else 202 this.positionSlides(); 203 204 this.addNavigation(); 205 206 } 207 208 Slidr.prototype.getLowest = function() { 209 210 return Math.min.apply( null, this.slidesCollection.map( function() { return $( this ).outerHeight(); }).get() ); 211 212 } 213 214 Slidr.prototype.getHighest = function() { 215 216 return Math.max.apply( null, this.slidesCollection.map( function() { return $( this ).outerHeight(); }).get() ); 217 218 } 219 220 Slidr.prototype.resizeSlides = function() { 221 222 var base = this; 223 base.resizer = this.slidesCollection.eq( 0 ).clone(); 224 225 base.resizer 226 .removeClass( this.args.active ) 227 .addClass( 'resizer' ) 228 .css({ position: 'relative', left: 0, top: 0, width: '100%', opacity: 0, zIndex: -1 }) 229 .appendTo( this.wrapper ); 230 231 this.slidesCollection.eq( 0 ) 232 .css({ position: 'absolute', left: 0 }); 233 234 } 235
236 Slidr.prototype.positionSlides = function() { 237 238 this.wrapper 239 .css({ minHeight: this.getHighest() }); 240 241 this.slidesCollection.eq( 0 ) 242 .css({ position: 'absolute', left: 0 }); 243 244 } 245 246 Slidr.prototype.addNavigation = function() { 247 248 if( this.slidesCollection.length > 1 ) { 249 250 var base = this; 251 252 this.navi = $( '<div />', { id: this.args.navid, 'class': 'slidr-nav' }).addClass( this.args.navclass ); 253 var $pagenums = $( '<ul />', { 'class': 'slidr-pagenums' }); 254 255 for( var i = 0; i < this.slidesCollection.length; ++i ) { 256 257 $( '<li />', { 'class': 'slidr-dots', html: ( i + 1 ) }) 258 .appendTo( $pagenums ); 259 260 } 261 262 $pagenums 263 .appendTo( this.navi ); 264 265 var $dots = $( '.slidr-dots', this.navi ); 266 267 $dots 268 .eq( 0 ) 269 .addClass( this.args.active ); 270 271 $dots 272 .on( 'click', function( e, param ) { 273 274 if( !$( this ).hasClass( base.args.active ) && base.animated === false ) { 275 276 base.activeidx = $( '.slidr-dots', base.navi ).index( $( '.current', base.navi ) ); 277 base.targetidx = $( '.slidr-dots', base.navi ).index( $( this ) ); 278 279 base.startpos = '100%'; 280 base.endpos = '-100%'; 281 282 if( ( base.targetidx < base.activeidx && param !== 'next' ) || param === 'prev' ) { 283 284 base.startpos = '-100%'; 285 base.endpos = '100%'; 286 287 } 288 289 base.moveSlides(); 290 291 $( base.activeClass, base.navi ) 292 .removeClass( base.args.active ); 293 294 $( this ) 295 .addClass( base.args.active ); 296 297 } 298 299 }); 300 301 302 this.prev = $( '<div />', { 'class': 'slidr-nextprev prev', html: '‹' }) 303 .appendTo( this.navi ); 304 305 this.next = $( '<div />', { 'class': 'slidr-nextprev next', html: '›' }) 306 .appendTo( this.navi ); 307 308 this.prev.on( 'click', function() { 309 310 if( base.animated === false ) { 311 312 var activeidx = $dots.index( $( '.current', base.navi ) ); 313 var targetidx = activeidx - 1; 314 315 if( targetidx < 0 ) 316 targetidx = base.slidesCollection.length - 1; 317 318 $dots 319 .eq( targetidx ) 320 .trigger( 'click', 'prev' ); 321 322 } 323 324 }); 325 326 this.next.on( 'click', function() { 327 328 if( base.animated === false ) { 329 330 var activeidx = $dots.index( $( '.current', base.navi ) ); 331 var targetidx = activeidx + 1; 332 333 if( targetidx > base.slidesCollection.length - 1 ) 334 335 targetidx = 0; 336 337 $dots 338 .eq( targetidx ) 339 .trigger( 'click', 'next' ); 340 341 } 342 343 }); 344 345 if( this.args.nextprev === false ) { 346 347 this.prev.hide(); 348 this.next.hide(); 349 350 } 351 352 if( this.args.navitoparent ) { 353 354 this.navi 355 .appendTo( this.wrapper.parent() ); 356 357 } 358 else if( this.args.navitoelm !== false ) { 359 360 this.navi 361 .appendTo( $( this.args.navitoelm, this.wrapper ) ); 362 363 } 364 else { 365 366 this.navi 367 .appendTo( this.wrapper ); 368 369 } 370 371 if( Modernizr.touch === true ) { 372 373 this.bindTouchEvents(); 374 375 } 376 377 if( base.args.automate === true ) { 378 379 if( Modernizr.touch !== true && base.args.interrupt === true ) { 380 381 $( base.wrapper ).on({ 382 383 mouseenter: function() { 384 385 clearInterval( base.changer ); 386 387 }, 388 mouseleave: function() { 389 390 base.automateChange(); 391 392 } 393 394 }); 395 396 } 397 398 base.automateChange(); 399 400 } 401 402 } 403 404 } 405 406 Slidr.prototype.bindTouchEvents = function() { 407 408 var base = this; 409 410 var mc = new Hammer.Manager( this.wrapper.get( 0 ) ); 411 mc.add( new Hammer.Pan({ direction: Hammer.DIRECTION_HORIZONTAL, threshold: 80, pointers: 0 }) ); 412 413 mc.on( 'panend', function( ev ) { 414 415 if( ev.direction == Hammer.DIRECTION_RIGHT ) { 416 417 base.swipeactions( 'right' ); 418 419 } 420 421 if( ev.direction == Hammer.DIRECTION_LEFT ) { 422 423 base.swipeactions( 'left' ); 424 425 } 426 427 }); 428 429 } 430 431 Slidr.prototype.swipeactions = function( dir ) { 432 433 switch( dir ) { 434 435 case 'left': 436 437 var $elm = this.next; 438 439 break; 440 441 case 'right': 442 443 var $elm = this.prev; 444 445 break; 446 447 } 448 449 if( this.args.automate === true ) { 450 451 clearInterval( this.changer ); 452 453 } 454 455 $elm 456 .trigger( 'click' ); 457 458 if( this.args.automate === true ) { 459 460 this.automateChange(); 461 462 } 463 464 } 465
466 Slidr.prototype.automateChange = function() { 467 468 var base = this; 469 470 base.changer = setInterval( function() { 471 472 if( base.activeidx < ( base.slidesCollection.length - 1 ) ) { 473 474 var targetidx = base.activeidx + 1; 475 476 } 477 else { 478 479 var targetidx = 0; 480 481 } 482 483 $( '.slidr-dots', base.navi ) 484 .eq( targetidx ) 485 .trigger( 'click' ); 486 487 }, base.args.changespeed ); 488 489 } 490 491 Slidr.prototype.moveSlides = function() { 492 493 var base = this; 494 this.animated = true; 495 496 $cur = this.slidesCollection.eq( this.activeidx ); 497 $trg = this.slidesCollection.eq( this.targetidx ); 498/* 499 if( !Modernizr.csstransitions ) { 500 501 $.fn.velocity = $.fn.animate; 502 503 } 504*/ 505 if( base.args.animation == 'fade' ) { 506 507 var css = { cur: { zIndex: 2 }, trg: { display: 'block', left: 0, opacity: 0, zIndex: 3 } }; 508 var anim = { cur: { opacity: 0 }, trg: { opacity: 1 } }; 509 510 } 511 512 if( base.args.animation == 'slide' ) { 513 514 var css = { cur: { zIndex: 2, opacity: 1 }, trg: { display: 'block', left: base.startpos, zIndex: 3, opacity: 0 } }; 515 var anim = { cur: { left: base.endpos, delay: 100, opacity: 0 }, trg: { left: 0, opacity: 1 } }; 516 517 } 518 519 $cur 520 .removeClass( this.args.active ) 521 .css( css.cur ) 522 .velocity( anim.cur, base.args.speed, 'easeInOutCubic', function() { 523 524 $cur 525 .css({ display: 'none' }); 526 527 }); 528 529 $trg 530 .addClass( base.args.active ) 531 .css( css.trg ) 532 .velocity( anim.trg, base.args.speed, 'easeInOutCubic', function() { 533 534 setTimeout( function() { 535 536 base.animated = false; 537 538 }, 100 ); 539 540 }); 541 542 this.activeidx = this.targetidx; 543 544 } 545 546 $.fn[ pluginName ] = function( options ) { 547 548 return this.each( function() { 549 550 if( !$.data( this, 'plugin_' + pluginName ) ) { 551 552 $.data( this, 'plugin_' + pluginName, new Slidr( this, options ) ); 553 554 } 555 556 }); 557 558 } 559 560}( jQuery, window ) ); 561 562 563( function( $ ) { 564 565 var pluginName = 'imageView'; 566 567 function imageView( elements ) { 568 569 this.elms = elements; 570 this.elms.on( 'click', $.proxy( this.clickevent, this ) ); 571 572 return elements; 573 574 } 575 576 577 imageView.prototype.clickevent = function ( e ) { 578 579 e.preventDefault(); 580 this.current = this.elms.index( e.currentTarget ); 581 this.elm = this.elms.eq( this.current ); 582 583 this.init(); 584 585 } 586 587 588 imageView.prototype.init = function () { 589 590 var base = this; 591 592 this.parts = {}; 593 this.viewactive = false; 594 this.timer = null; 595 this.imgloader = new Image(); 596 this.Hammer = null; 597 598 $( this.imgloader ) 599 .on({ 600 601 'load.imageView': function() { 602 603 clearTimeout( base.timer ); 604 605 base.parts.loading 606 .css({ opacity: 0 }); 607 608 base.parts.image 609 .attr({ src: base.elmsrc }); 610 611 base.parts.box 612 .css({ opacity: 0 }); 613 614 base.origsize = { width: this.width, height: this.height }; 615 base.imagesize = $.extend( {}, base.origsize ); 616 617 setTimeout( function() { 618 619 base.showImageView({ data: { initial: true } }); 620 621 }, 200 ); 622 623 }, 624 'error.imageView': function() { 625 626 alert( 'Error loading image.' ); 627 base.removeImageView(); 628 629 } 630 631 }); 632 633 634 $( window ) 635 .on( 'resize.imageView', { initial: false }, $.proxy( this, 'showImageView' ) ); 636 637 638 $( document ) 639 .on( 'keyup.imageView', function( e ) { 640 641 switch( e.which ) { 642 643 case 27: 644 645 base.removeImageView(); 646 647 break; 648 649 case 37: 650 651 base.changeImageViewImage({ data: { dir: 'prev' } }); 652 653 break; 654 655 case 39: 656 657 base.changeImageViewImage({ data: { dir: 'next' } }); 658 659 break; 660 661 } 662 663 }); 664 665 this.generateImageViewParts(); 666 667 } 668 669 670 imageView.prototype.getViewport = function() { 671 672 this.viewport = { width: $( window ).width(), height: $( window ).height() }; 673 674 } 675 676 677 imageView.prototype.getImageViewOffsets = function() { 678 679 this.offset = { width: ( this.parts.box.outerWidth( true ) - this.parts.box.width() ), height: ( this.parts.box.outerHeight( true ) - this.parts.box.height() ) }; 680 681 } 682 683 684 imageView.prototype.sprintf = function( format, etc ) { 685 686 var arg = arguments; 687 var i = 1; 688 return format.replace( /%((%)|s)/g, function( m ) { return m[ 2 ] || arg[ i++ ] }); 689 690 } 691 692 693 imageView.prototype.resizeImageViewImage = function( initial ) { 694 695 this.getViewport(); 696 this.getImageViewOffsets(); 697 698 if( Modernizr.touch ) 699 var margins = { x: 30, y: 90 }; 700 else 701 var margins = { x: 120, y: 90 }; 702 703 if( initial !== true ) 704 this.imagesize = $.extend( {}, this.origsize ); 705 706 if( ( this.imagesize.height + this.offset.height ) > ( this.viewport.height - margins.y ) ) { 707 708 var imageAR = this.imagesize.height / this.imagesize.width; 709 710 this.imagesize.height = this.viewport.height - margins.y;
711 this.imagesize.width = this.imagesize.height / imageAR; 712 713 } 714 715 if( ( this.imagesize.width + this.offset.width ) > ( this.viewport.width - margins.x ) ) { 716 717 var imageAR = this.imagesize.width / this.imagesize.height; 718 719 this.imagesize.width = this.viewport.width - margins.x; 720 this.imagesize.height = this.imagesize.width / imageAR; 721 722 } 723 724 this.parts.image 725 .attr({ width: this.imagesize.width, height: this.imagesize.height }); 726 727 this.parts.imagewrap 728 .css({ width: this.imagesize.width, height: this.imagesize.height }); 729 730 } 731 732 733 imageView.prototype.generateImageViewParts = function() { 734 735 this.parts.shade = $( '<div />', { id: 'imageview-shade' }).css({ opacity: 0.9 }).on( 'click.imageView', $.proxy( this, 'removeImageView' ) ); 736 this.parts.loading = $( '<div />', { id: 'imageview-loading', html: 'loading..' } ).css({ opacity: 0 }).appendTo( this.parts.shade ); 737 this.parts.box = $( '<div />', { id: 'imageview-box' }); 738 this.parts.imagewrap = $( '<div />', { id: 'imageview-imagewrap' }).appendTo( this.parts.box ); 739 this.parts.image = $( '<img />', { id: 'imageview-image' }).appendTo( this.parts.imagewrap ); 740 this.parts.caption = $( '<div />', { id: 'imageview-caption' }).appendTo( this.parts.box ); 741 742 if( Modernizr.touch === true ) { 743 744 this.parts.box 745 .addClass( 'mobile' ); 746 747 if( $( 'body' ).data( 'imageview-init' ) !== true ) { 748 749 $( 'body' ) 750 .data( 'imageview-init', true ); 751 752 753 } 754 755 } 756 else { 757 758 this.parts.closer = $( '<a />', { id: 'imageview-close', html: '×' }).on( 'click.imageView', $.proxy( this, 'removeImageView' ) ).appendTo( this.parts.box ); 759 760 if( this.elms.length > 1 ) { 761 762 this.parts.prev = $( '<a />', { id: 'imageview-prev', html: '‹' }).on( 'click.imageView', { dir: 'prev' }, $.proxy( this, 'changeImageViewImage' ) ).appendTo( this.parts.box ); 763 this.parts.next = $( '<a />', { id: 'imageview-next', html: '›' }).on( 'click.imageView', { dir: 'next' }, $.proxy( this, 'changeImageViewImage' ) ).appendTo( this.parts.box ); 764 765 } 766 767 } 768 769 if( !this.viewactive ) { 770 771 this.parts.shade 772 .appendTo( 'body' ); 773 774 this.parts.box 775 .appendTo( 'body' ); 776 777 if( Modernizr.touch === true ) { 778 779 this.bindTouchEvents(); 780 781 } 782 783 this.viewactive = true; 784 785 } 786 787 this.loadImageViewImage(); 788 789 } 790 791 792 imageView.prototype.loadImageViewImage = function() { 793 794 var base = this; 795 this.elmsrc = this.elm.attr( 'href' ); 796 797 this.timer = setTimeout( function() { 798 799 base.parts.loading 800 .css({ left: 0, top: '50%', opacity: 0.5, fontSize: 51 }); 801 802 }, 1000 ); 803 804 $( this.imgloader ) 805 .attr({ src: this.elmsrc }); 806 807 } 808 809 810 imageView.prototype.showImageView = function( e ) { 811 812 var caption = $( 'img', this.elm ).attr( 'alt' ); 813 814 if( typeof( caption ) == 'undefined' || caption != '' || caption != ' ' ) { 815 816 caption = this.elm.data( 'caption' ); 817 818 } 819 820 if( typeof( caption ) != 'undefined' && caption != '' && caption != ' ' ) { 821 822 this.parts.caption.html( caption ).show(); 823 824 } 825 else { 826 827 this.parts.caption.hide(); 828 829 } 830 831 this.resizeImageViewImage( e.data.initial ); 832 833 var posleft = parseInt( ( this.viewport.width - ( this.imagesize.width + this.offset.width ) ) / 2 ); 834 var postop = parseInt( ( this.viewport.height - ( this.imagesize.height + this.offset.height ) ) / 2 ); 835 836 this.parts.box 837 .css({ left: posleft, top: postop }); 838 839 if( e.data.initial === true ) { 840 841 this.parts.box 842 .css({ opacity: 1 }); 843 844 } 845 846 } 847 848 849 imageView.prototype.changeImageViewImage = function( e ) { 850 851 var base = this; 852 853 this.parts.box 854 .css({ opacity: 0 }); 855 856 setTimeout( function() { 857 858 switch( e.data.dir ) { 859 860 case 'prev' : 861 862 if( base.current > 0 ) 863 base.current--; 864 else 865 base.current = ( base.elms.length - 1 ); 866 867 break; 868 869 case 'next' : 870 871 if( base.current < ( base.elms.length - 1 ) ) 872 base.current++; 873 else 874 base.current = 0; 875 876 break; 877 878 } 879 880 base.elm = base.elms.eq( base.current ); 881 base.loadImageViewImage(); 882 883 }, 400 ); 884 885 } 886 887 888 imageView.prototype.removeImageView = function() { 889 890 $( document ) 891 .off( 'keyup.imageView' ); 892 893 this.parts.box 894 .remove(); 895 896 this.parts.shade 897 .remove(); 898 899 } 900 901 902 imageView.prototype.bindTouchEvents = function() { 903 904 var base = this; 905 906 var mc = new Hammer.Manager( this.parts.imagewrap.get( 0 ) ); 907 mc.add( new Hammer.Pan({ direction: Hammer.DIRECTION_HORIZONTAL, threshold: 80, pointers: 0 }) ); 908 mc.add( new Hammer.Tap({ event: 'doubletap', taps: 2 }) ); 909 910 mc.on( 'panend', function( ev ) { 911 912 if( ev.direction == Hammer.DIRECTION_RIGHT ) { 913 914 base.swipeactions( 'right' ); 915 916 } 917 918 if( ev.direction == Hammer.DIRECTION_LEFT ) { 919 920 base.swipeactions( 'left' ); 921 922 } 923 924 }); 925 926 mc.on( 'doubletap', function() { 927 928 base.removeImageView(); 929 930 }); 931 932 } 933 934 935 imageView.prototype.swipeactions = function( dir ) { 936 937 switch( dir ) { 938 939 case 'left': 940 941 this.changeImageViewImage({ data: { dir: 'prev' } }); 942 943 break; 944 945 case 'right': 946 947 this.changeImageViewImage({ data: { dir: 'next' } }); 948 949 break; 950 951 } 952 953 } 954 955 956 $.fn[ pluginName ] = function() { 957 958 return new imageView( this ); 959 960 } 961 962 963}( jQuery, window ) ); 964 965 966( function( $ ) { 967 968 var pluginName = 'MultiSlidr', 969 defaults = { slides: '.slidr', navid: '', pagenums: true, nextprev: true, navitoparent: false, navitoelm: false, speed: 500, changespeed: 7000, automate: false, interrupt: true }, 970 args = {}; 971 972 function MultiSlidr( element, args ) { 973 974 this.wrapper = $( element ); 975 this.args = $.extend( {}, defaults, args ); 976 977 this.init(); 978 979 } 980 981 MultiSlidr.prototype.init = function() { 982 983 this.slides = $( this.args.slides, this.wrapper ); 984 985 this.animated = false; 986 this.resizer = null; 987 988 this.slides 989 .wrapAll( '<div class="slidr-slidemover" style="position: relative;" />' ); 990 991 this.slidemover = $( '.slidr-slidemover', this.wrapper ); 992 this.dots = false; 993 994 this.calcSizes(); 995 996 this.leftidx = 0; 997 this.rightidx = ( this.perpage - 1 ); 998 999 $( window ) 1000 .on( 'resize', $.throttle( 150, $.proxy( this, 'resizeHandler' ) ) ); 1001 1002 this.addNavigation(); 1003 1004 if( this.slides.length < ( this.perpage + 1 ) ) { 1005 1006 this.navi 1007 .hide(); 1008 1009 } 1010 1011 } 1012 1013 MultiSlidr.prototype.calcSizes = function() { 1014 1015 this.wrapperwidth = this.wrapper.width(); 1016 this.slidewidth = this.slides.eq( 1 ).width(); 1017 this.slidemargin = parseFloat( this.slides.eq( 1 ).css( 'marginLeft' ), 10 ); 1018 this.perpage = Math.floor( this.wrapperwidth / this.slidewidth ); 1019 1020 } 1021 1022 MultiSlidr.prototype.resizeHandler = function() { 1023 1024 this.calcSizes(); 1025 1026 if( this.slides.length < ( this.perpage + 1 ) ) { 1027 1028 this.navi 1029 .hide(); 1030 1031 } 1032 else { 1033 1034 this.navi 1035 .show(); 1036 1037 } 1038 1039 if( this.leftidx == 0 ) { 1040 1041 this.targetpos = 0; 1042 this.rightidx = this.leftidx + this.perpage - 1; 1043 1044 } 1045 else { 1046 1047 if( ( this.rightidx + 1 ) == this.slides.length ) { 1048
1049 this.leftidx = this.rightidx - this.perpage + 1; 1050 1051 } 1052 else { 1053 1054 this.rightidx = this.leftidx + this.perpage - 1; 1055 1056 } 1057 1058 this.targetpos = this.slides.eq( this.leftidx ).position().left + this.slidemargin; 1059 1060 } 1061 1062 this.dots 1063 .removeClass( 'current' ) 1064 .slice( this.leftidx, this.rightidx + 1 ) 1065 .addClass( 'current' ); 1066 1067 if( !Modernizr.csstransitions ) { 1068 1069 this.slidemover 1070 .css({ left: -this.targetpos }); 1071 1072 } 1073 else { 1074 1075 this.slidemover 1076 .css({ transform: 'translateX(' + -this.targetpos + 'px)' }); 1077 1078 } 1079 1080 } 1081 1082 MultiSlidr.prototype.addNavigation = function() { 1083 1084 if( this.slides.length > 1 ) { 1085 1086 var _this = this; 1087 1088 this.navi = $( '<div />', { id: this.args.navid, 'class': 'mslidr-nav' }); 1089 var $pagenums = $( '<ul />', { 'class': 'mslidr-pagenums' }); 1090 1091 for( var i = 0; i < this.slides.length; ++i ) { 1092 1093 $( '<li />', { 'class': 'mslidr-dots', html: ( i + 1 ) }) 1094 .appendTo( $pagenums ); 1095 1096 } 1097 1098 $pagenums 1099 .appendTo( this.navi ); 1100 1101 this.dots = $( '.mslidr-dots', this.navi ); 1102 1103 this.dots 1104 .slice( 0, this.perpage ) 1105 .addClass( 'current' ); 1106 1107 this.dots 1108 .on( 'click', function( e, param ) { 1109 1110 if( !$( this ).hasClass( 'current' ) && _this.animated === false ) { 1111 1112 var clickidx = $( '.mslidr-dots', _this.navi ).index( $( this ) ); 1113 1114 if( clickidx > _this.leftidx ) { 1115 1116 _this.leftidx = clickidx - _this.perpage + 1; 1117 _this.rightidx = clickidx; 1118 1119 } 1120 else { 1121 1122 _this.leftidx = clickidx; 1123 _this.rightidx = clickidx + _this.perpage - 1; 1124 1125 } 1126 1127 _this.dots 1128 .removeClass( 'current' ) 1129 .slice( _this.leftidx, _this.rightidx + 1 ) 1130 .addClass( 'current' ); 1131 1132 1133 if( clickidx == 0 ) { 1134 1135 _this.targetpos = 0; 1136 1137 } 1138 else { 1139 1140 _this.targetpos = _this.slides.eq( _this.leftidx ).position().left + _this.slidemargin; 1141 1142 } 1143 1144 _this.moveSlides(); 1145 1146 } 1147 1148 }); 1149 1150 1151 this.prev = $( '<div />', { 'class': 'mslidr-nextprev prev', html: '‹' }) 1152 .css({ opacity: 0.4 }) 1153 .appendTo( this.navi ); 1154 1155 this.next = $( '<div />', { 'class': 'mslidr-nextprev next', html: '›' }) 1156 .appendTo( this.navi ); 1157 1158 this.prev.on( 'click', function() { 1159 1160 if( _this.leftidx == 0 ) { 1161 1162 return false; 1163 1164 } 1165 1166 if( _this.animated === false ) { 1167 1168 _this.dots 1169 .eq( _this.leftidx - 1 ) 1170 .trigger( 'click', 'prev' ); 1171 1172 } 1173 1174 }); 1175 1176 this.next.on( 'click', function() { 1177 1178 if( ( _this.rightidx + 1 ) == _this.slides.length ) { 1179 1180 return false; 1181 1182 } 1183 1184 if( _this.animated === false ) { 1185 1186 _this.dots 1187 .eq( _this.rightidx + 1 ) 1188 .trigger( 'click', 'next' ); 1189 1190 } 1191 1192 }); 1193 1194 if( this.args.pagenums === false ) { 1195 1196 $pagenums 1197 .hide(); 1198 1199 } 1200 1201 if( this.args.nextprev === false ) { 1202 1203 this.prev 1204 .add( this.next ) 1205 .hide(); 1206 1207 } 1208 1209 if( this.args.navitoparent ) { 1210 1211 this.navi 1212 .appendTo( this.wrapper.parent() ); 1213 1214 } 1215 else if( this.args.navitoelm !== false ) { 1216 1217 this.navi 1218 .appendTo( $( this.args.navitoelm, this.wrapper ) ); 1219 1220 } 1221 else { 1222 1223 this.navi 1224 .appendTo( this.wrapper ); 1225 1226 } 1227 1228 if( Modernizr.touch === true ) { 1229 1230 this.bindTouchEvents(); 1231 1232 } 1233 1234 if( this.args.automate === true ) { 1235 1236 if( Modernizr.touch !== true && this.args.interrupt === true ) { 1237 1238 $( this.wrapper ).on({ 1239 1240 mouseenter: function() { 1241 1242 clearInterval( _this.changer ); 1243 1244 }, 1245 mouseleave: function() { 1246 1247 _this.automateChange(); 1248 1249 } 1250 1251 }); 1252 1253 } 1254 1255 this.automateChange(); 1256 1257 } 1258 1259 } 1260 1261 } 1262 1263 MultiSlidr.prototype.bindTouchEvents = function() { 1264 1265 var base = this; 1266 1267 var mc = new Hammer.Manager( this.wrapper.get( 0 ) ); 1268 mc.add( new Hammer.Pan({ direction: Hammer.DIRECTION_HORIZONTAL, threshold: 80, pointers: 0 }) ); 1269 1270 mc.on( 'panend', function( ev ) { 1271 1272 if( ev.direction == Hammer.DIRECTION_RIGHT ) { 1273 1274 base.swipeactions( 'right' ); 1275 1276 } 1277 1278 if( ev.direction == Hammer.DIRECTION_LEFT ) { 1279 1280 base.swipeactions( 'left' ); 1281 1282 } 1283 1284 }); 1285 1286 } 1287 1288 MultiSlidr.prototype.swipeactions = function( dir ) { 1289 1290 switch( dir ) { 1291 1292 case 'left': 1293 1294 var $elm = this.next; 1295 1296 break; 1297 1298 case 'right': 1299 1300 var $elm = this.prev; 1301 1302 break; 1303 1304 } 1305 1306 if( this.args.automate === true ) { 1307 1308 clearInterval( this.changer ); 1309 1310 } 1311 1312 $elm 1313 .trigger( 'click' ); 1314 1315 if( this.args.automate === true ) { 1316 1317 this.automateChange(); 1318 1319 } 1320 1321 } 1322 1323 MultiSlidr.prototype.automateChange = function() { 1324 1325 var base = this; 1326 1327 base.changer = setInterval( function() { 1328 1329 if( base.activeidx < ( base.slides.length - 1 ) ) { 1330 1331 var targetidx = base.activeidx + 1; 1332 1333 } 1334 else { 1335 1336 var targetidx = 0; 1337 1338 } 1339 1340 $( '.mslidr-dots', base.navi ) 1341 .eq( targetidx ) 1342 .trigger( 'click' ); 1343 1344 }, base.args.changespeed ); 1345 1346 } 1347 1348 MultiSlidr.prototype.moveSlides = function() { 1349 1350 var _this = this; 1351 this.animated = true; 1352 1353 this.prev 1354 .add( this.next ) 1355 .css({ opacity: 1 }); 1356 1357 1358 if( this.leftidx == 0 ) { 1359 1360 this.prev 1361 .css({ opacity: 0.4 }); 1362 1363 } 1364 1365 if( ( this.rightidx + 1 ) == this.slides.length ) { 1366 1367 this.next 1368 .css({ opacity: 0.4 }); 1369 1370 } 1371 1372 if( !Modernizr.csstransitions ) { 1373 1374 this.slidemover 1375 .velocity({ left: -this.targetpos }, { duration: this.args.speed, easing: 'easeOutSine', complete: function() { 1376 1377 _this.animated = false; 1378 1379 }}); 1380 1381 } 1382 else { 1383 1384 this.slidemover 1385 .velocity({ translateX: -this.targetpos }, { duration: this.args.speed, easing: 'easeOutSine', complete: function() { 1386 1387 _this.animated = false; 1388 1389 }}); 1390 1391 } 1392 1393 } 1394 1395 $.fn[ pluginName ] = function( options ) { 1396 1397 return this.each( function() { 1398 1399 if( !$.data( this, 'plugin_' + pluginName ) ) { 1400 1401 $.data( this, 'plugin_' + pluginName, new MultiSlidr( this, options ) ); 1402 1403 } 1404 1405 }); 1406 1407 } 1408 1409}( jQuery, window ) ); 1410 1411 1412( function( $ ) { 1413 1414 var pluginName = 'videoView'; 1415 1416 function videoView( elements ) { 1417 1418 this.elms = elements; 1419 this.elms.on( 'click', $.proxy( this.clickevent, this ) ); 1420 1421 return elements; 1422 1423 } 1424 1425 1426 videoView.prototype.clickevent = function ( e ) { 1427 1428 e.preventDefault(); 1429 this.current = this.elms.index( e.currentTarget ); 1430 this.elm = this.elms.eq( this.current ); 1431 1432 this.init(); 1433 1434 } 1435 1436 1437 videoView.prototype.init = function () { 1438 1439 var base = this; 1440 1441 this.parts = {}; 1442 this.viewactive = false; 1443 this.timer = null; 1444 1445 this.generatevideoViewParts(); 1446 1447 $( window ) 1448 .on( 'resize.videoView', { initial: false }, $.proxy( this, 'showvideoView' ) ); 1449 1450 1451 $( document ) 1452 .on( 'keyup.videoView', function( e ) { 1453 1454 switch( e.which ) { 1455 1456 case 27: 1457 1458 base.removevideoView(); 1459 1460 break; 1461 1462 } 1463 1464 }); 1465 1466 } 1467 1468 1469 videoView.prototype.getViewport = function() { 1470 1471 this.viewport = { width: $( window ).width(), height: $( window ).height() }; 1472 1473 } 1474 1475 1476 videoView.prototype.getvideoViewOffsets = function() { 1477 1478 this.offset = { width: ( this.parts.box.outerWidth( true ) - this.parts.box.width() ), height: ( this.parts.box.outerHeight( true ) - this.parts.box.height() ) }; 1479 1480 } 1481 1482 1483 videoView.prototype.sprintf = function( format, etc ) { 1484 1485 var arg = arguments; 1486 var i = 1; 1487 return format.replace( /%((%)|s)/g, function( m ) { return m[ 2 ] || arg[ i++ ] }); 1488 1489 } 1490 1491 1492 videoView.prototype.resizevideoViewImage = function( initial ) { 1493 1494 this.getViewport(); 1495 this.getvideoViewOffsets(); 1496 1497 if( Modernizr.touch ) 1498 var margins = { x: 30, y: 30 }; 1499 else 1500 var margins = { x: 90, y: 90 }; 1501 1502 if( initial !== true ) 1503 this.imagesize = $.extend( {}, this.origsize ); 1504 1505 if( ( this.imagesize.height + this.offset.height ) > ( this.viewport.height - margins.y ) ) { 1506 1507 var imageAR = this.imagesize.height / this.imagesize.width; 1508 1509 this.imagesize.height = this.viewport.height - margins.y;
1510 this.imagesize.width = this.imagesize.height / imageAR; 1511 1512 } 1513 1514 if( ( this.imagesize.width + this.offset.width ) > ( this.viewport.width - margins.x ) ) { 1515 1516 var imageAR = this.imagesize.width / this.imagesize.height; 1517 1518 this.imagesize.width = this.viewport.width - margins.x; 1519 this.imagesize.height = this.imagesize.width / imageAR; 1520 1521 } 1522 1523 this.parts.videowrap 1524 .css({ width: this.imagesize.width, height: this.imagesize.height }); 1525 1526 $( 'iframe', this.parts.videowrap ) 1527 .attr({ width: this.imagesize.width, height: this.imagesize.height }); 1528 1529 1530 } 1531 1532 1533 videoView.prototype.generatevideoViewParts = function() { 1534 1535 this.parts.shade = $( '<div />', { id: 'videoview-shade' }).css({ opacity: 0.8 }).on( 'click.videoView', $.proxy( this, 'removevideoView' ) ); 1536 this.parts.box = $( '<div />', { id: 'videoview-box' }).css({ opacity: 0 }); 1537 this.parts.videowrap = $( '<div />', { id: 'videoview-videowrap' }).appendTo( this.parts.box ); 1538 this.parts.closer = $( '<a />', { id: 'videoview-close', html: '×' }).on( 'click.videoView', $.proxy( this, 'removevideoView' ) ).appendTo( this.parts.box ); 1539 1540 if( !this.viewactive ) { 1541 1542 this.parts.shade 1543 .appendTo( 'body' ); 1544 1545 this.parts.box 1546 .appendTo( 'body' ); 1547 1548 this.viewactive = true; 1549 1550 } 1551 1552 this.loadvideoViewImage(); 1553 1554 } 1555 1556 1557 videoView.prototype.loadvideoViewImage = function() { 1558 1559 var base = this; 1560 1561 $.post( async.url, { nonce: async.nonce, action: 'async', job: 'videoplay', videourl: base.elm.data( 'videourl' ) }, function( data ) { 1562 1563 base.parts.videowrap 1564 .html( data ); 1565 1566 $elm = $( 'iframe', base.parts.videowrap ); 1567 1568 base.origsize = { width: $elm.width(), height: $elm.height() }; 1569 base.imagesize = $.extend( {}, base.origsize ); 1570 1571 setTimeout( function() { 1572 1573 base.showvideoView({ data: { initial: true } }); 1574 1575 }, 200 ); 1576 1577 }); 1578 1579 } 1580 1581 1582 videoView.prototype.showvideoView = function( e ) { 1583 1584 this.resizevideoViewImage( e.data.initial ); 1585 1586 var posleft = parseInt( ( this.viewport.width - ( this.imagesize.width + this.offset.width ) ) / 2 ); 1587 var postop = parseInt( ( this.viewport.height - ( this.imagesize.height + this.offset.height ) ) / 2 ); 1588 1589 this.parts.box 1590 .css({ left: posleft, top: postop }); 1591 1592 if( e.data.initial === true ) { 1593 1594 this.parts.box 1595 .css({ opacity: 1 }); 1596 1597 } 1598 1599 } 1600 1601 1602 videoView.prototype.removevideoView = function() { 1603 1604 $( document ) 1605 .off( 'keyup.videoView' ); 1606 1607 this.parts.box 1608 .remove(); 1609 1610 this.parts.shade 1611 .remove(); 1612 1613 } 1614 1615 1616 $.fn[ pluginName ] = function() { 1617 1618 return new videoView( this ); 1619 1620 } 1621 1622 1623}( jQuery, window ) ); 1624 1625 1626( function( $ ) { 1627 1628 var pluginName = 'mapView', 1629 defaults = { 1630 offset: { horz: 0, vert: 80 }, 1631 zoomlevel: 15 1632 }, 1633 args = {}; 1634 1635 1636 function mapView( element, args ) { 1637 1638 var $ = jQuery; 1639 1640 this.args = $.extend( {}, defaults, args ); 1641 this.mapurl = $( element ).attr( 'href' ); 1642 1643 $( element ).on( 'click', $.proxy( this.clickevent, this ) ); 1644 1645 return element; 1646 1647 } 1648 1649 1650 mapView.prototype.clickevent = function ( e ) { 1651 1652 e.preventDefault(); 1653 this.init(); 1654 1655 } 1656 1657 1658 mapView.prototype.init = function() { 1659 1660 var $ = jQuery; 1661 1662 this.viewport = {}; 1663 this.parts = {}; 1664 this.origsize = {}; 1665 this.imagesize = {}; 1666 this.viewactive = false; 1667 this.timer = null; 1668 1669 this.generateMapViewParts(); 1670 1671 } 1672 1673 1674 mapView.prototype.getViewport = function() { 1675 1676 var $ = jQuery; 1677 this.viewport = { width: $( window ).width(), height: $( window ).height() }; 1678 1679 } 1680 1681 1682 mapView.prototype.generateMapViewParts = function() { 1683 1684 var $ = jQuery, t = this; 1685 1686 t.parts.shade = $( '<div />', { id: 'mapview-shade' }).css({ opacity: 0.9 }).on( 'click', function() { t.removeMapView(); }); 1687 t.parts.box = $( '<div />', { id: 'mapview-box' }).css({ opacity: 0 }); 1688 t.parts.iframe = $( '<iframe />', { frameborder: 0, scrolling: 'no', marginheight: 0, marginwidth: 0 }).css({ width: 800, height: 600 }).appendTo( t.parts.box ); 1689 t.parts.closer = $( '<a />', { id: 'mapview-close', html: '×' }).on( 'click', function() { t.removeMapView(); } ).appendTo( t.parts.box ); 1690 1691 $( document ).on( 'keyup.mapView', function( e ) { 1692 1693 switch( e.which ) { 1694 1695 case 27: 1696 1697 $( '#mapview-close' ) 1698 .trigger( 'click' ); 1699 1700 break; 1701 1702 } 1703 1704 }); 1705 1706 1707 $( window ).on( 'resize.mapview', function() { 1708 1709 t.showMapView(); 1710 1711 }); 1712 1713 1714 t.loadMapView(); 1715 1716 } 1717 1718 1719 mapView.prototype.loadMapView = function() { 1720 1721 var $ = jQuery, t = this; 1722 1723 t.mapurl = t.mapurl.replace( /&z=[0-9]+/i, ( '&z=' + t.args.zoomlevel ) ); 1724 t.mapurl += '&output=embed'; 1725 1726 if( !t.viewactive ) { 1727 1728 t.parts.shade.appendTo( 'body' ); 1729 t.parts.box.appendTo( 'body' ); 1730 t.viewactive = true; 1731 1732 } 1733 1734 t.parts.iframe.attr( { src: t.mapurl } ); 1735 t.origsize = { width: t.parts.iframe.width(), height: t.parts.iframe.height() }; 1736 t.imagesize = $.extend( {}, t.origsize ); 1737 1738 t.getMapViewOffsets(); 1739 t.showMapView( true ); 1740 1741 } 1742 1743 1744 mapView.prototype.getMapViewOffsets = function() { 1745 1746 var $ = jQuery, t = this; 1747 1748 var width = t.parts.box.outerWidth( true ) - t.parts.box.width(); 1749 var height = t.parts.box.outerHeight( true ) - t.parts.box.height(); 1750 1751 t.offset = { width: width, height: height }; 1752 1753 } 1754 1755 1756 mapView.prototype.resizeMapView = function( initial ) { 1757 1758 var $ = jQuery, t = this; 1759 1760 t.getViewport(); 1761 1762 if( initial !== true ) 1763 t.imagesize = $.extend( {}, t.origsize ); 1764 1765 if( ( t.imagesize.height ) > ( t.viewport.height - t.args.offset.vert ) ) { 1766 1767 var imageAR = t.origsize.height / t.origsize.width; 1768 1769 t.imagesize.height = t.viewport.height - t.args.offset.vert; 1770 t.imagesize.width = t.imagesize.height / imageAR; 1771 1772 } 1773 1774 if( ( t.imagesize.width ) > ( t.viewport.width - t.args.offset.horz ) ) { 1775 1776 var imageAR = t.origsize.width / t.origsize.height; 1777 1778 t.imagesize.width = t.viewport.width - t.args.offset.horz; 1779 t.imagesize.height = t.imagesize.width / imageAR; 1780 1781 } 1782 1783 t.parts.iframe.css( { width: t.imagesize.width, height: t.imagesize.height } ); 1784 1785 } 1786 1787 1788 mapView.prototype.showMapView = function( initial ) { 1789 1790 var $ = jQuery, t = this; 1791 1792 t.resizeMapView( initial ); 1793 1794 var posleft = parseInt( ( t.viewport.width - ( t.imagesize.width + t.offset.width ) ) / 2 ); 1795 var postop = parseInt( ( t.viewport.height - ( t.imagesize.height + t.offset.height ) ) / 2 ); 1796 1797 if( initial === true ) { 1798 1799 t.parts.box 1800 .css( { left: posleft, top: postop } ) 1801 .fadeTo( 100, 1 ); 1802 1803 } 1804 else { 1805 1806 t.parts.box 1807 .css( { left: posleft, top: postop } ); 1808 1809 } 1810 1811 } 1812 1813 1814 mapView.prototype.removeMapView = function() { 1815 1816 var $ = jQuery, t = this; 1817 1818 $( document ) 1819 .unbind( 'keyup.mapview' ); 1820 1821 t.parts.box.remove(); 1822 t.parts.shade.remove(); 1823 1824 } 1825 1826 1827 $.fn[ pluginName ] = function( options ) { 1828 1829 return this.each( function () { 1830 1831 if( !$.data( this, 'plugin_' + pluginName ) ) { 1832 1833 $.data( this, 'plugin_' + pluginName, new mapView( this, options ) ); 1834 1835 } 1836 1837 }); 1838 1839 } 1840 1841}( jQuery, window ) );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.