UNPKG

com.cordova.admob

Version:

Google AdMob plugin for Cordova, Phonegap and Intel XDK ,support ios and android,support admob v1 and admob v2 ,Monetize your app with one javascript line.simple and easy to use api.build on admob ios 7.6 and admob android sdk 8 project home:https

118 lines (114 loc) 74.5 kB
/*! intel-appframework - v2.1.0 - 2014-03-24 */ (function(b){function n(){b.ui.isWin8=!0;b.os.ie&&b.ui.isSideMenuEnabled()&&b.ui.ready(function(){if(window.innerWidth>b.ui.handheldMinWidth)return!0;b.ui.slideSideMenu&&(b.ui.slideSideMenu=!1);b.query("#afui #navbar footer").append("<a id='metroMenu' onclick='$.ui.toggleSideMenu()'>\u2022\u2022\u2022</a>");var m=b.query("#afui #navbar").find("a").not(".button");if(0<m.length){m.data("ignore-pressed","true").data("resetHistory","true");var f=parseFloat(100/m.length);m.css("width",f+"%")}var c=b.ui.updateNavbarElements; b.ui.updateNavbarElements=function(){c.apply(b.ui,arguments);1!==b.query("#afui #navbar #metroMenu").length&&b.query("#afui #navbar footer").append("<a id='metroMenu' onclick='$.ui.toggleSideMenu()'>\u2022\u2022\u2022</a>")};b.ui.isSideMenuOn=function(){var l=0>parseInt(b.getCssMatrix(b("#navbar")).f,10)?!0:!1;return this.isSideMenuEnabled()&&l};b.ui.toggleRightSideMenu=function(l,c,k){if(this.isAsideMenuEnabled()&&!this.togglingAsideMenu){var g=this,a=b("#menu"),e=b.query("#aside_menu"),h=b.query("#content, #header, #navbar"), q=b.query(".afui_panel_mask");k=k||this.transitionTime;var f="block"===b("#aside_menu").css("display"),m="-"+g.sideMenuWidth;0===q.length&&window.innerWidth<b.ui.handheldMinWidth&&(h.append("<div class='afui_panel_mask'></div>"),q=b.query(".afui_panel_mask"),b(".afui_panel_mask").bind("click",function(){b.ui.toggleSideMenu(!1,null,null,!0)}));var n=this.getSideMenuPosition();f&&0<n&&(f=!1);if(2===l||!f&&(void 0!==l&&!1!==l||void 0===l))this.togglingSideMenu=!0,e.show(),g.css3animate(h,{x:m,time:k, complete:function(a){g.togglingSideMenu=!1;h.vendorCss("Transition","");c&&c(a);0!==q.length&&window.innerWidth<b.ui.handheldMinWidth&&q.show()}});else if(void 0===l||void 0!==l&&!1===l)this.togglingSideMenu=!0,g.css3animate(h,{x:"0px",time:k,complete:function(l){h.vendorCss("Transition","");h.vendorCss("Transform","");g.togglingSideMenu=!1;c&&c(l);b.ui.splitview||a.hide();e.hide();0!==q.length&&window.innerWidth<b.ui.handheldMinWidth&&q.hide()}})}};b.ui.toggleLeftSideMenu=function(c,d){if(this.isSideMenuEnabled()&& !this.togglingSideMenu){this.togglingSideMenu=!0;var k=this,g=b.query("#menu"),a=b.query("#navbar"),e=this.isSideMenuOn();if(2===c||!e&&(void 0!==c&&!1!==c||void 0===c))g.show(),k.css3animate(a,{y:"-150px",time:b.ui.transitionTime,complete:function(){k.togglingSideMenu=!1;d&&d(!0)}}),k.css3animate(g,{y:"0px",time:b.ui.transitionTime});else if(void 0===c||void 0!==c&&!1===c)k.css3animate(a,{y:"0",time:b.ui.transitionTime,complete:function(){k.togglingSideMenu=!1;d&&d(!0);g.hide()}}),k.css3animate(g, {y:"150px",time:b.ui.transitionTime})}}})}if(!b)throw"This plugin requires AFUi";b.ui?b.ui.ready(function(){n()}):b(document).ready(function(){n()})})(af);(function(b){b.fn.actionsheet=function(b){for(var f,c=0;c<this.length;c++)f=new n(this[c],b);return 1===this.length?f:this};var n=function(){var m=function(f,c){if(this.el="string"===typeof f||f instanceof String?document.getElementById(f):f){if(this instanceof m){if("object"===typeof c)for(var l in c)this[l]=c[l]}else return new m(f,c);var d=this,k;l=function(){};if("string"===typeof c)k=b("<div id='af_actionsheet'><div style='width:100%'>"+c+"<a href='javascript:;' class='cancel'>Cancel</a></div></div>"); else if("object"===typeof c){k=b("<div id='af_actionsheet'><div style='width:100%'></div></div>");var g=b(k.children().get(0));c.push({text:"Cancel",cssClasses:"cancel"});for(var a=0;a<c.length;a++){var e=b("<a href='javascript:;'>"+(c[a].text||"TEXT NOT ENTERED")+"</a>");e[0].onclick=c[a].handler||l;c[a].cssClasses&&0<c[a].cssClasses.length&&e.addClass(c[a].cssClasses);g.append(e)}}b(f).find("#af_actionsheet").remove();b(f).find("#af_action_mask").remove();b(f).append(k);k.vendorCss("Transition", "all 0ms");k.cssTranslate("0,0");k.css("top",window.innerHeight+"px");this.el.style.overflow="hidden";k.on("click","a",function(){d.hideSheet();return!1});this.activeSheet=k;b(f).append("<div id='af_action_mask' style='position:absolute;top:0px;left:0px;right:0px;bottom:0px;z-index:9998;background:rgba(0,0,0,.4)'/>");setTimeout(function(){k.vendorCss("Transition","all 300ms");k.cssTranslate("0,"+-k.height()+"px")},10);b("#af_action_mask").bind("touchstart touchmove touchend click",function(a){a.preventDefault(); a.stopPropagation()})}else window.alert("Could not find element for actionsheet "+f)};m.prototype={activeSheet:null,hideSheet:function(){var f=this;this.activeSheet.off("click","a",function(){f.hideSheet()});b(this.el).find("#af_action_mask").unbind("click").remove();this.activeSheet.vendorCss("Transition","all 0ms");var c=this.activeSheet,l=this.el;setTimeout(function(){c.vendorCss("Transition","all 300ms");c.cssTranslate("0,0px");setTimeout(function(){c.remove();c=null;l.style.overflow="none"}, 500)},10)}};return m}()})(af);/* MIT - https://github.com/darius/requestAnimationFrame/commit/4f27a5a21902a883330da4663bea953b2f96cb15#diff-9879d6db96fd29134fc802214163b95a http://paulirish.com/2011/requestanimationframe-for-smart-animating/ http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating requestAnimationFrame polyfill by Erik M?ller. fixes from Paul Irish and Tino Zijdel MIT license Adapted from https://gist.github.com/paulirish/1579671 which derived from http://paulirish.com/2011/requestanimationframe-for-smart-animating/ http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating requestAnimationFrame polyfill by Erik M?ller. Fixes from Paul Irish, Tino Zijdel, Andrew Mao, Klemen Slavi?, Darius Bacon */ (function(b){var n=[],m=function(c,g){var a,e;a="string"===typeof c||c instanceof String?document.getElementById(c):b.is$(c)?c[0]:c;a.afCSS3AnimateId||(a.afCSS3AnimateId=b.uuid());e=a.afCSS3AnimateId;n[e]?(n[e].animate(g),a=n[e]):(a=d(a,g),n[e]=a);return a};b.fn.css3Animate=function(b){!b.complete&&b.callback&&(b.complete=b.callback);var c=m(this[0],b);b.complete=null;b.sucess=null;b.failure=null;for(var a=1;a<this.length;a++)c.link(this[a],b);return c};b.css3AnimateQueue=function(){return new d.queue}; var f=b.feat.cssTransformStart,c=b.feat.cssTransformEnd,l=b.feat.cssPrefix.replace(/-/g,"")+"TransitionEnd",l=b.os.fennec||""===b.feat.cssPrefix||b.os.ie?"transitionend":l,l=l.replace(l.charAt(0),l.charAt(0).toLowerCase()),d=function(){var d=function(c,a){if(!(this instanceof d))return new d(c,a);this.callbacksStack=[];this.activeEvent=null;this.countStack=0;this.isActive=!1;this.el=c;this.linkFinishedProxy=b.proxy(this.linkFinished,this);if(this.el){this.animate(a);var e=this;af(this.el).bind("destroy", function(){var a=e.el.afCSS3AnimateId;e.callbacksStack=[];n[a]&&delete n[a]})}};d.prototype={animate:function(g){this.isActive&&this.cancel();this.isActive=!0;if(g){var a=!!g.addClass,e,h,d=numOnly(g.time);if(a)g.removeClass?af(this.el).replaceClass(g.removeClass,g.addClass):af(this.el).addClass(g.addClass);else{0===d&&(g.time=0);g.y||(g.y=0);g.x||(g.x=0);g.previous&&(e=new b.getCssMatrix(this.el),g.y+=numOnly(e.f),g.x+=numOnly(e.e));g.origin||(g.origin="0% 0%");g.scale||(g.scale="1");g.rotateY|| (g.rotateY="0");g.rotateX||(g.rotateX="0");g.skewY||(g.skewY="0");g.skewX||(g.skewX="0");g.timingFunction||(g.timingFunction="linear");if("number"===typeof g.x||-1===g.x.indexOf("%")&&-1===g.x.toLowerCase().indexOf("px")&&-1===g.x.toLowerCase().indexOf("deg"))g.x=parseInt(g.x,10)+"px";if("number"===typeof g.y||-1===g.y.indexOf("%")&&-1===g.y.toLowerCase().indexOf("px")&&-1===g.y.toLowerCase().indexOf("deg"))g.y=parseInt(g.y,10)+"px";e="translate"+f+g.x+","+g.y+c+" scale("+parseFloat(g.scale)+") rotate("+ g.rotateX+")";b.os.opera||(e+=" rotateY("+g.rotateY+")");e+=" skew("+g.skewX+","+g.skewY+")";this.el.style[b.feat.cssPrefix+"Transform"]=e;this.el.style[b.feat.cssPrefix+"BackfaceVisibility"]="hidden";void 0!==g.opacity&&(this.el.style.opacity=g.opacity);g.width&&(this.el.style.width=g.width);g.height&&(this.el.style.height=g.height);this.el.style[b.feat.cssPrefix+"TransitionProperty"]="all";-1===(""+g.time).indexOf("s")?(e="ms",h=g.time+e):-1!==g.time.indexOf("ms")?(e="ms",h=g.time):(e="s",h=g.time+ e);g.delay&&(this.el.style[b.feat.cssPrefix+"TransitionDelay"]=g.delay);this.el.style[b.feat.cssPrefix+"TransitionDuration"]=h;this.el.style[b.feat.cssPrefix+"TransitionTimingFunction"]=g.timingFunction;this.el.style[b.feat.cssPrefix+"TransformOrigin"]=g.origin}this.callbacksStack.push({complete:g.complete,success:g.success,failure:g.failure});this.countStack++;var k=this;h=window.getComputedStyle(this.el);a&&(a=h[b.feat.cssPrefix+"TransitionDuration"],d=numOnly(a),g.time=d,-1!==a.indexOf("ms")?e= "ms":(e="s",g.time*=1E3));0===d||"ms"===e&&5>d||"none"===h.display?b.asap(b.proxy(this.finishAnimation,this,[!1])):(this.activeEvent=function(a){clearTimeout(k.timeout);k.finishAnimation(a);k.el.removeEventListener(l,k.activeEvent,!1)},k.timeout=setTimeout(this.activeEvent,numOnly(g.time)+50),this.el.addEventListener(l,this.activeEvent,!1))}else window.alert("Please provide configuration options for animation of "+this.el.id)},addCallbackHook:function(b){b&&this.callbacksStack.push(b);this.countStack++; return this.linkFinishedProxy},linkFinished:function(b){b?this.cancel():this.finishAnimation()},finishAnimation:function(b){b&&b.preventDefault&&b.preventDefault();this.isActive&&(this.countStack--,0===this.countStack&&this.fireCallbacks(!1))},fireCallbacks:function(b){this.clearEvents();var a=this.callbacksStack;this.cleanup();for(var e=0;e<a.length;e++){var h=a[e].complete,c=a[e].success,d=a[e].failure;"function"===typeof h&&h(b);b&&"function"===typeof d?d():"function"===typeof c&&c()}},cancel:function(){this.isActive&& this.fireCallbacks(!0)},cleanup:function(){this.callbacksStack=[];this.isActive=!1;this.countStack=0},clearEvents:function(){this.activeEvent&&this.el.removeEventListener(l,this.activeEvent,!1);this.activeEvent=null},link:function(b,a){var e={complete:a.complete,success:a.success,failure:a.failure};a.complete=this.addCallbackHook(e);a.success=null;a.failure=null;m(b,a);a.complete=e.complete;a.success=e.success;a.failure=e.failure;return this}};return d}();d.queue=function(){return{elements:[],push:function(b){this.elements.push(b)}, pop:function(){return this.elements.pop()},run:function(){var b=this;if(0!==this.elements.length&&("function"===typeof this.elements[0]&&this.shift()(),0!==this.elements.length)){var c=this.shift();0<this.elements.length&&(c.complete=function(a){a||b.run()});d(document.getElementById(c.id),c)}},shift:function(){return this.elements.shift()}}}})(af);Date.now||(Date.now=function(){return(new Date).getTime()}); (function(){for(var b=["webkit","moz","ms"],n=0;n<b.length&&!window.requestAnimationFrame;++n){var m=b[n];window.requestAnimationFrame=window[m+"RequestAnimationFrame"];window.cancelAnimationFrame=window[m+"CancelAnimationFrame"]||window[m+"CancelRequestAnimationFrame"]}if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){var f=0;window.requestAnimationFrame=function(b){var l=Date.now(),d=Math.max(f+16,l);return setTimeout(function(){b(f= d)},d-l)};window.cancelAnimationFrame=clearTimeout}})(); (function(b){var n=[];b.fn.animate=function(c){var l,d="string"===typeof this[0]||this[0]instanceof String?document.getElementById(this[0]):b.is$(this[0])?this[0][0]:this[0];d.afAnimateId||(d.afAnimateId=b.uuid());l=d.afAnimateId;n[l]?(c&&n[l].animate(c),c=n[l]):(c=m(d,c),n[l]=c);return c};var m=function(b,l){if(!(this instanceof m))return new m(b,l);if(this.el=b){l&&this.animate(l);var d=this;af(this.el).bind("destroy",function(){var b=d.el.afAnimateId;n[b]&&delete n[b]})}};m.prototype={animationTimer:null, isAnimating:!1,startX:0,startY:0,runTime:0,endX:0,endY:0,currX:0,currY:0,animationStartTime:0,pauseTime:0,completeCB:null,easingFn:"linear",animateOpts:{},updateCb:null,animate:function(c){this.isAnimating||(this.isAnimating=!0,window.cancelAnimationFrame(this.animationTimer),c||(c={x:0,y:0,duration:0}),this.easingFn=c.easing||"linear",this.completeCB=c.complete||null,this.updateCB=c.update||null,this.runTime=numOnly(c.duration),c.complete&&delete c.complete,this.animateOpts=c,this.startTime=Date.now(), this.startMatrix=b.getCssMatrix(this.el),0===this.runTime&&this.doAnimate())},start:function(){this.doAnimate()},doAnimate:function(){var b=Date.now(),l,d=this;0===this.runTime||b>=this.startTime+this.runTime?(d.setPosition(this.animateOpts.x,this.animateOpts.y),d.isAnimating=!1,this.updateCB&&this.updateCB({x:this.animateOpts.x,y:this.animateOpts.y}),this.completeCB&&this.completeCB()):(b=(b-this.startTime)/this.runTime,l=f[this.easingFn](1<b?1:b),b=(this.animateOpts.x-this.startMatrix.e)*l+this.startMatrix.e, l=(this.animateOpts.y-this.startMatrix.f)*l+this.startMatrix.f,this.setPosition(b,l),this.updateCB&&this.updateCB({x:b,y:l}),this.isAnimating&&(this.animationTimer=window.requestAnimationFrame(function(){d.doAnimate()})))},setPosition:function(c,l){this.el.style[b.feat.cssPrefix+"Transform"]="matrix3d( 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, "+c+", "+l+", 0, 1 )";this.currX=c;this.currY=l},stop:function(){this.isAnimating=!1;window.cancelAnimationFrame(this.animationTimer);this.pauseTime=Date.now()-this.startTime}, resume:function(){this.isAnimating=!0;this.startTime=Date.now()-this.pauseTime;this.doAnimate()}};var f={linear:function(b){return b},easeOutSine:function(b){return Math.sin(b*Math.PI/2)}}})(af);(function(b){var n=!1,m=function(a){a.preventDefault();a.stopPropagation()},f=function(a,e,h){h=h?h:e.target;-1===h.tagName.toUpperCase().indexOf("SELECT")&&(-1===h.tagName.toUpperCase().indexOf("TEXTAREA")&&-1===h.tagName.toUpperCase().indexOf("INPUT"))&&m(e);var c=document.createEvent("MouseEvent");c.initEvent(a,!0,!0);c.initMouseEvent(a,!0,!0,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.button,e.relatedTarget);"touchend"!==a&&(c.touches=[],c.touches[0]= {},c.touches[0].pageX=e.pageX,c.touches[0].pageY=e.pageY,c.touches[0].target=h,c.changedTouches=c.touches,c.targetTouches=c.touches);c.mouseToTouch=!0;if(b.os.ie)for(e=e.target;null!==e;)e.hasAttribute("on"+a)&&eval(e.getAttribute("on"+a)),e=e.parentElement;h.dispatchEvent(c)},c=!1,l=null,d=0,k=0;if(window.navigator.msPointerEnabled){var g=!1;document.addEventListener("MSPointerDown",function(a){g=c=!0;l=a.target;"a"===a.target.nodeName.toLowerCase()&&"javascript:;"===a.target.href.toLowerCase()&& (a.target.href="");f("touchstart",a);n=!1;d=a.clientX;k=a.clientY},!0);document.addEventListener("MSPointerUp",function(a){c&&(f("touchend",a,l),l=null,c=!1)},!0);document.addEventListener("MSPointerMove",function(a){g?g=!1:!(a.clientX===d&&a.clientY===k)&&c&&(f("touchmove",a,l),a.preventDefault(),n=!0)},!0)}else document.addEventListener("mousedown",function(a){c=!0;l=a.target;"a"===a.target.nodeName.toLowerCase()&&"javascript:;"===a.target.href.toLowerCase()&&(a.target.href="#");f("touchstart", a);n=!1;d=a.clientX;k=a.clientY},!0),document.addEventListener("mouseup",function(a){c&&(f("touchend",a,l),l=null,c=!1)},!0),document.addEventListener("mousemove",function(a){!(a.clientX===d&&a.clientY===k)&&c&&(f("touchmove",a,l),a.preventDefault(),n=!0)},!0);document.addEventListener("drag",m,!0);document.addEventListener("dragstart",m,!0);document.addEventListener("dragenter",m,!0);document.addEventListener("dragover",m,!0);document.addEventListener("dragleave",m,!0);document.addEventListener("dragend", m,!0);document.addEventListener("drop",m,!0);document.addEventListener("selectstart",function(a){var b=a.target;-1===b.tagName.toUpperCase().indexOf("SELECT")&&(-1===b.tagName.toUpperCase().indexOf("TEXTAREA")&&-1===b.tagName.toUpperCase().indexOf("INPUT"))&&m(a)},!0);document.addEventListener("click",function(a){!a.mouseToTouch&&a.target===l&&m(a);n&&(m(a),n=!1)},!0);window.addEventListener("resize",function(){var a=document.createEvent("Event");a.initEvent("orientationchange",!0,!0);document.dispatchEvent(a)}, !1)})(af);/* 2011 - Intel */ (function(b){b.passwordBox=function(){return new n};var n=function(){this.oldPasswords={}};n.prototype={showPasswordPlainText:!1,getOldPasswords:function(m){var f=m&&document.getElementById(m)?document.getElementById(m):document;if(f){m=f.getElementsByTagName("input");for(f=0;f<m.length;f++)"password"===m[f].type&&b.os.webkit&&(m[f].type="text",b(m[f]).vendorCss("TextSecurity","disc"))}else window.alert("Could not find container element for passwordBox "+m)},changePasswordVisiblity:function(m,f){m= parseInt(m,10);var c=document.getElementById(f);1===m?b(c).vendorCss("TextSecurity","none"):b(c).vendorCss("TextSecurity","disc");b.os.webkit||(c.type=1===m?"text":"password")}}})(af);(function(b){b.fn.popup=function(b){return new m(this[0],b)};var n=[],m=function(){var c=function(c,d){if(this.container="string"===typeof c||c instanceof String?document.getElementById(c):c)try{if("string"===typeof d||"number"===typeof d)d={message:d,cancelOnly:"true",cancelText:"OK"};this.id=d.id=d.id||b.uuid();this.addCssClass=d.addCssClass?d.addCssClass:"";this.title=d.suppressTitle?"":d.title||"Alert";this.message=d.message||"";this.cancelText=d.cancelText||"Cancel";this.cancelCallback=d.cancelCallback|| function(){};this.cancelClass=d.cancelClass||"button";this.doneText=d.doneText||"Done";this.doneCallback=d.doneCallback||function(){};this.doneClass=d.doneClass||"button";this.cancelOnly=d.cancelOnly||!1;this.onShow=d.onShow||function(){};this.autoCloseDone=void 0!==d.autoCloseDone?d.autoCloseDone:!0;n.push(this);1===n.length&&this.show()}catch(f){console.log("error adding popup "+f)}else window.alert("Error finding container for popup "+c)};c.prototype={id:null,addCssClass:null,title:null,message:null, cancelText:null,cancelCallback:null,cancelClass:null,doneText:null,doneCallback:null,doneClass:null,cancelOnly:!1,onShow:null,autoCloseDone:!0,supressTitle:!1,show:function(){var c=this,d="<div id='"+this.id+"' class='afPopup hidden "+this.addCssClass+"'><header>"+this.title+"</header><div>"+this.message+"</div><footer><a href='javascript:;' class='"+this.cancelClass+"' id='cancel'>"+this.cancelText+"</a><a href='javascript:;' class='"+this.doneClass+"' id='action'>"+this.doneText+"</a><div style='clear:both'></div></footer></div>"; b(this.container).append(b(d));var f=b.query("#"+this.id);f.bind("close",function(){c.hide()});this.cancelOnly&&(f.find("A#action").hide(),f.find("A#cancel").addClass("center"));f.find("A").each(function(){var d=b(this);d.bind("click",function(a){"cancel"===d.attr("id")?(c.cancelCallback.call(c.cancelCallback,c),c.hide()):(c.doneCallback.call(c.doneCallback,c),c.autoCloseDone&&c.hide());a.preventDefault()})});c.positionPopup();b.blockUI(0.5);f.bind("orientationchange",function(){c.positionPopup()}); f.find("header").show();f.find("footer").show();setTimeout(function(){f.removeClass("hidden");c.onShow(c)},50)},hide:function(){var c=this;b.query("#"+c.id).addClass("hidden");b.unblockUI();!b.os.ie&&!b.os.android?setTimeout(function(){c.remove()},250):c.remove()},remove:function(){var c=b.query("#"+this.id);c.unbind("close");c.find("BUTTON#action").unbind("click");c.find("BUTTON#cancel").unbind("click");c.unbind("orientationchange").remove();n.splice(0,1);0<n.length&&n[0].show()},positionPopup:function(){var c= b.query("#"+this.id);c.css("top",window.innerHeight/2.5+window.pageYOffset-c[0].clientHeight/2+"px");c.css("left",window.innerWidth/2-c[0].clientWidth/2+"px")}};return c}(),f=!1;b.blockUI=function(c){f||(c=c?" style='opacity:"+c+";'":"",b.query("BODY").prepend(b("<div id='mask'"+c+"></div>")),b.query("BODY DIV#mask").bind("touchstart",function(b){b.preventDefault()}),b.query("BODY DIV#mask").bind("touchmove",function(b){b.preventDefault()}),f=!0)};b.unblockUI=function(){f=!1;b.query("BODY DIV#mask").unbind("touchstart"); b.query("BODY DIV#mask").unbind("touchmove");b("BODY DIV#mask").remove()}})(af);(function(b){if(!b||!b.ui)throw"This plugin requires App Framework UI";b.extend(b.ui,{_hideHeaderOnScroll:!1,_hideFooterOnScroll:!1,hideHeaderOnScroll:function(){console.log(this);this._hideHeaderOnScroll=!0;this.setupScrollStart()},hideFooterOnScroll:function(){this._hideFooterOnScroll=!0;this.setupScrollStart()}});b.ui.ready(function(){var n=!1,m=!1,f=0,c=0,l,d,k=!1,g;for(g in b.ui.scrollingDivs)b.ui.scrollingDivs[g].initScrollProgress=!0,b.ui.scrollingDivs[g].lockBounce=!1;var a=b.ui.addDivAndScroll; b.ui.addDivAndScroll=function(){var e=a.apply(b.ui,arguments);b.ui.scrollingDivs[e].initScrollProgress=n||m;b.ui.scrollingDivs[e].lockBounce=!1};b.ui.setupScrollStart=function(){k||(b.bind(b.touchLayer,"scrollstart",e),b.bind(b.touchLayer,"scroll",h),k=!0)};b.ui.removeScrollStart=function(){b.unbind(b.touchLayer,"scrollstart",h)};var e=function(a,b){f=null;c=0},h=function(a){f||(f=a.y);var e;a.y<c&&80<Math.abs(a.y)-Math.abs(f)&&(b.ui._hideHeaderOnScroll&&!n&&(n=!0,e=b("#header"),l=e.css("height"), e.vendorCss("TransitionDuration","200ms"),e.css("height","0px"),f=a.y),b.ui._hideFooterOnScroll&&!m&&(m=!0,e=b("#navbar"),d=e.css("height"),e.vendorCss("TransitionDuration","200ms"),e.css("height","0px"),f=a.y));a.y>c&&-40>Math.abs(a.y)-Math.abs(f)&&(n&&b.ui._hideHeaderOnScroll&&(n=!1,e=b("#header"),e.css("height",l),f=a.y),m&&b.ui._hideFooterOnScroll&&(m=!1,e=b("#navbar"),e.css("height",d),f=a.y));c=a.y},q=b.ui.loadContent;b.ui.loadContent=function(){n&&b("#header").css("height",l);m&&b("#navbar").css("height", d);b("#header").vendorCss("TransitionDuration","");q.apply(b.ui,arguments);m=n=!1};b.ui.hideHeaderOnScroll();b.ui.hideFooterOnScroll()})})(af);/* Intel */ (function(b){function n(){if(b.os.android&&!b.os.chrome&&b.os.webkit){var c=!1;b.bind(b.touchLayer,["cancel-enter-edit","exit-edit"],function(){if(c){c=!1;for(var b in m){var f;m[b].el?f=!0:(delete m[b],f=!1);f&&m[b].androidFormsMode&&m[b].stopFormsMode()}}})}f=!0}var m=[];b.fn.scroller=function(f){for(var d,k,g=0;g<this.length;g++)d=this[g],d.afScrollerId||(d.afScrollerId=b.uuid()),k=d.afScrollerId,m[k]?d=m[k]:(f||(f={}),b.feat.nativeTouchScroll||(f.useJsScroll=!0),d=c(this[g],f),m[k]=d);return 1=== this.length?d:this};var f=!1,c=function(){function c(a,e){var h=document.createElement("div");h.style.position="absolute";h.style.width=a+"px";h.style.height=e+"px";h.style[b.feat.cssPrefix+"BorderRadius"]="2px";h.style.borderRadius="2px";h.style.display="none";h.className="scrollBar";h.style.background="black";return h}var d,k,g=function(a,e){this.el=a;this.afEl=b(this.el);for(var h in e)this[h]=e[h]};g.prototype={refresh:!1,refreshContent:"Pull to Refresh",refreshHangTimeout:2E3,refreshHeight:60, refreshElement:null,refreshCancelCB:null,refreshRunning:!1,scrollTop:0,scrollLeft:0,preventHideRefresh:!0,verticalScroll:!0,horizontalScroll:!1,refreshTriggered:!1,moved:!1,eventsActive:!1,rememberEventsActive:!1,scrollingLocked:!1,autoEnable:!0,blockFormsFix:!1,loggedPcentY:0,loggedPcentX:0,infinite:!1,infiniteEndCheck:!1,infiniteTriggered:!1,scrollSkip:!1,scrollTopInterval:null,scrollLeftInterval:null,bubbles:!0,lockBounce:!1,initScrollProgress:!1,_scrollTo:function(a,b){b=parseInt(b,10);if(0=== b||isNaN(b))this.el.scrollTop=Math.abs(a.y),this.el.scrollLeft=Math.abs(a.x);else{var h=(this.el.scrollTop-a.y)/Math.ceil(b/10),c=(this.el.scrollLeft-a.x)/Math.ceil(b/10),d=this,g=Math.ceil(this.el.scrollTop-a.y)/h,f=Math.ceil(this.el.scrollLeft-a.x)/h,l=0,k=0;d.scrollTopInterval=window.setInterval(function(){d.el.scrollTop-=h;k++;k>=g&&(d.el.scrollTop=a.y,clearInterval(d.scrollTopInterval))},10);d.scrollLeftInterval=window.setInterval(function(){d.el.scrollLeft-=c;l++;l>=f&&(d.el.scrollLeft=a.x, clearInterval(d.scrollLeftInterval))},10)}},enable:function(){},disable:function(){},hideScrollbars:function(){},addPullToRefresh:function(){},_scrollToTop:function(a){this._scrollTo({x:0,y:0},a)},_scrollToBottom:function(a){this._scrollTo({x:0,y:this.el.scrollHeight-this.el.offsetHeight},a)},scrollToBottom:function(a){return this._scrollToBottom(a)},scrollToTop:function(a){return this._scrollToTop(a)},init:function(a,e){this.el=a;this.afEl=b(this.el);this.defaultProperties();for(var h in e)this[h]= e[h];var c=this,d=function(a){c.eventsActive&&(!b.feat.nativeTouchScroll&&(!b.ui||b.ui.activeDiv===c.container))&&c.adjustScroll()};this.afEl.bind("destroy",function(){c.disable(!0);var a=c.el.afScrollerId;m[a]&&delete m[a];b.unbind(b.touchLayer,"orientationchange-reshape",d)});b.bind(b.touchLayer,"orientationchange-reshape",d);b(window).bind("resize",d)},needsFormsFix:function(a){return this.useJsScroll&&this.isEnabled()&&"none"!==this.el.style.display&&0<b(a).closest(this.afEl).size()},handleEvent:function(a){if(!this.scrollingLocked)switch(a.type){case "touchstart":clearInterval(this.scrollTopInterval); this.preventHideRefresh=!this.refreshRunning;this.moved=!1;this.onTouchStart(a);this.bubbles||a.stopPropagation();break;case "touchmove":this.onTouchMove(a);this.bubbles||a.stopPropagation();break;case "touchend":this.onTouchEnd(a);this.bubbles||a.stopPropagation();break;case "scroll":this.onScroll(a)}},coreAddPullToRefresh:function(a){a&&(this.refreshElement=a);null===this.refreshElement?(a=document.getElementById(this.container.id+"_pulldown"),a=null!==a?b(a):b("<div id='"+this.container.id+"_pulldown' class='afscroll_refresh' style='position:relative;height:60px;text-align:center;line-height:60px;font-weight:bold;'>"+ this.refreshContent+"</div>")):a=b(this.refreshElement);a=a.get(0);this.refreshContainer=b("<div style='overflow:hidden;height:0;width:100%;display:none;background:inherit;-webkit-backface-visibility: hidden !important;'></div>");b(this.el).prepend(this.refreshContainer.prepend(a));this.refreshContainer=this.refreshContainer[0]},fireRefreshRelease:function(a){if(this.refresh&&a&&(this.setRefreshContent("Refreshing..."),a=!1!==b.trigger(this,"refresh-release",[a]),this.preventHideRefresh=!1,this.refreshRunning= !0,a)){var e=this;0<this.refreshHangTimeout&&(this.refreshCancelCB=setTimeout(function(){e.hideRefresh()},this.refreshHangTimeout))}},setRefreshContent:function(a){b(this.container).find(".afscroll_refresh").html(a)},lock:function(){this.scrollingLocked||(this.scrollingLocked=!0,(this.rememberEventsActive=this.eventsActive)&&this.disable())},unlock:function(){this.scrollingLocked&&(this.scrollingLocked=!1,this.rememberEventsActive&&this.enable())},scrollToItem:function(a,e){b.is$(a)||(a=b(a));var h, c;"bottom"===e?(h=a.offset(),h=h.top-this.afEl.offset().bottom+h.height,h+=4):(h=a.offset().top,h-=document.body.scrollTop,c=this.afEl.offset().top,document.body.scrollTop<c&&(h-=c),h-=4);this.scrollBy({y:h,x:0},0)},setPaddings:function(a,e){var h=b(this.el),c=numOnly(h.css("paddingTop"));h.css("paddingTop",a+"px").css("paddingBottom",e+"px");this.scrollBy({y:a-c,x:0})},divide:function(a,b){return 0!==b?a/b:0},isEnabled:function(){return this.eventsActive},addInfinite:function(){this.infinite=!0}, clearInfinite:function(){this.infiniteTriggered=!1;this.scrollSkip=!0},scrollTo:function(a,b){return this._scrollTo(a,b)},updateP2rHackPosition:function(){}};d=function(a,e){this.init(a,e);if(e.hasParent)this.container=this.el.parentNode;else{var h=b.create("div",{});h.append(b(this.el).contents());b(this.el).append(h);this.container=this.el;this.el=h.get(0)}this.container.afScrollerId=a.afScrollerId;this.afEl=b(this.container);"hidden"!==this.container.style.overflow&&(this.container.style.overflow= "hidden");this.addPullToRefresh(null,!0);e.autoEnable&&(this.autoEnable=e.autoEnable);this.autoEnable&&this.enable(!0);this.verticalScroll&&(!0===this.verticalScroll&&!0===this.scrollBars)&&(h=c(5,20),h.style.top="0px",this.vScrollCSS&&(h.className=this.vScrollCSS),h.style.display="none",this.container.appendChild(h),this.vscrollBar=h);this.horizontalScroll&&(!0===this.horizontalScroll&&!0===this.scrollBars)&&(h=c(20,5),h.style.bottom="0px",this.hScrollCSS&&(h.className=this.hScrollCSS),h.style.display= "none",this.container.appendChild(h),this.hscrollBar=h);this.horizontalScroll&&(this.el.style.cssFloat="left");this.el.hasScroller=!0};k=function(a,e){e.nativeParent&&(a=a.parentNode);this.init(a,e);var h=b(a);if(!0===e.replaceParent){var c=h.parent();h.css("height",c.height()).css("width",c.width());h.insertBefore(h.parent());c.remove()}this.container=this.el;h.css("-webkit-overflow-scrolling","touch");e.autoEnable&&(this.autoEnable=e.autoEnable);this.autoEnable&&this.enable()};k.prototype=new g; d.prototype=new g;k.prototype.defaultProperties=function(){this.refreshContainer=null;this.dX=this.cX=this.dY=this.cY=0;this.cancelPropagation=!1;this.yReset=this.xReset=this.loggedPcentX=this.loggedPcentY=0;var a=this;this.adjustScrollOverflowProxy=function(){a.afEl.css("overflow","auto");a.afEl.parent().css("overflow","hidden")}};k.prototype.enable=function(a){this.eventsActive||(this.eventsActive=!0,this.el.style.overflow="auto",a||this.adjustScroll(),this.el.addEventListener("touchstart",this, !1),this.el.addEventListener("scroll",this,!1),this.updateP2rHackPosition())};k.prototype.disable=function(a){this.eventsActive&&(this.logPos(this.el.scrollLeft,this.el.scrollTop),!a&&!b.ui&&(this.el.style.overflow="hidden"),this.el.removeEventListener("touchstart",this,!1),this.el.removeEventListener("touchmove",this,!1),this.el.removeEventListener("touchend",this,!1),this.el.removeEventListener("scroll",this,!1),this.eventsActive=!1)};k.prototype.addPullToRefresh=function(a,b){b||(this.refresh= !0);this.refresh&&!0===this.refresh&&(this.coreAddPullToRefresh(a),this.refreshContainer.style.position="absolute",this.refreshContainer.style.top="-60px",this.refreshContainer.style.height="60px",this.refreshContainer.style.display="block",this.updateP2rHackPosition())};k.prototype.updateP2rHackPosition=function(){if(!this.refresh)return b(this.el).find(".p2rhack").remove();var a=b(this.el).find(".p2rhack");0===a.length&&(b(this.el).append("<div class='p2rhack' style='position:absolute;width:1px;height:1px;opacity:0;background:transparent;z-index:-1;-webkit-transform:translate3d(-1px,0,0);'></div>"), a=b(this.el).find(".p2rhack"));a.css("top",this.el.scrollHeight+this.refreshHeight+1+"px")};k.prototype.onTouchStart=function(a){this.lastScrollInfo={top:0};this.xReset=this.yReset=0;this.verticalScroll&&(0===this.el.scrollTop&&this.refresh&&(this.el.scrollTop=1,this.yReset=-1),this.el.scrollTop===this.el.scrollHeight-this.el.clientHeight&&this.infinite&&(this.el.scrollTop-=1,this.yReset=1));this.horizontalScroll&&(0===this.el.scrollLeft&&(this.el.scrollLeft=1,this.xReset=-1),this.el.scrollLeft=== this.el.scrollWidth-this.el.clientWidth&&(this.el.scrollLeft-=1,this.xReset=1));this.refreshCancelCB&&clearTimeout(this.refreshCancelCB);this.refresh&&this.el.addEventListener("touchend",this,!1);this.el.addEventListener("touchmove",this,!1);this.dY=a.touches[0].pageY;this.dX=a.touches[0].pageX;this.startTop=this.el.scrollTop;this.startLeft=this.el.scrollLeft;(this.refresh||this.infinite)&&this.refresh&&0>this.dY&&this.showRefresh()};k.prototype.onTouchMove=function(a){var e=a.touches[0].pageY-this.dY, h=a.touches[0].pageX-this.dX,c=this.el.scrollHeight-this.el.scrollTop===this.el.clientHeight&&0>e,d=this.el.scrollWidth-this.el.scrollLeft===this.el.clientWidth&&0>h,g="input"!==a.target.tagName.toLowerCase();this.verticalScroll&&0===this.startTop&&0===this.el.scrollTop&&0<e&&g&&a.preventDefault();this.horizontalScroll&&0===this.startTop&&0===this.el.scrollLeft&&0<h&&g&&a.preventDefault();this.verticalScroll&&c&&g&&a.preventDefault();this.horizontalScroll&&d&&g&&a.preventDefault();this.moved||(b.trigger(this, "scrollstart",[this.el,{x:h,y:e}]),b.trigger(b.touchLayer,"scrollstart",[this.el,{x:h,y:e}]),this.refresh||this.el.addEventListener("touchend",this,!1),this.moved=!0);this.horizontalScroll&&Math.abs(e)>Math.abs(h)&&a.preventDefault();this.refresh&&this.el.scrollTop<-this.refreshHeight?this.showRefresh():this.refresh&&this.refreshTriggered&&this.refreshRunning&&this.el.scrollTop>this.refreshHeight?(this.refreshRunning=this.refreshTriggered=!1,this.refreshCancelCB&&clearTimeout(this.refreshCancelCB), this.hideRefresh(!1),this.setRefreshContent("Pull to Refresh"),b.trigger(this,"refresh-cancel")):this.refresh&&(this.refreshTriggered&&!this.refreshRunning&&this.el.scrollTop>-this.refreshHeight)&&(this.refreshRunning=this.refreshTriggered=!1,this.refreshCancelCB&&clearTimeout(this.refreshCancelCB),this.hideRefresh(!1),this.setRefreshContent("Pull to Refresh"),b.trigger(this,"refresh-cancel"));this.cY=e;this.cX=h;this.lastScrollInfo.top=this.cY;this.initScrollProgress&&(b.trigger(this,"scroll",[{x:-this.el.scrollLeft, y:-this.el.scrollTop}]),b.trigger(b.touchLayer,"scroll",[{x:-this.el.scrollLeft,y:-this.el.scrollTop}]))};k.prototype.showRefresh=function(){this.refreshTriggered||(this.refreshTriggered=!0,this.setRefreshContent("Release to Refresh"),b.trigger(this,"refresh-trigger"))};k.prototype.onTouchEnd=function(a){a=this.el.scrollTop<=-this.refreshHeight;this.fireRefreshRelease(a,!0);this.moved||(this.el.scrollTop+=this.yReset,this.el.scrollLeft+=this.xReset);if(a&&this.refresh){var e=b.create("<div style='height:"+ this.el.clientHeight+this.refreshHeight+"px;width:1px;-webkit-transform:translated3d(-1px,0,0)'></div>");b(this.el).append(e);this.refreshContainer.style.top="0px";this.refreshContainer.style.position="";setTimeout(function(){e.remove()})}this.el.removeEventListener("touchmove",this,!1);this.el.removeEventListener("touchend",this,!1);this.infiniteEndCheck=!0;this.infinite&&(!this.infiniteTriggered&&this.el.scrollTop>=this.el.scrollHeight-this.el.clientHeight)&&(this.infiniteTriggered=!0,b.trigger(this, "infinite-scroll"),this.infiniteEndCheck=!0);this.touchEndFired=!0;var h=this,c=this.el.scrollTop,d=this.el.scrollLeft,g=0;clearInterval(h.nativePolling);h.nativePolling=setInterval(function(){g++;25===g&&h.initScrollProgress&&(b.trigger(h,"scroll",[{x:-h.el.scrollLeft+h.cX,y:-h.el.scrollTop+h.cY}]),b.trigger(b.touchLayer,"scroll",[{x:-h.el.scrollLeft+h.cX,y:-h.el.scrollTop+h.cY}]));if(200<=g)clearInterval(h.nativePolling),h.initScrollProgress&&(b.trigger(h,"scroll",[{x:-h.el.scrollLeft,y:-h.el.scrollTop}]), b.trigger(b.touchLayer,"scroll",[{x:-h.el.scrollLeft,y:-h.el.scrollTop}]));else if(h.el.scrollTop!==c||h.el.scrollLeft!==d)clearInterval(h.nativePolling),b.trigger(b.touchLayer,"scrollend",[h.el]),b.trigger(h,"scrollend",[h.el]),h.initScrollProgress&&(b.trigger(h,"scroll",[{x:-h.el.scrollLeft,y:-h.el.scrollTop}]),b.trigger(b.touchLayer,"scroll",[{x:-h.el.scrollLeft,y:-h.el.scrollTop}]))},20)};k.prototype.hideRefresh=function(a){if(!this.preventHideRefresh){var e=this,h=function(a){e.refreshContainer.style.top= "-60px";e.refreshContainer.style.position="absolute";e.dY=e.cY=0;a||(e.el.style[b.feat.cssPrefix+"Transform"]="none",e.el.style[b.feat.cssPrefix+"TransitionProperty"]="none",e.el.scrollTop=0,e.logPos(e.el.scrollLeft,0),e.refreshRunning=!1,e.setRefreshContent("Pull to Refresh"),b.trigger(e,"refresh-finish"))};!1===a||!e.afEl.css3Animate?h():e.afEl.css3Animate({y:e.el.scrollTop-e.refreshHeight+"px",x:"0%",time:"325ms",complete:h});this.refreshTriggered=!1}};k.prototype.hideScrollbars=function(){};k.prototype.scrollTo= function(a,b){this.logPos(a.x,a.y);a.x*=-1;a.y*=-1;return this._scrollTo(a,b)};k.prototype.scrollBy=function(a,b){a.x+=this.el.scrollLeft;a.y+=this.el.scrollTop;this.logPos(this.el.scrollLeft,this.el.scrollTop);return this._scrollTo(a,b)};k.prototype.scrollToBottom=function(a){this._scrollToBottom(a);this.logPos(this.el.scrollLeft,this.el.scrollTop)};k.prototype.onScroll=function(a){this.infinite&&this.touchEndFired?this.touchEndFired=!1:this.scrollSkip?this.scrollSkip=!1:(this.infinite&&(!this.infiniteTriggered&& this.el.scrollTop>=this.el.scrollHeight-this.el.clientHeight)&&(this.infiniteTriggered=!0,b.trigger(this,"infinite-scroll"),this.infiniteEndCheck=!0),this.infinite&&(this.infiniteEndCheck&&this.infiniteTriggered)&&(this.infiniteEndCheck=!1,b.trigger(this,"infinite-scroll-end")))};k.prototype.logPos=function(a,b){this.loggedPcentX=this.divide(a,this.el.scrollWidth);this.loggedPcentY=this.divide(b,this.el.scrollHeight);this.scrollLeft=a;this.scrollTop=b;isNaN(this.loggedPcentX)&&(this.loggedPcentX= 0);isNaN(this.loggedPcentY)&&(this.loggedPcentY=0)};k.prototype.adjustScroll=function(){this.adjustScrollOverflowProxy();this.el.scrollLeft=this.loggedPcentX*this.el.scrollWidth;this.el.scrollTop=this.loggedPcentY*this.el.scrollHeight;this.logPos(this.el.scrollLeft,this.el.scrollTop)};d.prototype.defaultProperties=function(){this.boolScrollLock=!1;this.elementInfo=this.currentScrollingObject=null;this.verticalScroll=!0;this.horizontalScroll=!1;this.scrollBars=!0;this.hscrollBar=this.vscrollBar=null; this.vScrollCSS=this.hScrollCSS="scrollBar";this.firstEventInfo=null;this.moved=!1;this.preventPullToRefresh=!0;this.refreshSafeKeep=this.androidFormsMode=this.isScrolling=!1;this.lastScrollbar="";this.scrollingFinishCB=this.container=this.finishScrollingObject=null;this.androidPerfHack=this.loggedPcentX=this.loggedPcentY=0};d.prototype.enable=function(a){this.eventsActive||(this.eventsActive=!0,a?this.scrollerMoveCSS({x:0,y:0},0):this.adjustScroll(),this.container.addEventListener("touchstart",this, !1),this.container.addEventListener("touchmove",this,!1),this.container.addEventListener("touchend",this,!1))};d.prototype.adjustScroll=function(){var a=this.getViewportSize();this.scrollerMoveCSS({x:Math.round(this.loggedPcentX*(this.el.clientWidth-a.w)),y:Math.round(this.loggedPcentY*(this.el.clientHeight-a.h))},0)};d.prototype.disable=function(){if(this.eventsActive){var a=this.getCSSMatrix(this.el);this.logPos(numOnly(a.e)-numOnly(this.container.scrollLeft),numOnly(a.f)-numOnly(this.container.scrollTop)); this.container.removeEventListener("touchstart",this,!1);this.container.removeEventListener("touchmove",this,!1);this.container.removeEventListener("touchend",this,!1);this.eventsActive=!1}};d.prototype.addPullToRefresh=function(a,b){b||(this.refresh=!0);this.refresh&&!0===this.refresh&&(this.coreAddPullToRefresh(a),this.el.style.overflow="visible")};d.prototype.hideScrollbars=function(){this.hscrollBar&&(this.hscrollBar.style.display="none",this.hscrollBar.style[b.feat.cssPrefix+"TransitionDuration"]= "0ms");this.vscrollBar&&(this.vscrollBar.style.display="none",this.vscrollBar.style[b.feat.cssPrefix+"TransitionDuration"]="0ms")};d.prototype.getViewportSize=function(){var a=window.getComputedStyle(this.container);isNaN(numOnly(a.paddingTop))&&window.alert(typeof a.paddingTop+"::"+a.paddingTop+":");return{h:this.container.clientHeight>window.innerHeight?window.innerHeight:this.container.clientHeight-numOnly(a.paddingTop)-numOnly(a.paddingBottom),w:this.container.clientWidth>window.innerWidth?window.innerWidth: this.container.clientWidth-numOnly(a.paddingLeft)-numOnly(a.paddingRight)}};d.prototype.onTouchStart=function(a){this.moved=!1;this.currentScrollingObject=null;b(this.el).animate().stop();if(this.container&&(this.refreshCancelCB&&(clearTimeout(this.refreshCancelCB),this.refreshCancelCB=null),this.scrollingFinishCB&&(clearTimeout(this.scrollingFinishCB),this.scrollingFinishCB=null),!(1!==a.touches.length||this.boolScrollLock)&&!(a.touches[0].target&&void 0!==a.touches[0].target.type&&"select"===a.touches[0].target.tagName.toLowerCase()))){var e= {top:0,left:0,speedY:0,speedX:0,absSpeedY:0,absSpeedX:0,deltaY:0,deltaX:0,absDeltaY:0,absDeltaX:0,y:0,x:0,duration:0};this.elementInfo={};var h=this.getViewportSize();this.elementInfo.bottomMargin=h.h;this.elementInfo.maxTop=this.el.clientHeight-this.elementInfo.bottomMargin;0>this.elementInfo.maxTop&&(this.elementInfo.maxTop=0);this.elementInfo.divHeight=this.el.clientHeight;this.elementInfo.rightMargin=h.w;this.elementInfo.maxLeft=this.el.clientWidth-this.elementInfo.rightMargin;0>this.elementInfo.maxLeft&& (this.elementInfo.maxLeft=0);this.elementInfo.divWidth=this.el.clientWidth;this.elementInfo.hasVertScroll=this.verticalScroll||0<this.elementInfo.maxTop;this.elementInfo.hasHorScroll=0<this.elementInfo.maxLeft;this.elementInfo.requiresVScrollBar=this.vscrollBar&&this.elementInfo.hasVertScroll;this.elementInfo.requiresHScrollBar=this.hscrollBar&&this.elementInfo.hasHorScroll;this.saveEventInfo(a);this.saveFirstEventInfo(a);a=this.getCSSMatrix(this.el);e.top=numOnly(a.f)-numOnly(this.container.scrollTop); e.left=numOnly(a.e)-numOnly(this.container.scrollLeft);this.container.scrollTop=this.container.scrollLeft=0;this.currentScrollingObject=this.el;this.refresh&&0===e.top?(this.refreshContainer.style.display="block",this.refreshHeight=this.refreshContainer.firstChild.clientHeight,this.refreshContainer.firstChild.style.top=-this.refreshHeight+"px",this.refreshContainer.style.overflow="visible",this.preventPullToRefresh=!1):0>e.top&&(this.preventPullToRefresh=!0,this.refresh&&(this.refreshContainer.style.overflow= "hidden"));e.x=e.left;e.y=e.top;this.setVScrollBar(e,0,0)&&(this.vscrollBar.style.right="0px",this.vscrollBar.style[b.feat.cssPrefix+"Transition"]="",b(this.vscrollBar).animate().stop());this.setHScrollBar(e,0,0)&&(this.container.clientHeight>window.innerHeight?this.hscrollBar.style.top=window.innerHeight-numOnly(this.hscrollBar.style.height)+"px":this.hscrollBar.style.bottom=numOnly(this.hscrollBar.style.height),this.hscrollBar.style[b.feat.cssPrefix+"Transition"]="",b(this.hscrollBar).animate().stop()); this.lastScrollInfo=e;this.hasMoved=!1;0===this.elementInfo.maxTop&&0===this.elementInfo.maxLeft&&this.lockBounce?this.scrollToTop(0):this.scrollerMoveCSS(this.lastScrollInfo,0);this.scrollerMoveCSS(this.lastScrollInfo,0)}};d.prototype.getCSSMatrix=function(a){if(this.androidFormsMode){var e=parseInt(a.style.marginTop,10);a=parseInt(a.style.marginLeft,10);isNaN(e)&&(e=0);isNaN(a)&&(a=0);return{f:e,e:a}}return b.getCssMatrix(a)};d.prototype.saveEventInfo=function(a){this.lastEventInfo={pageX:a.touches[0].pageX, pageY:a.touches[0].pageY,time:a.timeStamp}};d.prototype.saveFirstEventInfo=function(a){this.firstEventInfo={pageX:a.touches[0].pageX,pageY:a.touches[0].pageY,time:a.timeStamp}};d.prototype.setVScrollBar=function(a,b,h){if(!this.elementInfo.requiresVScrollBar)return!1;var c=parseFloat(this.elementInfo.bottomMargin/this.elementInfo.divHeight)*this.elementInfo.bottomMargin+"px";numOnly(c)>this.elementInfo.bottomMargin&&(c=this.elementInfo.bottomMargin+"px");c!==this.vscrollBar.style.height&&(this.vscrollBar.style.height= c);a=this.elementInfo.bottomMargin-numOnly(this.vscrollBar.style.height)-(this.elementInfo.maxTop+a.y)/this.elementInfo.maxTop*(this.elementInfo.bottomMargin-numOnly(this.vscrollBar.style.height));a>this.elementInfo.bottomMargin&&(a=this.elementInfo.bottomMargin);0>a&&(a=0);this.scrollbarMoveCSS(this.vscrollBar,{x:0,y:a},b,h);return!0};d.prototype.setHScrollBar=function(a,b,c){if(!this.elementInfo.requiresHScrollBar)return!1;var d=parseFloat(this.elementInfo.rightMargin/this.elementInfo.divWidth)* this.elementInfo.rightMargin+"px";d!==this.hscrollBar.style.width&&(this.hscrollBar.style.width=d);a=this.elementInfo.rightMargin-numOnly(this.hscrollBar.style.width)-(this.elementInfo.maxLeft+a.x)/this.elementInfo.maxLeft*(this.elementInfo.rightMargin-numOnly(this.hscrollBar.style.width));a>this.elementInfo.rightMargin&&(a=this.elementInfo.rightMargin);0>a&&(a=0);this.scrollbarMoveCSS(this.hscrollBar,{x:a,y:0},b,c);return!0};d.prototype.onTouchMove=function(a){if(null!==this.currentScrollingObject){var e= this.calculateMovement(a);this.calculateTarget(e);this.lastScrollInfo=e;this.moved||(b.trigger(this,"scrollstart",[this.el,{x:this.lastScrollInfo.top,y:this.lastScrollInfo.left}]),b.trigger(b.touchLayer,"scrollstart",[this.el,{x:this.lastScrollInfo.top,y:this.lastScrollInfo.left}]),this.elementInfo.requiresVScrollBar&&(this.vscrollBar.style.display="block"),this.elementInfo.requiresHScrollBar&&(this.hscrollBar.style.display="block"));this.moved=!0;this.refresh&&0===e.top?(this.refreshContainer.style.display= "block",this.refreshHeight=this.refreshContainer.firstChild.clientHeight,this.refreshContainer.firstChild.style.top=-this.refreshHeight+"px",this.refreshContainer.style.overflow="visible",this.preventPullToRefresh=!1):0>e.top&&(this.preventPullToRefresh=!0,this.refresh&&(this.refreshContainer.style.overflow="hidden"));this.saveEventInfo(a);if(!1===this.isScrolling&&(this.isScrolling=!0,this.onScrollStart))this.onScrollStart();a=this.getCSSMatrix(this.el);this.lastScrollInfo.top=numOnly(a.f);this.lastScrollInfo.left= numOnly(a.e);this.recalculateDeltaY(this.lastScrollInfo);this.recalculateDeltaX(this.lastScrollInfo);this.checkYboundary(this.lastScrollInfo);this.elementInfo.hasHorScroll&&this.checkXboundary(this.lastScrollInfo);a=0<this.lastScrollInfo.y&&0<this.lastScrollInfo.deltaY;var c=this.lastScrollInfo.y<-this.elementInfo.maxTop&&0>this.lastScrollInfo.deltaY,d;if(a||c)e=a?this.lastScrollInfo.y:-this.lastScrollInfo.y-this.elementInfo.maxTop,e=(this.container.clientHeight-e)/this.container.clientHeight,0.5> e&&(e=0.5),d=0,a&&0<this.lastScrollInfo.top||c&&this.lastScrollInfo.top<-this.elementInfo.maxTop?d=this.lastScrollInfo.top:c&&(d=-this.elementInfo.maxTop),c=this.lastScrollInfo.deltaY*e,1>Math.abs(this.lastScrollInfo.deltaY*e)&&(c=a?1:-1),this.lastScrollInfo.y=d+c;if(this.elementInfo.hasHorScroll&&(a=0<this.lastScrollInfo.x&&0<this.lastScrollInfo.deltaX,c=this.lastScrollInfo.x<-this.elementInfo.maxLeft&&0>this.lastScrollInfo.deltaX,a||c))e=a?this.lastScrollInfo.x:-this.lastScrollInfo.x-this.elementInfo.maxLeft, e=(this.container.clientWidth-e)/this.container.clientWidth,0.5>e&&(e=0.5),d=0,a&&0<this.lastScrollInfo.left||c&&this.lastScrollInfo.left<-this.elementInfo.maxLeft?d=this.lastScrollInfo.left:c&&(d=-this.elementInfo.maxLeft),c=this.lastScrollInfo.deltaX*e,1>Math.abs(this.lastScrollInfo.deltaX*e)&&(c=a?1:-1),this.lastScrollInfo.x=d+c;if(this.lockBounce||!this.refresh)0<this.lastScrollInfo.x?this.lastScrollInfo.x=0:-1*this.lastScrollInfo.x>this.elementInfo.maxLeft&&(this.lastScrollInfo.x=-1*this.elementInfo.maxLeft), 0<this.lastScrollInfo.y?this.lastScrollInfo.y=0:-1*this.lastScrollInfo.y>this.elementInfo.maxTop&&(this.lastScrollInfo.y=-1*this.elementInfo.maxTop);this.scrollerMoveCSS(this.lastScrollInfo,0);this.setVScrollBar(this.lastScrollInfo,0,0);this.setHScrollBar(this.lastScrollInfo,0,0);this.refresh&&!this.preventPullToRefresh&&(!this.refreshTriggered&&this.lastScrollInfo.top>this.refreshHeight?(this.refreshTriggered=!0,this.setRefreshContent("Release to Refresh"),b.trigger(this,"refresh-trigger")):this.refreshTriggered&& this.lastScrollInfo.top<this.refreshHeight&&(this.refreshTriggered=!1,this.setRefreshContent("Pull to Refresh"),b.trigger(this,"refresh-cancel")));this.infinite&&!this.infiniteTriggered&&Math.abs(this.lastScrollInfo.top)>this.el.clientHeight-this.container.clientHeight&&(this.infiniteTriggered=!0,b.trigger(this,"infinite-scroll"))}};d.prototype.calculateMovement=function(a,b){var c={top:0,left:0,speedY:0,speedX:0,absSpeedY:0,absSpeedX:0,deltaY:0,deltaX:0,absDeltaY:0,absDeltaX:0,y:0,x:0,duration:0}, d=b?this.firstEventInfo:this.lastEventInfo,g=b?a.pageX:a.touches[0].pageX,f=b?a.pageY:a.touches[0].pageY,l=b?a.time:a.timeStamp;c.deltaY=this.elementInfo.hasVertScroll?f-d.pageY:0;c.deltaX=this.elementInfo.hasHorScroll?g-d.pageX:0;c.time=l;c.duration=l-d.time;return c};d.prototype.calculateTarget=function(a){a.y=this.lastScrollInfo.y+a.deltaY;a.x=this.lastScrollInfo.x+a.deltaX;0<Math.abs(a.deltaY)&&(a.y+=(0<a.deltaY?1:-1)*this.elementInfo.divHeight*this.androidPerfHack);0<Math.abs(a.deltaX)&&(a.x+= (0<a.deltaX?1:-1)*this.elementInfo.divWidth*this.androidPerfHack)};d.prototype.checkYboundary=function(a){var b=this.container.clientHeight/2,c=this.elementInfo.maxTop+b;if(a.y>b)a.y=b;else if(-a.y>c)a.y=-c;else return;this.recalculateDeltaY(a)};d.prototype.checkXboundary=function(a){var b=this.container.clientWidth/2,c=this.elementInfo.maxLeft+b;if(a.x>b)a.x=b;else if(-a.x>c)a.x=-c;else return;this.recalculateDeltaX(a)};d.prototype.recalculateDeltaY=function(a){var b=Math.abs(a.deltaY);a.deltaY= a.y-a.top;var c=Math.abs(a.deltaY);a.duration=a.duration*c/b};d.prototype.recalculateDeltaX=function(a){var b=Math.abs(a.deltaX);a.deltaX=a.x-a.left;var c=Math.abs(a.deltaX);a.duration=a.duration*c/b};d.prototype.hideRefresh=function(a){var e=this;if(!this.preventHideRefresh){var c=function(){e.setRefreshContent("Pull to Refresh");b.trigger(e,"refresh-finish")};this.scrollerMoveCSS({x:0,y:0},325);!1===a||!e.afEl.css3Animate?c():e.afEl.css3Animate({time:"325ms",complete:c});this.refreshTriggered=!1}}; d.prototype.setMomentum=function(a){a.speedY=this.divide(a.deltaY,a.duration);a.speedX=this.divide(a.deltaX,a.duration);a.absSpeedY=Math.abs(a.speedY);a.absSpeedX=Math.abs(a.speedX);a.absDeltaY=Math.abs(a.deltaY);a.absDeltaX=Math.abs(a.deltaX);if(0<a.absDeltaY){if(a.deltaY+=(0>a.deltaY?-1:1)*a.absSpeedY*a.absSpeedY/0.0016,a.absDeltaY=Math.abs(a.deltaY),a.duration=a.absSpeedY/8E-4,a.speedY=a.deltaY/a.duration,a.absSpeedY=Math.abs(a.speedY),0.08>a.absSpeedY||5>a.absDeltaY)a.deltaY=a.absDeltaY=a.duration= a.speedY=a.absSpeedY=0}else if(a.absDeltaX){if(a.deltaX+=(0>a.deltaX?-1:1)*a.absSpeedX*a.absSpeedX/0.0016,a.absDeltaX=Math.abs(a.deltaX),a.duration=a.absSpeedX/8E-4,a.speedX=a.deltaX/a.duration,a.absSpeedX=Math.abs(a.speedX),0.08>a.absSpeedX||5>a.absDeltaX)a.deltaX=a.absDeltaX=a.duration=a.speedX=a.absSpeedX=0}else a.duration=0};d.prototype.onTouchEnd=function(a){if(null!==this.currentScrollingObject&&this.moved){this.finishScrollingObject=this.currentScrollingObject;this.currentScrollingObject=null; a=this.calculateMovement(this.lastEventInfo,!0);this.androidFormsMode||this.setMomentum(a);this.calculateTarget(a);var e=this.getCSSMatrix(this.el);a.top=numOnly(e.f);a.left=numOnly(e.e);this.checkYboundary(a);this.elementInfo.hasHorScroll&&this.checkXboundary(a);e=!this.preventPullToRefresh&&(a.top>this.refreshHeight||a.y>this.refreshHeight);this.fireRefreshRelease(e,0<a.top);if(this.refresh&&e)a.y=this.refreshHeight,a.duration=325;else if(0<=