You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

503 lines
79 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. ; (function (window) {
  2. 'use strict';
  3. var Waves = Waves || {};
  4. var $$ = document.querySelectorAll.bind(document);
  5. // Find exact position of element
  6. function isWindow(obj) {
  7. return obj !== null && obj === obj.window;
  8. }
  9. function getWindow(elem) {
  10. return isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;
  11. }
  12. function offset(elem) {
  13. var docElem, win,
  14. box = { top: 0, left: 0 },
  15. doc = elem && elem.ownerDocument;
  16. docElem = doc.documentElement;
  17. if (typeof elem.getBoundingClientRect !== typeof undefined) {
  18. box = elem.getBoundingClientRect();
  19. }
  20. win = getWindow(doc);
  21. return {
  22. top: box.top + win.pageYOffset - docElem.clientTop,
  23. left: box.left + win.pageXOffset - docElem.clientLeft
  24. };
  25. }
  26. function convertStyle(obj) {
  27. var style = '';
  28. for (var a in obj) {
  29. if (obj.hasOwnProperty(a)) {
  30. style += (a + ':' + obj[a] + ';');
  31. }
  32. }
  33. return style;
  34. }
  35. var Effect = {
  36. // Effect delay
  37. duration: 750,
  38. show: function (e, element) {
  39. // Disable right click
  40. if (e.button === 2) {
  41. return false;
  42. }
  43. var el = element || this;
  44. // Create ripple
  45. var ripple = document.createElement('div');
  46. ripple.className = 'waves-ripple';
  47. el.appendChild(ripple);
  48. // Get click coordinate and element witdh
  49. var pos = offset(el);
  50. var relativeY = (e.pageY - pos.top);
  51. var relativeX = (e.pageX - pos.left);
  52. var scale = 'scale(' + ((el.clientWidth / 100) * 10) + ')';
  53. // Support for touch devices
  54. if ('touches' in e) {
  55. relativeY = (e.touches[0].pageY - pos.top);
  56. relativeX = (e.touches[0].pageX - pos.left);
  57. }
  58. // Attach data to element
  59. ripple.setAttribute('data-hold', Date.now());
  60. ripple.setAttribute('data-scale', scale);
  61. ripple.setAttribute('data-x', relativeX);
  62. ripple.setAttribute('data-y', relativeY);
  63. // Set ripple position
  64. var rippleStyle = {
  65. 'top': relativeY + 'px',
  66. 'left': relativeX + 'px'
  67. };
  68. ripple.className = ripple.className + ' waves-notransition';
  69. ripple.setAttribute('style', convertStyle(rippleStyle));
  70. ripple.className = ripple.className.replace('waves-notransition', '');
  71. // Scale the ripple
  72. rippleStyle['-webkit-transform'] = scale;
  73. rippleStyle['-moz-transform'] = scale;
  74. rippleStyle['-ms-transform'] = scale;
  75. rippleStyle['-o-transform'] = scale;
  76. rippleStyle.transform = scale;
  77. rippleStyle.opacity = '1';
  78. rippleStyle['-webkit-transition-duration'] = Effect.duration + 'ms';
  79. rippleStyle['-moz-transition-duration'] = Effect.duration + 'ms';
  80. rippleStyle['-o-transition-duration'] = Effect.duration + 'ms';
  81. rippleStyle['transition-duration'] = Effect.duration + 'ms';
  82. rippleStyle['-webkit-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
  83. rippleStyle['-moz-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
  84. rippleStyle['-o-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
  85. rippleStyle['transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
  86. ripple.setAttribute('style', convertStyle(rippleStyle));
  87. },
  88. hide: function (e) {
  89. TouchHandler.touchup(e);
  90. var el = this;
  91. var width = el.clientWidth * 1.4;
  92. // Get first ripple
  93. var ripple = null;
  94. var ripples = el.getElementsByClassName('waves-ripple');
  95. if (ripples.length > 0) {
  96. ripple = ripples[ripples.length - 1];
  97. } else {
  98. return false;
  99. }
  100. var relativeX = ripple.getAttribute('data-x');
  101. var relativeY = ripple.getAttribute('data-y');
  102. var scale = ripple.getAttribute('data-scale');
  103. // Get delay beetween mousedown and mouse leave
  104. var diff = Date.now() - Number(ripple.getAttribute('data-hold'));
  105. var delay = 350 - diff;
  106. if (delay < 0) {
  107. delay = 0;
  108. }
  109. // Fade out ripple after delay
  110. setTimeout(function () {
  111. var style = {
  112. 'top': relativeY + 'px',
  113. 'left': relativeX + 'px',
  114. 'opacity': '0',
  115. // Duration
  116. '-webkit-transition-duration': Effect.duration + 'ms',
  117. '-moz-transition-duration': Effect.duration + 'ms',
  118. '-o-transition-duration': Effect.duration + 'ms',
  119. 'transition-duration': Effect.duration + 'ms',
  120. '-webkit-transform': scale,
  121. '-moz-transform': scale,
  122. '-ms-transform': scale,
  123. '-o-transform': scale,
  124. 'transform': scale,
  125. };
  126. ripple.setAttribute('style', convertStyle(style));
  127. setTimeout(function () {
  128. try {
  129. el.removeChild(ripple);
  130. } catch (e) {
  131. return false;
  132. }
  133. }, Effect.duration);
  134. }, delay);
  135. },
  136. // Little hack to make <input> can perform waves effect
  137. wrapInput: function (elements) {
  138. for (var a = 0; a < elements.length; a++) {
  139. var el = elements[a];
  140. if (el.tagName.toLowerCase() === 'input') {
  141. var parent = el.parentNode;
  142. // If input already have parent just pass through
  143. if (parent.tagName.toLowerCase() === 'i' && parent.className.indexOf('waves-effect') !== -1) {
  144. continue;
  145. }
  146. // Put element class and style to the specified parent
  147. var wrapper = document.createElement('i');
  148. wrapper.className = el.className + ' waves-input-wrapper';
  149. var elementStyle = el.getAttribute('style');
  150. if (!elementStyle) {
  151. elementStyle = '';
  152. }
  153. wrapper.setAttribute('style', elementStyle);
  154. el.className = 'waves-button-input';
  155. el.removeAttribute('style');
  156. // Put element as child
  157. parent.replaceChild(wrapper, el);
  158. wrapper.appendChild(el);
  159. }
  160. }
  161. }
  162. };
  163. /**
  164. * Disable mousedown event for 500ms during and after touch
  165. */
  166. var TouchHandler = {
  167. /* uses an integer rather than bool so there's no issues with
  168. * needing to clear timeouts if another touch event occurred
  169. * within the 500ms. Cannot mouseup between touchstart and
  170. * touchend, nor in the 500ms after touchend. */
  171. touches: 0,
  172. allowEvent: function (e) {
  173. var allow = true;
  174. if (e.type === 'touchstart') {
  175. TouchHandler.touches += 1; //push
  176. } else if (e.type === 'touchend' || e.type === 'touchcancel') {
  177. setTimeout(function () {
  178. if (TouchHandler.touches > 0) {
  179. TouchHandler.touches -= 1; //pop after 500ms
  180. }
  181. }, 500);
  182. } else if (e.type === 'mousedown' && TouchHandler.touches > 0) {
  183. allow = false;
  184. }
  185. return allow;
  186. },
  187. touchup: function (e) {
  188. TouchHandler.allowEvent(e);
  189. }
  190. };
  191. /**
  192. * Delegated click handler for .waves-effect element.
  193. * returns null when .waves-effect element not in "click tree"
  194. */
  195. function getWavesEffectElement(e) {
  196. if (TouchHandler.allowEvent(e) === false) {
  197. return null;
  198. }
  199. var element = null;
  200. var target = e.target || e.srcElement;
  201. while (target.parentElement !== null) {
  202. if (!(target instanceof SVGElement) && target.className.indexOf('waves-effect') !== -1) {
  203. element = target;
  204. break;
  205. } else if (target.classList.contains('waves-effect')) {
  206. element = target;
  207. break;
  208. }
  209. target = target.parentElement;
  210. }
  211. return element;
  212. }
  213. /**
  214. * Bubble the click and show effect if .waves-effect elem was found
  215. */
  216. function showEffect(e) {
  217. var element = getWavesEffectElement(e);
  218. if (element !== null) {
  219. Effect.show(e, element);
  220. if ('ontouchstart' in window) {
  221. element.addEventListener('touchend', Effect.hide, false);
  222. element.addEventListener('touchcancel', Effect.hide, false);
  223. }
  224. element.addEventListener('mouseup', Effect.hide, false);
  225. element.addEventListener('mouseleave', Effect.hide, false);
  226. }
  227. }
  228. Waves.displayEffect = function (options) {
  229. options = options || {};
  230. if ('duration' in options) {
  231. Effect.duration = options.duration;
  232. }
  233. //Wrap input inside <i> tag
  234. Effect.wrapInput($$('.waves-effect'));
  235. if ('ontouchstart' in window) {
  236. document.body.addEventListener('touchstart', showEffect, false);
  237. }
  238. document.body.addEventListener('mousedown', showEffect, false);
  239. };
  240. /**
  241. * Attach Waves to an input element (or any element which doesn't
  242. * bubble mouseup/mousedown events).
  243. * Intended to be used with dynamically loaded forms/inputs, or
  244. * where the user doesn't want a delegated click handler.
  245. */
  246. Waves.attach = function (element) {
  247. //FUTURE: automatically add waves classes and allow users
  248. // to specify them with an options param? Eg. light/classic/button
  249. if (element.tagName.toLowerCase() === 'input') {
  250. Effect.wrapInput([element]);
  251. element = element.parentElement;
  252. }
  253. if ('ontouchstart' in window) {
  254. element.addEventListener('touchstart', showEffect, false);
  255. }
  256. element.addEventListener('mousedown', showEffect, false);
  257. };
  258. window.Waves = Waves;
  259. document.addEventListener('DOMContentLoaded', function () {
  260. Waves.displayEffect();
  261. }, false);
  262. })(window);
  263. /*
  264. Tabs
  265. */
  266. /*! VelocityJS.org (1.2.2). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
  267. /*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */
  268. !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 Num
  269. return function (e, t, r, a) {
  270. 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)
  271. 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)
  272. 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) {
  273. 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) {
  274. t && $.each(t[1], function (r, n) {
  275. var o = b === a ? "" : b; return o === !0 || t[2].queue === o || b === a && t[2].queue === !1 ? void $.each(m, function (r, a) {
  276. 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) {
  277. t.endValue = t.currentValue
  278. }), A.push(e)) : "finish" === h && (t[2].duration = 1))
  279. }) : !0
  280. })
  281. }), "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"
  282. }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()
  283. }
  284. }; 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
  285. }(window.jQuery || window.Zepto || window, window, document)
  286. });; !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.point
  287. if (typeof define === 'function' && define.amd) {
  288. define(['jquery', 'hammerjs'], factory);
  289. } else if (typeof exports === 'object') {
  290. factory(require('jquery'), require('hammerjs'));
  291. } else {
  292. factory(jQuery, Hammer);
  293. }
  294. }(function ($, Hammer) {
  295. function hammerify(el, options) {
  296. var $el = $(el);
  297. if (!$el.data("hammer")) {
  298. $el.data("hammer", new Hammer($el[0], options));
  299. }
  300. }
  301. $.fn.hammer = function (options) {
  302. return this.each(function () {
  303. hammerify(this, options);
  304. });
  305. };
  306. // extend the emit method to also trigger jQuery events
  307. Hammer.Manager.prototype.emit = (function (originalEmit) {
  308. return function (type, data) {
  309. originalEmit.call(this, type, data);
  310. $(this.element).trigger({
  311. type: type,
  312. gesture: data
  313. });
  314. };
  315. })(Hammer.Manager.prototype.emit);
  316. }));
  317. var methods = {
  318. init: function () {
  319. return this.each(function () {
  320. // For each set of tabs, we want to keep track of
  321. // which tab is active and its associated content
  322. var $this = $(this),
  323. window_width = $(window).width();
  324. $this.width('100%');
  325. // Set Tab Width for each tab
  326. var $num_tabs = $(this).children('li').length;
  327. $this.children('li').each(function () {
  328. $(this).width((100 / $num_tabs) + '%');
  329. });
  330. var $active, $content, $links = $this.find('li.tab a'),
  331. $tabs_width = $this.width(),
  332. $tab_width = $this.find('li').first().outerWidth(),
  333. $index = 0;
  334. // If the location.hash matches one of the links, use that as the active tab.
  335. $active = $($links.filter('[href="' + location.hash + '"]'));
  336. // If no match is found, use the first link or any with class 'active' as the initial active tab.
  337. if ($active.length === 0) {
  338. $active = $(this).find('li.tab a.active').first();
  339. }
  340. if ($active.length === 0) {
  341. $active = $(this).find('li.tab a').first();
  342. }
  343. $active.addClass('active');
  344. $index = $links.index($active);
  345. if ($index < 0) {
  346. $index = 0;
  347. }
  348. $content = $($active[0].hash);
  349. // append indicator then set indicator width to tab width
  350. $this.append('<div class="indicator"></div>');
  351. var $indicator = $this.find('.indicator');
  352. if ($this.is(":visible")) {
  353. $indicator.css({ "right": $tabs_width - (($index + 1) * $tab_width) });
  354. $indicator.css({ "left": $index * $tab_width });
  355. }
  356. $(window).resize(function () {
  357. $tabs_width = $this.width();
  358. $tab_width = $this.find('li').first().outerWidth();
  359. if ($index < 0) {
  360. $index = 0;
  361. }
  362. if ($tab_width !== 0 && $tabs_width !== 0) {
  363. $indicator.css({ "right": $tabs_width - (($index + 1) * $tab_width) });
  364. $indicator.css({ "left": $index * $tab_width });
  365. }
  366. });
  367. // Hide the remaining content
  368. $links.not($active).each(function () {
  369. $(this.hash).hide();
  370. });
  371. // Bind the click event handler
  372. $this.on('click', 'a', function (e) {
  373. $tabs_width = $this.width();
  374. $tab_width = $this.find('li').first().outerWidth();
  375. // Make the old tab inactive.
  376. $active.removeClass('active');
  377. $content.hide();
  378. // Update the variables with the new link and content
  379. $active = $(this);
  380. $content = $(this.hash);
  381. $links = $this.find('li.tab a');
  382. // Make the tab active.
  383. $active.addClass('active');
  384. var $prev_index = $index;
  385. $index = $links.index($(this));
  386. if ($index < 0) {
  387. $index = 0;
  388. }
  389. // Change url to current tab
  390. // window.location.hash = $active.attr('href');
  391. $content.show();
  392. // Update indicator
  393. if (($index - $prev_index) >= 0) {
  394. $indicator.velocity({ "right": $tabs_width - (($index + 1) * $tab_width) }, { duration: 300, queue: false, easing: 'easeOutQuad' });
  395. $indicator.velocity({ "left": $index * $tab_width }, { duration: 300, queue: false, easing: 'easeOutQuad', delay: 90 });
  396. }
  397. else {
  398. $indicator.velocity({ "left": $index * $tab_width }, { duration: 300, queue: false, easing: 'easeOutQuad' });
  399. $indicator.velocity({ "right": $tabs_width - (($index + 1) * $tab_width) }, { duration: 300, queue: false, easing: 'easeOutQuad', delay: 90 });
  400. }
  401. // Prevent the anchor's default click action
  402. e.preventDefault();
  403. });
  404. });
  405. },
  406. select_tab: function (id) {
  407. this.find('a[href="#' + id + '"]').trigger('click');
  408. }
  409. };
  410. $.fn.tabs = function (methodOrOptions) {
  411. if (methods[methodOrOptions]) {
  412. return methods[methodOrOptions].apply(this, Array.prototype.slice.call(arguments, 1));
  413. } else if (typeof methodOrOptions === 'object' || !methodOrOptions) {
  414. // Default to "init"
  415. return methods.init.apply(this, arguments);
  416. } else {
  417. $.error('Method ' + methodOrOptions + ' does not exist on jQuery.tooltip');
  418. }
  419. };
  420. //$(document).ready(function () {
  421. // $('ul.tabs').tabs();
  422. //});