From 0b70fac4488041f7fffaf603d285f4c361a2a4c2 Mon Sep 17 00:00:00 2001 From: Richard Pinedo Date: Fri, 16 Oct 2015 13:22:05 -0400 Subject: [PATCH] possible fix for issue #268 --- www/index.html | 2 +- www/js/app.js | 181 ++++++++++++-------------- www/js/dependencies/hammer.js | 7 - www/js/dependencies/quo.standalone.js | 8 ++ 4 files changed, 95 insertions(+), 103 deletions(-) delete mode 100644 www/js/dependencies/hammer.js create mode 100644 www/js/dependencies/quo.standalone.js diff --git a/www/index.html b/www/index.html index 5c085a1c4..cc66a133c 100644 --- a/www/index.html +++ b/www/index.html @@ -47,7 +47,7 @@ - + diff --git a/www/js/app.js b/www/js/app.js index 6c48a02ae..fd7456ac4 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -209,24 +209,22 @@ window.ko.bindingHandlers.logger = { window.ko.bindingHandlers.scrollToView = { init: function(element, valueAccessor, allBindings, viewModel, bindingContext) { - Hammer(element, { - time: 2000 - }) - .on("tap", function() { - var index = $(element).index('.mobile-characters-image'), - distance = $(".profile:eq(" + index + ")"); - if (distance.length > 0) { - distance = distance.position().top - 50; - app.scrollTo(distance); - } - }) - .on("press", function() { - $.toaster({ - priority: 'info', - title: 'Info', - message: app.activeText().this_icon + viewModel.uniqueName() - }); - }); + var elem = $$(element) + elem.on("touch", function() { + var index = $(element).index('.mobile-characters-image'), + distance = $(".profile:eq(" + index + ")"); + if (distance.length > 0) { + distance = distance.position().top - 50; + app.scrollTo(distance); + } + }); + elem.on("hold", function() { + $.toaster({ + priority: 'info', + title: 'Info', + message: app.activeText().this_icon + viewModel.uniqueName() + }); + }); } }; @@ -239,75 +237,72 @@ window.ko.bindingHandlers.fastclick = { ko.bindingHandlers.moveItem = { init: function(element, valueAccessor, allBindings, viewModel, bindingContext) { - Hammer(element, { - time: 2000 - }) - .on("tap", function(ev) { - tgd.localLog("item.tap"); - var target = tgd.getEventDelegate(ev.target, ".itemLink"); - if (target) { - var item = ko.contextFor(target).$data; - tgd.moveItemPositionHandler(target, item); - } - }) - .on("doubletap", function(ev) { - tgd.localLog("item.doubletap"); - var target = tgd.getEventDelegate(ev.target, ".itemLink"); - if (target) { - var context = ko.contextFor(target); - if (context && "$data" in context) { - var item = context.$data; - if (item.transferStatus < 2) { - if (app.dynamicMode() === false) { - app.dynamicMode(true); - app.createLoadout(); - } - tgd.localLog("double tap"); - if (item._id > 0) { - app.activeLoadout().addUniqueItem({ - id: item._id, - bucketType: item.bucketType, - doEquip: false - }); - } else { - app.activeLoadout().addGenericItem({ - hash: item.id, - bucketType: item.bucketType, - primaryStat: item.primaryStat() - }); - } - } else { - $.toaster({ - priority: 'danger', - title: 'Warning', - message: app.activeText().unable_create_loadout_for_type - }); - } - } - } - }) - // press is actually hold - .on("press", function(ev) { - tgd.localLog("item.press"); - var target = tgd.getEventDelegate(ev.target, ".itemLink"); - if (target) { - var context = ko.contextFor(target); - if (context && "$data" in context) { - var item = context.$data; - if (item && item.doEquip && app.loadoutMode() === true) { - item.doEquip(!item.doEquip()); - item.markAsEquip(item, { - target: target - }); - } else if (!isMobile) { - tgd.moveItemPositionHandler(target, item); - } else { - $ZamTooltips.lastElement = target; - $ZamTooltips.show("destinydb", "items", item.id, target); - } - } - } - }); + var elem = $$(element); + elem.on("touch", function(ev) { + tgd.localLog("item.tap"); + var target = tgd.getEventDelegate(ev.target, ".itemLink"); + if (target) { + var item = ko.contextFor(target).$data; + tgd.moveItemPositionHandler(target, item); + } + }); + elem.on("doubleTap", function(ev) { + tgd.localLog("item.doubletap"); + var target = tgd.getEventDelegate(ev.target, ".itemLink"); + if (target) { + var context = ko.contextFor(target); + if (context && "$data" in context) { + var item = context.$data; + if (item.transferStatus < 2) { + if (app.dynamicMode() === false) { + app.dynamicMode(true); + app.createLoadout(); + } + tgd.localLog("double tap"); + if (item._id > 0) { + app.activeLoadout().addUniqueItem({ + id: item._id, + bucketType: item.bucketType, + doEquip: false + }); + } else { + app.activeLoadout().addGenericItem({ + hash: item.id, + bucketType: item.bucketType, + primaryStat: item.primaryStat() + }); + } + } else { + $.toaster({ + priority: 'danger', + title: 'Warning', + message: app.activeText().unable_create_loadout_for_type + }); + } + } + } + }) + elem.on("hold", function(ev) { + tgd.localLog("item.press"); + var target = tgd.getEventDelegate(ev.target, ".itemLink"); + if (target) { + var context = ko.contextFor(target); + if (context && "$data" in context) { + var item = context.$data; + if (item && item.doEquip && app.loadoutMode() === true) { + item.doEquip(!item.doEquip()); + item.markAsEquip(item, { + target: target + }); + } else if (!isMobile) { + tgd.moveItemPositionHandler(target, item); + } else { + $ZamTooltips.lastElement = target; + $ZamTooltips.show("destinydb", "items", item.id, target); + } + } + } + }); } }; @@ -1933,14 +1928,10 @@ var app = function() { } if (isMobile) { - Hammer(document.getElementById('charactersContainer'), { - drag_min_distance: 1, - swipe_velocity: 0.1, - drag_horizontal: true, - drag_vertical: false - }).on("swipeleft", self.shiftViewLeft) - .on("swiperight", self.shiftViewRight) - .on("tap", self.globalClickHandler); + var cContainer = $$(document.getElementById('charactersContainer')) + cContainer.on("swipeLeft", self.shiftViewLeft) + cContainer.on("swipeRight", self.shiftViewRight) + cContainer.on("touch", self.globalClickHandler); if (window.device && device.platform === "iOS" && device.version >= 7.0) { StatusBar.overlaysWebView(false); diff --git a/www/js/dependencies/hammer.js b/www/js/dependencies/hammer.js deleted file mode 100644 index 2071fb1f0..000000000 --- a/www/js/dependencies/hammer.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! Hammer.JS - v2.0.4 - 2014-09-28 - * http://hammerjs.github.io/ - * - * Copyright (c) 2014 Jorik Tangelder; - * Licensed under the MIT license */ -!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(k(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e-1}function r(a){return a.trim().split(/\s+/g)}function s(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;dc[b]}):d.sort()),d}function v(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g1&&!c.firstMultiple?c.firstMultiple=E(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=F(d);b.timeStamp=nb(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=J(h,i),b.distance=I(h,i),C(c,b),b.offsetDirection=H(b.deltaX,b.deltaY),b.scale=g?L(g.pointers,d):1,b.rotation=g?K(g.pointers,d):0,D(c,b);var j=a.element;p(b.srcEvent.target,j)&&(j=b.srcEvent.target),b.target=j}function C(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===yb||f.eventType===Ab)&&(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 D(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Bb&&(i>xb||h.velocity===d)){var j=h.deltaX-b.deltaX,k=h.deltaY-b.deltaY,l=G(i,j,k);e=l.x,f=l.y,c=mb(l.x)>mb(l.y)?l.x:l.y,g=H(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function E(a){for(var b=[],c=0;ce;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:lb(c/b),y:lb(d/b)}}function G(a,b,c){return{x:b/a||0,y:c/a||0}}function H(a,b){return a===b?Cb:mb(a)>=mb(b)?a>0?Db:Eb:b>0?Fb:Gb}function I(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function J(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function K(a,b){return J(b[1],b[0],Lb)-J(a[1],a[0],Lb)}function L(a,b){return I(b[0],b[1],Lb)/I(a[0],a[1],Lb)}function M(){this.evEl=Nb,this.evWin=Ob,this.allow=!0,this.pressed=!1,y.apply(this,arguments)}function N(){this.evEl=Rb,this.evWin=Sb,y.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function O(){this.evTarget=Ub,this.evWin=Vb,this.started=!1,y.apply(this,arguments)}function P(a,b){var c=t(a.touches),d=t(a.changedTouches);return b&(Ab|Bb)&&(c=u(c.concat(d),"identifier",!0)),[c,d]}function Q(){this.evTarget=Xb,this.targetIds={},y.apply(this,arguments)}function R(a,b){var c=t(a.touches),d=this.targetIds;if(b&(yb|zb)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=t(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return p(a.target,i)}),b===yb)for(e=0;eh&&(b.push(a),h=b.length-1):e&(Ab|Bb)&&(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 Tb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Ub="touchstart",Vb="touchstart touchmove touchend touchcancel";j(O,y,{handler:function(a){var b=Tb[a.type];if(b===yb&&(this.started=!0),this.started){var c=P.call(this,a,b);b&(Ab|Bb)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}});var Wb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Xb="touchstart touchmove touchend touchcancel";j(Q,y,{handler:function(a){var b=Wb[a.type],c=R.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}),j(S,y,{handler:function(a,b,c){var d=c.pointerType==tb,e=c.pointerType==vb;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Ab|Bb)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Yb=v(jb.style,"touchAction"),Zb=Yb!==d,$b="compute",_b="auto",ac="manipulation",bc="none",cc="pan-x",dc="pan-y";T.prototype={set:function(a){a==$b&&(a=this.compute()),Zb&&(this.manager.element.style[Yb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){l(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),U(a.join(" "))},preventDefaults:function(a){if(!Zb){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=q(d,bc),f=q(d,dc),g=q(d,cc);return e||f&&c&Hb||g&&c&Ib?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var ec=1,fc=2,gc=4,hc=8,ic=hc,jc=16,kc=32;V.prototype={defaults:{},set:function(a){return h(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=Y(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=Y(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=Y(a,this),-1===s(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=Y(a,this);var b=s(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(c.options.event+(b?W(d):""),a)}var c=this,d=this.state;hc>d&&b(!0),b(),d>=hc&&b(!0)},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=kc)},canEmit:function(){for(var a=0;af?Db:Eb,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Cb:0>g?Fb:Gb,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return Z.prototype.attrTest.call(this,a)&&(this.state&fc||!(this.state&fc)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this._super.emit.call(this,a)}}),j(_,Z,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&fc)},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)}}}),j(ab,V,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[_b]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distanceb.time;if(this._input=a,!d||!c||a.eventType&(Ab|Bb)&&!f)this.reset();else if(a.eventType&yb)this.reset(),this._timer=e(function(){this.state=ic,this.tryEmit()},b.time,this);else if(a.eventType&Ab)return ic;return kc},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===ic&&(a&&a.eventType&Ab?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=nb(),this.manager.emit(this.options.event,this._input)))}}),j(bb,Z,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&fc)}}),j(cb,Z,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:Hb|Ib,pointers:1},getTouchAction:function(){return $.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Hb|Ib)?b=a.velocity:c&Hb?b=a.velocityX:c&Ib&&(b=a.velocityY),this._super.attrTest.call(this,a)&&c&a.direction&&a.distance>this.options.threshold&&mb(b)>this.options.velocity&&a.eventType&Ab},emit:function(a){var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),j(db,V,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[ac]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distancen;n++)if(n in this&&this[n]===t)return n;return-1};t=function(){var t,n,e,r,i,u,o,a,c,l,s,f,h,d,p,v,g;return r=[],a=Object.prototype,o=/^\s*<(\w+|!)[^>]*>/,e=[1,9,11],n=/^\.([\w-]+)$/,u=/^#[\w\d-]+$/,s=/^[\w-]+$/,c=document.createElement("table"),l=document.createElement("tr"),i={tr:document.createElement("tbody"),tbody:c,thead:c,tfoot:c,td:l,th:l,"*":document.createElement("div")},t=function(n,e){var r;return n?"function"===t.toType(n)?t(document).ready(n):(r=p(n,e),v(r,n)):v()},t.query=function(t,e){var r;return n.test(e)?r=t.getElementsByClassName(e.replace(".","")):s.test(e)?r=t.getElementsByTagName(e):u.test(e)&&t===document?(r=t.getElementById(e.replace("#","")),r||(r=[])):r=t.querySelectorAll(e),r.nodeType?[r]:Array.prototype.slice.call(r)},t.extend=function(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){var e,r;r=[];for(e in n)r.push(t[e]=n[e]);return r}),t},t.toType=function(t){return a.toString.call(t).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()},t.each=function(n,e){var r,i,u,o,a;if(i=void 0,u=void 0,"array"===t.toType(n))for(i=o=0,a=n.length;a>o;i=++o)r=n[i],e.call(r,i,r)===!1;else for(u in n)e.call(n[u],u,n[u])===!1;return n},t.map=function(n,e){var r,i,u,o;if(o=[],r=void 0,i=void 0,"array"===t.toType(n))for(r=0;rt;){n=arguments[t];for(i in n)g(n,i)&&void 0!==n[i]&&(e[i]=n[i]);t++}return e},v=function(t,n){return null==n&&(n=""),t=t||r,t.selector=n,t.__proto__=v.prototype,t},p=function(n,r){var i,u;return i=null,u=t.toType(n),"array"===u?i=f(n):"string"===u&&o.test(n)?(i=d(n.trim(),RegExp.$1),n=null):"string"===u?(i=t.query(document,n),r&&(i=1===i.length?t.query(i[0],r):t.map(function(){return t.query(i,r)}))):(e.indexOf(n.nodeType)>=0||n===window)&&(i=[n],n=null),i},d=function(n,e){var r;return null==e&&(e="*"),e in i||(e="*"),r=i[e],r.innerHTML=""+n,t.each(Array.prototype.slice.call(r.childNodes),function(){return r.removeChild(this)})},f=function(t){return t.filter(function(t){return null!=t?t:void 0})},h=function(t){return t.length>0?r.concat.apply(r,t):t},g=function(t,n){return a.hasOwnProperty.call(t,n)},v.prototype=t.fn={},t.fn.each=function(t){return this.forEach(function(n,e){return t.call(n,e,n)}),this},t.fn.filter=function(n){return t(r.filter.call(this,function(e){return e.parentNode&&t.query(e.parentNode,n).indexOf(e)>=0}))},t.fn.forEach=r.forEach,t.fn.indexOf=r.indexOf,t.version="3.0.6",t}(),this.Quo=this.$$=t,function(t){var n,e,r,i,u,o,a,c,l,s,f,h;return n={TYPE:"GET",MIME:"json"},r={script:"text/javascript, application/javascript",json:"application/json",xml:"application/xml, text/xml",html:"text/html",text:"text/plain"},e=0,t.ajaxSettings={type:n.TYPE,async:!0,success:{},error:{},context:null,dataType:n.MIME,headers:{},xhr:function(){return new window.XMLHttpRequest},crossDomain:!1,timeout:0},t.ajax=function(e){var r,o,c,f;if(c=t.mix(t.ajaxSettings,e),c.type===n.TYPE?c.url+=t.serialize(c.data,"?"):c.data=t.serialize(c.data),i(c.url))return u(c);f=c.xhr(),f.onreadystatechange=function(){return 4===f.readyState?(clearTimeout(r),s(f,c)):void 0},f.open(c.type,c.url,c.async),l(f,c),c.timeout>0&&(r=setTimeout(function(){return h(f,c)},c.timeout));try{f.send(c.data)}catch(d){o=d,f=o,a("Resource not found",f,c)}return f},t.get=function(n,e,r,i){return t.ajax({url:n,data:e,success:r,dataType:i})},t.post=function(t,n,e,r){return c("POST",t,n,e,r)},t.put=function(t,n,e,r){return c("PUT",t,n,e,r)},t["delete"]=function(t,n,e,r){return c("DELETE",t,n,e,r)},t.json=function(n,e,r){return t.ajax({url:n,data:e,success:r})},t.serialize=function(t,n){var e,r;null==n&&(n=""),r=n;for(e in t)t.hasOwnProperty(e)&&(r!==n&&(r+="&"),r+=""+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));return r===n?"":r},u=function(n){var r,i,u,o;return n.async?(i="jsonp"+ ++e,u=document.createElement("script"),o={abort:function(){return t(u).remove(),i in window?window[i]={}:void 0}},r=void 0,window[i]=function(e){return clearTimeout(r),t(u).remove(),delete window[i],f(e,o,n)},u.src=n.url.replace(RegExp("=\\?"),"="+i),t("head").append(u),n.timeout>0&&(r=setTimeout(function(){return h(o,n)},n.timeout)),o):console.error("QuoJS.ajax: Unable to make jsonp synchronous call.")},s=function(t,n){t.status>=200&&t.status<300||0===t.status?n.async&&f(o(t,n),t,n):a("QuoJS.ajax: Unsuccesful request",t,n)},f=function(t,n,e){e.success.call(e.context,t,n)},a=function(t,n,e){e.error.call(e.context,t,n,e)},l=function(t,n){var e;n.contentType&&(n.headers["Content-Type"]=n.contentType),n.dataType&&(n.headers.Accept=r[n.dataType]);for(e in n.headers)t.setRequestHeader(e,n.headers[e])},h=function(t,n){t.onreadystatechange={},t.abort(),a("QuoJS.ajax: Timeout exceeded",t,n)},c=function(n,e,r,i,u){return t.ajax({type:n,url:e,data:r,success:i,dataType:u,contentType:"application/x-www-form-urlencoded"})},i=function(t){return RegExp("=\\?").test(t)},o=function(t,e){var r,i;if(i=t,t.responseText){if(e.dataType===n.MIME)try{i=JSON.parse(t.responseText)}catch(u){r=u,i=r,a("QuoJS.ajax: Parse Error",t,e)}"xml"===e.dataType&&(i=t.responseXML)}return i}}(t),function(t){var n,e;return n=["-webkit-","-moz-","-ms-","-o-",""],t.fn.addClass=function(t){return this.each(function(){return this.classList.add(t)})},t.fn.removeClass=function(t){return this.each(function(){return this.classList.remove(t)})},t.fn.toggleClass=function(t){return this.each(function(){var n;return n=this.classList.contains(t)?"remove":"add",this.classList[n](t)})},t.fn.hasClass=function(t){return this.length>0&&this[0].classList.contains(t)},t.fn.listClass=function(){return this.length>0?this[0].classList:void 0},t.fn.style=t.fn.css=function(t,n){var r;return null!=n?this.each(function(){return this.style[t]=n}):(r=this[0],r.style[t]||e(r,t))},t.fn.vendor=function(t,e){var r,i,u,o;for(o=[],i=0,u=n.length;u>i;i++)r=n[i],o.push(this.style(""+r+t,e));return o},e=function(t,n){return document.defaultView.getComputedStyle(t,"")[n]}}(t),function(t){return t.fn.attr=function(n,e){return this.length>0&&"string"===t.toType(n)?null!=e?this.each(function(){return this.setAttribute(n,e)}):this[0].getAttribute(n):void 0},t.fn.removeAttr=function(n){return this.length>0&&"string"===t.toType(n)?this.each(function(){return this.removeAttribute(n)}):void 0},t.fn.data=function(t,n){return this.attr("data-"+t,n)},t.fn.removeData=function(t){return this.removeAttr("data-"+t)},t.fn.val=function(t){return null!=t?this.each(function(){return this.value=t.toString()}):this.length>0?this[0].value:null},t.fn.show=function(){return this.style("display","block")},t.fn.hide=function(){return this.style("display","none")},t.fn.focus=function(){return this[0].focus()},t.fn.blur=function(){return this[0].blur()},t.fn.offset=function(){var t,n;return this.length>0&&(t=this[0].getBoundingClientRect(),n={left:t.left+window.pageXOffset,top:t.top+window.pageYOffset,width:t.width,height:t.height}),n}}(t),function(t){var n,e,r,i,u,o;return r=null,n=/WebKit\/([\d.]+)/,e={Android:/(Android)\s+([\d.]+)/,ipad:/(iPad).*OS\s([\d_]+)/,iphone:/(iPhone\sOS)\s([\d_]+)/,Blackberry:/(BlackBerry|BB10|Playbook).*Version\/([\d.]+)/,FirefoxOS:/(Mozilla).*Mobile[^\/]*\/([\d\.]*)/,webOS:/(webOS|hpwOS)[\s\/]([\d.]+)/},t.isMobile=function(){return this.environment(),r.isMobile},t.environment=function(){var t,n;return r||(n=navigator.userAgent,t=u(n),r={browser:i(n),isMobile:!!t,screen:o(),os:t}),r},i=function(t){var e;return e=t.match(n),e?e[0]:t},u=function(t){var n,r,i;for(r in e)if(i=t.match(e[r])){n={name:"iphone"===r||"ipad"===r||"ipod"===r?"ios":r,version:i[2].replace("_",".")};break}return n},o=function(){return{width:window.innerWidth,height:window.innerHeight}}}(t),function(t){var n,e,r,i,u,o,a,c,l,s,f,h,d;return n=1,i={},r={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"},e={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",touch:"click",orientationchange:"resize"},u=/complete|loaded|interactive/,t.fn.on=function(n,e,r){return null==e||"function"===t.toType(e)?this.bind(n,e):this.delegate(e,n,r)},t.fn.off=function(n,e,r){return null==e||"function"===t.toType(e)?this.unbind(n,e):this.undelegate(e,n,r)},t.fn.ready=function(n){return u.test(document.readyState)?n.call(this,t):t.fn.addEvent(document,"DOMContentLoaded",function(){return n.call(this,t)})},t.fn.bind=function(t,n){return this.forEach(function(e){return h(e,t,n)})},t.fn.unbind=function(t,n){return this.each(function(){return d(this,t,n)})},t.fn.delegate=function(n,e,r){return this.each(function(i,u){return h(u,e,r,n,function(e){return function(r){var i,a;return a=t(r.target).closest(n,u).get(0),a?(i=t.extend(o(r),{currentTarget:a,liveFired:u}),e.apply(a,[i].concat([].slice.call(arguments,1)))):void 0}})})},t.fn.undelegate=function(t,n,e){return this.each(function(){return d(this,n,e,t)})},t.fn.trigger=function(n,e,r){return"string"===t.toType(n)&&(n=l(n,e)),null!=r&&(n.originalEvent=r),this.each(function(){return this.dispatchEvent(n)})},t.fn.addEvent=function(t,n,e){return t.addEventListener?t.addEventListener(n,e,!1):t.attachEvent?t.attachEvent("on"+n,e):t["on"+n]=e},t.fn.removeEvent=function(t,n,e){return t.removeEventListener?t.removeEventListener(n,e,!1):t.detachEvent?t.detachEvent("on"+n,e):t["on"+n]=null},l=function(t,n){var e;return e=document.createEvent("Events"),e.initEvent(t,!0,!0,null,null,null,null,null,null,null,null,null,null,null,null),n&&(e.touch=n),e},h=function(n,e,r,u,o){var l,s,h,d;return e=c(e),h=f(n),s=i[h]||(i[h]=[]),l=o&&o(r,e),d={event:e,callback:r,selector:u,proxy:a(l,r,n),delegate:l,index:s.length},s.push(d),t.fn.addEvent(n,d.event,d.proxy)},d=function(n,e,r,u){var o;return e=c(e),o=f(n),s(o,e,r,u).forEach(function(e){return delete i[o][e.index],t.fn.removeEvent(n,e.event,e.proxy)})},f=function(t){return t._id||(t._id=n++)},c=function(n){var r;return r=("function"==typeof t.isMobile?t.isMobile():void 0)?n:e[n],r||n},a=function(t,n,e){var r;return n=t||n,r=function(t){var r;return r=n.apply(e,[t].concat(t.data)),r===!1&&t.preventDefault(),r}},s=function(t,n,e,r){return(i[t]||[]).filter(function(t){return!(!t||n&&t.event!==n||e&&t.callback!==e||r&&t.selector!==r)})},o=function(n){var e;return e=t.extend({originalEvent:n},n),t.each(r,function(t,r){return e[t]=function(){return this[r]=function(){return!0},n[t].apply(n,arguments)},e[r]=function(){return!1}}),e}}(t),function(t){return t.fn.text=function(t){return null!=t?this.each(function(){return this.textContent=t}):this.length>0?this[0].textContent:""},t.fn.html=function(n){var e;return null!=n?(e=t.toType(n),this.each(function(){return"string"===e?this.innerHTML=n:"array"===e?n.forEach(function(n){return function(e){return t(n).html(e)}}(this)):this.innerHTML+=t(n).html()})):this.length>0?this[0].innerHTML:""},t.fn.remove=function(){return this.each(function(){return null!=this.parentNode?this.parentNode.removeChild(this):void 0})},t.fn.empty=function(){return this.each(function(){return this.innerHTML=null})},t.fn.append=function(n){var e;return e=t.toType(n),this.each(function(){return"string"===e?this.insertAdjacentHTML("beforeend",n):"array"===e?n.forEach(function(n){return function(e){return t(n).append(e)}}(this)):this.appendChild(n)})},t.fn.prepend=function(n){var e;return e=t.toType(n),this.each(function(){return"string"===e?this.insertAdjacentHTML("afterbegin",n):"array"===e?n.each(function(t){return function(n,e){return t.insertBefore(e,t.firstChild)}}(this)):this.insertBefore(n,this.firstChild)})},t.fn.replaceWith=function(n){var e;return e=t.toType(n),this.each(function(){return this.parentNode?"string"===e?this.insertAdjacentHTML("beforeBegin",n):"array"===e?n.each(function(t){return function(n,e){return t.parentNode.insertBefore(e,t)}}(this)):this.parentNode.insertBefore(n,this):void 0}),this.remove()}}(t),function(n){var e,r,i,u;return e="parentNode",n.fn.find=function(e){var r;return r=1===this.length?t.query(this[0],e):this.map(function(){return t.query(this,e)}),n(r)},n.fn.parent=function(t){var n;return n=t?i(this):this.instance(e),r(n,t)},n.fn.children=function(t){var n;return n=this.map(function(){return Array.prototype.slice.call(this.children)}),r(n,t)},n.fn.siblings=function(t){var n;return n=this.map(function(t,n){return Array.prototype.slice.call(n.parentNode.children).filter(function(t){return t!==n})}),r(n,t)},n.fn.get=function(t){return this[t]||null},n.fn.first=function(){return n(this[0])},n.fn.last=function(){return n(this[this.length-1])},n.fn.closest=function(t,e){var r,i;for(i=this[0],r=n(t),r.length||(i=null);i&&r.indexOf(i)<0;)i=i!==e&&i!==document&&i.parentNode;return n(i)},n.fn.next=function(){return u.call(this,"nextSibling")},n.fn.prev=function(){return u.call(this,"previousSibling")},n.fn.instance=function(t){return this.map(function(){return this[t]})},n.fn.map=function(t){return n.map(this,function(n,e){return t.call(n,e,n)})},i=function(t){var e;for(e=[];t.length>0;)t=n.map(t,function(t){return t=t.parentNode,t!==document&&e.indexOf(t)<0?(e.push(t),t):void 0});return e},r=function(t,e){return null!=e?n(t).filter(e):n(t)},u=function(t){var e;for(e=this[0][t];e&&1!==e.nodeType;)e=e[t];return n(e)}}(t),t.Gestures=function(t){var e,r,i,u,o,a,c,l,s,f,h,d,p,v;return v=!1,f={},c=null,d=null,o=["input","select","textarea"],e=function(t){return f[t.name]=t.handler,i(t.events)},r=function(n,e,r){return t(n).trigger(e,r,d)},p=function(t){var e;return e=(t.srcElement||t.target).tagName.toLowerCase(),n.call(o,e)>=0?t.stopPropagation():(v=!0,d=t||event,c=l(t),s("start",t.target,c))},h=function(t){return v?(d=t||event,c=l(t),c.length>1&&d.preventDefault(),s("move",t.target,c)):void 0},a=function(t){return v?(d=t||event,s("end",t.target,c),v=!1):void 0},u=function(){return v=!1,s("cancel")},i=function(n){return n.forEach(function(n){return t.fn[n]=function(e){return t(document.body).delegate(this.selector,n,e)}}),this},s=function(t,n,e){var r,i,u;u=[];for(i in f)r=f[i],r[t]&&u.push(r[t].call(r,n,e));return u},l=function(t){var n,e,r,i,u;for(i=t.touches||[t],u=[],e=0,r=i.length;r>e;e++)n=i[e],u.push({x:n.pageX,y:n.pageY});return u},t(document).ready(function(){var n;return n=t(document.body),n.bind("touchstart",p),n.bind("touchmove",h),n.bind("touchend",a),n.bind("touchcancel",u)}),{add:e,trigger:r}}(t),t.Gestures.add({name:"basic",events:["touch","hold","doubleTap"],handler:function(t){var n,e,r,i,u,o,a,c,l,s,f,h;return e=15,n={TAP:200,DOUBLE_TAP:400,HOLD:400},c=null,h=!0,f=null,s=null,l=null,o=function(e,i){return 1===i.length?(s={time:new Date,x:i[0].x,y:i[0].y},f=e,c=setTimeout(function(){return t.trigger(e,"hold",i[0])},n.HOLD)):r()},u=function(t,n){var i;return null!==s&&(i=a(s,n[0]),i.x>e||i.y>e||n.length>1)?r():void 0},i=function(e,i){var u,o;if(s)return u=a(s,i[0]),0!==u.x||0!==u.y?r():(clearTimeout(c),o=new Date,o-s.time=2?15:20,h=null,s=null,f=null,l=null,u=function(t,n){return n.length>=2?(h=t,s=n.length,f=o(n)):void 0},i=function(t,n){var e;return n.length===s?(e=a(n),l={touches:n,delta:e},c(!0)):void 0},e=r=function(){return f&&l?(c(!1),s=null,f=null,l=null):void 0},a=function(t){var n;return n=o(t),{x:n.x-f.x,y:n.y-f.y}},o=function(t){var n,e,r,i,u;for(e=0,r=0,i=0,u=t.length;u>i;i++)n=t[i],e+=parseInt(n.x),r+=parseInt(n.y);return{x:e/t.length,y:r/t.length}},c=function(e){return e?t.trigger(h,"dragging",l):Math.abs(l.delta.x)>n||Math.abs(l.delta.y)>n?t.trigger(h,"drag",l):void 0},{start:u,move:i,end:r}}(t.Gestures)}),t.Gestures.add({name:"pinch",events:["pinch","pinching","pinchIn","pinchOut"],handler:function(t){var n,e,r,i,u,o,a,c,l,s;return n=window.devicePixelRatio>=2?15:20,s=null,l=null,c=null,u=function(t,n){return 2===n.length?(s=t,l=a(n[0],n[1])):void 0},i=function(t,n){var e;return l&&2===n.length?(e=a(n[0],n[1]),c={touches:n,delta:e-l},o(!0)):void 0},e=r=function(){return l&&c?(o(!1),l=null,c=null):void 0},a=function(t,n){return Math.sqrt((n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y))},o=function(e){var r;return e?t.trigger(s,"pinching",c):Math.abs(c.delta)>n?(t.trigger(s,"pinch",c),r=c.delta>0?"pinchOut":"pinchIn",t.trigger(s,r,c)):void 0},{start:u,move:i,end:r}}(t.Gestures)}),t.Gestures.add({name:"rotation",events:["rotate","rotating","rotateLeft","rotateRight"],handler:function(t){var n,e,r,i,u,o,a,c,l,s,f,h,d;return n=5,e=20,d=null,l=0,h=null,c=null,o=function(t,n){return 2===n.length?(d=t,l=0,h=s(n[0],n[1])):void 0},u=function(t,n){var r;return h&&2===n.length?(r=s(n[0],n[1])-h,c&&Math.abs(c.delta-r)>e&&(r+=360*f(c.delta)),Math.abs(r)>360&&(l++,r-=360*f(c.delta)),c={touches:n,delta:r,rotationsCount:l},a(!0)):void 0},r=i=function(){return h&&c?(a(!1),d=null,l=0,h=null,c=null,h=null):void 0},f=function(t){return 0>t?-1:1},s=function(t,n){var e;return e=Math.atan2(t.y-n.y,t.x-n.x),180*(0>e?e+2*Math.PI:e)/Math.PI},a=function(e){var r;return e?t.trigger(d,"rotating",c):Math.abs(c.delta)>n?(t.trigger(d,"rotate",c),r=c.delta>0?"rotateRight":"rotateLeft",t.trigger(d,r,c)):void 0},{start:o,move:u,end:i}}(t.Gestures)}),t.Gestures.add({name:"swipe",events:["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","swiping","swipingHorizontal","swipingVertical"],handler:function(t){var n,e,r,i,u,o,a,c,l,s,f;return n=Math.round(20/window.devicePixelRatio),f=null,l=null,s=null,c=null,u=function(t,n){return 1===n.length?(f=t,l=n[0],c=null):void 0},i=function(t,n){var e,r;return 1===n.length?(e={x:n[0].x-l.x,y:n[0].y-l.y},r=null===c,c={x:n[0].x,y:n[0].y,delta:e},o(!0,r)):c=null},e=r=function(t,n){var e;return null==c&&n.length>=1&&(e={x:n[0].x-l.x,y:n[0].y-l.y},c={x:n[0].x,y:n[0].y,delta:e}),c?(o(!1),c=null):void 0},o=function(e,r){var i,u,o,l,h;if(null==r&&(r=!1),e)return r&&(s=a(c.delta.x,c.delta.y)),null!==s&&t.trigger(f,"swiping"+s,c),t.trigger(f,"swiping",c);if(u=[],Math.abs(c.delta.y)>n?u.push(c.delta.y<0?"Up":"Down"):Math.abs(c.delta.x)>n&&u.push(c.delta.x<0?"Left":"Right"),u.length){for(t.trigger(f,"swipe",c),h=[],o=0,l=u.length;l>o;o++)i=u[o],h.push(t.trigger(f,"swipe"+i,c));return h}},a=function(t,n){var e;return e=null,Math.round(Math.abs(t/n))>=2?e="Horizontal":Math.round(Math.abs(n/t))>=2&&(e="Vertical"),e},{start:u,move:i,end:r}}(t.Gestures)})}).call(this); \ No newline at end of file