Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

improved class generation, made loading async, fixed a ton of bugs

  • Loading branch information...
commit 4730a295d1fadac3ea2e1220ffa0a495da9750da 1 parent 4b47f1c
Henrik Hofmeister authored
Showing with 16,665 additions and 534 deletions.
  1. +7 −10 canvas.html
  2. +7 −12 game.html
  3. +6 −10 index.html
  4. +783 −208 js/core.js
  5. +107 −1 js/data.js
  6. +444 −0 js/doc/files.html
  7. +314 −0 js/doc/index.html
  8. +882 −0 js/doc/symbols/$wb.Array.html
  9. +572 −0 js/doc/symbols/$wb.Set.html
  10. +725 −0 js/doc/symbols/$wb.Url.html
  11. +505 −0 js/doc/symbols/$wb.core.Events.html
  12. +595 −0 js/doc/symbols/$wb.core.Registry.html
  13. +409 −0 js/doc/symbols/$wb.core.Utils.html
  14. +325 −0 js/doc/symbols/$wb.core.html
  15. +850 −0 js/doc/symbols/$wb.html
  16. +342 −0 js/doc/symbols/$wb.ui.BasePane.html
  17. +1,652 −0 js/doc/symbols/$wb.ui.Widget.html
  18. +330 −0 js/doc/symbols/$wb.ui.html
  19. +325 −0 js/doc/symbols/$wb.ui.layout.html
  20. +848 −0 js/doc/symbols/$wb.utils.html
  21. +517 −0 js/doc/symbols/_global_.html
  22. +966 −0 js/doc/symbols/src/js_core.js.html
  23. +571 −0 js/doc/symbols/src/js_data.js.html
  24. +445 −0 js/doc/symbols/src/js_form.js.html
  25. +192 −0 js/doc/symbols/src/js_game.js.html
  26. +13 −0 js/doc/symbols/src/js_jcanvas.min.js.html
  27. +175 −0 js/doc/symbols/src/js_kitchensink.canvas.js.html
  28. +16 −0 js/doc/symbols/src/js_kitchensink.game.js.html
  29. +330 −0 js/doc/symbols/src/js_kitchensink.js.html
  30. +33 −0 js/doc/symbols/src/js_localization.js.html
  31. +154 −0 js/doc/symbols/src/js_template.js.html
  32. +449 −0 js/doc/symbols/src/js_utils.js.html
  33. +1,678 −0 js/doc/symbols/src/js_widget.js.html
  34. +14 −0 js/form.js
  35. +15 −5 js/kitchensink.js
  36. +25 −0 js/localization.js
  37. +16 −7 js/template.js
  38. +144 −10 js/utils.js
  39. +812 −269 js/widget.js
  40. +63 −2 style/default.css
  41. +9 −0 style/webbeans.css
