diff options
author | wei <> | 2006-04-21 11:41:21 +0000 |
---|---|---|
committer | wei <> | 2006-04-21 11:41:21 +0000 |
commit | e1e034ced29b0b9bf11a49798b4fba4d3dd0164d (patch) | |
tree | 92120227f58c2463ddb50b1592dde0436d175189 /framework/Web/Javascripts/extended/base.js | |
parent | e57fc66ee3f5259b4f7cbd18a1cd0f6da6176f5d (diff) |
Update javascript libraries, rewrote client-side validators, removed some js files, simplified javascript compression.
Diffstat (limited to 'framework/Web/Javascripts/extended/base.js')
-rw-r--r-- | framework/Web/Javascripts/extended/base.js | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/framework/Web/Javascripts/extended/base.js b/framework/Web/Javascripts/extended/base.js index 06a916d6..53856684 100644 --- a/framework/Web/Javascripts/extended/base.js +++ b/framework/Web/Javascripts/extended/base.js @@ -1,26 +1,29 @@ -/**
- * get element
- @ @param element or element id string
- @ returns element
+/**
+ * Similar to bindAsEventLister, but takes additional arguments.
*/
-function $(n,d) {
- if(isElement(n)) return n;
- if(isString(n)==false) return null;
- var p,i,x;
- if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
- d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
- if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
- for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=DOM.find(n,d.layers[i].document);
- if(!x && d.getElementById) x=d.getElementById(n); return x;
+Function.prototype.bindEvent = function()
+{
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function(event)
+ {
+ return __method.apply(object, [event || window.event].concat(args));
+ }
}
/**
- * Similar to bindAsEventLister, but takes additional arguments.
+ * Creates a new function by copying function definition from
+ * the <tt>base</tt> and optional <tt>definition</tt>.
+ * @param function a base function to copy from.
+ * @param array additional definition
+ * @param function return a new function with definition from both
+ * <tt>base</tt> and <tt>definition</tt>.
*/
-Function.prototype.bindEvent = function() {
- var __method = this, args = $A(arguments), object = args.shift();
- return function(event) {
- return __method.apply(object, [event || window.event].concat(args));
- }
-}
+Class.extend = function(base, definition)
+{
+ var component = Class.create();
+ Object.extend(component.prototype, base.prototype);
+ if(definition)
+ Object.extend(component.prototype, definition);
+ return component;
+}
\ No newline at end of file |