mopidy-musicbox-webclient/mopidy_musicbox_webclient/static/js/jquery.mobile.iscrollview-closure-min.js
woutervanwijk b39530e882 merged #37
2014-09-19 00:59:45 +02:00

51 lines
26 KiB
JavaScript

(function(d,n,m,e){function o(a){a.preventDefault()}function j(a,b,c){this.iscrollview=a;this._emulateBottomOffset=function(){this.iscrollview.options.emulateBottomOffset&&(this.maxScrollY=this.wrapperH-this.scrollerH+this.minScrollY+this.iscrollview.options.bottomOffset)};this._fixInput=function(a){if(this.iscrollview.options.fixInput){var b;for(b=a.target;1!==b.nodeType;)b=b.parentNode;b=b.tagName.toLowerCase();if("select"===b||"input"===b||"textarea"===b)return}this.iscrollview.options.preventTouchHover?
a.stopImmediatePropagation():a.preventDefault()};this._doCallback=function(a,b,c){var d=this.iscrollview,e=d._logCallback(a,b);c&&c.call(this,b);d._trigger(a.toLowerCase(),b,{iscrollview:d});d._logCallback(a,b,e)};this._bind=function(a,b,c){var e=this.iscrollview.options.bindIscrollUsingJqueryEvents,i=e&&"mouseout"===a?"mouseleave":a;"orientationchange"===a||"resize"===a?this.iscrollview._logIscrollEvent("iScroll bind (ignored)",a):(this.iscrollview._logIscrollEvent("iScroll bind",a),e?(b?d(b):this.iscrollview.$scroller).bind(i,
d.proxy(this.handleEvent,this)):(b||this.scroller).addEventListener(i,this,!!c))};this._unbind=function(a,b,c){var e=this.iscrollview.options.bindIscrollUsingJqueryEvents,i=e&&"mouseout"===a?"mouseleave":a;"orientationchange"===a||"resize"===a?this.iscrollview._logIscrollEvent("iScroll unbind (ignored)"):(this.iscrollview._logIscrollEvent("iScroll unbind",a),e?d(b||this.iscrollview.$scroller).unbind(i,this.handleEvent):(b||this.scroller).removeEventListener(i,this,!!c))};this._origHandleEvent=iScroll.prototype.handleEvent;
this.handleEvent=function(a){var b=this.iscrollview.options.bindIscrollUsingJqueryEvents,c;c=this.iscrollview._logIscrollEvent("iScroll.handleEvent",a);b&&"mouseleave"===a.type?(a.type="mouseout",this._origHandleEvent(a),a.type="mouseleave"):this._origHandleEvent(a);this.iscrollview._logIscrollEvent("iScroll.handleEvent",a,c)};this._resize=function(){};iScroll.call(this,b,c)}var k=m.ontouchend!==e,p=/webkit/i.test(navigator.appVersion),q=/android/gi.test(navigator.appVersion),r=/firefox/i.test(navigator.userAgent);
/hp-tablet/gi.test(navigator.appVersion);/(iPhone|iPad|iPod).*AppleWebKit/.test(navigator.appVersion);var s=/iPad.*AppleWebKit/.test(navigator.appVersion),t=/(iPhone|iPad|iPod).*AppleWebKit.*Safari/.test(navigator.appVersion);/(iPhone|iPad|iPod).*AppleWebKit.(?!.*Safari)/.test(navigator.appVersion);var u=d.mobile.ignoreContentEnabled===e,l=1,h=function(){};h.prototype=iScroll.prototype;h=new h;h.constructor=j;j.prototype=h;d.widget("mobile.iscrollview",d.mobile.widget,{widgetEventPrefix:"iscroll_",
iscroll:null,$window:d(n),$wrapper:[],$scroller:[],$scrollerContent:[],$pullDown:[],$pullUp:[],$pullUpSpacer:[],$page:[],_wrapperHeightAdjustForBoxModel:0,_firstScrollerExpand:!0,createdAt:null,pageID:null,instanceID:null,_dirty:!1,_dirtyCallbackBefore:null,_dirtyCallbackAfter:null,_sizeDirty:!1,options:{hScroll:!1,hScrollbar:!1,debug:!1,traceResizeWrapper:!1,traceRefresh:!1,traceCreateDestroy:!1,traceIscrollEvents:!1,tracedIscrollEvents:[],traceWidgetEvents:!1,tracedWidgetEvents:[],traceIscrollCallbacks:!1,
tracedIscrollCallbacks:[],traceWidgetCallbacks:!1,tracedWidgetCallbacks:[],bottomOffset:0,emulateBottomOffset:!0,pageClass:"iscroll-page",wrapperClass:"iscroll-wrapper",scrollerClass:"iscroll-scroller",pullDownClass:"iscroll-pulldown",pullUpClass:"iscroll-pullup",pullLabelClass:"iscroll-pull-label",pullUpSpacerClass:"iscroll-pullup-spacer",scrollerContentClass:"iscroll-content",fixedHeightClass:"iscroll-fixed",fixedHeightSelector:":jqmData(role='header'), :jqmData(role='footer'), :jqmData(iscroll-fixed)",
resizeWrapper:!0,resizeEvents:"resize"+(d.support.orientation?" orientationchange":""),refreshOnPageBeforeShow:!1,fixInput:!0,wrapperAdd:0,refreshDelay:q?200:0,scrollShortContent:!0,removeWrapperPadding:!0,addScrollerPadding:!0,scrollTopOnResize:!0,scrollTopOnOrientatationChange:!0,createScroller:!0,deferNonActiveRefresh:!0,deferNonActiveResize:!0,preventTouchHover:u&&k,bindIscrollUsingJqueryEvents:!1,fastDestroy:!1,preventPageScroll:!0,pullDownResetText:"Pull down to refresh...",pullDownPulledText:"Release to refresh...",
pullDownLoadingText:"Loading...",pullUpResetText:"Pull up to refresh...",pullUpPulledText:"Release to refresh...",pullUpLoadingText:"Loading...",pullPulledClass:"iscroll-pull-pulled",pullLoadingClass:"iscroll-pull-loading",onrefresh:null,onbeforescrollstart:null,onscrollstart:null,onbeforescrollmove:null,onscrollmove:null,onbeforescrollend:null,onscrollend:null,ontouchend:null,ondestroy:null,onzoomstart:null,onzoom:null,onzoomend:null,onpulldownreset:null,onpulldownpulled:null,onpulldown:null,onpullupreset:null,
onpulluppulled:null,onpullup:null,onbeforerefresh:null,onafterrefresh:null},_widgetOnlyOptions:"debug traceIscrollEvents tracedIscrollEvents traceIscrollCallbacks tracedIscrollCallbacks traceWidgetEvents tracedWidgetEvents traceWidgetCallbacks tracedWidgetCallbacks traceResizeWrapper traceRefresh traceCreateDestroy bottomOffset emulateBottomOffset pageClass wrapperClass scrollerClass pullDownClass pullUpClass scrollerContentClass pullLabelClass pullUpSpacerClass fixedHeightSelector resizeWrapper resizeEvents refreshOnPageBeforeShow fixInput wrapperAdd refreshDelay scrollShortContent removeWrapperPadding addScrollerPadding createScroller deferNonActiveRefresh preventTouchHover deferNonActiveResize bindIscrollUsingJqueryEvents scrollTopOnResize scrollTopOnOrientationChange pullDownResetText pullDownPulledText pullDownLoadingText pullUpResetText pullUpPulledText pullUpLoadingText pullPulledClass pullLoadingClass onpulldownreset onpulldownpulled onpulldown onpullupreset onpulluppulled onpullup onbeforerefresh onafterrefresh fastDestroy".split(" "),
_event_map:{onrefresh:"onRefresh",onbeforescrollstart:"onBeforeScrollStart",onscrollstart:"onScrollStart",onbeforescrollmove:"onBeforeScrollMove",onscrollmove:"onScrollMove",onbeforescrollend:"onBeforeScrollEnd",onscrollend:"onScrollEnd",ontouchend:"onTouchEnd",ondestroy:"onDetroy",onzoomstart:"onZoomStart",onzoom:"onZoom",onzoomend:"onZoomEnd"},_proxy_event_funcs:{onRefresh:function(a){this._doCallback("onRefresh",a,function(a){this._emulateBottomOffset();this.iscrollview._pullOnRefresh.call(this.iscrollview,
a)})},onBeforeScrollStart:function(a){this._doCallback("onBeforeScrollStart",a,function(a){this._fixInput(a)})},onScrollStart:function(a){this._doCallback("onScrollStart",a)},onBeforeScrollMove:function(a){this._doCallback("onBeforeScrollMove",a);a.preventDefault()},onScrollMove:function(a){this._doCallback("onScrollMove",a,function(a){this.iscrollview._pullOnScrollMove.call(this.iscrollview,a)})},onBeforeScrollEnd:function(a){this._doCallback("onBeforeScrollEnd",a)},onScrollEnd:function(a){this._doCallback("onScrollEnd",
a,function(a){this.iscrollview._pullOnScrollEnd.call(this.iscrollview,a)})},onTouchEnd:function(a){this._doCallback("onTouchEnd",a)},onDestroy:function(a){this._doCallback("onDestroy",a)},onZoomStart:function(a){this._doCallback("onZoomStart",a)},onZoom:function(a){this._doCallback("onZoom",a)},onZoomEnd:function(a){this._doCallback("onZoomEnd",a)}},_merge_from_iscroll_options:function(){var a=d.extend(!0,{},this.iscroll.options);d.each(this._proxy_event_funcs,function(b){delete a[b]});this.options.emulateBottomOffset&&
delete a.bottomOffset;d.extend(this.options,a)},_create_iscroll_options:function(){var a=d.extend(!0,{},this.options);d.each(this._widgetOnlyOptions,function(b,c){delete a[c]});d.each(this._event_map,function(b){delete a[b]});this.options.emulateBottomOffset&&delete a.bottomOffset;return d.extend(a,this._proxy_event_funcs)},_pad:function(a,b,c){a=a.toString();for(c=c||"0";a.length<b;)a=c+a;return a},_toTime:function(a){return this._pad(a.getHours(),2)+":"+this._pad(a.getMinutes(),2)+":"+this._pad(a.getSeconds(),
2)+"."+this._pad(a.getMilliseconds(),3)},_log:function(a,b){var c,g;if(!this.options.debug)return null;c=b||new Date;g=this.$wrapper.attr("id");console.log(this._toTime(c)+" "+d.mobile.path.parseUrl(this.$page.jqmData("url")).filename+(g?"#"+g:"")+" "+a);return c},_logInterval:function(a,b){var c;if(!this.options.debug)return null;c=new Date;return this._log(a+" "+(c-b)+"mS from "+this._toTime(b),c)},_logEvent:function(a,b,c){var d=b&&b instanceof Object,e=(d?b.type:b)+" "+a;if(!this.options.debug)return null;
a=new Date;c?e+=" end "+ +(a-c)+"mS from "+this._toTime(c):d&&(e+=" begin");d&&(c=new Date(b.timeStamp),e+=" ("+(a-c)+"mS from "+b.type+" @ "+this._toTime(c)+")");return this._log(e,a)},_logCallback:function(a,b,c){return!this.options.debug||!this.options.traceIscrollCallbacks||0!==this.options.tracedIscrollCallbacks.length&&-1===d.inArray(a,this.options.tracedIscrollCallbacks)?null:b?this._logEvent(a,b,c):c?this._logInterval(a+" end",c):this._log(a+" begin")},_logIscrollEvent:function(a,b,c){var g=
b instanceof Event?b.type:b;return!this.options.debug||!this.options.traceIscrollEvents||0!==this.options.tracedIscrollEvents.length&&-1===d.inArray(g,this.options.tracedIscrollEvents)?null:this._logEvent(a,b,c)},_logWidgetEvent:function(a,b,c){var g=b instanceof Object?b.type:b;return!this.options.debug||!this.options.traceWidgetEvents||0!==this.options.tracedWidgetEvents.length&&-1===d.inArray(g,this.options.tracedWidgetEvents)?null:this._logEvent(a,b,c)},_logWidgetCallback:function(a,b,c){return!this.options.debug||
!this.options.traceWidgetCallbacks||0!==this.options.tracedWidgetCallbacks.length&&-1===d.inArray(a,this.options.tracedWidgetCallbacks)?null:b?this._logEvent(a,b,c):c?this._logInterval(a+" end",c):this._log(a+" begin")},_logInterval2:function(a,b,c){var d;this.options.debug&&(d=new Date,this._log(a+" "+(d-c)+"mS from "+this._toTime(c)+" ("+(d-b)+"mS from "+this._toTime(b)+")"))},_startTiming:function(){return!this.options.debug?null:new Date},_pageEventNamespace:function(){return".iscroll_"+this.pageID},
_instanceEventNamespace:function(){return this._pageEventNamespace()+"_"+this.instanceID},_addEventsNamespace:function(a,b){var c=a.split(" ");d.each(c,function(a){c[a]+=b});return c.join(" ")},_isvBind:function(a,b,c,e){b=this._addEventsNamespace(b,this._instanceEventNamespace());this._logWidgetEvent("bind "+e,b);a.bind(b,d.proxy(c,this))},_bindPage:function(a,b){var c=this._addEventsNamespace(a,this._pageEventNamespace());this._logWidgetEvent("bind $page",c);this.$page.bind(c,d.proxy(b,this))},
_isvUnbind:function(a,b,c){b=this._addEventsNamespace(b,this._instanceEventNamespace());this._logWidgetEvent("unbind "+c,b);a.unbind(b)},_unbindPage:function(a){a=this._addEventsNamespace(a,this._instanceEventNamespace());this._logWidgetEvent("unbind $page",a);this.$page.unbind(a)},_delegate:function(a,b,c,e,f){this._logWidgetEvent("delegate "+f+" "+b,c);a.delegate(b,c,d.proxy(e,this))},_triggerWidget:function(a,b){var c=this._logWidgetCallback(a);this._trigger(a,b,{iscrollview:this});this._logWidgetCallback(a,
b,c)},isDirty:function(){return this._dirty},_restoreStyle:function(a,b){b!==e&&(null===b?a.removeAttr("style"):a.attr("style",b))},_pageBeforeShowFunc:function(a){var b=this._logWidgetEvent("_pageBeforeShowFunc",a);this._dirty?(this.resizeWrapper(),this.refresh(null,this._dirtyCallbackBefore,this._dirtyCallbackAfter,!0),this._dirty=!1,this._dirtyCallbackAfter=this._dirtyCallbackBefore=null):(this.options.refreshOnPageBeforeShow||this._sizeDirty)&&this.refresh(null,d.proxy(this._resizeWrapper,this),
null,!0);this._sizeDirty=!1;this._logWidgetEvent("_pageBeforeShowFunc",a,b)},_windowResizeFunc:function(a){var b=this._logWidgetEvent("_windowResizeFunc",a);this.options.deferNonActiveResize&&!this.$page.is(d.mobile.activePage)?(this._sizeDirty=!0,this.options.traceResizeWrapper&&this._log("resizeWrapper() (deferred)")):(this.resizeWrapper(),this.refresh(null,null,null,!0));this._logWidgetEvent("_windowResizeFunc",a,b)},_orientationChangeFunc:function(a){var b=this._logWidgetEvent("_orientationChangeFunc",
a);this.options.scrollTopOnOrientationChange&&d.mobile.silentScroll(0);this._logWidgetEvent("_orientationChangeFunc",a,b)},_updateLayoutFunc:function(){this.refresh()},_instanceCount:function(a){var b=0,c=this.$page.jqmData("iscroll-private")||{};a!==e?(b=a,c.instanceCount=b,this.$page.jqmData("iscroll-private",c)):c.instanceCount!==e&&(b=c.instanceCount);return b},_nextInstanceID:function(a){var b=1,c=this.$page.jqmData("iscroll-private")||{};a!==e?(b=a,c.nextInstanceID=b,this.$page.jqmData("iscroll-private",
c)):c.nextInstanceID!==e&&(b=c.nextInstanceID);return b},_pageID:function(a){var b=1,c=this.$page.jqmData("iscroll-private")||{};a!==e?(b=a,c.pageID=b,this.$page.jqmData("iscroll-private",c)):c.pageID!==e&&(b=c.pageID);return b},_adaptPage:function(){var a=this;1===this._instanceCount()&&(this.$page.addClass(this.options.pageClass),this.$page.find(this.options.fixedHeightSelector).each(function(){d(this).addClass(a.options.fixedHeightClass)}),k&&this.options.preventPageScroll&&this._bindPage("touchmove",
o))},_undoAdaptPage:function(){var a=this;1===this._instanceCount()&&(this.$page.find(this.options.fixedHeightSelector).each(function(){d(this).removeClass(a.options.fixedHeightClass)}),this.$page.removeClass(this.options.pageClass))},_calculateBarsHeight:function(){var a=0,b="."+this.options.fixedHeightClass,c=this.$page.find(b),b=d("body").children(b);c.each(function(){a+=d(this).outerHeight(!0)});b.each(function(){var b=d(this).jqmData("id");if(""===b||!c.is(":jqmData(id='"+b+"')"))a+=d(this).outerHeight(!0)});
return a},_getBoxSizing:function(a){var b,c="";r?c="-moz-":p&&(c="-webkit-");b=a.css(c+"box-sizing");!b&&c&&(b=a.css("box-sizing"));b||(b=d.boxModel?"content-box":"border-box");return b},_getHeightAdjustForBoxModel:function(a){switch(this._getBoxSizing(a)){case "border-box":a=a.outerHeight(!0)-a.outerHeight();break;case "padding-box":a=a.outerHeight()-a.height();break;default:a=a.outerHeight(!0)-a.height()}return a},_setTopOffsetForPullDown:function(){this.$pullDown.length&&!this.options.topOffset&&
(this.options.topOffset=this.$pullDown.outerHeight(!0))},_setBottomOffsetForPullUp:function(){this.$pullUp.length&&!this.options.bottomOffset&&(this.options.bottomOffset=this.$pullUp.outerHeight(!0))},_removeWrapperPadding:function(){var a=this.$wrapper;this.options.removeWrapperPadding&&(this._origWrapperPaddingLeft=a.css("padding-left"),this._origWrapperPaddingRight=a.css("padding-right"),this._origWrapperPaddingTop=a.css("padding-top"),this._origWrapperPaddingBottom=a.css("padding-bottom"),this.$wrapper.css("padding",
0))},_modifyWrapperCSS:function(){this._origWrapperStyle=this.$wrapper.attr("style")||null;this._removeWrapperPadding()},_undoModifyWrapperCSS:function(){this._restoreStyle(this.$wrapper,this._origWrapperStyle)},_addScrollerPadding:function(){if(this.options.removeWrapperPadding&&this.options.addScrollerPadding){var a=this.$scroller.children().not(this.$pullDown).not(this.$pullUp).not(this.$pullUpSpacer);a.wrapAll("<div/>");a.parent().addClass(this.options.scrollerContentClass).css({"padding-left":this._origWrapperPaddingLeft,
"padding-right":this._origWrapperPaddingRight,"padding-top":this._origWrapperPaddingTop,"padding-bottom":this._origWrapperPaddingBottom})}},_undoAddScrollerPadding:function(){this.options.removeWrapperPadding&&this.options.addScrollerPadding&&d("."+this.options.scrollerContentClass,this.$scroller).children().unwrap()},_addWrapperClasses:function(){this.$wrapper.addClass(this.options.wrapperClass);this.$scroller.addClass(this.options.scrollerClass)},_undoAddWrapperClasses:function(){this.$scroller.removeClass(this.options.scrollerClass);
this.$wrapper.removeClass(this.options.wrapperClass)},_expandScrollerToFillWrapper:function(){if(this.options.scrollShortContent||this.$pullDown.length||this.pullUp.length)this._firstScrollerExpand&&(this._origScrollerStyle=this.$scroller.attr("style")||null,this._firstScrollerExpand=!1),this.$scroller.css("min-height",this.$wrapper.height()+(this.$pullDown.length?this.$pullDown.outerHeight(!0):0)+(this.$pullUp.length?this.$pullUp.outerHeight(!0):0))},_undoExpandScrollerToFillWrapper:function(){this._restoreStyle(this.$scroller,
this._origScrollerStyle)},_resizeWrapper:function(){var a=null,b,c;this.options.resizeWrapper&&(this.options.traceResizeWrapper&&(a=this._log("resizeWrapper() start")),this.$wrapper.trigger("updatelayout"),b=m.documentElement.clientHeight,c=this._calculateBarsHeight(),b=b-c-this._wrapperHeightAdjustForBoxModel+(t&&!s?60:0)+this.options.wrapperAdd,this.$wrapper.css("height",b),this._expandScrollerToFillWrapper(),this.options.traceResizeWrapper&&this._logInterval("resizeWrapper() end"+(this._sizeDirty?
" (dirty)":""),a))},resizeWrapper:function(){var a=this._setPageVisible();this._resizeWrapper();this._restorePageVisibility(a)},_undoResizeWrapper:function(){},_modifyWrapper:function(){this._addWrapperClasses();this._modifyWrapperCSS();this._wrapperHeightAdjustForBoxModel=this._getHeightAdjustForBoxModel(this.$wrapper)},_undoModifyWrapper:function(){this._undoResizeWrapper();this._undoModifyWrapperCSS();this._undoAddWrapperClasses()},_modifyPullDown:function(){var a,b;if(0!==this.$pullDown.length&&
(a=d("."+this.options.pullLabelClass,this.$pullDown),a.length)){(this._origPullDownLabelText=a.text())?this.options.pullDownResetText=this._origPullDownLabelText:a.text(this.options.pullDownResetText);if(b=a.jqmData("iscroll-pulled-text"))this.options.pullDownPulledText=b;if(a=a.jqmData("iscroll-loading-text"))this.options.pullDownLoadingText=a}},_undoModifyPullDown:function(){if(0!==this.$pullDown.length){var a=d("."+this.options.pullLabelClass,this.$pullDown);0!==a.length&&a.text(this._origPullDownLabelText)}},
_modifyPullUp:function(){var a,b;if(0!==this.$pullUp.length&&(d("<div></div>").insertBefore(this.$pullUp).css("height",this.$pullUp.outerHeight(!0)),this.$pullUpSpacer=this.$pullUp.prev(),this.$pullUpSpacer.addClass(this.options.pullUpSpacerClass),a=d("."+this.options.pullLabelClass,this.$pullUp),a.length)){(this._origPullUpLabelText=a.text())?this.options.pullUpResetText=this._origPullUpLabelText:a.text(this.options.pullUpResetText);if(b=a.jqmData("iscroll-pulled-text"))this.options.pullUpPulledText=
b;if(a=a.jqmData("iscroll-loading-text"))this.options.pullUpLoadingText=a}},_undoModifyPullUp:function(){0!==this.$pullUp.length&&(this.$pullUp.prev().remove(),this._origPullUpLabelText&&d("."+this.options.pullLabelClass,this.$pullUp).text(this._origPullUpLabelText))},_correctPushedDownPage:function(){this.options.resizeWrapper&&this.options.scrollTopOnResize&&d.mobile.silentScroll(0)},refresh:function(a,b,c,g){var f,h;if(!g&&this.options.deferNonActiveRefresh&&!this.$page.is(d.mobile.activePage))this._dirty=
!0,this._dirtyCallbackBefore=b,this._dirtyCallbackAfter=c,this.options.traceRefresh&&this._log("refresh() (deferred)");else{f=this;h=this._startTiming();if(a===e||null===a)a=this.options.refreshDelay;setTimeout(function(){var a=null,d;f.options.traceRefresh&&(a=f._logInterval("refresh() start",h));d=f._setPageVisible();b&&b();f._triggerWidget("onbeforerefresh");f.iscroll.refresh();f._triggerWidget("onafterrefresh");c&&c();f._restorePageVisibility(d);d||f._correctPushedDownPage();f.options.traceRefresh&&
f._logInterval2("refresh() end"+(g?" (dirty)":""),h,a)},a);this.options.traceRefresh&&this._log("refresh() will occur after >= "+a+"mS")}},_create_iscroll_object:function(){this.iscroll=new j(this,this.$wrapper.get(0),this._create_iscroll_options())},_createScroller:function(){this.options.createScroller&&(this.$wrapper.children().length?this.$wrapper.children().wrapAll("<div/>"):this.$wrapper.append("<div><div></div></div>"))},_undoCreateScroller:function(){this.options.createScroller&&this.$scroller.children().unwrap()},
_setPageVisible:function(){var a=this.$page.is(":hidden");a&&this.$page.css("display","block");return a},_restorePageVisibility:function(a){a&&this.$page.css("display","")},_create:function(){var a=new Date,b;this.$wrapper=this.element;this.$page=this.$wrapper.parents(":jqmData(role='page')");this.options.debug&&this.options.traceCreateDestroy&&this._log("_create() start",a);this.createdAt=a;this._instanceCount(this._instanceCount()+1);this.instanceID=this._nextInstanceID();this._nextInstanceID(this._instanceID+
1);1===this.instanceID&&(this._pageID(l),l+=1);this.pageID=this._pageID();b=this._setPageVisible();this._adaptPage();this._createScroller();this.$scroller=this.$wrapper.children(":first");0!==this.$scroller.length&&(this.$pullDown=d("."+this.options.pullDownClass,this.$scroller),this._modifyPullDown(),this.$pullUp=d("."+this.options.pullUpClass,this.$scroller),this._modifyPullUp(),d.extend(!0,this.options,this.$wrapper.jqmData("iscroll")),this._modifyWrapper(),this._bindPage("pagebeforeshow",this._pageBeforeShowFunc),
this._setTopOffsetForPullDown(),this._setBottomOffsetForPullUp(),this._resizeWrapper(),this._addScrollerPadding(),this._create_iscroll_object(),this._merge_from_iscroll_options(),this._restorePageVisibility(b),this.options.resizeWrapper&&(this._isvBind(this.$window,this.options.resizeEvents,this._windowResizeFunc,"$window"),this.options.scrollTopOnOrientationChange&&this._isvBind(this.$window,"orientationchange",this._orientationChangeFunc,"$window")),this.$scrollerContent=this.$scroller.find("."+
this.options.scrollerContentClass),this._isvBind(this.$scrollerContent,"updatelayout",this._updateLayoutFunc,"$scrollerContent"),this.options.debug&&this.options.traceCreateDestroy&&this._logInterval("_create() end",a))},destroy:function(){var a=null;this.options.debug&&this.options.traceCreateDestroy&&(a=this._log("destroy() start"));this._isvUnbind(this.$scrollerContent,"updatelayout","$scrollerContent");this._isvUnbind(this.$window,this.options.resizeEvents,"$window");this._isvUnbind(this.$window,
"orientationchange","$window");1===this._instanceCount()&&(this._unbindPage("pagebeforeshow"),k&&this._unbindPage("touchmove"));this.options.fastDestroy||(this.iscroll.destroy(),this.iscroll=null,this._undoExpandScrollerToFillWrapper(),this._undoModifyPullDown(),this._undoModifyPullUp(),this._undoAddScrollerPadding(),this._undoModifyWrapper(),this.$wrapper.removeClass(this.options.wrapperClass),this.$scroller.removeClass(this.options.scrollerClass),this._undoCreateScroller());this._instanceCount(this._instanceCount()-
1);0===this._instanceCount()&&this._undoAdaptPage();d.Widget.prototype.destroy.call(this);this.options.debug&&this.options.traceCreateDestroy&&this._logInterval("destroy() end",a)},enable:function(){this.iscroll.enable();d.Widget.prototype.enable.call(this)},disable:function(){this.iscroll.disable();d.Widget.prototype.disable.call(this)},_setOption:function(a,b){var c;this.options[a]=b;this.iscroll.destroy();c=this._setPageVisible();this._create_iscroll_object();this._restorePageVisibility(c);d.Widget.prototype._setOption.apply(this,
arguments)},scrollTo:function(a,b,c,d){this.iscroll.scrollTo(a,b,c,d)},scrollToElement:function(a,b){this.iscroll.scrollToElement(a,b)},scrollToPage:function(a,b,c){this.iscroll.scrollToPage(a,b,c)},stop:function(){this.iscroll.stop()},zoom:function(a,b,c,d){this.iscroll.zoom(a,b,c,d)},isReady:function(){return this.iscroll.isReady()},x:function(){return this.iscroll.x},y:function(){return this.iscroll.y},wrapperW:function(){return this.iscroll.wrapperW},wrapperH:function(){return this.iscroll.wrapperH},
scrollerW:function(){return this.iscroll.scrollerW},scrollerH:function(){return this.iscroll.scrollerH},minScrollX:function(a){a!==e&&(this.iscroll.minScrollX=a);return this.iscroll.minScrollX},minScrollY:function(a){a!==e&&(this.iscroll.minScrollY=a);return this.iscroll.minScrollY},maxScrollX:function(a){a!==e&&(this.iscroll.maxScrollX=a);return this.iscroll.maxScrollX},maxScrollY:function(a){a!==e&&(this.iscroll.maxScrollY=a);return this.iscroll.maxScrollY},_pullDownIsPulled:function(){return this.$pullDown.length&&
this.$pullDown.hasClass(this.options.pullPulledClass)},_pullUpIsPulled:function(){return this.$pullUp.length&&this.$pullUp.hasClass(this.options.pullPulledClass)},_replacePullText:function(a,b){var c;b&&(c=d("."+this.options.pullLabelClass,a))&&c.text(b)},_pullSetStateReset:function(a,b){a.is("."+this.options.pullLoadingClass+", ."+this.options.pullPulledClass)&&(a.removeClass(this.options.pullPulledClass+" "+this.options.pullLoadingClass),this._replacePullText(a,b))},_pullDownSetStateReset:function(a){this._pullSetStateReset(this.$pullDown,
this.options.pullDownResetText);this._triggerWidget("onpulldownreset",a)},_pullUpSetStateReset:function(a){this._pullSetStateReset(this.$pullUp,this.options.pullUpResetText);this._triggerWidget("onpullupreset",a)},_pullSetStatePulled:function(a,b){a.removeClass(this.options.pullLoadingClass).addClass(this.options.pullPulledClass);this._replacePullText(a,b)},_pullDownSetStatePulled:function(a){this._pullSetStatePulled(this.$pullDown,this.options.pullDownPulledText);this._triggerWidget("onpulldownpulled",
a)},_pullUpSetStatePulled:function(a){this._pullSetStatePulled(this.$pullUp,this.options.pullUpPulledText);this._triggerWidget("onpulluppulled",a)},_pullSetStateLoading:function(a,b){a.removeClass(this.options.pullPulledClass).addClass(this.options.pullLoadingClass);this._replacePullText(a,b)},_pullDownSetStateLoading:function(a){this._pullSetStateLoading(this.$pullDown,this.options.pullDownLoadingText);this._triggerWidget("onpulldownloading",a)},_pullUpSetStateLoading:function(a){this._pullSetStateLoading(this.$pullUp,
this.options.pullUpLoadingText);this._triggerWidget("onpulluploading",a)},_pullOnRefresh:function(a){this.$pullDown.length&&this._pullDownSetStateReset(a);this.$pullUp.length&&this._pullUpSetStateReset(a)},_pullOnScrollMove:function(a){var b,c,d=this.y();this.$pullDown.length&&(b=this._pullDownIsPulled(),c=this.options.topOffset,!b&&d>c/2?(this._pullDownSetStatePulled(a),this.minScrollY(0)):b&&0>=d&&(this._pullDownSetStateReset(a),this.minScrollY(-c)));this.$pullUp.length&&(b=this._pullUpIsPulled(),
c=this.options.bottomOffset,!b&&d<this.maxScrollY()-c-c/2?(this._pullUpSetStatePulled(a),this.maxScrollY(this.wrapperH()-this.scrollerH()+this.minScrollY())):b&&d>=this.maxScrollY()&&(this._pullUpSetStateReset(a),this.maxScrollY(this.wrapperH()-this.scrollerH()+this.minScrollY()+c)))},_pullOnScrollEnd:function(a){this._pullDownIsPulled(a)?(this._pullDownSetStateLoading(a),this._triggerWidget("onpulldown",a)):this._pullUpIsPulled(a)&&(this._pullUpSetStateLoading(a),this._triggerWidget("onpullup",a))}})})(jQuery,
window,document);jQuery(document).bind("pagecreate",function(d){jQuery(d.target).find(":jqmData(iscroll)").iscrollview()});