Skip to content

Commit

Permalink
Rebranding
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Maffett committed Jun 30, 2011
1 parent 86c1918 commit a131fa6
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 230 deletions.
6 changes: 3 additions & 3 deletions READMe.rdoc → README.rdoc
Expand Up @@ -33,7 +33,7 @@ The default scroller will scroll all content, so trying to add a button bar will

* To add divs to the content, simply set the class to "panel". This is a special css class that we search for at startup.

* aUX_web.scroller is added automatically, along with aUX_web.appMobiSelect, aUX_web.appMobiPassword, and aUX_web.css3animate.
* aUX_web.scroller is added automatically, along with aUX.web.appMobiSelect, aUX.web.appMobiPassword, and aUX.web.css3animate.

* 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"
<a href="#login">Login</a>
Expand All @@ -55,13 +55,13 @@ The default scroller will scroll all content, so trying to add a button bar will
<script>AMUi.updateContentDiv("login","New Login HTML");

where AMUi is a new AppMobi toolkit ui
var AMUi = new aUX.js();
var AMUi = new aUX.ui();

* To dynamically add a new div, you can call the function addContentDiv(_id_,_content_);
<script>AMUi.addContentDiv("newdiv","This is some new html");

where AMUi is a new aUX object
var AMUi = new aUX.js();
var AMUi = new aUX.ui();

* To initiate a page transition, you can call the function loadContent(_id_,clearHistory,backbutton,transition)
<scritp>AMUi.loadContent("my_id",false,false,"pop");
Expand Down
File renamed without changes.
31 changes: 15 additions & 16 deletions appMobiUI.js → aUX_ui.js
@@ -1,20 +1,16 @@
/**
* AppMobi.toolkit.ui - A User Interface library for creating
* aUX.webui - A User Interface library for creating
*
* @copyright 2011 - AppMobi
* @author IDM
*/

