[KSS-checkins] r50002 - kukit/kukit.js/branch/finish-closures/kukit
gotcha at codespeak.net
gotcha at codespeak.net
Sat Dec 22 11:10:56 CET 2007
Author: gotcha
Date: Sat Dec 22 11:10:55 2007
New Revision: 50002
Modified:
kukit/kukit.js/branch/finish-closures/kukit/actionreg.js
Log:
unindent and use of __init__
Modified: kukit/kukit.js/branch/finish-closures/kukit/actionreg.js
==============================================================================
--- kukit/kukit.js/branch/finish-closures/kukit/actionreg.js (original)
+++ kukit/kukit.js/branch/finish-closures/kukit/actionreg.js Sat Dec 22 11:10:55 2007
@@ -27,36 +27,39 @@
* the local event actions need to be registered here.
*/
var _ActionRegistry = function () {
+this.__init__ = function() {
this.content = {};
+};
- this.register = function(name, func) {
-;;; if (typeof(func) == 'undefined') {
-;;; kukit.e = '[func] argument is mandatory when registering an action';
-;;; kukit.e += ' [actionregistry.register].';
-;;; throw new error(kukit.e);
-;;; }
- if (this.content[name]) {
- // do not allow redefinition
-;;; kukit.logerror('error : action [' + name + '] already registered.');
- return;
- }
- this.content[name] = func;
- };
+this.register = function(name, func) {
+;;; if (typeof(func) == 'undefined') {
+;;; kukit.e = '[func] argument is mandatory when registering an action';
+;;; kukit.e += ' [actionregistry.register].';
+;;; throw new error(kukit.e);
+;;; }
+ if (this.content[name]) {
+ // do not allow redefinition
+;;; kukit.logerror('error : action [' + name + '] already registered.');
+ return;
+ }
+ this.content[name] = func;
+};
- this.exists = function(name) {
- var entry = this.content[name];
- return (typeof(entry) != 'undefined');
- };
+this.exists = function(name) {
+ var entry = this.content[name];
+ return (typeof(entry) != 'undefined');
+};
- this.get = function(name) {
- var func = this.content[name];
- if (! func) {
- // not found
-;;; kukit.E = 'Error : undefined local action [' + name + '].';
- throw Error(kukit.E);
- }
- return func;
- };
+this.get = function(name) {
+ var func = this.content[name];
+ if (! func) {
+ // not found
+;;; kukit.E = 'Error : undefined local action [' + name + '].';
+ throw Error(kukit.E);
+ }
+ return func;
+};
+this.__init__();
};
More information about the Kukit-checkins
mailing list