Author: gotcha
Date: Sun Dec 23 11:50:12 2007
New Revision: 50035
Modified:
kukit/kukit.js/branch/finish-closures/kukit/TODO.txt
kukit/kukit.js/branch/finish-closures/kukit/commandreg.js
Log:
unindent and initialize
Modified: kukit/kukit.js/branch/finish-closures/kukit/TODO.txt
==============================================================================
--- kukit/kukit.js/branch/finish-closures/kukit/TODO.txt (original)
+++ kukit/kukit.js/branch/finish-closures/kukit/TODO.txt Sun Dec 23
11:50:12 2007
@@ -7,7 +7,6 @@
files where indentation has to be undone and initialize needs to be done
-commandreg.js
dom.js
errors.js
eventreg.js
Modified: kukit/kukit.js/branch/finish-closures/kukit/commandreg.js
==============================================================================
--- kukit/kukit.js/branch/finish-closures/kukit/commandreg.js (original)
+++ kukit/kukit.js/branch/finish-closures/kukit/commandreg.js Sun Dec 23
11:50:12 2007
@@ -27,41 +27,44 @@
* class _CommandRegistry
*/
var _CommandRegistry = function () {
+
+this.initialize = function() {
this.commands = {};
+};
- this.registerFromAction =
- function(srcname, factory, name) {
- if (typeof(name) == 'undefined') {
- // allows to set a different name as the action name,
- // usable for backward
- // compatibility setups
- name = srcname;
+this.registerFromAction =
+ function(srcname, factory, name) {
+ if (typeof(name) == 'undefined') {
+ // allows to set a different name as the action name,
+ // usable for backward
+ // compatibility setups
+ name = srcname;
+ }
+ // register a given action as a command, using the given vactor
+ var f = kukit.actionsGlobalRegistry.get(srcname);
+ factory(name, f);
+};
+
+this.register = function(name, klass) {
+ if (this.commands[name]) {
+ // Do not allow redefinition
+;;; var msg = 'ValueError : command [' + name + '] is already registered.';
+;;; kukit.logError(msg);
+ return;
}
- // register a given action as a command, using the given vactor
- var f = kukit.actionsGlobalRegistry.get(srcname);
- factory(name, f);
- };
-
- this.register = function(name, klass) {
- if (this.commands[name]) {
- // Do not allow redefinition
-;;; var msg = 'ValueError : command [' + name + '] is already
registered.';
-;;; kukit.logError(msg);
- return;
- }
- this.commands[name] = klass;
- };
-
- this.get = function(name) {
- var klass = this.commands[name];
-;;; if (! klass) {
-;;; // not found
-;;; var msg = 'ValueError : no command registered under [' + name +
'].';
-;;; kukit.logError(msg);
-;;; }
- return klass;
- };
+ this.commands[name] = klass;
+};
+this.get = function(name) {
+ var klass = this.commands[name];
+;;; if (! klass) {
+;;; // not found
+;;; var msg = 'ValueError : no command registered under [' + name + '].';
+;;; kukit.logError(msg);
+;;; }
+ return klass;
+};
+this.initialize.apply(this, arguments);
};
/*
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins