Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Rebranding

  • Loading branch information...
commit a131fa64bc2cffadb1159de953848704e5bd8a67 1 parent 86c1918
Ian Maffett imaffett authored
6 READMe.rdoc → README.rdoc
Source Rendered
@@ -33,7 +33,7 @@ The default scroller will scroll all content, so trying to add a button bar will
33 33
34 34 * To add divs to the content, simply set the class to "panel". This is a special css class that we search for at startup.
35 35
36   -* aUX_web.scroller is added automatically, along with aUX_web.appMobiSelect, aUX_web.appMobiPassword, and aUX_web.css3animate.
  36 +* aUX_web.scroller is added automatically, along with aUX.web.appMobiSelect, aUX.web.appMobiPassword, and aUX.web.css3animate.
37 37
38 38 * Linking to pages - You can link two ways. You can link to a file by setting the URL, which will load via AJAX. Or you can set the href property to "#div_id"
39 39 <a href="#login">Login</a>
@@ -55,13 +55,13 @@ The default scroller will scroll all content, so trying to add a button bar will
55 55 <script>AMUi.updateContentDiv("login","New Login HTML");
56 56
57 57 where AMUi is a new AppMobi toolkit ui
58   - var AMUi = new aUX.js();
  58 + var AMUi = new aUX.ui();
59 59
60 60 * To dynamically add a new div, you can call the function addContentDiv(_id_,_content_);
61 61 <script>AMUi.addContentDiv("newdiv","This is some new html");
62 62
63 63 where AMUi is a new aUX object
64   - var AMUi = new aUX.js();
  64 + var AMUi = new aUX.ui();
