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

1 line
9.3 KiB
Plaintext

11 months ago
(function(a,c,b){if(typeof define==="function"&&define.amd){define(["jquery"],function(d){b(d,a,c);return d.mobile})}else{b(a.jQuery,a,c)}}(this,document,function(c,b,a,d){(function(e,f){e.extend(e.support,{orientation:"orientation" in b&&"onorientationchange" in b})}(c));(function(i){i.event.special.throttledresize={setup:function(){i(this).bind("resize",g)},teardown:function(){i(this).unbind("resize",g)}};var h=250,g=function(){k=(new Date()).getTime();j=k-f;if(j>=h){f=k;i(this).trigger("throttledresize")}else{if(e){clearTimeout(e)}e=setTimeout(g,h-j)}},f=0,e,k,j})(c);(function(j,o){var m=j(o),l="orientationchange",f,k,g,p,n={"0":true,"180":true},i,e,h;if(j.support.orientation){i=o.innerWidth||m.width();e=o.innerHeight||m.height();h=50;g=i>e&&(i-e)>h;p=n[o.orientation];if((g&&p)||(!g&&!p)){n={"-90":true,"90":true}}}j.event.special.orientationchange=j.extend({},j.event.special.orientationchange,{setup:function(){if(j.support.orientation&&!j.event.special.orientationchange.disabled){return false}k=f();m.bind("throttledresize",q)},teardown:function(){if(j.support.orientation&&!j.event.special.orientationchange.disabled){return false}m.unbind("throttledresize",q)},add:function(r){var s=r.handler;r.handler=function(t){t.orientation=f();return s.apply(this,arguments)}}});function q(){var r=f();if(r!==k){k=r;m.trigger(l)}}j.event.special.orientationchange.orientation=f=function(){var s=true,r=a.documentElement;if(j.support.orientation){s=n[o.orientation]}else{s=r&&r.clientWidth/r.clientHeight<1.1}return s?"portrait":"landscape"};j.fn[l]=function(r){return r?this.bind(l,r):this.trigger(l)};if(j.attrFn){j.attrFn[l]=true}}(c,this));(function(B,K,j,q){var J="virtualMouseBindings",f="virtualTouchID",e="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),A="clientX clientY pageX pageY screenX screenY".split(" "),G=B.event.mouseHooks?B.event.mouseHooks.props:[],C=B.event.props.concat(G),E={},L=0,w=0,v=0,t=false,O=[],l=false,V=false,y="addEventListener" in j,x=B(j),I=1,R=0,g,P;B.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};function u(i){while(i&&typeof i.originalEvent!=="undefined"){i=i.originalEvent}return i}function m(X,Y){var ag=X.type,ah,af,Z,W,ad,ac,ab,aa,ae;X=B.Event(X);X.type=Y;ah=X.originalEvent;af=B.event.props;if(ag.search(/^(mouse|click)/)>-1){af=C}if(ah){for(ab=af.length,W;ab;){W=af[--ab];X[W]=ah[W]}}if(ag.search(/mouse(down|up)|click/)>-1&&!X.which){X.which=1}if(ag.search(/^touch/)!==-1){Z=u(ah);ag=Z.touches;ad=Z.changedTouches;ac=(ag&&ag.length)?ag[0]:((ad&&ad.length)?ad[0]:q);if(ac){for(aa=0,ae=A.length;aa<ae;aa++){W=A[aa];X[W]=ac[W]}}}return X}function T(Y){var W={},i,X;while(Y){i=B.data(Y,J);for(X in i){if(i[X]){W[X]=W.hasVirtualBinding=true}}Y=Y.parentNode}return W}function F(X,W){var i;while(X){i=B.data(X,J);if(i&&(!W||i[W])){return X}X=X.parentNode}return null}function N(){V=false}function o(){V=true}function U(){R=0;O.length=0;l=false;o()}function s(){N()}function z(){D();L=setTimeout(function(){L=0;U()},B.vmouse.resetTimerDuration)}function D(){if(L){clearTimeout(L);L=0}}function r(X,Y,i){var W;if((i&&i[X])||(!i&&F(Y.target,X))){W=m(Y,X);B(Y.target).trigger(W)}return W}function n(W){var X=B.data(W.target,f),i;if(!l&&(!R||R!==X)){i=r("v"+W.type,W);if(i){if(i.isDefaultPrevented()){W.preventDefault()}if(i.isPropagationStopped()){W.stopPropagation()}if(i.isImmediatePropagationStopped()){W.stopImmediatePropagation()}}}}function S(X){var Z=u(X).touches,Y,i,W;if(Z&&Z.length===1){Y=X.target;i=T(Y);if(i.hasVirtualBinding){R=I++;B.data(Y,f,R);D();s();t=false;W=u(X).touches[0];w=W.pageX;v=W.pageY;r("vmouseover",X,i);r("vmousedown",X,i)}}}function M(i){if(V){return}if(!t){r("vmousecancel",i,T(i.target))}t=true;z()}function h(Z){if(V){return}var X=u(Z).touches[0],W=t,Y=B.vmouse.moveDistanceThreshold,i=T(Z.target);t=t||(Math.abs(X.pageX-w)>Y||Math.abs(X.pageY-v)>Y);if(t&&!W){r("vmousecancel",Z,i)}r("vmousemove",Z,i);z()}function k(Y){if(V){return}o();var i=T(Y.target),W,X;r("vmouseup",Y,i);if(!t){W=r("vclick",Y,i);if(W&&W.isDefaultPrevented()){X=u(Y).chan