17 canvas.html
View
@@ -2,18 +2,15 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>WebBeans KitchenSink</title>
- <link href="style/webbeans.css" type="text/css" rel="stylesheet" />
+ <title>WebBeans KitchenSink ::</title>
+ <script type="text/javascript" >
+ $wbConfig = {base:''};
+ </script>
</head>
<body>
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" ></script>
- <script type="text/javascript" src="js/jcanvas.min.js" ></script>
<script type="text/javascript" src="js/core.js" ></script>
- <script type="text/javascript" src="js/utils.js" ></script>
- <script type="text/javascript" src="js/template.js" ></script>
- <script type="text/javascript" src="js/widget.js" ></script>
- <script type="text/javascript" src="js/form.js" ></script>
- <script type="text/javascript" src="js/kitchensink.canvas.js" ></script>
-
+ <script type="text/javascript" >
+ require(["js/jcanvas.min.js","*","js/kitchensink.canvas.js"]);
+ </script>
</body>
</html>
19 game.html
View
@@ -2,20 +2,15 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>WebBeans KitchenSink</title>
- <link href="style/webbeans.css" type="text/css" rel="stylesheet" />
- <link href="style/game.css" type="text/css" rel="stylesheet" />
+ <title>WebBeans KitchenSink ::</title>
+ <script type="text/javascript" >
+ $wbConfig = {base:'',skin:"game"};
+ </script>
</head>
<body>
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" ></script>
- <script type="text/javascript" src="js/jcanvas.min.js" ></script>
<script type="text/javascript" src="js/core.js" ></script>
- <script type="text/javascript" src="js/utils.js" ></script>
- <script type="text/javascript" src="js/template.js" ></script>
- <script type="text/javascript" src="js/widget.js" ></script>
- <script type="text/javascript" src="js/form.js" ></script>
- <script type="text/javascript" src="js/game.js" ></script>
- <script type="text/javascript" src="js/kitchensink.game.js" ></script>
-
+ <script type="text/javascript" >
+ require(["js/jcanvas.min.js","*","game","js/kitchensink.game.js"]);
+ </script>
</body>
</html>
16 index.html
View
@@ -3,18 +3,14 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>WebBeans KitchenSink ::</title>
- <link href="style/webbeans.css" type="text/css" rel="stylesheet" />
- <link href="style/default.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" >
+ $wbConfig = {base:''};
+ </script>
</head>
<body>
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" ></script>
<script type="text/javascript" src="js/core.js" ></script>
- <script type="text/javascript" src="js/utils.js" ></script>
- <script type="text/javascript" src="js/data.js" ></script>
- <script type="text/javascript" src="js/template.js" ></script>
- <script type="text/javascript" src="js/widget.js" ></script>
- <script type="text/javascript" src="js/form.js" ></script>
- <script type="text/javascript" src="js/kitchensink.js" ></script>
-
+ <script type="text/javascript" >
+ require(["*","js/kitchensink.js"]);
+ </script>
</body>
</html>
991 js/core.js
View
@@ -1,5 +1,186 @@
-var $wb = null;
-(function() {
+/**
+ * @fileOverview
+ * <p>
+ * This is the webbeans bootstrap file. You should only include this file directly on the page and use "require" to load
+ * additional modules and js files.
+ * <hr/>
+ * </p>
+ * <p><b>$wbConfig</b> is read when including this file. </p>
+ *
+ * <p>
+ * it has the following options:<br/>
+ *
+ * <br/><b>jQuery:</b> Path to a jquery js file - defaults to google CDN. Required.
+ * <br/><b>skin:</b> Name of the skin (or path to costum CSS file). Defaults to "default" - set to null to skip skin handling
+ * <br/><b>base:</b> Url that points to the base of webbeans. Required.
+ * <br/><b>noCSS:</b> Boolean - set to true to skip loading of all webbeans css files. Defaults to false. Optional.
+ * </p>
+ * @author <a href="http://twitter.com/vonhofdk"/>Henrik Hofmeister</a>
+ * @version 1.0
+ */
+
+
+if (typeof $wbConfig == 'undefined')
+ throw "$wbConfig not initialized. You must initialize $wbConfig within the <head> tag and provide at least the 'base' property. The core.js file should be included in the bottom of the <body> tag";
+
+//Set default jquery path
+if (!$wbConfig.jQuery) $wbConfig.jQuery = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
+
+//Set default skin
+if (typeof $wbConfig.skin == 'undefined') $wbConfig.skin = 'default';
+
+if (typeof $wbConfig.base == 'undefined')
+ throw "Remember to provide $wbConfig.base with a valid url pointing to a webbeans CDN";
+
+
+/**
+ @description used to make a temporary scope that has the supplied package in global space. Notice that you cannot use using within using and it does contaminate the window object temporarily
+ @param {Object} pkg Pak the package to "use"
+ @param {Function} the callback which will be executed in the temp scope
+ @type Void
+*/
+var using = function(pkg,cb) {
+ if (window.__using)
+ throw "Attempted to use when using()";
+ window.__using = true;
+ var old = {};
+ for(var key in pkg) {
+ old[key] = window[key] ? window[key] : null;
+ window[key] = pkg[key];
+ }
+ cb();
+
+ for(var key in old) {
+ if (!old[key])
+ delete window[key];
+ else
+ window[key] = old[key];
+ }
+ window.__using = false;
+}
+
+/**
+ @description Loads one or more scripts/moduyle into the current document. Deletes the script tag after it is loaded.
+ @param {String|String[]} path One or more paths to the scripts.
+ If a string equals /^[A-Z]+$/i it is assumed to be a webbeans module.
+ If a string equals "*" every std. module of webbeans is included
+ @param {Function} [cb] Optional callback to call when all scripts has been loaded
+ @param {Boolean} [async=false] Use async loading (load all at once)
+ @type Void
+*/
+var require = function(path,cb,async) {
+ if (!async) async = false;
+
+ var paths = null;
+
+ if (typeof path == "string")
+ paths = [path];
+ else
+ paths = path;
+
+ var requireAllIx = -1;
+ for(var i = 0; i < paths.length;i++) {
+ path = paths[i];
+ if (path == '*') {
+ paths.splice(i,1);
+ requireAllIx = i;
+ }
+ }
+ if (requireAllIx > -1) {
+ paths.splice(requireAllIx,0,
+ "utils","data","template","widget","form","localization");
+ }
+
+ var oks = new Array(paths.length);
+
+ var check = function() {
+ for(var i = 0; i < oks.length;i++) {
+ if (!oks[i])
+ return;
+ }
+ if (cb)
+ cb();
+ }
+
+ var build = function(i,path,buildCallback) {
+ if (!path) return;
+ if (/^[A-Z]+$/i.test(path)) {
+ //WebBeans module
+ if (typeof $wbConfig.base == 'undefined')
+ throw "Remember to provide $wbConfig.base with a valid url pointing to a webbeans CDN";
+ path = $wbConfig.base+"js/"+path+".js";
+ }
+
+ var script = document.createElement('script');
+ script.type = 'text/javascript';
+ script.src = path;
+ script.async = async;
+ script.onload = function() {
+ oks[i] = true;
+ $(script).detach();
+ check();
+ if (buildCallback)
+ buildCallback();
+ };
+ document.getElementsByTagName('body')[0].appendChild(script);
+ }
+
+ if (async) {
+ for(var i = 0; i < paths.length;i++) {
+ path = paths[i];
+ build(i,path);
+ }
+ } else {
+ var ix = 0;
+ var recurse = function() {
+ if (paths.length <= ix)
+ return;
+ var oldIx = ix;
+ var path = paths[ix];
+ ix++;
+ build(oldIx,path,recurse);
+ }
+ recurse();
+ }
+};
+/**
+ @description Loads a single CSS file into play.
+ @param {String|String[]} path Path to the CSS file
+ If a string equals /^[A-Z]+$/i it is assumed to be a built-in webbeans stylesheet.
+ @type Void
+*/
+var loadCSS = function(path) {
+ if (/^[A-Z]+$/i.test(path)) {
+ //WebBeans stylesheet
+ if (typeof $wbConfig.base == 'undefined')
+ throw "Remember to provide $wbConfig.base with a valid url pointing to a webbeans CDN";
+ path = $wbConfig.base+"style/"+path+".css";
+ }
+
+ var link = document.createElement('link');
+ link.type = 'text/css';
+ link.href = path;
+ link.rel = "stylesheet";
+
+ document.getElementsByTagName('head')[0].appendChild(link);
+}
+
+if (!$wbConfig.noCSS) {
+ //Load the base webbeans css
+ loadCSS("webbeans");
+
+ if ($wbConfig.skin) {
+ //Load the skin
+ loadCSS($wbConfig.skin);
+ }
+}
+
+require($wbConfig.jQuery,function() {
+ /**
+ * @description Short for $(elm).widget();
+ * @Param {String|DOMNode} elm The element - same as the arguemnt for the jQuery function ($)
+ * @namespace the main namespace in webbeans
+ */
$wb = function(elm) {
if (typeof elm == 'function') {
return elm();
@@ -7,127 +188,356 @@ var $wb = null;
return $(elm).widget();
}
};
+
+ /**
+ * @description Convert and splice arguments objects into arrays
+ */
+ var getArguments = function(args,num) {
+ out = [];
+ for(var i = num;i < args.length;i++) {
+ out.push(args[i]);
+ }
+ return out;
+ }
+
+ /**
+ * @constant message handlers handles $wb.message and $wb.error
+ */
$wb.MESSAGE_HANDLER = "MESSAGE_HANDLER";
+
+ /**
+ * @constant enable debugging (affects $wb.debug)
+ */
$wb.DEBUG_ENABLE = "DEBUG_ENABLE";
- $wb.Class = function(name,opts) {
- var clz = function() {
- if (!this.__callConstructor) {
- throw "You must instantiate this prototype using the new operator: "+clz.prototype._clz;
- }
- for(var key in clz.prototype) {
- var val = clz.prototype[key];
- if ($.type(val) == 'function')
- continue;
- if ($.type(val) == 'array')
- val = $.extend(true,[],val);
- if ($.type(val) == 'object')
- val = $.extend(true,{},val);
- this[key] = val;
- }
- this.__callConstructor.apply(this,arguments);
- };
+
+ /**
+ * @description Function for creating simulated classes with support for multiple inheritance and calling overriden methods.
+ * Can be used stand alone - only dependency is $wb.Set
+ *
+ * @param {String} name The name of the class. This will be the name of the constructor as well.
+ * @param {Object} opts The fields and methods for the class
+ * @param {Class[]} [opts.__extends] Extend these classes. Notice that order matters and last wins in conflicts.
+ * @param {Function} [opts.__construct] The constructor of the class
+ * @Type $wb.Class
+ * @example
+ * var MySuperClass = $wb.Class("MySuperClass",{
+ * text:null,
+ * __construct:function(text) {
+ * this.text = text;
+ * }
+ * emit:function() {
+ * console.log(this.text);
+ * }
+ * });
+ * var MySubClass = $wb.Class("MySubClass",{
+ * __extends:[MySuperClass],
+ * __construct:function(text) {
+ * this.__super(text+ "world");
+ * }
+ * });
+ *
+ * var instance = new MySubClass("hello");
+ * instance.emit(); // Emits hello world in the console.
+ */
+ $wb.Class = function (name,opts) {
+ /**
+ * @description Base class
+ * This may need to change because of the use of Function. This is the only way to give the constructor a proper
+ * name (afaik) - if not all of them would be "clz".
+ * @class $wb.Class
+ * @constructor
+ * @function
+ */
+ var clz = new Function("return function "+name+"() { "+
+ //First - grab all fields from the prototype and add as actual fields on "this"
+ " var clz = this.constructor; "+
+ " for(var key in clz.prototype) {"+
+ " var val = clz.prototype[key];"+
+ " if ($.type(val) == 'function')"+
+ " continue;"+
+ " if ($.type(val) == 'array')"+
+ " val = $.extend(true,[],val);"+
+ " if ($.type(val) == 'object')"+
+ " val = $.extend(true,{},val);"+
+ " this[key] = val;"+
+ " }"+
+ //Call the constructor - this method is actually not the defined constructor but a placeholder.
+ //See further down
+ " this.__construct.apply(this,arguments);"+
+ "};")();
+
+ //Make sure we have a constructor
if (!opts.__construct)
opts.__construct = function() {};
+ //Compile a list of unique parent classes
var parents = new $wb.Set();
+
if (opts.__extends) {
for(var i in opts.__extends) {
var parent = opts.__extends[i];
+ //Extend the prototype with all inherited prototypes
$.extend(true,clz.prototype,parent.prototype);
- parents.add(parent.prototype.constructor);
+
+ //Add to set
+ parents.add(parent.prototype);
}
}
-
-
+
+ //Clean up
delete opts.__extends;
delete clz.prototype.__extends;
+
+ //Sets the super context and calls method.
+ var call = function(clzContext,methodName,func,args) {
+ var oldSuper = this.__super;
+ this.__super = function () {
+ return clzContext.__super.apply(this,[methodName,arguments]);
+ };
+ var out = func.apply(this,args);
+ if (!oldSuper)
+ delete this.__super;
+ else
+ this.__super = oldSuper;
+ return out;
+ }
- $.extend(true,clz.prototype,opts);
- clz.prototype._clz = name;
+ //Final methods - cannot be overridden.
+ var fixed = {
+ /**
+ *@private
+ * @description Class name
+ * @memberOf $wb.Class.prototype
+ */
+ _clz: name,
+
+ /**
+ * @description Wrapper used to call all member methods (Is what allows the __super() calls)
+ * @private
+ * @memberOf $wb.Class.prototype
+ */
+ __callMethod: function(name,args) {
+
+ var m = clz.methods[name];
+ if (!m) {
+ //Check if a superclass has it
+ var parentMethod = clz.__getParentMethod(name);
+ if (parentMethod) {
+ m = parentMethod.method;
+ }
+ }
+
+ if (!m)
+ throw "Method not found: "+clz.prototype._clz+"::"+name;
+
+ return call.apply(this,[clz,name,m,args]);
+ }
+
+ }
+ //
+ //Methods contain the methods that are defined in *this* class
+ //Note that they are placed on the constructor
+ clz.methods = {};
+ for(var j in opts) {
+ (function() {
+ var key = j;
+ var val = opts[key];
+ if ((typeof val == 'function')) {
+ //Add the method to the class method map
+ clz.methods[key] = val;
+ //And add a place holder to the prototype that uses _callMethod.
+ //Call method enabled you to call __super() and execute overridden methods
+ opts[key] = function() {
+ return this.__callMethod(key,arguments);
+ }
+ }
+ })();
+ }
+ //Extend the prototype with opts and fixed
+ $.extend(true,clz.prototype,opts,fixed);
+
+ //Extends contains a unique array of all directly inherited classes (Note: NOT entire hierarchy)
clz.__extends = parents.toArray();
-
- clz.prototype.__callConstructor = function() {
-
- this.__super = clz.__super;
- clz.prototype.__construct.apply(this,arguments);
- delete this.__super;
- };
-
- clz.__super = function() {
-
+
+ /**
+ * @description The super method is a class specific method that is used to call overridden methods.
+ * It is injected into the "this" scope whenever you call a method (through the placeholder __callMethod)
+ * @memberOf $wb.Class
+ */
+ clz.__super = function(name,args) {
+ var m = clz.__getParentMethod(name);
+ if (m) {
+ return call.apply(this,[m.type.constructor,name,m.method,args]);
+ }
+ throw "No parents had method "+name;
+ }
+ /**
+ * @description Used internally to get the closest parent method named "name"
+ * @memberOf $wb.Class
+ * @static
+ */
+ clz.__getParentMethod = function(name) {
+ var list = [];
for(var i in clz.__extends) {
var parent = clz.__extends[i];
- //console.log(clz.prototype._clz + " calls: "+parent.prototype._clz);
- parent.prototype.__callConstructor.apply(this,arguments);
+
+ list.push(parent._clz);
+ var m = parent.constructor.methods[name];
+ if (m) {
+ return {type:parent,method:m};
+ } else {
+ m = parent.constructor.__getParentMethod(name);
+ if (m)
+ return m;
+ }
}
- };
+ return null;
+ }
+
return clz;
};
-
- $wb.Set = function() {
+ /**
+ * @description A Set collection (unique list)
+ * @constructor
+ */
+ $wb.Set = function () {
this._arr = [];
};
+
$wb.Set.prototype = {
+ /**
+ * @description the size of the set
+ */
get length() {
return this.arr.length;
},
+ /**
+ * @description Class name
+ * @type String
+ * @private
+ */
_clz:"Set",
+ /**
+ * @description Add element to Set
+ * @param {Object} elm
+ */
add:function(elm) {
if (this._arr.indexOf(elm) == -1)
this._arr.push(elm);
},
+ /**
+ * @description Add several elements to Set
+ * @param {Object[]} elms
+ */
addAll:function(elms) {
for(var i in elms) {
this.add(elms[i]);
}
},
+ /**
+ * @description Get element
+ * @param {int} i The index to get
+ * @type Object
+ */
get:function(i) {
return this._arr[i];
},
+ /**
+ * @description Convert this set into a standard js array
+ * @type Object[]
+ */
toArray:function() {
return $.extend([],this._arr);
}
};
- $wb.Array = function(arr) {
+ //Maybe extend Array instead
+ /**
+ * @description An array wrapper
+ * @constructor
+ */
+ $wb.Array = function (arr) {
this._arr = arr ? arr : [];
};
$wb.Array.prototype = {
+ /**
+ * Class name
+ * @type String
+ * @private
+ */
_clz:"Array",
+ /**
+ * @description Push element onto end
+ * @param {Object} elm
+ */
push:function(elm) {
this._arr.push(elm);
},
+ /**
+ * @description Push several elements onto end
+ * @param {Object[]} elm
+ */
pushAll:function(elms) {
for(var i in elms) {
this.add(elms[i]);
}
},
+ /**
+ * @description Get element by index
+ * @param {int} i The index to get
+ * @type Object
+ */
get:function(i) {
return this._arr[i];
},
+ /**
+ * @description remove element at specified index
+ * @param {int} i the index to remove
+ */
remove:function(i) {
return this._arr.splice(i,1);
},
+ /**
+ * @description remove element from array
+ * @param {Object} value the value to remove
+ */
removeValue:function(value) {
var ix = this._arr.indexOf(value);
if (ix > -1)
this.remove(ix);
},
+ /**
+ * @description get the length of the array
+ * @type int
+ */
length:function() {
return this._arr.length;
},
+ /**
+ * @description Sort the array
+ * @param {Function} compareFunction the sort function
+ */
sort:function(compareFunction) {
this._arr.sort(compareFunction);
},
+ /**
+ * @description Empty the array
+ */
clear:function() {
for(var i = (this._arr.length-1); i > -1;i--) {
this.remove(i);
}
},
+ /**
+ * @description Find an element in the array by path and value
+ * @param {String} path the path to look for in each element
+ * @param {Object} value the value to look for in each path
+ * @type Object[] the entries matching the query
+ */
find:function(path,value) {
var out = [];
this.each(function(elm) {
@@ -137,199 +547,362 @@ var $wb = null;
});
return out;
},
+ /**
+ * @description iterate through the array using a callback function
+ * @param {Function} cb the callback function - is called with a single parameter - each entry.
+ */
each:function(cb) {
for(var i in this._arr) {
cb.apply(this,[this._arr[i]]);
}
},
+ /**
+ * @description Get the internal std. js array
+ * @type Object[]
+ */
toArray:function() {
return this._arr;
}
};
+ // Heavily inspired by:
// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License
- $wb.Url = $wb.Class('Url',{
- opts:{
+ $wb.Url = $wb.Class('Url',
+ /**
+ * @lends $wb.Url.prototype
+ * @augments $wb.Class
+ */
+ {
+ opts:{
strictMode: false,
key: ["source","protocol","authority","userInfo","username","password","host","port","relative","path","directory","file","query","anchor"],
q: {
- name: "params",
- parser: /(?:^|&)([^&=]*)=?([^&]*)/g
+ name: "params",
+ parser: /(?:^|&)([^&=]*)=?([^&]*)/g
},
parser: {
- strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
- loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
+ strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
+ loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
}
- },
- anchor:"",
- authority:"",
- directory:"",
- file:"",
- host:"",
- password:"",
- path:"/",
- port:80,
- protocol:"http",
- query:"",
- params:{},
- relative:"",
- url:"",
- username:"",
- userInfo:"",
- __construct:function(arg) {
- if (typeof arg == 'string') {
- this.fromString(arg);
- } else {
- this.fromObject(arg);
- }
- },
- get:function(key) {
- if (!this.params)
- return null;
- return this.params[key];
- },
- getHost:function() {
- return this.host;
- },
- getPort:function() {
- return this.port;
- },
- getPath:function() {
- return this.path;
- },
- getAnchor:function() {
- return this.anchor;
- },
- fromObject:function(obj) {
- for(var i = 0;i < this.opts.key.length;i++) {
- var key = this.opts.key[i];
- this[key] = obj[key];
- }
- if (obj.params) {
- for(var key in obj.params) {
- this.params[key] = obj.params[key];
+ },
+ anchor:"",
+ authority:"",
+ directory:"",
+ file:"",
+ host:"",
+ password:"",
+ path:"/",
+ port:80,
+ protocol:"http",
+ query:"",
+ params:{},
+ relative:"",
+ url:"",
+ username:"",
+ userInfo:"",
+ /**
+ * @constructs
+ * @param {String|Object} arg the url or an object containing url information
+ * @param {String|Object} [ref] Optional argument to indicate the reference. Is used to set default values
+ */
+ __construct:function(arg,ref) {
+ if (ref) {
+ if (typeof ref == 'string') {
+ this.fromString(ref);
+ } else {
+ this.fromObject(ref);
+ }
}
- }
-
- },
- fromString:function(str) {
+
+ if (typeof arg == 'string') {
+ this.fromString(arg);
+ } else {
+ this.fromObject(arg);
+ }
+ },
+ /**
+ * @description Gets HTTP GET parameter values
+ * @param {String} key the name of the parameter
+ * @type String
+ */
+ get:function(key) {
+ if (!this.params)
+ return null;
+ return this.params[key];
+ },
+ /**
+ * @description Gets host name
+ * @type String
+ */
+ getHost:function() {
+ return this.host;
+ },
+ /**
+ * @description Gets port
+ * @type int
+ */
+ getPort:function() {
+ return this.port;
+ },
+ /**
+ * @description Gets path
+ * @type String
+ */
+ getPath:function() {
+ return this.path;
+ },
+ /**
+ * @description Gets anchor (#whatever)
+ * @type String
+ */
+ getAnchor:function() {
+ return this.anchor;
+ },
+ /**
+ * @description Read url from object
+ * @param {Object} obj
+ */
+ fromObject:function(obj) {
+ for(var i = 0;i < this.opts.key.length;i++) {
+ var key = this.opts.key[i];
+ this[key] = obj[key];
+ }
+ if (obj.params) {
+ for(var key in obj.params) {
+ this.params[key] = obj.params[key];
+ }
+ }
+
+ },
+ /**
+ * @description Read url from string
+ * @param {String} str
+ */
+ fromString:function(str) {
var o = this.opts,
- m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
- uri = this,
- i = 14;
+ m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
+ uri = this,
+ i = 14;
- while (i--) uri[o.key[i]] = m[i] || "";
+ while (i--) {
+ if (m[i])
+ uri[o.key[i]] = m[i];
+ }
uri[o.q.name] = {};
uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
- if ($1) uri[o.q.name][$1] = $2;
+ if ($1) uri[o.q.name][$1] = $2;
});
if (uri.port)
uri.port = parseInt(uri.port);
- },
- toString:function() {
- var out = "";
- if (this.host) {
- out += this.protocol+"://";
- if (this.username) {
- out += this.username;
- if (this.password) {
- out += ":"+this.password;
+ },
+ /**
+ * @description Convert this url to a string
+ * @type String
+ */
+ toString:function() {
+ var out = "";
+ if (this.host) {
+ out += this.protocol+"://";
+ if (this.username) {
+ out += this.username;
+ if (this.password) {
+ out += ":"+this.password;
+ }
+ out += "@";
+ }
+ out += this.host;
+
+ var defPort = $wb.Url.protocols[this.protocol];
+ if (defPort && this.port && this.port != defPort) {
+ out += ":"+this.port;
}
- out += "@";
- }
- out += this.host;
-
- var defPort = $wb.Url.protocols[this.protocol];
- if (defPort && this.port && this.port != defPort) {
- out += ":"+this.port;
}
- }
-
- if (!this.path)
- this.path = "/";
- out += this.path;
- var first = true;
- for(var key in this.params) {
- if (first) {
- first = false;
- out += "?";
- } else {
- out += "&";
+
+ if (!this.path)
+ this.path = "/";
+ out += this.path;
+ var first = true;
+ for(var key in this.params) {
+ if (first) {
+ first = false;
+ out += "?";
+ } else {
+ out += "&";
+ }
+ out += key+"="+encodeURIComponent(this.params[key]);
}
- out += key+"="+encodeURIComponent(this.params[key]);
+ if (this.anchor)
+ out += "#"+this.anchor;
+ return out;
}
- if (this.anchor)
- out += "#"+this.anchor;
- return out;
}
- });
+ );
+ /**
+ * @description Protocol to port map
+ * @static
+ * @type Object
+ */
$wb.Url.protocols = {
'http':80,
'https':443,
'ftp':21,
}
+ /**
+ * @description A read-only "location" field on the $wb namespace that reads the current location and gets a $wb.Url
+ * @field
+ * @name location
+ * @memberOf $wb
+ * @Type $wb.Url
+ */
$wb.__defineGetter__("location",function() {
if (!this._location) {
this._location = new $wb.Url(top.location.href);
}
return this._location;
});
-
+ /**
+ * @namespace Core classes
+ */
$wb.core = {};
-
- $wb.core.Registry = $wb.Class('Registry',{
- _data:{},
- get:function(key,defaultValue) {
- var out = this._data[key.toLowerCase()];
- if (!out)
- return defaultValue;
- return out;
- },
- has:function(key) {
- return typeof this._data[key.toLowerCase()] != 'undefined';
- },
- register:function(key,value) {
- this._data[key.toLowerCase()] = value;
- },
- unregister:function(key) {
- delete this._data[key.toLowerCase()];
+ /**
+ * @description Registry class used for name/value stores
+ * @class
+ */
+ $wb.core.Registry = $wb.Class('Registry',
+ /**
+ * @lends $wb.core.Registry.prototype
+ * @augments $wb.Class
+ */
+ {
+ /**
+ * @description Internal var used for the data
+ * @private
+ * @type Object
+ */
+ _data:{},
+ /**
+ * @description get value - or default value if not available
+ * @param {String} key the registry key
+ * @param {Object} [defaultValue=null] default value
+ * @type Object
+ */
+ get:function(key,defaultValue) {
+ var out = this._data[key.toLowerCase()];
+ if (!out)
+ return defaultValue;
+ return out;
+ },
+ /**
+ * @description Registry key existance check
+ * @param {String} key the registry key
+ * @type Boolean
+ */
+ has:function(key) {
+ return typeof this._data[key.toLowerCase()] != 'undefined';
+ },
+ /**
+ * @description Register key with value
+ * @param {String} key the registry key
+ * @param {Object} value the value
+ */
+ register:function(key,value) {
+ this._data[key.toLowerCase()] = value;
+ },
+ /**
+ * @description Remove key
+ * @param {String} key the registry key
+ */
+ unregister:function(key) {
+ delete this._data[key.toLowerCase()];
+ }
}
- });
- $wb.core.Events = $wb.Class('Events',{
- _bindings:{},
- trigger:function(evt,args) {
- if (this._bindings[evt]) {
- for(var i in this._bindings[evt]) {
- var handler = this._bindings[evt][i];
- handler.apply(this,args);
+ );
+
+ /**
+ * @description Provides basic event handling
+ * @class
+ */
+ $wb.core.Events = $wb.Class('Events',
+ /**
+ * @lends $wb.core.Events.prototype
+ * @augments $wb.Class
+ */
+ {
+ /**
+ * @private
+ */
+ _bindings:{},
+ /**
+ * @description Trigger event with optional arguments
+ * @param {String} evt the event name
+ * @param {Object[]} [args] Optional arguments to send as parms to event handlers
+ */
+ trigger:function(evt,args) {
+ if (this._bindings[evt]) {
+ for(var i in this._bindings[evt]) {
+ var handler = this._bindings[evt][i];
+ handler.apply(this,args);
+ }
}
+ },
+ /**
+ * @description Bind handler to event
+ * @param {String} evt the event name
+ * @param {Function} handler Event handler
+ */
+ bind:function(evt,handler) {
+ if (!this._bindings[evt])
+ this._bindings[evt] = [];
+ this._bindings[evt].push(handler);
}
- },
- bind:function(evt,handler) {
- if (!this._bindings[evt])
- this._bindings[evt] = [];
- this._bindings[evt].push(handler);
}
- });
- $wb.core.Utils = $wb.Class('Utils',{
-
- require:function(obj) {
- for(var i = 1; i < arguments.length;i++) {
- var arg = arguments[i];
- if (typeof obj[arg] == 'undefined')
- throw "Missing argument: "+this._clz+": "+arg;
+ );
+
+ /**
+ * @description Provides basic class utilities
+ * @class
+ */
+ $wb.core.Utils = $wb.Class('Utils',
+ /**
+ * @lends $wb.core.Utils.prototype
+ * @augments $wb.Class
+ */
+ {
+ /**
+ * @description require certain keys to be present within map
+ * @param {Object} obj the map
+ * @param {String ...} arguments additional arguments will all be checked against the map
+ * @throws String
+ */
+ require:function(obj) {
+ for(var i = 1; i < arguments.length;i++) {
+ var arg = arguments[i];
+ if (typeof obj[arg] == 'undefined')
+ throw "Missing argument: "+this._clz+": "+arg;
+ }
}
}
- });
+ );
- //Init global registry
+ /**
+ * @description global registry
+ * @static
+ * @type $wb.core.Registry
+ */
$wb.registry = new $wb.core.Registry();
- //Messaging
+ /** Messaging **/
+
+ /**
+ * @function
+ * @description Send debug message to console - if debug is enabled
+ * @param {String} msg the message
+ * @param {Object} [source] the source of the message
+ */
$wb.debug = function(msg,source) {
if ($wb.registry.get($wb.DEBUG_ENABLE,false)) {
console.log(msg);
@@ -337,48 +910,50 @@ var $wb = null;
};
+ /**
+ * @description Send error message
+ * @param {String} msg the message
+ * @param {Object} [source] the source of the error
+ */
$wb.error = function(msg,source) {
if ($wb.registry.has($wb.MESSAGE_HANDLER)) {
$wb.registry.get($wb.MESSAGE_HANDLER).error(msg);
}
$wb.debug(msg,source);
};
+
+ /**
+ * @description Send message
+ * @param {String} msg the message
+ * @param {Object} [source] the source of the message
+ */
$wb.message = function(msg,source) {
if ($wb.registry.has($wb.MESSAGE_HANDLER)) {
$wb.registry.get($wb.MESSAGE_HANDLER).message(msg,source);
}
$wb.debug(msg,source);
};
-})()
-
-
-var using = function(pkg,cb) {
- if (window.__using)
- throw "Attempted to use when using()";
- window.__using = true;
- var old = {};
- for(var key in pkg) {
- old[key] = window[key] ? window[key] : null;
- window[key] = pkg[key];
+
+ /**
+ * @description Show confirm box
+ * @param {String} msg the message
+ * @param {Function} [cb] Called with a single boolean paramenter (result of confirm box)
+ */
+ $wb.confirm = function(msg,cb) {
+ var ok = confirm(msg);
+ if (cb)
+ cb(ok);
}
- cb();
- for(var key in old) {
- if (!old[key])
- delete window[key];
- else
- window[key] = old[key];
+ /**
+ * @description Show alert box
+ * @param {String} msg the message
+ * @param {Function} [cb] Called when alert box is closed
+ */
+ $wb.alert = function(msg,cb) {
+ alert(msg);
+ if (cb)
+ cb();
}
- window.__using = false;
-}
-var require = function(path,cb) {
- var script = document.createElement('script');
- script.type = 'text/javascript';
- script.src = path;
- script.async = true;
- script.onload = function() {
- cb();
- $(script).detach();
- };
- document.getElementsByTagName('body')[0].appendChild(script);
-}
+ window.$wb = $wb;
+});
108 js/data.js
View
@@ -1,3 +1,11 @@
+/**
+ * @fileOverview
+ * All methods and classes related to data handling is in here
+ * @author <a href="http://twitter.com/vonhofdk"/>Henrik Hofmeister</a>
+ * @version 1.0
+ */
+
+
$wb.data = {};
$wb.data.Model = $wb.Class('Model',{
@@ -24,12 +32,15 @@ $wb.data.Model = $wb.Class('Model',{
return this._type;
},
addFields:function(fields) {
+ var ids = [];
for(var id in fields) {
+ ids.push(id);
this._fields[id] = $.extend({},this._defaults,fields[id]);
this._fields[id].id = id;
if (!this._fields[id].shortName)
this._fields[id].shortName = this._fields[id].name;
}
+ this.trigger('added',[ids]);
},
addField:function(id,name,valueType,validator,defaultValue,shortName) {
this._fields[id] = {
@@ -40,7 +51,7 @@ $wb.data.Model = $wb.Class('Model',{
defaultValue: defaultValue ? defaultValue : null,
validator:validator ? validator : null
};
- this.trigger('added',[id]);
+ this.trigger('added',[[id]]);
},
getField:function(id) {
@@ -157,6 +168,101 @@ $wb.data.Service = $wb.Class('Service',{
}
});
+$wb.data.JsonService = $wb.Class('JsonService',{
+ __extends:[$wb.core.Events,$wb.core.Utils],
+ opts:{},
+ __construct:function(opts) {
+ if (!opts) opts = {};
+ this.__super(opts);
+ this.require(opts,'schema');
+ this.opts = opts;
+
+ },
+ load:function() {
+ var self = this;
+ $.getJSON(this.opts.schema,function(data) {
+ var baseUrl = new $wb.Url(data.url,self.opts.schema);
+ for(var controllerName in data.methods) {
+ var controller = data.methods[controllerName];
+ self[controllerName] = {};
+ for(var methodName in controller.methods) {
+ (function() {
+ var method = controller.methods[methodName][0];
+ self[controllerName][methodName] = function(args,callback) {
+ var url = baseUrl+method.url;
+ var data = null;
+
+ //@TODO: Validate body against model and generate Model's from schema
+ var bodyType = null;
+
+ if (typeof args == 'function') {
+ callback = args;
+ args = null;
+ }
+
+ if (method.args) {
+
+ if (method.args.length == 1 && method.args[0].transport == 'BODY') {
+ data = args;
+ bodyType = method.args[0].type;
+ } else {
+ for(var i = 0; i < method.args.length;i++) {
+ var arg = method.args[i];
+ var value = args != null ? args[arg.name] : undefined;
+ if (arg.required && (typeof value == "undefined")) {
+ throw "Required argument missing: "+arg.name;
+ }
+
+ if (typeof value == "undefined")
+ continue;
+
+ switch(arg.transport) {
+ case 'GET':
+ url += (url.indexOf('?') > -1) ? "&" : "?";
+ url += arg.name + "=" + encodeURIComponent(value);
+ break;
+ case 'BODY':
+ data = value;
+ bodyType = arg.type;
+ break;
+ }
+
+ if (arg.type == 'enum' && arg['enum'].indexOf(value) == -1) {
+ throw "Invalid value for enum argument: "+arg.name+" = "+value
+ +"\nMust be one of "+arg['enum'].join(', ');
+ }
+ }
+ }
+ }
+
+ if (data) {
+ data = JSON.stringify(data);
+ }
+
+ return $.ajax({
+ url:url,
+ type:method.method,
+ dataType:'json',
+ contentType:'application/json',
+ data:data,
+ success:function(out) {
+ if (callback)
+ callback(true,out);
+ },
+ error:function(out) {
+ if (callback)
+ callback(false);
+ }
+ });
+ };
+ })();
+ }
+ }
+ self.trigger('ready');
+ });
+ }
+});
+
$wb.data.Store = $wb.Class('Store',{
__extends:[$wb.core.Events,$wb.core.Utils],
_data:null,
444 js/doc/files.html
View
@@ -0,0 +1,444 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+
+ <title>JsDoc Reference - File Index</title>
+ <meta name="generator" content="JsDoc Toolkit" />
+
+ <style type="text/css">
+ /* default.css */
+body
+{
+ font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
+ width: 800px;
+}
+
+.header
+{
+ clear: both;
+ background-color: #ccc;
+ padding: 8px;
+}
+
+h1
+{
+ font-size: 150%;
+ font-weight: bold;
+ padding: 0;
+ margin: 1em 0 0 .3em;
+}
+
+hr
+{
+ border: none 0;
+ border-top: 1px solid #7F8FB1;
+ height: 1px;
+}
+
+pre.code
+{
+ display: block;
+ padding: 8px;
+ border: 1px dashed #ccc;
+}
+
+#index
+{
+ margin-top: 24px;
+ float: left;
+ width: 160px;
+ position: absolute;
+ left: 8px;
+ background-color: #F3F3F3;
+ padding: 8px;
+}
+
+#content
+{
+ margin-left: 190px;
+ width: 600px;
+}
+
+.classList
+{
+ list-style-type: none;
+ padding: 0;
+ margin: 0 0 0 8px;
+ font-family: arial, sans-serif;
+ font-size: 1em;
+ overflow: auto;
+}
+
+.classList li
+{
+ padding: 0;
+ margin: 0 0 8px 0;
+}
+
+.summaryTable { width: 100%; }
+
+h1.classTitle
+{
+ font-size:170%;
+ line-height:130%;
+}
+
+h2 { font-size: 110%; }
+caption, div.sectionTitle
+{
+ background-color: #7F8FB1;
+ color: #fff;
+ font-size:130%;
+ text-align: left;
+ padding: 2px 6px 2px 6px;
+ border: 1px #7F8FB1 solid;
+}
+
+div.sectionTitle { margin-bottom: 8px; }
+.summaryTable thead { display: none; }
+
+.summaryTable td
+{
+ vertical-align: top;
+ padding: 4px;
+ border-bottom: 1px #7F8FB1 solid;
+ border-right: 1px #7F8FB1 solid;
+}
+
+/*col#summaryAttributes {}*/
+.summaryTable td.attributes
+{
+ border-left: 1px #7F8FB1 solid;
+ width: 140px;
+ text-align: right;
+}
+
+td.attributes, .fixedFont
+{
+ line-height: 15px;
+ color: #002EBE;
+ font-family: "Courier New",Courier,monospace;
+ font-size: 13px;
+}
+
+.summaryTable td.nameDescription
+{
+ text-align: left;
+ font-size: 13px;
+ line-height: 15px;
+}
+
+.summaryTable td.nameDescription, .description
+{
+ line-height: 15px;
+ padding: 4px;
+ padding-left: 4px;
+}
+
+.summaryTable { margin-bottom: 8px; }
+
+ul.inheritsList
+{
+ list-style: square;
+ margin-left: 20px;
+ padding-left: 0;
+}
+
+.detailList {
+ margin-left: 20px;
+ line-height: 15px;
+}
+.detailList dt { margin-left: 20px; }
+
+.detailList .heading
+{
+ font-weight: bold;
+ padding-bottom: 6px;
+ margin-left: 0;
+}
+
+.light, td.attributes, .light a:link, .light a:visited
+{
+ color: #777;
+ font-style: italic;
+}
+
+.fineprint
+{
+ text-align: right;
+ font-size: 10px;
+}
+ </style>
+ </head>
+
+ <body>
+ <div id="header">
+</div>
+
+ <div id="index">
+ <div align="center"><a href="index.html">Class Index</a>
+| <a href="files.html">File Index</a></div>
+<hr />
+<h2>Classes</h2>
+<ul class="classList">
+
+ <li><a href="symbols/%24wb.html">$wb</a></li>
+
+ <li><a href="symbols/%24wb.Array.html">$wb.Array</a></li>
+
+ <li><a href="symbols/%24wb.core.html">$wb.core</a></li>
+
+ <li><a href="symbols/%24wb.core.Events.html">$wb.core.Events</a></li>
+
+ <li><a href="symbols/%24wb.core.Registry.html">$wb.core.Registry</a></li>
+
+ <li><a href="symbols/%24wb.core.Utils.html">$wb.core.Utils</a></li>
+
+ <li><a href="symbols/%24wb.Set.html">$wb.Set</a></li>
+
+ <li><a href="symbols/%24wb.ui.html">$wb.ui</a></li>
+
+ <li><a href="symbols/%24wb.ui.BasePane.html">$wb.ui.BasePane</a></li>
+
+ <li><a href="symbols/%24wb.ui.layout.html">$wb.ui.layout</a></li>
+
+ <li><a href="symbols/%24wb.ui.Widget.html">$wb.ui.Widget</a></li>
+
+ <li><a href="symbols/%24wb.Url.html">$wb.Url</a></li>
+
+ <li><a href="symbols/%24wb.utils.html">$wb.utils</a></li>
+
+ <li><i><a href="symbols/_global_.html">_global_</a></i></li>
+
+</ul>
+<hr />
+ </div>
+
+ <div id="content">
+ <h1 class="classTitle">File Index</h1>
+
+
+ <div>
+ <h2><a href="symbols/src/js_template.js.html">template.js</a></h2>
+
+Contains all the default templates
+ <dl>
+
+ <dt class="heading">Author:</dt>
+ <dd><a href="http://twitter.com/vonhofdk"/>Henrik Hofmeister</a></dd>
+
+
+ <dt class="heading">Version:</dt>
+ <dd>1.0</dd>
+
+
+
+ </dl>
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/src/js_widget.js.html">widget.js</a></h2>
+
+This file contains all the basic widgets
+ <dl>
+
+ <dt class="heading">Author:</dt>
+ <dd><a href="http://twitter.com/vonhofdk"/>Henrik Hofmeister</a></dd>
+
+
+ <dt class="heading">Version:</dt>
+ <dd>1.0</dd>
+
+
+
+ </dl>
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/src/js_utils.js.html">utils.js</a></h2>
+
+This file contains all utilities provided and used by webbeans
+ <dl>
+
+ <dt class="heading">Author:</dt>
+ <dd><a href="http://twitter.com/vonhofdk"/>Henrik Hofmeister</a></dd>
+
+
+ <dt class="heading">Version:</dt>
+ <dd>1.0</dd>
+
+
+
+ </dl>
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/src/js_data.js.html">data.js</a></h2>
+
+All methods and classes related to data handling is in here
+ <dl>
+
+ <dt class="heading">Author:</dt>
+ <dd><a href="http://twitter.com/vonhofdk"/>Henrik Hofmeister</a></dd>
+
+
+ <dt class="heading">Version:</dt>
+ <dd>1.0</dd>
+
+
+
+ </dl>
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/src/js_core.js.html">core.js</a></h2>
+
+<p>
+This is the webbeans bootstrap file. You should only include this file directly on the page and use "require" to load
+additional modules and js files.
+<hr/>
+</p>
+<p><b>$wbConfig</b> is read when including this file. </p>
+
+<p>
+it has the following options:<br/>
+
+<br/><b>jQuery:</b> Path to a jquery js file - defaults to google CDN. Required.
+<br/><b>skin:</b> Name of the skin (or path to costum CSS file). Defaults to "default" - set to null to skip skin handling
+<br/><b>base:</b> Url that points to the base of webbeans. Required.
+<br/><b>noCSS:</b> Boolean - set to true to skip loading of all webbeans css files. Defaults to false. Optional.
+</p>
+ <dl>
+
+ <dt class="heading">Author:</dt>
+ <dd><a href="http://twitter.com/vonhofdk"/>Henrik Hofmeister</a></dd>
+
+
+ <dt class="heading">Version:</dt>
+ <dd>1.0</dd>
+
+
+
+ </dl>
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/src/js_form.js.html">form.js</a></h2>
+
+All form widgets are in here
+ <dl>
+
+ <dt class="heading">Author:</dt>
+ <dd><a href="http://twitter.com/vonhofdk"/>Henrik Hofmeister</a></dd>
+
+
+ <dt class="heading">Version:</dt>
+ <dd>1.0</dd>
+
+
+
+ </dl>
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/src/js_kitchensink.js.html">kitchensink.js</a></h2>
+
+Demo application using usually all elements available in webbeans
+ <dl>
+
+ <dt class="heading">Author:</dt>
+ <dd><a href="http://twitter.com/vonhofdk"/>Henrik Hofmeister</a></dd>
+
+
+ <dt class="heading">Version:</dt>
+ <dd>1.0</dd>
+
+
+
+ </dl>
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/src/js_localization.js.html">localization.js</a></h2>
+
+All localization related methods are in here
+ <dl>
+
+ <dt class="heading">Author:</dt>
+ <dd><a href="http://twitter.com/vonhofdk"/>Henrik Hofmeister</a></dd>
+
+
+ <dt class="heading">Version:</dt>
+ <dd>1.0</dd>
+
+
+
+ </dl>
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/src/js_game.js.html">js/game.js</a></h2>
+
+ <dl>
+
+
+
+
+ </dl>
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/src/js_jcanvas.min.js.html">js/jcanvas.min.js</a></h2>
+
+ <dl>
+
+
+
+
+ </dl>
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/src/js_kitchensink.canvas.js.html">js/kitchensink.canvas.js</a></h2>
+
+ <dl>
+
+
+
+
+ </dl>
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/src/js_kitchensink.game.js.html">js/kitchensink.game.js</a></h2>
+
+ <dl>
+
+
+
+
+ </dl>
+ </div>
+ <hr />
+
+
+ </div>
+ <div class="fineprint" style="clear:both">
+
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Apr 13 2012 14:41:27 GMT+0200 (CEST)
+ </div>
+ </body>
+</html>
314 js/doc/index.html
View
@@ -0,0 +1,314 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+
+ <title>JsDoc Reference - Index</title>
+ <meta name="generator" content="JsDoc Toolkit" />
+
+ <style type="text/css">
+ /* default.css */
+body
+{
+ font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
+ width: 800px;
+}
+
+.header
+{
+ clear: both;
+ background-color: #ccc;
+ padding: 8px;
+}
+
+h1
+{
+ font-size: 150%;
+ font-weight: bold;
+ padding: 0;
+ margin: 1em 0 0 .3em;
+}
+
+hr
+{
+ border: none 0;
+ border-top: 1px solid #7F8FB1;
+ height: 1px;
+}
+
+pre.code
+{
+ display: block;
+ padding: 8px;
+ border: 1px dashed #ccc;
+}
+
+#index
+{
+ margin-top: 24px;
+ float: left;
+ width: 160px;
+ position: absolute;
+ left: 8px;
+ background-color: #F3F3F3;
+ padding: 8px;
+}
+
+#content
+{
+ margin-left: 190px;
+ width: 600px;
+}
+
+.classList
+{
+ list-style-type: none;
+ padding: 0;
+ margin: 0 0 0 8px;
+ font-family: arial, sans-serif;
+ font-size: 1em;
+ overflow: auto;
+}
+
+.classList li
+{
+ padding: 0;
+ margin: 0 0 8px 0;
+}
+
+.summaryTable { width: 100%; }
+
+h1.classTitle
+{
+ font-size:170%;
+ line-height:130%;
+}
+
+h2 { font-size: 110%; }
+caption, div.sectionTitle
+{
+ background-color: #7F8FB1;
+ color: #fff;
+ font-size:130%;
+ text-align: left;
+ padding: 2px 6px 2px 6px;
+ border: 1px #7F8FB1 solid;
+}
+
+div.sectionTitle { margin-bottom: 8px; }
+.summaryTable thead { display: none; }
+
+.summaryTable td
+{
+ vertical-align: top;
+ padding: 4px;
+ border-bottom: 1px #7F8FB1 solid;
+ border-right: 1px #7F8FB1 solid;
+}
+
+/*col#summaryAttributes {}*/
+.summaryTable td.attributes
+{
+ border-left: 1px #7F8FB1 solid;
+ width: 140px;
+ text-align: right;
+}
+
+td.attributes, .fixedFont
+{
+ line-height: 15px;
+ color: #002EBE;
+ font-family: "Courier New",Courier,monospace;
+ font-size: 13px;
+}
+
+.summaryTable td.nameDescription
+{
+ text-align: left;
+ font-size: 13px;
+ line-height: 15px;
+}
+
+.summaryTable td.nameDescription, .description
+{
+ line-height: 15px;
+ padding: 4px;
+ padding-left: 4px;
+}
+
+.summaryTable { margin-bottom: 8px; }
+
+ul.inheritsList
+{
+ list-style: square;
+ margin-left: 20px;
+ padding-left: 0;
+}
+
+.detailList {
+ margin-left: 20px;
+ line-height: 15px;
+}
+.detailList dt { margin-left: 20px; }
+
+.detailList .heading
+{
+ font-weight: bold;
+ padding-bottom: 6px;
+ margin-left: 0;
+}
+
+.light, td.attributes, .light a:link, .light a:visited
+{
+ color: #777;
+ font-style: italic;
+}
+
+.fineprint
+{
+ text-align: right;
+ font-size: 10px;
+}
+ </style>
+ </head>
+
+ <body>
+ <div id="header">
+</div>
+
+ <div id="index">
+ <div align="center"><a href="index.html">Class Index</a>
+| <a href="files.html">File Index</a></div>
+<hr />
+<h2>Classes</h2>
+<ul class="classList">
+
+ <li><a href="symbols/%24wb.html">$wb</a></li>
+
+ <li><a href="symbols/%24wb.Array.html">$wb.Array</a></li>
+
+ <li><a href="symbols/%24wb.core.html">$wb.core</a></li>
+
+ <li><a href="symbols/%24wb.core.Events.html">$wb.core.Events</a></li>
+
+ <li><a href="symbols/%24wb.core.Registry.html">$wb.core.Registry</a></li>
+
+ <li><a href="symbols/%24wb.core.Utils.html">$wb.core.Utils</a></li>
+
+ <li><a href="symbols/%24wb.Set.html">$wb.Set</a></li>
+
+ <li><a href="symbols/%24wb.ui.html">$wb.ui</a></li>
+
+ <li><a href="symbols/%24wb.ui.BasePane.html">$wb.ui.BasePane</a></li>
+
+ <li><a href="symbols/%24wb.ui.layout.html">$wb.ui.layout</a></li>
+
+ <li><a href="symbols/%24wb.ui.Widget.html">$wb.ui.Widget</a></li>
+
+ <li><a href="symbols/%24wb.Url.html">$wb.Url</a></li>
+
+ <li><a href="symbols/%24wb.utils.html">$wb.utils</a></li>
+
+ <li><i><a href="symbols/_global_.html">_global_</a></i></li>
+
+</ul>
+<hr />
+ </div>
+
+ <div id="content">
+ <h1 class="classTitle">Class Index</h1>
+
+
+ <div>
+ <h2><a href="symbols/%24wb.html">$wb</a></h2>
+ the main namespace in webbeans
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/%24wb.Array.html">$wb.Array</a></h2>
+
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/%24wb.core.html">$wb.core</a></h2>
+ Core classes
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/%24wb.core.Events.html">$wb.core.Events</a></h2>
+
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/%24wb.core.Registry.html">$wb.core.Registry</a></h2>
+
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/%24wb.core.Utils.html">$wb.core.Utils</a></h2>
+
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/%24wb.Set.html">$wb.Set</a></h2>
+
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/%24wb.ui.html">$wb.ui</a></h2>
+ User interface classes, templates and methods
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/%24wb.ui.BasePane.html">$wb.ui.BasePane</a></h2>
+
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/%24wb.ui.layout.html">$wb.ui.layout</a></h2>
+ Layout handlers
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/%24wb.ui.Widget.html">$wb.ui.Widget</a></h2>
+
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/%24wb.Url.html">$wb.Url</a></h2>
+
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/%24wb.utils.html">$wb.utils</a></h2>
+ Utility functions
+ </div>
+ <hr />
+
+ <div>
+ <h2><a href="symbols/_global_.html">_global_</a></h2>
+
+ </div>
+ <hr />
+
+
+ </div>
+ <div class="fineprint" style="clear:both">
+
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Apr 13 2012 14:41:27 GMT+0200 (CEST)
+ </div>
+ </body>
+</html>
882 js/doc/symbols/$wb.Array.html
View
@@ -0,0 +1,882 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+ <meta name="generator" content="JsDoc Toolkit" />
+
+ <title>JsDoc Reference - $wb.Array</title>
+
+ <style type="text/css">
+ /* default.css */
+body
+{
+ font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
+ width: 800px;
+}
+
+.header
+{
+ clear: both;
+ background-color: #ccc;
+ padding: 8px;
+}
+
+h1
+{
+ font-size: 150%;
+ font-weight: bold;
+ padding: 0;
+ margin: 1em 0 0 .3em;
+}
+
+hr
+{
+ border: none 0;
+ border-top: 1px solid #7F8FB1;
+ height: 1px;
+}
+
+pre.code
+{
+ display: block;
+ padding: 8px;
+ border: 1px dashed #ccc;
+}
+
+#index
+{
+ margin-top: 24px;
+ float: left;
+ width: 160px;
+ position: absolute;
+ left: 8px;
+ background-color: #F3F3F3;
+ padding: 8px;
+}
+
+#content
+{
+ margin-left: 190px;
+ width: 600px;
+}
+
+.classList
+{
+ list-style-type: none;
+ padding: 0;
+ margin: 0 0 0 8px;
+ font-family: arial, sans-serif;
+ font-size: 1em;
+ overflow: auto;
+}
+
+.classList li
+{
+ padding: 0;
+ margin: 0 0 8px 0;
+}
+
+.summaryTable { width: 100%; }
+
+h1.classTitle
+{
+ font-size:170%;
+ line-height:130%;
+}
+
+h2 { font-size: 110%; }
+caption, div.sectionTitle
+{
+ background-color: #7F8FB1;
+ color: #fff;
+ font-size:130%;
+ text-align: left;
+ padding: 2px 6px 2px 6px;
+ border: 1px #7F8FB1 solid;
+}
+
+div.sectionTitle { margin-bottom: 8px; }
+.summaryTable thead { display: none; }
+
+.summaryTable td
+{
+ vertical-align: top;
+ padding: 4px;
+ border-bottom: 1px #7F8FB1 solid;
+ border-right: 1px #7F8FB1 solid;
+}
+
+/*col#summaryAttributes {}*/
+.summaryTable td.attributes
+{
+ border-left: 1px #7F8FB1 solid;
+ width: 140px;
+ text-align: right;
+}
+
+td.attributes, .fixedFont
+{
+ line-height: 15px;
+ color: #002EBE;
+ font-family: "Courier New",Courier,monospace;
+ font-size: 13px;
+}
+
+.summaryTable td.nameDescription
+{
+ text-align: left;
+ font-size: 13px;
+ line-height: 15px;
+}
+
+.summaryTable td.nameDescription, .description
+{
+ line-height: 15px;
+ padding: 4px;
+ padding-left: 4px;
+}
+
+.summaryTable { margin-bottom: 8px; }
+
+ul.inheritsList
+{
+ list-style: square;
+ margin-left: 20px;
+ padding-left: 0;
+}
+
+.detailList {
+ margin-left: 20px;
+ line-height: 15px;
+}
+.detailList dt { margin-left: 20px; }
+
+.detailList .heading
+{
+ font-weight: bold;
+ padding-bottom: 6px;
+ margin-left: 0;
+}
+
+.light, td.attributes, .light a:link, .light a:visited
+{
+ color: #777;
+ font-style: italic;
+}
+
+.fineprint
+{
+ text-align: right;
+ font-size: 10px;
+}
+ </style>
+ </head>
+
+ <body>
+<!-- ============================== header ================================= -->
+ <!-- begin static/header.html -->
+ <div id="header">
+</div>
+ <!-- end static/header.html -->
+
+<!-- ============================== classes index ============================ -->
+ <div id="index">
+ <!-- begin publish.classesIndex -->
+ <div align="center"><a href="../index.html">Class Index</a>
+| <a href="../files.html">File Index</a></div>
+<hr />
+<h2>Classes</h2>
+<ul class="classList">
+
+ <li><a href="../symbols/%24wb.html">$wb</a></li>
+
+ <li><a href="../symbols/%24wb.Array.html">$wb.Array</a></li>
+
+ <li><a href="../symbols/%24wb.core.html">$wb.core</a></li>
+
+ <li><a href="../symbols/%24wb.core.Events.html">$wb.core.Events</a></li>
+
+ <li><a href="../symbols/%24wb.core.Registry.html">$wb.core.Registry</a></li>
+
+ <li><a href="../symbols/%24wb.core.Utils.html">$wb.core.Utils</a></li>
+
+ <li><a href="../symbols/%24wb.Set.html">$wb.Set</a></li>
+
+ <li><a href="../symbols/%24wb.ui.html">$wb.ui</a></li>
+
+ <li><a href="../symbols/%24wb.ui.BasePane.html">$wb.ui.BasePane</a></li>
+
+ <li><a href="../symbols/%24wb.ui.layout.html">$wb.ui.layout</a></li>
+
+ <li><a href="../symbols/%24wb.ui.Widget.html">$wb.ui.Widget</a></li>
+
+ <li><a href="../symbols/%24wb.Url.html">$wb.Url</a></li>
+
+ <li><a href="../symbols/%24wb.utils.html">$wb.utils</a></li>
+
+ <li><i><a href="../symbols/_global_.html">_global_</a></i></li>
+
+</ul>
+<hr />
+ <!-- end publish.classesIndex -->
+ </div>
+
+ <div id="content">
+<!-- ============================== class title ============================ -->
+ <h1 class="classTitle">
+
+ Class $wb.Array
+ </h1>
+
+<!-- ============================== class summary ========================== -->
+ <p class="description">
+
+
+
+
+
+
+ <br /><i>Defined in: </i> <a href="../symbols/src/js_core.js.html">core.js</a>.
+
+ </p>
+
+<!-- ============================== constructor summary ==================== -->
+
+ <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class $wb.Array.">
+ <caption>Class Summary</caption>
+ <thead>
+ <tr>
+ <th scope="col">Constructor Attributes</th>
+ <th scope="col">Constructor Name and Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="attributes">&nbsp;</td>
+ <td class="nameDescription" >
+ <div class="fixedFont">
+ <b><a href="../symbols/%24wb.Array.html#constructor">$wb.Array</a></b>(arr)
+ </div>
+ <div class="description">An array wrapper</div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+
+<!-- ============================== properties summary ===================== -->
+
+
+
+ <table class="summaryTable"