materialize-sass 0.95.3.4 → 0.96.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. data/README.md +1 -1
  2. data/app/assets/javascripts/materialize-sprockets.js +2 -1
  3. data/app/assets/javascripts/materialize.js +832 -522
  4. data/app/assets/javascripts/materialize/character_counter.js +59 -0
  5. data/app/assets/javascripts/materialize/dropdown.js +64 -61
  6. data/app/assets/javascripts/materialize/forms.js +14 -0
  7. data/app/assets/javascripts/materialize/global.js +13 -0
  8. data/app/assets/javascripts/materialize/init.js +5 -1
  9. data/app/assets/javascripts/materialize/leanModal.js +4 -5
  10. data/app/assets/javascripts/materialize/parallax.js +9 -12
  11. data/app/assets/javascripts/materialize/scrollFire.js +24 -24
  12. data/app/assets/javascripts/materialize/toasts.js +6 -2
  13. data/app/assets/stylesheets/materialize/components/_buttons.scss +16 -7
  14. data/app/assets/stylesheets/materialize/components/_cards.scss +9 -9
  15. data/app/assets/stylesheets/materialize/components/_collapsible.scss +19 -1
  16. data/app/assets/stylesheets/materialize/components/_color.scss +3 -2
  17. data/app/assets/stylesheets/materialize/components/_dropdown.scss +16 -10
  18. data/app/assets/stylesheets/materialize/components/_form.scss +93 -5
  19. data/app/assets/stylesheets/materialize/components/_global.scss +37 -6
  20. data/app/assets/stylesheets/materialize/components/_modal.scss +2 -2
  21. data/app/assets/stylesheets/materialize/components/_navbar.scss +5 -7
  22. data/app/assets/stylesheets/materialize/components/_normalize.scss +2 -2
  23. data/app/assets/stylesheets/materialize/components/_prefixer.scss +4 -4
  24. data/app/assets/stylesheets/materialize/components/_sideNav.scss +6 -0
  25. data/app/assets/stylesheets/materialize/components/_tabs.scss +1 -2
  26. data/app/assets/stylesheets/materialize/components/_typography.scss +2 -1
  27. data/app/assets/stylesheets/materialize/components/_variables.scss +1 -0
  28. data/lib/materialize-sass/version.rb +1 -1
  29. metadata +16 -7
  30. checksums.yaml +0 -7
data/README.md CHANGED
@@ -29,7 +29,7 @@ $ gem install materialize-sass
29
29
 
30
30
  ### a. Sass
31
31
 
32
- Import Materialize styles in `app/assets/stylesheets/application.css.scss`:
32
+ Import Materialize styles in `app/assets/stylesheets/application.scss`:
33
33
 