65 65
66 66 * To initiate a page transition, you can call the function loadContent(_id_,clearHistory,backbutton,transition)
67 67 <scritp>AMUi.loadContent("my_id",false,false,"pop");
0  appMobiUI.css → aUX_ui.css
File renamed without changes
31 appMobiUI.js → aUX_ui.js
... ... @@ -1,20 +1,16 @@
1 1 /**
2   - * AppMobi.toolkit.ui - A User Interface library for creating
  2 + * aUX.webui - A User Interface library for creating
3 3 *
4 4 * @copyright 2011 - AppMobi
5 5 * @author IDM
6 6 */
7 7
8   -if (!window.AppMobi)
9   - AppMobi = {};
10   -if (!AppMobi.toolkit)
11   - AppMobi.toolkit = {};
12   -AppMobi.domFired=false;
13   -document.addEventListener("DOMContentLoaded",function(){AppMobi.domFired=true;},false);
14   -AppMobi.toolkit.ui = (function() {
  8 +if (!window.aUX)
  9 + aUX = {};
  10 +aUX.domFired=false;
  11 +document.addEventListener("DOMContentLoaded",function(){aUX.domFired=true;},false);
  12 +aUX.ui = (function() {
15 13
16   - var translateOpen = 'm11' in new WebKitCSSMatrix() ? "3d(" : "(";
17   - var translateClose = 'm11' in new WebKitCSSMatrix() ? ",0)" : ")";
18 14 var toolbar = "";
19 15 var content = "";
20 16 var navbar = "";
@@ -25,17 +21,20 @@ AppMobi.toolkit.ui = (function() {
25 21 var activeDiv = "";
26 22 var homeDiv = "";
27 23 var screenWidth = "";
28   - var css3animate = AppMobi.toolkit.css3Animate;
29   - var passwordBox = new AppMobi.toolkit.appMobiPassword();
30   - var selectBox = new AppMobi.toolkit.appMobiSelect();
  24 + var css3animate = aUX.web.css3Animate;
  25 + var passwordBox = new aUX.web.appMobiPassword();
  26 + var selectBox = new aUX.web.appMobiSelect();
31 27 var ajaxUrl = "";
32 28 var transitionType = "slide";
33 29 var scrollingDivs = [];
34 30 var firstDiv = "";
35 31 var ui = function() {
36 32 // Init the page
37   - if(!AppMobi.domFired) //bad hack - could put in bad loop, but tries to not fire ubntil DOMContentLoaded triggers
38   - return new ui();
  33 + if(!aUX.domFired)
  34 + {
  35 + document.addEventListener("DOMContentLoaded",function(){return new ui();},false);
  36 + return;
  37 + }
39 38 var that = this;
40 39 toolbar = $am("toolbar");
41 40 content = $am("content");
@@ -148,7 +147,7 @@ AppMobi.toolkit.ui = (function() {
148 147 selectBox.getOldSelects(tmp.id);
149 148 passwordBox.getOldPasswords(tmp.id);
150 149 if(addScroller){
151   - scrollingDivs[tmp.id]=(AppMobi.toolkit.scroller(myDiv, {
  150 + scrollingDivs[tmp.id]=(aUX.web.scroller(myDiv, {
152 151 scrollBars : true,
153 152 verticalScroll : true,
154 153 horizontalScroll : false,
39 appMobiCss3animate.js → aUX_webCss3animate.js
... ... @@ -1,13 +1,12 @@
1 1 /**
2   - * AppMobi.toolkit.css3Animator
  2 + * aUX.web.css3Animator
3 3 * @copyright 2011 - AppMobi
4   - * @author IDM
5 4 */
6   - if(!window.AppMobi)
7   - AppMobi={};
8   -if(!AppMobi.toolkit)
9   - AppMobi.toolkit={};
10   -AppMobi.toolkit.css3Animate = (function() {
  5 + if(!window.aUX)
  6 + aUX={};
  7 +if(!aUX.web)
  8 + aUX.web={};
  9 +aUX.web.css3Animate = (function() {
11 10
12 11 var translateOpen = 'm11' in new WebKitCSSMatrix() ? "3d(" : "(";
13 12 var translateClose = 'm11' in new WebKitCSSMatrix() ? ",0)" : ")";
@@ -22,7 +21,6 @@ AppMobi.toolkit.css3Animate = (function() {
22 21 if (!this instanceof css3Animate) {
23 22 return new css3Animate(elID, options);
24 23 }
25   -
26 24 if(!this.el)
27 25 return;
28 26 if(!options)
@@ -30,8 +28,6 @@ AppMobi.toolkit.css3Animate = (function() {
30 28 alert("Please provide configuration options for animation of "+elID);
31 29 return;
32 30 }
33   - this.animID=0|Math.random() * 99999999;
34   - var that=this;
35 31 this.el.addEventListener("webkitTransitionEnd", finishAnimation, false);
36 32 if (options["opacity"]) {
37 33 this.el.style.opacity = options["opacity"];
@@ -67,10 +63,10 @@ AppMobi.toolkit.css3Animate = (function() {
67 63
68 64 //check for percent or numbers
69 65
70   - this.el.moving = true;
71   - if(typeof(options.x)=="number"||(options.x.indexOf("%")==-1&&options.x.toLowerCase().indexOf("px")==-1))
  66 +
  67 + if(typeof(options.x)=="number"||(options.x.indexOf("%")==-1&&options.x.toLowerCase().indexOf("px")==-1&&options.x.toLowerCase().indexOf("deg")==-1))
72 68 options.x=parseInt(options.x)+"px";
73   - if(typeof(options.y)=="number"||(options.y.indexOf("%")==-1&&options.y.toLowerCase().indexOf("px")==-1))
  69 + if(typeof(options.y)=="number"||(options.y.indexOf("%")==-1&&options.y.toLowerCase().indexOf("px")==-1&&options.y.toLowerCase().indexOf("deg")==-1))
74 70 options.y=parseInt(options.y)+"px";
75 71
76 72 this.el.style.webkitTransform = "translate" + translateOpen + (options.x)+"," + (options.y)+ translateClose + " scale("+parseFloat(options.scale)+") rotate("+options.rotateX+") rotateY("+options.rotateY+") skew("+options.skewX+","+options.skewY+")";
@@ -86,26 +82,25 @@ AppMobi.toolkit.css3Animate = (function() {
86 82 this.el.style.height = options["height"];
87 83 }
88 84 if (options["callback"]) {
  85 +
89 86 if (!webkitTransitionCallbacks[this.el.id])
90 87 webkitTransitionCallbacks[this.el.id] = [];
91 88 webkitTransitionCallbacks[this.el.id].push(options["callback"]);
92   -
  89 + this.el.moving = true;
93 90 }
94 91 };
95 92
96 93 function finishAnimation(event) {
97 94 event.preventDefault();
98 95 var that = event.target;
99   -
100 96 if (!event.target.moving)
101   - return;
102   - that.removeEventListener("webkitTransitionEnd",finishAnimation,true);
  97 + return;
103 98 event.target.moving = false;
104   - if (webkitTransitionCallbacks[that.id]
105   - && webkitTransitionCallbacks[that.id].length > 0) {
106   - var tmp=webkitTransitionCallbacks[that.id].shift();
107   - tmp();
108   - }
  99 + if (webkitTransitionCallbacks[event.target.id]
  100 + && webkitTransitionCallbacks[event.target.id].length > 0) {
  101 + var cb = webkitTransitionCallbacks[event.target.id].shift();
  102 + cb();
  103 + }
109 104 }
110 105 return css3Animate;
111 106 })();
17 appMobiPasswordBox.js → aUX_webPasswordBox.js
... ... @@ -1,18 +1,17 @@
1 1 /*
2   - * AppMobi.toolkit.appMobiPasswordbox
  2 + * aUX.web.appMobiPasswordbox
3 3 * @copyright 2011 - AppMobi
4   - * @author IDM
5 4 */
6   -if(!window.AppMobi)
7   - AppMobi={};
8   -if (!AppMobi.toolkit)
9   - AppMobi.toolkit = {};
10   -AppMobi.toolkit.appMobiPassword = function() {
  5 +if(!window.aUX)
  6 + aUX={};
  7 +if (!aUX.web)
  8 + aUX.web = {};
  9 +aUX.web.appMobiPassword = function() {
11 10 this.oldPasswords = {};
12 11 };
13 12
14   -AppMobi.toolkit.appMobiPassword.prototype = {
15   - oldPasswords : {},
  13 +aUX.web.appMobiPassword.prototype = {
  14 + oldPasswords : [],
16 15 showPasswordPlainText:false,
17 16 getOldPasswords : function(elID) {
18 17 var container = elID && document.getElementById(elID) ? document
17 appMobiScroll.js → aUX_webScroll.js
... ... @@ -1,18 +1,15 @@
1 1 /**
2   - * AppMobi.toolkit.scroller - a scrolling library for AppMobi Apps Copyright
3   - * 2011 - AppMobi Author: IDM
4   - *
5   - * @TODO - add 'load more' to the bottom
6   - * @TODO - fix positioning of scrollbars based off content related to top/bottom
  2 + * aUX.web.scroller - a scrolling library for AppMobi Apps
  3 + * Copyright 2011 - AppMobi
7 4 */
8 5
9   -if(!window.AppMobi)
10   - AppMobi={};
  6 +if(!window.aUX)
  7 + aUX={};
11 8
12   -if (!AppMobi.toolkit)
13   - AppMobi.toolkit = {};
  9 +if (!aUX.web)
  10 + aUX.web = {};
14 11
15   -AppMobi.toolkit.scroller = (function() {
  12 +aUX.web.scroller = (function() {
16 13 var translateOpen = 'm11' in new WebKitCSSMatrix() ? "3d(" : "(";
17 14 var translateClose = 'm11' in new WebKitCSSMatrix() ? ",0)" : ")";
18 15 var touchStarted=false;
1  aUX_webSelectBox.js
... ... @@ -0,0 +1 @@
  1 +/* * Copyright: 4-2-2011 AppMobi * Description: This script will replace all drop downs with friendly select controls. Users can still interact * with the old drop down box as normal with javascript, and this will be reflected * @TODO - add listeners for new options added after page is rendered */ if(!window.aUX) aUX={}; if (!aUX.web) aUX.web = {}; aUX.web.appMobiSelect = function() { this.oldSelects = []; }; aUX.web.appMobiSelect.prototype = { oldSelects : [], scroller : null, getOldSelects : function(elID) { if (!aUX.web.scroller) { alert("This library requires aUX_web scroller"); return; } var container = elID && document.getElementById(elID) ? document .getElementById(elID) : document; if (!container) { alert("Could not find container element for aUX_web password " + elID); return; } var sels = container.getElementsByTagName("select"); for ( var i = 0; i < sels.length; i++) { this.oldSelects.push(document.getElementById(sels[i])); } var that = this; for ( var i = 0; i < sels.length; i++) { var fakeInput = document.createElement("input"); var selWidth = parseInt(sels[i].style.width) > 0 ? parseInt(sels[i].style.width) : 100; var selHeight = parseInt(sels[i].style.height) > 0 ? parseInt(sels[i].style.height) : 20; fakeInput.type = "text"; fakeInput.style.width = selWidth + "px"; fakeInput.style.height = selHeight + "px"; fakeInput.style.position = "absolute"; fakeInput.style.left = "0px"; fakeInput.style.top = "0px"; fakeInput.style.zIndex = "1"; fakeInput.value = sels[i].value; fakeInput.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"; fakeInput.style.backgroundColor = "white"; fakeInput.className = "appMobiSelect_fakeInput"; fakeInput.id = sels[i].id + "_appMobiSelect"; var imageMask = document.createElement("input"); imageMask.type = "image"; imageMask.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg=="; imageMask.style.width = selWidth + 5 + "px"; imageMask.style.height = selHeight + 5 + "px"; imageMask.style.left = "0px"; imageMask.style.top = "0px"; imageMask.style.zIndex = "2"; imageMask.style.position = "absolute"; imageMask.linkId = sels[i].id; imageMask.className = "appMobiSelect_imageMask"; imageMask.onclick = function(e) { e.preventDefault(); that.initDropDown(this.linkId); }; sels[i].parentNode.appendChild(fakeInput); sels[i].parentNode.appendChild(imageMask); sels[i].parentNode.style.position = "relative"; sels[i].style.display = "none"; sels[i].style.webkitAppearance = "none"; // Create listeners to watch when the select value has changed. // This // is needed so the users can continue to interact as normal, // via // jquery or other frameworks for ( var j = 0; j < sels[i].options.length; j++) { if (sels[i].options[j].selected) fakeInput.value = sels[i].options[j].text; this.watcher(sels[i].options[j], "selected", function(prop, oldValue, newValue) { if (newValue == true) { that.updateMaskValue(this.parentNode.id, this.text); this.parentNode.value = this.value; } return newValue; }); } this.watcher(sels, "selectedIndex", function(prop, oldValue, newValue) { if (this.options[newValue]) { that.updateMaskValue(this.id, this.options[newValue].text); this.value = this.options[newValue].value; } return newValue; }); this.createHtml(); } }, updateDropdown : function(id) { var el = document.getElementById(id); if (!el) return; for ( var j = 0; j < el.options.length; j++) { if (el.options[j].selected) fakeInput.value = el.options[j].text; ; this.watcher(el.options[j], "selected", function(prop, oldValue, newValue) { if (newValue == true) { that.updateMaskValue(this.parentNode.id, this.text); this.parentNode.value = this.value; } return newValue; }); } }, initDropDown : function(elID) { var that = this; var el = document.getElementById(elID); if (!el || !el.options || el.options.length == 0) return; var htmlTemplate = ""; var foundInd = 0; document.getElementById("appMobiselectBoxScroll").innerHTML = ""; for ( var j = 0; j < el.options.length; j++) { var currInd = j; this.watcher(el.options[j], "selected", function(prop, oldValue, newValue) { if (newValue == true) { that.updateMaskValue(this.parentNode.id, this.text); this.parentNode.value = this.value; } return newValue; }); var checked = (el.value == el.options[j].value) ? true : false; var button = ""; var bg = "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)))"; var foundID; if (checked) { bg = "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)))"; button = "checked"; foundInd = j; foundID = "id='appmobiSelectBox_found'"; } else { foundID = ""; } var div = document.createElement("div"); div.id = foundID; div.style.cssText = bg + ";padding-top:10px;font-size:80%;padding-left:10px;height:30px;width:100%;position:relative;width:100%;"; var anchor = document.createElement("a"); anchor.href = "javascript:;"; anchor.tmpValue = j; anchor.onclick = function() { that.setDropDownValue(elID, this.tmpValue); }; anchor.style.cssText = "text-decoration:none;color:white;"; anchor.innerHTML = el.options[j].text; var span = document.createElement("span"); span.style.cssText = "float:right;margin-right:20px;margin-top:-2px"; var rad = document.createElement("button"); if (foundID) rad.style.cssText = "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: 0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);"; else rad.style.cssText = "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: 0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);"; rad.style.width = "20px"; rad.style.height = "20px"; rad.tmpValue = j; rad.onclick = function() { that.setDropDownValue(elID, this.tmpValue); }; rad.checked = button; span.appendChild(rad); div.appendChild(anchor); div.appendChild(span); document.getElementById("appMobiselectBoxScroll").appendChild(div); } try { document.getElementById("appMobiselectBoxContainer").style.display = 'block'; } catch (e) { console.log("Error showing div " + e); } try { var scrollThreshold = 40; var scrollToPos = (foundInd) * -scrollThreshold; if (foundInd >= 3) { this.scroller.scrollTo({ x : 0, y : scrollToPos }); } } catch (e) { console.log("error init dropdown" + e); } }, updateMaskValue : function(elID, value) { var el = document.getElementById(elID + "_appMobiSelect"); if (el) el.value = value; }, setDropDownValue : function(elID, value) { var el = document.getElementById(elID); if (el) { el.selectedIndex = value; } this.scroller.scrollTo({ x : 0, y : 0 }); this.hideDropDown(); }, hideDropDown : function() { document.getElementById("appMobiselectBoxContainer").style.display = 'none'; document.getElementById("appMobiselectBoxScroll").innerHTML = ""; }, createHtml : function() { var that = this; if (document.getElementById("appMobiselectBoxContainer")) return; var myDiv = document.createElement("div"); myDiv.id = "appMobiselectBoxContainer"; myDiv.style.cssText = "position:absolute;bottom:0px;display:none;width:100%;height:175px; z-index:200000;background:black;color:white;"; myDiv.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(myDiv); document.getElementById('appMobiSelectCloseButton').onclick = function() { that.hideDropDown(); }; try { this.scroller = new aUX.web.scroller( "appMobiselectBoxScroll", { scroller : false, verticalScroll : true }); } catch (e) { console.log("Error creating select html " + e); } }, watcher : function(object, prop, handler) { var that = object; var val = object[prop]; window.setInterval(function() { newval = that[prop]; if (newval != val) { handler.call(that, prop, val, newval); val = newval; } }, 1500); } }; function getScrollerValue(el) { return document.getElementById(el).value; }
1  appMobiSelectBox.js
... ... @@ -1 +0,0 @@
1   -/* * appMobiSelect * Author: Ian Maffett - AppMobi * Copyright: 4-2-2011 * Description: This script will replace all drop downs with friendly select controls. Users can still interact * with the old drop down box as normal with javascript, and this will be reflected * @TODO - add listeners for new options added after page is rendered */ if(!window.AppMobi) AppMobi={}; if (!AppMobi.toolkit) AppMobi.toolkit = {}; AppMobi.toolkit.appMobiSelect = function() { this.oldSelects = []; }; AppMobi.toolkit.appMobiSelect.prototype = { oldSelects : [], scroller : null, getOldSelects : function(elID) { if (!AppMobi.toolkit.scroller) { alert("This library requires AppMobi scroller"); return; } var container = elID && document.getElementById(elID) ? document .getElementById(elID) : document; if (!container) { alert("Could not find container element for appMobiPassword " + elID); return; } var sels = container.getElementsByTagName("select"); for ( var i = 0; i < sels.length; i++) { this.oldSelects.push(document.getElementById(sels[i])); } var that = this; for ( var i = 0; i < sels.length; i++) { var fakeInput = document.createElement("input"); var selWidth = parseInt(sels[i].style.width) > 0 ? parseInt(sels[i].style.width) : 100; var selHeight = parseInt(sels[i].style.height) > 0 ? parseInt(sels[i].style.height) : 20; fakeInput.type = "text"; fakeInput.style.width = selWidth + "px"; fakeInput.style.height = selHeight + "px"; fakeInput.style.position = "absolute"; fakeInput.style.left = "0px"; fakeInput.style.top = "0px"; fakeInput.style.zIndex = "1"; fakeInput.value = sels[i].value; fakeInput.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"; fakeInput.style.backgroundColor = "white"; fakeInput.className = "appMobiSelect_fakeInput"; fakeInput.id = sels[i].id + "_appMobiSelect"; var imageMask = document.createElement("input"); imageMask.type = "image"; imageMask.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg=="; imageMask.style.width = selWidth + 5 + "px"; imageMask.style.height = selHeight + 5 + "px"; imageMask.style.left = "0px"; imageMask.style.top = "0px"; imageMask.style.zIndex = "2"; imageMask.style.position = "absolute"; imageMask.linkId = sels[i].id; imageMask.className = "appMobiSelect_imageMask"; imageMask.onclick = function(e) { e.preventDefault(); e.stopPropagation(); that.initDropDown(this.linkId); }; sels[i].parentNode.appendChild(fakeInput); sels[i].parentNode.appendChild(imageMask); sels[i].parentNode.style.position = "relative"; sels[i].style.display = "none"; sels[i].style.webkitAppearance = "none"; // Create listeners to watch when the select value has changed. // This // is needed so the users can continue to interact as normal, // via // jquery or other frameworks for ( var j = 0; j < sels[i].options.length; j++) { if (sels[i].options[j].selected) fakeInput.value = sels[i].options[j].text; this.watcher(sels[i].options[j], "selected", function(prop, oldValue, newValue) { if (newValue == true) { that.updateMaskValue(this.parentNode.id, this.text); this.parentNode.value = this.value; } return newValue; }); } this.watcher(sels, "selectedIndex", function(prop, oldValue, newValue) { if (this.options[newValue]) { that.updateMaskValue(this.id, this.options[newValue].text); this.value = this.options[newValue].value; } return newValue; }); this.createHtml(); } }, updateDropdown : function(id) { var el = document.getElementById(id); if (!el) return; for ( var j = 0; j < el.options.length; j++) { if (el.options[j].selected) fakeInput.value = el.options[j].text; ; this.watcher(el.options[j], "selected", function(prop, oldValue, newValue) { if (newValue == true) { that.updateMaskValue(this.parentNode.id, this.text); this.parentNode.value = this.value; } return newValue; }); } }, initDropDown : function(elID) { var that = this; var el = document.getElementById(elID); if (!el || !el.options || el.options.length == 0) return; var htmlTemplate = ""; var foundInd = 0; document.getElementById("appMobiselectBoxScroll").innerHTML = ""; for ( var j = 0; j < el.options.length; j++) { var currInd = j; this.watcher(el.options[j], "selected", function(prop, oldValue, newValue) { if (newValue == true) { that.updateMaskValue(this.parentNode.id, this.text); this.parentNode.value = this.value; } return newValue; }); var checked = (el.value == el.options[j].value) ? true : false; var button = ""; var bg = "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)))"; var foundID; if (checked) { bg = "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)))"; button = "checked"; foundInd = j; foundID = "id='appmobiSelectBox_found'"; } else { foundID = ""; } var div = document.createElement("div"); div.id = foundID; div.style.cssText = bg + ";padding-top:10px;font-size:80%;padding-left:10px;height:30px;width:100%;position:relative;width:100%;"; var anchor = document.createElement("a"); anchor.href = "javascript:;"; anchor.tmpValue = j; anchor.onclick = function() { that.setDropDownValue(elID, this.tmpValue); }; anchor.style.cssText = "text-decoration:none;color:white;"; anchor.innerHTML = el.options[j].text; var span = document.createElement("span"); span.style.cssText = "float:right;margin-right:20px;margin-top:-2px"; var rad = document.createElement("button"); if (foundID) rad.style.cssText = "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: 0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);"; else rad.style.cssText = "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: 0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);"; rad.style.width = "20px"; rad.style.height = "20px"; rad.tmpValue = j; rad.onclick = function() { that.setDropDownValue(elID, this.tmpValue); }; rad.checked = button; span.appendChild(rad); div.appendChild(anchor); div.appendChild(span); document.getElementById("appMobiselectBoxScroll").appendChild(div); } try { document.getElementById("appMobiselectBoxContainer").style.display = 'block'; } catch (e) { console.log("Error showing div " + e); } try { var scrollThreshold = 40; var scrollToPos = (foundInd) * -scrollThreshold; if (foundInd >= 3) { this.scroller.scrollTo({ x : 0, y : scrollToPos }); } } catch (e) { console.log("error init dropdown" + e); } }, updateMaskValue : function(elID, value) { var el = document.getElementById(elID + "_appMobiSelect"); if (el) el.value = value; }, setDropDownValue : function(elID, value) { var el = document.getElementById(elID); if (el) { el.selectedIndex = value; } this.scroller.scrollTo({ x : 0, y : 0 }); this.hideDropDown(); }, hideDropDown : function() { document.getElementById("appMobiselectBoxContainer").style.display = 'none'; document.getElementById("appMobiselectBoxScroll").innerHTML = ""; }, createHtml : function() { var that = this; if (document.getElementById("appMobiselectBoxContainer")) return; var myDiv = document.createElement("div"); myDiv.id = "appMobiselectBoxContainer"; myDiv.style.cssText = "position:absolute;bottom:0px;display:none;width:100%;height:175px; z-index:200000;background:black;color:white;"; myDiv.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(myDiv); document.getElementById('appMobiSelectCloseButton').onclick = function() { that.hideDropDown(); }; try { this.scroller = new AppMobi.toolkit.scroller( "appMobiselectBoxScroll", { scroller : false, verticalScroll : true }); } catch (e) { console.log("Error creating select html " + e); } }, watcher : function(object, prop, handler) { var that = object; var val = object[prop]; window.setInterval(function() { newval = that[prop]; if (newval != val) { handler.call(that, prop, val, newval); val = newval; } }, 1500); } }; function getScrollerValue(el) { return document.getElementById(el).value; }
159 appmobi.toolkit.ui.min.js
... ... @@ -1,159 +0,0 @@
1   -if(!window.AppMobi)
2   -AppMobi={};if(!AppMobi.toolkit)
3   -AppMobi.toolkit={};AppMobi.toolkit.scroller=(function(){var translateOpen='m11'in new WebKitCSSMatrix()?"3d(":"(";var translateClose='m11'in new WebKitCSSMatrix()?",0)":")";var touchStarted=false;var scroller=function(elID,opts){if(typeof elID=="string"||elID instanceof String){this.el=document.getElementById(elID);}else{this.el=elID;}
4   -if(!this.el){alert("Could not find element for scroller "+elID);return;}
5   -if(this instanceof scroller){for(j in opts){this[j]=opts[j];}}else{return new scroller(elID,opts);}
6   -try{this.container=this.el.parentNode;var that=this;this.el.addEventListener('touchmove',function(e){that.touchMove(e);},false);this.el.addEventListener('touchend',function(e){that.touchEnd(e);},false);var windowHeight=window.innerHeight;var windowWidth=window.innerWidth;if(this["verticalScroll"]&&this["verticalScroll"]==true&&this["scrollBars"]==true){var scrollDiv=createScrollBar(5,20);scrollDiv.style.top="0px";scrollDiv.className=this.vScrollCSS;scrollDiv.style.opacity="0";this.container.appendChild(scrollDiv);this.vscrollBar=scrollDiv;}
7   -if(this["horizontalScroll"]&&this["horizontalScroll"]==true&&this["scrollBars"]==true){var scrollDiv=createScrollBar(20,5);scrollDiv.style.bottom="0px";scrollDiv.className=this.hScrollCSS;scrollDiv.style.opacity="0";this.container.appendChild(scrollDiv);this.hscrollBar=scrollDiv;}}catch(e){alert("error adding scroller"+e);}};function createScrollBar(width,height){var scrollDiv=document.createElement("div");scrollDiv.style.position='absolute';scrollDiv.style.width=width+"px";scrollDiv.style.height=height+"px";scrollDiv.style.webkitBorderRadius="2px";scrollDiv.className='scrollBar';scrollDiv.style.opacity=.7;scrollDiv.style.background="black";return scrollDiv;}
8   -scroller.prototype={lockX:0,lockY:0,boolScrollLock:false,currentScrollingObject:null,bottomMargin:0,maxTop:0,startTop:0,verticalScroll:true,horizontalScroll:false,scrollBars:true,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(event){try{if(!touchStarted){touchStarted=true;this.touchStart(event);}
9   -if(this.currentScrollingObject!=null){event.preventDefault();var scrollPoints={x:0,y:0};var scrollbarPoints={x:0,y:0};var newTop=0,prevTop=0,newLeft=0,prevLeft=0;if(this.verticalScroll){var deltaY=this.lockY-event.touches[0].pageY;deltaY=-deltaY;var newTop=this.startTop+deltaY;var top=-newTop;var prevTop=new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform).f;scrollPoints.y=newTop;}
10   -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);scrollPoints.x=left;}
11   -this.scrollerMoveCSS(this.currentScrollingObject,scrollPoints,0);if(this.vscrollBar){var pos=(this.bottomMargin-numOnly(this.vscrollBar.style.height))
12   --(((this.maxTop+newTop)/this.maxTop)*(this.bottomMargin-numOnly(this.vscrollBar.style.height)));this.scrollerMoveCSS(this.vscrollBar,{x:0,y:pos},0);}
13   -if(this.hscrollBar){var pos=(this.rightMargin-numOnly(this.hscrollBar.style.width))
14   --(((this.maxLeft+newLeft)/this.maxLeft)*(this.rightMargin-numOnly(this.hscrollBar.style.width)));this.scrollerMoveCSS(this.hscrollBar,{x:pos,y:0},0);}
15   -if(this.prevTime){var tmpDistanceY=Math.abs(prevTop)-Math.abs(newTop);var tmpDistanceX=Math.abs(prevLeft)
16   --Math.abs(newLeft);var tmpTime=event.timeStamp-this.prevTime;if(tmpTime<1000){this.timeMoved+=tmpTime;this.vdistanceMoved+=tmpDistanceY;this.hdistanceMoved+=tmpDistanceX;}else{this.timeMoved=0;this.vdistanceMoved=0;this.hdistanceMoved=0;}}
17   -this.prevTime=event.timeStamp;}}catch(e){alert("error in scrollMove: "+e);}},touchStart:function(event){var container=this.container;var eleScrolling=this.el;if(!container)
18   -return;try{if(event.touches[0].target&&event.touches[0].target.type!=undefined){var tagname=event.touches[0].target.tagName.toLowerCase();if(tagname=="select"||tagname=="input"||tagname=="button")
19   -return;}
20   -this.timeMoved=0;this.vdistanceMoved=0;this.hdistanceMoved=0;this.prevTime=null;this.finishScrollingObject=null;this.bottomMargin=container.clientHeight>window.innerHeight?window.innerHeight:container.clientHeight;this.maxTop=eleScrolling.clientHeight-this.bottomMargin;this.divHeight=eleScrolling.clientHeight;this.rightMargin=container.clientWidth>window.innerWidth?window.innerWidth:container.clientWidth;this.maxLeft=eleScrolling.clientWidth-this.rightMargin;this.divWidth=eleScrolling.clientWidth;if(this.maxTop<0)
21   -return;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;}catch(e){this.startTop=0;this.startLeft=0;console.log("error scroller touchstart "+e);}
22   -this.lockX=event.touches[0].pageX;this.lockY=event.touches[0].pageY;this.currentScrollingObject=eleScrolling;if(this.vscrollBar){this.vscrollBar.style.height=(parseFloat(this.bottomMargin/this.divHeight)*this.bottomMargin)
23   -+"px";var pos=(this.bottomMargin-numOnly(this.vscrollBar.style.height))
24   --(((this.maxTop+this.startTop)/this.maxTop)*(this.bottomMargin-numOnly(this.vscrollBar.style.height)));this.scrollerMoveCSS(this.vscrollBar,{x:0,y:pos},0);if(this.container.clientWidth>window.innerWidth)
25   -this.vscrollBar.style.left=(window.innerWidth-numOnly(this.vscrollBar.style.width))
26   -+"px";else
27   -this.vscrollBar.style.right="0px";this.vscrollBar.webkitTransition="opacity";this.vscrollBar.style.opacity=1;}
28   -if(this.hscrollBar){this.hscrollBar.style.width=(parseFloat(this.rightMargin/this.divWidth)*this.rightMargin)
29   -+"px";var pos=(this.rightMargin-numOnly(this.hscrollBar.style.width))
30   --(((this.maxTop+this.startLeft)/this.maxtLeft)*(this.rightMargin-numOnly(this.hscrollBar.style.width)));this.scrollerMoveCSS(this.hscrollBar,{x:pos,y:0},0);if(this.container.clientHeight>window.innerHeight)
31   -this.hscrollBar.style.top=(window.innerHeight-numOnly(this.hscrollBar.style.height))
32   -+"px";else
33   -this.hscrollBar.style.bottom="0px";this.hscrollBar.webkitTransition="opacity";this.hscrollBar.style.opacity=1;}
34   -event.preventDefault();}}catch(e){alert("error in scrollStart: "+e);}},touchEnd:function(event){if(this.currentScrollingObject!=null){event.preventDefault();event.stopPropagation();this.finishScrollingObject=this.currentScrollingObject;this.currentScrollingObject=null;var scrollPoints={x:0,y:0};if(this.verticalScroll){var myDistance=-this.vdistanceMoved;var dist=myDistance;var time=this.timeMoved;var friction=2.0;var deceleration=2.0;var speed=Math.abs(dist)/time*1000;var distanceDelim=(Math.abs(dist)/time)*friction;var newDist=speed*speed/friction/1000/distanceDelim;newTime=0;newDist=newDist*(dist<0?-1:1);newTime=speed/deceleration;var move=new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform).f;if(move<0)
35   -move=move-newDist;if(move>0)
36   -move=0;if(move<(-this.maxTop))
37   -move=-this.maxTop;scrollPoints.y=move;}
38   -if(this.horizontalScroll){var myDistance=-this.hdistanceMoved;var dist=myDistance;var time=this.timeMoved;var friction=2.0;var deceleration=2.0;var speed=Math.abs(dist)/time*1000;var distanceDelim=(Math.abs(dist)/time)*friction;var newDist=speed*speed/friction/1000/distanceDelim;newTime=0;newDist=newDist*(dist<0?-1:1);newTime=speed/deceleration;var move=new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform).e;if(move<0)
39   -move=move-newDist;if(move>0)
40   -move=0;if(move<(-this.maxLeft))
41   -move=-this.maxLeft;scrollPoints.x=move;}
42   -var that=this;this.scrollerMoveCSS(this.finishScrollingObject,scrollPoints,300,"ease-out");if(this.vscrollBar){var pos=(this.bottomMargin-numOnly(this.vscrollBar.style.height))
43   --(((this.maxTop+scrollPoints.y)/this.maxTop)*(this.bottomMargin-numOnly(this.vscrollBar.style.height)));if(pos>this.bottomMargin)
44   -pos=this.bottomMargin;if(pos<0)
45   -pos=0;this.scrollerMoveCSS(this.vscrollBar,{x:0,y:pos},300,"ease-out");this.vscrollBar.style.opacity='0';}
46   -if(this.hscrollBar){var pos=(this.rightMargin-numOnly(this.hscrollBar.style.width))
47   --(((this.maxLeft+scrollPoints.x)/this.maxLeft)*(this.rightMargin-numOnly(this.hscrollBar.style.width)));if(pos>this.rightMargin)
48   -pos=this.rightMargin;if(pos<0)
49   -pos=0;this.scrollerMoveCSS(this.hscrollBar,{x:pos,y:0},300,"ease-out");this.hscrollBar.style.opacity='0';}}
50   -this.hdistanceMoved=0;this.vdistanceMoved=0;touchStarted=false;},scrollerMoveCSS:function(el,distanceToMove,time,timingFunction){if(!time)
51   -time=0;if(!timingFunction)
52   -timingFunction="linear";el.style.webkitTransform="translate"+translateOpen
53   -+distanceToMove.x+"px,"+distanceToMove.y+"px"
54   -+translateClose;el.style.webkitTransitionDuration=time+"ms";el.style.webkitBackfaceVisiblity="hidden";el.style.webkitTransitionTimingFunction=timingFunction;},scrollTo:function(pos){this.scrollerMoveCSS(this.el,pos,0);}};return scroller;})();if(!window.numOnly){function numOnly(val){if(isNaN(parseFloat(val)))
55   -val=val.replace(/[^0-9.-]/,"");return parseFloat(val);}}
56   -if(!window.AppMobi)
57   -AppMobi={};if(!AppMobi.toolkit)
58   -AppMobi.toolkit={};AppMobi.toolkit.css3Animate=(function(){var translateOpen='m11'in new WebKitCSSMatrix()?"3d(":"(";var translateClose='m11'in new WebKitCSSMatrix()?",0)":")";var webkitTransitionCallbacks={};var css3Animate=function(elID,options){if(typeof elID=="string"||elID instanceof String){this.el=document.getElementById(elID);}else{this.el=elID;}
59   -if(!this instanceof css3Animate){return new css3Animate(elID,options);}
60   -if(!this.el)
61   -return;if(!options)
62   -{alert("Please provide configuration options for animation of "+elID);return;}
63   -this.animID=0|Math.random()*99999999;var that=this;this.el.addEventListener("webkitTransitionEnd",finishAnimation,false);if(options["opacity"]){this.el.style.opacity=options["opacity"];}
64   -if(!options["y"])
65   -options["y"]=0;if(!options["x"])
66   -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;}
67   -if(!options["origin"])
68   -options.origin="0% 0%";if(!options["scale"])
69   -options.scale="1";if(!options["rotateY"])
70   -options.rotateY="0";if(!options["rotateX"])
71   -options.rotateX="0";if(!options["skewY"])
72   -options.skewY="0";if(!options["skewX"])
73   -options.skewX="0";if(!options["timingFunction"])
74   -options["timingFunction"]="linear";this.el.moving=true;if(typeof(options.x)=="number"||(options.x.indexOf("%")==-1&&options.x.toLowerCase().indexOf("px")==-1))
75   -options.x=parseInt(options.x)+"px";if(typeof(options.y)=="number"||(options.y.indexOf("%")==-1&&options.y.toLowerCase().indexOf("px")==-1))
76   -options.y=parseInt(options.y)+"px";this.el.style.webkitTransform="translate"+translateOpen+(options.x)+","+(options.y)+translateClose+" scale("+parseFloat(options.scale)+") rotate("+options.rotateX+") rotateY("+options.rotateY+") skew("+options.skewX+","+options.skewY+")";this.el.style.webkitBackfaceVisiblity="hidden";this.el.style.webkitTransition="all "+options["time"];this.el.style.webkitTransitionTimingFunction=options["timingFunction"];this.el.style.webkitTransformOrigin=options.origin;if(options["width"]){this.el.style.width=options["width"];}
77   -if(options["height"]){this.el.style.height=options["height"];}
78   -if(options["callback"]){if(!webkitTransitionCallbacks[this.el.id])
79   -webkitTransitionCallbacks[this.el.id]=[];webkitTransitionCallbacks[this.el.id].push(options["callback"]);}};function finishAnimation(event){event.preventDefault();var that=event.target;if(!event.target.moving)
80   -return;that.removeEventListener("webkitTransitionEnd",finishAnimation,true);event.target.moving=false;if(webkitTransitionCallbacks[that.id]&&webkitTransitionCallbacks[that.id].length>0){var tmp=webkitTransitionCallbacks[that.id].shift();tmp();}}
81   -return css3Animate;})();if(!window.AppMobi)
82   -AppMobi={};if(!AppMobi.toolkit)
83   -AppMobi.toolkit={};AppMobi.toolkit.appMobiSelect=function(){this.oldSelects=[];};AppMobi.toolkit.appMobiSelect.prototype={oldSelects:[],scroller:null,getOldSelects:function(elID){if(!AppMobi.toolkit.scroller){alert("This library requires AppMobi scroller");return;}
84   -var container=elID&&document.getElementById(elID)?document.getElementById(elID):document;if(!container){alert("Could not find container element for appMobiPassword "
85   -+elID);return;}
86   -var sels=container.getElementsByTagName("select");for(var i=0;i<sels.length;i++){this.oldSelects.push(document.getElementById(sels[i]));}
87   -var that=this;for(var i=0;i<sels.length;i++){var fakeInput=document.createElement("input");var selWidth=parseInt(sels[i].style.width)>0?parseInt(sels[i].style.width):100;var selHeight=parseInt(sels[i].style.height)>0?parseInt(sels[i].style.height):20;fakeInput.type="text";fakeInput.style.width=selWidth+"px";fakeInput.style.height=selHeight+"px";fakeInput.style.position="absolute";fakeInput.style.left="0px";fakeInput.style.top="0px";fakeInput.style.zIndex="1";fakeInput.value=sels[i].value;fakeInput.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";fakeInput.style.backgroundColor="white";fakeInput.className="appMobiSelect_fakeInput";fakeInput.id=sels[i].id+"_appMobiSelect";var imageMask=document.createElement("input");imageMask.type="image";imageMask.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==";imageMask.style.width=selWidth+5+"px";imageMask.style.height=selHeight+5+"px";imageMask.style.left="0px";imageMask.style.top="0px";imageMask.style.zIndex="2";imageMask.style.position="absolute";imageMask.linkId=sels[i].id;imageMask.className="appMobiSelect_imageMask";imageMask.onclick=function(e){e.preventDefault();e.stopPropagation();that.initDropDown(this.linkId);};sels[i].parentNode.appendChild(fakeInput);sels[i].parentNode.appendChild(imageMask);sels[i].parentNode.style.position="relative";sels[i].style.display="none";sels[i].style.webkitAppearance="none";for(var j=0;j<sels[i].options.length;j++){if(sels[i].options[j].selected)
88   -fakeInput.value=sels[i].options[j].text;this.watcher(sels[i].options[j],"selected",function(prop,oldValue,newValue){if(newValue==true){that.updateMaskValue(this.parentNode.id,this.text);this.parentNode.value=this.value;}
89   -return newValue;});}
90   -this.watcher(sels,"selectedIndex",function(prop,oldValue,newValue){if(this.options[newValue]){that.updateMaskValue(this.id,this.options[newValue].text);this.value=this.options[newValue].value;}
91   -return newValue;});this.createHtml();}},updateDropdown:function(id){var el=document.getElementById(id);if(!el)
92   -return;for(var j=0;j<el.options.length;j++){if(el.options[j].selected)
93   -fakeInput.value=el.options[j].text;;this.watcher(el.options[j],"selected",function(prop,oldValue,newValue){if(newValue==true){that.updateMaskValue(this.parentNode.id,this.text);this.parentNode.value=this.value;}
94   -return newValue;});}},initDropDown:function(elID){var that=this;var el=document.getElementById(elID);if(!el||!el.options||el.options.length==0)
95   -return;var htmlTemplate="";var foundInd=0;document.getElementById("appMobiselectBoxScroll").innerHTML="";for(var j=0;j<el.options.length;j++){var currInd=j;this.watcher(el.options[j],"selected",function(prop,oldValue,newValue){if(newValue==true){that.updateMaskValue(this.parentNode.id,this.text);this.parentNode.value=this.value;}
96   -return newValue;});var checked=(el.value==el.options[j].value)?true:false;var button="";var bg="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)))";var foundID;if(checked){bg="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)))";button="checked";foundInd=j;foundID="id='appmobiSelectBox_found'";}else{foundID="";}
97   -var div=document.createElement("div");div.id=foundID;div.style.cssText=bg
98   -+";padding-top:10px;font-size:80%;padding-left:10px;height:30px;width:100%;position:relative;width:100%;";var anchor=document.createElement("a");anchor.href="javascript:;";anchor.tmpValue=j;anchor.onclick=function(){that.setDropDownValue(elID,this.tmpValue);};anchor.style.cssText="text-decoration:none;color:white;";anchor.innerHTML=el.options[j].text;var span=document.createElement("span");span.style.cssText="float:right;margin-right:20px;margin-top:-2px";var rad=document.createElement("button");if(foundID)
99   -rad.style.cssText="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: 0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);";else
100   -rad.style.cssText="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: 0px 1px 3px rgba(000,000,000,0.5),inset 0px 0px 1px rgba(255,255,255,0.6);";rad.style.width="20px";rad.style.height="20px";rad.tmpValue=j;rad.onclick=function(){that.setDropDownValue(elID,this.tmpValue);};rad.checked=button;span.appendChild(rad);div.appendChild(anchor);div.appendChild(span);document.getElementById("appMobiselectBoxScroll").appendChild(div);}
101   -try{document.getElementById("appMobiselectBoxContainer").style.display='block';}catch(e){console.log("Error showing div "+e);}
102   -try{var scrollThreshold=40;var scrollToPos=(foundInd)*-scrollThreshold;if(foundInd>=3){this.scroller.scrollTo({x:0,y:scrollToPos});}}catch(e){console.log("error init dropdown"+e);}},updateMaskValue:function(elID,value){var el=document.getElementById(elID+"_appMobiSelect");if(el)
103   -el.value=value;},setDropDownValue:function(elID,value){var el=document.getElementById(elID);if(el){el.selectedIndex=value;}
104   -this.scroller.scrollTo({x:0,y:0});this.hideDropDown();},hideDropDown:function(){document.getElementById("appMobiselectBoxContainer").style.display='none';document.getElementById("appMobiselectBoxScroll").innerHTML="";},createHtml:function(){var that=this;if(document.getElementById("appMobiselectBoxContainer"))
105   -return;var myDiv=document.createElement("div");myDiv.id="appMobiselectBoxContainer";myDiv.style.cssText="position:absolute;bottom:0px;display:none;width:100%;height:175px; z-index:200000;background:black;color:white;";myDiv.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(myDiv);document.getElementById('appMobiSelectCloseButton').onclick=function(){that.hideDropDown();};try{this.scroller=new AppMobi.toolkit.scroller("appMobiselectBoxScroll",{scroller:false,verticalScroll:true});}catch(e){console.log("Error creating select html "+e);}},watcher:function(object,prop,handler){var that=object;var val=object[prop];window.setInterval(function(){newval=that[prop];if(newval!=val){handler.call(that,prop,val,newval);val=newval;}},1500);}};function getScrollerValue(el){return document.getElementById(el).value;}
106   -if(!window.AppMobi)
107   -AppMobi={};if(!AppMobi.toolkit)
108   -AppMobi.toolkit={};AppMobi.toolkit.appMobiPassword=function(){this.oldPasswords={};};AppMobi.toolkit.appMobiPassword.prototype={oldPasswords:{},showPasswordPlainText:false,getOldPasswords:function(elID){var container=elID&&document.getElementById(elID)?document.getElementById(elID):document;if(!container){alert("Could not find container element for appMobiPassword "
109   -+elID);return;}
110   -var sels=container.getElementsByTagName("input");var that=this;for(var i=0;i<sels.length;i++){if(sels[i].type!="password")
111   -continue;this.oldPasswords[sels[i].id]=sels[i];var fakeInput=document.createElement("input");var selWidth=parseInt(sels[i].style.width)>0?parseInt(sels[i].style.width):100;var selHeight=parseInt(sels[i].style.height)>0?parseInt(sels[i].style.height):20;fakeInput.type="text";if(sels[i].className!=""){fakeInput.style.width=selWidth+"px";fakeInput.style.height=selHeight+"px";fakeInput.style.backgroundColor="white";}
112   -fakeInput.style.position="relative";fakeInput.style.left="0px";fakeInput.style.top="0px";fakeInput.style.zIndex="1";fakeInput.value=sels[i].value;fakeInput.showPasswordPlainText=that.showPasswordPlainText;fakeInput.className=sels[i].className;fakeInput.id=sels[i].id+"_appMobiPassword";fakeInput.placeHolder=sels[i].placeHolder;var realPW=sels[i];fakeInput.onkeyup=function(){if(realPW.value.length!=this.value.length){var theText=this.value.substring(this.selectionStart-1,this.selectionStart);var oldCaret=this.selectionStart;that.updatePassword(realPW,theText,this.selectionStart,this.value.length);if(realPW.value.length>0&&!this.showPasswordPlainText){var oldTxt=this.value;this.value="";this.value=oldTxt.replace(theText,"*");if(oldCaret!=this.value.length)
113   -this.setSelectionRange(oldCaret,oldCaret);}else if(realPW.value.length==0)
114   -this.value="";}};sels[i].parentNode.appendChild(fakeInput);sels[i].style.display="none";sels[i].parentNode.appendChild(fakeInput);}},updatePassword:function(elem,val,caretPos,totalLength){if(totalLength==0){elem.value="";}
115   -if(totalLength>elem.value.length&&val.length>0){var str=elem.value;elem.value=str.substring(0,caretPos-1)+val
116   -+str.substring(caretPos-1,str.length);}else{var str=elem.value;elem.value=str.substring(0,caretPos)
117   -+str.substring(caretPos+1,str.length);}},changePasswordVisiblity:function(what,id)
118   -{what=parseInt(what);if(this.oldPasswords[id])
119   -{var theEl=document.getElementById(id+"_appMobiPassword");if(what==1){this.showPasswordPlainText=true;theEl.showPasswordPlainText=showPasswordPlainText=true;theEl.value=this.oldPasswords[id].value;}
120   -else{this.showPasswordPlainText=false;theEl.showPasswordPlainText=showPasswordPlainText=false;var pwStr="";for(var i=0;i<theEl.value.length;i++)
121   -{pwStr+="*";}
122   -theEl.value=pwStr;}}}};if(!window.AppMobi)
123   -AppMobi={};if(!AppMobi.toolkit)
124   -AppMobi.toolkit={};AppMobi.domFired=false;document.addEventListener("DOMContentLoaded",function(){AppMobi.domFired=true;},false);AppMobi.toolkit.ui=(function(){var translateOpen='m11'in new WebKitCSSMatrix()?"3d(":"(";var translateClose='m11'in new WebKitCSSMatrix()?",0)":")";var toolbar="";var content="";var navbar="";var backButton="";var titleBar="";var remotePages={};var history=[];var activeDiv="";var homeDiv="";var screenWidth="";var css3animate=AppMobi.toolkit.css3Animate;var passwordBox=new AppMobi.toolkit.appMobiPassword();var selectBox=new AppMobi.toolkit.appMobiSelect();var ajaxUrl="";var transitionType="slide";var scrollingDivs=[];var firstDiv="";var ui=function(){var that=this;toolbar=$am("toolbar");content=$am("content");navbar=$am("navbar");if(!toolbar){var toolbar=document.createElement("div");toolbar.id="toolbar";toolbar.style.cssText="display:none";}
125   -if(!navbar){navbar=document.createElement("div");navbar.id="navbar";document.body.appendChild(navbar);}
126   -if(!content){content=document.createElement("div");content.id="content";document.body.appendChild(content);}
127   -navbar.innerHTML='<a id="backButton" href="javascript:;"><div>Back</div></a> <h1 id="pageTitle"></h1>'
128   -+navbar.innerHTML;backButton=$am("backButton");backButton.className="button";backButton.onclick=function(){if(history.length>0){var tmpEl=history.pop();that.loadContent(tmpEl.target+"",0,1,tmpEl.transition);transitionType=tmpEl.transition;}};backButton.style.visibility="hidden";titleBar=$am("pageTitle");this.addContentDiv("AMUi_ajax","");var maskDiv=document.createElement("div");maskDiv.id="AMUI_mask";maskDiv.className="ui-loader ui-body-a ui-corner-all loading-mask";maskDiv.innerHTML="<span class='ui-icon ui-icon-loading spin'></span><h1>Loading Content</h1>";maskDiv.zIndex=20000;maskDiv.style.display="none";document.body.appendChild(maskDiv);document.addEventListener("appMobi.device.orientation.change",that.updateOrientation,false);this.updateAnchors(toolbar,1);this.updateAnchors(navbar);var contentDivs=getElementsByClass(document,"panel","div");while(contentDivs.length>0){var el=contentDivs.pop();var tmp=el;if(el.parentNode&&el.parentNode.id!="content"){el.parentNode.removeChild(el);this.addDivAndScroll(tmp);}}
129   -if(firstDiv){activeDiv=firstDiv;window.setTimeout(function(){css3animate(firstDiv,{x:"100%",time:"0ms"});if(activeDiv.title)
130   -titleBar.innerHTML=activeDiv.title;},100);}};ui.prototype={clearHistory:function(){this.history=[];},updateContentDiv:function(id,content){var el=$am(id);if(!el)
131   -return;el.childNodes[0].innerHTML=content;},addContentDiv:function(el,content){var myEl=document.getElementById(el);if(!myEl){var newDiv=document.createElement("div");newDiv.id=el;newDiv.innerHTML=content;}else{newDiv=myEl;}
132   -newDiv.className="panel";this.addDivAndScroll(newDiv);},addDivAndScroll:function(tmp){content.appendChild(tmp);var addScroller=true;if(tmp.getAttribute("scrolling")&&tmp.getAttribute("scrolling").toLowerCase()=="no")
133   -addScroller=false;var myDiv=document.createElement("div");myDiv.innerHTML=tmp.innerHTML;myDiv.innerHTML+="<Br>";tmp.innerHTML="";tmp.appendChild(myDiv);this.updateAnchors(myDiv);selectBox.getOldSelects(tmp.id);passwordBox.getOldPasswords(tmp.id);if(addScroller){scrollingDivs[tmp.id]=(AppMobi.toolkit.scroller(myDiv,{scrollBars:true,verticalScroll:true,horizontalScroll:false,vScrollCSS:"scrollBarV"}));}},updateAnchors:function(domEl,reset){var anchors=domEl.getElementsByTagName("a");var that=this;var theTransition;for(var i=0;i<anchors.length;i++){if(anchors[i].href.indexOf("javascript:")!=-1)
134   -continue;anchors[i].oldhref=anchors[i].href;anchors[i].oldhash=anchors[i].hash;anchors[i].href="javascript:;"
135   -anchors[i].oldonclick=anchors[i].onclick;anchors[i].resetHistory=reset;anchors[i].onclick=function(){var transition="slide";if(this.target&&this.target!=""){if(AppMobi.device&&AppMobi.device.showRemoteSite)
136   -AppMobi.device.showRemoteSite(this.oldhref);else{window.open(this.oldhref);}
137   -return;}
138   -var mytransition=this.getAttribute("data-transition");switch(mytransition){case"up":transition="up";break;case"down":transition="down";break;case"flip":transition="flip";break;case"fade":transition="fade";break;case"pop":transition="pop";break;default:transition="slide";}
139   -that.loadContent(this.oldhash?this.oldhash:this.oldhref,this.resetHistory,0,transition);if(this.oldonclick)
140   -this.oldonclick();}}},updateOrientation:function(event){for(var i=0;i<scrollingDivs.length;i++){scrollingDivs[i].scrollTo({x:0,y:0});}
141   -css3animate(activeDiv,{x:"100%",time:"0ms"});},loadContent:function(target,newTab,back,transition){try{what=null;var that=this;that.hideMask();if(target.indexOf("#")==-1){if(activeDiv.id=="AMUi_ajax"&&target==ajaxUrl)
142   -return;if(target.indexOf("http")==-1)
143   -target=AppMobi.webRoot+target;var xmlhttp=new XMLHttpRequest();xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){that.updateContentDiv("AMUi_ajax",xmlhttp.responseText);$am("AMUi_ajax").title=target;that.loadContent("#AMUi_ajax",newTab,back);return;}};ajaxUrl=target;xmlhttp.open("GET",target,true);xmlhttp.send();this.showMask();}else{what=target.replace("#","");what=$am(what);if(what==activeDiv&&!back)
144   -return;what.style.display="block";if(scrollingDivs[what.id])
145   -{scrollingDivs[what.id].scrollTo({x:0,y:0})}
146   -var oldHistory=[];if(newTab){history=[];history.push({target:"#"+firstDiv.id,transition:"slide"});}else if(!back){history.push({target:"#"+activeDiv.id,transition:transition});}
147   -transitionType=transition;var oldDiv=activeDiv;var currWhat=what;switch(transition){case"up":this.slideUpTransition(oldDiv,currWhat,back);break;case"down":this.slideDownTransition(oldDiv,currWhat,back);break;case"fade":this.fadeTransition(oldDiv,currWhat,back);break;case"flip":this.flipTransition(oldDiv,currWhat,back);break;case"pop":this.popTransition(oldDiv,currWhat,back);break;default:this.slideTransition(oldDiv,currWhat,back);}
148   -if(back){if(history.length>0){var val=history[history.length-1];var el=$am(val.target.replace("#",""));backButton.innerHTML="<div>"+el.title+"</div>";}}else if(activeDiv.title)
149   -backButton.innerHTML="<div>"+activeDiv.title+"</div>";else
150   -backButton.innerHTML="<div>"+"Back"+"</div>";if(what.title){titleBar.innerHTML=what.title;}
151   -if(newTab){backButton.innerHTML=firstDiv.title;}
152   -if(history.length==0){backButton.style.visibility="hidden";history=[];}else
153   -backButton.style.visibility="visible";activeDiv=what;}}catch(e){console.log("Error with loading content "+e+" - "
154   -+target);}},showMask:function(){$am("AMUI_mask").style.display="block";},hideMask:function(){$am("AMUI_mask").style.display="none";},slideTransition:function(oldDiv,currDiv,back){if(back){css3animate(oldDiv,{x:"200%",time:"200ms",callback:function(){css3animate(oldDiv,{x:0,time:"1ms"});}});css3animate(currDiv,{x:"100%",time:"200ms"});}else{css3animate(oldDiv,{x:"0%",time:"200ms"});css3animate(currDiv,{x:"200%",time:"1ms",callback:function(){css3animate(currDiv,{x:"100%",time:"200ms"});}});}},slideUpTransition:function(oldDiv,currDiv,back){if(back){css3animate(currDiv,{x:"100%",y:"0%",time:"1ms"});css3animate(oldDiv,{y:"100%",x:"100%",time:"200ms",callback:function(){css3animate(oldDiv,{x:0,y:0,time:"1ms"});currDiv.style.zIndex=2;oldDiv.style.zIndex=1;}});}else{oldDiv.style.zIndex=1;currDiv.style.zIndex=2;css3animate(oldDiv,{x:"100%",time:"200ms",callback:function(){css3animate(oldDiv,{x:0,y:0,time:"1ms"})}});css3animate(currDiv,{y:"100%",x:"100%",time:"1ms",callback:function(){css3animate(currDiv,{y:"0%",x:"100%",time:"200ms"});}});}},slideDownTransition:function(oldDiv,currDiv,back){if(back){css3animate(currDiv,{x:"100%",y:"0%",time:"1ms"});css3animate(oldDiv,{y:"-100%",x:"100%",time:"200ms",callback:function(){css3animate(oldDiv,{x:0,y:0,time:"1ms"});currDiv.style.zIndex=2;oldDiv.style.zIndex=1;}});}else{oldDiv.style.zIndex=1;currDiv.style.zIndex=2;css3animate(oldDiv,{x:"100%",time:"200ms",callback:function(){css3animate(oldDiv,{x:0,y:0,time:"1ms"})}});css3animate(currDiv,{y:"-100%",x:"100%",time:"1ms",callback:function(){css3animate(currDiv,{y:"0%",x:"100%",time:"200ms"});}});}},flipTransition:function(oldDiv,currDiv,back){if(back){css3animate(currDiv,{x:"200%",time:"1ms",scale:.8,rotateY:"180deg",callback:function(){css3animate(currDiv,{x:"100%",time:"200ms"});}});css3animate(oldDiv,{x:"200%",time:"200ms",scale:.8,rotateY:"180deg",callback:function(){css3animate(oldDiv,{x:0,time:"1ms",opacity:1});currDiv.style.zIndex=2;oldDiv.style.zIndex=1;}});}else{oldDiv.style.zIndex=1;currDiv.style.zIndex=2;css3animate(oldDiv,{x:"200%",time:"200ms",scale:'.8',rotateY:"180deg",callback:function(){css3animate(oldDiv,{x:0,y:0,time:"1ms"})}});css3animate(currDiv,{x:"200%",time:"1ms",scale:.8,rotateY:"180deg",callback:function(){css3animate(currDiv,{x:"100%",time:"200ms"});}});}},fadeTransition:function(oldDiv,currDiv,back){if(back){css3animate(currDiv,{x:"100%",time:"1ms"});css3animate(oldDiv,{x:"100%",time:"200ms",opacity:.1,callback:function(){css3animate(oldDiv,{x:0,time:"1ms",opacity:1});currDiv.style.zIndex=2;oldDiv.style.zIndex=1;}});}else{oldDiv.style.zIndex=1;currDiv.style.zIndex=2;css3animate(oldDiv,{x:"100%",time:"200ms",callback:function(){css3animate(oldDiv,{x:0,y:0,time:"1ms"})}});currDiv.style.opacity=0;css3animate(currDiv,{x:"100%",time:"1ms",callback:function(){css3animate(currDiv,{x:"100%",time:"200ms",opacity:1});}});}},popTransition:function(oldDiv,currDiv,back){if(back){css3animate(currDiv,{x:"100%",time:"1ms"});css3animate(oldDiv,{x:"100%",time:"200ms",opacity:.1,scale:.2,origin:"50% 50%",callback:function(){css3animate(oldDiv,{x:0,time:"1ms"});currDiv.style.zIndex=2;oldDiv.style.zIndex=1;}});}else{oldDiv.style.zIndex=1;currDiv.style.zIndex=2;css3animate(oldDiv,{x:"100%",time:"200ms",callback:function(){css3animate(oldDiv,{x:0,y:0,time:"1ms"})}});css3animate(currDiv,{x:"100%",y:"0%",time:"1ms",scale:.2,origin:"50% 50%",opacity:.1,callback:function(){css3animate(currDiv,{x:"100%",time:"200ms",scale:1,opacity:1,origin:"0% 0%"});}});}}};function $am(el){return document.getElementById(el);}
155   -function getElementsByClass(node,searchClass,tag){var classElements=new Array();if(!tag)
156   -tag="*";var els=node.getElementsByTagName(tag);var elsLen=els.length;for(i=0;i<elsLen;i++){if(els[i].className.indexOf(searchClass)!=-1){classElements.push(els[i]);if(els[i].getAttribute("selected"))
157   -firstDiv=els[i];}}
158   -return classElements;}
159   -return ui;})();
21 index.html
@@ -7,13 +7,15 @@
7 7
8 8 <script type="text/javascript" charset="utf-8" src="http://localhost:58888/_appMobi/appmobi.js"></script>
9 9 <script type="text/javascript" charset="utf-8" src="http://localhost:58888/_appMobi/xhr.js"></script>
10   -
11   -
12   -<script src="appMobiCss3animate.js"></script>
13   -<script src="appMobiSelectBox.js"></script>
14   -<script src="appMobiPasswordBox.js"></script>
15   -<script src="appMobiUI.js"></script>
16   -<script src="appMobiScroll.js"></script>
  10 +<!--
  11 +
  12 +<script src="aUX_webCss3animate.js"></script>
  13 +<script src="aUX_webSelectBox.js"></script>
  14 +<script src="aUX_webPasswordBox.js"></script>
  15 +<script src="aUX_ui.js"></script>
  16 +<script src="aUX_webScroll.js"></script>
  17 +-->
  18 +<script src="aUX_ui.min.js"></script>
17 19 <script type="text/javascript">
18 20 /* This function runs once the page is loaded, but appMobi is not yet active */
19 21 var init = function() {
@@ -21,7 +23,6 @@
21 23 };
22 24 window.addEventListener("load", init, false);
23 25
24   -
25 26 /* This code prevents users from dragging the page */
26 27 var preventDefaultScroll = function(event) {
27 28 event.preventDefault();
@@ -38,7 +39,7 @@
38 39 AppMobi.device.hideSplashScreen();
39 40
40 41 AppMobi.display.useViewport(320, 480);
41   - AMUi=new AppMobi.toolkit.ui();
  42 + AMUi=new aUX.ui();
42 43 AMUi.addContentDiv("mytest");
43 44 };
44 45 document.addEventListener("appMobi.device.ready", onDeviceReady, false);
@@ -54,7 +55,7 @@
54 55 console.log(e);
55 56 }
56 57 </script>
57   -<link rel="stylesheet" type="text/css" href="appMobiUI.css" />
  58 +<link rel="stylesheet" type="text/css" href="aUX_ui.css" />
58 59 <style>
59 60 h3{text-align:center; font-size:35px;}
60 61 ul.iconLinks li{font-size:12px; font-weight:normal;}

0 comments on commit a131fa6

Please sign in to comment.
Something went wrong with that request. Please try again.