|
|
; (function (window) { 'use strict';
var Waves = Waves || {}; var $$ = document.querySelectorAll.bind(document);
// Find exact position of element
function isWindow(obj) { return obj !== null && obj === obj.window; }
function getWindow(elem) { return isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView; }
function offset(elem) { var docElem, win, box = { top: 0, left: 0 }, doc = elem && elem.ownerDocument;
docElem = doc.documentElement;
if (typeof elem.getBoundingClientRect !== typeof undefined) { box = elem.getBoundingClientRect(); } win = getWindow(doc); return { top: box.top + win.pageYOffset - docElem.clientTop, left: box.left + win.pageXOffset - docElem.clientLeft }; }
function convertStyle(obj) { var style = '';
for (var a in obj) { if (obj.hasOwnProperty(a)) { style += (a + ':' + obj[a] + ';'); } }
return style; }
var Effect = { // Effect delay
duration: 750,
show: function (e, element) { // Disable right click
if (e.button === 2) { return false; }
var el = element || this;
// Create ripple
var ripple = document.createElement('div'); ripple.className = 'waves-ripple'; el.appendChild(ripple);
// Get click coordinate and element witdh
var pos = offset(el); var relativeY = (e.pageY - pos.top); var relativeX = (e.pageX - pos.left); var scale = 'scale(' + ((el.clientWidth / 100) * 10) + ')';
// Support for touch devices
if ('touches' in e) { relativeY = (e.touches[0].pageY - pos.top); relativeX = (e.touches[0].pageX - pos.left); }
// Attach data to element
ripple.setAttribute('data-hold', Date.now()); ripple.setAttribute('data-scale', scale); ripple.setAttribute('data-x', relativeX); ripple.setAttribute('data-y', relativeY);
// Set ripple position
var rippleStyle = { 'top': relativeY + 'px', 'left': relativeX + 'px' };
ripple.className = ripple.className + ' waves-notransition'; ripple.setAttribute('style', convertStyle(rippleStyle)); ripple.className = ripple.className.replace('waves-notransition', '');
// Scale the ripple
rippleStyle['-webkit-transform'] = scale; rippleStyle['-moz-transform'] = scale; rippleStyle['-ms-transform'] = scale; rippleStyle['-o-transform'] = scale; rippleStyle.transform = scale; rippleStyle.opacity = '1';
rippleStyle['-webkit-transition-duration'] = Effect.duration + 'ms'; rippleStyle['-moz-transition-duration'] = Effect.duration + 'ms'; rippleStyle['-o-transition-duration'] = Effect.duration + 'ms'; rippleStyle['transition-duration'] = Effect.duration + 'ms';
rippleStyle['-webkit-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)'; rippleStyle['-moz-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)'; rippleStyle['-o-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)'; rippleStyle['transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
ripple.setAttribute('style', convertStyle(rippleStyle)); },
hide: function (e) { TouchHandler.touchup(e);
var el = this; var width = el.clientWidth * 1.4;
// Get first ripple
var ripple = null; var ripples = el.getElementsByClassName('waves-ripple'); if (ripples.length > 0) { ripple = ripples[ripples.length - 1]; } else { return false; }
var relativeX = ripple.getAttribute('data-x'); var relativeY = ripple.getAttribute('data-y'); var scale = ripple.getAttribute('data-scale');
// Get delay beetween mousedown and mouse leave
var diff = Date.now() - Number(ripple.getAttribute('data-hold')); var delay = 350 - diff;
if (delay < 0) { delay = 0; }
// Fade out ripple after delay
setTimeout(function () { var style = { 'top': relativeY + 'px', 'left': relativeX + 'px', 'opacity': '0',
// Duration
'-webkit-transition-duration': Effect.duration + 'ms', '-moz-transition-duration': Effect.duration + 'ms', '-o-transition-duration': Effect.duration + 'ms', 'transition-duration': Effect.duration + 'ms', '-webkit-transform': scale, '-moz-transform': scale, '-ms-transform': scale, '-o-transform': scale, 'transform': scale, };
ripple.setAttribute('style', convertStyle(style));
setTimeout(function () { try { el.removeChild(ripple); } catch (e) { return false; } }, Effect.duration); }, delay); },
// Little hack to make <input> can perform waves effect
wrapInput: function (elements) { for (var a = 0; a < elements.length; a++) { var el = elements[a];
if (el.tagName.toLowerCase() === 'input') { var parent = el.parentNode;
// If input already have parent just pass through
if (parent.tagName.toLowerCase() === 'i' && parent.className.indexOf('waves-effect') !== -1) { continue; }
// Put element class and style to the specified parent
var wrapper = document.createElement('i'); wrapper.className = el.className + ' waves-input-wrapper';
var elementStyle = el.getAttribute('style');
if (!elementStyle) { elementStyle = ''; }
wrapper.setAttribute('style', elementStyle);
el.className = 'waves-button-input'; el.removeAttribute('style');
// Put element as child
parent.replaceChild(wrapper, el); wrapper.appendChild(el); } } } };
/** * Disable mousedown event for 500ms during and after touch */ var TouchHandler = { /* uses an integer rather than bool so there's no issues with * needing to clear timeouts if another touch event occurred * within the 500ms. Cannot mouseup between touchstart and * touchend, nor in the 500ms after touchend. */ touches: 0, allowEvent: function (e) { var allow = true;
if (e.type === 'touchstart') { TouchHandler.touches += 1; //push
} else if (e.type === 'touchend' || e.type === 'touchcancel') { setTimeout(function () { if (TouchHandler.touches > 0) { TouchHandler.touches -= 1; //pop after 500ms
} }, 500); } else if (e.type === 'mousedown' && TouchHandler.touches > 0) { allow = false; }
return allow; }, touchup: function (e) { TouchHandler.allowEvent(e); } };
/** * Delegated click handler for .waves-effect element. * returns null when .waves-effect element not in "click tree" */ function getWavesEffectElement(e) { if (TouchHandler.allowEvent(e) === false) { return null; }
var element = null; var target = e.target || e.srcElement;
while (target.parentElement !== null) { if (!(target instanceof SVGElement) && target.className.indexOf('waves-effect') !== -1) { element = target; break; } else if (target.classList.contains('waves-effect')) { element = target; break; } target = target.parentElement; }
return element; }
/** * Bubble the click and show effect if .waves-effect elem was found */ function showEffect(e) { var element = getWavesEffectElement(e);
if (element !== null) { Effect.show(e, element);
if ('ontouchstart' in window) { element.addEventListener('touchend', Effect.hide, false); element.addEventListener('touchcancel', Effect.hide, false); }
element.addEventListener('mouseup', Effect.hide, false); element.addEventListener('mouseleave', Effect.hide, false); } }
Waves.displayEffect = function (options) { options = options || {};
if ('duration' in options) { Effect.duration = options.duration; }
//Wrap input inside <i> tag
Effect.wrapInput($$('.waves-effect'));
if ('ontouchstart' in window) { document.body.addEventListener('touchstart', showEffect, false); }
document.body.addEventListener('mousedown', showEffect, false); };
/** * Attach Waves to an input element (or any element which doesn't * bubble mouseup/mousedown events). * Intended to be used with dynamically loaded forms/inputs, or * where the user doesn't want a delegated click handler. */ Waves.attach = function (element) { //FUTURE: automatically add waves classes and allow users
// to specify them with an options param? Eg. light/classic/button
if (element.tagName.toLowerCase() === 'input') { Effect.wrapInput([element]); element = element.parentElement; }
if ('ontouchstart' in window) { element.addEventListener('touchstart', showEffect, false); }
element.addEventListener('mousedown', showEffect, false); };
window.Waves = Waves;
document.addEventListener('DOMContentLoaded', function () { Waves.displayEffect(); }, false); })(window);
/* Tabs */ /*! VelocityJS.org (1.2.2). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */ /*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */ !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 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) 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 ? (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 }), 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.point if (typeof define === 'function' && define.amd) { define(['jquery', 'hammerjs'], factory); } else if (typeof exports === 'object') { factory(require('jquery'), require('hammerjs')); } else { factory(jQuery, Hammer); } }(function ($, Hammer) { function hammerify(el, options) { var $el = $(el); if (!$el.data("hammer")) { $el.data("hammer", new Hammer($el[0], options)); } }
$.fn.hammer = function (options) { return this.each(function () { hammerify(this, options); }); };
// extend the emit method to also trigger jQuery events
Hammer.Manager.prototype.emit = (function (originalEmit) { return function (type, data) { originalEmit.call(this, type, data); $(this.element).trigger({ type: type, gesture: data }); }; })(Hammer.Manager.prototype.emit); }));
var methods = { init: function () { return this.each(function () { // For each set of tabs, we want to keep track of
// which tab is active and its associated content
var $this = $(this), window_width = $(window).width();
$this.width('100%'); // Set Tab Width for each tab
var $num_tabs = $(this).children('li').length; $this.children('li').each(function () { $(this).width((100 / $num_tabs) + '%'); }); var $active, $content, $links = $this.find('li.tab a'), $tabs_width = $this.width(), $tab_width = $this.find('li').first().outerWidth(), $index = 0;
// If the location.hash matches one of the links, use that as the active tab.
$active = $($links.filter('[href="' + location.hash + '"]'));
// If no match is found, use the first link or any with class 'active' as the initial active tab.
if ($active.length === 0) { $active = $(this).find('li.tab a.active').first(); } if ($active.length === 0) { $active = $(this).find('li.tab a').first(); }
$active.addClass('active'); $index = $links.index($active); if ($index < 0) { $index = 0; }
$content = $($active[0].hash);
// append indicator then set indicator width to tab width
$this.append('<div class="indicator"></div>'); var $indicator = $this.find('.indicator'); if ($this.is(":visible")) { $indicator.css({ "right": $tabs_width - (($index + 1) * $tab_width) }); $indicator.css({ "left": $index * $tab_width }); } $(window).resize(function () { $tabs_width = $this.width(); $tab_width = $this.find('li').first().outerWidth(); if ($index < 0) { $index = 0; } if ($tab_width !== 0 && $tabs_width !== 0) { $indicator.css({ "right": $tabs_width - (($index + 1) * $tab_width) }); $indicator.css({ "left": $index * $tab_width }); } });
// Hide the remaining content
$links.not($active).each(function () { $(this.hash).hide(); });
// Bind the click event handler
$this.on('click', 'a', function (e) { $tabs_width = $this.width(); $tab_width = $this.find('li').first().outerWidth();
// Make the old tab inactive.
$active.removeClass('active'); $content.hide();
// Update the variables with the new link and content
$active = $(this); $content = $(this.hash); $links = $this.find('li.tab a');
// Make the tab active.
$active.addClass('active'); var $prev_index = $index; $index = $links.index($(this)); if ($index < 0) { $index = 0; } // Change url to current tab
// window.location.hash = $active.attr('href');
$content.show();
// Update indicator
if (($index - $prev_index) >= 0) { $indicator.velocity({ "right": $tabs_width - (($index + 1) * $tab_width) }, { duration: 300, queue: false, easing: 'easeOutQuad' }); $indicator.velocity({ "left": $index * $tab_width }, { duration: 300, queue: false, easing: 'easeOutQuad', delay: 90 }); } else { $indicator.velocity({ "left": $index * $tab_width }, { duration: 300, queue: false, easing: 'easeOutQuad' }); $indicator.velocity({ "right": $tabs_width - (($index + 1) * $tab_width) }, { duration: 300, queue: false, easing: 'easeOutQuad', delay: 90 }); }
// Prevent the anchor's default click action
e.preventDefault(); }); }); }, select_tab: function (id) { this.find('a[href="#' + id + '"]').trigger('click'); } };
$.fn.tabs = function (methodOrOptions) { if (methods[methodOrOptions]) { return methods[methodOrOptions].apply(this, Array.prototype.slice.call(arguments, 1)); } else if (typeof methodOrOptions === 'object' || !methodOrOptions) { // Default to "init"
return methods.init.apply(this, arguments); } else { $.error('Method ' + methodOrOptions + ' does not exist on jQuery.tooltip'); } };
//$(document).ready(function () {
// $('ul.tabs').tabs();
//});
|