34
34
  ```scss
35
35
  @import "materialize";
@@ -2,8 +2,8 @@
2
2
  //= require ./materialize/animation
3
3
  //= require ./materialize/velocity.min
4
4
  //= require ./materialize/hammer.min
5
- //= require ./materialize/global
6
5
  //= require ./materialize/jquery.hammer
6
+ //= require ./materialize/global
7
7
  //= require ./materialize/collapsible
8
8
  //= require ./materialize/dropdown
9
9
  //= require ./materialize/leanModal
@@ -24,3 +24,4 @@
24
24
  //= require ./materialize/scrollFire
25
25
  //= require ./materialize/date_picker/picker
26
26
  //= require ./materialize/date_picker/picker.date
27
+ //= require ./materialize/character_counter
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Materialize v0.95.3 (http://materializecss.com)
2
+ * Materialize v0.96.0 (http://materializecss.com)
3
3
  * Copyright 2014-2015 Materialize
4
4
  * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
5
5
  */
@@ -216,10 +216,10 @@ jQuery.extend( jQuery.easing,
216
216
  }
217
217
  });
218
218
 
219
- ;/*! VelocityJS.org (1.1.0). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
219
+ ;/*! VelocityJS.org (1.2.2). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
220
220
  /*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */
221
- !function(e){function t(e){var t=e.length,r=$.type(e);return"function"===r||$.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e}if(!e.jQuery){var $=function(e,t){return new $.fn.init(e,t)};$.isWindow=function(e){return null!=e&&e==e.window},$.type=function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?a[o.call(e)]||"object":typeof e},$.isArray=Array.isArray||function(e){return"array"===$.type(e)},$.isPlainObject=function(e){var t;if(!e||"object"!==$.type(e)||e.nodeType||$.isWindow(e))return!1;try{if(e.constructor&&!n.call(e,"constructor")&&!n.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}for(t in e);return void 0===t||n.call(e,t)},$.each=function(e,r,a){var n,o=0,i=e.length,s=t(e);if(a){if(s)for(;i>o&&(n=r.apply(e[o],a),n!==!1);o++);else for(o in e)if(n=r.apply(e[o],a),n===!1)break}else if(s)for(;i>o&&(n=r.call(e[o],o,e[o]),n!==!1);o++);else for(o in e)if(n=r.call(e[o],o,e[o]),n===!1)break;return e},$.data=function(e,t,a){if(void 0===a){var n=e[$.expando],o=n&&r[n];if(void 0===t)return o;if(o&&t in o)return o[t]}else if(void 0!==t){var n=e[$.expando]||(e[$.expando]=++$.uuid);return r[n]=r[n]||{},r[n][t]=a,a}},$.removeData=function(e,t){var a=e[$.expando],n=a&&r[a];n&&$.each(t,function(e,t){delete n[t]})},$.extend=function(){var e,t,r,a,n,o,i=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof i&&(u=i,i=arguments[s]||{},s++),"object"!=typeof i&&"function"!==$.type(i)&&(i={}),s===l&&(i=this,s--);l>s;s++)if(null!=(n=arguments[s]))for(a in n)e=i[a],r=n[a],i!==r&&(u&&r&&($.isPlainObject(r)||(t=$.isArray(r)))?(t?(t=!1,o=e&&$.isArray(e)?e:[]):o=e&&$.isPlainObject(e)?e:{},i[a]=$.extend(u,o,r)):void 0!==r&&(i[a]=r));return i},$.queue=function(e,r,a){function n(e,r){var a=r||[];return null!=e&&(t(Object(e))?!function(e,t){for(var r=+t.length,a=0,n=e.length;r>a;)e[n++]=t[a++];if(r!==r)for(;void 0!==t[a];)e[n++]=t[a++];return e.length=n,e}(a,"string"==typeof e?[e]:e):[].push.call(a,e)),a}if(e){r=(r||"fx")+"queue";var o=$.data(e,r);return a?(!o||$.isArray(a)?o=$.data(e,r,n(a)):o.push(a),o):o||[]}},$.dequeue=function(e,t){$.each(e.nodeType?[e]:e,function(e,r){t=t||"fx";var a=$.queue(r,t),n=a.shift();"inprogress"===n&&(n=a.shift()),n&&("fx"===t&&a.unshift("inprogress"),n.call(r,function(){$.dequeue(r,t)}))})},$.fn=$.prototype={init:function(e){if(e.nodeType)return this[0]=e,this;throw new Error("Not a DOM node.")},offset:function(){var t=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:t.top+(e.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:t.left+(e.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function e(){for(var e=this.offsetParent||document;e&&"html"===!e.nodeType.toLowerCase&&"static"===e.style.position;)e=e.offsetParent;return e||document}var t=this[0],e=e.apply(t),r=this.offset(),a=/^(?:body|html)$/i.test(e.nodeName)?{top:0,left:0}:$(e).offset();return r.top-=parseFloat(t.style.marginTop)||0,r.left-=parseFloat(t.style.marginLeft)||0,e.style&&(a.top+=parseFloat(e.style.borderTopWidth)||0,a.left+=parseFloat(e.style.borderLeftWidth)||0),{top:r.top-a.top,left:r.left-a.left}}};var r={};$.expando="velocity"+(new Date).getTime(),$.uuid=0;for(var a={},n=a.hasOwnProperty,o=a.toString,i="Boolean Number String Function Array Date RegExp Object Error".split(" "),s=0;s<i.length;s++)a["[object "+i[s]+"]"]=i[s].toLowerCase();$.fn.init.prototype=$.fn,e.Velocity={Utilities:$}}}(window),function(e){"object"==typeof module&&"object"==typeof module.exports?module.exports=e():"function"==typeof define&&define.amd?define(e):e()}(function(){return function(e,t,r,a){function n(e){for(var t=-1,r=e?e.length:0,a=[];++t<r;){var n=e[t];n&&a.push(n)}return a}function o(e){return g.isWrapped(e)?e=[].slice.call(e):g.isNode(e)&&(e=[e]),e}function i(e){var t=$.data(e,"velocity");return null===t?a:t}function s(e){return function(t){return Math.round(t*e)*(1/e)}}function l(e,r,a,n){function o(e,t){return 1-3*t+3*e}function i(e,t){return 3*t-6*e}function s(e){return 3*e}function l(e,t,r){return((o(t,r)*e+i(t,r))*e+s(t))*e}function u(e,t,r){return 3*o(t,r)*e*e+2*i(t,r)*e+s(t)}function c(t,r){for(var n=0;m>n;++n){var o=u(r,e,a);if(0===o)return r;var i=l(r,e,a)-t;r-=i/o}return r}function p(){for(var t=0;b>t;++t)w[t]=l(t*x,e,a)}function f(t,r,n){var o,i,s=0;do i=r+(n-r)/2,o=l(i,e,a)-t,o>0?n=i:r=i;while(Math.abs(o)>h&&++s<v);return i}function d(t){for(var r=0,n=1,o=b-1;n!=o&&w[n]<=t;++n)r+=x;--n;var i=(t-w[n])/(w[n+1]-w[n]),s=r+i*x,l=u(s,e,a);return l>=y?c(t,s):0==l?s:f(t,r,r+x)}function g(){V=!0,(e!=r||a!=n)&&p()}var m=4,y=.001,h=1e-7,v=10,b=11,x=1/(b-1),S="Float32Array"in t;if(4!==arguments.length)return!1;for(var P=0;4>P;++P)if("number"!=typeof arguments[P]||isNaN(arguments[P])||!isFinite(arguments[P]))return!1;e=Math.min(e,1),a=Math.min(a,1),e=Math.max(e,0),a=Math.max(a,0);var w=S?new Float32Array(b):new Array(b),V=!1,C=function(t){return V||g(),e===r&&a===n?t:0===t?0:1===t?1:l(d(t),r,n)};C.getControlPoints=function(){return[{x:e,y:r},{x:a,y:n}]};var T="generateBezier("+[e,r,a,n]+")";return C.toString=function(){return T},C}function u(e,t){var r=e;return g.isString(e)?v.Easings[e]||(r=!1):r=g.isArray(e)&&1===e.length?s.apply(null,e):g.isArray(e)&&2===e.length?b.apply(null,e.concat([t])):g.isArray(e)&&4===e.length?l.apply(null,e):!1,r===!1&&(r=v.Easings[v.defaults.easing]?v.defaults.easing:h),r}function c(e){if(e)for(var t=(new Date).getTime(),r=0,n=v.State.calls.length;n>r;r++)if(v.State.calls[r]){var o=v.State.calls[r],s=o[0],l=o[2],u=o[3],f=!!u;u||(u=v.State.calls[r][3]=t-16);for(var d=Math.min((t-u)/l.duration,1),m=0,y=s.length;y>m;m++){var h=s[m],b=h.element;if(i(b)){var S=!1;if(l.display!==a&&null!==l.display&&"none"!==l.display){if("flex"===l.display){var w=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];$.each(w,function(e,t){x.setPropertyValue(b,"display",t)})}x.setPropertyValue(b,"display",l.display)}l.visibility!==a&&"hidden"!==l.visibility&&x.setPropertyValue(b,"visibility",l.visibility);for(var V in h)if("element"!==V){var C=h[V],T,k=g.isString(C.easing)?v.Easings[C.easing]:C.easing;if(1===d)T=C.endValue;else if(T=C.startValue+(C.endValue-C.startValue)*k(d),!f&&T===C.currentValue)continue;if(C.currentValue=T,x.Hooks.registered[V]){var A=x.Hooks.getRoot(V),F=i(b).rootPropertyValueCache[A];F&&(C.rootPropertyValue=F)}var E=x.setPropertyValue(b,V,C.currentValue+(0===parseFloat(T)?"":C.unitType),C.rootPropertyValue,C.scrollData);x.Hooks.registered[V]&&(i(b).rootPropertyValueCache[A]=x.Normalizations.registered[A]?x.Normalizations.registered[A]("extract",null,E[1]):E[1]),"transform"===E[0]&&(S=!0)}l.mobileHA&&i(b).transformCache.translate3d===a&&(i(b).transformCache.translate3d="(0px, 0px, 0px)",S=!0),S&&x.flushTransformCache(b)}}l.display!==a&&"none"!==l.display&&(v.State.calls[r][2].display=!1),l.visibility!==a&&"hidden"!==l.visibility&&(v.State.calls[r][2].visibility=!1),l.progress&&l.progress.call(o[1],o[1],d,Math.max(0,u+l.duration-t),u),1===d&&p(r)}v.State.isTicking&&P(c)}function p(e,t){if(!v.State.calls[e])return!1;for(var r=v.State.calls[e][0],n=v.State.calls[e][1],o=v.State.calls[e][2],s=v.State.calls[e][4],l=!1,u=0,c=r.length;c>u;u++){var p=r[u].element;if(t||o.loop||("none"===o.display&&x.setPropertyValue(p,"display",o.display),"hidden"===o.visibility&&x.setPropertyValue(p,"visibility",o.visibility)),o.loop!==!0&&($.queue(p)[1]===a||!/\.velocityQueueEntryFlag/i.test($.queue(p)[1]))&&i(p)){i(p).isAnimating=!1,i(p).rootPropertyValueCache={};var f=!1;$.each(x.Lists.transforms3D,function(e,t){var r=/^scale/.test(t)?1:0,n=i(p).transformCache[t];i(p).transformCache[t]!==a&&new RegExp("^\\("+r+"[^.]").test(n)&&(f=!0,delete i(p).transformCache[t])}),o.mobileHA&&(f=!0,delete i(p).transformCache.translate3d),f&&x.flushTransformCache(p),x.Values.removeClass(p,"velocity-animating")}if(!t&&o.complete&&!o.loop&&u===c-1)try{o.complete.call(n,n)}catch(d){setTimeout(function(){throw d},1)}s&&o.loop!==!0&&s(n),o.loop!==!0||t||($.each(i(p).tweensContainer,function(e,t){/^rotate/.test(e)&&360===parseFloat(t.endValue)&&(t.endValue=0,t.startValue=360)}),v(p,"reverse",{loop:!0,delay:o.delay})),o.queue!==!1&&$.dequeue(p,o.queue)}v.State.calls[e]=!1;for(var g=0,m=v.State.calls.length;m>g;g++)if(v.State.calls[g]!==!1){l=!0;break}l===!1&&(v.State.isTicking=!1,delete v.State.calls,v.State.calls=[])}var f=function(){if(r.documentMode)return r.documentMode;for(var e=7;e>4;e--){var t=r.createElement("div");if(t.innerHTML="<!--[if IE "+e+"]><span></span><![endif]-->",t.getElementsByTagName("span").length)return t=null,e}return a}(),d=function(){var e=0;return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(t){var r=(new Date).getTime(),a;return a=Math.max(0,16-(r-e)),e=r+a,setTimeout(function(){t(r+a)},a)}}(),g={isString:function(e){return"string"==typeof e},isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)},isNode:function(e){return e&&e.nodeType},isNodeList:function(e){return"object"==typeof e&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(e))&&e.length!==a&&(0===e.length||"object"==typeof e[0]&&e[0].nodeType>0)},isWrapped:function(e){return e&&(e.jquery||t.Zepto&&t.Zepto.zepto.isZ(e))},isSVG:function(e){return t.SVGElement&&e instanceof t.SVGElement},isEmptyObject:function(e){for(var t in e)return!1;return!0}},$,m=!1;if(e.fn&&e.fn.jquery?($=e,m=!0):$=t.Velocity.Utilities,8>=f&&!m)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(7>=f)return void(jQuery.fn.velocity=jQuery.fn.animate);var y=400,h="swing",v={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:t.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:r.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:$,Redirects:{},Easings:{},Promise:t.Promise,defaults:{queue:"",duration:y,easing:h,begin:a,complete:a,progress:a,display:a,visibility:a,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(e){$.data(e,"velocity",{isSVG:g.isSVG(e),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:1,patch:0},debug:!1};t.pageYOffset!==a?(v.State.scrollAnchor=t,v.State.scrollPropertyLeft="pageXOffset",v.State.scrollPropertyTop="pageYOffset"):(v.State.scrollAnchor=r.documentElement||r.body.parentNode||r.body,v.State.scrollPropertyLeft="scrollLeft",v.State.scrollPropertyTop="scrollTop");var b=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,r,a){var n={x:t.x+a.dx*r,v:t.v+a.dv*r,tension:t.tension,friction:t.friction};return{dx:n.v,dv:e(n)}}function r(r,a){var n={dx:r.v,dv:e(r)},o=t(r,.5*a,n),i=t(r,.5*a,o),s=t(r,a,i),l=1/6*(n.dx+2*(o.dx+i.dx)+s.dx),u=1/6*(n.dv+2*(o.dv+i.dv)+s.dv);return r.x=r.x+l*a,r.v=r.v+u*a,r}return function a(e,t,n){var o={x:-1,v:0,tension:null,friction:null},i=[0],s=0,l=1e-4,u=.016,c,p,f;for(e=parseFloat(e)||500,t=parseFloat(t)||20,n=n||null,o.tension=e,o.friction=t,c=null!==n,c?(s=a(e,t),p=s/n*u):p=u;;)if(f=r(f||o,p),i.push(1+f.x),s+=16,!(Math.abs(f.x)>l&&Math.abs(f.v)>l))break;return c?function(e){return i[e*(i.length-1)|0]}:s}}();v.Easings={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)}},$.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(e,t){v.Easings[t[0]]=l.apply(null,t[1])});var x=v.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 e=0;e<x.Lists.colors.length;e++){var t="color"===x.Lists.colors[e]?"0 0 0 1":"255 255 255 1";x.Hooks.templates[x.Lists.colors[e]]=["Red Green Blue Alpha",t]}var r,a,n;if(f)for(r in x.Hooks.templates){a=x.Hooks.templates[r],n=a[0].split(" ");var o=a[1].match(x.RegEx.valueSplit);"Color"===n[0]&&(n.push(n.shift()),o.push(o.shift()),x.Hooks.templates[r]=[n.join(" "),o.join(" ")])}for(r in x.Hooks.templates){a=x.Hooks.templates[r],n=a[0].split(" ");for(var e in n){var i=r+n[e],s=e;x.Hooks.registered[i]=[r,s]}}},getRoot:function(e){var t=x.Hooks.registered[e];return t?t[0]:e},cleanRootPropertyValue:function(e,t){return x.RegEx.valueUnwrap.test(t)&&(t=t.match(x.RegEx.valueUnwrap)[1]),x.Values.isCSSNullValue(t)&&(t=x.Hooks.templates[e][1]),t},extractValue:function(e,t){var r=x.Hooks.registered[e];if(r){var a=r[0],n=r[1];return t=x.Hooks.cleanRootPropertyValue(a,t),t.toString().match(x.RegEx.valueSplit)[n]}return t},injectValue:function(e,t,r){var a=x.Hooks.registered[e];if(a){var n=a[0],o=a[1],i,s;return r=x.Hooks.cleanRootPropertyValue(n,r),i=r.toString().match(x.RegEx.valueSplit),i[o]=t,s=i.join(" ")}return r}},Normalizations:{registered:{clip:function(e,t,r){switch(e){case"name":return"clip";case"extract":var a;return x.RegEx.wrappedValueAlreadyExtracted.test(r)?a=r:(a=r.toString().match(x.RegEx.valueUnwrap),a=a?a[1].replace(/,(\s+)?/g," "):r),a;case"inject":return"rect("+r+")"}},blur:function(e,t,r){switch(e){case"name":return"-webkit-filter";case"extract":var a=parseFloat(r);if(!a&&0!==a){var n=r.toString().match(/blur\(([0-9]+[A-z]+)\)/i);a=n?n[1]:0}return a;case"inject":return parseFloat(r)?"blur("+r+")":"none"}},opacity:function(e,t,r){if(8>=f)switch(e){case"name":return"filter";case"extract":var a=r.toString().match(/alpha\(opacity=(.*)\)/i);return r=a?a[1]/100:1;case"inject":return t.style.zoom=1,parseFloat(r)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(r),10)+")"}else switch(e){case"name":return"opacity";case"extract":return r;case"inject":return r}}},register:function(){9>=f||v.State.isGingerbread||(x.Lists.transformsBase=x.Lists.transformsBase.concat(x.Lists.transforms3D));for(var e=0;e<x.Lists.transformsBase.length;e++)!function(){var t=x.Lists.transformsBase[e];x.Normalizations.registered[t]=function(e,r,n){switch(e){case"name":return"transform";case"extract":return i(r)===a||i(r).transformCache[t]===a?/^scale/i.test(t)?1:0:i(r).transformCache[t].replace(/[()]/g,"");case"inject":var o=!1;switch(t.substr(0,t.length-1)){case"translate":o=!/(%|px|em|rem|vw|vh|\d)$/i.test(n);break;case"scal":case"scale":v.State.isAndroid&&i(r).transformCache[t]===a&&1>n&&(n=1),o=!/(\d)$/i.test(n);break;case"skew":o=!/(deg|\d)$/i.test(n);break;case"rotate":o=!/(deg|\d)$/i.test(n)}return o||(i(r).transformCache[t]="("+n+")"),i(r).transformCache[t]}}}();for(var e=0;e<x.Lists.colors.length;e++)!function(){var t=x.Lists.colors[e];x.Normalizations.registered[t]=function(e,r,n){switch(e){case"name":return t;case"extract":var o;if(x.RegEx.wrappedValueAlreadyExtracted.test(n))o=n;else{var i,s={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(n)?i=s[n]!==a?s[n]:s.black:x.RegEx.isHex.test(n)?i="rgb("+x.Values.hexToRgb(n).join(" ")+")":/^rgba?\(/i.test(n)||(i=s.black),o=(i||n).toString().match(x.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return 8>=f||3!==o.split(" ").length||(o+=" 1"),o;case"inject":return 8>=f?4===n.split(" ").length&&(n=n.split(/\s+/).slice(0,3).join(" ")):3===n.split(" ").length&&(n+=" 1"),(8>=f?"rgb":"rgba")+"("+n.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})},SVGAttribute:function(e){var t="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(f||v.State.isAndroid&&!v.State.isChrome)&&(t+="|transform"),new RegExp("^("+t+")$","i").test(e)},prefixCheck:function(e){if(v.State.prefixMatches[e])return[v.State.prefixMatches[e],!0];for(var t=["","Webkit","Moz","ms","O"],r=0,a=t.length;a>r;r++){var n;if(n=0===r?e:t[r]+e.replace(/^\w/,function(e){return e.toUpperCase()}),g.isString(v.State.prefixElement.style[n]))return v.State.prefixMatches[e]=n,[n,!0]}return[e,!1]}},Values:{hexToRgb:function(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,a;return e=e.replace(t,function(e,t,r,a){return t+t+r+r+a+a}),a=r.exec(e),a?[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]:[0,0,0]},isCSSNullValue:function(e){return 0==e||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(e)},getUnitType:function(e){return/^(rotate|skew)/i.test(e)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(e)?"":"px"},getDisplayType:function(e){var t=e&&e.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(t)?"inline":/^(li)$/i.test(t)?"list-item":/^(tr)$/i.test(t)?"table-row":"block"},addClass:function(e,t){e.classList?e.classList.add(t):e.className+=(e.className.length?" ":"")+t},removeClass:function(e,t){e.classList?e.classList.remove(t):e.className=e.className.toString().replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(e,r,n,o){function s(e,r){function n(){u&&x.setPropertyValue(e,"display","none")}var l=0;if(8>=f)l=$.css(e,r);else{var u=!1;if(/^(width|height)$/.test(r)&&0===x.getPropertyValue(e,"display")&&(u=!0,x.setPropertyValue(e,"display",x.Values.getDisplayType(e))),!o){if("height"===r&&"border-box"!==x.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var c=e.offsetHeight-(parseFloat(x.getPropertyValue(e,"borderTopWidth"))||0)-(parseFloat(x.getPropertyValue(e,"borderBottomWidth"))||0)-(parseFloat(x.getPropertyValue(e,"paddingTop"))||0)-(parseFloat(x.getPropertyValue(e,"paddingBottom"))||0);return n(),c}if("width"===r&&"border-box"!==x.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var p=e.offsetWidth-(parseFloat(x.getPropertyValue(e,"borderLeftWidth"))||0)-(parseFloat(x.getPropertyValue(e,"borderRightWidth"))||0)-(parseFloat(x.getPropertyValue(e,"paddingLeft"))||0)-(parseFloat(x.getPropertyValue(e,"paddingRight"))||0);return n(),p}}var d;d=i(e)===a?t.getComputedStyle(e,null):i(e).computedStyle?i(e).computedStyle:i(e).computedStyle=t.getComputedStyle(e,null),(f||v.State.isFirefox)&&"borderColor"===r&&(r="borderTopColor"),l=9===f&&"filter"===r?d.getPropertyValue(r):d[r],(""===l||null===l)&&(l=e.style[r]),n()}if("auto"===l&&/^(top|right|bottom|left)$/i.test(r)){var g=s(e,"position");("fixed"===g||"absolute"===g&&/top|left/i.test(r))&&(l=$(e).position()[r]+"px")}return l}var l;if(x.Hooks.registered[r]){var u=r,c=x.Hooks.getRoot(u);n===a&&(n=x.getPropertyValue(e,x.Names.prefixCheck(c)[0])),x.Normalizations.registered[c]&&(n=x.Normalizations.registered[c]("extract",e,n)),l=x.Hooks.extractValue(u,n)}else if(x.Normalizations.registered[r]){var p,d;p=x.Normalizations.registered[r]("name",e),"transform"!==p&&(d=s(e,x.Names.prefixCheck(p)[0]),x.Values.isCSSNullValue(d)&&x.Hooks.templates[r]&&(d=x.Hooks.templates[r][1])),l=x.Normalizations.registered[r]("extract",e,d)}return/^[\d-]/.test(l)||(l=i(e)&&i(e).isSVG&&x.Names.SVGAttribute(r)?/^(height|width)$/i.test(r)?e.getBBox()[r]:e.getAttribute(r):s(e,x.Names.prefixCheck(r)[0])),x.Values.isCSSNullValue(l)&&(l=0),v.debug>=2&&console.log("Get "+r+": "+l),l},setPropertyValue:function(e,r,a,n,o){var s=r;if("scroll"===r)o.container?o.container["scroll"+o.direction]=a:"Left"===o.direction?t.scrollTo(a,o.alternateValue):t.scrollTo(o.alternateValue,a);else if(x.Normalizations.registered[r]&&"transform"===x.Normalizations.registered[r]("name",e))x.Normalizations.registered[r]("inject",e,a),s="transform",a=i(e).transformCache[r];else{if(x.Hooks.registered[r]){var l=r,u=x.Hooks.getRoot(r);n=n||x.getPropertyValue(e,u),a=x.Hooks.injectValue(l,a,n),r=u}if(x.Normalizations.registered[r]&&(a=x.Normalizations.registered[r]("inject",e,a),r=x.Normalizations.registered[r]("name",e)),s=x.Names.prefixCheck(r)[0],8>=f)try{e.style[s]=a}catch(c){v.debug&&console.log("Browser does not support ["+a+"] for ["+s+"]")}else i(e)&&i(e).isSVG&&x.Names.SVGAttribute(r)?e.setAttribute(r,a):e.style[s]=a;v.debug>=2&&console.log("Set "+r+" ("+s+"): "+a)}return[s,a]},flushTransformCache:function(e){function t(t){return parseFloat(x.getPropertyValue(e,t))}var r="";if((f||v.State.isAndroid&&!v.State.isChrome)&&i(e).isSVG){var a={translate:[t("translateX"),t("translateY")],skewX:[t("skewX")],skewY:[t("skewY")],scale:1!==t("scale")?[t("scale"),t("scale")]:[t("scaleX"),t("scaleY")],rotate:[t("rotateZ"),0,0]};$.each(i(e).transformCache,function(e){/^translate/i.test(e)?e="translate":/^scale/i.test(e)?e="scale":/^rotate/i.test(e)&&(e="rotate"),a[e]&&(r+=e+"("+a[e].join(" ")+") ",delete a[e])})}else{var n,o;$.each(i(e).transformCache,function(t){return n=i(e).transformCache[t],"transformPerspective"===t?(o=n,!0):(9===f&&"rotateZ"===t&&(t="rotate"),void(r+=t+n+" "))}),o&&(r="perspective"+o+" "+r)}x.setPropertyValue(e,"transform",r)}};x.Hooks.register(),x.Normalizations.register(),v.hook=function(e,t,r){var n=a;return e=o(e),$.each(e,function(e,o){if(i(o)===a&&v.init(o),r===a)n===a&&(n=v.CSS.getPropertyValue(o,t));else{var s=v.CSS.setPropertyValue(o,t,r);"transform"===s[0]&&v.CSS.flushTransformCache(o),n=s}}),n};var S=function(){function e(){return f?k.promise||null:d}function s(){function e(e){function f(e,t){var r=a,n=a,i=a;return g.isArray(e)?(r=e[0],!g.isArray(e[1])&&/^[\d-]/.test(e[1])||g.isFunction(e[1])||x.RegEx.isHex.test(e[1])?i=e[1]:(g.isString(e[1])&&!x.RegEx.isHex.test(e[1])||g.isArray(e[1]))&&(n=t?e[1]:u(e[1],s.duration),e[2]!==a&&(i=e[2]))):r=e,t||(n=n||s.easing),g.isFunction(r)&&(r=r.call(o,V,w)),g.isFunction(i)&&(i=i.call(o,V,w)),[r||0,n,i]}function d(e,t){var r,a;return a=(t||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(e){return r=e,""}),r||(r=x.Values.getUnitType(e)),[a,r]}function m(){var e={myParent:o.parentNode||r.body,position:x.getPropertyValue(o,"position"),fontSize:x.getPropertyValue(o,"fontSize")},a=e.position===L.lastPosition&&e.myParent===L.lastParent,n=e.fontSize===L.lastFontSize;L.lastParent=e.myParent,L.lastPosition=e.position,L.lastFontSize=e.fontSize;var s=100,l={};if(n&&a)l.emToPx=L.lastEmToPx,l.percentToPxWidth=L.lastPercentToPxWidth,l.percentToPxHeight=L.lastPercentToPxHeight;else{var u=i(o).isSVG?r.createElementNS("http://www.w3.org/2000/svg","rect"):r.createElement("div");v.init(u),e.myParent.appendChild(u),$.each(["overflow","overflowX","overflowY"],function(e,t){v.CSS.setPropertyValue(u,t,"hidden")}),v.CSS.setPropertyValue(u,"position",e.position),v.CSS.setPropertyValue(u,"fontSize",e.fontSize),v.CSS.setPropertyValue(u,"boxSizing","content-box"),$.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(e,t){v.CSS.setPropertyValue(u,t,s+"%")}),v.CSS.setPropertyValue(u,"paddingLeft",s+"em"),l.percentToPxWidth=L.lastPercentToPxWidth=(parseFloat(x.getPropertyValue(u,"width",null,!0))||1)/s,l.percentToPxHeight=L.lastPercentToPxHeight=(parseFloat(x.getPropertyValue(u,"height",null,!0))||1)/s,l.emToPx=L.lastEmToPx=(parseFloat(x.getPropertyValue(u,"paddingLeft"))||1)/s,e.myParent.removeChild(u)}return null===L.remToPx&&(L.remToPx=parseFloat(x.getPropertyValue(r.body,"fontSize"))||16),null===L.vwToPx&&(L.vwToPx=parseFloat(t.innerWidth)/100,L.vhToPx=parseFloat(t.innerHeight)/100),l.remToPx=L.remToPx,l.vwToPx=L.vwToPx,l.vhToPx=L.vhToPx,v.debug>=1&&console.log("Unit ratios: "+JSON.stringify(l),o),l}if(s.begin&&0===V)try{s.begin.call(h,h)}catch(y){setTimeout(function(){throw y},1)}if("scroll"===A){var S=/^x$/i.test(s.axis)?"Left":"Top",C=parseFloat(s.offset)||0,T,F,E;s.container?g.isWrapped(s.container)||g.isNode(s.container)?(s.container=s.container[0]||s.container,T=s.container["scroll"+S],E=T+$(o).position()[S.toLowerCase()]+C):s.container=null:(T=v.State.scrollAnchor[v.State["scrollProperty"+S]],F=v.State.scrollAnchor[v.State["scrollProperty"+("Left"===S?"Top":"Left")]],E=$(o).offset()[S.toLowerCase()]+C),l={scroll:{rootPropertyValue:!1,startValue:T,currentValue:T,endValue:E,unitType:"",easing:s.easing,scrollData:{container:s.container,direction:S,alternateValue:F}},element:o},v.debug&&console.log("tweensContainer (scroll): ",l.scroll,o)}else if("reverse"===A){if(!i(o).tweensContainer)return void $.dequeue(o,s.queue);"none"===i(o).opts.display&&(i(o).opts.display="auto"),"hidden"===i(o).opts.visibility&&(i(o).opts.visibility="visible"),i(o).opts.loop=!1,i(o).opts.begin=null,i(o).opts.complete=null,P.easing||delete s.easing,P.duration||delete s.duration,s=$.extend({},i(o).opts,s);var j=$.extend(!0,{},i(o).tweensContainer);for(var H in j)if("element"!==H){var N=j[H].startValue;j[H].startValue=j[H].currentValue=j[H].endValue,j[H].endValue=N,g.isEmptyObject(P)||(j[H].easing=s.easing),v.debug&&console.log("reverse tweensContainer ("+H+"): "+JSON.stringify(j[H]),o)}l=j}else if("start"===A){var j;i(o).tweensContainer&&i(o).isAnimating===!0&&(j=i(o).tweensContainer),$.each(b,function(e,t){if(RegExp("^"+x.Lists.colors.join("$|^")+"$").test(e)){var r=f(t,!0),n=r[0],o=r[1],i=r[2];if(x.RegEx.isHex.test(n)){for(var s=["Red","Green","Blue"],l=x.Values.hexToRgb(n),u=i?x.Values.hexToRgb(i):a,c=0;c<s.length;c++){var p=[l[c]];o&&p.push(o),u!==a&&p.push(u[c]),b[e+s[c]]=p}delete b[e]}}});for(var O in b){var z=f(b[O]),q=z[0],M=z[1],I=z[2];O=x.Names.camelCase(O);var B=x.Hooks.getRoot(O),W=!1;if(i(o).isSVG||x.Names.prefixCheck(B)[1]!==!1||x.Normalizations.registered[B]!==a){(s.display!==a&&null!==s.display&&"none"!==s.display||s.visibility!==a&&"hidden"!==s.visibility)&&/opacity|filter/.test(O)&&!I&&0!==q&&(I=0),s._cacheValues&&j&&j[O]?(I===a&&(I=j[O].endValue+j[O].unitType),W=i(o).rootPropertyValueCache[B]):x.Hooks.registered[O]?I===a?(W=x.getPropertyValue(o,B),I=x.getPropertyValue(o,O,W)):W=x.Hooks.templates[B][1]:I===a&&(I=x.getPropertyValue(o,O));var G,D,X,Y=!1;if(G=d(O,I),I=G[0],X=G[1],G=d(O,q),q=G[0].replace(/^([+-\/*])=/,function(e,t){return Y=t,""}),D=G[1],I=parseFloat(I)||0,q=parseFloat(q)||0,"%"===D&&(/^(fontSize|lineHeight)$/.test(O)?(q/=100,D="em"):/^scale/.test(O)?(q/=100,D=""):/(Red|Green|Blue)$/i.test(O)&&(q=q/100*255,D="")),/[\/*]/.test(Y))D=X;else if(X!==D&&0!==I)if(0===q)D=X;else{p=p||m();var Q=/margin|padding|left|right|width|text|word|letter/i.test(O)||/X$/.test(O)||"x"===O?"x":"y";switch(X){case"%":I*="x"===Q?p.percentToPxWidth:p.percentToPxHeight;break;case"px":break;default:I*=p[X+"ToPx"]}switch(D){case"%":I*=1/("x"===Q?p.percentToPxWidth:p.percentToPxHeight);break;case"px":break;default:I*=1/p[D+"ToPx"]}}switch(Y){case"+":q=I+q;break;case"-":q=I-q;break;case"*":q=I*q;break;case"/":q=I/q}l[O]={rootPropertyValue:W,startValue:I,currentValue:I,endValue:q,unitType:D,easing:M},v.debug&&console.log("tweensContainer ("+O+"): "+JSON.stringify(l[O]),o)}else v.debug&&console.log("Skipping ["+B+"] due to a lack of browser support.")}l.element=o}l.element&&(x.Values.addClass(o,"velocity-animating"),R.push(l),""===s.queue&&(i(o).tweensContainer=l,i(o).opts=s),i(o).isAnimating=!0,V===w-1?(v.State.calls.length>1e4&&(v.State.calls=n(v.State.calls)),v.State.calls.push([R,h,s,null,k.resolver]),v.State.isTicking===!1&&(v.State.isTicking=!0,c())):V++)}var o=this,s=$.extend({},v.defaults,P),l={},p;switch(i(o)===a&&v.init(o),parseFloat(s.delay)&&s.queue!==!1&&$.queue(o,s.queue,function(e){v.velocityQueueEntryFlag=!0,i(o).delayTimer={setTimeout:setTimeout(e,parseFloat(s.delay)),next:e}}),s.duration.toString().toLowerCase()){case"fast":s.duration=200;break;case"normal":s.duration=y;break;case"slow":s.duration=600;break;default:s.duration=parseFloat(s.duration)||1}v.mock!==!1&&(v.mock===!0?s.duration=s.delay=1:(s.duration*=parseFloat(v.mock)||1,s.delay*=parseFloat(v.mock)||1)),s.easing=u(s.easing,s.duration),s.begin&&!g.isFunction(s.begin)&&(s.begin=null),s.progress&&!g.isFunction(s.progress)&&(s.progress=null),s.complete&&!g.isFunction(s.complete)&&(s.complete=null),s.display!==a&&null!==s.display&&(s.display=s.display.toString().toLowerCase(),"auto"===s.display&&(s.display=v.CSS.Values.getDisplayType(o))),s.visibility!==a&&null!==s.visibility&&(s.visibility=s.visibility.toString().toLowerCase()),s.mobileHA=s.mobileHA&&v.State.isMobile&&!v.State.isGingerbread,s.queue===!1?s.delay?setTimeout(e,s.delay):e():$.queue(o,s.queue,function(t,r){return r===!0?(k.promise&&k.resolver(h),!0):(v.velocityQueueEntryFlag=!0,void e(t))}),""!==s.queue&&"fx"!==s.queue||"inprogress"===$.queue(o)[0]||$.dequeue(o)}var l=arguments[0]&&($.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||g.isString(arguments[0].properties)),f,d,m,h,b,P;if(g.isWrapped(this)?(f=!1,m=0,h=this,d=this):(f=!0,m=1,h=l?arguments[0].elements:arguments[0]),h=o(h)){l?(b=arguments[0].properties,P=arguments[0].options):(b=arguments[m],P=arguments[m+1]);var w=h.length,V=0;if("stop"!==b&&!$.isPlainObject(P)){var C=m+1;P={};for(var T=C;T<arguments.length;T++)g.isArray(arguments[T])||!/^(fast|normal|slow)$/i.test(arguments[T])&&!/^\d/.test(arguments[T])?g.isString(arguments[T])||g.isArray(arguments[T])?P.easing=arguments[T]:g.isFunction(arguments[T])&&(P.complete=arguments[T]):P.duration=arguments[T]}var k={promise:null,resolver:null,rejecter:null};f&&v.Promise&&(k.promise=new v.Promise(function(e,t){k.resolver=e,k.rejecter=t}));var A;switch(b){case"scroll":A="scroll";break;case"reverse":A="reverse";break;case"stop":$.each(h,function(e,t){i(t)&&i(t).delayTimer&&(clearTimeout(i(t).delayTimer.setTimeout),i(t).delayTimer.next&&i(t).delayTimer.next(),delete i(t).delayTimer)});var F=[];return $.each(v.State.calls,function(e,t){t&&$.each(t[1],function(r,n){var o=g.isString(P)?P:"";return P!==a&&t[2].queue!==o?!0:void $.each(h,function(t,r){r===n&&(P!==a&&($.each($.queue(r,o),function(e,t){g.isFunction(t)&&t(null,!0)}),$.queue(r,o,[])),i(r)&&""===o&&$.each(i(r).tweensContainer,function(e,t){t.endValue=t.currentValue}),F.push(e))})})}),$.each(F,function(e,t){p(t,!0)}),k.promise&&k.resolver(h),e();default:if(!$.isPlainObject(b)||g.isEmptyObject(b)){if(g.isString(b)&&v.Redirects[b]){var E=$.extend({},P),j=E.duration,H=E.delay||0;return E.backwards===!0&&(h=$.extend(!0,[],h).reverse()),$.each(h,function(e,t){parseFloat(E.stagger)?E.delay=H+parseFloat(E.stagger)*e:g.isFunction(E.stagger)&&(E.delay=H+E.stagger.call(t,e,w)),E.drag&&(E.duration=parseFloat(j)||(/^(callout|transition)/.test(b)?1e3:y),E.duration=Math.max(E.duration*(E.backwards?1-e/w:(e+1)/w),.75*E.duration,200)),v.Redirects[b].call(t,t,E||{},e,w,h,k.promise?k:a)
222
- }),e()}var N="Velocity: First argument ("+b+") was not a property map, a known action, or a registered redirect. Aborting.";return k.promise?k.rejecter(new Error(N)):console.log(N),e()}A="start"}var L={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},R=[];$.each(h,function(e,t){g.isNode(t)&&s.call(t)});var E=$.extend({},v.defaults,P),O;if(E.loop=parseInt(E.loop),O=2*E.loop-1,E.loop)for(var z=0;O>z;z++){var q={delay:E.delay,progress:E.progress};z===O-1&&(q.display=E.display,q.visibility=E.visibility,q.complete=E.complete),S(h,"reverse",q)}return e()}};v=$.extend(S,v),v.animate=S;var P=t.requestAnimationFrame||d;return v.State.isMobile||r.hidden===a||r.addEventListener("visibilitychange",function(){r.hidden?(P=function(e){return setTimeout(function(){e(!0)},16)},c()):P=t.requestAnimationFrame||d}),e.Velocity=v,e!==t&&(e.fn.velocity=S,e.fn.velocity.defaults=v.defaults),$.each(["Down","Up"],function(e,t){v.Redirects["slide"+t]=function(e,r,n,o,i,s){var l=$.extend({},r),u=l.begin,c=l.complete,p={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},f={};l.display===a&&(l.display="Down"===t?"inline"===v.CSS.Values.getDisplayType(e)?"inline-block":"block":"none"),l.begin=function(){u&&u.call(i,i);for(var r in p){f[r]=e.style[r];var a=v.CSS.getPropertyValue(e,r);p[r]="Down"===t?[a,0]:[0,a]}f.overflow=e.style.overflow,e.style.overflow="hidden"},l.complete=function(){for(var t in f)e.style[t]=f[t];c&&c.call(i,i),s&&s.resolver(i)},v(e,p,l)}}),$.each(["In","Out"],function(e,t){v.Redirects["fade"+t]=function(e,r,n,o,i,s){var l=$.extend({},r),u={opacity:"In"===t?1:0},c=l.complete;l.complete=n!==o-1?l.begin=null:function(){c&&c.call(i,i),s&&s.resolver(i)},l.display===a&&(l.display="In"===t?"auto":"none"),v(this,u,l)}}),v}(window.jQuery||window.Zepto||window,window,document)});;!function(a,b,c,d){"use strict";function k(a,b,c){return setTimeout(q(a,c),b)}function l(a,b,c){return Array.isArray(a)?(m(a,c[b],c),!0):!1}function m(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 n(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}function o(a,b){return n(a,b,!0)}function p(a,b,c){var e,d=b.prototype;e=a.prototype=Object.create(d),e.constructor=a,e._super=d,c&&n(e,c)}function q(a,b){return function(){return a.apply(b,arguments)}}function r(a,b){return typeof a==g?a.apply(b?b[0]||d:d,b):a}function s(a,b){return a===d?b:a}function t(a,b,c){m(x(b),function(b){a.addEventListener(b,c,!1)})}function u(a,b,c){m(x(b),function(b){a.removeEventListener(b,c,!1)})}function v(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function w(a,b){return a.indexOf(b)>-1}function x(a){return a.trim().split(/\s+/g)}function y(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 z(a){return Array.prototype.slice.call(a,0)}function A(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];y(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 B(a,b){for(var c,f,g=b[0].toUpperCase()+b.slice(1),h=0;h<e.length;){if(c=e[h],f=c?c+g:b,f in a)return f;h++}return d}function D(){return C++}function E(a){var b=a.ownerDocument;return b.defaultView||b.parentWindow}function ab(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){r(a.options.enable,[a])&&c.handler(b)},this.init()}function bb(a){var b,c=a.options.inputClass;return b=c?c:H?wb:I?Eb:G?Gb:rb,new b(a,cb)}function cb(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&O&&0===d-e,g=b&(Q|R)&&0===d-e;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,db(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function db(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=gb(b)),e>1&&!c.firstMultiple?c.firstMultiple=gb(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=hb(d);b.timeStamp=j(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=lb(h,i),b.distance=kb(h,i),eb(c,b),b.offsetDirection=jb(b.deltaX,b.deltaY),b.scale=g?nb(g.pointers,d):1,b.rotation=g?mb(g.pointers,d):0,fb(c,b);var k=a.element;v(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function eb(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===O||f.eventType===Q)&&(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 fb(a,b){var f,g,h,j,c=a.lastInterval||b,e=b.timeStamp-c.timeStamp;if(b.eventType!=R&&(e>N||c.velocity===d)){var k=c.deltaX-b.deltaX,l=c.deltaY-b.deltaY,m=ib(e,k,l);g=m.x,h=m.y,f=i(m.x)>i(m.y)?m.x:m.y,j=jb(k,l),a.lastInterval=b}else f=c.velocity,g=c.velocityX,h=c.velocityY,j=c.direction;b.velocity=f,b.velocityX=g,b.velocityY=h,b.direction=j}function gb(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:h(a.pointers[c].clientX),clientY:h(a.pointers[c].clientY)},c++;return{timeStamp:j(),pointers:b,center:hb(b),deltaX:a.deltaX,deltaY:a.deltaY}}function hb(a){var b=a.length;if(1===b)return{x:h(a[0].clientX),y:h(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:h(c/b),y:h(d/b)}}function ib(a,b,c){return{x:b/a||0,y:c/a||0}}function jb(a,b){return a===b?S:i(a)>=i(b)?a>0?T:U:b>0?V:W}function kb(a,b,c){c||(c=$);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function lb(a,b,c){c||(c=$);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function mb(a,b){return lb(b[1],b[0],_)-lb(a[1],a[0],_)}function nb(a,b){return kb(b[0],b[1],_)/kb(a[0],a[1],_)}function rb(){this.evEl=pb,this.evWin=qb,this.allow=!0,this.pressed=!1,ab.apply(this,arguments)}function wb(){this.evEl=ub,this.evWin=vb,ab.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Ab(){this.evTarget=yb,this.evWin=zb,this.started=!1,ab.apply(this,arguments)}function Bb(a,b){var c=z(a.touches),d=z(a.changedTouches);return b&(Q|R)&&(c=A(c.concat(d),"identifier",!0)),[c,d]}function Eb(){this.evTarget=Db,this.targetIds={},ab.apply(this,arguments)}function Fb(a,b){var c=z(a.touches),d=this.targetIds;if(b&(O|P)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=z(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return v(a.target,i)}),b===O)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&(Q|R)&&delete d[g[e].identifier],e++;return h.length?[A(f.concat(h),"identifier",!0),h]:void 0}function Gb(){ab.apply(this,arguments);var a=q(this.handler,this);this.touch=new Eb(this.manager,a),this.mouse=new rb(this.manager,a)}function Pb(a,b){this.manager=a,this.set(b)}function Qb(a){if(w(a,Mb))return Mb;var b=w(a,Nb),c=w(a,Ob);return b&&c?Nb+" "+Ob:b||c?b?Nb:Ob:w(a,Lb)?Lb:Kb}function Yb(a){this.id=D(),this.manager=null,this.options=o(a||{},this.defaults),this.options.enable=s(this.options.enable,!0),this.state=Rb,this.simultaneous={},this.requireFail=[]}function Zb(a){return a&Wb?"cancel":a&Ub?"end":a&Tb?"move":a&Sb?"start":""}function $b(a){return a==W?"down":a==V?"up":a==T?"left":a==U?"right":""}function _b(a,b){var c=b.manager;return c?c.get(a):a}function ac(){Yb.apply(this,arguments)}function bc(){ac.apply(this,arguments),this.pX=null,this.pY=null}function cc(){ac.apply(this,arguments)}function dc(){Yb.apply(this,arguments),this._timer=null,this._input=null}function ec(){ac.apply(this,arguments)}function fc(){ac.apply(this,arguments)}function gc(){Yb.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function hc(a,b){return b=b||{},b.recognizers=s(b.recognizers,hc.defaults.preset),new kc(a,b)}function kc(a,b){b=b||{},this.options=o(b,hc.defaults),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.element=a,this.input=bb(this),this.touchAction=new Pb(this,this.options.touchAction),lc(this,!0),m(b.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 lc(a,b){var c=a.element;m(a.options.cssProps,function(a,d){c.style[B(c.style,d)]=b?a:""})}function mc(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var e=["","webkit","moz","MS","ms","o"],f=b.createElement("div"),g="function",h=Math.round,i=Math.abs,j=Date.now,C=1,F=/mobile|tablet|ip(ad|hone|od)|android/i,G="ontouchstart"in a,H=B(a,"PointerEvent")!==d,I=G&&F.test(navigator.userAgent),J="touch",K="pen",L="mouse",M="kinect",N=25,O=1,P=2,Q=4,R=8,S=1,T=2,U=4,V=8,W=16,X=T|U,Y=V|W,Z=X|Y,$=["x","y"],_=["clientX","clientY"];ab.prototype={handler:function(){},init:function(){this.evEl&&t(this.element,this.evEl,this.domHandler),this.evTarget&&t(this.target,this.evTarget,this.domHandler),this.evWin&&t(E(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&u(this.element,this.evEl,this.domHandler),this.evTarget&&u(this.target,this.evTarget,this.domHandler),this.evWin&&u(E(this.element),this.evWin,this.domHandler)}};var ob={mousedown:O,mousemove:P,mouseup:Q},pb="mousedown",qb="mousemove mouseup";p(rb,ab,{handler:function(a){var b=ob[a.type];b&O&&0===a.button&&(this.pressed=!0),b&P&&1!==a.which&&(b=Q),this.pressed&&this.allow&&(b&Q&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:L,srcEvent:a}))}});var sb={pointerdown:O,pointermove:P,pointerup:Q,pointercancel:R,pointerout:R},tb={2:J,3:K,4:L,5:M},ub="pointerdown",vb="pointermove pointerup pointercancel";a.MSPointerEvent&&(ub="MSPointerDown",vb="MSPointerMove MSPointerUp MSPointerCancel"),p(wb,ab,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=sb[d],f=tb[a.pointerType]||a.pointerType,g=f==J,h=y(b,a.pointerId,"pointerId");e&O&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Q|R)&&(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 xb={touchstart:O,touchmove:P,touchend:Q,touchcancel:R},yb="touchstart",zb="touchstart touchmove touchend touchcancel";p(Ab,ab,{handler:function(a){var b=xb[a.type];if(b===O&&(this.started=!0),this.started){var c=Bb.call(this,a,b);b&(Q|R)&&0===c[0].length-c[1].length&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:J,srcEvent:a})}}});var Cb={touchstart:O,touchmove:P,touchend:Q,touchcancel:R},Db="touchstart touchmove touchend touchcancel";p(Eb,ab,{handler:function(a){var b=Cb[a.type],c=Fb.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:J,srcEvent:a})}}),p(Gb,ab,{handler:function(a,b,c){var d=c.pointerType==J,e=c.pointerType==L;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Q|R)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Hb=B(f.style,"touchAction"),Ib=Hb!==d,Jb="compute",Kb="auto",Lb="manipulation",Mb="none",Nb="pan-x",Ob="pan-y";Pb.prototype={set:function(a){a==Jb&&(a=this.compute()),Ib&&(this.manager.element.style[Hb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return m(this.manager.recognizers,function(b){r(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),Qb(a.join(" "))},preventDefaults:function(a){if(!Ib){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return b.preventDefault(),void 0;var d=this.actions,e=w(d,Mb),f=w(d,Ob),g=w(d,Nb);return e||f&&c&X||g&&c&Y?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var Rb=1,Sb=2,Tb=4,Ub=8,Vb=Ub,Wb=16,Xb=32;Yb.prototype={defaults:{},set:function(a){return n(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(l(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_b(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return l(a,"dropRecognizeWith",this)?this:(a=_b(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(l(a,"requireFailure",this))return this;var b=this.requireFail;return a=_b(a,this),-1===y(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(l(a,"dropRequireFailure",this))return this;a=_b(a,this);var b=y(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 d(d){b.manager.emit(b.options.event+(d?Zb(c):""),a)}var b=this,c=this.state;Ub>c&&d(!0),d(),c>=Ub&&d(!0)},tryEmit:function(a){return this.canEmit()?this.emit(a):(this.state=Xb,void 0)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(Xb|Rb)))return!1;a++}return!0},recognize:function(a){var b=n({},a);return r(this.options.enable,[this,b])?(this.state&(Vb|Wb|Xb)&&(this.state=Rb),this.state=this.process(b),this.state&(Sb|Tb|Ub|Wb)&&this.tryEmit(b),void 0):(this.reset(),this.state=Xb,void 0)},process:function(){},getTouchAction:function(){},reset:function(){}},p(ac,Yb,{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&(Sb|Tb),e=this.attrTest(a);return d&&(c&R||!e)?b|Wb:d||e?c&Q?b|Ub:b&Sb?b|Tb:Sb:Xb}}),p(bc,ac,{defaults:{event:"pan",threshold:10,pointers:1,direction:Z},getTouchAction:function(){var a=this.options.direction,b=[];return a&X&&b.push(Ob),a&Y&&b.push(Nb),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&X?(e=0===f?S:0>f?T:U,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?S:0>g?V:W,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return ac.prototype.attrTest.call(this,a)&&(this.state&Sb||!(this.state&Sb)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$b(a.direction);b&&this.manager.emit(this.options.event+b,a),this._super.emit.call(this,a)}}),p(cc,ac,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Mb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&Sb)},emit:function(a){if(this._super.emit.call(this,a),1!==a.scale){var b=a.scale<1?"in":"out";this.manager.emit(this.options.event+b,a)}}}),p(dc,Yb,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[Kb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,e=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Q|R)&&!e)this.reset();else if(a.eventType&O)this.reset(),this._timer=k(function(){this.state=Vb,this.tryEmit()},b.time,this);else if(a.eventType&Q)return Vb;return Xb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===Vb&&(a&&a.eventType&Q?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=j(),this.manager.emit(this.options.event,this._input)))}}),p(ec,ac,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Mb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&Sb)}}),p(fc,ac,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:X|Y,pointers:1},getTouchAction:function(){return bc.prototype.getTouchAction.call(this)},attrTest:function(a){var c,b=this.options.direction;return b&(X|Y)?c=a.velocity:b&X?c=a.velocityX:b&Y&&(c=a.velocityY),this._super.attrTest.call(this,a)&&b&a.direction&&a.distance>this.options.threshold&&i(c)>this.options.velocity&&a.eventType&Q},emit:function(a){var b=$b(a.direction);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),p(gc,Yb,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[Lb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,e=a.deltaTime<b.time;if(this.reset(),a.eventType&O&&0===this.count)return this.failTimeout();if(d&&e&&c){if(a.eventType!=Q)return this.failTimeout();var f=this.pTime?a.timeStamp-this.pTime<b.interval:!0,g=!this.pCenter||kb(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,g&&f?this.count+=1:this.count=1,this._input=a;var h=this.count%b.taps;if(0===h)return this.hasRequireFailures()?(this._timer=k(function(){this.state=Vb,this.tryEmit()},b.interval,this),Sb):Vb}return Xb},failTimeout:function(){return this._timer=k(function(){this.state=Xb},this.options.interval,this),Xb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Vb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),hc.VERSION="2.0.4",hc.defaults={domEvents:!1,touchAction:Jb,enable:!0,inputTarget:null,inputClass:null,preset:[[ec,{enable:!1}],[cc,{enable:!1},["rotate"]],[fc,{direction:X}],[bc,{direction:X},["swipe"]],[gc],[gc,{event:"doubletap",taps:2},["tap"]],[dc]],cssProps:{userSelect:"default",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ic=1,jc=2;kc.prototype={set:function(a){return n(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?jc:ic},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&Vb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===jc||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(Sb|Tb|Ub)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Yb)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(l(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(l(a,"remove",this))return this;var b=this.recognizers;return a=this.get(a),b.splice(y(b,a),1),this.touchAction.update(),this},on:function(a,b){var c=this.handlers;return m(x(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this},off:function(a,b){var c=this.handlers;return m(x(a),function(a){b?c[a].splice(y(c[a],b),1):delete c[a]}),this},emit:function(a,b){this.options.domEvents&&mc(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&&lc(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},n(hc,{INPUT_START:O,INPUT_MOVE:P,INPUT_END:Q,INPUT_CANCEL:R,STATE_POSSIBLE:Rb,STATE_BEGAN:Sb,STATE_CHANGED:Tb,STATE_ENDED:Ub,STATE_RECOGNIZED:Vb,STATE_CANCELLED:Wb,STATE_FAILED:Xb,DIRECTION_NONE:S,DIRECTION_LEFT:T,DIRECTION_RIGHT:U,DIRECTION_UP:V,DIRECTION_DOWN:W,DIRECTION_HORIZONTAL:X,DIRECTION_VERTICAL:Y,DIRECTION_ALL:Z,Manager:kc,Input:ab,TouchAction:Pb,TouchInput:Eb,MouseInput:rb,PointerEventInput:wb,TouchMouseInput:Gb,SingleTouchInput:Ab,Recognizer:Yb,AttrRecognizer:ac,Tap:gc,Pan:bc,Swipe:fc,Pinch:cc,Rotate:ec,Press:dc,on:t,off:u,each:m,merge:o,extend:n,inherit:p,bindFn:q,prefixed:B}),typeof define==g&&define.amd?define(function(){return hc}):"undefined"!=typeof module&&module.exports?module.exports=hc:a[c]=hc}(window,document,"Hammer");;(function(factory) {
221
+ !function(e){function t(e){var t=e.length,r=$.type(e);return"function"===r||$.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e}if(!e.jQuery){var $=function(e,t){return new $.fn.init(e,t)};$.isWindow=function(e){return null!=e&&e==e.window},$.type=function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?a[o.call(e)]||"object":typeof e},$.isArray=Array.isArray||function(e){return"array"===$.type(e)},$.isPlainObject=function(e){var t;if(!e||"object"!==$.type(e)||e.nodeType||$.isWindow(e))return!1;try{if(e.constructor&&!n.call(e,"constructor")&&!n.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}for(t in e);return void 0===t||n.call(e,t)},$.each=function(e,r,a){var n,o=0,i=e.length,s=t(e);if(a){if(s)for(;i>o&&(n=r.apply(e[o],a),n!==!1);o++);else for(o in e)if(n=r.apply(e[o],a),n===!1)break}else if(s)for(;i>o&&(n=r.call(e[o],o,e[o]),n!==!1);o++);else for(o in e)if(n=r.call(e[o],o,e[o]),n===!1)break;return e},$.data=function(e,t,a){if(void 0===a){var n=e[$.expando],o=n&&r[n];if(void 0===t)return o;if(o&&t in o)return o[t]}else if(void 0!==t){var n=e[$.expando]||(e[$.expando]=++$.uuid);return r[n]=r[n]||{},r[n][t]=a,a}},$.removeData=function(e,t){var a=e[$.expando],n=a&&r[a];n&&$.each(t,function(e,t){delete n[t]})},$.extend=function(){var e,t,r,a,n,o,i=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof i&&(u=i,i=arguments[s]||{},s++),"object"!=typeof i&&"function"!==$.type(i)&&(i={}),s===l&&(i=this,s--);l>s;s++)if(null!=(n=arguments[s]))for(a in n)e=i[a],r=n[a],i!==r&&(u&&r&&($.isPlainObject(r)||(t=$.isArray(r)))?(t?(t=!1,o=e&&$.isArray(e)?e:[]):o=e&&$.isPlainObject(e)?e:{},i[a]=$.extend(u,o,r)):void 0!==r&&(i[a]=r));return i},$.queue=function(e,r,a){function n(e,r){var a=r||[];return null!=e&&(t(Object(e))?!function(e,t){for(var r=+t.length,a=0,n=e.length;r>a;)e[n++]=t[a++];if(r!==r)for(;void 0!==t[a];)e[n++]=t[a++];return e.length=n,e}(a,"string"==typeof e?[e]:e):[].push.call(a,e)),a}if(e){r=(r||"fx")+"queue";var o=$.data(e,r);return a?(!o||$.isArray(a)?o=$.data(e,r,n(a)):o.push(a),o):o||[]}},$.dequeue=function(e,t){$.each(e.nodeType?[e]:e,function(e,r){t=t||"fx";var a=$.queue(r,t),n=a.shift();"inprogress"===n&&(n=a.shift()),n&&("fx"===t&&a.unshift("inprogress"),n.call(r,function(){$.dequeue(r,t)}))})},$.fn=$.prototype={init:function(e){if(e.nodeType)return this[0]=e,this;throw new Error("Not a DOM node.")},offset:function(){var t=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:t.top+(e.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:t.left+(e.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function e(){for(var e=this.offsetParent||document;e&&"html"===!e.nodeType.toLowerCase&&"static"===e.style.position;)e=e.offsetParent;return e||document}var t=this[0],e=e.apply(t),r=this.offset(),a=/^(?:body|html)$/i.test(e.nodeName)?{top:0,left:0}:$(e).offset();return r.top-=parseFloat(t.style.marginTop)||0,r.left-=parseFloat(t.style.marginLeft)||0,e.style&&(a.top+=parseFloat(e.style.borderTopWidth)||0,a.left+=parseFloat(e.style.borderLeftWidth)||0),{top:r.top-a.top,left:r.left-a.left}}};var r={};$.expando="velocity"+(new Date).getTime(),$.uuid=0;for(var a={},n=a.hasOwnProperty,o=a.toString,i="Boolean Number String Function Array Date RegExp Object Error".split(" "),s=0;s<i.length;s++)a["[object "+i[s]+"]"]=i[s].toLowerCase();$.fn.init.prototype=$.fn,e.Velocity={Utilities:$}}}(window),function(e){"object"==typeof module&&"object"==typeof module.exports?module.exports=e():"function"==typeof define&&define.amd?define(e):e()}(function(){return function(e,t,r,a){function n(e){for(var t=-1,r=e?e.length:0,a=[];++t<r;){var n=e[t];n&&a.push(n)}return a}function o(e){return g.isWrapped(e)?e=[].slice.call(e):g.isNode(e)&&(e=[e]),e}function i(e){var t=$.data(e,"velocity");return null===t?a:t}function s(e){return function(t){return Math.round(t*e)*(1/e)}}function l(e,r,a,n){function o(e,t){return 1-3*t+3*e}function i(e,t){return 3*t-6*e}function s(e){return 3*e}function l(e,t,r){return((o(t,r)*e+i(t,r))*e+s(t))*e}function u(e,t,r){return 3*o(t,r)*e*e+2*i(t,r)*e+s(t)}function c(t,r){for(var n=0;m>n;++n){var o=u(r,e,a);if(0===o)return r;var i=l(r,e,a)-t;r-=i/o}return r}function p(){for(var t=0;b>t;++t)w[t]=l(t*x,e,a)}function f(t,r,n){var o,i,s=0;do i=r+(n-r)/2,o=l(i,e,a)-t,o>0?n=i:r=i;while(Math.abs(o)>h&&++s<v);return i}function d(t){for(var r=0,n=1,o=b-1;n!=o&&w[n]<=t;++n)r+=x;--n;var i=(t-w[n])/(w[n+1]-w[n]),s=r+i*x,l=u(s,e,a);return l>=y?c(t,s):0==l?s:f(t,r,r+x)}function g(){V=!0,(e!=r||a!=n)&&p()}var m=4,y=.001,h=1e-7,v=10,b=11,x=1/(b-1),S="Float32Array"in t;if(4!==arguments.length)return!1;for(var P=0;4>P;++P)if("number"!=typeof arguments[P]||isNaN(arguments[P])||!isFinite(arguments[P]))return!1;e=Math.min(e,1),a=Math.min(a,1),e=Math.max(e,0),a=Math.max(a,0);var w=S?new Float32Array(b):new Array(b),V=!1,C=function(t){return V||g(),e===r&&a===n?t:0===t?0:1===t?1:l(d(t),r,n)};C.getControlPoints=function(){return[{x:e,y:r},{x:a,y:n}]};var T="generateBezier("+[e,r,a,n]+")";return C.toString=function(){return T},C}function u(e,t){var r=e;return g.isString(e)?v.Easings[e]||(r=!1):r=g.isArray(e)&&1===e.length?s.apply(null,e):g.isArray(e)&&2===e.length?b.apply(null,e.concat([t])):g.isArray(e)&&4===e.length?l.apply(null,e):!1,r===!1&&(r=v.Easings[v.defaults.easing]?v.defaults.easing:h),r}function c(e){if(e){var t=(new Date).getTime(),r=v.State.calls.length;r>1e4&&(v.State.calls=n(v.State.calls));for(var o=0;r>o;o++)if(v.State.calls[o]){var s=v.State.calls[o],l=s[0],u=s[2],f=s[3],d=!!f,m=null;f||(f=v.State.calls[o][3]=t-16);for(var y=Math.min((t-f)/u.duration,1),h=0,b=l.length;b>h;h++){var S=l[h],w=S.element;if(i(w)){var V=!1;if(u.display!==a&&null!==u.display&&"none"!==u.display){if("flex"===u.display){var C=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];$.each(C,function(e,t){x.setPropertyValue(w,"display",t)})}x.setPropertyValue(w,"display",u.display)}u.visibility!==a&&"hidden"!==u.visibility&&x.setPropertyValue(w,"visibility",u.visibility);for(var T in S)if("element"!==T){var k=S[T],A,F=g.isString(k.easing)?v.Easings[k.easing]:k.easing;if(1===y)A=k.endValue;else{var E=k.endValue-k.startValue;if(A=k.startValue+E*F(y,u,E),!d&&A===k.currentValue)continue}if(k.currentValue=A,"tween"===T)m=A;else{if(x.Hooks.registered[T]){var j=x.Hooks.getRoot(T),H=i(w).rootPropertyValueCache[j];H&&(k.rootPropertyValue=H)}var N=x.setPropertyValue(w,T,k.currentValue+(0===parseFloat(A)?"":k.unitType),k.rootPropertyValue,k.scrollData);x.Hooks.registered[T]&&(i(w).rootPropertyValueCache[j]=x.Normalizations.registered[j]?x.Normalizations.registered[j]("extract",null,N[1]):N[1]),"transform"===N[0]&&(V=!0)}}u.mobileHA&&i(w).transformCache.translate3d===a&&(i(w).transformCache.translate3d="(0px, 0px, 0px)",V=!0),V&&x.flushTransformCache(w)}}u.display!==a&&"none"!==u.display&&(v.State.calls[o][2].display=!1),u.visibility!==a&&"hidden"!==u.visibility&&(v.State.calls[o][2].visibility=!1),u.progress&&u.progress.call(s[1],s[1],y,Math.max(0,f+u.duration-t),f,m),1===y&&p(o)}}v.State.isTicking&&P(c)}function p(e,t){if(!v.State.calls[e])return!1;for(var r=v.State.calls[e][0],n=v.State.calls[e][1],o=v.State.calls[e][2],s=v.State.calls[e][4],l=!1,u=0,c=r.length;c>u;u++){var p=r[u].element;if(t||o.loop||("none"===o.display&&x.setPropertyValue(p,"display",o.display),"hidden"===o.visibility&&x.setPropertyValue(p,"visibility",o.visibility)),o.loop!==!0&&($.queue(p)[1]===a||!/\.velocityQueueEntryFlag/i.test($.queue(p)[1]))&&i(p)){i(p).isAnimating=!1,i(p).rootPropertyValueCache={};var f=!1;$.each(x.Lists.transforms3D,function(e,t){var r=/^scale/.test(t)?1:0,n=i(p).transformCache[t];i(p).transformCache[t]!==a&&new RegExp("^\\("+r+"[^.]").test(n)&&(f=!0,delete i(p).transformCache[t])}),o.mobileHA&&(f=!0,delete i(p).transformCache.translate3d),f&&x.flushTransformCache(p),x.Values.removeClass(p,"velocity-animating")}if(!t&&o.complete&&!o.loop&&u===c-1)try{o.complete.call(n,n)}catch(d){setTimeout(function(){throw d},1)}s&&o.loop!==!0&&s(n),i(p)&&o.loop===!0&&!t&&($.each(i(p).tweensContainer,function(e,t){/^rotate/.test(e)&&360===parseFloat(t.endValue)&&(t.endValue=0,t.startValue=360),/^backgroundPosition/.test(e)&&100===parseFloat(t.endValue)&&"%"===t.unitType&&(t.endValue=0,t.startValue=100)}),v(p,"reverse",{loop:!0,delay:o.delay})),o.queue!==!1&&$.dequeue(p,o.queue)}v.State.calls[e]=!1;for(var g=0,m=v.State.calls.length;m>g;g++)if(v.State.calls[g]!==!1){l=!0;break}l===!1&&(v.State.isTicking=!1,delete v.State.calls,v.State.calls=[])}var f=function(){if(r.documentMode)return r.documentMode;for(var e=7;e>4;e--){var t=r.createElement("div");if(t.innerHTML="<!--[if IE "+e+"]><span></span><![endif]-->",t.getElementsByTagName("span").length)return t=null,e}return a}(),d=function(){var e=0;return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(t){var r=(new Date).getTime(),a;return a=Math.max(0,16-(r-e)),e=r+a,setTimeout(function(){t(r+a)},a)}}(),g={isString:function(e){return"string"==typeof e},isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)},isNode:function(e){return e&&e.nodeType},isNodeList:function(e){return"object"==typeof e&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(e))&&e.length!==a&&(0===e.length||"object"==typeof e[0]&&e[0].nodeType>0)},isWrapped:function(e){return e&&(e.jquery||t.Zepto&&t.Zepto.zepto.isZ(e))},isSVG:function(e){return t.SVGElement&&e instanceof t.SVGElement},isEmptyObject:function(e){for(var t in e)return!1;return!0}},$,m=!1;if(e.fn&&e.fn.jquery?($=e,m=!0):$=t.Velocity.Utilities,8>=f&&!m)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(7>=f)return void(jQuery.fn.velocity=jQuery.fn.animate);var y=400,h="swing",v={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:t.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:r.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:$,Redirects:{},Easings:{},Promise:t.Promise,defaults:{queue:"",duration:y,easing:h,begin:a,complete:a,progress:a,display:a,visibility:a,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(e){$.data(e,"velocity",{isSVG:g.isSVG(e),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:2,patch:2},debug:!1};t.pageYOffset!==a?(v.State.scrollAnchor=t,v.State.scrollPropertyLeft="pageXOffset",v.State.scrollPropertyTop="pageYOffset"):(v.State.scrollAnchor=r.documentElement||r.body.parentNode||r.body,v.State.scrollPropertyLeft="scrollLeft",v.State.scrollPropertyTop="scrollTop");var b=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,r,a){var n={x:t.x+a.dx*r,v:t.v+a.dv*r,tension:t.tension,friction:t.friction};return{dx:n.v,dv:e(n)}}function r(r,a){var n={dx:r.v,dv:e(r)},o=t(r,.5*a,n),i=t(r,.5*a,o),s=t(r,a,i),l=1/6*(n.dx+2*(o.dx+i.dx)+s.dx),u=1/6*(n.dv+2*(o.dv+i.dv)+s.dv);return r.x=r.x+l*a,r.v=r.v+u*a,r}return function a(e,t,n){var o={x:-1,v:0,tension:null,friction:null},i=[0],s=0,l=1e-4,u=.016,c,p,f;for(e=parseFloat(e)||500,t=parseFloat(t)||20,n=n||null,o.tension=e,o.friction=t,c=null!==n,c?(s=a(e,t),p=s/n*u):p=u;;)if(f=r(f||o,p),i.push(1+f.x),s+=16,!(Math.abs(f.x)>l&&Math.abs(f.v)>l))break;return c?function(e){return i[e*(i.length-1)|0]}:s}}();v.Easings={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)}},$.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(e,t){v.Easings[t[0]]=l.apply(null,t[1])});var x=v.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 e=0;e<x.Lists.colors.length;e++){var t="color"===x.Lists.colors[e]?"0 0 0 1":"255 255 255 1";x.Hooks.templates[x.Lists.colors[e]]=["Red Green Blue Alpha",t]}var r,a,n;if(f)for(r in x.Hooks.templates){a=x.Hooks.templates[r],n=a[0].split(" ");var o=a[1].match(x.RegEx.valueSplit);"Color"===n[0]&&(n.push(n.shift()),o.push(o.shift()),x.Hooks.templates[r]=[n.join(" "),o.join(" ")])}for(r in x.Hooks.templates){a=x.Hooks.templates[r],n=a[0].split(" ");for(var e in n){var i=r+n[e],s=e;x.Hooks.registered[i]=[r,s]}}},getRoot:function(e){var t=x.Hooks.registered[e];return t?t[0]:e},cleanRootPropertyValue:function(e,t){return x.RegEx.valueUnwrap.test(t)&&(t=t.match(x.RegEx.valueUnwrap)[1]),x.Values.isCSSNullValue(t)&&(t=x.Hooks.templates[e][1]),t},extractValue:function(e,t){var r=x.Hooks.registered[e];if(r){var a=r[0],n=r[1];return t=x.Hooks.cleanRootPropertyValue(a,t),t.toString().match(x.RegEx.valueSplit)[n]}return t},injectValue:function(e,t,r){var a=x.Hooks.registered[e];if(a){var n=a[0],o=a[1],i,s;return r=x.Hooks.cleanRootPropertyValue(n,r),i=r.toString().match(x.RegEx.valueSplit),i[o]=t,s=i.join(" ")}return r}},Normalizations:{registered:{clip:function(e,t,r){switch(e){case"name":return"clip";case"extract":var a;return x.RegEx.wrappedValueAlreadyExtracted.test(r)?a=r:(a=r.toString().match(x.RegEx.valueUnwrap),a=a?a[1].replace(/,(\s+)?/g," "):r),a;case"inject":return"rect("+r+")"}},blur:function(e,t,r){switch(e){case"name":return v.State.isFirefox?"filter":"-webkit-filter";case"extract":var a=parseFloat(r);if(!a&&0!==a){var n=r.toString().match(/blur\(([0-9]+[A-z]+)\)/i);a=n?n[1]:0}return a;case"inject":return parseFloat(r)?"blur("+r+")":"none"}},opacity:function(e,t,r){if(8>=f)switch(e){case"name":return"filter";case"extract":var a=r.toString().match(/alpha\(opacity=(.*)\)/i);return r=a?a[1]/100:1;case"inject":return t.style.zoom=1,parseFloat(r)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(r),10)+")"}else switch(e){case"name":return"opacity";case"extract":return r;case"inject":return r}}},register:function(){9>=f||v.State.isGingerbread||(x.Lists.transformsBase=x.Lists.transformsBase.concat(x.Lists.transforms3D));for(var e=0;e<x.Lists.transformsBase.length;e++)!function(){var t=x.Lists.transformsBase[e];x.Normalizations.registered[t]=function(e,r,n){switch(e){case"name":return"transform";case"extract":return i(r)===a||i(r).transformCache[t]===a?/^scale/i.test(t)?1:0:i(r).transformCache[t].replace(/[()]/g,"");case"inject":var o=!1;switch(t.substr(0,t.length-1)){case"translate":o=!/(%|px|em|rem|vw|vh|\d)$/i.test(n);break;case"scal":case"scale":v.State.isAndroid&&i(r).transformCache[t]===a&&1>n&&(n=1),o=!/(\d)$/i.test(n);break;case"skew":o=!/(deg|\d)$/i.test(n);break;case"rotate":o=!/(deg|\d)$/i.test(n)}return o||(i(r).transformCache[t]="("+n+")"),i(r).transformCache[t]}}}();for(var e=0;e<x.Lists.colors.length;e++)!function(){var t=x.Lists.colors[e];x.Normalizations.registered[t]=function(e,r,n){switch(e){case"name":return t;case"extract":var o;if(x.RegEx.wrappedValueAlreadyExtracted.test(n))o=n;else{var i,s={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(n)?i=s[n]!==a?s[n]:s.black:x.RegEx.isHex.test(n)?i="rgb("+x.Values.hexToRgb(n).join(" ")+")":/^rgba?\(/i.test(n)||(i=s.black),o=(i||n).toString().match(x.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return 8>=f||3!==o.split(" ").length||(o+=" 1"),o;case"inject":return 8>=f?4===n.split(" ").length&&(n=n.split(/\s+/).slice(0,3).join(" ")):3===n.split(" ").length&&(n+=" 1"),(8>=f?"rgb":"rgba")+"("+n.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})},SVGAttribute:function(e){var t="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(f||v.State.isAndroid&&!v.State.isChrome)&&(t+="|transform"),new RegExp("^("+t+")$","i").test(e)},prefixCheck:function(e){if(v.State.prefixMatches[e])return[v.State.prefixMatches[e],!0];for(var t=["","Webkit","Moz","ms","O"],r=0,a=t.length;a>r;r++){var n;if(n=0===r?e:t[r]+e.replace(/^\w/,function(e){return e.toUpperCase()}),g.isString(v.State.prefixElement.style[n]))return v.State.prefixMatches[e]=n,[n,!0]}return[e,!1]}},Values:{hexToRgb:function(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,a;return e=e.replace(t,function(e,t,r,a){return t+t+r+r+a+a}),a=r.exec(e),a?[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]:[0,0,0]},isCSSNullValue:function(e){return 0==e||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(e)},getUnitType:function(e){return/^(rotate|skew)/i.test(e)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(e)?"":"px"},getDisplayType:function(e){var t=e&&e.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(t)?"inline":/^(li)$/i.test(t)?"list-item":/^(tr)$/i.test(t)?"table-row":/^(table)$/i.test(t)?"table":/^(tbody)$/i.test(t)?"table-row-group":"block"},addClass:function(e,t){e.classList?e.classList.add(t):e.className+=(e.className.length?" ":"")+t},removeClass:function(e,t){e.classList?e.classList.remove(t):e.className=e.className.toString().replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(e,r,n,o){function s(e,r){function n(){u&&x.setPropertyValue(e,"display","none")}var l=0;if(8>=f)l=$.css(e,r);else{var u=!1;if(/^(width|height)$/.test(r)&&0===x.getPropertyValue(e,"display")&&(u=!0,x.setPropertyValue(e,"display",x.Values.getDisplayType(e))),!o){if("height"===r&&"border-box"!==x.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var c=e.offsetHeight-(parseFloat(x.getPropertyValue(e,"borderTopWidth"))||0)-(parseFloat(x.getPropertyValue(e,"borderBottomWidth"))||0)-(parseFloat(x.getPropertyValue(e,"paddingTop"))||0)-(parseFloat(x.getPropertyValue(e,"paddingBottom"))||0);return n(),c}if("width"===r&&"border-box"!==x.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var p=e.offsetWidth-(parseFloat(x.getPropertyValue(e,"borderLeftWidth"))||0)-(parseFloat(x.getPropertyValue(e,"borderRightWidth"))||0)-(parseFloat(x.getPropertyValue(e,"paddingLeft"))||0)-(parseFloat(x.getPropertyValue(e,"paddingRight"))||0);return n(),p}}var d;d=i(e)===a?t.getComputedStyle(e,null):i(e).computedStyle?i(e).computedStyle:i(e).computedStyle=t.getComputedStyle(e,null),"borderColor"===r&&(r="borderTopColor"),l=9===f&&"filter"===r?d.getPropertyValue(r):d[r],(""===l||null===l)&&(l=e.style[r]),n()}if("auto"===l&&/^(top|right|bottom|left)$/i.test(r)){var g=s(e,"position");("fixed"===g||"absolute"===g&&/top|left/i.test(r))&&(l=$(e).position()[r]+"px")}return l}var l;if(x.Hooks.registered[r]){var u=r,c=x.Hooks.getRoot(u);n===a&&(n=x.getPropertyValue(e,x.Names.prefixCheck(c)[0])),x.Normalizations.registered[c]&&(n=x.Normalizations.registered[c]("extract",e,n)),l=x.Hooks.extractValue(u,n)}else if(x.Normalizations.registered[r]){var p,d;p=x.Normalizations.registered[r]("name",e),"transform"!==p&&(d=s(e,x.Names.prefixCheck(p)[0]),x.Values.isCSSNullValue(d)&&x.Hooks.templates[r]&&(d=x.Hooks.templates[r][1])),l=x.Normalizations.registered[r]("extract",e,d)}if(!/^[\d-]/.test(l))if(i(e)&&i(e).isSVG&&x.Names.SVGAttribute(r))if(/^(height|width)$/i.test(r))try{l=e.getBBox()[r]}catch(g){l=0}else l=e.getAttribute(r);else l=s(e,x.Names.prefixCheck(r)[0]);return x.Values.isCSSNullValue(l)&&(l=0),v.debug>=2&&console.log("Get "+r+": "+l),l},setPropertyValue:function(e,r,a,n,o){var s=r;if("scroll"===r)o.container?o.container["scroll"+o.direction]=a:"Left"===o.direction?t.scrollTo(a,o.alternateValue):t.scrollTo(o.alternateValue,a);else if(x.Normalizations.registered[r]&&"transform"===x.Normalizations.registered[r]("name",e))x.Normalizations.registered[r]("inject",e,a),s="transform",a=i(e).transformCache[r];else{if(x.Hooks.registered[r]){var l=r,u=x.Hooks.getRoot(r);n=n||x.getPropertyValue(e,u),a=x.Hooks.injectValue(l,a,n),r=u}if(x.Normalizations.registered[r]&&(a=x.Normalizations.registered[r]("inject",e,a),r=x.Normalizations.registered[r]("name",e)),s=x.Names.prefixCheck(r)[0],8>=f)try{e.style[s]=a}catch(c){v.debug&&console.log("Browser does not support ["+a+"] for ["+s+"]")}else i(e)&&i(e).isSVG&&x.Names.SVGAttribute(r)?e.setAttribute(r,a):e.style[s]=a;v.debug>=2&&console.log("Set "+r+" ("+s+"): "+a)}return[s,a]},flushTransformCache:function(e){function t(t){return parseFloat(x.getPropertyValue(e,t))}var r="";if((f||v.State.isAndroid&&!v.State.isChrome)&&i(e).isSVG){var a={translate:[t("translateX"),t("translateY")],skewX:[t("skewX")],skewY:[t("skewY")],scale:1!==t("scale")?[t("scale"),t("scale")]:[t("scaleX"),t("scaleY")],rotate:[t("rotateZ"),0,0]};$.each(i(e).transformCache,function(e){/^translate/i.test(e)?e="translate":/^scale/i.test(e)?e="scale":/^rotate/i.test(e)&&(e="rotate"),a[e]&&(r+=e+"("+a[e].join(" ")+") ",delete a[e])})}else{var n,o;$.each(i(e).transformCache,function(t){return n=i(e).transformCache[t],"transformPerspective"===t?(o=n,!0):(9===f&&"rotateZ"===t&&(t="rotate"),void(r+=t+n+" "))}),o&&(r="perspective"+o+" "+r)}x.setPropertyValue(e,"transform",r)}};x.Hooks.register(),x.Normalizations.register(),v.hook=function(e,t,r){var n=a;return e=o(e),$.each(e,function(e,o){if(i(o)===a&&v.init(o),r===a)n===a&&(n=v.CSS.getPropertyValue(o,t));else{var s=v.CSS.setPropertyValue(o,t,r);"transform"===s[0]&&v.CSS.flushTransformCache(o),n=s}}),n};var S=function(){function e(){return l?T.promise||null:f}function n(){function e(e){function p(e,t){var r=a,i=a,s=a;return g.isArray(e)?(r=e[0],!g.isArray(e[1])&&/^[\d-]/.test(e[1])||g.isFunction(e[1])||x.RegEx.isHex.test(e[1])?s=e[1]:(g.isString(e[1])&&!x.RegEx.isHex.test(e[1])||g.isArray(e[1]))&&(i=t?e[1]:u(e[1],o.duration),e[2]!==a&&(s=e[2]))):r=e,t||(i=i||o.easing),g.isFunction(r)&&(r=r.call(n,w,P)),g.isFunction(s)&&(s=s.call(n,w,P)),[r||0,i,s]}function f(e,t){var r,a;return a=(t||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(e){return r=e,""}),r||(r=x.Values.getUnitType(e)),[a,r]}function d(){var e={myParent:n.parentNode||r.body,position:x.getPropertyValue(n,"position"),fontSize:x.getPropertyValue(n,"fontSize")},a=e.position===N.lastPosition&&e.myParent===N.lastParent,o=e.fontSize===N.lastFontSize;N.lastParent=e.myParent,N.lastPosition=e.position,N.lastFontSize=e.fontSize;var s=100,l={};if(o&&a)l.emToPx=N.lastEmToPx,l.percentToPxWidth=N.lastPercentToPxWidth,l.percentToPxHeight=N.lastPercentToPxHeight;else{var u=i(n).isSVG?r.createElementNS("http://www.w3.org/2000/svg","rect"):r.createElement("div");v.init(u),e.myParent.appendChild(u),$.each(["overflow","overflowX","overflowY"],function(e,t){v.CSS.setPropertyValue(u,t,"hidden")}),v.CSS.setPropertyValue(u,"position",e.position),v.CSS.setPropertyValue(u,"fontSize",e.fontSize),v.CSS.setPropertyValue(u,"boxSizing","content-box"),$.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(e,t){v.CSS.setPropertyValue(u,t,s+"%")}),v.CSS.setPropertyValue(u,"paddingLeft",s+"em"),l.percentToPxWidth=N.lastPercentToPxWidth=(parseFloat(x.getPropertyValue(u,"width",null,!0))||1)/s,l.percentToPxHeight=N.lastPercentToPxHeight=(parseFloat(x.getPropertyValue(u,"height",null,!0))||1)/s,l.emToPx=N.lastEmToPx=(parseFloat(x.getPropertyValue(u,"paddingLeft"))||1)/s,e.myParent.removeChild(u)}return null===N.remToPx&&(N.remToPx=parseFloat(x.getPropertyValue(r.body,"fontSize"))||16),null===N.vwToPx&&(N.vwToPx=parseFloat(t.innerWidth)/100,N.vhToPx=parseFloat(t.innerHeight)/100),l.remToPx=N.remToPx,l.vwToPx=N.vwToPx,l.vhToPx=N.vhToPx,v.debug>=1&&console.log("Unit ratios: "+JSON.stringify(l),n),l}if(o.begin&&0===w)try{o.begin.call(m,m)}catch(y){setTimeout(function(){throw y},1)}if("scroll"===k){var S=/^x$/i.test(o.axis)?"Left":"Top",V=parseFloat(o.offset)||0,C,A,F;o.container?g.isWrapped(o.container)||g.isNode(o.container)?(o.container=o.container[0]||o.container,C=o.container["scroll"+S],F=C+$(n).position()[S.toLowerCase()]+V):o.container=null:(C=v.State.scrollAnchor[v.State["scrollProperty"+S]],A=v.State.scrollAnchor[v.State["scrollProperty"+("Left"===S?"Top":"Left")]],F=$(n).offset()[S.toLowerCase()]+V),s={scroll:{rootPropertyValue:!1,startValue:C,currentValue:C,endValue:F,unitType:"",easing:o.easing,scrollData:{container:o.container,direction:S,alternateValue:A}},element:n},v.debug&&console.log("tweensContainer (scroll): ",s.scroll,n)}else if("reverse"===k){if(!i(n).tweensContainer)return void $.dequeue(n,o.queue);"none"===i(n).opts.display&&(i(n).opts.display="auto"),"hidden"===i(n).opts.visibility&&(i(n).opts.visibility="visible"),i(n).opts.loop=!1,i(n).opts.begin=null,i(n).opts.complete=null,b.easing||delete o.easing,b.duration||delete o.duration,o=$.extend({},i(n).opts,o);var E=$.extend(!0,{},i(n).tweensContainer);for(var j in E)if("element"!==j){var H=E[j].startValue;E[j].startValue=E[j].currentValue=E[j].endValue,E[j].endValue=H,g.isEmptyObject(b)||(E[j].easing=o.easing),v.debug&&console.log("reverse tweensContainer ("+j+"): "+JSON.stringify(E[j]),n)}s=E}else if("start"===k){var E;i(n).tweensContainer&&i(n).isAnimating===!0&&(E=i(n).tweensContainer),$.each(h,function(e,t){if(RegExp("^"+x.Lists.colors.join("$|^")+"$").test(e)){var r=p(t,!0),n=r[0],o=r[1],i=r[2];if(x.RegEx.isHex.test(n)){for(var s=["Red","Green","Blue"],l=x.Values.hexToRgb(n),u=i?x.Values.hexToRgb(i):a,c=0;c<s.length;c++){var f=[l[c]];o&&f.push(o),u!==a&&f.push(u[c]),h[e+s[c]]=f}delete h[e]}}});for(var R in h){var O=p(h[R]),z=O[0],q=O[1],M=O[2];R=x.Names.camelCase(R);var I=x.Hooks.getRoot(R),B=!1;if(i(n).isSVG||"tween"===I||x.Names.prefixCheck(I)[1]!==!1||x.Normalizations.registered[I]!==a){(o.display!==a&&null!==o.display&&"none"!==o.display||o.visibility!==a&&"hidden"!==o.visibility)&&/opacity|filter/.test(R)&&!M&&0!==z&&(M=0),o._cacheValues&&E&&E[R]?(M===a&&(M=E[R].endValue+E[R].unitType),B=i(n).rootPropertyValueCache[I]):x.Hooks.registered[R]?M===a?(B=x.getPropertyValue(n,I),M=x.getPropertyValue(n,R,B)):B=x.Hooks.templates[I][1]:M===a&&(M=x.getPropertyValue(n,R));var W,G,D,X=!1;if(W=f(R,M),M=W[0],D=W[1],W=f(R,z),z=W[0].replace(/^([+-\/*])=/,function(e,t){return X=t,""}),G=W[1],M=parseFloat(M)||0,z=parseFloat(z)||0,"%"===G&&(/^(fontSize|lineHeight)$/.test(R)?(z/=100,G="em"):/^scale/.test(R)?(z/=100,G=""):/(Red|Green|Blue)$/i.test(R)&&(z=z/100*255,G="")),/[\/*]/.test(X))G=D;else if(D!==G&&0!==M)if(0===z)G=D;else{l=l||d();var Y=/margin|padding|left|right|width|text|word|letter/i.test(R)||/X$/.test(R)||"x"===R?"x":"y";switch(D){case"%":M*="x"===Y?l.percentToPxWidth:l.percentToPxHeight;break;case"px":break;default:M*=l[D+"ToPx"]}switch(G){case"%":M*=1/("x"===Y?l.percentToPxWidth:l.percentToPxHeight);break;case"px":break;default:M*=1/l[G+"ToPx"]}}switch(X){case"+":z=M+z;break;case"-":z=M-z;break;case"*":z=M*z;break;case"/":z=M/z}s[R]={rootPropertyValue:B,startValue:M,currentValue:M,endValue:z,unitType:G,easing:q},v.debug&&console.log("tweensContainer ("+R+"): "+JSON.stringify(s[R]),n)}else v.debug&&console.log("Skipping ["+I+"] due to a lack of browser support.")}s.element=n}s.element&&(x.Values.addClass(n,"velocity-animating"),L.push(s),""===o.queue&&(i(n).tweensContainer=s,i(n).opts=o),i(n).isAnimating=!0,w===P-1?(v.State.calls.push([L,m,o,null,T.resolver]),v.State.isTicking===!1&&(v.State.isTicking=!0,c())):w++)}var n=this,o=$.extend({},v.defaults,b),s={},l;switch(i(n)===a&&v.init(n),parseFloat(o.delay)&&o.queue!==!1&&$.queue(n,o.queue,function(e){v.velocityQueueEntryFlag=!0,i(n).delayTimer={setTimeout:setTimeout(e,parseFloat(o.delay)),next:e}}),o.duration.toString().toLowerCase()){case"fast":o.duration=200;break;case"normal":o.duration=y;break;case"slow":o.duration=600;break;default:o.duration=parseFloat(o.duration)||1}v.mock!==!1&&(v.mock===!0?o.duration=o.delay=1:(o.duration*=parseFloat(v.mock)||1,o.delay*=parseFloat(v.mock)||1)),o.easing=u(o.easing,o.duration),o.begin&&!g.isFunction(o.begin)&&(o.begin=null),o.progress&&!g.isFunction(o.progress)&&(o.progress=null),o.complete&&!g.isFunction(o.complete)&&(o.complete=null),o.display!==a&&null!==o.display&&(o.display=o.display.toString().toLowerCase(),"auto"===o.display&&(o.display=v.CSS.Values.getDisplayType(n))),o.visibility!==a&&null!==o.visibility&&(o.visibility=o.visibility.toString().toLowerCase()),o.mobileHA=o.mobileHA&&v.State.isMobile&&!v.State.isGingerbread,o.queue===!1?o.delay?setTimeout(e,o.delay):e():$.queue(n,o.queue,function(t,r){return r===!0?(T.promise&&T.resolver(m),!0):(v.velocityQueueEntryFlag=!0,void e(t))}),""!==o.queue&&"fx"!==o.queue||"inprogress"===$.queue(n)[0]||$.dequeue(n)}var s=arguments[0]&&(arguments[0].p||$.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||g.isString(arguments[0].properties)),l,f,d,m,h,b;if(g.isWrapped(this)?(l=!1,d=0,m=this,f=this):(l=!0,d=1,m=s?arguments[0].elements||arguments[0].e:arguments[0]),m=o(m)){s?(h=arguments[0].properties||arguments[0].p,b=arguments[0].options||arguments[0].o):(h=arguments[d],b=arguments[d+1]);var P=m.length,w=0;if(!/^(stop|finish)$/i.test(h)&&!$.isPlainObject(b)){var V=d+1;b={};for(var C=V;C<arguments.length;C++)g.isArray(arguments[C])||!/^(fast|normal|slow)$/i.test(arguments[C])&&!/^\d/.test(arguments[C])?g.isString(arguments[C])||g.isArray(arguments[C])?b.easing=arguments[C]:g.isFunction(arguments[C])&&(b.complete=arguments[C]):b.duration=arguments[C]}var T={promise:null,resolver:null,rejecter:null};l&&v.Promise&&(T.promise=new v.Promise(function(e,t){T.resolver=e,T.rejecter=t}));var k;switch(h){case"scroll":k="scroll";break;case"reverse":k="reverse";break;case"finish":case"stop":$.each(m,function(e,t){i(t)&&i(t).delayTimer&&(clearTimeout(i(t).delayTimer.setTimeout),i(t).delayTimer.next&&i(t).delayTimer.next(),delete i(t).delayTimer)});var A=[];return $.each(v.State.calls,function(e,t){t&&$.each(t[1],function(r,n){var o=b===a?"":b;return o===!0||t[2].queue===o||b===a&&t[2].queue===!1?void $.each(m,function(r,a){a===n&&((b===!0||g.isString(b))&&($.each($.queue(a,g.isString(b)?b:""),function(e,t){g.isFunction(t)&&t(null,!0)}),$.queue(a,g.isString(b)?b:"",[])),"stop"===h?(i(a)&&i(a).tweensContainer&&o!==!1&&$.each(i(a).tweensContainer,function(e,t){t.endValue=t.currentValue
222
+ }),A.push(e)):"finish"===h&&(t[2].duration=1))}):!0})}),"stop"===h&&($.each(A,function(e,t){p(t,!0)}),T.promise&&T.resolver(m)),e();default:if(!$.isPlainObject(h)||g.isEmptyObject(h)){if(g.isString(h)&&v.Redirects[h]){var F=$.extend({},b),E=F.duration,j=F.delay||0;return F.backwards===!0&&(m=$.extend(!0,[],m).reverse()),$.each(m,function(e,t){parseFloat(F.stagger)?F.delay=j+parseFloat(F.stagger)*e:g.isFunction(F.stagger)&&(F.delay=j+F.stagger.call(t,e,P)),F.drag&&(F.duration=parseFloat(E)||(/^(callout|transition)/.test(h)?1e3:y),F.duration=Math.max(F.duration*(F.backwards?1-e/P:(e+1)/P),.75*F.duration,200)),v.Redirects[h].call(t,t,F||{},e,P,m,T.promise?T:a)}),e()}var H="Velocity: First argument ("+h+") was not a property map, a known action, or a registered redirect. Aborting.";return T.promise?T.rejecter(new Error(H)):console.log(H),e()}k="start"}var N={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},L=[];$.each(m,function(e,t){g.isNode(t)&&n.call(t)});var F=$.extend({},v.defaults,b),R;if(F.loop=parseInt(F.loop),R=2*F.loop-1,F.loop)for(var O=0;R>O;O++){var z={delay:F.delay,progress:F.progress};O===R-1&&(z.display=F.display,z.visibility=F.visibility,z.complete=F.complete),S(m,"reverse",z)}return e()}};v=$.extend(S,v),v.animate=S;var P=t.requestAnimationFrame||d;return v.State.isMobile||r.hidden===a||r.addEventListener("visibilitychange",function(){r.hidden?(P=function(e){return setTimeout(function(){e(!0)},16)},c()):P=t.requestAnimationFrame||d}),e.Velocity=v,e!==t&&(e.fn.velocity=S,e.fn.velocity.defaults=v.defaults),$.each(["Down","Up"],function(e,t){v.Redirects["slide"+t]=function(e,r,n,o,i,s){var l=$.extend({},r),u=l.begin,c=l.complete,p={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},f={};l.display===a&&(l.display="Down"===t?"inline"===v.CSS.Values.getDisplayType(e)?"inline-block":"block":"none"),l.begin=function(){u&&u.call(i,i);for(var r in p){f[r]=e.style[r];var a=v.CSS.getPropertyValue(e,r);p[r]="Down"===t?[a,0]:[0,a]}f.overflow=e.style.overflow,e.style.overflow="hidden"},l.complete=function(){for(var t in f)e.style[t]=f[t];c&&c.call(i,i),s&&s.resolver(i)},v(e,p,l)}}),$.each(["In","Out"],function(e,t){v.Redirects["fade"+t]=function(e,r,n,o,i,s){var l=$.extend({},r),u={opacity:"In"===t?1:0},c=l.complete;l.complete=n!==o-1?l.begin=null:function(){c&&c.call(i,i),s&&s.resolver(i)},l.display===a&&(l.display="In"===t?"auto":"none"),v(this,u,l)}}),v}(window.jQuery||window.Zepto||window,window,document)});;!function(a,b,c,d){"use strict";function k(a,b,c){return setTimeout(q(a,c),b)}function l(a,b,c){return Array.isArray(a)?(m(a,c[b],c),!0):!1}function m(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 n(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}function o(a,b){return n(a,b,!0)}function p(a,b,c){var e,d=b.prototype;e=a.prototype=Object.create(d),e.constructor=a,e._super=d,c&&n(e,c)}function q(a,b){return function(){return a.apply(b,arguments)}}function r(a,b){return typeof a==g?a.apply(b?b[0]||d:d,b):a}function s(a,b){return a===d?b:a}function t(a,b,c){m(x(b),function(b){a.addEventListener(b,c,!1)})}function u(a,b,c){m(x(b),function(b){a.removeEventListener(b,c,!1)})}function v(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function w(a,b){return a.indexOf(b)>-1}function x(a){return a.trim().split(/\s+/g)}function y(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 z(a){return Array.prototype.slice.call(a,0)}function A(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];y(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 B(a,b){for(var c,f,g=b[0].toUpperCase()+b.slice(1),h=0;h<e.length;){if(c=e[h],f=c?c+g:b,f in a)return f;h++}return d}function D(){return C++}function E(a){var b=a.ownerDocument;return b.defaultView||b.parentWindow}function ab(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){r(a.options.enable,[a])&&c.handler(b)},this.init()}function bb(a){var b,c=a.options.inputClass;return b=c?c:H?wb:I?Eb:G?Gb:rb,new b(a,cb)}function cb(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&O&&0===d-e,g=b&(Q|R)&&0===d-e;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,db(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function db(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=gb(b)),e>1&&!c.firstMultiple?c.firstMultiple=gb(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=hb(d);b.timeStamp=j(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=lb(h,i),b.distance=kb(h,i),eb(c,b),b.offsetDirection=jb(b.deltaX,b.deltaY),b.scale=g?nb(g.pointers,d):1,b.rotation=g?mb(g.pointers,d):0,fb(c,b);var k=a.element;v(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function eb(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===O||f.eventType===Q)&&(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 fb(a,b){var f,g,h,j,c=a.lastInterval||b,e=b.timeStamp-c.timeStamp;if(b.eventType!=R&&(e>N||c.velocity===d)){var k=c.deltaX-b.deltaX,l=c.deltaY-b.deltaY,m=ib(e,k,l);g=m.x,h=m.y,f=i(m.x)>i(m.y)?m.x:m.y,j=jb(k,l),a.lastInterval=b}else f=c.velocity,g=c.velocityX,h=c.velocityY,j=c.direction;b.velocity=f,b.velocityX=g,b.velocityY=h,b.direction=j}function gb(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:h(a.pointers[c].clientX),clientY:h(a.pointers[c].clientY)},c++;return{timeStamp:j(),pointers:b,center:hb(b),deltaX:a.deltaX,deltaY:a.deltaY}}function hb(a){var b=a.length;if(1===b)return{x:h(a[0].clientX),y:h(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:h(c/b),y:h(d/b)}}function ib(a,b,c){return{x:b/a||0,y:c/a||0}}function jb(a,b){return a===b?S:i(a)>=i(b)?a>0?T:U:b>0?V:W}function kb(a,b,c){c||(c=$);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function lb(a,b,c){c||(c=$);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function mb(a,b){return lb(b[1],b[0],_)-lb(a[1],a[0],_)}function nb(a,b){return kb(b[0],b[1],_)/kb(a[0],a[1],_)}function rb(){this.evEl=pb,this.evWin=qb,this.allow=!0,this.pressed=!1,ab.apply(this,arguments)}function wb(){this.evEl=ub,this.evWin=vb,ab.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Ab(){this.evTarget=yb,this.evWin=zb,this.started=!1,ab.apply(this,arguments)}function Bb(a,b){var c=z(a.touches),d=z(a.changedTouches);return b&(Q|R)&&(c=A(c.concat(d),"identifier",!0)),[c,d]}function Eb(){this.evTarget=Db,this.targetIds={},ab.apply(this,arguments)}function Fb(a,b){var c=z(a.touches),d=this.targetIds;if(b&(O|P)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=z(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return v(a.target,i)}),b===O)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&(Q|R)&&delete d[g[e].identifier],e++;return h.length?[A(f.concat(h),"identifier",!0),h]:void 0}function Gb(){ab.apply(this,arguments);var a=q(this.handler,this);this.touch=new Eb(this.manager,a),this.mouse=new rb(this.manager,a)}function Pb(a,b){this.manager=a,this.set(b)}function Qb(a){if(w(a,Mb))return Mb;var b=w(a,Nb),c=w(a,Ob);return b&&c?Nb+" "+Ob:b||c?b?Nb:Ob:w(a,Lb)?Lb:Kb}function Yb(a){this.id=D(),this.manager=null,this.options=o(a||{},this.defaults),this.options.enable=s(this.options.enable,!0),this.state=Rb,this.simultaneous={},this.requireFail=[]}function Zb(a){return a&Wb?"cancel":a&Ub?"end":a&Tb?"move":a&Sb?"start":""}function $b(a){return a==W?"down":a==V?"up":a==T?"left":a==U?"right":""}function _b(a,b){var c=b.manager;return c?c.get(a):a}function ac(){Yb.apply(this,arguments)}function bc(){ac.apply(this,arguments),this.pX=null,this.pY=null}function cc(){ac.apply(this,arguments)}function dc(){Yb.apply(this,arguments),this._timer=null,this._input=null}function ec(){ac.apply(this,arguments)}function fc(){ac.apply(this,arguments)}function gc(){Yb.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function hc(a,b){return b=b||{},b.recognizers=s(b.recognizers,hc.defaults.preset),new kc(a,b)}function kc(a,b){b=b||{},this.options=o(b,hc.defaults),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.element=a,this.input=bb(this),this.touchAction=new Pb(this,this.options.touchAction),lc(this,!0),m(b.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 lc(a,b){var c=a.element;m(a.options.cssProps,function(a,d){c.style[B(c.style,d)]=b?a:""})}function mc(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var e=["","webkit","moz","MS","ms","o"],f=b.createElement("div"),g="function",h=Math.round,i=Math.abs,j=Date.now,C=1,F=/mobile|tablet|ip(ad|hone|od)|android/i,G="ontouchstart"in a,H=B(a,"PointerEvent")!==d,I=G&&F.test(navigator.userAgent),J="touch",K="pen",L="mouse",M="kinect",N=25,O=1,P=2,Q=4,R=8,S=1,T=2,U=4,V=8,W=16,X=T|U,Y=V|W,Z=X|Y,$=["x","y"],_=["clientX","clientY"];ab.prototype={handler:function(){},init:function(){this.evEl&&t(this.element,this.evEl,this.domHandler),this.evTarget&&t(this.target,this.evTarget,this.domHandler),this.evWin&&t(E(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&u(this.element,this.evEl,this.domHandler),this.evTarget&&u(this.target,this.evTarget,this.domHandler),this.evWin&&u(E(this.element),this.evWin,this.domHandler)}};var ob={mousedown:O,mousemove:P,mouseup:Q},pb="mousedown",qb="mousemove mouseup";p(rb,ab,{handler:function(a){var b=ob[a.type];b&O&&0===a.button&&(this.pressed=!0),b&P&&1!==a.which&&(b=Q),this.pressed&&this.allow&&(b&Q&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:L,srcEvent:a}))}});var sb={pointerdown:O,pointermove:P,pointerup:Q,pointercancel:R,pointerout:R},tb={2:J,3:K,4:L,5:M},ub="pointerdown",vb="pointermove pointerup pointercancel";a.MSPointerEvent&&(ub="MSPointerDown",vb="MSPointerMove MSPointerUp MSPointerCancel"),p(wb,ab,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=sb[d],f=tb[a.pointerType]||a.pointerType,g=f==J,h=y(b,a.pointerId,"pointerId");e&O&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Q|R)&&(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 xb={touchstart:O,touchmove:P,touchend:Q,touchcancel:R},yb="touchstart",zb="touchstart touchmove touchend touchcancel";p(Ab,ab,{handler:function(a){var b=xb[a.type];if(b===O&&(this.started=!0),this.started){var c=Bb.call(this,a,b);b&(Q|R)&&0===c[0].length-c[1].length&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:J,srcEvent:a})}}});var Cb={touchstart:O,touchmove:P,touchend:Q,touchcancel:R},Db="touchstart touchmove touchend touchcancel";p(Eb,ab,{handler:function(a){var b=Cb[a.type],c=Fb.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:J,srcEvent:a})}}),p(Gb,ab,{handler:function(a,b,c){var d=c.pointerType==J,e=c.pointerType==L;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Q|R)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Hb=B(f.style,"touchAction"),Ib=Hb!==d,Jb="compute",Kb="auto",Lb="manipulation",Mb="none",Nb="pan-x",Ob="pan-y";Pb.prototype={set:function(a){a==Jb&&(a=this.compute()),Ib&&(this.manager.element.style[Hb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return m(this.manager.recognizers,function(b){r(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),Qb(a.join(" "))},preventDefaults:function(a){if(!Ib){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return b.preventDefault(),void 0;var d=this.actions,e=w(d,Mb),f=w(d,Ob),g=w(d,Nb);return e||f&&c&X||g&&c&Y?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var Rb=1,Sb=2,Tb=4,Ub=8,Vb=Ub,Wb=16,Xb=32;Yb.prototype={defaults:{},set:function(a){return n(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(l(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_b(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return l(a,"dropRecognizeWith",this)?this:(a=_b(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(l(a,"requireFailure",this))return this;var b=this.requireFail;return a=_b(a,this),-1===y(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(l(a,"dropRequireFailure",this))return this;a=_b(a,this);var b=y(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 d(d){b.manager.emit(b.options.event+(d?Zb(c):""),a)}var b=this,c=this.state;Ub>c&&d(!0),d(),c>=Ub&&d(!0)},tryEmit:function(a){return this.canEmit()?this.emit(a):(this.state=Xb,void 0)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(Xb|Rb)))return!1;a++}return!0},recognize:function(a){var b=n({},a);return r(this.options.enable,[this,b])?(this.state&(Vb|Wb|Xb)&&(this.state=Rb),this.state=this.process(b),this.state&(Sb|Tb|Ub|Wb)&&this.tryEmit(b),void 0):(this.reset(),this.state=Xb,void 0)},process:function(){},getTouchAction:function(){},reset:function(){}},p(ac,Yb,{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&(Sb|Tb),e=this.attrTest(a);return d&&(c&R||!e)?b|Wb:d||e?c&Q?b|Ub:b&Sb?b|Tb:Sb:Xb}}),p(bc,ac,{defaults:{event:"pan",threshold:10,pointers:1,direction:Z},getTouchAction:function(){var a=this.options.direction,b=[];return a&X&&b.push(Ob),a&Y&&b.push(Nb),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&X?(e=0===f?S:0>f?T:U,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?S:0>g?V:W,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return ac.prototype.attrTest.call(this,a)&&(this.state&Sb||!(this.state&Sb)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$b(a.direction);b&&this.manager.emit(this.options.event+b,a),this._super.emit.call(this,a)}}),p(cc,ac,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Mb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&Sb)},emit:function(a){if(this._super.emit.call(this,a),1!==a.scale){var b=a.scale<1?"in":"out";this.manager.emit(this.options.event+b,a)}}}),p(dc,Yb,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[Kb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,e=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Q|R)&&!e)this.reset();else if(a.eventType&O)this.reset(),this._timer=k(function(){this.state=Vb,this.tryEmit()},b.time,this);else if(a.eventType&Q)return Vb;return Xb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===Vb&&(a&&a.eventType&Q?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=j(),this.manager.emit(this.options.event,this._input)))}}),p(ec,ac,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Mb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&Sb)}}),p(fc,ac,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:X|Y,pointers:1},getTouchAction:function(){return bc.prototype.getTouchAction.call(this)},attrTest:function(a){var c,b=this.options.direction;return b&(X|Y)?c=a.velocity:b&X?c=a.velocityX:b&Y&&(c=a.velocityY),this._super.attrTest.call(this,a)&&b&a.direction&&a.distance>this.options.threshold&&i(c)>this.options.velocity&&a.eventType&Q},emit:function(a){var b=$b(a.direction);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),p(gc,Yb,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[Lb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,e=a.deltaTime<b.time;if(this.reset(),a.eventType&O&&0===this.count)return this.failTimeout();if(d&&e&&c){if(a.eventType!=Q)return this.failTimeout();var f=this.pTime?a.timeStamp-this.pTime<b.interval:!0,g=!this.pCenter||kb(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,g&&f?this.count+=1:this.count=1,this._input=a;var h=this.count%b.taps;if(0===h)return this.hasRequireFailures()?(this._timer=k(function(){this.state=Vb,this.tryEmit()},b.interval,this),Sb):Vb}return Xb},failTimeout:function(){return this._timer=k(function(){this.state=Xb},this.options.interval,this),Xb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Vb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),hc.VERSION="2.0.4",hc.defaults={domEvents:!1,touchAction:Jb,enable:!0,inputTarget:null,inputClass:null,preset:[[ec,{enable:!1}],[cc,{enable:!1},["rotate"]],[fc,{direction:X}],[bc,{direction:X},["swipe"]],[gc],[gc,{event:"doubletap",taps:2},["tap"]],[dc]],cssProps:{userSelect:"default",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ic=1,jc=2;kc.prototype={set:function(a){return n(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?jc:ic},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&Vb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===jc||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(Sb|Tb|Ub)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Yb)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(l(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(l(a,"remove",this))return this;var b=this.recognizers;return a=this.get(a),b.splice(y(b,a),1),this.touchAction.update(),this},on:function(a,b){var c=this.handlers;return m(x(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this},off:function(a,b){var c=this.handlers;return m(x(a),function(a){b?c[a].splice(y(c[a],b),1):delete c[a]}),this},emit:function(a,b){this.options.domEvents&&mc(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&&lc(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},n(hc,{INPUT_START:O,INPUT_MOVE:P,INPUT_END:Q,INPUT_CANCEL:R,STATE_POSSIBLE:Rb,STATE_BEGAN:Sb,STATE_CHANGED:Tb,STATE_ENDED:Ub,STATE_RECOGNIZED:Vb,STATE_CANCELLED:Wb,STATE_FAILED:Xb,DIRECTION_NONE:S,DIRECTION_LEFT:T,DIRECTION_RIGHT:U,DIRECTION_UP:V,DIRECTION_DOWN:W,DIRECTION_HORIZONTAL:X,DIRECTION_VERTICAL:Y,DIRECTION_ALL:Z,Manager:kc,Input:ab,TouchAction:Pb,TouchInput:Eb,MouseInput:rb,PointerEventInput:wb,TouchMouseInput:Gb,SingleTouchInput:Ab,Recognizer:Yb,AttrRecognizer:ac,Tap:gc,Pan:bc,Swipe:fc,Pinch:cc,Rotate:ec,Press:dc,on:t,off:u,each:m,merge:o,extend:n,inherit:p,bindFn:q,prefixed:B}),typeof define==g&&define.amd?define(function(){return hc}):"undefined"!=typeof module&&module.exports?module.exports=hc:a[c]=hc}(window,document,"Hammer");;(function(factory) {
223
223
  if (typeof define === 'function' && define.amd) {
224
224
  define(['jquery', 'hammerjs'], factory);
225
225
  } else if (typeof exports === 'object') {
@@ -252,6 +252,37 @@ jQuery.extend( jQuery.easing,
252
252
  };
253
253
  })(Hammer.Manager.prototype.emit);
254
254
  }));
255
+ ;var Materialize = {};
256
+
257
+ // Unique ID
258
+ Materialize.guid = (function() {
259
+ function s4() {
260
+ return Math.floor((1 + Math.random()) * 0x10000)
261
+ .toString(16)
262
+ .substring(1);
263
+ }
264
+ return function() {
265
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
266
+ s4() + '-' + s4() + s4() + s4();
267
+ };
268
+ })();
269
+
270
+ Materialize.elementOrParentIsFixed = function(element) {
271
+ var $element = $(element);
272
+ var $checkElements = $element.add($element.parents());
273
+ var isFixed = false;
274
+ $checkElements.each(function(){
275
+ if ($(this).css("position") === "fixed") {
276
+ isFixed = true;
277
+ return false;
278
+ }
279
+ });
280
+ return isFixed;
281
+ }
282
+
283
+ // Velocity has conflicts when loaded with jQuery, this will check for it
284
+ var Vel;
285
+ if ($) { Vel = $.Velocity } else { Vel = Velocity};
255
286
  ;(function ($) {
256
287
  $.fn.collapsible = function(options) {
257
288
  var defaults = {
@@ -265,7 +296,7 @@ jQuery.extend( jQuery.easing,
265
296
 
266
297
  var $this = $(this);
267
298
 
268
- var $panel_headers = $(this).find('.collapsible-header');
299
+ var $panel_headers = $(this).find('> li > .collapsible-header');
269
300
 
270
301
  var collapsible_type = $this.data("collapsible");
271
302
 
@@ -280,25 +311,46 @@ jQuery.extend( jQuery.easing,
280
311
 
281
312
  // Accordion Open
282
313
  function accordionOpen(object) {
283
- $panel_headers = $this.find('.collapsible-header');
284
- object.parent().toggleClass('active');
314
+ $panel_headers = $this.find('> li > .collapsible-header');
315
+ if (object.hasClass('active')) {
316
+ object.parent().addClass('active');
317
+ }
318
+ else {
319
+ object.parent().removeClass('active');
320
+ }
285
321
  if (object.parent().hasClass('active')){
286
- object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: "easeOutQuart", queue: false});
322
+ object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '')}});
287
323
  }
288
324
  else{
289
- object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: "easeOutQuart", queue: false});
325
+ object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '')}});
290
326
  }
291
- $panel_headers.not(object).parent().removeClass('active');
292
- $panel_headers.not(object).parent().children('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: "easeOutQuart", queue: false});
327
+
328
+ $panel_headers.not(object).removeClass('active').parent().removeClass('active');
329
+ $panel_headers.not(object).parent().children('.collapsible-body').stop(true,false).slideUp(
330
+ {
331
+ duration: 350,
332
+ easing: "easeOutQuart",
333
+ queue: false,
334
+ complete:
335
+ function() {
336
+ $(this).css('height', '')
337
+ }
338
+ });
293
339
  }
294
- // Collapsible Open
295
- function collapsibleOpen(object) {
296
- object.parent().toggleClass('active');
340
+
341
+ // Expandable Open
342
+ function expandableOpen(object) {
343
+ if (object.hasClass('active')) {
344
+ object.parent().addClass('active');
345
+ }
346
+ else {
347
+ object.parent().removeClass('active');
348
+ }
297
349
  if (object.parent().hasClass('active')){
298
- object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: "easeOutQuart", queue: false});
350
+ object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '')}});
299
351
  }
300
352
  else{
301
- object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: "easeOutQuart", queue: false});
353
+ object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '')}});
302
354
  }
303
355
  }
304
356
 
@@ -307,26 +359,26 @@ jQuery.extend( jQuery.easing,
307
359
 
308
360
 
309
361
  if (options.accordion || collapsible_type == "accordion" || collapsible_type == undefined) { // Handle Accordion
310
-
311
- // Event delegation to all collapsible section
312
- $this.on('click.collapse', '.collapsible-header', function (e) {
313
- accordionOpen($(e.currentTarget));
362
+ // Add click handler to only direct collapsible header children
363
+ $this.find('> li > .collapsible-header').on('click.collapse', function (e) {
364
+ var header = $(e.target);
365
+ header.toggleClass('active');
366
+ accordionOpen(header);
314
367
  });
315
-
316
368
  // Open first active
317
369
  accordionOpen($panel_headers.filter('.active').first());
318
370
  }
319
371
  else { // Handle Expandables
320
372
  $panel_headers.each(function () {
321
-
322
- // Event delegation to open collapsible section
373
+ // Add click handler to only direct collapsible header children
323
374
  $(this).on('click.collapse', function (e) {
324
- collapsibleOpen($(e.currentTarget));
375
+ var header = $(e.target);
376
+ header.toggleClass('active');
377
+ expandableOpen(header);
325
378
  });
326
-
327
379
  // Open any bodies that have the active class
328
380
  if ($(this).hasClass('active')) {
329
- collapsibleOpen($(this));
381
+ expandableOpen($(this));
330
382
  }
331
383
 
332
384
  });
@@ -347,35 +399,32 @@ jQuery.extend( jQuery.easing,
347
399
  return this;
348
400
  };
349
401
 
350
- $.fn.dropdown = function (options) {
402
+ $.fn.dropdown = function (option) {
351
403
  var defaults = {
352
404
  inDuration: 300,
353
405
  outDuration: 225,
354
406
  constrain_width: true, // Constrains width of dropdown to the activator
355
- hover: true,
356
- alignment: 'left',
407
+ hover: false,
357
408
  gutter: 0, // Spacing from edge
358
409
  belowOrigin: false
359
410
  }
360
411
 
361
- options = $.extend(defaults, options);
362
412
  this.each(function(){
363
413
  var origin = $(this);
414
+ var options = $.extend({}, defaults, option);
364
415
 
365
416
  // Dropdown menu
366
417
  var activates = $("#"+ origin.attr('data-activates'));
367
418
 
368
419
  function updateOptions() {
369
- if (origin.data('inDuration') != undefined)
420
+ if (origin.data('induration') != undefined)
370
421
  options.inDuration = origin.data('inDuration');
371
- if (origin.data('outDuration') != undefined)
422
+ if (origin.data('outduration') != undefined)
372
423
  options.outDuration = origin.data('outDuration');
373
424
  if (origin.data('constrainwidth') != undefined)
374
425
  options.constrain_width = origin.data('constrainwidth');
375
426
  if (origin.data('hover') != undefined)
376
427
  options.hover = origin.data('hover');
377
- if (origin.data('alignment') != undefined)
378
- options.alignment = origin.data('alignment');
379
428
  if (origin.data('gutter') != undefined)
380
429
  options.gutter = origin.data('gutter');
381
430
  if (origin.data('beloworigin') != undefined)
@@ -384,13 +433,16 @@ jQuery.extend( jQuery.easing,
384
433
 
385
434
  updateOptions();
386
435
 
387
- // Move Dropdown menu to body. This allows for absolute positioning to work
388
- if ( !(activates.parent().is($('body'))) ) {
389
- activates.detach();
390
- $('body').append(activates);
436
+ // Attach dropdown to its activator
437
+ if (origin.hasClass('select-dropdown')) {
438
+ origin.after(activates)
439
+ }
440
+ else {
441
+ origin.append(activates);
391
442
  }
392
443
 
393
- var dropdownRealHeight = activates.height();
444
+
445
+
394
446
 
395
447
  /*
396
448
  Helper function to position and resize dropdown.
@@ -400,6 +452,7 @@ jQuery.extend( jQuery.easing,
400
452
  // Check html data attributes
401
453
  updateOptions();
402
454
 
455
+ // Constrain width
403
456
  if (options.constrain_width == true) {
404
457
  activates.css('width', origin.outerWidth());
405
458
  }
@@ -407,82 +460,70 @@ jQuery.extend( jQuery.easing,
407
460
  if (options.belowOrigin == true) {
408
461
  offset = origin.height();
409
462
  }
463
+
410
464
  // Handle edge alignment
465
+ var offsetLeft = origin.offset().left;
466
+
411
467
  var width_difference = 0;
412
468
  var gutter_spacing = options.gutter;
413
- if (options.alignment == 'right') {
469
+
470
+
471
+ if (offsetLeft + activates.innerWidth() > $(window).width()) {
414
472
  width_difference = origin.innerWidth() - activates.innerWidth();
415
473
  gutter_spacing = gutter_spacing * -1;
416
474
  }
417
- if (elementOrParentIsFixed(origin[0])) {
475
+ // If fixed placement
476
+ if (Materialize.elementOrParentIsFixed(origin[0])) {
418
477
  activates.css({
419
- display: 'block',
420
- position: 'fixed',
421
- height: 0,
422
- top: origin.offset().top - $(window).scrollTop() + offset,
423
- left: origin.offset().left + width_difference + gutter_spacing
478
+ top: 0 + offset,
479
+ left: 0 + width_difference + gutter_spacing
424
480
  });
425
481
  }
482
+ // If relative placement
426
483
  else {
484
+
427
485
  activates.css({
428
- display: 'block',
429
- top: origin.offset().top + offset,
430
- left: origin.offset().left + width_difference + gutter_spacing,
431
- height: 0
486
+ position: 'absolute',
487
+ top: 0 + offset,
488
+ left: 0 + width_difference + gutter_spacing
432
489
  });
490
+
433
491
  }
434
- activates.velocity({opacity: 1}, {duration: options.inDuration, queue: false, easing: 'easeOutQuad'})
435
- .velocity(
436
- {
437
- height: dropdownRealHeight
438
- },
439
- {duration: options.inDuration,
492
+
493
+ // Show dropdown
494
+ activates.stop(true, true).css('opacity', 0)
495
+ .slideDown({
440
496
  queue: false,
497
+ duration: options.inDuration,
441
498
  easing: 'easeOutCubic',
442
- complete: function(){
443
- activates.css('overflow-y', 'auto')
499
+ complete: function() {
500
+ $(this).css('height', '');
444
501
  }
445
- });
446
- }
447
- function elementOrParentIsFixed(element) {
448
- var $element = $(element);
449
- var $checkElements = $element.add($element.parents());
450
- var isFixed = false;
451
- $checkElements.each(function(){
452
- if ($(this).css("position") === "fixed") {
453
- isFixed = true;
454
- return false;
455
- }
456
- });
457
- return isFixed;
502
+ })
503
+ .animate( {opacity: 1}, {queue: false, duration: options.inDuration, easing: 'easeOutSine'});
504
+
505
+
458
506
  }
459
507
 
508
+
460
509
  function hideDropdown() {
461
- activates.velocity(
462
- {
463
- opacity: 0
464
- },
465
- {
466
- duration: options.outDuration,
467
- easing: 'easeOutQuad',
468
- complete: function(){
469
- activates.css({
470
- display: 'none',
471
- 'overflow-y': ''
472
- });
473
- }
474
- });
510
+ activates.fadeOut(options.outDuration);
475
511
  }
476
512
 
513
+ activates.on('hover', function(e) {
514
+ e.stopPropagation();
515
+ });
516
+
477
517
  // Hover
478
518
  if (options.hover) {
519
+ origin.unbind('click.' + origin.attr('id'));
479
520
  // Hover handler to show dropdown
480
- origin.on('mouseover', function(e){ // Mouse over
521
+ origin.on('mouseenter', function(e){ // Mouse over
481
522
  placeDropdown();
482
523
  });
483
524
 
484
- // Document click handler
485
- activates.on('mouseleave', function(e){ // Mouse out
525
+ origin.on('mouseleave', function(e){ // Mouse out
526
+ activates.stop(true, true);
486
527
  hideDropdown();
487
528
  });
488
529
 
@@ -493,18 +534,33 @@ jQuery.extend( jQuery.easing,
493
534
  // Click handler to show dropdown
494
535
  origin.unbind('click.' + origin.attr('id'));
495
536
  origin.bind('click.'+origin.attr('id'), function(e){
496
- if (origin[0] == e.currentTarget) {
497
-
537
+ // Handles case for select plugin
538
+ if (origin.hasClass('select-dropdown')) {
539
+ return false;
540
+ }
541
+ if ( origin[0] == e.currentTarget && ($(e.target).closest('.dropdown-content').length === 0) ) {
498
542
  e.preventDefault(); // Prevents button click from moving window
499
543
  placeDropdown();
500
- }
544
+ open = true;
501
545
 
502
- $(document).bind('click.'+ activates.attr('id'), function (e) {
503
- if (!activates.is(e.target) && !origin.is(e.target) && (!origin.find(e.target).length > 0) ) {
546
+ }
547
+ // If origin is clicked and menu is open, close menu
548
+ else {
549
+ if (open === true) {
504
550
  hideDropdown();
505
551
  $(document).unbind('click.' + activates.attr('id'));
552
+ open = false;
506
553
  }
507
- });
554
+ }
555
+ // If menu open, add click close handler to document
556
+ if (open === true) {
557
+ $(document).bind('click.'+ activates.attr('id'), function (e) {
558
+ if (!activates.is(e.target) && !origin.is(e.target) && (!origin.find(e.target).length > 0) ) {
559
+ hideDropdown();
560
+ $(document).unbind('click.' + activates.attr('id'));
561
+ }
562
+ });
563
+ }
508
564
  });
509
565
 
510
566
  } // End else
@@ -516,6 +572,10 @@ jQuery.extend( jQuery.easing,
516
572
 
517
573
  });
518
574
  }; // End dropdown plugin
575
+
576
+ $(document).ready(function(){
577
+ $('.dropdown-button').dropdown();
578
+ });
519
579
  }( jQuery ));
520
580
  ;(function($) {
521
581
  $.fn.extend({
@@ -526,8 +586,8 @@ jQuery.extend( jQuery.easing,
526
586
 
527
587
  var defaults = {
528
588
  opacity: 0.5,
529
- in_duration: 300,
530
- out_duration: 200,
589
+ in_duration: 350,
590
+ out_duration: 250,
531
591
  ready: undefined,
532
592
  complete: undefined,
533
593
  dismissible: true
@@ -541,16 +601,14 @@ jQuery.extend( jQuery.easing,
541
601
  $(modal).closeModal(options);
542
602
  });
543
603
  // Return on ESC
544
- $(document).keyup(function(e) {
604
+ $(document).on('keyup.leanModal', function(e) {
545
605
  if (e.keyCode === 27) { // ESC key
546
606
  $(modal).closeModal(options);
547
- $(this).off();
548
607
  }
549
608
  });
550
609
  }
551
610
 
552
611
  $(modal).find(".modal-close").click(function(e) {
553
- e.preventDefault();
554
612
  $(modal).closeModal(options);
555
613
  });
556
614
 
@@ -558,47 +616,90 @@ jQuery.extend( jQuery.easing,
558
616
 
559
617
  $(modal).css({
560
618
  display : "block",
561
- top: "4%",
562
619
  opacity: 0
563
620
  });
564
621
 
565
622
  $("#lean-overlay").velocity({opacity: options.opacity}, {duration: options.in_duration, queue: false, ease: "easeOutCubic"});
566
623
 
567
- $(modal).velocity({top: "10%", opacity: 1}, {
568
- duration: options.in_duration,
569
- queue: false,
570
- ease: "easeOutCubic",
571
- // Handle modal ready callback
572
- complete: function() {
573
- if (typeof(options.ready) === "function") {
574
- options.ready();
624
+
625
+ // Define Bottom Sheet animation
626
+ if ($(modal).hasClass('bottom-sheet')) {
627
+ $(modal).velocity({bottom: "0", opacity: 1}, {
628
+ duration: options.in_duration,
629
+ queue: false,
630
+ ease: "easeOutCubic",
631
+ // Handle modal ready callback
632
+ complete: function() {
633
+ if (typeof(options.ready) === "function") {
634
+ options.ready();
635
+ }
575
636
  }
576
- }
577
- });
637
+ });
638
+ }
639
+ else {
640
+ $(modal).css({ top: "4%" });
641
+ $(modal).velocity({top: "10%", opacity: 1}, {
642
+ duration: options.in_duration,
643
+ queue: false,
644
+ ease: "easeOutCubic",
645
+ // Handle modal ready callback
646
+ complete: function() {
647
+ if (typeof(options.ready) === "function") {
648
+ options.ready();
649
+ }
650
+ }
651
+ });
652
+ }
653
+
654
+
578
655
  }
579
656
  });
580
657
 
581
658
  $.fn.extend({
582
659
  closeModal: function(options) {
583
660
  var defaults = {
584
- out_duration: 200,
661
+ out_duration: 250,
585
662
  complete: undefined
586
663
  }
587
664
  var options = $.extend(defaults, options);
588
665
 
589
666
  $('.modal-close').off();
667
+ $(document).off('keyup.leanModal');
590
668
 
591
669
  $("#lean-overlay").velocity( { opacity: 0}, {duration: options.out_duration, queue: false, ease: "easeOutQuart"});
592
- $(this).fadeOut(options.out_duration, function() {
593
- $(this).css({ top: 0});
594
- $("#lean-overlay").css({display:"none"});
595
670
 
596
- // Call complete callback
597
- if (typeof(options.complete) === "function") {
598
- options.complete();
599
- }
600
- $('#lean-overlay').remove();
601
- });
671
+
672
+ // Define Bottom Sheet animation
673
+ if ($(this).hasClass('bottom-sheet')) {
674
+ $(this).velocity({bottom: "-100%", opacity: 0}, {
675
+ duration: options.out_duration,
676
+ queue: false,
677
+ ease: "easeOutCubic",
678
+ // Handle modal ready callback
679
+ complete: function() {
680
+ $("#lean-overlay").css({display:"none"});
681
+
682
+ // Call complete callback
683
+ if (typeof(options.complete) === "function") {
684
+ options.complete();
685
+ }
686
+ $('#lean-overlay').remove();
687
+ }
688
+ });
689
+ }
690
+ else {
691
+ $(this).fadeOut(options.out_duration, function() {
692
+ $(this).css({ top: 0});
693
+ $("#lean-overlay").css({display:"none"});
694
+
695
+ // Call complete callback
696
+ if (typeof(options.complete) === "function") {
697
+ options.complete();
698
+ }
699
+ $('#lean-overlay').remove();
700
+ });
701
+ }
702
+
602
703
  }
603
704
  })
604
705
 
@@ -607,7 +708,7 @@ jQuery.extend( jQuery.easing,
607
708
  return this.each(function() {
608
709
  // Close Handlers
609
710
  $(this).click(function(e) {
610
- var modal_id = $(this).attr("href");
711
+ var modal_id = $(this).attr("href") || '#' + $(this).data('target');
611
712
  $(modal_id).openModal(options);
612
713
  e.preventDefault();
613
714
  }); // done set on click
@@ -635,24 +736,27 @@ jQuery.extend( jQuery.easing,
635
736
  var placeholder = $('<div></div>').addClass('material-placeholder');
636
737
  var originalWidth = 0;
637
738
  var originalHeight = 0;
638
-
639
739
  origin.wrap(placeholder);
740
+
741
+
640
742
  origin.on('click', function(){
641
-
642
743
  var placeholder = origin.parent('.material-placeholder');
643
744
  var windowWidth = window.innerWidth;
644
745
  var windowHeight = window.innerHeight;
645
746
  var originalWidth = origin.width();
646
747
  var originalHeight = origin.height();
748
+
647
749
 
648
750
  // If already modal, return to original
649
751
  if (doneAnimating === false) {
752
+ returnToOriginal();
650
753
  return false;
651
754
  }
652
755
  else if (overlayActive && doneAnimating===true) {
653
756
  returnToOriginal();
654
757
  return false;
655
758
  }
759
+
656
760
 
657
761
  // Set states
658
762
  doneAnimating = false;
@@ -667,7 +771,9 @@ jQuery.extend( jQuery.easing,
667
771
  position: 'relative',
668
772
  top: 0,
669
773
  left: 0
670
- })
774
+ });
775
+
776
+
671
777
 
672
778
  // Set css on origin
673
779
  origin.css({position: 'absolute', 'z-index': 1000})
@@ -790,12 +896,20 @@ jQuery.extend( jQuery.easing,
790
896
  var windowHeight = window.innerHeight;
791
897
  var originalWidth = origin.data('width');
792
898
  var originalHeight = origin.data('height');
899
+
900
+ origin.velocity("stop", true);
901
+ $('#materialbox-overlay').velocity("stop", true);
902
+ $('.materialbox-caption').velocity("stop", true);
793
903
 
794
904
 
795
- $('#materialbox-overlay').fadeOut(outDuration, function(){
796
- // Remove Overlay
797
- overlayActive = false;
798
- $(this).remove();
905
+ $('#materialbox-overlay').velocity({opacity: 0}, {
906
+ duration: outDuration, // Delay prevents animation overlapping
907
+ queue: false, easing: 'easeOutQuad',
908
+ complete: function(){
909
+ // Remove Overlay
910
+ overlayActive = false;
911
+ $(this).remove();
912
+ }
799
913
  });
800
914
 
801
915
  // Resize Image
@@ -814,7 +928,7 @@ jQuery.extend( jQuery.easing,
814
928
 
815
929
  // Remove Caption + reset css settings on image
816
930
  $('.materialbox-caption').velocity({opacity: 0}, {
817
- duration: outDuration + 200, // Delay prevents animation overlapping
931
+ duration: outDuration, // Delay prevents animation overlapping
818
932
  queue: false, easing: 'easeOutQuad',
819
933
  complete: function(){
820
934
  placeholder.css({
@@ -860,20 +974,16 @@ $(document).ready(function(){
860
974
  var $this = $(this);
861
975
  $this.addClass('parallax');
862
976
 
863
- $this.find('img').each(function () {
864
- $(this).css('background-image', 'url(' + $(this).attr('src') + ')' );
865
- $(this).attr('src', 'data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==');
866
- });
867
-
868
977
  function updateParallax(initial) {
869
978
  var container_height;
870
- if (window_width < 992) {
979
+ if (window_width < 601) {
871
980
  container_height = ($this.height() > 0) ? $this.height() : $this.children("img").height();
872
981
  }
873
982
  else {
874
983
  container_height = ($this.height() > 0) ? $this.height() : 500;
875
984
  }
876
- var img_height = $this.children("img").height();
985
+ var $img = $this.children("img").first();
986
+ var img_height = $img.height();
877
987
  var parallax_dist = img_height - container_height;
878
988
  var bottom = $this.offset().top + container_height;
879
989
  var top = $this.offset().top;
@@ -881,14 +991,15 @@ $(document).ready(function(){
881
991
  var windowHeight = window.innerHeight;
882
992
  var windowBottom = scrollTop + windowHeight;
883
993
  var percentScrolled = (windowBottom - top) / (container_height + windowHeight);
884
- var parallax = -1 * parallax_dist * percentScrolled;
994
+ var parallax = Math.round((parallax_dist * percentScrolled));
885
995
 
886
- if ((bottom > scrollTop) && (top < (scrollTop + windowHeight))) {
887
- $this.children("img").first().css('bottom', parallax + "px");
888
- }
889
996
  if (initial) {
890
- $this.children("img").first().css('display', 'block');
997
+ $img.css('display', 'block');
891
998
  }
999
+ if ((bottom > scrollTop) && (top < (scrollTop + windowHeight))) {
1000
+ $img.css('transform', "translate3D(-50%," + parallax + "px, 0)");
1001
+ }
1002
+
892
1003
  }
893
1004
 
894
1005
  // Wait for image load
@@ -1207,7 +1318,7 @@ $(document).ready(function(){
1207
1318
  });
1208
1319
  }( jQuery ));
1209
1320
  ;/*!
1210
- * Waves v0.6.0
1321
+ * Waves v0.6.4
1211
1322
  * http://fian.my.id/Waves
1212
1323
  *
1213
1324
  * Copyright 2014 Alfiana E. Sibuea and other contributors
@@ -1467,7 +1578,10 @@ $(document).ready(function(){
1467
1578
  var target = e.target || e.srcElement;
1468
1579
 
1469
1580
  while (target.parentElement !== null) {
1470
- if (target.className.indexOf('waves-effect') !== -1) {
1581
+ if (!(target instanceof SVGElement) && target.className.indexOf('waves-effect') !== -1) {
1582
+ element = target;
1583
+ break;
1584
+ } else if (target.classList.contains('waves-effect')) {
1471
1585
  element = target;
1472
1586
  break;
1473
1587
  }
@@ -1540,106 +1654,129 @@ $(document).ready(function(){
1540
1654
  Waves.displayEffect();
1541
1655
  }, false);
1542
1656
 
1543
- })(window);;function toast(message, displayLength, className, completeCallback) {
1657
+ })(window);
1658
+ ;Materialize.toast = function (message, displayLength, className, completeCallback) {
1544
1659
  className = className || "";
1545
- if ($('#toast-container').length == 0) {
1660
+
1661
+ var container = document.getElementById('toast-container');
1662
+
1663
+ // Create toast container if it does not exist
1664
+ if (container === null) {
1546
1665
  // create notification container
1547
- var container = $('<div></div>')
1548
- .attr('id', 'toast-container');
1549
- $('body').append(container);
1666
+ var container = document.createElement('div');
1667
+ container.id = 'toast-container';
1668
+ document.body.appendChild(container);
1550
1669
  }
1551
1670
 
1552
1671
  // Select and append toast
1553
- var container = $('#toast-container')
1554
1672
  var newToast = createToast(message);
1555
- container.append(newToast);
1673
+ container.appendChild(newToast);
1674
+
1675
+ newToast.style.top = '35px';
1676
+ newToast.style.opacity = 0;
1556
1677
 
1557
- newToast.css({"top" : parseFloat(newToast.css("top"))+35+"px",
1558
- "opacity": 0});
1559
- newToast.velocity({"top" : "0px",
1560
- opacity: 1},
1561
- {duration: 300,
1562
- easing: 'easeOutCubic',
1563
- queue: false});
1678
+ // Animate toast in
1679
+ Vel(newToast, { "top" : "0px", opacity: 1 }, {duration: 300,
1680
+ easing: 'easeOutCubic',
1681
+ queue: false});
1564
1682
 
1565
1683
  // Allows timer to be pause while being panned
1566
1684
  var timeLeft = displayLength;
1567
1685
  var counterInterval = setInterval (function(){
1568
- if (newToast.parent().length === 0)
1686
+
1687
+
1688
+ if (newToast.parentNode === null)
1569
1689
  window.clearInterval(counterInterval);
1570
1690
 
1571
- if (!newToast.hasClass("panning")) {
1572
- timeLeft -= 100;
1691
+ // If toast is not being dragged, decrease its time remaining
1692
+ if (!newToast.classList.contains('panning')) {
1693
+ timeLeft -= 20;
1573
1694
  }
1574
1695
 
1575
1696
  if (timeLeft <= 0) {
1576
- newToast.velocity({"opacity": 0, marginTop: '-40px'},
1577
- { duration: 375,
1578
- easing: 'easeOutExpo',
1579
- queue: false,
1580
- complete: function(){
1581
- if(typeof(completeCallback) === "function")
1582
- completeCallback();
1583
- $(this).remove();
1584
- }
1585
- }
1586
- );
1697
+ // Animate toast out
1698
+ Vel(newToast, {"opacity": 0, marginTop: '-40px'}, { duration: 375,
1699
+ easing: 'easeOutExpo',
1700
+ queue: false,
1701
+ complete: function(){
1702
+ // Call the optional callback
1703
+ if(typeof(completeCallback) === "function")
1704
+ completeCallback();
1705
+ // Remove toast after it times out
1706
+ this[0].parentNode.removeChild(this[0]);
1707
+ }
1708
+ });
1587
1709
  window.clearInterval(counterInterval);
1588
1710
  }
1589
- }, 100);
1711
+ }, 20);
1590
1712
 
1591
1713
 
1592
1714
 
1593
1715
  function createToast(html) {
1594
- var toast = $("<div class='toast'></div>")
1595
- .addClass(className)
1596
- .html(html);
1716
+
1717
+ // Create toast
1718
+ var toast = document.createElement('div');
1719
+ toast.classList.add('toast');
1720
+ if (className) {
1721
+ var classes = className.split(' ');
1722
+
1723
+ for (var i = 0, count = classes.length; i < count; i++) {
1724
+ toast.classList.add(classes[i]);
1725
+ }
1726
+ }
1727
+ toast.innerHTML = html;
1728
+
1597
1729
  // Bind hammer
1598
- toast.hammer({prevent_default:false
1599
- }).bind('pan', function(e) {
1600
-
1601
- var deltaX = e.gesture.deltaX;
1602
- var activationDistance = 80;
1603
-
1604
- // change toast state
1605
- if (!toast.hasClass("panning"))
1606
- toast.addClass("panning");
1607
-
1608
- var opacityPercent = 1-Math.abs(deltaX / activationDistance);
1609
- if (opacityPercent < 0)
1610
- opacityPercent = 0;
1611
-
1612
- toast.velocity({left: deltaX, opacity: opacityPercent }, {duration: 50, queue: false, easing: 'easeOutQuad'});
1613
-
1614
- }).bind('panend', function(e) {
1615
- var deltaX = e.gesture.deltaX;
1616
- var activationDistance = 80;
1617
-
1618
- // If toast dragged past activation point
1619
- if (Math.abs(deltaX) > activationDistance) {
1620
- toast.velocity({marginTop: '-40px'},
1621
- { duration: 375,
1622
- easing: 'easeOutExpo',
1623
- queue: false,
1624
- complete: function(){
1625
- if(typeof(completeCallback) === "function")
1626
- completeCallback();
1627
- toast.remove()
1628
- }
1629
- })
1630
- } else {
1631
- toast.removeClass("panning");
1632
- // Put toast back into original position
1633
- toast.velocity({left: 0, opacity: 1},
1634
- { duration: 300,
1635
- easing: 'easeOutExpo',
1636
- queue: false
1637
- })
1730
+ var hammerHandler = new Hammer(toast, {prevent_default: false});
1731
+ hammerHandler.on('pan', function(e) {
1732
+ var deltaX = e.deltaX;
1733
+ var activationDistance = 80;
1734
+
1735
+ // Change toast state
1736
+ if (!toast.classList.contains('panning')){
1737
+ toast.classList.add('panning');
1738
+ }
1739
+
1740
+ var opacityPercent = 1-Math.abs(deltaX / activationDistance);
1741
+ if (opacityPercent < 0)
1742
+ opacityPercent = 0;
1743
+
1744
+ Vel(toast, {left: deltaX, opacity: opacityPercent }, {duration: 50, queue: false, easing: 'easeOutQuad'});
1745
+
1746
+ });
1747
+
1748
+ hammerHandler.on('panend', function(e) {
1749
+ var deltaX = e.deltaX;
1750
+ var activationDistance = 80;
1751
+
1752
+ // If toast dragged past activation point
1753
+ if (Math.abs(deltaX) > activationDistance) {
1754
+ Vel(toast, {marginTop: '-40px'}, { duration: 375,
1755
+ easing: 'easeOutExpo',
1756
+ queue: false,
1757
+ complete: function(){
1758
+ if(typeof(completeCallback) === "function") {
1759
+ completeCallback();
1638
1760
  }
1639
- });
1761
+ toast.parentNode.removeChild(toast);
1762
+ }
1763
+ });
1764
+
1765
+ } else {
1766
+ toast.classList.remove('panning');
1767
+ // Put toast back into original position
1768
+ Vel(toast, { left: 0, opacity: 1 }, { duration: 300,
1769
+ easing: 'easeOutExpo',
1770
+ queue: false
1771
+ });
1772
+
1773
+ }
1774
+ });
1775
+
1640
1776
  return toast;
1641
1777
  }
1642
- };(function ($) {
1778
+ }
1779
+ ;(function ($) {
1643
1780
  // left: 37, up: 38, right: 39, down: 40,
1644
1781
  // spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36
1645
1782
  // var keys = [32, 33, 34, 35, 36, 37, 38, 39, 40];
@@ -1698,37 +1835,49 @@ $(document).ready(function(){
1698
1835
  // Set to width
1699
1836
  if (options.menuWidth != 240) {
1700
1837
  menu_id.css('width', options.menuWidth);
1701
- if (!menu_id.hasClass('fixed')) {
1702
- menu_id.css('left', -1 * (options.menuWidth + 10));
1703
- }
1704
- }
1705
-
1706
- // Add alignment
1707
- if (options.edge != 'left') {
1708
- menu_id.addClass('right-aligned');
1709
1838
  }
1710
1839
 
1711
1840
  // Add Touch Area
1712
1841
  $('body').append($('<div class="drag-target"></div>'));
1713
- if (options.edge === 'left') {
1714
- $('.drag-target').css({'left': 0})
1842
+
1843
+ if (options.edge == 'left') {
1844
+ menu_id.css('left', -1 * (options.menuWidth + 10));
1845
+ $('.drag-target').css({'left': 0}); // Add Touch Area
1715
1846
  }
1716
1847
  else {
1717
- $('.drag-target').css({'right': 0})
1848
+ menu_id.addClass('right-aligned') // Change text-alignment to right
1849
+ .css('right', -1 * (options.menuWidth + 10))
1850
+ .css('left', '');
1851
+ $('.drag-target').css({'right': 0}); // Add Touch Area
1718
1852
  }
1719
1853
 
1854
+ // If fixed sidenav, bring menu out
1855
+ if (menu_id.hasClass('fixed')) {
1856
+ if ($(window).width() > 992) {
1857
+ menu_id.css('left', 0);
1858
+ }
1859
+ }
1860
+
1720
1861
  // Window resize to reset on large screens fixed
1721
1862
  if (menu_id.hasClass('fixed')) {
1722
1863
  $(window).resize( function() {
1723
- if ($(window).width() > 1200) {
1724
- if (menu_id.attr('style')) {
1864
+ if (window.innerWidth > 992) {
1865
+ // Close menu if window is resized bigger than 992 and user has fixed sidenav
1866
+ if ($('#sidenav-overlay').css('opacity') != 0 && menuOut) {
1867
+ removeMenu(true);
1868
+ }
1869
+ else {
1725
1870
  menu_id.removeAttr('style');
1726
1871
  menu_id.css('width', options.menuWidth);
1727
1872
  }
1728
1873
  }
1729
- if ($('#sidenav-overlay').css('opacity') != 0 && menuOut) {
1730
- $('#sidenav-overlay').trigger('click');
1874
+ else if (menuOut === false){
1875
+ if (options.edge === 'left')
1876
+ menu_id.css('left', -1 * (options.menuWidth + 10));
1877
+ else
1878
+ menu_id.css('right', -1 * (options.menuWidth + 10));
1731
1879
  }
1880
+
1732
1881
  });
1733
1882
  }
1734
1883
 
@@ -1739,7 +1888,7 @@ $(document).ready(function(){
1739
1888
  });
1740
1889
  }
1741
1890
 
1742
- function removeMenu() {
1891
+ function removeMenu(restoreNav) {
1743
1892
  panning = false;
1744
1893
  menuOut = false;
1745
1894
  $('#sidenav-overlay').velocity({opacity: 0}, {duration: 200, queue: false, easing: 'easeOutQuad',
@@ -1749,15 +1898,38 @@ $(document).ready(function(){
1749
1898
  if (options.edge === 'left') {
1750
1899
  // Reset phantom div
1751
1900
  $('.drag-target').css({width: '', right: '', left: '0'});
1752
- menu_id.velocity({left: -1 * (options.menuWidth + 10)}, {duration: 200, queue: false, easing: 'easeOutCubic'});
1901
+ menu_id.velocity(
1902
+ {left: -1 * (options.menuWidth + 10)},
1903
+ { duration: 200,
1904
+ queue: false,
1905
+ easing: 'easeOutCubic',
1906
+ complete: function() {
1907
+ if (restoreNav == true) {
1908
+ // Restore Fixed sidenav
1909
+ menu_id.removeAttr('style');
1910
+ menu_id.css('width', options.menuWidth);
1911
+ }
1912
+ }
1913
+
1914
+ });
1753
1915
  }
1754
1916
  else {
1755
1917
  // Reset phantom div
1756
1918
  $('.drag-target').css({width: '', right: '0', left: ''});
1757
- menu_id.velocity({right: -1 * (options.menuWidth + 10)}, {duration: 200, queue: false, easing: 'easeOutCubic'});
1919
+ menu_id.velocity(
1920
+ {right: -1 * (options.menuWidth + 10)},
1921
+ { duration: 200,
1922
+ queue: false,
1923
+ easing: 'easeOutCubic',
1924
+ complete: function() {
1925
+ if (restoreNav == true) {
1926
+ // Restore Fixed sidenav
1927
+ menu_id.removeAttr('style');
1928
+ menu_id.css('width', options.menuWidth);
1929
+ }
1930
+ }
1931
+ });
1758
1932
  }
1759
-
1760
- // enable_scroll();
1761
1933
  }
1762
1934
 
1763
1935
 
@@ -1766,25 +1938,27 @@ $(document).ready(function(){
1766
1938
  var panning = false;
1767
1939
  var menuOut = false;
1768
1940
 
1941
+ $('.drag-target').on('click', function(){
1942
+ removeMenu();
1943
+ })
1944
+
1769
1945
  $('.drag-target').hammer({
1770
1946
  prevent_default: false
1771
- }).bind('tap', function(e) {
1772
- // capture overlay click on drag target
1773
- // if (menuOut && !panning) {
1774
- $('#sidenav-overlay').trigger('click');
1775
- // }
1776
1947
  }).bind('pan', function(e) {
1777
1948
 
1778
- if (e.gesture.pointerType === "touch") {
1949
+ if (e.gesture.pointerType == "touch") {
1779
1950
 
1780
1951
  var direction = e.gesture.direction;
1781
1952
  var x = e.gesture.center.x;
1782
1953
  var y = e.gesture.center.y;
1783
1954
  var velocityX = e.gesture.velocityX;
1784
1955
 
1785
- if (!$('#sidenav-overlay').length) {
1956
+ // If overlay does not exist, create one and if it is clicked, close menu
1957
+ if ($('#sidenav-overlay').length === 0) {
1786
1958
  var overlay = $('<div id="sidenav-overlay"></div>');
1787
- overlay.css('opacity', 0).click(function(){ removeMenu(); });
1959
+ overlay.css('opacity', 0).click( function(){
1960
+ removeMenu();
1961
+ });
1788
1962
  $('body').append(overlay);
1789
1963
  }
1790
1964
 
@@ -1793,9 +1967,6 @@ $(document).ready(function(){
1793
1967
  if (x > options.menuWidth) { x = options.menuWidth; }
1794
1968
  else if (x < 0) { x = 0; }
1795
1969
  }
1796
- else {
1797
- if (x < $(window).width() - options.menuWidth) { x = $(window).width() - options.menuWidth; }
1798
- }
1799
1970
 
1800
1971
  if (options.edge === 'left') {
1801
1972
  // Left Direction
@@ -1807,11 +1978,19 @@ $(document).ready(function(){
1807
1978
  }
1808
1979
  else {
1809
1980
  // Left Direction
1810
- if (x < ($(window).width() - options.menuWidth / 2)) { menuOut = true; }
1981
+ if (x < ($(window).width() - options.menuWidth / 2)) {
1982
+ menuOut = true;
1983
+ }
1811
1984
  // Right Direction
1812
- else if (x >= ($(window).width() - options.menuWidth / 2)) { menuOut = false; }
1985
+ else if (x >= ($(window).width() - options.menuWidth / 2)) {
1986
+ menuOut = false;
1987
+ }
1988
+ var rightPos = -1 *(x - options.menuWidth / 2);
1989
+ if (rightPos > 0) {
1990
+ rightPos = 0;
1991
+ }
1813
1992
 
1814
- menu_id.css('right', -1 *(x - options.menuWidth / 2));
1993
+ menu_id.css('right', rightPos);
1815
1994
  }
1816
1995
 
1817
1996
 
@@ -1829,7 +2008,7 @@ $(document).ready(function(){
1829
2008
  }
1830
2009
 
1831
2010
  }).bind('panend', function(e) {
1832
- if (e.gesture.pointerType === "touch") {
2011
+ if (e.gesture.pointerType == "touch") {
1833
2012
  var velocityX = e.gesture.velocityX;
1834
2013
  panning = false;
1835
2014
  if (options.edge === 'left') {
@@ -1840,12 +2019,12 @@ $(document).ready(function(){
1840
2019
  $('.drag-target').css({width: '50%', right: 0, left: ''});
1841
2020
  }
1842
2021
  else if (!menuOut || velocityX > 0.3) {
1843
- menu_id.velocity({left: -240}, {duration: 300, queue: false, easing: 'easeOutQuad'});
1844
- $('#sidenav-overlay').velocity({opacity: 0 }, {duration: 50, queue: false, easing: 'easeOutQuad',
2022
+ menu_id.velocity({left: -1 * (options.menuWidth + 10)}, {duration: 200, queue: false, easing: 'easeOutQuad'});
2023
+ $('#sidenav-overlay').velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',
1845
2024
  complete: function () {
1846
2025
  $(this).remove();
1847
2026
  }});
1848
- $('.drag-target').css({width: '10%', right: '', left: 0});
2027
+ $('.drag-target').css({width: '10px', right: '', left: 0});
1849
2028
  }
1850
2029
  }
1851
2030
  else {
@@ -1855,16 +2034,15 @@ $(document).ready(function(){
1855
2034
  $('.drag-target').css({width: '50%', right: '', left: 0});
1856
2035
  }
1857
2036
  else if (!menuOut || velocityX < -0.3) {
1858
- menu_id.velocity({right: -240}, {duration: 300, queue: false, easing: 'easeOutQuad'});
1859
- $('#sidenav-overlay').velocity({opacity: 0 }, {duration: 50, queue: false, easing: 'easeOutQuad',
2037
+ menu_id.velocity({right: -1 * (options.menuWidth + 10)}, {duration: 200, queue: false, easing: 'easeOutQuad'});
2038
+ $('#sidenav-overlay').velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',
1860
2039
  complete: function () {
1861
2040
  $(this).remove();
1862
2041
  }});
1863
- $('.drag-target').css({width: '10%', right: 0, left: ''});
2042
+ $('.drag-target').css({width: '10px', right: 0, left: ''});
1864
2043
  }
1865
2044
  }
1866
2045
 
1867
-
1868
2046
  }
1869
2047
  });
1870
2048
 
@@ -1892,14 +2070,14 @@ $(document).ready(function(){
1892
2070
  menuOut = false;
1893
2071
  panning = false;
1894
2072
  removeMenu();
1895
- overlay.animate({opacity: 0}, {duration: 300, queue: false, easing: 'easeOutQuad',
2073
+ overlay.velocity({opacity: 0}, {duration: 300, queue: false, easing: 'easeOutQuad',
1896
2074
  complete: function() {
1897
2075
  $(this).remove();
1898
2076
  } });
1899
2077
 
1900
2078
  });
1901
2079
  $('body').append(overlay);
1902
- overlay.animate({opacity: 1}, {duration: 300, queue: false, easing: 'easeOutQuad',
2080
+ overlay.velocity({opacity: 1}, {duration: 300, queue: false, easing: 'easeOutQuad',
1903
2081
  complete: function () {
1904
2082
  menuOut = true;
1905
2083
  panning = false;
@@ -2115,13 +2293,10 @@ $(document).ready(function(){
2115
2293
  e.preventDefault();
2116
2294
  var offset = $(this.hash).offset().top + 1;
2117
2295
 
2118
- // offset-60 to handle floating fixed tab bar
2119
- if ($('.tabs-wrapper').length) {
2120
- $('html, body').animate({ scrollTop: offset-60 }, {duration: 400, easing: 'easeOutCubic'});
2121
- }
2122
- else {
2123
- $('html, body').animate({ scrollTop: offset }, {duration: 400, easing: 'easeOutCubic'});
2124
- }
2296
+ // offset - 200 allows elements near bottom of page to scroll
2297
+
2298
+ $('html, body').animate({ scrollTop: offset - 200 }, {duration: 400, easing: 'easeOutCubic'});
2299
+
2125
2300
  });
2126
2301
  });
2127
2302
  options = options || {
@@ -2222,12 +2397,28 @@ $(document).ready(function(){
2222
2397
  })(jQuery);;(function ($) {
2223
2398
  $(document).ready(function() {
2224
2399
 
2400
+ // Function to update labels of text fields
2401
+ Materialize.updateTextFields = function() {
2402
+ var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
2403
+ $(input_selector).each(function(index, element) {
2404
+ if ($(element).val().length > 0 || $(this).attr('placeholder') !== undefined) {
2405
+ $(this).siblings('label, i').addClass('active');
2406
+ }
2407
+ else {
2408
+ $(this).siblings('label, i').removeClass('active');
2409
+ }
2410
+ });
2411
+ }
2412
+
2225
2413
  // Text based inputs
2226
2414
  var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
2227
2415
 
2416
+ // Handle HTML5 autofocus
2417
+ $('input[autofocus]').siblings('label, i').addClass('active');
2418
+
2228
2419
  // Add active if form auto complete
2229
2420
  $(document).on('change', input_selector, function () {
2230
- if($(this).val().length !== 0) {
2421
+ if($(this).val().length !== 0 || $(this).attr('placeholder') !== undefined) {
2231
2422
  $(this).siblings('label, i').addClass('active');
2232
2423
  }
2233
2424
  validate_field($(this));
@@ -2235,17 +2426,14 @@ $(document).ready(function(){
2235
2426
 
2236
2427
  // Add active if input element has been pre-populated on document ready
2237
2428
  $(document).ready(function() {
2238
- $(input_selector).each(function(index, element) {
2239
- if($(element).val().length > 0) {
2240
- $(this).siblings('label, i').addClass('active');
2241
- }
2242
- });
2429
+ Materialize.updateTextFields();
2243
2430
  });
2244
2431
 
2245
2432
  // HTML DOM FORM RESET handling
2246
2433
  $(document).on('reset', function(e) {
2247
2434
  if ($(e.target).is('form')) {
2248
2435
  $(this).find(input_selector).removeClass('valid').removeClass('invalid');
2436
+ $(this).find(input_selector).siblings('label, i').removeClass('active');
2249
2437
 
2250
2438
  // Reset select
2251
2439
  $(this).find('select.initialized').each(function () {
@@ -2261,7 +2449,7 @@ $(document).ready(function(){
2261
2449
  });
2262
2450
 
2263
2451
  $(document).on('blur', input_selector, function () {
2264
- if ($(this).val().length === 0) {
2452
+ if ($(this).val().length === 0 && $(this).attr('placeholder') === undefined) {
2265
2453
  $(this).siblings('label, i').removeClass('active');
2266
2454
  }
2267
2455
  validate_field($(this));
@@ -2290,35 +2478,48 @@ $(document).ready(function(){
2290
2478
 
2291
2479
 
2292
2480
  // Textarea Auto Resize
2293
- if ($('.hiddendiv').length === 0) {
2294
- var hiddenDiv = $('<div class="hiddendiv common"></div>'),
2295
- content = null;
2296
- $('body').append(hiddenDiv);
2481
+ var hiddenDiv = $('.hiddendiv').first();
2482
+ if (!hiddenDiv.length) {
2483
+ hiddenDiv = $('<div class="hiddendiv common"></div>');
2484
+ $('body').append(hiddenDiv);
2297
2485
  }
2298
2486
  var text_area_selector = '.materialize-textarea';
2299
- $('.hiddendiv').css('width', $(text_area_selector).width());
2487
+
2488
+ function textareaAutoResize($textarea) {
2489
+ hiddenDiv.text($textarea.val() + '\n');
2490
+ var content = hiddenDiv.html().replace(/\n/g, '<br>');
2491
+ hiddenDiv.html(content);
2492
+
2493
+ // When textarea is hidden, width goes crazy.
2494
+ // Approximate with half of window size
2495
+
2496
+ if ($textarea.is(':visible')) {
2497
+ hiddenDiv.css('width', $textarea.width());
2498
+ }
2499
+ else {
2500
+ hiddenDiv.css('width', $(window).width()/2);
2501
+ }
2502
+
2503
+ $textarea.css('height', hiddenDiv.height());
2504
+ }
2300
2505
 
2301
2506
  $(text_area_selector).each(function () {
2302
- if ($(this).val().length) {
2303
- content = $(this).val();
2304
- content = content.replace(/\n/g, '<br>');
2305
- hiddenDiv.html(content + '<br>');
2306
- $(this).css('height', hiddenDiv.height());
2507
+ var $textarea = $(this);
2508
+ if ($textarea.val().length) {
2509
+ textareaAutoResize($textarea);
2307
2510
  }
2308
2511
  });
2309
- $('body').on('keyup keydown',text_area_selector , function () {
2310
- content = $(this).val();
2311
- content = content.replace(/\n/g, '<br>');
2312
- hiddenDiv.html(content + '<br>');
2313
- $(this).css('height', hiddenDiv.height());
2314
- });
2512
+
2513
+ $('body').on('keyup keydown', text_area_selector, function () {
2514
+ textareaAutoResize($(this));
2515
+ });
2315
2516
 
2316
2517
 
2317
2518
  // File Input Path
2318
2519
  $('.file-field').each(function() {
2319
2520
  var path_input = $(this).find('input.file-path');
2320
2521
  $(this).find('input[type="file"]').change(function () {
2321
- path_input.val($(this).val());
2522
+ path_input.val($(this)[0].files[0].name);
2322
2523
  path_input.trigger('change');
2323
2524
  });
2324
2525
  });
@@ -2399,177 +2600,195 @@ $(document).ready(function(){
2399
2600
  }
2400
2601
  });
2401
2602
 
2402
- // Select Functionality
2603
+ }); // End of $(document).ready
2403
2604
 
2404
- // Select Plugin
2405
- $.fn.material_select = function (callback) {
2406
- $(this).each(function(){
2407
- $select = $(this);
2408
2605
 
2409
- if ( $select.hasClass('browser-default') || $select.hasClass('initialized')) {
2410
- return; // Continue to next (return false breaks out of entire loop)
2411
- }
2412
2606
 
2413
- var uniqueID = guid();
2414
- var wrapper = $('<div class="select-wrapper"></div>');
2415
- var options = $('<ul id="select-options-' + uniqueID+'" class="dropdown-content select-dropdown"></ul>');
2416
- var selectOptions = $select.children('option');
2417
- if ($select.find('option:selected') !== undefined) {
2418
- var label = $select.find('option:selected');
2419
- }
2420
- else {
2421
- var label = options.first();
2422
- }
2423
2607
 
2608
+ // Select Plugin
2609
+ $.fn.material_select = function (callback) {
2610
+ $(this).each(function(){
2611
+ $select = $(this);
2424
2612
 
2425
- // Create Dropdown structure
2426
- selectOptions.each(function () {
2427
- // Add disabled attr if disabled
2428
- options.append($('<li class="' + (($(this).is(':disabled')) ? 'disabled' : '') + '"><span>' + $(this).html() + '</span></li>'));
2429
- });
2613
+ if ( $select.hasClass('browser-default')) {
2614
+ return; // Continue to next (return false breaks out of entire loop)
2615
+ }
2430
2616
 
2617
+ // Tear down structure if Select needs to be rebuilt
2618
+ var lastID = $select.data('select-id');
2619
+ if (lastID) {
2620
+ $select.parent().find('i').remove();
2621
+ $select.parent().find('input').remove();
2431
2622
 
2432
- options.find('li').each(function (i) {
2433
- var $curr_select = $select;
2434
- $(this).click(function () {
2435
- // Check if option element is disabled
2436
- if (!$(this).hasClass('disabled')) {
2437
- $curr_select.find('option').eq(i).prop('selected', true);
2438
- // Trigger onchange() event
2439
- $curr_select.trigger('change');
2440
- $curr_select.siblings('input.select-dropdown').val($(this).text());
2441
- if (typeof callback !== 'undefined') callback();
2442
- }
2443
- });
2623
+ $select.unwrap();
2624
+ $('ul#select-options-'+lastID).remove();
2625
+ }
2444
2626
 
2445
- });
2627
+ // If destroying the select, remove the selelct-id and reset it to it's uninitialized state.
2628
+ if(callback === 'destroy') {
2629
+ $select.data('select-id', null).removeClass('initialized');
2630
+ return;
2631
+ }
2446
2632
 
2447
- // Wrap Elements
2448
- $select.wrap(wrapper);
2449
- // Add Select Display Element
2450
- var $newSelect = $('<input type="text" class="select-dropdown" readonly="true" ' + (($select.is(':disabled')) ? 'disabled' : '')
2451
- + ' data-activates="select-options-' + uniqueID +'" value="'+ label.html() +'"/><i class="mdi-navigation-arrow-drop-down">');
2452
- $select.before($newSelect);
2453
- $('body').append(options);
2454
- // Check if section element is disabled
2455
- if (!$select.is(':disabled')) {
2456
- $newSelect.dropdown({"hover": false});
2457
- }
2458
- $select.addClass('initialized');
2633
+ var uniqueID = Materialize.guid();
2634
+ $select.data('select-id', uniqueID);
2635
+ var wrapper = $('<div class="select-wrapper"></div>');
2636
+ wrapper.addClass($select.attr('class'));
2637
+ var options = $('<ul id="select-options-' + uniqueID+'" class="dropdown-content select-dropdown"></ul>');
2638
+ var selectOptions = $select.children('option');
2639
+ if ($select.find('option:selected') !== undefined) {
2640
+ var label = $select.find('option:selected');
2641
+ }
2642
+ else {
2643
+ var label = options.first();
2644
+ }
2645
+
2646
+
2647
+ // Create Dropdown structure
2648
+ selectOptions.each(function () {
2649
+ // Add disabled attr if disabled
2650
+ options.append($('<li class="' + (($(this).is(':disabled')) ? 'disabled' : '') + '"><span>' + $(this).html() + '</span></li>'));
2651
+ });
2459
2652
 
2460
- $newSelect.on('focus', function(){
2461
- $(this).trigger('open');
2462
- label = $(this).val();
2463
- selectedOption = options.find('li').filter(function() {
2464
- return $(this).text().toLowerCase() === label.toLowerCase();
2465
- })[0];
2466
- activateOption(options, selectedOption);
2467
- });
2468
2653
 
2469
- $newSelect.on('blur', function(){
2470
- $(this).trigger('close');
2654
+ options.find('li').each(function (i) {
2655
+ var $curr_select = $select;
2656
+ $(this).click(function () {
2657
+ // Check if option element is disabled
2658
+ if (!$(this).hasClass('disabled')) {
2659
+ $curr_select.find('option').eq(i).prop('selected', true);
2660
+ // Trigger onchange() event
2661
+ $curr_select.trigger('change');
2662
+ $curr_select.siblings('input.select-dropdown').val($(this).text());
2663
+ if (typeof callback !== 'undefined') callback();
2664
+ }
2471
2665
  });
2472
2666
 
2473
- // Make option as selected and scroll to selected position
2474
- activateOption = function(collection, newOption) {
2475
- collection.find('li.active').removeClass('active');
2476
- $(newOption).addClass('active');
2477
- collection.scrollTo(newOption);
2478
- }
2667
+ });
2479
2668
 
2480
- // Allow user to search by typing
2481
- // this array is cleared after 1 second
2482
- filterQuery = []
2669
+ // Wrap Elements
2670
+ $select.wrap(wrapper);
2671
+ // Add Select Display Element
2672
+ var dropdownIcon = $('<i class="mdi-navigation-arrow-drop-down"></i>');
2673
+ if ( $select.is(':disabled') )
2674
+ dropdownIcon.addClass('disabled');
2675
+
2676
+ var $newSelect = $('<input type="text" class="select-dropdown" readonly="true" ' + (($select.is(':disabled')) ? 'disabled' : '')
2677
+ + ' data-activates="select-options-' + uniqueID +'" value="'+ label.html() +'"/>');
2678
+ $select.before($newSelect);
2679
+ $newSelect.before(dropdownIcon);
2680
+
2681
+ $('body').append(options);
2682
+ // Check if section element is disabled
2683
+ if (!$select.is(':disabled')) {
2684
+ $newSelect.dropdown({"hover": false});
2685
+ }
2483
2686
 
2484
- onKeyDown = function(event){
2485
- // TAB - switch to another input
2486
- if(event.which == 9){
2487
- $newSelect.trigger('close');
2488
- return
2489
- }
2687
+ // Copy tabindex
2688
+ if ($select.attr('tabindex')) {
2689
+ $($newSelect[0]).attr('tabindex', $select.attr('tabindex'));
2690
+ }
2490
2691
 
2491
- // ARROW DOWN WHEN SELECT IS CLOSED - open select options
2492
- if(event.which == 40 && !options.is(":visible")){
2493
- $newSelect.trigger('open');
2494
- return
2495
- }
2692
+ $select.addClass('initialized');
2496
2693
 
2497
- // ENTER WHEN SELECT IS CLOSED - submit form
2498
- if(event.which == 13 && !options.is(":visible")){
2499
- return
2500
- }
2694
+ $newSelect.on('focus', function(){
2695
+ $(this).trigger('open');
2696
+ label = $(this).val();
2697
+ selectedOption = options.find('li').filter(function() {
2698
+ return $(this).text().toLowerCase() === label.toLowerCase();
2699
+ })[0];
2700
+ activateOption(options, selectedOption);
2701
+ });
2501
2702
 
2502
- event.preventDefault();
2703
+ $newSelect.on('blur', function(){
2704
+ $(this).trigger('close');
2705
+ });
2503
2706
 
2504
- // CASE WHEN USER TYPE LETTERS
2505
- letter = String.fromCharCode(event.which).toLowerCase();
2707
+ // Make option as selected and scroll to selected position
2708
+ activateOption = function(collection, newOption) {
2709
+ collection.find('li.active').removeClass('active');
2710
+ $(newOption).addClass('active');
2711
+ collection.scrollTo(newOption);
2712
+ }
2506
2713
 
2507
- if (letter){
2508
- filterQuery.push(letter);
2714
+ // Allow user to search by typing
2715
+ // this array is cleared after 1 second
2716
+ filterQuery = []
2509
2717
 
2510
- string = filterQuery.join("");
2718
+ onKeyDown = function(event){
2719
+ // TAB - switch to another input
2720
+ if(event.which == 9){
2721
+ $newSelect.trigger('close');
2722
+ return
2723
+ }
2511
2724
 
2512
- newOption = options.find('li').filter(function() {
2513
- return $(this).text().toLowerCase().indexOf(string) === 0;
2514
- })[0];
2725
+ // ARROW DOWN WHEN SELECT IS CLOSED - open select options
2726
+ if(event.which == 40 && !options.is(":visible")){
2727
+ $newSelect.trigger('open');
2728
+ return
2729
+ }
2515
2730
 
2516
- if(newOption){
2517
- activateOption(options, newOption);
2518
- }
2519
- }
2731
+ // ENTER WHEN SELECT IS CLOSED - submit form
2732
+ if(event.which == 13 && !options.is(":visible")){
2733
+ return
2734
+ }
2520
2735
 
2521
- // ENTER - select option and close when select options are opened
2522
- if(event.which == 13){
2523
- activeOption = options.find('li.active:not(.disabled)')[0];
2524
- if(activeOption){
2525
- $(activeOption).trigger('click');
2526
- $newSelect.trigger('close');
2527
- }
2528
- }
2736
+ event.preventDefault();
2529
2737
 
2530
- // ARROW DOWN - move to next not disabled option
2531
- if(event.which == 40){
2532
- newOption = options.find('li.active').next('li:not(.disabled)')[0];
2533
- if(newOption){
2534
- activateOption(options, newOption);
2535
- }
2738
+ // CASE WHEN USER TYPE LETTERS
2739
+ letter = String.fromCharCode(event.which).toLowerCase();
2740
+
2741
+ if (letter){
2742
+ filterQuery.push(letter);
2743
+
2744
+ string = filterQuery.join("");
2745
+
2746
+ newOption = options.find('li').filter(function() {
2747
+ return $(this).text().toLowerCase().indexOf(string) === 0;
2748
+ })[0];
2749
+
2750
+ if(newOption){
2751
+ activateOption(options, newOption);
2536
2752
  }
2753
+ }
2537
2754
 
2538
- // ESC - close options
2539
- if(event.which == 27){
2755
+ // ENTER - select option and close when select options are opened
2756
+ if(event.which == 13){
2757
+ activeOption = options.find('li.active:not(.disabled)')[0];
2758
+ if(activeOption){
2759
+ $(activeOption).trigger('click');
2540
2760
  $newSelect.trigger('close');
2541
2761
  }
2762
+ }
2542
2763
 
2543
- // ARROW UP - move to previous not disabled option
2544
- if(event.which == 38){
2545
- newOption = options.find('li.active').prev('li:not(.disabled)')[0];
2546
- if(newOption){
2547
- activateOption(options, newOption);
2548
- }
2764
+ // ARROW DOWN - move to next not disabled option
2765
+ if(event.which == 40){
2766
+ newOption = options.find('li.active').next('li:not(.disabled)')[0];
2767
+ if(newOption){
2768
+ activateOption(options, newOption);
2549
2769
  }
2770
+ }
2550
2771
 
2551
- // Automaticaly clean filter query so user can search again by starting letters
2552
- setTimeout(function(){filterQuery = []}, 1000)
2772
+ // ESC - close options
2773
+ if(event.which == 27){
2774
+ $newSelect.trigger('close');
2553
2775
  }
2554
2776
 
2555
- $newSelect.on('keydown', onKeyDown);
2556
- });
2557
- }
2777
+ // ARROW UP - move to previous not disabled option
2778
+ if(event.which == 38){
2779
+ newOption = options.find('li.active').prev('li:not(.disabled)')[0];
2780
+ if(newOption){
2781
+ activateOption(options, newOption);
2782
+ }
2783
+ }
2558
2784
 
2559
- // Unique ID
2560
- var guid = (function() {
2561
- function s4() {
2562
- return Math.floor((1 + Math.random()) * 0x10000)
2563
- .toString(16)
2564
- .substring(1);
2785
+ // Automaticaly clean filter query so user can search again by starting letters
2786
+ setTimeout(function(){filterQuery = []}, 1000)
2565
2787
  }
2566
- return function() {
2567
- return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
2568
- s4() + '-' + s4() + s4() + s4();
2569
- };
2570
- })();
2571
2788
 
2572
- });
2789
+ $newSelect.on('keydown', onKeyDown);
2790
+ });
2791
+ }
2573
2792
 
2574
2793
  }( jQuery ));
2575
2794
  ;(function ($) {
@@ -2579,7 +2798,7 @@ $(document).ready(function(){
2579
2798
  indicators: true,
2580
2799
  height: 400,
2581
2800
  transition: 500,
2582
- interval: 60000
2801
+ interval: 6000
2583
2802
  }
2584
2803
  options = $.extend(defaults, options);
2585
2804
 
@@ -2841,11 +3060,19 @@ $(document).ready(function(){
2841
3060
  $(document).on('click.card', '.card', function (e) {
2842
3061
  if ($(this).find('.card-reveal').length) {
2843
3062
  if ($(e.target).is($('.card-reveal .card-title')) || $(e.target).is($('.card-reveal .card-title i'))) {
2844
- $(this).find('.card-reveal').velocity({translateY: 0}, {duration: 225, queue: false, easing: 'easeInOutQuad'});
3063
+ // Make Reveal animate down and display none
3064
+ $(this).find('.card-reveal').velocity(
3065
+ {translateY: 0}, {
3066
+ duration: 225,
3067
+ queue: false,
3068
+ easing: 'easeInOutQuad',
3069
+ complete: function() { $(this).css({ display: 'none'}) }
3070
+ }
3071
+ );
2845
3072
  }
2846
3073
  else if ($(e.target).is($('.card .activator')) ||
2847
3074
  $(e.target).is($('.card .activator i')) ) {
2848
- $(this).find('.card-reveal').velocity({translateY: '-100%'}, {duration: 300, queue: false, easing: 'easeInOutQuad'});
3075
+ $(this).find('.card-reveal').css({ display: 'block'}).velocity("stop", false).velocity({translateY: '-100%'}, {duration: 300, queue: false, easing: 'easeInOutQuad'});
2849
3076
  }
2850
3077
  }
2851
3078
 
@@ -2856,19 +3083,6 @@ $(document).ready(function(){
2856
3083
  }( jQuery ));;(function ($) {
2857
3084
  $(document).ready(function() {
2858
3085
 
2859
- // Unique ID
2860
- var guid = (function() {
2861
- function s4() {
2862
- return Math.floor((1 + Math.random()) * 0x10000)
2863
- .toString(16)
2864
- .substring(1);
2865
- }
2866
- return function() {
2867
- return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
2868
- s4() + '-' + s4() + s4() + s4();
2869
- };
2870
- })();
2871
-
2872
3086
  $.fn.pushpin = function (options) {
2873
3087
 
2874
3088
  var defaults = {
@@ -2880,7 +3094,7 @@ $(document).ready(function(){
2880
3094
 
2881
3095
  $index = 0;
2882
3096
  return this.each(function() {
2883
- var $uniqueId = guid(),
3097
+ var $uniqueId = Materialize.guid(),
2884
3098
  $this = $(this),
2885
3099
  $original_offset = $(this).offset().top;
2886
3100
 
@@ -2936,12 +3150,12 @@ $(document).ready(function(){
2936
3150
  $(document).on('mouseenter.fixedActionBtn', '.fixed-action-btn', function(e) {
2937
3151
  var $this = $(this);
2938
3152
 
2939
- $this.find('ul a.btn-floating').velocity(
3153
+ $this.find('ul .btn-floating').velocity(
2940
3154
  { scaleY: ".4", scaleX: ".4", translateY: "40px"},
2941
3155
  { duration: 0 });
2942
3156
 
2943
3157
  var time = 0;
2944
- $this.find('ul a.btn-floating').reverse().each(function () {
3158
+ $this.find('ul .btn-floating').reverse().each(function () {
2945
3159
  $(this).velocity(
2946
3160
  { opacity: "1", scaleX: "1", scaleY: "1", translateY: "0"},
2947
3161
  { duration: 80, delay: time });
@@ -2954,8 +3168,8 @@ $(document).ready(function(){
2954
3168
  var $this = $(this);
2955
3169
 
2956
3170
  var time = 0;
2957
- $this.find('ul a.btn-floating').velocity("stop", true);
2958
- $this.find('ul a.btn-floating').velocity(
3171
+ $this.find('ul .btn-floating').velocity("stop", true);
3172
+ $this.find('ul .btn-floating').velocity(
2959
3173
  { opacity: "0", scaleX: ".4", scaleY: ".4", translateY: "40px"},
2960
3174
  { duration: 80 });
2961
3175
  });
@@ -2963,37 +3177,66 @@ $(document).ready(function(){
2963
3177
  });
2964
3178
  }( jQuery ));
2965
3179
  ;(function ($) {
2966
- $(document).ready(function() {
3180
+ // Image transition function
3181
+ Materialize.fadeInImage = function(selector){
3182
+ var element = $(selector);
3183
+ element.css({opacity: 0});
3184
+ $(element).velocity({opacity: 1}, {
3185
+ duration: 650,
3186
+ queue: false,
3187
+ easing: 'easeOutSine'
3188
+ });
3189
+ $(element).velocity({opacity: 1}, {
3190
+ duration: 1300,
3191
+ queue: false,
3192
+ easing: 'swing',
3193
+ step: function(now, fx) {
3194
+ fx.start = 100;
3195
+ var grayscale_setting = now/100;
3196
+ var brightness_setting = 150 - (100 - now)/1.75;
3197
+
3198
+ if (brightness_setting < 100) {
3199
+ brightness_setting = 100;
3200
+ }
3201
+ if (now >= 0) {
3202
+ $(this).css({
3203
+ "-webkit-filter": "grayscale("+grayscale_setting+")" + "brightness("+brightness_setting+"%)",
3204
+ "filter": "grayscale("+grayscale_setting+")" + "brightness("+brightness_setting+"%)"
3205
+ });
3206
+ }
3207
+ }
3208
+ });
3209
+ };
2967
3210
 
3211
+ // Horizontal staggered list
3212
+ Materialize.showStaggeredList = function(selector) {
3213
+ var time = 0;
3214
+ $(selector).find('li').velocity(
3215
+ { translateX: "-100px"},
3216
+ { duration: 0 });
2968
3217
 
2969
- // Horizontal staggered list
2970
- showStaggeredList = function(selector) {
2971
- var time = 0;
2972
- $(selector).find('li').velocity(
2973
- { translateX: "-100px"},
2974
- { duration: 0 });
3218
+ $(selector).find('li').each(function() {
3219
+ $(this).velocity(
3220
+ { opacity: "1", translateX: "0"},
3221
+ { duration: 800, delay: time, easing: [60, 10] });
3222
+ time += 120;
3223
+ });
3224
+ };
2975
3225
 
2976
- $(selector).find('li').each(function() {
2977
- $(this).velocity(
2978
- { opacity: "1", translateX: "0"},
2979
- { duration: 800, delay: time, easing: [60, 10] });
2980
- time += 120;
2981
- });
2982
- }
2983
3226
 
3227
+ $(document).ready(function() {
2984
3228
  // Hardcoded .staggered-list scrollFire
2985
- var staggeredListOptions = [];
2986
- $('ul.staggered-list').each(function (i) {
2987
-
2988
- var label = 'scrollFire-' + i;
2989
- $(this).addClass(label);
2990
- staggeredListOptions.push(
2991
- {selector: 'ul.staggered-list.' + label,
2992
- offset: 200,
2993
- callback: 'showStaggeredList("ul.staggered-list.' + label + '")'});
2994
- });
2995
- scrollFire(staggeredListOptions);
2996
-
3229
+ // var staggeredListOptions = [];
3230
+ // $('ul.staggered-list').each(function (i) {
3231
+
3232
+ // var label = 'scrollFire-' + i;
3233
+ // $(this).addClass(label);
3234
+ // staggeredListOptions.push(
3235
+ // {selector: 'ul.staggered-list.' + label,
3236
+ // offset: 200,
3237
+ // callback: 'showStaggeredList("ul.staggered-list.' + label + '")'});
3238
+ // });
3239
+ // scrollFire(staggeredListOptions);
2997
3240
 
2998
3241
  // HammerJS, Swipe navigation
2999
3242
 
@@ -3076,66 +3319,74 @@ $(document).ready(function(){
3076
3319
  // { opacity: "1", scaleX: 1, scaleY: 1, translateX: 0},
3077
3320
  // { duration: 800, easing: [60, 10] });
3078
3321
  // });
3322
+ });
3323
+ }( jQuery ));
3324
+ ;(function($) {
3079
3325
 
3326
+ // Input: Array of JSON objects {selector, offset, callback}
3080
3327
 
3081
- // Image transition function
3082
- fadeInImage = function(selector){
3083
- var element = $(selector);
3084
- element.css({opacity: 0});
3085
- $(element).velocity({opacity: 1}, {
3086
- duration: 650,
3087
- queue: false,
3088
- easing: 'easeOutSine'
3089
- });
3090
- $(element).animate({opacity: 1}, {
3091
- duration: 1300,
3092
- queue: false,
3093
- easing: 'swing',
3094
- step: function(now, fx) {
3095
- fx.start = 100;
3096
- var grayscale_setting = now/100;
3097
- var brightness_setting = 150 - (100 - now)/1.75;
3098
-
3099
- if (brightness_setting < 100) {
3100
- brightness_setting = 100;
3101
- }
3102
- if (now >= 0) {
3103
- $(this).css({
3104
- "-webkit-filter": "grayscale("+grayscale_setting+")" + "brightness("+brightness_setting+"%)",
3105
- "filter": "grayscale("+grayscale_setting+")" + "brightness("+brightness_setting+"%)"
3106
- });
3328
+ Materialize.scrollFire = function(options) {
3329
+
3330
+ var didScroll = false;
3331
+
3332
+ window.addEventListener("scroll", function() {
3333
+ didScroll = true;
3334
+ });
3335
+
3336
+ // Rate limit to 100ms
3337
+ setInterval(function() {
3338
+ if(didScroll) {
3339
+ didScroll = false;
3340
+
3341
+ var windowScroll = window.pageYOffset + window.innerHeight;
3342
+
3343
+ for (var i = 0 ; i < options.length; i++) {
3344
+ // Get options from each line
3345
+ var value = options[i];
3346
+ var selector = value.selector,
3347
+ offset = value.offset,
3348
+ callback = value.callback;
3349
+
3350
+ var currentElement = document.querySelector(selector);
3351
+ if ( currentElement !== null) {
3352
+ var elementOffset = currentElement.getBoundingClientRect().top + document.body.scrollTop;
3353
+
3354
+ if (windowScroll > (elementOffset + offset)) {
3355
+ if (value.done != true) {
3356
+ var callbackFunc = new Function(callback);
3357
+ callbackFunc();
3358
+ value.done = true;
3107
3359
  }
3360
+ }
3108
3361
  }
3109
- });
3110
- };
3362
+ };
3363
+ }
3364
+ }, 100);
3111
3365
 
3112
- });
3113
- }( jQuery ));
3114
- ;(function($) {
3115
3366
 
3116
- // Input: Array of JSON objects {selector, offset, callback}
3367
+ // $(window).scroll(function () {
3368
+ // var windowScroll = $(window).scrollTop() + $(window).height();
3117
3369
 
3118
- scrollFire = function(options) {
3119
- $(window).scroll(function () {
3120
- var windowScroll = $(window).scrollTop() + $(window).height();
3370
+ // $.each( options, function( i, value ){
3371
+ // var selector = value.selector,
3372
+ // offset = value.offset,
3373
+ // callback = value.callback;
3121
3374
 
3122
- $.each( options, function( i, value ){
3123
- var selector = value.selector,
3124
- offset = value.offset,
3125
- callback = value.callback;
3375
+ // if ($(selector).length != 0) {
3376
+ // var elementOffset = $(selector).offset().top;
3126
3377
 
3127
- var elementOffset = $(selector).offset().top;
3378
+ // if (windowScroll > (elementOffset + offset)) {
3379
+ // if (value.done != true) {
3380
+ // var callbackFunc = new Function(callback);
3381
+ // callbackFunc();
3382
+ // value.done = true;
3383
+ // }
3384
+ // }
3385
+ // }
3128
3386
 
3129
- if (windowScroll > (elementOffset + offset)) {
3130
- if (value.done != true) {
3131
- var callbackFunc = new Function(callback);
3132
- callbackFunc();
3133
- value.done = true;
3134
- }
3135
- }
3387
+ // });
3388
+ // });
3136
3389
 
3137
- });
3138
- });
3139
3390
  }
3140
3391
 
3141
3392
  })(jQuery);;/*!
@@ -5691,3 +5942,62 @@ Picker.extend( 'pickadate', DatePicker )
5691
5942
  }));
5692
5943
 
5693
5944
 
5945
+ ;(function ($) {
5946
+
5947
+ $.fn.characterCounter = function(){
5948
+ return this.each(function(){
5949
+
5950
+ itHasLengthAttribute = $(this).attr('length') != undefined;
5951
+
5952
+ if(itHasLengthAttribute){
5953
+ $(this).on('input', updateCounter);
5954
+ $(this).on('focus', updateCounter);
5955
+ $(this).on('blur', removeCounterElement);
5956
+
5957
+ addCounterElement($(this));
5958
+ }
5959
+
5960
+ });
5961
+ };
5962
+
5963
+ function updateCounter(){
5964
+ var maxLength = +$(this).attr('length'),
5965
+ actualLength = +$(this).val().length,
5966
+ isValidLength = actualLength <= maxLength;
5967
+
5968
+ $(this).parent().find('span[class="character-counter"]')
5969
+ .html( actualLength + '/' + maxLength);
5970
+
5971
+ addInputStyle(isValidLength, $(this));
5972
+ }
5973
+
5974
+ function addCounterElement($input){
5975
+ $counterElement = $('<span/>')
5976
+ .addClass('character-counter')
5977
+ .css('float','right')
5978
+ .css('font-size','12px')
5979
+ .css('height', 1);
5980
+
5981
+ $input.parent().append($counterElement);
5982
+ }
5983
+
5984
+ function removeCounterElement(){
5985
+ $(this).parent().find('span[class="character-counter"]').html('');
5986
+ }
5987
+
5988
+ function addInputStyle(isValidLength, $input){
5989
+ inputHasInvalidClass = $input.hasClass('invalid');
5990
+ if (isValidLength && inputHasInvalidClass) {
5991
+ $input.removeClass('invalid');
5992
+ }
5993
+ else if(!isValidLength && !inputHasInvalidClass){
5994
+ $input.removeClass('valid');
5995
+ $input.addClass('invalid');
5996
+ }
5997
+ }
5998
+
5999
+ $(document).ready(function(){
6000
+ $('input, textarea').characterCounter();
6001
+ });
6002
+
6003
+ }( jQuery ));