if (!window.AppMobi)
AppMobi = {};
if (!AppMobi.toolkit)
AppMobi.toolkit = {};
AppMobi.domFired=false;
document.addEventListener("DOMContentLoaded",function(){AppMobi.domFired=true;},false);
AppMobi.toolkit.ui = (function() {
if (!window.aUX)
aUX = {};
aUX.domFired=false;
document.addEventListener("DOMContentLoaded",function(){aUX.domFired=true;},false);
aUX.ui = (function() {

var translateOpen = 'm11' in new WebKitCSSMatrix() ? "3d(" : "(";
var translateClose = 'm11' in new WebKitCSSMatrix() ? ",0)" : ")";
var toolbar = "";
var content = "";
var navbar = "";
Expand All @@ -25,17 +21,20 @@ AppMobi.toolkit.ui = (function() {
var activeDiv = "";
var homeDiv = "";
var screenWidth = "";
var css3animate = AppMobi.toolkit.css3Animate;
var passwordBox = new AppMobi.toolkit.appMobiPassword();
var selectBox = new AppMobi.toolkit.appMobiSelect();
var css3animate = aUX.web.css3Animate;
var passwordBox = new aUX.web.appMobiPassword();
var selectBox = new aUX.web.appMobiSelect();
var ajaxUrl = "";
var transitionType = "slide";
var scrollingDivs = [];
var firstDiv = "";
var ui = function() {
// Init the page
if(!AppMobi.domFired) //bad hack - could put in bad loop, but tries to not fire ubntil DOMContentLoaded triggers
return new ui();
if(!aUX.domFired)
{
document.addEventListener("DOMContentLoaded",function(){return new ui();},false);
return;
}
var that = this;
toolbar = $am("toolbar");
content = $am("content");
Expand Down Expand Up @@ -148,7 +147,7 @@ AppMobi.toolkit.ui = (function() {
selectBox.getOldSelects(tmp.id);
passwordBox.getOldPasswords(tmp.id);
if(addScroller){
scrollingDivs[tmp.id]=(AppMobi.toolkit.scroller(myDiv, {
scrollingDivs[tmp.id]=(aUX.web.scroller(myDiv, {
scrollBars : true,
verticalScroll : true,
horizontalScroll : false,
Expand Down
39 changes: 17 additions & 22 deletions appMobiCss3animate.js → aUX_webCss3animate.js
@@ -1,13 +1,12 @@
/**
* AppMobi.toolkit.css3Animator
* aUX.web.css3Animator
* @copyright 2011 - AppMobi
* @author IDM
*/
if(!window.AppMobi)
AppMobi={};
if(!AppMobi.toolkit)
AppMobi.toolkit={};
AppMobi.toolkit.css3Animate = (function() {
if(!window.aUX)
aUX={};
if(!aUX.web)
aUX.web={};
aUX.web.css3Animate = (function() {

var translateOpen = 'm11' in new WebKitCSSMatrix() ? "3d(" : "(";
var translateClose = 'm11' in new WebKitCSSMatrix() ? ",0)" : ")";
Expand All @@ -22,16 +21,13 @@ AppMobi.toolkit.css3Animate = (function() {
if (!this instanceof css3Animate) {
return new css3Animate(elID, options);
}

if(!this.el)
return;
if(!options)
{
alert("Please provide configuration options for animation of "+elID);
return;
}
this.animID=0|Math.random() * 99999999;
var that=this;
this.el.addEventListener("webkitTransitionEnd", finishAnimation, false);
if (options["opacity"]) {
this.el.style.opacity = options["opacity"];
Expand Down Expand Up @@ -67,10 +63,10 @@ AppMobi.toolkit.css3Animate = (function() {

//check for percent or numbers

this.el.moving = true;
if(typeof(options.x)=="number"||(options.x.indexOf("%")==-1&&options.x.toLowerCase().indexOf("px")==-1))

if(typeof(options.x)=="number"||(options.x.indexOf("%")==-1&&options.x.toLowerCase().indexOf("px")==-1&&options.x.toLowerCase().indexOf("deg")==-1))
options.x=parseInt(options.x)+"px";
if(typeof(options.y)=="number"||(options.y.indexOf("%")==-1&&options.y.toLowerCase().indexOf("px")==-1))
if(typeof(options.y)=="number"||(options.y.indexOf("%")==-1&&options.y.toLowerCase().indexOf("px")==-1&&options.y.toLowerCase().indexOf("deg")==-1))
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+")";
Expand All @@ -86,26 +82,25 @@ AppMobi.toolkit.css3Animate = (function() {
this.el.style.height = options["height"];
}
if (options["callback"]) {

if (!webkitTransitionCallbacks[this.el.id])
webkitTransitionCallbacks[this.el.id] = [];
webkitTransitionCallbacks[this.el.id].push(options["callback"]);

this.el.moving = true;
}
};

function finishAnimation(event) {
event.preventDefault();
var that = event.target;

if (!event.target.moving)
return;
that.removeEventListener("webkitTransitionEnd",finishAnimation,true);
return;
event.target.moving = false;
if (webkitTransitionCallbacks[that.id]
&& webkitTransitionCallbacks[that.id].length > 0) {
var tmp=webkitTransitionCallbacks[that.id].shift();
tmp();
}
if (webkitTransitionCallbacks[event.target.id]
&& webkitTransitionCallbacks[event.target.id].length > 0) {
var cb = webkitTransitionCallbacks[event.target.id].shift();
cb();
}
}
return css3Animate;
})();
17 changes: 8 additions & 9 deletions appMobiPasswordBox.js → aUX_webPasswordBox.js
@@ -1,18 +1,17 @@
/*
* AppMobi.toolkit.appMobiPasswordbox
* aUX.web.appMobiPasswordbox
* @copyright 2011 - AppMobi
* @author IDM
*/
if(!window.AppMobi)
AppMobi={};
if (!AppMobi.toolkit)
AppMobi.toolkit = {};
AppMobi.toolkit.appMobiPassword = function() {
if(!window.aUX)
aUX={};
if (!aUX.web)
aUX.web = {};
aUX.web.appMobiPassword = function() {
this.oldPasswords = {};
};

AppMobi.toolkit.appMobiPassword.prototype = {
oldPasswords : {},
aUX.web.appMobiPassword.prototype = {
oldPasswords : [],
showPasswordPlainText:false,
getOldPasswords : function(elID) {
var container = elID && document.getElementById(elID) ? document
Expand Down
17 changes: 7 additions & 10 deletions appMobiScroll.js → aUX_webScroll.js
@@ -1,18 +1,15 @@
/**
* AppMobi.toolkit.scroller - a scrolling library for AppMobi Apps Copyright
* 2011 - AppMobi Author: IDM
*
* @TODO - add 'load more' to the bottom
* @TODO - fix positioning of scrollbars based off content related to top/bottom
* aUX.web.scroller - a scrolling library for AppMobi Apps
* Copyright 2011 - AppMobi
*/

if(!window.AppMobi)
AppMobi={};
if(!window.aUX)
aUX={};

if (!AppMobi.toolkit)
AppMobi.toolkit = {};
if (!aUX.web)
aUX.web = {};

AppMobi.toolkit.scroller = (function() {
aUX.web.scroller = (function() {
var translateOpen = 'm11' in new WebKitCSSMatrix() ? "3d(" : "(";
var translateClose = 'm11' in new WebKitCSSMatrix() ? ",0)" : ")";
var touchStarted=false;
Expand Down
1 change: 1 addition & 0 deletions aUX_webSelectBox.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a131fa6

Please sign in to comment.