Browse files

Honeycomb reports "none" for a WebkitCSSMatrix if it's not set. Updat…

…ed scrolling and animate libraries to parse the integer value.

Throws a DOM Exception 12 error when it hasn't been set, so a try/catch is needed.
  • Loading branch information...
1 parent 8f9c836 commit a5413d2c6cead475fad760c1df861b7309a974c4 Ian Maffett committed Aug 2, 2011
Showing with 59 additions and 50 deletions.
  1. +33 −32 aUX_ui.min.js
  2. +6 −4 aUX_webCss3animate.js
  3. +20 −14 aUX_webScroll.js
View
65 aUX_ui.min.js
@@ -1,50 +1,51 @@
window.aUX||(aUX={});if(!aUX.web)aUX.web={};
-aUX.web.scroller=function(){function b(c,b){var a=document.createElement("div");a.style.position="absolute";a.style.width=c+"px";a.style.height=b+"px";a.style.webkitBorderRadius="2px";a.className="scrollBar";a.style.opacity=0.7;a.style.background="black";return a}var a="m11"in new WebKitCSSMatrix?"3d(":"(",g="m11"in new WebKitCSSMatrix?",0)":")",d=!1,f=function(c,h){if(this.el=typeof c=="string"||c instanceof String?document.getElementById(c):c){if(this instanceof f)for(j in h)this[j]=h[j];else return new f(c,
-h);try{this.container=this.el.parentNode;var a=this;this.el.addEventListener("touchmove",function(c){a.touchMove(c)},!1);this.el.addEventListener("touchend",function(c){a.touchEnd(c)},!1);if(this.verticalScroll&&this.verticalScroll==!0&&this.scrollBars==!0){var e=b(5,20);e.style.top="0px";e.className=this.vScrollCSS;e.style.opacity="0";this.container.appendChild(e);this.vscrollBar=e}if(this.horizontalScroll&&this.horizontalScroll==!0&&this.scrollBars==!0)e=b(20,5),e.style.bottom="0px",e.className=
-this.hScrollCSS,e.style.opacity="0",this.container.appendChild(e),this.hscrollBar=e}catch(d){alert("error adding scroller"+d)}}else alert("Could not find element for scroller "+c)};f.prototype={lockX:0,lockY:0,boolScrollLock:!1,currentScrollingObject:null,bottomMargin:0,maxTop:0,startTop:0,verticalScroll:!0,horizontalScroll:!1,scrollBars:!0,vscrollBar:null,hscrollBar:null,hScrollCSS:"scrollBar",vScrollCSS:"scrollBar",divHeight:0,lastScrollbar:"",timeMoved:0,vdistanceMoved:0,hdistanceMoved:0,prevTime:0,
-finishScrollingObject:null,container:null,maxLeft:0,startLeft:0,rightMargin:0,divWidth:0,touchMove:function(c){try{if(d||(d=!0,this.touchStart(c)),this.currentScrollingObject!=null){c.preventDefault();var b={x:0,y:0},a=0,e=0,f=0,g=0;if(this.verticalScroll){var p=this.lockY-c.touches[0].pageY,p=-p,a=this.startTop+p,e=(new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).f;b.y=a}if(this.horizontalScroll){var m=this.lockX-c.touches[0].pageX,m=-m,p=f=this.startLeft+m,g=-(new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).e;
-b.x=p}this.scrollerMoveCSS(this.currentScrollingObject,b,0);if(this.vscrollBar){var q=this.bottomMargin-numOnly(this.vscrollBar.style.height)-(this.maxTop+a)/this.maxTop*(this.bottomMargin-numOnly(this.vscrollBar.style.height));this.scrollerMoveCSS(this.vscrollBar,{x:0,y:q},0)}this.hscrollBar&&(q=this.rightMargin-numOnly(this.hscrollBar.style.width)-(this.maxLeft+f)/this.maxLeft*(this.rightMargin-numOnly(this.hscrollBar.style.width)),this.scrollerMoveCSS(this.hscrollBar,{x:q,y:0},0));if(this.prevTime){var t=
-Math.abs(e)-Math.abs(a),s=Math.abs(g)-Math.abs(f),o=c.timeStamp-this.prevTime;o<1E3?(this.timeMoved+=o,this.vdistanceMoved+=t,this.hdistanceMoved+=s):this.hdistanceMoved=this.vdistanceMoved=this.timeMoved=0}this.prevTime=c.timeStamp}}catch(n){alert("error in scrollMove: "+n)}},touchStart:function(c){var b=this.container,a=this.el;if(b)try{if(c.touches[0].target&&c.touches[0].target.type!=void 0){var e=c.touches[0].target.tagName.toLowerCase();if(e=="select"||e=="input"||e=="button")return}this.hdistanceMoved=
-this.vdistanceMoved=this.timeMoved=0;this.finishScrollingObject=this.prevTime=null;this.bottomMargin=b.clientHeight>window.innerHeight?window.innerHeight:b.clientHeight;this.maxTop=a.clientHeight-this.bottomMargin;this.divHeight=a.clientHeight;this.rightMargin=b.clientWidth>window.innerWidth?window.innerWidth:b.clientWidth;this.maxLeft=a.clientWidth-this.rightMargin;this.divWidth=a.clientWidth;if(!(this.maxTop<0)&&c.touches.length==1&&this.boolScrollLock==!1){try{this.startTop=(new WebKitCSSMatrix(window.getComputedStyle(a).webkitTransform)).f,
-this.startLeft=(new WebKitCSSMatrix(window.getComputedStyle(a).webkitTransform)).e}catch(d){this.startLeft=this.startTop=0,console.log("error scroller touchstart "+d)}this.lockX=c.touches[0].pageX;this.lockY=c.touches[0].pageY;this.currentScrollingObject=a;if(this.vscrollBar){this.vscrollBar.style.height=parseFloat(this.bottomMargin/this.divHeight)*this.bottomMargin+"px";var f=this.bottomMargin-numOnly(this.vscrollBar.style.height)-(this.maxTop+this.startTop)/this.maxTop*(this.bottomMargin-numOnly(this.vscrollBar.style.height));
-this.scrollerMoveCSS(this.vscrollBar,{x:0,y:f},0);this.container.clientWidth>window.innerWidth?this.vscrollBar.style.left=window.innerWidth-numOnly(this.vscrollBar.style.width)+"px":this.vscrollBar.style.right="0px";this.vscrollBar.webkitTransition="opacity";this.vscrollBar.style.opacity=1}if(this.hscrollBar)this.hscrollBar.style.width=parseFloat(this.rightMargin/this.divWidth)*this.rightMargin+"px",f=this.rightMargin-numOnly(this.hscrollBar.style.width)-(this.maxTop+this.startLeft)/this.maxtLeft*
-(this.rightMargin-numOnly(this.hscrollBar.style.width)),this.scrollerMoveCSS(this.hscrollBar,{x:f,y:0},0),this.container.clientHeight>window.innerHeight?this.hscrollBar.style.top=window.innerHeight-numOnly(this.hscrollBar.style.height)+"px":this.hscrollBar.style.bottom="0px",this.hscrollBar.webkitTransition="opacity",this.hscrollBar.style.opacity=1;c.preventDefault()}}catch(g){alert("error in scrollStart: "+g)}},touchEnd:function(b){if(this.currentScrollingObject!=null){b.preventDefault();b.stopPropagation();
-this.finishScrollingObject=this.currentScrollingObject;this.currentScrollingObject=null;b={x:0,y:0};if(this.verticalScroll){var a=-this.vdistanceMoved,f=this.timeMoved,e=2,g=Math.abs(a)/f*1E3,f=Math.abs(a)/f*e,e=g*g/e/1E3/f;newTime=0;e*=a<0?-1:1;newTime=g/2;a=(new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).f;a<0&&(a-=e);a>0&&(a=0);a<-this.maxTop&&(a=-this.maxTop);b.y=a}if(this.horizontalScroll)a=-this.hdistanceMoved,f=this.timeMoved,e=2,g=Math.abs(a)/f*1E3,f=Math.abs(a)/f*
-e,e=g*g/e/1E3/f,newTime=0,e*=a<0?-1:1,newTime=g/2,a=(new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).e,a<0&&(a-=e),a>0&&(a=0),a<-this.maxLeft&&(a=-this.maxLeft),b.x=a;this.scrollerMoveCSS(this.finishScrollingObject,b,300,"ease-out");if(this.vscrollBar){a=this.bottomMargin-numOnly(this.vscrollBar.style.height)-(this.maxTop+b.y)/this.maxTop*(this.bottomMargin-numOnly(this.vscrollBar.style.height));if(a>this.bottomMargin)a=this.bottomMargin;a<0&&(a=0);this.scrollerMoveCSS(this.vscrollBar,
-{x:0,y:a},300,"ease-out");this.vscrollBar.style.opacity="0"}if(this.hscrollBar){a=this.rightMargin-numOnly(this.hscrollBar.style.width)-(this.maxLeft+b.x)/this.maxLeft*(this.rightMargin-numOnly(this.hscrollBar.style.width));if(a>this.rightMargin)a=this.rightMargin;a<0&&(a=0);this.scrollerMoveCSS(this.hscrollBar,{x:a,y:0},300,"ease-out");this.hscrollBar.style.opacity="0"}}this.vdistanceMoved=this.hdistanceMoved=0;d=!1},scrollerMoveCSS:function(b,d,f,e){f||(f=0);e||(e="linear");b.style.webkitTransform=
-"translate"+a+d.x+"px,"+d.y+"px"+g;b.style.webkitTransitionDuration=f+"ms";b.style.webkitBackfaceVisiblity="hidden";b.style.webkitTransitionTimingFunction=e},scrollTo:function(a){this.scrollerMoveCSS(this.el,a,0)}};return f}();if(!window.numOnly)var numOnly=function(b){isNaN(parseFloat(b))&&(b=b.replace(/[^0-9.-]/,""));return parseFloat(b)};window.aUX||(aUX={});if(!aUX.web)aUX.web={};aUX.web.appMobiSelect=function(){this.oldSelects=[]};
+aUX.web.scroller=function(){function b(c,b){var a=document.createElement("div");a.style.position="absolute";a.style.width=c+"px";a.style.height=b+"px";a.style.webkitBorderRadius="2px";a.className="scrollBar";a.style.opacity=0.7;a.style.background="black";return a}if(window.WebKitCSSMatrix){var a="m11"in new WebKitCSSMatrix?"3d(":"(",g="m11"in new WebKitCSSMatrix?",0)":")",d=!1,f=function(c,h){if(this.el=typeof c=="string"||c instanceof String?document.getElementById(c):c){if(this instanceof f)for(j in h)this[j]=
+h[j];else return new f(c,h);try{this.container=this.el.parentNode;var a=this;this.el.addEventListener("touchmove",function(c){a.touchMove(c)},!1);this.el.addEventListener("touchend",function(c){a.touchEnd(c)},!1);if(this.verticalScroll&&this.verticalScroll==!0&&this.scrollBars==!0){var e=b(5,20);e.style.top="0px";e.className=this.vScrollCSS;e.style.opacity="0";this.container.appendChild(e);this.vscrollBar=e}if(this.horizontalScroll&&this.horizontalScroll==!0&&this.scrollBars==!0)e=b(20,5),e.style.bottom=
+"0px",e.className=this.hScrollCSS,e.style.opacity="0",this.container.appendChild(e),this.hscrollBar=e}catch(d){alert("error adding scroller"+d)}}else alert("Could not find element for scroller "+c)};f.prototype={lockX:0,lockY:0,boolScrollLock:!1,currentScrollingObject:null,bottomMargin:0,maxTop:0,startTop:0,verticalScroll:!0,horizontalScroll:!1,scrollBars:!0,vscrollBar:null,hscrollBar:null,hScrollCSS:"scrollBar",vScrollCSS:"scrollBar",divHeight:0,lastScrollbar:"",timeMoved:0,vdistanceMoved:0,hdistanceMoved:0,
+prevTime:0,finishScrollingObject:null,container:null,maxLeft:0,startLeft:0,rightMargin:0,divWidth:0,touchMove:function(c){try{if(d||(d=!0,this.touchStart(c)),this.currentScrollingObject!=null){c.preventDefault();var b={x:0,y:0},a=0,e=0,f=0,g=0;if(this.verticalScroll){var n=this.lockY-c.touches[0].pageY,n=-n,a=this.startTop+n;try{e=numOnly((new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).f)}catch(r){e=0}b.y=a}if(this.horizontalScroll){var o=this.lockX-c.touches[0].pageX,o=-o,
+n=f=this.startLeft+o;try{g=-numOnly((new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).e)}catch(w){g=0}b.x=n}this.scrollerMoveCSS(this.currentScrollingObject,b,0);if(this.vscrollBar){var q=this.bottomMargin-numOnly(this.vscrollBar.style.height)-(this.maxTop+a)/this.maxTop*(this.bottomMargin-numOnly(this.vscrollBar.style.height));this.scrollerMoveCSS(this.vscrollBar,{x:0,y:q},0)}this.hscrollBar&&(q=this.rightMargin-numOnly(this.hscrollBar.style.width)-(this.maxLeft+f)/this.maxLeft*
+(this.rightMargin-numOnly(this.hscrollBar.style.width)),this.scrollerMoveCSS(this.hscrollBar,{x:q,y:0},0));if(this.prevTime){var p=Math.abs(e)-Math.abs(a),m=Math.abs(g)-Math.abs(f),x=c.timeStamp-this.prevTime;x<1E3?(this.timeMoved+=x,this.vdistanceMoved+=p,this.hdistanceMoved+=m):this.hdistanceMoved=this.vdistanceMoved=this.timeMoved=0}this.prevTime=c.timeStamp}}catch(y){alert("error in scrollMove: "+y)}},touchStart:function(c){var b=this.container,a=this.el;if(b)try{if(c.touches[0].target&&c.touches[0].target.type!=
+void 0){var e=c.touches[0].target.tagName.toLowerCase();if(e=="select"||e=="input"||e=="button")return}this.hdistanceMoved=this.vdistanceMoved=this.timeMoved=0;this.finishScrollingObject=this.prevTime=null;this.bottomMargin=b.clientHeight>window.innerHeight?window.innerHeight:b.clientHeight;this.maxTop=a.clientHeight-this.bottomMargin;this.divHeight=a.clientHeight;this.rightMargin=b.clientWidth>window.innerWidth?window.innerWidth:b.clientWidth;this.maxLeft=a.clientWidth-this.rightMargin;this.divWidth=
+a.clientWidth;if(!(this.maxTop<0)&&c.touches.length==1&&this.boolScrollLock==!1){try{this.startTop=numOnly((new WebKitCSSMatrix(window.getComputedStyle(a).webkitTransform)).f),this.startLeft=numOnly((new WebKitCSSMatrix(window.getComputedStyle(a).webkitTransform)).e)}catch(d){this.startLeft=this.startTop=0,console.log("error scroller touchstart "+d)}this.lockX=c.touches[0].pageX;this.lockY=c.touches[0].pageY;this.currentScrollingObject=a;if(this.vscrollBar){this.vscrollBar.style.height=parseFloat(this.bottomMargin/
+this.divHeight)*this.bottomMargin+"px";var f=this.bottomMargin-numOnly(this.vscrollBar.style.height)-(this.maxTop+this.startTop)/this.maxTop*(this.bottomMargin-numOnly(this.vscrollBar.style.height));this.scrollerMoveCSS(this.vscrollBar,{x:0,y:f},0);this.container.clientWidth>window.innerWidth?this.vscrollBar.style.left=window.innerWidth-numOnly(this.vscrollBar.style.width)+"px":this.vscrollBar.style.right="0px";this.vscrollBar.webkitTransition="opacity";this.vscrollBar.style.opacity=1}if(this.hscrollBar)this.hscrollBar.style.width=
+parseFloat(this.rightMargin/this.divWidth)*this.rightMargin+"px",f=this.rightMargin-numOnly(this.hscrollBar.style.width)-(this.maxTop+this.startLeft)/this.maxtLeft*(this.rightMargin-numOnly(this.hscrollBar.style.width)),this.scrollerMoveCSS(this.hscrollBar,{x:f,y:0},0),this.container.clientHeight>window.innerHeight?this.hscrollBar.style.top=window.innerHeight-numOnly(this.hscrollBar.style.height)+"px":this.hscrollBar.style.bottom="0px",this.hscrollBar.webkitTransition="opacity",this.hscrollBar.style.opacity=
+1;c.preventDefault()}}catch(g){alert("error in scrollStart: "+g)}},touchEnd:function(b){if(this.currentScrollingObject!=null){b.preventDefault();b.stopPropagation();this.finishScrollingObject=this.currentScrollingObject;this.currentScrollingObject=null;b={x:0,y:0};if(this.verticalScroll){var a=-this.vdistanceMoved,f=this.timeMoved,e=2,g=Math.abs(a)/f*1E3,f=Math.abs(a)/f*e,e=g*g/e/1E3/f;newTime=0;e*=a<0?-1:1;newTime=g/2;a=numOnly((new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).f);
+a<0&&(a-=e);a>0&&(a=0);a<-this.maxTop&&(a=-this.maxTop);b.y=a}if(this.horizontalScroll)a=-this.hdistanceMoved,f=this.timeMoved,e=2,g=Math.abs(a)/f*1E3,f=Math.abs(a)/f*e,e=g*g/e/1E3/f,newTime=0,e*=a<0?-1:1,newTime=g/2,a=(new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).e,a<0&&(a-=e),a>0&&(a=0),a<-this.maxLeft&&(a=-this.maxLeft),b.x=a;this.scrollerMoveCSS(this.finishScrollingObject,b,300,"ease-out");if(this.vscrollBar){a=this.bottomMargin-numOnly(this.vscrollBar.style.height)-
+(this.maxTop+b.y)/this.maxTop*(this.bottomMargin-numOnly(this.vscrollBar.style.height));if(a>this.bottomMargin)a=this.bottomMargin;a<0&&(a=0);this.scrollerMoveCSS(this.vscrollBar,{x:0,y:a},300,"ease-out");this.vscrollBar.style.opacity="0"}if(this.hscrollBar){a=this.rightMargin-numOnly(this.hscrollBar.style.width)-(this.maxLeft+b.x)/this.maxLeft*(this.rightMargin-numOnly(this.hscrollBar.style.width));if(a>this.rightMargin)a=this.rightMargin;a<0&&(a=0);this.scrollerMoveCSS(this.hscrollBar,{x:a,y:0},
+300,"ease-out");this.hscrollBar.style.opacity="0"}}this.vdistanceMoved=this.hdistanceMoved=0;d=!1},scrollerMoveCSS:function(b,d,f,e){f||(f=0);e||(e="linear");b.style.webkitTransform="translate"+a+d.x+"px,"+d.y+"px"+g;b.style.webkitTransitionDuration=f+"ms";b.style.webkitBackfaceVisiblity="hidden";b.style.webkitTransitionTimingFunction=e},scrollTo:function(a){this.scrollerMoveCSS(this.el,a,0)}};return f}}();
+if(!window.numOnly)var numOnly=function(b){isNaN(parseFloat(b))&&(b=b.replace(/[^0-9.-]/,""));return parseFloat(b)};window.aUX||(aUX={});if(!aUX.web)aUX.web={};aUX.web.appMobiSelect=function(){this.oldSelects=[]};
aUX.web.appMobiSelect.prototype={oldSelects:[],scroller:null,getOldSelects:function(b){if(aUX.web.scroller){var a=b&&document.getElementById(b)?document.getElementById(b):document;if(a){b=a.getElementsByTagName("select");for(a=0;a<b.length;a++)this.oldSelects.push(document.getElementById(b[a]));for(var g=this,a=0;a<b.length;a++){var d=document.createElement("input"),f=parseInt(b[a].style.width)>0?parseInt(b[a].style.width):100,c=parseInt(b[a].style.height)>0?parseInt(b[a].style.height):20;d.type=
"text";d.style.width=f+"px";d.style.height=c+"px";d.style.position="absolute";d.style.left="0px";d.style.top="0px";d.style.zIndex="1";d.value=b[a].value;d.style.background="url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAeCAIAAABFWWJ4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkM1NjQxRUQxNUFEODExRTA5OUE3QjE3NjI3MzczNDAzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkM1NjQxRUQyNUFEODExRTA5OUE3QjE3NjI3MzczNDAzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QzU2NDFFQ0Y1QUQ4MTFFMDk5QTdCMTc2MjczNzM0MDMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QzU2NDFFRDA1QUQ4MTFFMDk5QTdCMTc2MjczNzM0MDMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6YWbdCAAAAlklEQVR42mIsKChgIBGwAHFPTw/xGkpKSlggrG/fvhGjgYuLC0gyMZAOoPb8//9/0Or59+8f8XrICQN66SEnDOgcp3AgKiqKqej169dY9Hz69AnCuHv3rrKyMrIKoAhcVlBQELt/gIqwstHD4B8quH37NlAQSKKJEwg3iLbBED8kpeshoGcwh5uuri5peoBFMEluAwgwAK+5aXfuRb4gAAAAAElFTkSuQmCC') right top no-repeat";
d.style.backgroundColor="white";d.className="appMobiSelect_fakeInput";d.id=b[a].id+"_appMobiSelect";var h=document.createElement("input");h.type="image";h.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==";h.style.width=f+5+"px";h.style.height=c+5+"px";h.style.left="0px";h.style.top="0px";h.style.zIndex="2";h.style.position="absolute";h.linkId=b[a].id;h.className="appMobiSelect_imageMask";h.onclick=function(a){a.preventDefault();
g.initDropDown(this.linkId)};b[a].parentNode.appendChild(d);b[a].parentNode.appendChild(h);b[a].parentNode.style.position="relative";b[a].style.display="none";b[a].style.webkitAppearance="none";for(f=0;f<b[a].options.length;f++){if(b[a].options[f].selected)d.value=b[a].options[f].text;this.watcher(b[a].options[f],"selected",function(a,b,c){if(c==!0)g.updateMaskValue(this.parentNode.id,this.text),this.parentNode.value=this.value;return c})}this.watcher(b,"selectedIndex",function(a,b,c){if(this.options[c])g.updateMaskValue(this.id,
this.options[c].text),this.value=this.options[c].value;return c});this.createHtml()}}else alert("Could not find container element for aUX_web password "+b)}else alert("This library requires aUX_web scroller")},updateDropdown:function(b){if(b=document.getElementById(b))for(var a=0;a<b.options.length;a++){if(b.options[a].selected)fakeInput.value=b.options[a].text;this.watcher(b.options[a],"selected",function(a,b,f){if(f==!0)that.updateMaskValue(this.parentNode.id,this.text),this.parentNode.value=this.value;
-return f})}},initDropDown:function(b){var a=this,g=document.getElementById(b);if(g&&g.options&&g.options.length!=0){var d=0;document.getElementById("appMobiselectBoxScroll").innerHTML="";for(var f=0;f<g.options.length;f++){this.watcher(g.options[f],"selected",function(b,c,s){if(s==!0)a.updateMaskValue(this.parentNode.id,this.text),this.parentNode.value=this.value;return s});var c="",h="background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0.17, rgb(102,102,102)),color-stop(0.59, rgb(94,94,94)))",
+return f})}},initDropDown:function(b){var a=this,g=document.getElementById(b);if(g&&g.options&&g.options.length!=0){var d=0;document.getElementById("appMobiselectBoxScroll").innerHTML="";for(var f=0;f<g.options.length;f++){this.watcher(g.options[f],"selected",function(b,c,q){if(q==!0)a.updateMaskValue(this.parentNode.id,this.text),this.parentNode.value=this.value;return q});var c="",h="background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0.17, rgb(102,102,102)),color-stop(0.59, rgb(94,94,94)))",
k;g.value==g.options[f].value?(h="background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0.17, rgb(8,8,8)),color-stop(0.59, rgb(38,38,38)))",c="checked",d=f,k="id='appmobiSelectBox_found'"):k="";var e=document.createElement("div");e.id=k;e.style.cssText=h+";padding-top:10px;font-size:80%;padding-left:10px;height:30px;width:100%;position:relative;width:100%;";h=document.createElement("a");h.href="javascript:;";h.tmpValue=f;h.onclick=function(){a.setDropDownValue(b,this.tmpValue)};
-h.style.cssText="text-decoration:none;color:white;";h.innerHTML=g.options[f].text;var r=document.createElement("span");r.style.cssText="float:right;margin-right:20px;margin-top:-2px";var l=document.createElement("button");l.style.cssText=k?"color: #ffffff;padding: 0px 0px;background: -webkit-gradient(linear, left top, left bottom,from(#ffffff),color-stop(0.50, #3b3b3b),color-stop(0.50, #242424),to(#ffffff));border-radius: 30px;border: 0px solid #000000;-webkit-box-shadow:\t0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);":
-"color: #ffffff;padding: 0px 0px;background: -webkit-gradient(linear, left top, left bottom,from(#ffffff),color-stop(0.44, #dbd8db),to(#ffffff));border-radius: 30px;border: 0px solid #000000;-webkit-box-shadow:\t0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);";l.style.width="20px";l.style.height="20px";l.tmpValue=f;l.onclick=function(){a.setDropDownValue(b,this.tmpValue)};l.checked=c;r.appendChild(l);e.appendChild(h);e.appendChild(r);document.getElementById("appMobiselectBoxScroll").appendChild(e)}try{document.getElementById("appMobiselectBoxContainer").style.display=
-"block"}catch(p){console.log("Error showing div "+p)}try{d>=3&&this.scroller.scrollTo({x:0,y:d*-40})}catch(m){console.log("error init dropdown"+m)}}},updateMaskValue:function(b,a){var g=document.getElementById(b+"_appMobiSelect");if(g)g.value=a},setDropDownValue:function(b,a){var g=document.getElementById(b);if(g)g.selectedIndex=a;this.scroller.scrollTo({x:0,y:0});this.hideDropDown()},hideDropDown:function(){document.getElementById("appMobiselectBoxContainer").style.display="none";document.getElementById("appMobiselectBoxScroll").innerHTML=
+h.style.cssText="text-decoration:none;color:white;";h.innerHTML=g.options[f].text;var s=document.createElement("span");s.style.cssText="float:right;margin-right:20px;margin-top:-2px";var l=document.createElement("button");l.style.cssText=k?"color: #ffffff;padding: 0px 0px;background: -webkit-gradient(linear, left top, left bottom,from(#ffffff),color-stop(0.50, #3b3b3b),color-stop(0.50, #242424),to(#ffffff));border-radius: 30px;border: 0px solid #000000;-webkit-box-shadow:\t0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);":
+"color: #ffffff;padding: 0px 0px;background: -webkit-gradient(linear, left top, left bottom,from(#ffffff),color-stop(0.44, #dbd8db),to(#ffffff));border-radius: 30px;border: 0px solid #000000;-webkit-box-shadow:\t0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);";l.style.width="20px";l.style.height="20px";l.tmpValue=f;l.onclick=function(){a.setDropDownValue(b,this.tmpValue)};l.checked=c;s.appendChild(l);e.appendChild(h);e.appendChild(s);document.getElementById("appMobiselectBoxScroll").appendChild(e)}try{document.getElementById("appMobiselectBoxContainer").style.display=
+"block"}catch(n){console.log("Error showing div "+n)}try{d>=3&&this.scroller.scrollTo({x:0,y:d*-40})}catch(r){console.log("error init dropdown"+r)}}},updateMaskValue:function(b,a){var g=document.getElementById(b+"_appMobiSelect");if(g)g.value=a},setDropDownValue:function(b,a){var g=document.getElementById(b);if(g)g.selectedIndex=a;this.scroller.scrollTo({x:0,y:0});this.hideDropDown()},hideDropDown:function(){document.getElementById("appMobiselectBoxContainer").style.display="none";document.getElementById("appMobiselectBoxScroll").innerHTML=
""},createHtml:function(){var b=this;if(!document.getElementById("appMobiselectBoxContainer")){var a=document.createElement("div");a.id="appMobiselectBoxContainer";a.style.cssText="position:absolute;bottom:0px;display:none;width:100%;height:175px; z-index:200000;background:black;color:white;";a.innerHTML='<div style=\'height:35px;width:100%;text-align:center;\'><button id="appMobiSelectCloseButton" style="width:100px;background:#e3e3e3;border: 1px solid #bbb;border-radius: 6px;box-shadow: inset 0 0 1px 1px #f6f6f6;color: #333;font-weight: bold;line-height: 1;padding: 8px 0 9px;text-align: center;text-shadow: 0 1px 0 #fff;width: 6-px;">Done</button></div><div id="appMobiselectBoxFix" style="position:relative;height:150px;background:black;overflow:hidden;width:100%"><div id="appMobiselectBoxScroll"></div></div>';
document.body.appendChild(a);document.getElementById("appMobiSelectCloseButton").onclick=function(){b.hideDropDown()};try{this.scroller=new aUX.web.scroller("appMobiselectBoxScroll",{scroller:!1,verticalScroll:!0})}catch(g){console.log("Error creating select html "+g)}}},watcher:function(b,a,g){var d=b[a];window.setInterval(function(){newval=b[a];newval!=d&&(g.call(b,a,d,newval),d=newval)},1500)}};function getScrollerValue(b){return document.getElementById(b).value};window.aUX||(aUX={});if(!aUX.web)aUX.web={};aUX.web.appMobiPassword=function(){this.oldPasswords={}};
aUX.web.appMobiPassword.prototype={oldPasswords:[],showPasswordPlainText:!1,getOldPasswords:function(b){var a=b&&document.getElementById(b)?document.getElementById(b):document;if(a)for(var b=a.getElementsByTagName("input"),g=this,a=0;a<b.length;a++){if(b[a].type=="password"){this.oldPasswords[b[a].id]=b[a];var d=document.createElement("input"),f=parseInt(b[a].style.width)>0?parseInt(b[a].style.width):100,c=parseInt(b[a].style.height)>0?parseInt(b[a].style.height):20;d.type="text";if(b[a].className!=
"")d.style.width=f+"px",d.style.height=c+"px",d.style.backgroundColor="white";d.style.position="relative";d.style.left="0px";d.style.top="0px";d.style.zIndex="1";d.value=b[a].value;d.showPasswordPlainText=g.showPasswordPlainText;d.className=b[a].className;d.id=b[a].id+"_appMobiPassword";d.placeHolder=b[a].placeHolder;d.oldPW=b[a];d.onkeyup=function(){var a=this.oldPW;if(a.value.length!=this.value.length){var b=this.value.substring(this.selectionStart-1,this.selectionStart),c=this.selectionStart;g.updatePassword(a,
b,this.selectionStart,this.value.length);if(a.value.length>0&&!this.showPasswordPlainText)a=this.value,this.value="",this.value=a.replace(b,"*"),c!=this.value.length&&this.setSelectionRange(c,c);else if(a.value.length==0)this.value=""}};b[a].parentNode.appendChild(d);b[a].style.display="none";b[a].parentNode.appendChild(d)}}else alert("Could not find container element for appMobiPassword "+b)},updatePassword:function(b,a,g,d){if(d==0)b.value="";d>b.value.length&&a.length>0?(d=b.value,b.value=d.substring(0,
g-1)+a+d.substring(g-1,d.length)):(d=b.value,b.value=d.substring(0,g)+d.substring(g+1,d.length))},changePasswordVisiblity:function(b,a){b=parseInt(b);if(this.oldPasswords[a]){var g=document.getElementById(a+"_appMobiPassword");if(b==1)this.showPasswordPlainText=!0,g.showPasswordPlainText=showPasswordPlainText=!0,g.value=this.oldPasswords[a].value;else{this.showPasswordPlainText=!1;g.showPasswordPlainText=showPasswordPlainText=!1;for(var d="",f=0;f<g.value.length;f++)d+="*";g.value=d}}}};window.aUX||(aUX={});if(!aUX.web)aUX.web={};
-aUX.web.css3Animate=function(){function b(a){a.preventDefault();var b=a.target;if(a.target.moving&&(a.target.moving=!1,b.callback&&typeof(b.callback=="function")))b.callback(),b.callback=""}var a="m11"in new WebKitCSSMatrix?"3d(":"(",g="m11"in new WebKitCSSMatrix?",0)":")",d=function(f,c){this.el=typeof f=="string"||f instanceof String?document.getElementById(f):f;if(!this instanceof d)return new d(f,c);if(this.el)if(c){this.el.addEventListener("webkitTransitionEnd",b,!1);if(c.opacity)this.el.style.opacity=
-c.opacity;c.y||(c.y=0);c.x||(c.x=0);c.previous&&(c.y+=(new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).f,c.x+=(new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).e);if(!c.origin)c.origin="0% 0%";if(!c.scale)c.scale="1";if(!c.rotateY)c.rotateY="0";if(!c.rotateX)c.rotateX="0";if(!c.skewY)c.skewY="0";if(!c.skewX)c.skewX="0";c.timingFunction||(c.timingFunction="linear");if(typeof c.x=="number"||c.x.indexOf("%")==-1&&c.x.toLowerCase().indexOf("px")==-1&&c.x.toLowerCase().indexOf("deg")==
--1)c.x=parseInt(c.x)+"px";if(typeof c.y=="number"||c.y.indexOf("%")==-1&&c.y.toLowerCase().indexOf("px")==-1&&c.y.toLowerCase().indexOf("deg")==-1)c.y=parseInt(c.y)+"px";this.el.style.webkitTransform="translate"+a+c.x+","+c.y+g+" scale("+parseFloat(c.scale)+") rotate("+c.rotateX+") rotateY("+c.rotateY+") skew("+c.skewX+","+c.skewY+")";this.el.style.webkitBackfaceVisiblity="hidden";this.el.style.webkitTransition="all "+c.time;this.el.style.webkitTransitionTimingFunction=c.timingFunction;this.el.style.webkitTransformOrigin=
-c.origin;if(c.width)this.el.style.width=c.width;if(c.height)this.el.style.height=c.height;if(c.callback)this.el.callback=c.callback,this.el.moving=!0}else alert("Please provide configuration options for animation of "+f)};return d}();window.aUX||(aUX={});aUX.domFired=!1;document.addEventListener("DOMContentLoaded",function(){aUX.domFired=!0},!1);
-aUX.ui=function(){function b(a){return document.getElementById(a)}function a(a,b,c){var e=[];c||(c="*");a=a.getElementsByTagName(c);c=a.length;for(i=0;i<c;i++)a[i].className.indexOf(b)!=-1&&(e.push(a[i]),a[i].getAttribute("selected")&&(q=a[i]));return e}var g="",d="",f="",c="",h=[],k="",e=aUX.web.css3Animate,r=new aUX.web.appMobiPassword,l=new aUX.web.appMobiSelect,p="",m=[],q="",t=function(){if(aUX.domFired)this.hasLaunched=!0,this.launch();else{var a=this;document.addEventListener("DOMContentLoaded",
-function(){a.launch()},!1)}};t.prototype={hasLaunched:!1,launch:function(){if(this.hasLaunched==!1)this.hasLaunched=!0;else{var s=this,o=b("toolbar");g=b("content");d=b("navbar");if(!o){var o=document.createElement("div");o.id="toolbar";o.style.cssText="display:none"}if(!d)d=document.createElement("div"),d.id="navbar",document.body.appendChild(d);if(!g)g=document.createElement("div"),g.id="content",document.body.appendChild(g);d.innerHTML='<a id="backButton" href="javascript:;"><div>Back</div></a> <h1 id="pageTitle"></h1>'+
-d.innerHTML;f=b("backButton");f.className="button";f.onclick=function(){if(h.length>0){var a=h.pop();s.loadContent(a.target+"",0,1,a.transition)}};f.style.visibility="hidden";c=b("pageTitle");this.addContentDiv("AMUi_ajax","");var n=document.createElement("div");n.id="AMUI_mask";n.className="ui-loader ui-body-a ui-corner-all loading-mask";n.innerHTML="<span class='ui-icon ui-icon-loading spin'></span><h1>Loading Content</h1>";n.zIndex=2E4;n.style.display="none";document.body.appendChild(n);document.addEventListener("appMobi.device.orientation.change",
-s.updateOrientation,!1);this.updateAnchors(o,1);this.updateAnchors(d);for(o=a(document,"panel","div");o.length>0;){var m=n=o.pop();n.parentNode&&n.parentNode.id!="content"&&(n.parentNode.removeChild(n),this.addDivAndScroll(m))}q&&(k=q,window.setTimeout(function(){e(q,{x:"100%",time:"0ms"});if(k.title)c.innerHTML=k.title},100))}},clearHistory:function(){this.history=[]},updateContentDiv:function(a,c){var e=b(a);if(e)e.childNodes[0].innerHTML=c,this.updateAnchors(e)},addContentDiv:function(a,b){var c=
-document.getElementById(a);if(!c)c=document.createElement("div"),c.id=a,c.innerHTML=b;c.className="panel";this.addDivAndScroll(c)},addDivAndScroll:function(a){g.appendChild(a);var b=!0;a.getAttribute("scrolling")&&a.getAttribute("scrolling").toLowerCase()=="no"&&(b=!1);var c=document.createElement("div");c.innerHTML=a.innerHTML;c.innerHTML+="<Br>";a.innerHTML="";a.appendChild(c);this.updateAnchors(c);l.getOldSelects(a.id);r.getOldPasswords(a.id);b&&(m[a.id]=aUX.web.scroller(c,{scrollBars:!0,verticalScroll:!0,
+aUX.web.css3Animate=function(){function b(a){a.preventDefault();var b=a.target;if(a.target.moving&&(a.target.moving=!1,b.callback&&typeof(b.callback=="function")))b.callback(),b.callback=""}if(window.WebKitCSSMatrix){var a="m11"in new WebKitCSSMatrix?"3d(":"(",g="m11"in new WebKitCSSMatrix?",0)":")",d=function(f,c){this.el=typeof f=="string"||f instanceof String?document.getElementById(f):f;if(!this instanceof d)return new d(f,c);if(this.el)if(c){this.el.addEventListener("webkitTransitionEnd",b,!1);
+if(c.opacity)this.el.style.opacity=c.opacity;c.y||(c.y=0);c.x||(c.x=0);c.previous&&(c.y+=numOnly((new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).f),c.x+=numOnly((new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).e));if(!c.origin)c.origin="0% 0%";if(!c.scale)c.scale="1";if(!c.rotateY)c.rotateY="0";if(!c.rotateX)c.rotateX="0";if(!c.skewY)c.skewY="0";if(!c.skewX)c.skewX="0";c.timingFunction||(c.timingFunction="linear");if(typeof c.x=="number"||c.x.indexOf("%")==
+-1&&c.x.toLowerCase().indexOf("px")==-1&&c.x.toLowerCase().indexOf("deg")==-1)c.x=parseInt(c.x)+"px";if(typeof c.y=="number"||c.y.indexOf("%")==-1&&c.y.toLowerCase().indexOf("px")==-1&&c.y.toLowerCase().indexOf("deg")==-1)c.y=parseInt(c.y)+"px";this.el.style.webkitTransform="translate"+a+c.x+","+c.y+g+" scale("+parseFloat(c.scale)+") rotate("+c.rotateX+") rotateY("+c.rotateY+") skew("+c.skewX+","+c.skewY+")";this.el.style.webkitBackfaceVisiblity="hidden";this.el.style.webkitTransition="all "+c.time;
+this.el.style.webkitTransitionTimingFunction=c.timingFunction;this.el.style.webkitTransformOrigin=c.origin;if(c.width)this.el.style.width=c.width;if(c.height)this.el.style.height=c.height;if(c.callback)this.el.callback=c.callback,this.el.moving=!0}else alert("Please provide configuration options for animation of "+f)};return d}}();window.aUX||(aUX={});aUX.domFired=!1;document.addEventListener("DOMContentLoaded",function(){aUX.domFired=!0},!1);
+aUX.ui=function(){function b(a){return document.getElementById(a)}function a(a,b,c){var e=[];c||(c="*");a=a.getElementsByTagName(c);c=a.length;for(i=0;i<c;i++)a[i].className.indexOf(b)!=-1&&(e.push(a[i]),a[i].getAttribute("selected")&&(o=a[i]));return e}var g="",d="",f="",c="",h=[],k="",e=aUX.web.css3Animate,s=new aUX.web.appMobiPassword,l=new aUX.web.appMobiSelect,n="",r=[],o="",w=function(){if(aUX.domFired)this.hasLaunched=!0,this.launch();else{var a=this;document.addEventListener("DOMContentLoaded",
+function(){a.launch()},!1)}};w.prototype={hasLaunched:!1,launch:function(){if(this.hasLaunched==!1)this.hasLaunched=!0;else{var q=this,p=b("toolbar");g=b("content");d=b("navbar");if(!p){var p=document.createElement("div");p.id="toolbar";p.style.cssText="display:none"}if(!d)d=document.createElement("div"),d.id="navbar",document.body.appendChild(d);if(!g)g=document.createElement("div"),g.id="content",document.body.appendChild(g);d.innerHTML='<a id="backButton" href="javascript:;"><div>Back</div></a> <h1 id="pageTitle"></h1>'+
+d.innerHTML;f=b("backButton");f.className="button";f.onclick=function(){if(h.length>0){var a=h.pop();q.loadContent(a.target+"",0,1,a.transition)}};f.style.visibility="hidden";c=b("pageTitle");this.addContentDiv("AMUi_ajax","");var m=document.createElement("div");m.id="AMUI_mask";m.className="ui-loader ui-body-a ui-corner-all loading-mask";m.innerHTML="<span class='ui-icon ui-icon-loading spin'></span><h1>Loading Content</h1>";m.zIndex=2E4;m.style.display="none";document.body.appendChild(m);document.addEventListener("appMobi.device.orientation.change",
+q.updateOrientation,!1);this.updateAnchors(p,1);this.updateAnchors(d);for(p=a(document,"panel","div");p.length>0;){var n=m=p.pop();m.parentNode&&m.parentNode.id!="content"&&(m.parentNode.removeChild(m),this.addDivAndScroll(n))}o&&(k=o,window.setTimeout(function(){e(o,{x:"100%",time:"0ms"});if(k.title)c.innerHTML=k.title},100))}},clearHistory:function(){this.history=[]},updateContentDiv:function(a,c){var e=b(a);if(e)e.childNodes[0].innerHTML=c,this.updateAnchors(e)},addContentDiv:function(a,b){var c=
+document.getElementById(a);if(!c)c=document.createElement("div"),c.id=a,c.innerHTML=b;c.className="panel";this.addDivAndScroll(c)},addDivAndScroll:function(a){g.appendChild(a);var b=!0;a.getAttribute("scrolling")&&a.getAttribute("scrolling").toLowerCase()=="no"&&(b=!1);var c=document.createElement("div");c.innerHTML=a.innerHTML;c.innerHTML+="<Br>";a.innerHTML="";a.appendChild(c);this.updateAnchors(c);l.getOldSelects(a.id);s.getOldPasswords(a.id);b&&(r[a.id]=aUX.web.scroller(c,{scrollBars:!0,verticalScroll:!0,
horizontalScroll:!1,vScrollCSS:"scrollBarV"}))},updateAnchors:function(a,b){for(var c=a.getElementsByTagName("a"),e=this,d=0;d<c.length;d++)if(c[d].href.indexOf("javascript:")==-1)c[d].oldhref=c[d].href,c[d].oldhash=c[d].hash,c[d].href="javascript:;",c[d].oldonclick=c[d].onclick,c[d].resetHistory=b,c[d].onclick=function(){var a="slide";if(this.target&&this.target!="")AppMobi.device&&AppMobi.device.showRemoteSite?AppMobi.device.showRemoteSite(this.oldhref):window.open(this.oldhref);else{switch(this.getAttribute("data-transition")){case "up":a=
-"up";break;case "down":a="down";break;case "flip":a="flip";break;case "fade":a="fade";break;case "pop":a="pop";break;default:a="slide"}e.loadContent(this.oldhash?this.oldhash:this.oldhref,this.resetHistory,0,a);this.oldonclick&&this.oldonclick()}}},updateOrientation:function(){for(var a=0;a<m.length;a++)m[a].scrollTo({x:0,y:0});e(k,{x:"100%",time:"0ms"})},loadContent:function(a,e,d,g){try{what=null;var l=this;l.hideMask();if(a.indexOf("#")==-1){if(!(k.id=="AMUi_ajax"&&a==p)){a.indexOf("http")==-1&&
-(a=AppMobi.webRoot+a);var u=new XMLHttpRequest;u.onreadystatechange=function(){if(u.readyState==4&&u.status==200)l.updateContentDiv("AMUi_ajax",u.responseText),b("AMUi_ajax").title=a,l.loadContent("#AMUi_ajax",e,d)};p=a;u.open("GET",a,!0);u.send();this.showMask()}}else if(what=a.replace("#",""),what=b(what),what!=k||d){what.style.display="block";m[what.id]&&m[what.id].scrollTo({x:0,y:0});e?(h=[],h.push({target:"#"+q.id,transition:"slide"})):d||h.push({target:"#"+k.id,transition:g});var v=k,w=what;
-switch(g){case "up":this.slideUpTransition(v,w,d);break;case "down":this.slideDownTransition(v,w,d);break;case "fade":this.fadeTransition(v,w,d);break;case "flip":this.flipTransition(v,w,d);break;case "pop":this.popTransition(v,w,d);break;default:this.slideTransition(v,w,d)}if(d){if(h.length>0){var r=b(h[h.length-1].target.replace("#",""));f.innerHTML="<div>"+r.title+"</div>"}}else f.innerHTML=k.title?"<div>"+k.title+"</div>":"<div>Back</div>";if(what.title)c.innerHTML=what.title;if(e)f.innerHTML=
-q.title;h.length==0?(f.style.visibility="hidden",h=[]):f.style.visibility="visible";k=what}}catch(t){console.log("Error with loading content "+t+" - "+a)}},showMask:function(){b("AMUI_mask").style.display="block"},hideMask:function(){b("AMUI_mask").style.display="none"},slideTransition:function(a,b,c){c?(e(a,{x:"200%",time:"200ms",callback:function(){e(a,{x:0,time:"1ms"})}}),e(b,{x:"100%",time:"200ms"})):(e(a,{x:"0%",time:"200ms"}),e(b,{x:"200%",time:"1ms",callback:function(){e(b,{x:"100%",time:"200ms"})}}))},
+"up";break;case "down":a="down";break;case "flip":a="flip";break;case "fade":a="fade";break;case "pop":a="pop";break;default:a="slide"}e.loadContent(this.oldhash?this.oldhash:this.oldhref,this.resetHistory,0,a);this.oldonclick&&this.oldonclick()}}},updateOrientation:function(){for(var a=0;a<r.length;a++)r[a].scrollTo({x:0,y:0});e(k,{x:"100%",time:"0ms"})},loadContent:function(a,e,d,g){try{what=null;var l=this;l.hideMask();if(a.indexOf("#")==-1){if(!(k.id=="AMUi_ajax"&&a==n)){a.indexOf("http")==-1&&
+(a=AppMobi.webRoot+a);var t=new XMLHttpRequest;t.onreadystatechange=function(){if(t.readyState==4&&t.status==200)l.updateContentDiv("AMUi_ajax",t.responseText),b("AMUi_ajax").title=a,l.loadContent("#AMUi_ajax",e,d)};n=a;t.open("GET",a,!0);t.send();this.showMask()}}else if(what=a.replace("#",""),what=b(what),what!=k||d){what.style.display="block";r[what.id]&&r[what.id].scrollTo({x:0,y:0});e?(h=[],h.push({target:"#"+o.id,transition:"slide"})):d||h.push({target:"#"+k.id,transition:g});var u=k,v=what;
+switch(g){case "up":this.slideUpTransition(u,v,d);break;case "down":this.slideDownTransition(u,v,d);break;case "fade":this.fadeTransition(u,v,d);break;case "flip":this.flipTransition(u,v,d);break;case "pop":this.popTransition(u,v,d);break;default:this.slideTransition(u,v,d)}if(d){if(h.length>0){var s=b(h[h.length-1].target.replace("#",""));f.innerHTML="<div>"+s.title+"</div>"}}else f.innerHTML=k.title?"<div>"+k.title+"</div>":"<div>Back</div>";if(what.title)c.innerHTML=what.title;if(e)f.innerHTML=
+o.title;h.length==0?(f.style.visibility="hidden",h=[]):f.style.visibility="visible";k=what}}catch(w){console.log("Error with loading content "+w+" - "+a)}},showMask:function(){b("AMUI_mask").style.display="block"},hideMask:function(){b("AMUI_mask").style.display="none"},slideTransition:function(a,b,c){c?(e(a,{x:"200%",time:"200ms",callback:function(){e(a,{x:0,time:"1ms"})}}),e(b,{x:"100%",time:"200ms"})):(e(a,{x:"0%",time:"200ms"}),e(b,{x:"200%",time:"1ms",callback:function(){e(b,{x:"100%",time:"200ms"})}}))},
slideUpTransition:function(a,b,c){c?(e(b,{x:"100%",y:"0%",time:"1ms"}),e(a,{y:"100%",x:"100%",time:"200ms",callback:function(){e(a,{x:0,y:0,time:"1ms"});b.style.zIndex=2;a.style.zIndex=1}})):(a.style.zIndex=1,b.style.zIndex=2,e(a,{x:"100%",time:"200ms",callback:function(){e(a,{x:0,y:0,time:"1ms"})}}),e(b,{y:"100%",x:"100%",time:"1ms",callback:function(){e(b,{y:"0%",x:"100%",time:"200ms"})}}))},slideDownTransition:function(a,b,c){c?(e(b,{x:"100%",y:"0%",time:"1ms"}),e(a,{y:"-100%",x:"100%",time:"200ms",
callback:function(){e(a,{x:0,y:0,time:"1ms"});b.style.zIndex=2;a.style.zIndex=1}})):(a.style.zIndex=1,b.style.zIndex=2,e(a,{x:"100%",time:"200ms",callback:function(){e(a,{x:0,y:0,time:"1ms"})}}),e(b,{y:"-100%",x:"100%",time:"1ms",callback:function(){e(b,{y:"0%",x:"100%",time:"200ms"})}}))},flipTransition:function(a,b,c){c?(e(b,{x:"200%",time:"1ms",scale:0.8,rotateY:"180deg",callback:function(){e(b,{x:"100%",time:"200ms"})}}),e(a,{x:"200%",time:"200ms",scale:0.8,rotateY:"180deg",callback:function(){e(a,
{x:0,time:"1ms",opacity:1});b.style.zIndex=2;a.style.zIndex=1}})):(a.style.zIndex=1,b.style.zIndex=2,e(a,{x:"200%",time:"200ms",scale:".8",rotateY:"180deg",callback:function(){e(a,{x:0,y:0,time:"1ms"})}}),e(b,{x:"200%",time:"1ms",scale:0.8,rotateY:"180deg",callback:function(){e(b,{x:"100%",time:"200ms"})}}))},fadeTransition:function(a,b,c){c?(e(b,{x:"100%",time:"1ms"}),e(a,{x:"100%",time:"200ms",opacity:0.1,callback:function(){e(a,{x:0,time:"1ms",opacity:1});b.style.zIndex=2;a.style.zIndex=1}})):
(a.style.zIndex=1,b.style.zIndex=2,e(a,{x:"100%",time:"200ms",callback:function(){e(a,{x:0,y:0,time:"1ms"})}}),b.style.opacity=0,e(b,{x:"100%",time:"1ms",callback:function(){e(b,{x:"100%",time:"200ms",opacity:1})}}))},popTransition:function(a,b,c){c?(e(b,{x:"100%",time:"1ms"}),e(a,{x:"100%",time:"200ms",opacity:0.1,scale:0.2,origin:"50% 50%",callback:function(){e(a,{x:0,time:"1ms"});b.style.zIndex=2;a.style.zIndex=1}})):(a.style.zIndex=1,b.style.zIndex=2,e(a,{x:"100%",time:"200ms",callback:function(){e(a,
-{x:0,y:0,time:"1ms"})}}),e(b,{x:"100%",y:"0%",time:"1ms",scale:0.2,origin:"50% 50%",opacity:0.1,callback:function(){e(b,{x:"100%",time:"200ms",scale:1,opacity:1,origin:"0% 0%"})}}))}};return t}();
+{x:0,y:0,time:"1ms"})}}),e(b,{x:"100%",y:"0%",time:"1ms",scale:0.2,origin:"50% 50%",opacity:0.1,callback:function(){e(b,{x:"100%",time:"200ms",scale:1,opacity:1,origin:"0% 0%"})}}))}};return w}();
View
10 aUX_webCss3animate.js
@@ -8,6 +8,8 @@ if(!aUX.web)
aUX.web={};
aUX.web.css3Animate = (function() {
+ if(!window.WebKitCSSMatrix)
+ return;
var translateOpen = 'm11' in new WebKitCSSMatrix() ? "3d(" : "(";
var translateClose = 'm11' in new WebKitCSSMatrix() ? ",0)" : ")";
var webkitTransitionCallbacks = {};
@@ -38,10 +40,10 @@ aUX.web.css3Animate = (function() {
if(!options["x"])
options["x"]=0;
if (options["previous"]) {
- options.y += new WebKitCSSMatrix(
- window.getComputedStyle(this.el).webkitTransform).f;
- options.x += new WebKitCSSMatrix(
- window.getComputedStyle(this.el).webkitTransform).e;
+ options.y += numOnly(new WebKitCSSMatrix(
+ window.getComputedStyle(this.el).webkitTransform).f);
+ options.x += numOnly(new WebKitCSSMatrix(
+ window.getComputedStyle(this.el).webkitTransform).e);
}
if(!options["origin"])
options.origin="0% 0%";
View
34 aUX_webScroll.js
@@ -10,6 +10,8 @@ if (!aUX.web)
aUX.web = {};
aUX.web.scroller = (function() {
+ if(!window.WebKitCSSMatrix)
+ return;
var translateOpen = 'm11' in new WebKitCSSMatrix() ? "3d(" : "(";
var translateClose = 'm11' in new WebKitCSSMatrix() ? ",0)" : ")";
var touchStarted=false;
@@ -140,19 +142,23 @@ aUX.web.scroller = (function() {
deltaY = -deltaY;
var newTop = this.startTop + deltaY;
var top = -newTop;
-
- var prevTop = new WebKitCSSMatrix(window
- .getComputedStyle(this.el).webkitTransform).f;
+ try{
+ var prevTop = numOnly(new WebKitCSSMatrix(window
+ .getComputedStyle(this.el).webkitTransform).f);
+ }
+ catch(prevTopE){var prevTop=0;}
scrollPoints.y = newTop;
}
if (this.horizontalScroll) {
var deltaX = this.lockX - event.touches[0].pageX;
deltaX = -deltaX;
var newLeft = this.startLeft + deltaX;
var left = newLeft;
-
- var prevLeft = -(new WebKitCSSMatrix(window
- .getComputedStyle(this.el).webkitTransform).e);
+ try{
+ var prevLeft = -numOnly((new WebKitCSSMatrix(window
+ .getComputedStyle(this.el).webkitTransform).e));
+ }
+ catch(prevLeftE){var prevLeft=0;}
scrollPoints.x = left;
}
@@ -243,10 +249,10 @@ aUX.web.scroller = (function() {
if (event.touches.length == 1 && this.boolScrollLock == false) {
try {
- this.startTop = new WebKitCSSMatrix(window
- .getComputedStyle(eleScrolling).webkitTransform).f;
- this.startLeft = new WebKitCSSMatrix(window
- .getComputedStyle(eleScrolling).webkitTransform).e;
+ this.startTop = numOnly(new WebKitCSSMatrix(window
+ .getComputedStyle(eleScrolling).webkitTransform).f);
+ this.startLeft = numOnly(new WebKitCSSMatrix(window
+ .getComputedStyle(eleScrolling).webkitTransform).e);
} catch (e) {
this.startTop = 0;
this.startLeft = 0;
@@ -332,8 +338,8 @@ aUX.web.scroller = (function() {
newDist = newDist * (dist < 0 ? -1 : 1);
newTime = speed / deceleration;
- var move = new WebKitCSSMatrix(window
- .getComputedStyle(this.el).webkitTransform).f;
+ var move = numOnly(new WebKitCSSMatrix(window
+ .getComputedStyle(this.el).webkitTransform).f);
if (move < 0)
move = move - newDist;
@@ -359,8 +365,8 @@ aUX.web.scroller = (function() {
newDist = newDist * (dist < 0 ? -1 : 1);
newTime = speed / deceleration;
- var move = new WebKitCSSMatrix(window
- .getComputedStyle(this.el).webkitTransform).e;
+ var move = (new WebKitCSSMatrix(window
+ .getComputedStyle(this.el).webkitTransform).e);
if (move < 0)
move = move - newDist;

0 comments on commit a5413d2

Please sign in to comment.