[KSS-checkins] r44148 - kukit/kukit.js/trunk/kukit

reebalazs at codespeak.net reebalazs at codespeak.net
Mon Jun 11 18:04:13 CEST 2007


Author: reebalazs
Date: Mon Jun 11 18:04:11 2007
New Revision: 44148

Modified:
   kukit/kukit.js/trunk/kukit/actionreg.js
   kukit/kukit.js/trunk/kukit/commandprocessor.js
   kukit/kukit.js/trunk/kukit/commandreg.js
   kukit/kukit.js/trunk/kukit/dom.js
   kukit/kukit.js/trunk/kukit/errors.js
   kukit/kukit.js/trunk/kukit/eventreg.js
   kukit/kukit.js/trunk/kukit/forms.js
   kukit/kukit.js/trunk/kukit/kssparser.js
   kukit/kukit.js/trunk/kukit/kukit.js
   kukit/kukit.js/trunk/kukit/oper.js
   kukit/kukit.js/trunk/kukit/plugin.js
   kukit/kukit.js/trunk/kukit/providerreg.js
   kukit/kukit.js/trunk/kukit/requestmanager.js
   kukit/kukit.js/trunk/kukit/resourcedata.js
   kukit/kukit.js/trunk/kukit/selectorreg.js
   kukit/kukit.js/trunk/kukit/serveraction.js
   kukit/kukit.js/trunk/kukit/tokenizer.js
   kukit/kukit.js/trunk/kukit/utils.js
Log:
Merge in ree-stripout-comments branch (-r42580:44147)

Modified: kukit/kukit.js/trunk/kukit/actionreg.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/actionreg.js	(original)
+++ kukit/kukit.js/trunk/kukit/actionreg.js	Mon Jun 11 18:04:11 2007
@@ -32,12 +32,12 @@
 };
 
 kukit.ar.ActionRegistry.prototype.register = function(name, func) {
-    if (typeof(func) == 'undefined') {
-        throw 'func argument is mandatory when registering an action (ActionRegistry.register).';
-    }
+    ;;; if (typeof(func) == 'undefined') {
+    ;;;     throw 'func argument is mandatory when registering an action (ActionRegistry.register).';
+    ;;; }
     if (this.content[name]) {
         // Do not allow redefinition
-        kukit.logError('Error : action "' + name + '" already registered.');
+        ;;; kukit.logError('Error : action "' + name + '" already registered.');
         return;
         }
     this.content[name] = func;
@@ -52,8 +52,9 @@
     var func = this.content[name];
     if (! func) {
         // not found
-        throw 'Error : undefined local action "' + name + '"';
-        //kukit.logError('Error : undefined action ' + name);
+        ;;; kukit.E = 'Error : undefined local action "' + name + '"';
+        throw kukit.E;
+        //kukit.logError(kukit.E);
         }
     return func;
 };
@@ -65,7 +66,7 @@
 
 kukit.ar.actionRegistry = {};
 kukit.ar.actionRegistry.register = function(name, func) {
-    kukit.logWarning('Deprecated kukit.ar.actionRegistry.register, use kukit.actionsGlobalRegistry.register instead! (' + name + ')');
+    ;;; kukit.logWarning('Deprecated kukit.ar.actionRegistry.register, use kukit.actionsGlobalRegistry.register instead! (' + name + ')');
     kukit.actionsGlobalRegistry.register(name, func);
 };
 

Modified: kukit/kukit.js/trunk/kukit/commandprocessor.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/commandprocessor.js	(original)
+++ kukit/kukit.js/trunk/kukit/commandprocessor.js	Mon Jun 11 18:04:11 2007
@@ -30,8 +30,8 @@
 };
 
 kukit.cp.CommandProcessor.prototype.parseCommands = function(commands, transport) {
-    kukit.log('Parse commands');
-    kukit.logDebug('Number of commands: ' + commands.length);
+    ;;; kukit.log('Parse commands');
+    ;;; kukit.logDebug('Number of commands: ' + commands.length);
     for (var y=0;y < commands.length;y++) {
         var command = commands[y];
         this.parseCommand(command, transport);
@@ -41,7 +41,8 @@
         // we make sure we execute none of them.
         var lastcommand = this.commands[this.commands.length-1];
         if (lastcommand.name == 'error') {
-            throw new kukit.err.ExplicitError(lastcommand);
+            ;;; kukit.E = new kukit.err.ExplicitError(lastcommand);
+            throw kukit.E;
         }
     }
 };
@@ -110,16 +111,16 @@
     var commands = this.commands;
     for (var y=0;y < commands.length;y++) {
         var command = commands[y];
-        try {
+        ;;; try {
             command.execute(oper); 
-        } catch (e) {
-            if (e.name == 'RuleMergeError' || e.name == 'EventBindError') {
-                throw(e);
-            } else {
-                // augment the error message
-                throw new kukit.err.CommandExecutionError(e, command); 
-            }
-        }
+        ;;; } catch (e) {
+        ;;;     if (e.name == 'RuleMergeError' || e.name == 'EventBindError') {
+        ;;;         throw(e);
+        ;;;     } else {
+        ;;;         // augment the error message
+        ;;;         throw new kukit.err.CommandExecutionError(e, command); 
+        ;;;     }
+        ;;; }
     }
     kukit.engine.finishSetupEventsCollection();
 };

Modified: kukit/kukit.js/trunk/kukit/commandreg.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/commandreg.js	(original)
+++ kukit/kukit.js/trunk/kukit/commandreg.js	Mon Jun 11 18:04:11 2007
@@ -57,7 +57,7 @@
 kukit.cr.CommandRegistry.prototype.register = function(name, klass) {
     if (this.commands[name]) {
         // Do not allow redefinition
-        kukit.logError('ValueError : command "' + name + '" is already registered.');
+        ;;; kukit.logError('ValueError : command "' + name + '" is already registered.');
         return;
         }
     this.commands[name] = klass;
@@ -65,10 +65,10 @@
 
 kukit.cr.CommandRegistry.prototype.get = function(name) {
     var klass = this.commands[name];
-    if (! klass) {
-        // not found
-        kukit.logError('ValueError : no command registered under name : ' + name);
-        }
+    ;;; if (! klass) {
+    ;;;     // not found
+    ;;;     kukit.logError('ValueError : no command registered under name : ' + name);
+    ;;;    }
     return klass;
 };
 
@@ -79,7 +79,7 @@
 
 kukit.cr.commandRegistry = {};
 kukit.cr.commandRegistry.registerFromAction = function(srcname, factory, name) {
-    kukit.logWarning('Deprecated kukit.cr.commandRegistry.registerFromAction, use kukit.commandsGlobalRegistry.registerFromAction instead! (' + srcname + ')');
+    ;;; kukit.logWarning('Deprecated kukit.cr.commandRegistry.registerFromAction, use kukit.commandsGlobalRegistry.registerFromAction instead! (' + srcname + ')');
     kukit.commandsGlobalRegistry.registerFromAction(srcname, factory, name);
 };
 
@@ -107,21 +107,23 @@
 
 kukit.cr._Command_execute_selector = function(oper) {
     var selfunc = kukit.selectorTypesGlobalRegistry.get(this.selectorType);
-    var nodes = selfunc(this.selector, null, oper.orignode);
-    var printtype;
-    if (this.selectorType) {
-        printtype = this.selectorType;
-    } else {
-        printtype = 'default (' + kukit.selectorTypesGlobalRegistry.defaultSelectorType + ')';
-    }
-    kukit.logDebug('Selector type: ' +  printtype + ', selector : "' + this.selector + '", selected nodes:' + nodes.length);
-    if (!nodes || nodes.length == 0) {
-        kukit.logWarning('Selector found no nodes');
-    }
+    // When applying the selection, the original event target will be used
+    // as a starting point for the selection.
+    var nodes = selfunc(this.selector, oper.orignode, {});
+    ;;; var printtype;
+    ;;; if (this.selectorType) {
+    ;;;     printtype = this.selectorType;
+    ;;; } else {
+    ;;;     printtype = 'default (' + kukit.selectorTypesGlobalRegistry.defaultSelectorType + ')';
+    ;;; }
+    ;;; kukit.logDebug('Selector type: ' +  printtype + ', selector : "' + this.selector + '", selected nodes:' + nodes.length);
+    ;;; if (!nodes || nodes.length == 0) {
+    ;;;     kukit.logWarning('Selector found no nodes');
+    ;;; }
     for (var i=0;i < nodes.length;i++) {
         oper.node = nodes[i];
         //XXX error handling for wrong command name
-        kukit.logDebug('Command Name: ' + this.name);
+        ;;; kukit.logDebug('Command Name: ' + this.name);
         this.executeOnSingleNode(oper);
     }
 };

Modified: kukit/kukit.js/trunk/kukit/dom.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/dom.js	(original)
+++ kukit/kukit.js/trunk/kukit/dom.js	Mon Jun 11 18:04:11 2007
@@ -125,7 +125,8 @@
 kukit.dom.cssQuery = function(selector, in_nodes) {
     // to eliminate possible errors
     if (typeof(in_nodes) != 'undefined' && in_nodes == null) {
-        throw 'Selection error in kukit.dom.cssQuery';
+        ;;; kukit.E = 'Selection error in kukit.dom.cssQuery';
+        throw kukit.E;
     }
     return kukit.dom._cssQuery(selector, in_nodes);
 };
@@ -137,10 +138,10 @@
 kukit.dom._cssQuery = function(selector, in_nodes) {
     var USE_BASE2 = (typeof(base2) != 'undefined');
     if (USE_BASE2) {
-        kukit.log('Using cssQuery from base2');
+        ;;; kukit.log('Using cssQuery from base2');
         kukit.dom._cssQuery = kukit.dom._cssQuery_base2
     } else {
-        kukit.log('Using original cssQuery');
+        ;;; kukit.log('Using original cssQuery');
         kukit.dom._cssQuery = kukit.dom._cssQuery_orig
     }
     return kukit.dom._cssQuery(selector, in_nodes);
@@ -174,8 +175,8 @@
     tagName = node.tagName.toLowerCase();
     if ((tagName == 'input') || (tagName == 'select') || (tagName == 'textarea')) {
         node.focus();
-    } else {
-        kukit.logWarning('Focus on node that cannot have focus !');
+    ;;; } else {
+    ;;;     kukit.logWarning('Focus on node that cannot have focus !');
     }
 };
 
@@ -371,14 +372,16 @@
 
 kukit.dom.EmbeddedContentLoadedScheduler.prototype.check = function() {
     
-    kukit.logDebug('Is iframe loaded ?');
+    ;;; kukit.logDebug('Is iframe loaded ?');
     
     var doc = kukit.dom.getIframeDocument(this.framename);
 
     // quit if the init function has already been called
     // XXX I believe we want to call the function too, then
-    if (doc._embeddedContentLoadedInitDone) {
-        kukit.logWarning('Iframe already initialized, but we execute the action enyway, as requested.');
+    // XXX attribute access starting with _ breaks full compression, even in strings
+    //if (doc._embeddedContentLoadedInitDone) {
+    if (doc['_' + 'embeddedContentLoadedInitDone']) {
+        ;;; kukit.logWarning('Iframe already initialized, but we execute the action anyway, as requested.');
         this.counter.restart = false;
     }
 
@@ -388,7 +391,9 @@
     // on the document, when loaded. It is safe to check for this in any 
     // case, however if this option is selected, we rely only on this, 
     // and skip the otherwise problematic default checking.
-    if (typeof doc._kssReadyForLoadEvent != 'undefined') {
+    // XXX attribute access starting with _ breaks full compression, even in strings
+    //if (typeof doc._kssReadyForLoadEvent != 'undefined') {
+    if (typeof doc['_' + 'kssReadyForLoadEvent'] != 'undefined') {
         this.counter.restart = false;
     } 
 
@@ -415,8 +420,10 @@
     }
 
     if ( ! this.counter.restart) {
-        kukit.logDebug('Yes, iframe is loaded.');
-        doc._embeddedContentLoadedInitDone = true;
+        ;;; kukit.logDebug('Yes, iframe is loaded.');
+        // XXX attribute access starting with _ breaks full compression, even in strings
+        // doc._embeddedContentLoadedInitDone = true;
+        doc['_' + 'embeddedContentLoadedInitDone'] = true;
         this.func();
     }
 };

Modified: kukit/kukit.js/trunk/kukit/errors.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/errors.js	(original)
+++ kukit/kukit.js/trunk/kukit/errors.js	Mon Jun 11 18:04:11 2007
@@ -74,56 +74,56 @@
     return exc;
 };
 
-// this should be thrown with the error command as parameter
-kukit.err.ExplicitError = kukit.err.exceptionFactory('ExplicitError');
-kukit.err.ExplicitError.prototype.__superinit__ = kukit.err.ExplicitError.prototype.__init__;
-kukit.err.ExplicitError.prototype.__init__ = function(name, errorcommand) {
-    var message = 'Explicit error';
-    var kw = this.__superinit__(name, message);
-    kw.errorcommand = errorcommand;
-    return kw;
-};
-
-kukit.err.ResponseParsingError = kukit.err.exceptionFactory('ResponseParsingError');
-
-kukit.err.CommandExecutionError = kukit.err.exceptionFactory('CommandExecutionError');
-kukit.err.CommandExecutionError.prototype.__superinit__ = kukit.err.CommandExecutionError.prototype.__init__; 
-kukit.err.CommandExecutionError.prototype.__init__ = function(name, e, command) {
-    var kw = this.__superinit__(name, '');
-    kw.message = 'Command "' + command.name + '": ' + e.toString();
-    return kw;
-};
+;;; // this should be thrown with the error command as parameter
+;;; kukit.err.ExplicitError = kukit.err.exceptionFactory('ExplicitError');
+;;; kukit.err.ExplicitError.prototype.__superinit__ = kukit.err.ExplicitError.prototype.__init__;
+;;; kukit.err.ExplicitError.prototype.__init__ = function(name, errorcommand) {
+;;;     var message = 'Explicit error';
+;;;     var kw = this.__superinit__(name, message);
+;;;     kw.errorcommand = errorcommand;
+;;;     return kw;
+;;; };
+
+;;; kukit.err.ResponseParsingError = kukit.err.exceptionFactory('ResponseParsingError');
+
+;;; kukit.err.CommandExecutionError = kukit.err.exceptionFactory('CommandExecutionError');
+;;; kukit.err.CommandExecutionError.prototype.__superinit__ = kukit.err.CommandExecutionError.prototype.__init__; 
+;;; kukit.err.CommandExecutionError.prototype.__init__ = function(name, e, command) {
+;;;     var kw = this.__superinit__(name, '');
+;;;     kw.message = 'Command "' + command.name + '": ' + e.toString();
+;;;     return kw;
+;;; };
 
 kukit.err.rd = {};
-kukit.err.rd.RuleMergeError = kukit.err.exceptionFactory('RuleMergeError');
+;;; kukit.err.rd.RuleMergeError = kukit.err.exceptionFactory('RuleMergeError');
 
-kukit.err.rd.KssSelectorError = kukit.err.exceptionFactory('KssSelectorError');
+;;; kukit.err.rd.KssSelectorError = kukit.err.exceptionFactory('KssSelectorError');
 
-kukit.err.rd.EventBindError = kukit.err.exceptionFactory('EventBindError');
-kukit.err.rd.EventBindError.prototype.__superinit__ = kukit.err.rd.EventBindError.prototype.__init__; 
-kukit.err.rd.EventBindError.prototype.__init__ = function(name, message, eventname, eventnamespace) {
-    var kw = this.__superinit__(name, message);
-    kw.eventname = eventname;
-    kw.eventnamespace = eventnamespace;
-    kw.message = kw.message + ' when binding event name "' + eventname + '" on namespace "' + eventnamespace + '"';
-    return kw;
-};
+;;; kukit.err.rd.EventBindError = kukit.err.exceptionFactory('EventBindError');
+;;; kukit.err.rd.EventBindError.prototype.__superinit__ = kukit.err.rd.EventBindError.prototype.__init__; 
+;;; kukit.err.rd.EventBindError.prototype.__init__ = function(name, message, eventname, eventnamespace) {
+;;;     var kw = this.__superinit__(name, message);
+;;;     kw.eventname = eventname;
+;;;     kw.eventnamespace = eventnamespace;
+;;;     kw.message = kw.message + ' when binding event name "' + eventname + '" on namespace "' + eventnamespace + '"';
+;;;     return kw;
+;;; };
 
 kukit.err.tk = {};
-kukit.err.tk.ParsingError = kukit.err.exceptionFactory('ParsingError');
-kukit.err.tk.ParsingError.prototype.__superinit__ = kukit.err.tk.ParsingError.prototype.__init__; 
-kukit.err.tk.ParsingError.prototype.__init__ = function(name, message, cursor) {
-    var kw = this.__superinit__(name, message);
-    if (cursor) {
-        kw.errpos = cursor.pos;
-        kw.errrow = cursor.row;
-        kw.errcol = cursor.col;
-        kw.message = kw.message + ' at row ' + kw.errrow + ', column ' + kw.errcol;
-    } else {
-        kw.errpos = null;
-        kw.errrow = null;
-        kw.errcol = null;
-    }
-    return kw;
-};
+;;; kukit.err.tk.ParsingError = kukit.err.exceptionFactory('ParsingError');
+;;; kukit.err.tk.ParsingError.prototype.__superinit__ = kukit.err.tk.ParsingError.prototype.__init__; 
+;;; kukit.err.tk.ParsingError.prototype.__init__ = function(name, message, cursor) {
+;;;     var kw = this.__superinit__(name, message);
+;;;     if (cursor) {
+;;;         kw.errpos = cursor.pos;
+;;;         kw.errrow = cursor.row;
+;;;         kw.errcol = cursor.col;
+;;;         kw.message = kw.message + ' at row ' + kw.errrow + ', column ' + kw.errcol;
+;;;     } else {
+;;;         kw.errpos = null;
+;;;         kw.errrow = null;
+;;;         kw.errcol = null;
+;;;     }
+;;;     return kw;
+;;; };
 

Modified: kukit/kukit.js/trunk/kukit/eventreg.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/eventreg.js	(original)
+++ kukit/kukit.js/trunk/kukit/eventreg.js	Mon Jun 11 18:04:11 2007
@@ -48,11 +48,12 @@
 
 kukit.er.EventRegistry.prototype.registerBinder = function(classname, func) {
     if (typeof(func) == 'undefined') {
-        throw 'func argument is mandatory when registering an event binder (EventRegistry.registerBinder).';
+        ;;; kukit.E = 'func argument is mandatory when registering an event binder (EventRegistry.registerBinder).';
+        throw kukit.E;
     }
     if (this.classes[classname]) {
         // Do not allow redefinition
-        kukit.logError('Error : event class "' + classname + '" already registered.');
+        ;;; kukit.logError('Error : event class "' + classname + '" already registered.');
         return;
     
     }
@@ -70,7 +71,8 @@
     var func = this.classes[classname];
     if (! func) {
         // not found
-        throw 'Error : undefined event setup type ' + classname;
+        ;;; kukit.E = 'Error : undefined event setup type ' + classname;
+        throw kukit.E;
         }
     return func;
 };
@@ -80,7 +82,8 @@
 kukit.er.EventRegistry.prototype._register = function(namespace, eventname, klass,
         bindmethodname, defaultactionmethodname, itername) {
     if (typeof(defaultactionmethodname) == 'undefined') {
-        throw 'some arguments are not passed when calling EventRegistry.register';
+        ;;; kukit.E = 'some arguments are not passed when calling EventRegistry.register';
+        throw kukit.E;
     }
     // Find out the class name. (Not specified now.)
     var classname = klass.prototype.__classname__;
@@ -92,7 +95,8 @@
         klass.prototype.__classname__ = classname;
     }
     if (!eventname) {
-        throw 'eventname argument cannot be empty when registering an event (EventRegistry.register)';
+        ;;; kukit.E = 'eventname argument cannot be empty when registering an event (EventRegistry.register)';
+        throw kukit.E;
     }
     var key = this._getKey(namespace, eventname);
     var entry = this.content[key];
@@ -100,16 +104,24 @@
         if (key[0] == '-') {
             key = key.substring(1);
         }
-        throw 'In EventRegistry.register double registration of key "' + key + '"';
+        ;;; kukit.E = 'In EventRegistry.register double registration of key "' + key + '"';
+        throw kukit.E;
     }
     // check bindmethodname and defaultactionmethodname
-    if (bindmethodname && ! klass.prototype[bindmethodname])
-        throw 'In EventRegistry.register bind method "' + bindmethodname + '" is undefined for event "' + eventname + '" namespace "' + namespace + '"';
-    if (defaultactionmethodname && ! klass.prototype[defaultactionmethodname])
-        throw 'In EventRegistry.register default action method "' + defaultactionmethodname + '" is undefined for event "' + eventname + '" namespace "' + namespace + '"';
+    if (bindmethodname && ! klass.prototype[bindmethodname]) {
+        ;;; kukit.E = 'In EventRegistry.register bind method "' + bindmethodname;
+        ;;; kukit.E += '" is undefined for event "' + eventname + '" namespace "' + namespace + '"';
+        throw kukit.E;
+    }
+    if (defaultactionmethodname && ! klass.prototype[defaultactionmethodname]) {
+        ;;; kukit.E = 'In EventRegistry.register default action method "' + defaultactionmethodname;
+        ;;; kukit.E += '" is undefined for event "' + eventname + '" namespace "' + namespace + '"';
+        throw kukit.E;
+    }
     // check the iterator.
     if  (! kukit.er.getBindIterator(itername)) {
-        throw 'In EventRegistry.register unknown bind iterator "' + itername + '"';
+        ;;; kukit.E = 'In EventRegistry.register unknown bind iterator "' + itername + '"';
+        throw kukit.E;
     }
     // register it
     this.content[key] = {
@@ -157,7 +169,8 @@
     if (namespace == null) {
         namespace = '';
     } else if (namespace.split('-') > 1) {
-        throw 'In EventRegistry.register namespace cannot contain -';
+        ;;; kukit.E = 'In EventRegistry.register namespace cannot contain -';
+        throw kukit.E;
     }
     return namespace + '-' + eventname;
 };
@@ -172,11 +185,14 @@
     var key = this._getKey(namespace, eventname);
     var entry = this.content[key];
     if (typeof(entry) == 'undefined') {
-        if (key[0] == '-') {
-            key = key.substring(1);
-            throw 'Error : undefined global event key ' + key + ' (or maybe namespace is missing?)';
+        if (key.substr(0, 1) == '-') {
+            ;;; key = key.substring(1);
+            ;;; kukit.E = 'Error : undefined global event key ';
+            ;;; kukit.E += key + ' (or maybe namespace is missing?)';
+            throw kukit.E;
         } else {
-            throw 'Error : undefined event key ' + key;
+            ;;; kukit.E = 'Error : undefined event key ' + key;
+            throw kukit.E;
         }
     } 
     return entry;
@@ -263,7 +279,7 @@
 * so we create a new oper below
 */
 
-kukit.er.EventBinder__continue_event__ = function(name, node, parms) {
+kukit.er.EventBinder__continue_event__ = function(name, node, defaultparms) {
     // Trigger a continuation event bound to a given state instance, given node
     // (or on document, if node = null)
     //
@@ -290,18 +306,18 @@
             // XXX this case should go away, as we should check this already from binding time
             // and signal the appropriate error.
             // Also note that behaviour roles will only be allowed for "non-binding" events.
-            kukit.logError('Behaviour rule for continuation event "' + name + '" will be ignored, because we found an explicit rule.');
+            ;;; kukit.logError('Behaviour rule for continuation event "' + name + '" will be ignored, because we found an explicit rule.');
         }
     }
     // If parameters are specified in the call, use them.
-    if (typeof(parms) != 'undefined') {
-        oper.parms = parms;
+    if (typeof(defaultparms) != 'undefined') {
+        oper.defaultparms = defaultparms;
     } else {
-        oper.parms = {};
+        oper.defaultparms = {};
     }
     // (if eventrule is null here, we can yet have the default method, so go on.)
     this._EventBinder_triggerevent(name, oper);
-    kukit.logDebug('Continuation event "' + name + '" executed on same node.');
+    ;;; kukit.logDebug('Continuation event "' + name + '" executed on same node.');
 };
 
 kukit.er.EventBinder__continue_event_allnodes__ = function(name, parms) {
@@ -313,7 +329,7 @@
     // each on the node that it selects - not on the original node.
     var oper = new kukit.op.Oper();
     var info = kukit.engine.binderInfoRegistry.getBinderInfoById(this.__binder_id__);
-    var opers = info.getBoundOpers(name);
+    var opers = info.bound.getBoundOpers(name);
     for (var i=0; i<opers.length; i++) {
         var oper = opers[i];
         var newoper = oper.clone();
@@ -325,7 +341,7 @@
         this._EventBinder_triggerevent(name, newoper);
         executed += 1;
     }
-    kukit.logDebug('Event "' + name + '" executed on ' + executed + ' nodes.');
+    ;;; kukit.logDebug('Event "' + name + '" executed on ' + executed + ' nodes.');
 };
 
 kukit.er.EventBinder_makeFuncToBind = function(name, node) {
@@ -344,7 +360,7 @@
 
 kukit.er.LateBinder.prototype.executeActions = function() {
     if (! this.bound) {
-        kukit.log('Attempt of late binding for event ' + this.name + ', node ' + this.node.nodeName);
+        ;;; kukit.log('Attempt of late binding for event ' + this.name + ', node ' + this.node.nodeName);
         if (kukit.hasFirebug) {
             kukit.log(this.node);
         }
@@ -356,9 +372,9 @@
             this.bound = function() {
                 this.binderinstance._EventBinder_triggerevent(this.name, oper);
             };
-            kukit.log('node bound');
+            ;;; kukit.log('node bound');
         } else {
-            kukit.logWarning('no node bound');
+            ;;; kukit.logWarning('no node bound');
             this.bound = function() {};
         }
     }
@@ -375,12 +391,15 @@
     } else {
         // In case there is no event rule, just call the default event action.
         var namespace = this.__event_namespace__;
-        kukit.logDebug('Calling implicit event "' + name + '" on namespace "' + namespace + '"');
+        ;;; kukit.logDebug('Calling implicit event "' + name + '" on namespace "' + namespace + '"');
         var success = oper.executeDefaultAction(name, true);
         if (! success) {
             // instead of the standard message give more specific reason:
             // either way we should have executed something...
-            throw 'Could not trigger event name "' + name + '" on namespace "' + namespace + '", because there is neither an explicit kss rule, nor a default method';
+            ;;; kukit.E = 'Could not trigger event name "' + name;
+            ;;; kukit.E += '" on namespace "' + namespace;
+            ;;; kukit.E += '", because there is neither an explicit kss rule, nor a default method';
+            throw kukit.E;
         }
     }
 };
@@ -392,7 +411,10 @@
     // (called from oper)
     var method = this[methodname];
     if (! method) {
-        throw 'Could not trigger event name "' + name + '" on namespace "' + namespace + '", because the method "' + methodname + '" does not exist.';
+        ;;; kukit.E = 'Could not trigger event name "' + name;
+        ;;; kukit.E += '" on namespace "' + namespace;
+        ;;; kukit.E += '", because the method "' + methodname + '" does not exist.';
+        throw kukit.E;
     }
     // call it
     oper.binderinstance = this;
@@ -424,7 +446,7 @@
     var binderinfo = this.info[id];
     if (typeof(binderinfo) == 'undefined') {
         // Create a new event.
-        kukit.logDebug('instantiating event id=' + id + ', classname=' + classname + ', namespace=' + namespace);
+        ;;; kukit.logDebug('instantiating event id=' + id + ', classname=' + classname + ', namespace=' + namespace);
         binderinstance = new (kukit.eventsGlobalRegistry.getBinder(classname))();
         
         binderinfo = this.info[id] = new kukit.er.BinderInfo(binderinstance);
@@ -437,8 +459,9 @@
         //binderinstance.__bound_rules__ = [];
     } else if (binderinfo.getBinderInstance().__binder_classname__ != classname) {
         // just paranoia
-        throw 'Conflicting class for event id "' + id + '", "' + binderinfo.getBinderInstance().__binder_classname__
-                + '" != "' + classname + '"';
+        ;;; kukit.E = 'Conflicting class for event id "' + id + '", "';
+        ;;; kukit.E += binderinfo.getBinderInstance().__binder_classname__ + '" != "' + classname + '"';
+        throw kukit.E;
     }
     return binderinfo;
 };
@@ -447,7 +470,8 @@
     // Get an event.
     var binderinfo = this.info[id];
     if (typeof(binderinfo) == 'undefined') {
-        throw 'Event with id "' + id + '" not found.';
+        ;;; kukit.E = 'Event with id "' + id + '" not found.';
+        throw kukit.E;
     }
     return binderinfo;
 };
@@ -459,7 +483,9 @@
     var id = kukit.rd.makeId(namespace, classname);
     var binderinfo = this.info[id];
     if (typeof(binderinfo) == 'undefined') {
-        throw 'Singleton event with namespace "' + namespace + '" and (event) name "' + name + '" not found.';
+        ;;; kukit.E = 'Singleton event with namespace "' + namespace;
+        ;;; kukit.E += '" and (event) name "' + name + '" not found.';
+        throw kukit.E;
     }
     return binderinfo;
 };
@@ -522,7 +548,7 @@
 kukit.er.BinderInfo.prototype.processBindingEvents = function () {
     // We came to the end of the binding phase. Now we process all our binding
     // events, This will do the actual binding on the browser side.
-    this.binding.processBindingEvents(this.binderinstance)
+    this.binding.processBindingEvents(this.binderinstance);
     // Now we to add these to the new ones.
     this.binding.propagateTo(this.bound);
     // Delete them from the registry, to protect against accidents.
@@ -573,7 +599,8 @@
         // Create an empty list.
         rules_per_name = info[name] = {};
     } else if (typeof(rules_per_name[nodehash]) != 'undefined') {
-        throw 'Mismatch in bind registry, ' + name + ' already bound to node in this instance.'; 
+        ;;; kukit.E = 'Mismatch in bind registry, ' + name + ' already bound to node in this instance.'; 
+        throw kukit.E;
     }
     return rules_per_name;
 };
@@ -660,11 +687,11 @@
 kukit.er.OperRegistry.prototype.call_bind_method = function (eventset, binderinstance, p1, p2, p3, p4, p5, p6) {
     var method = binderinstance[eventset.bindmethodname];
     // Protect the binding for better logging
-    try {
+    ;;; try {
         method.call(binderinstance, p1, p2, p3, p4, p5, p6);
-    } catch(e) {
-        throw new kukit.err.rd.EventBindError('Error during binding, reason: [' + e + ']',  eventset.names, eventset.namespace);
-    }
+    ;;; } catch(e) {
+    ;;;     throw new kukit.err.rd.EventBindError('Error during binding, reason: [' + e + ']',  eventset.names, eventset.namespace);
+    ;;; }
 };
 
 // This calls the bind method by each bound oper one by one. Eventname and func_to_bind are passed too.
@@ -718,19 +745,52 @@
         var rules_per_node = this.infopernode[nodehash];
         // filter only the events we are interested in
         var filtered_rules = {};
-        var found = false;
+        var foundoper = false;
         for (var i=0; i<eventset.names.length; i++) {
             var name = eventset.names[i];
             var oper = rules_per_node[name];
             if (typeof(oper) != 'undefined') {
                 filtered_rules[name] = oper;
-                found = true;
+                foundoper = oper;
             }
         }
         // call it
-        if (found) {
-            this.call_bind_method(eventset, binderinstance, filtered_rules);
+        // All opers have the same node, the last one is yet in foundoper, so
+        // we use it as a second parameter to the call.
+        // The method may or may not want to use this.
+        if (foundoper) {
+            this.call_bind_method(eventset, binderinstance, filtered_rules, foundoper.node);
+        }
+    }
+};
+
+// This calls the bind method once per instance, by a list of
+// items, where item.node is the node and item.opers_by_eventname nodehash:item
+// in item there is item.node and item.opers_by_eventname
+kukit.er.OperRegistry.prototype.iter_allnodes = function (eventset, binderinstance) {
+    var items = [];
+    var has_result = false;
+    for (var nodehash in this.infopernode) {
+        var rules_per_node = this.infopernode[nodehash];
+        // filter only the events we are interested in
+        var filtered_rules = {};
+        var foundoper = false;
+        for (var i=0; i<eventset.names.length; i++) {
+            var name = eventset.names[i];
+            var oper = rules_per_node[name];
+            if (typeof(oper) != 'undefined') {
+                filtered_rules[name] = oper;
+                foundoper = oper;
+            }
         }
+        if (foundoper) {
+            items.push({node: foundoper.node, opers_by_eventname: filtered_rules});
+            has_result = true;
+        }
+    }
+    // call the binder method
+    if (has_result) {
+        this.call_bind_method(eventset, binderinstance, items);
     }
 };
 

Modified: kukit/kukit.js/trunk/kukit/forms.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/forms.js	(original)
+++ kukit/kukit.js/trunk/kukit/forms.js	Mon Jun 11 18:04:11 2007
@@ -121,7 +121,7 @@
 kukit.fo.CurrentFormLocator.prototype.getForm = function() {
     var form = this.queryForm();
     if (!form) {
-        kukit.logWarning("No form found");
+        ;;; kukit.logWarning("No form found");
         return null;
     }
     return form;
@@ -195,13 +195,13 @@
     var element = form[name];
     if (element) {
         var value = kukit.fo.getValueOfFormElement(element);
-        if (value == null) {
-            kukit.logWarning('Form element not harvested: '+element.tagName);
-        } else {
-            kukit.logDebug("Form element ("+element.tagName+"): name="+element.name+", value="+value);
-        }
-    } else {
-        kukit.logWarning('Form element '+ name + '" not found in form.');
+        ;;; if (value != null) {
+        ;;;    kukit.logDebug("Form element ("+element.tagName+"): name="+element.name+", value="+value);
+        ;;; // } else {
+        ;;; //   kukit.logWarning('Form element not harvested: '+element.tagName);
+        ;;; }
+    ;;; } else {
+    ;;;     kukit.logWarning('Form element '+ name + '" not found in form.');
     }
     return value;
 };
@@ -216,11 +216,11 @@
     for (var y=0; y<elements.length; y++) {
         var element = elements[y];
         var value = kukit.fo.getValueOfFormElement(element);
-        if (value == null) {
-            kukit.logWarning('Form element not harvested: '+element.tagName);
-        } else {
-            kukit.logDebug("Form element ("+element.tagName+"): name="+element.name+", value="+value);
+        if (value != null) {
+            ;;; kukit.logDebug("Form element ("+element.tagName+"): name="+element.name+", value="+value);
             collector.add(element.name, value);
+        ;;; // } else {
+        ;;; //    kukit.logWarning('Form element not harvested: '+element.tagName);
         }
     }
     return collector.result;
@@ -247,7 +247,8 @@
 kukit.fo.FieldUpdateRegistry.prototype.register = function(node, editor) {
     var hash = kukit.rd.hashnode(node);
     if (typeof(this.editors[hash]) != 'undefined') {
-        throw 'Double registration of editor update on node.';
+        ;;; kukit.E = 'Double registration of editor update on node.';
+        throw kukit.E;
     }
     this.editors[hash] = editor;
     //kukit.logDebug('Registered '+node.name + ' hash=' + hash);
@@ -277,11 +278,15 @@
 
 kukit.fo.FormPP = function() {};
 kukit.fo.FormPP.prototype = {
+    /*
+    ;;; */
     check: function(args) {
         if (args.length != 1) {
-            throw 'form method needs 1 arguments (formname)';
+           throw 'form method needs 1 arguments (formname)';
         }
     },
+    /*
+    */
     eval: function(args, node) {
         return kukit.fo.getAllFormVars(new kukit.fo.NamedFormLocator(args[0]), new kukit.ut.TupleCollector());
     }
@@ -290,11 +295,15 @@
 
 kukit.fo.CurrentFormPP = function() {};
 kukit.fo.CurrentFormPP.prototype = {
+    /*
+    ;;; */
     check: function(args) {
         if (args.length != 0) {
             throw 'currentForm method needs no argument';
         }
     },
+    /*
+    */
     eval: function(args, node) {
         return kukit.fo.getAllFormVars(new kukit.fo.CurrentFormLocator(node), new kukit.ut.TupleCollector());
     }
@@ -309,27 +318,27 @@
 /* BBB. To be deprecated at 2007-06-15 */
 
 kukit.fo.getCurrentForm = function(target) {
-    kukit.logWarning('Deprecated kukit.fo.getCurrentForm(target), new kukit.fo.CurrentFormLocator(target).getForm() instead!');
+    ;;; kukit.logWarning('Deprecated kukit.fo.getCurrentForm(target), new kukit.fo.CurrentFormLocator(target).getForm() instead!');
     return new kukit.fo.CurrentFormLocator(target).getForm();
 };
 
 kukit.fo.getFormVarFromCurrentForm = function(target, name) {
-    kukit.logWarning('Deprecated kukit.fo.getFormVarFromCurrentForm(target, name), use kukit.fo.getFormVar(new kukit.fo.CurrentFormLocator(target), name) instead!');
+    ;;; kukit.logWarning('Deprecated kukit.fo.getFormVarFromCurrentForm(target, name), use kukit.fo.getFormVar(new kukit.fo.CurrentFormLocator(target), name) instead!');
     return kukit.fo.getFormVar(new kukit.fo.CurrentFormLocator(target), name);
 };
 
 kukit.fo.getFormVarFromNamedForm = function(formname, name) {
-    kukit.logWarning('Deprecated kukit.fo.getFormVarFromNamedForm(formname, name), use kukit.fo.getFormVar(new kukit.fo.NamedFormLocator(formname), name) instead!');
+    ;;; kukit.logWarning('Deprecated kukit.fo.getFormVarFromNamedForm(formname, name), use kukit.fo.getFormVar(new kukit.fo.NamedFormLocator(formname), name) instead!');
     return kukit.fo.getFormVar(new kukit.fo.NamedFormLocator(formname), name);
 };
 
 kukit.fo.getAllFormVarsFromCurrentForm = function(target) {
-    kukit.logWarning('Deprecated kukit.fo.getAllFormVarsFromCurrentForm(target), use kukit.fo.getAllFormVars(new kukit.fo.CurrentFormLocator(target), new kukit.ut.DictCollector()) instead!');
+    ;;; kukit.logWarning('Deprecated kukit.fo.getAllFormVarsFromCurrentForm(target), use kukit.fo.getAllFormVars(new kukit.fo.CurrentFormLocator(target), new kukit.ut.DictCollector()) instead!');
     return kukit.fo.getAllFormVars(new kukit.fo.CurrentFormLocator(target), new kukit.ut.DictCollector());
 };
 
 kukit.fo.getAllFormVarsFromNamedForm = function(formname) {
-    kukit.logWarning('Deprecated kukit.fo.getAllFormVarsFromNamedtForm(formname), use kukit.fo.getAllFormVars(new kukit.fo.NamedFormLocator(formname), new kukit.ut.DictCollector()) instead!');
+    ;;; kukit.logWarning('Deprecated kukit.fo.getAllFormVarsFromNamedtForm(formname), use kukit.fo.getAllFormVars(new kukit.fo.NamedFormLocator(formname), new kukit.ut.DictCollector()) instead!');
     return kukit.fo.getAllFormVars(new kukit.fo.NamedFormLocator(formname), new kukit.ut.DictCollector());
 };
 

Modified: kukit/kukit.js/trunk/kukit/kssparser.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/kssparser.js	(original)
+++ kukit/kukit.js/trunk/kukit/kssparser.js	Mon Jun 11 18:04:11 2007
@@ -36,7 +36,7 @@
 kukit.kssp.colon = kukit.tk.mkToken('colon', ":");
 kukit.kssp.quote = kukit.tk.mkToken('quote', "'");
 kukit.kssp.dquote = kukit.tk.mkToken('dquote', '"');
-kukit.kssp.backslash = kukit.tk.mkToken('backslash', '\\');
+kukit.kssp.backslash = kukit.tk.mkToken('backslash', '\x5c'); 
 kukit.kssp.comma = kukit.tk.mkToken('comma', ",");
 kukit.kssp.equals = kukit.tk.mkToken('equals', "=");
 
@@ -74,8 +74,10 @@
         // We have evt- parms in the rule.
         if (block.evt_name != parser.kssSelector.name || block.evt_namespace != parser.kssSelector.namespace) {
             // XXX this should be done in another way, so that we can see where the error happened.
-            block.emitError('kss param key evt-[<namespace>-]<name>-yyy must not have different [namespace and] name then the kss selector at the top of the rule, "' 
-                    + key + '", and inside we have "' + block.evt_namespace + '-' + block.evt_name + '"');
+            ;;; kukit.E = 'kss param key evt-[<namespace>-]<name>-yyy must not have different ';
+            ;;; kukit.E += '[namespace and] name then the kss selector at the top of the rule, "';
+            ;;; kukit.E += key + '", and inside we have "' + block.evt_namespace + '-' + block.evt_name + '"';
+            block.emitError(kukit.E);
         }
     }
     // Create the event rule. (one action only)
@@ -156,20 +158,16 @@
     // default-error: <VALUE>
     //
     var splitkey = key.split('-');
-    if (splitkey.length < 2 || splitkey.length > 4) {
-        this.emitError(
-            'kss param key must be like xxx-yyy or nnn-xxx-yyy or evt-xxx-yyy or evt-nnn-xxx-yyy"'
-            + key + '"');
-    }
+    ;;; if (splitkey.length < 2 || splitkey.length > 4) {
+    ;;;     this.emitError('kss param key must be like xxx-yyy or nnn-xxx-yyy or evt-xxx-yyy or evt-nnn-xxx-yyy"' + key + '"');
+    ;;; }
     var name = splitkey[0];
     if (name == 'evt') {
         // evt-<EVTNAME>-<KEY>: <VALUE>
         // evt-<NAMESPACE>-<EVTNAME>-<KEY>: <VALUE>
-        if (splitkey.length < 3) {
-            this.emitError(
-                'kss param key must be like xxx-yyy or nnn-xxx-yyy or evt-xxx-yyy or evt-nnn-xxx-yyy"'
-                + key + '"');
-        }
+        ;;; if (splitkey.length < 3) {
+        ;;;     this.emitError('kss param key must be like xxx-yyy or nnn-xxx-yyy or evt-xxx-yyy or evt-nnn-xxx-yyy"' + key + '"');
+        ;;; }
         var enamespace;
         var ename;
         var ekey;
@@ -188,16 +186,17 @@
             // so that we can check it stays the same within the block.
             this.evt_name = ename;
             this.evt_namespace = enamespace;
-        } else {
-            if (ename != this.evt_name || enamespace != this.evt_namespace) {
-                // Do not allow deviation from the previous event names.
-                this.emitError('kss param key evt-[<namespace>-]<name>-yyy must not have different [namespace and] name inside the same rule,"' 
-                    + key + '", it must be "' + this.evt_namespace + '-' + this.evt_name + '"');
-            }
-        }
-        if (value.isMethod != false) {
-            this.emitError('evt-[nnn-]xxx-yyy: parameter producers are not allowed as value, key "' 
-                + key + '"');
+        ;;; } else {
+        ;;;     if (ename != this.evt_name || enamespace != this.evt_namespace) {
+        ;;;         // Do not allow deviation from the previous event names.
+        ;;;         kukit.E = 'kss param key evt-[<namespace>-]<name>-yyy must not have different ';
+        ;;;         kukit.E += '[namespace and] name inside the same rule,"' + key + '", it must be "';
+        ;;;         kukit.E += this.evt_namespace + '-' + this.evt_name + '"';
+        ;;;         this.emitError(kukit.E);
+        ;;;     }
+        ;;; }
+        ;;; if (value.isMethod != false) {
+        ;;;     this.emitError('evt-[nnn-]xxx-yyy: parameter producers are not allowed as value, key "' + key + '"');
         }
         // set it
         this.evt_parms[ekey] = value.txt;
@@ -207,27 +206,22 @@
         // action-client: <NAMESPACE>-<ACTIONNAME>
         // action-cancel: <ACTIONNAME>
         // action-cancel: <NAMESPACE>-<ACTIONNAME>
-        if (splitkey.length != 2) {
-            this.emitError(
-                'action-xxx must not have more "-" in it, key "' +
-                key + '"');
-        }
-        if (value.isMethod != false) {
-            this.emitError('action-xxx: parameter producers are not allowed as value, key "' 
-                + key + '"');
-        }
+        ;;; if (splitkey.length != 2) {
+        ;;;     this.emitError('action-xxx must not have more "-" in it, key "' + key + '"');
+        ;;; }
+        ;;; if (value.isMethod != false) {
+        ;;;     this.emitError('action-xxx: parameter producers are not allowed as value, key "'  + key + '"');
+        ;;; }
         var atab = {'server': 'S', 'client': 'C', 'cancel': 'X'};
         var actionType = atab[splitkey[1]];
-        if (! actionType) {
-            this.emitError('action-xxx: key must be action-server or action-client or action-cancel, key "' 
-                + key + '"');
-        }    
-        // force value to be <ACTIONNAME> or <NAMESPACE>-<ACTIONNAME>
-        var splitvalue = value.txt.split('-');
-        if (splitvalue.length > 2) {
-            this.emitError('action-xxx: value must be <ACTIONNAME> or <NAMESPACE>-<ACTIONNAME>, key "' 
-                + key + '"');
-        }
+        ;;; if (! actionType) {
+        ;;;     this.emitError('action-xxx: key must be action-server or action-client or action-cancel, key "' + key + '"');
+        ;;; }    
+        ;;; // force value to be <ACTIONNAME> or <NAMESPACE>-<ACTIONNAME>
+        ;;; var splitvalue = value.txt.split('-');
+        ;;; if (splitvalue.length > 2) {
+        ;;;     this.emitError('action-xxx: value must be <ACTIONNAME> or <NAMESPACE>-<ACTIONNAME>, key "' + key + '"');
+        ;;; }
         // set it
         var action = this.actions.getOrCreateAction(value.txt);
         if (actionType != 'X' || action.type == null) {
@@ -263,10 +257,9 @@
             case 'error': {
                     // <ACTIONNAME>-error: <VALUE>
                     // default-error: <VALUE>
-                    if (value.isMethod != false) {
-                        this.emitError('xxx-error: parameter producers are not allowed as value, key "' 
-                            + key + '"');
-                    }
+                    ;;; if (value.isMethod != false) {
+                    ;;;     this.emitError('xxx-error: parameter producers are not allowed as value, key "' + key + '"');
+                    ;;; }
                     action.setError(value.txt);
                     // also create the action for the error itself.
                     var err_action = this.actions.getOrCreateAction(value.txt);
@@ -294,7 +287,8 @@
                         // Check also sets the parameter provider on the value.
                         value.check(registry);
                     } catch(e) {
-                        throw new kukit.err.tk.ParsingError('Error in value: ' + e,  this.src.makeMarker(this.startpos));
+                        ;;; kukit.E = new kukit.err.tk.ParsingError('Error in value: ' + e,  this.src.makeMarker(this.startpos));
+                        throw kukit.E;
                     }
                 } break;
         }
@@ -322,7 +316,8 @@
     if (this.ifToken(cursor, kukit.kssp.String)) {
         // The previous txt must be all whitespace.
         if (txt) {
-            this.emitError('Excess characters before the string in property value');
+            ;;; this.emitError('Excess characters before the string in property value');
+            this.emitError('');
         }
         // the next one must be a string.
         this.expectToken(cursor, kukit.kssp.String);
@@ -330,7 +325,8 @@
     } else if (this.ifToken(cursor, kukit.kssp.MethodArgs)) {
         // see if not empty and has no spaces in it 
         if (! txt || txt.indexOf(' ') != -1) {
-            this.emitError('Method property value must have a one-word method name');
+            ;;; this.emitError('Method property value must have a one-word method name');
+            this.emitError('');
         }
         // the next one must be the params
         this.expectToken(cursor, kukit.kssp.MethodArgs);
@@ -338,7 +334,8 @@
     } else {
         // not a string or method: check if we allowed multiword.
         if (! this.multiword_allowed && txt.indexOf(' ') != -1) {
-            this.emitError('Property value must be one word');
+            ;;; this.emitError('Property value must be one word');
+            this.emitError('');
         }
         this.produceTxt(txt);
     }
@@ -347,7 +344,8 @@
         this.digestTxt(cursor, kukit.tk.Fraction, kukit.kssp.Comment);
         // we have to be at the end and have no text after
         if (cursor.next < this.result.length || cursor.txt) {
-            this.emitError('Excess characters after the property value');
+            ;;; this.emitError('Excess characters after the property value');
+            this.emitError('');
         }
     }
     this.result = [];
@@ -409,7 +407,7 @@
 */
 kukit.kssp.String = kukit.tk.mkParser('string', {
     "'": 'this.emitAndReturn(new kukit.kssp.quote(this.src))',
-    "\\": 'new kukit.kssp.Backslashed(this.src, kukit.kssp.backslash)'
+    '\x5c': 'new kukit.kssp.Backslashed(this.src, kukit.kssp.backslash)'
     });
 kukit.kssp.String.prototype.process = function() {
     // collect up the value of the string, omitting the quotes
@@ -424,7 +422,7 @@
 */
 kukit.kssp.String2 = kukit.tk.mkParser('string', {
     '"': 'this.emitAndReturn(new kukit.kssp.dquote(this.src))',
-    "\\": 'new kukit.kssp.Backslashed(this.src, kukit.kssp.backslash)'
+    '\x5c': 'new kukit.kssp.Backslashed(this.src, kukit.kssp.backslash)'
     });
 kukit.kssp.String2.prototype.process = kukit.kssp.String.prototype.process; 
 
@@ -438,7 +436,8 @@
     var src = this.src;
     var length = src.text.length;
     if (length < src.pos + 1) {
-        this.emitError('Missing character after backslash');
+        ;;; this.emitError('Missing character after backslash');
+        this.emitError('');
     } else { 
         this.result.push(new kukit.tk.Fraction(src, src.pos+1));
         this.src.pos += 1;
@@ -476,7 +475,8 @@
         } else {
             // Just a value, must be one word then.
             if (value.indexOf(' ') != -1) {
-                this.emitError('Argument value must be one word or a string');
+                ;;; this.emitError('Argument value must be one word or a string');
+                this.emitError('');
             }
         }
         this.args.push(value);
@@ -517,7 +517,8 @@
                     tokenindex -= 1;
                 } else {
                     // Error.
-                    this.emitError('Kss event selector must end with an event qualifier :event or :event(id)');
+                    ;;; this.emitError('Kss event selector must end with an event qualifier :event or :event(id)');
+                    this.emitError('');
                 }
             } break;
             case kukit.kssp.Comment.prototype.symbol: {
@@ -534,7 +535,8 @@
             || this.result[tokenindex+2].symbol != kukit.kssp.PropValueInPseudo.prototype.symbol
             || this.result[tokenindex+1].symbol != kukit.kssp.colon.prototype.symbol
             || this.result[tokenindex].symbol != kukit.tk.Fraction.prototype.symbol) {
-        this.emitError('Kss event selector must end with an event qualifier :event or :event(id)');
+        ;;; this.emitError('Kss event selector must end with an event qualifier :event or :event(id)');
+        this.emitError('');
     }
     // See that the last fraction does not end with space.
     var lasttoken = this.result[tokenindex];
@@ -542,13 +544,16 @@
     var pseudotoken = this.result[tokenindex+2];
     var txt = lasttoken.txt;
     if (txt.match(/[\r\n\t ]$/) != null) {
-        this.emitError('In kss event selector no space can be before the colon');
+        ;;; this.emitError('In kss event selector no space can be before the colon');
+        this.emitError('');
     }
     if (! pseudotoken.value.methodname) {
-        this.emitError('Kss event selector must have a one-word name after the colon');
+        ;;; this.emitError('Kss event selector must have a one-word name after the colon');
+        this.emitError('');
     }
     if (pseudotoken.value.args.length > 1) {
-        this.emitError('Kss pseudo value must not have more then one parameters');
+        ;;; this.emitError('Kss pseudo value must not have more then one parameters');
+        this.emitError('');
     }
     css = this.src.text.substring(this.startpos, commatoken.startpos);
     //print ('>>' + css + ':' + pseudotoken.value.methodname);
@@ -572,22 +577,23 @@
     var splitname = name.split('-');
     var namespace = null;
     if (splitname.length > 2) {
-        this.emitError('Kss event selector must be name or namespace-name but no more dashes, "' + name + '"');
+        ;;; this.emitError('Kss event selector must be name or namespace-name but no more dashes, "' + name + '"');
+        this.emitError('');
     } else if (splitname.length == 2) { 
         name = splitname[1];
         namespace = splitname[0];
     }
     // Protect the error for better logging
-    try {
+    ;;; try {
         this.kssSelector = new kukit.rd.KssSelector(isEvent, css, name, namespace, id);
-    } catch(e) {
-        if (e.name == 'KssSelectorError') {
-            // Log the message
-            this.emitError(e.toString());
-        } else {
-            throw e;
-        }
-    }
+    ;;; } catch(e) {
+    ;;;     if (e.name == 'KssSelectorError') {
+    ;;;         // Log the message
+    ;;;         this.emitError(e.toString());
+    ;;;     } else {
+    ;;;         throw e;
+    ;;;     }
+    ;;; }
     this.txt = '';
     this.result = [];
 };
@@ -619,12 +625,12 @@
     for (var i=0; i<parser.eventRules.length; i++) {
         var rule = parser.eventRules[i];
         // finish up the kss on it
-        try {
+        ;;; try {
             rule.kss_selector.setIdAndClass();
-        } catch(e) {
-            // foolishly, we don't know the position at this point
-            throw new kukit.err.tk.ParsingError('Undefined event name="' + rule.kss_selector.name + '", namespace="' + rule.kss_selector.namespace + '"');
-        }
+        ;;; } catch(e) {
+        ;;;     // foolishly, we don't know the position at this point
+        ;;;     throw new kukit.err.tk.ParsingError('Undefined event name="' + rule.kss_selector.name + '", namespace="' + rule.kss_selector.namespace + '"');
+        ;;; }
         kukit.engine.rules.push(rule);
     }
 };

Modified: kukit/kukit.js/trunk/kukit/kukit.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/kukit.js	(original)
+++ kukit/kukit.js/trunk/kukit/kukit.js	Mon Jun 11 18:04:11 2007
@@ -107,8 +107,7 @@
     }
     // BBB to be removed after 2008-02-17
     if (rel=="kukit" || rel=="k-stylesheet") {
-        kukit.logWarning(node.href + ': rel "' + rel +
-            '" is deprecated; use "kinetic-stylesheet" instead.');
+        ;;; kukit.logWarning(node.href + ': rel "' + rel +'" is deprecated; use "kinetic-stylesheet" instead.');
         return true;
     }
     return false;
@@ -140,27 +139,28 @@
     var deferred_setup_events = function() {
         self._setupEvents(in_nodes);
     };
-    var targetmsg;
+    ;;; var targetmsg;
     var found = false;
     if ( ! in_nodes) {
-        targetmsg = 'document';
+    ;;;     targetmsg = 'document';
         found = true;
     } else {
-        targetmsg = 'node subtrees ';
+    ;;;     targetmsg = 'node subtrees ';
         for (var i=0; i<in_nodes.length; i++) {
             var node = in_nodes[i];
             if (node.nodeType == 1) {
                 if (! found) {
                     found = true;
-                } else {
-                    targetmsg += ', '; 
+    ;;;             } else {
+    ;;;                 targetmsg += ', '; 
                 }
-                targetmsg += node.tagName.toLowerCase();
+    ;;;             targetmsg += node.tagName.toLowerCase();
             }
         }
     }
     if (found) {
-        this.bindScheduler.addPre(deferred_setup_events, 'setting up events for ' + targetmsg);
+        ;;; kukit.E = 'setting up events for ' + targetmsg;
+        this.bindScheduler.addPre(deferred_setup_events, kukit.E);
     }
 };
 
@@ -192,7 +192,7 @@
 kukit.Engine.prototype.initializeRules = function() {
     if (window.kukitRulesInitializing || window.kukitRulesInitialized) {
         // Refuse to initialize a second time.
-        kukit.log('Subsequent call to initializeRules is ignored !');
+        ;;; kukit.log('Subsequent call to initializeRules is ignored !');
         return;
     }
     // Succesful initialization. At the moment the engine is kept
@@ -201,51 +201,51 @@
     window.kukitRulesInitializing = true;
     // load the rulesheets
     var rulelinks = this.getRuleSheetLinks();
-    kukit.log("Count of KSS links: " + rulelinks.length);
+    ;;; kukit.log("Count of KSS links: " + rulelinks.length);
     for (var i=0; i<rulelinks.length; i++) {
         var rulelink = rulelinks[i];
         var ruleProcessorClass = this._ruleProcessorClasses[rulelink.res_type];
         if (ruleProcessorClass) {
-            kukit.log("Start loading and processing " + rulelink.href + " resource type " + rulelink.res_type);
+            ;;; kukit.log("Start loading and processing " + rulelink.href + " resource type " + rulelink.res_type);
             var ruleprocessor = new ruleProcessorClass(rulelink.href);
-            var ts_start = (new Date()).valueOf();
+            ;;; var ts_start = (new Date()).valueOf();
             ruleprocessor.load();
-            var ts_loaded = (new Date()).valueOf();
-            try {
+            ;;; var ts_loaded = (new Date()).valueOf();
+            ;;; try {
                 ruleprocessor.parse();
-            } catch(e) {
-                // ParsingError are logged.
-                if (e.name == 'ParsingError') {
-                    var msg = 'Error parsing ' + rulelink.res_type + ' at ' + rulelink.href + ' : ' + e.toString();
-                    // Log the message
-                    kukit.logFatal(msg);
-                    // and throw it...
-                    throw msg;
-                } else {
-                    throw e;
-                }
-            }
-            var ts_end = (new Date()).valueOf();
-            kukit.log("Finished loading and processing " + rulelink.href + " resource type " + rulelink.res_type + ' in ' + (ts_loaded - ts_start) + ' + ' + (ts_end - ts_loaded) + ' ms');
+            ;;; } catch(e) {
+            ;;;    // ParsingError are logged.
+            ;;;    if (e.name == 'ParsingError') {
+            ;;;        var msg = 'Error parsing ' + rulelink.res_type + ' at ' + rulelink.href + ' : ' + e.toString();
+            ;;;        // Log the message
+            ;;;        kukit.logFatal(msg);
+            ;;;        // and throw it...
+            ;;;        throw msg;
+            ;;;    } else {
+            ;;;        throw e;
+            ;;;    }
+            ;;; }
+            ;;; var ts_end = (new Date()).valueOf();
+            ;;; kukit.log("Finished loading and processing " + rulelink.href + " resource type " + rulelink.res_type + ' in ' + (ts_loaded - ts_start) + ' + ' + (ts_end - ts_loaded) + ' ms');
             this._ruleProcessors[this._ruleProcessors.length] = ruleprocessor;
-        } else {
-            kukit.logError("Ignoring rulesheet " + rulelink.href + ' of type ' + rulelink.res_type);
+        ;;; } else {
+        ;;;    kukit.logError("Ignoring rulesheet " + rulelink.href + ' of type ' + rulelink.res_type);
         }
     }
-    try {
+    ;;; try {
         this.setupEvents();
-    } catch(e) {
-        // Event setup errors are logged.
-        if (e.name == 'RuleMergeError' || e.name == 'EventBindError') {
-            var msg = 'Error setting up events: ' + e.toString();
-            // Log the message
-            kukit.logFatal(msg);
-            // and throw it...
-            throw msg;
-        } else {
-            throw e;
-        }
-    }
+    ;;; } catch(e) {
+    ;;;     // Event setup errors are logged.
+    ;;;     if (e.name == 'RuleMergeError' || e.name == 'EventBindError') {
+    ;;;        var msg = 'Error setting up events: ' + e.toString();
+    ;;;         // Log the message
+    ;;;         kukit.logFatal(msg);
+    ;;;         // and throw it...
+    ;;;         throw msg;
+    ;;;     } else {
+    ;;;         throw e;
+    ;;;     }
+    ;;; }
     window.kukitRulesInitializing = false;
     window.kukitRulesInitialized = true;
 };
@@ -257,7 +257,7 @@
  */
 
 kukit.initializeRules = function() {
-    kukit.logWarning('Deprecated kukit.initializeRules, use kukit.bootstrap instead!');
+    ;;; kukit.logWarning('Deprecated kukit.initializeRules, use kukit.bootstrap instead!');
     kukit.bootstrap();
 };
 
@@ -275,7 +275,7 @@
     // Subsequent activations will not delete the already set up engine.
     // Subsequent activations may happen, if more event handlers are set up,
     // and the first one will do the job, the later ones are ignored.
-    kukit.log('bootstrap');
+    ;;; kukit.log('bootstrap');
     engine.initializeRules();
 };
 
@@ -286,7 +286,7 @@
     // Subsequent activations may happen, if more event handlers are set up,
     // and the first one will do the job, the later ones are ignored.
     engine.initializedOnDOMLoad = true;
-    kukit.log('bootstrap from DOMLoad');
+    ;;; kukit.log('bootstrap from DOMLoad');
     engine.initializeRules();
 };
 

Modified: kukit/kukit.js/trunk/kukit/oper.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/oper.js	(original)
+++ kukit/kukit.js/trunk/kukit/oper.js	Mon Jun 11 18:04:11 2007
@@ -77,10 +77,9 @@
         return;
     }
     for (var key in dict) {
-        if (restricted && (key == 'node' || key == 'parms' || key == 'eventrule' 
-                || key == 'binderinstance' || key == 'orignode')) {
-            throw 'Illegal update on oper object, protected attribute "' + key + '"';
-        }
+        ;;; if (restricted && (key == 'node' || key == 'parms' || key == 'eventrule' || key == 'binderinstance' || key == 'orignode')) {
+        ;;;    throw 'Illegal update on oper object, protected attribute "' + key + '"';
+        ;;; }
         var value = dict[key];
         if (typeof(value) != 'function') {
             this[key] = value;
@@ -89,19 +88,19 @@
 };
 
 kukit.op.Oper.prototype.logDebug = function() {
-    var result = [];
-    for (var key in this){
-        if (key == 'parms') {
-            var res2 = [];
-            for (var k2 in this.parms){
-                res2.push(k2 + '="' + this.parms[k2] + '"');
-            }
-            result.push('parms={' + res2.join(',') + '}');
-        } else if (typeof(kukit.op.Oper.prototype[key]) == 'undefined') {
-            result.push(key + '=' + this[key]);
-        }
-    }
-    kukit.logDebug('Oper contents: ' + result.join(', '));
+;;;     var result = [];
+;;;     for (var key in this){
+;;;         if (key == 'parms') {
+;;;             var res2 = [];
+;;;             for (var k2 in this.parms){
+;;;                 res2.push(k2 + '="' + this.parms[k2] + '"');
+;;;             }
+;;;             result.push('parms={' + res2.join(',') + '}');
+;;;         } else if (typeof(kukit.op.Oper.prototype[key]) == 'undefined') {
+;;;             result.push(key + '=' + this[key]);
+;;;         }
+;;;     }
+;;;     kukit.logDebug('Oper contents: ' + result.join(', '));
 };
 
 kukit.op.Oper.prototype.executeClientAction = function(name) {
@@ -115,52 +114,54 @@
                 nodes = this.aparms[key];
             } break;
             default: {
-                throw 'No kss parameter "' + key + '" allowed in action-client. (Normal parameters cannot start with kss.)';
+               ;;; kukit.E = 'No kss parameter "' + key + '" allowed in action-client.';
+               ;;; kukit.E += ' (Normal parameters cannot start with kss.)';
+               throw kukit.E;
             } break;
         }
     }
     //
     // XXX TODO refactor this with commands execution (or the other way)
-    var nodetext = function(node) {
-        if (node) {
-            return node.tagName.toLowerCase();
-        } else {
-            return 'DOCUMENT';
-        }
-    };
+    ;;; var nodetext = function(node) {
+    ;;;     if (node) {
+    ;;;         return node.tagName.toLowerCase();
+    ;;;     } else {
+    ;;;         return 'DOCUMENT';
+    ;;;     }
+    ;;; };
     var executeActions = kukit.actionsGlobalRegistry.get(name);
     if (nodes != null) { 
-        kukit.logDebug('action Selector type selected nodes:' + nodes.length);
-        if (!nodes || nodes.length == 0) {
-            kukit.logWarning('action Selector found no nodes');
-        }
+        ;;; kukit.logDebug('action Selector type selected nodes:' + nodes.length);
+        ;;; if (!nodes || nodes.length == 0) {
+        ;;;     kukit.logWarning('action Selector found no nodes');
+        ;;; }
         for (var i=0; i < nodes.length; i++) {
             this.node = nodes[i];
             //XXX error handling for wrong command name
             //kukit.logDebug('action Name: ' + this.name);
-            kukit.logDebug('action Name: ' + name + ' executing on target (' + (i+1) +  '/' + nodes.length +  '): ' + nodetext(this.node));
+            ;;; kukit.logDebug('action Name: ' + name + ' executing on target (' + (i+1) +  '/' + nodes.length +  '): ' + nodetext(this.node));
             executeActions(this);
         }
     } else {
         // single node
-        kukit.logDebug('action Name: ' + name + ' executing on single target ' + nodetext(this.node));
+        ;;; kukit.logDebug('action Name: ' + name + ' executing on single target ' + nodetext(this.node));
         executeActions(this);
     }
 };
 
 kukit.op.Oper.prototype.executeDefaultAction = function(name, optional) {
     // Check kss action parameters
-    for (key in this.aparms) {
-        throw 'No kss parameter "' + key + '" allowed in action-default. (Normal parameters cannot start with kss.)';
-    }
+    ;;; for (key in this.aparms) {
+    ;;;    throw 'No kss parameter "' + key + '" allowed in action-default. (Normal parameters cannot start with kss.)';
+    ;;; }
     //
     var namespace = this.binderinstance.__event_namespace__;
     var methodname = kukit.eventsGlobalRegistry.get(namespace, name).defaultactionmethodname;
     var success = false;
     if (! methodname) {
-        if (! optional) {
-            throw 'Could not trigger event name "' + name + '" on namespace "' + namespace + '", because this event has no default method.';
-        }
+        ;;; if (! optional) {
+        ;;;     throw 'Could not trigger event name "' + name + '" on namespace "' + namespace + '", because this event has no default method.';
+        ;;; }
     } else {
         this.binderinstance._EventBinder_callmethod(namespace, name, this, methodname);
         success = true;
@@ -169,20 +170,15 @@
 };
 
 kukit.op.Oper.prototype.executeServerAction = function(name) {
-    for (key in this.aparms) {
-        switch (key) {
-            case 'kssUrl': {
-                // Value will be evaluated.
-            } break;
-            case 'kssSubmitForm': {
-                // Value will be evaluated.
-            } break;
-            default: {
-                throw 'No kss parameter "' + key + '" allowed in action-server. (Normal parameters cannot start with kss.)';
-            } break;
-        }
-    }
-
+    ;;; for (key in this.aparms) {
+    ;;;     if (key == 'kssUrl') {
+    ;;;         // Value will be evaluated.
+    ;;;     } else if (key == 'kssSubmitForm') {
+    ;;;         // Value will be evaluated.
+    ;;;     } else {
+    ;;;         throw 'No kss parameter "' + key + '" allowed in action-server. (Normal parameters cannot start with kss.)';
+    ;;;     }
+    ;;; }
     // oper will be accessible to some commands that execute in return
     var sa = new kukit.sa.ServerAction(name, this);
 };
@@ -199,6 +195,27 @@
     return this.eventrule.kss_selector.namespace;
 };
 
+kukit.op.Oper.prototype.hasExecuteActions = function () {
+    // Decide if there are any actions (or a default action)
+    // to execute. This can speed up execution if in case
+    // we have nothing to do, there is no reason to bind
+    // the actions hook.
+    if (this.eventrule) {  
+        // if it has actions, the answer is yes
+        if (this.eventrule.actions.hasActions())
+            return true
+        // if we have a default action, we will return true in any case
+        // because we may want to call it.
+        // The reason for this check is, that a default action is also
+        // valid, even if it received no parameters in the eventrule,
+        // in which case it is not present as an action.
+        var methodname = kukit.eventsGlobalRegistry.get(this.getEventNamespace(), 
+                    this.getEventName()).defaultactionmethodname;
+        return (typeof methodname != 'undefined');
+    } else
+        return false;
+};
+
 kukit.op.Oper.prototype.makeExecuteActionsHook = function (filter) {
     // Factory that creates the function that executes the actions.
     // The function may take a dict that is updated on the oper 
@@ -206,12 +223,18 @@
     // the event will only be triggered if the filter returned true.
     // THe return value of func_to_bind will show if the event
     // has executed or not.
+    //
+    // Speedup.
+    if (! this.hasExecuteActions()) {
+        return function() {};
+    }
     var eventname = this.getEventName();
     var self = this;
     var func_to_bind = function(dict) {
         // (XXX XXX TODO it should happen here, that we change to a different
         // oper class. This is for the future when we separate the BindOper
         // from the ActionOper.)
+
         var newoper = self.clone(dict, true);
         // call the filter and if it says skip it, we are done
         if (filter && ! filter(newoper)) return false;
@@ -230,15 +253,15 @@
     // also fill up default values
     // Parms are cloned and returned.
     // Call example: oper.completeParms(['mand1', 'mand2'], {'key1': 'defval'}, 'event X');
-    if (typeof(allow_excess) == 'undefined') {
-        allow_excess = false;
-    }
+    ;;; if (typeof(allow_excess) == 'undefined') {
+    ;;;     allow_excess = false;
+    ;;;}
     var newparms = {};
     for (var i=0; i<mandatory.length; i++) {
         var next = mandatory[i];
-        if (typeof(this.parms[next]) == 'undefined') {
-            throw 'Missing mandatory parameter "' + next + '" in ' + errname;
-        }
+        ;;; if (typeof(this.parms[next]) == 'undefined') {
+        ;;;     throw 'Missing mandatory parameter "' + next + '" in ' + errname;
+        ;;; }
         newparms[next] = this.parms[next];
     }
     for (var key in defaults){
@@ -251,11 +274,11 @@
     }
     for (var key in this.parms){
         if (typeof(newparms[key]) == 'undefined') {
-            if (allow_excess) {
+            ;;; if (allow_excess) {
                 newparms[key] = this.parms[key];
-            } else {
-                throw 'Excess parameter "' + key + '" in ' + errname;
-            }
+            ;;; } else {
+            ;;;     throw 'Excess parameter "' + key + '" in ' + errname;
+            ;;; }
         }
     }
     this.parms = newparms;
@@ -263,16 +286,19 @@
 
 kukit.op.Oper.prototype.evalBool = function(key, errname) {
     var value = this.parms[key];
-    this.parms[key] = kukit.ut.evalBool(value, 'for key "' + key + '" in ' + errname);
+    ;;; kukit.E = 'for key "' + key + '" in ' + errname;
+    this.parms[key] = kukit.ut.evalBool(value, kukit.E);
 };
 
 kukit.op.Oper.prototype.evalInt = function(key, errname) {
     var value = this.parms[key];
-    this.parms[key] = kukit.ut.evalInt(value, 'for key "' + key + '" in ' + errname);
+    ;;; kukit.E = 'for key "' + key + '" in ' + errname || this.componentname;
+    this.parms[key] = kukit.ut.evalInt(value, kukit.E);
 };
 
 kukit.op.Oper.prototype.evalList = function(key, errname) {
     var value = this.parms[key];
-    this.parms[key] = kukit.ut.evalList(value, 'for key "' + key + '" in ' + errname);
+    ;;; kukit.E = 'for key "' + key + '" in ' + errname || this.componentname;
+    this.parms[key] = kukit.ut.evalList(value, kukit.E);
 };
 

Modified: kukit/kukit.js/trunk/kukit/plugin.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/plugin.js	(original)
+++ kukit/kukit.js/trunk/kukit/plugin.js	Mon Jun 11 18:04:11 2007
@@ -117,8 +117,8 @@
                 // throw the original exception
                 throw exc;
             }
-        } else {
-            kukit.log('Ignored bubbling event for "' + name + '" (target =' + target.tagName + '), EventRule #' + oper.eventrule.getNr() + ' mergeid ' + oper.eventrule.kss_selector.mergeid); 
+        ;;; } else {
+        ;;;    kukit.log('Ignored bubbling event for "' + name + '" (target =' + target.tagName + '), EventRule #' + oper.eventrule.getNr() + ' mergeid ' + oper.eventrule.kss_selector.mergeid); 
         }
     };
     if (! eventname)
@@ -133,9 +133,9 @@
 };
 
 kukit.pl.NativeEventBinder.prototype.__bind__node = function(name, func_to_bind, oper) {
-    if (oper.node == null) {
-        throw 'Native event "' + name + '"must be bound to a node.';
-    }
+    ;;; if (oper.node == null) {
+    ;;;     throw 'Native event "' + name + '"must be bound to a node.';
+    ;;; }
     this.__bind__(name, func_to_bind, oper);
 };
 
@@ -147,9 +147,9 @@
 };
 
 kukit.pl.NativeEventBinder.prototype.__bind__window = function(name, func_to_bind, oper) {
-    if (oper.node != null) {
-        throw 'Native event "' + name + '"must not be bound to a node.';
-    }
+    ;;; if (oper.node != null) {
+    ;;;     throw 'Native event "' + name + '"must not be bound to a node.';
+    ;;; }
     oper.node = window;
     this.__bind__(name, func_to_bind, oper);
 };
@@ -162,10 +162,11 @@
 };
 
 kukit.pl.NativeEventBinder.prototype.__bind__ = function(name, func_to_bind, oper) {
-    oper.completeParms([], {'preventdefault': '', 'allowbubbling': '', 'preventbubbling': ''}, 'native event binding');
-    oper.evalBool('preventdefault', 'native event binding');
-    oper.evalBool('allowbubbling', 'native event binding');
-    oper.evalBool('preventbubbling', 'native event binding');
+    ;;; oper.componentname = 'native event binding';
+    oper.completeParms([], {'preventdefault': '', 'allowbubbling': '', 'preventbubbling': ''});
+    oper.evalBool('preventdefault');
+    oper.evalBool('allowbubbling');
+    oper.evalBool('preventbubbling');
     if (oper.parms.preventdefault) {
         if (name != 'click') {
             throw 'In native events only the click event can have preventdefault.';
@@ -189,10 +190,11 @@
 };
 
 kukit.pl.NativeEventBinder.prototype.__bind_key__ = function(name, func_to_bind, oper) {
-    oper.completeParms([], {'preventdefault': 'true', 'allowbubbling': '', 'preventbubbling': '', 'keycodes': ''},  'native key event binding');
-    oper.evalList('keycodes', 'native key event binding');
-    oper.evalBool('preventdefault', 'native key event binding');
-    oper.evalBool('allowbubbling', 'native key event binding');
+    ;;; oper.componentname = 'native key event binding';
+    oper.completeParms([], {'preventdefault': 'true', 'allowbubbling': '', 'preventbubbling': '', 'keycodes': ''});
+    oper.evalList('keycodes');
+    oper.evalBool('preventdefault');
+    oper.evalBool('allowbubbling');
     var filter;
     if (oper.parms.keycodes.length >= 0) {
         // Convert keyCode to dict
@@ -249,23 +251,17 @@
 };
 
 kukit.pl.TimeoutEventBinder.prototype.__bind__ = function(name, func_to_bind, oper) {
-    oper.completeParms(['delay'], {'repeat': 'true'}, 'timeout event binding');
-    oper.evalBool('repeat', 'timeout event binding');
+    ;;; oper.componentname = 'timeout event binding';
+    oper.completeParms(['delay'], {'repeat': 'true'});
+    oper.evalBool('repeat');
     var key = oper.eventrule.getNr();
-    if (oper.parms.repeat && this.counters[key]) {
-        // Don't bind the counter if we matched this eventrule already
-        // (this is only checked if this event is repeating)
-        kukit.logDebug('timer event key ignored for actionEvent #' + key + ' ' 
-            + oper.eventrule.kss_selector.css);
-    } else {   
-        kukit.logDebug('timer event key entered for actionEvent #' + key + ' ' 
-            + oper.eventrule.kss_selector.css);
+    if (! (oper.parms.repeat && this.counters[key])) {
+        ;;; kukit.logDebug('timer event key entered for actionEvent #' + key + ' '  + oper.eventrule.kss_selector.css);
         var f = function() {
             // check if the node has been deleted
             // and weed it out if so
             if (oper.node != null && ! oper.node.parentNode) {
-                kukit.logDebug('timer deleted for actionEvent #' + key + ' ' 
-                    + oper.eventrule.kss_selector.css);
+                ;;; kukit.logDebug('timer deleted for actionEvent #' + key + ' ' + oper.eventrule.kss_selector.css);
                 this.clear();
             } else {
                 func_to_bind();
@@ -275,6 +271,10 @@
         this.counters[key] = counter;
         // Start the counter
         counter.start();
+    ;;; } else {   
+    ;;;     // Don't bind the counter if we matched this eventrule already
+    ;;;     // (this is only checked if this event is repeating)
+    ;;;     kukit.logDebug('timer event key ignored for actionEvent #' + key + ' ' + oper.eventrule.kss_selector.css);
     }
 };
 
@@ -291,23 +291,25 @@
         return;
     }
     if (iload) {
-        oper.completeParms(['autodetect'], {'initial': 'true', 'insert': 'true'}, 'iload event binding');
+        ;;; oper.componentname = 'iload event binding';
+        oper.completeParms(['autodetect'], {'initial': 'true', 'insert': 'true'});
         // autodetect=false changes the iload autosense method to one that requires the iframe set
         // the _kssReadyForLoadEvent attribute on the document. Setting this attribute is explicitely required 
         // if autodetect is off, since otherwise in this case we would never notice if the document has arrived.
-        oper.evalBool('autodetect', 'iload event binding');
+        oper.evalBool('autodetect');
     } else {
-        oper.completeParms([], {'initial': 'true', 'insert': 'true'}, 'load event binding');
+        ;;; oper.componentname = 'load event binding';
+        oper.completeParms([], {'initial': 'true', 'insert': 'true'});
     }
-    oper.evalBool('initial', 'load/iload event binding');
-    oper.evalBool('insert', 'load/iload event binding');
+    oper.evalBool('initial');
+    oper.evalBool('insert');
     var phase = oper.node._kukitmark;
     if (phase == 1 && ! oper.parms.initial) {
-        kukit.logDebug('EventRule #' + oper.eventrule.getNr() + ' mergeid ' + oper.eventrule.kss_selector.mergeid + ' event ignored, oninitial=false.');
+        ;;; kukit.logDebug('EventRule #' + oper.eventrule.getNr() + ' mergeid ' + oper.eventrule.kss_selector.mergeid + ' event ignored, oninitial=false.');
         return;
     }
     if (phase == 2 && ! oper.parms.insert) {
-        kukit.logDebug('EventRule #' + oper.eventrule.getNr() + ' mergeid ' + oper.eventrule.kss_selector.mergeid + ' event ignored, oninsert=false.');
+        ;;; kukit.logDebug('EventRule #' + oper.eventrule.getNr() + ' mergeid ' + oper.eventrule.kss_selector.mergeid + ' event ignored, oninsert=false.');
         return;
     }
     return oper;
@@ -337,27 +339,37 @@
             loadoper = null;
             // with the legacy loads we suppose autodetect=false
             iloadoper.parms.autodetect = false;
-            kukit.logWarning('Deprecated the use of "load" event for iframes. It will behave differently in the future. Use the "iload" event (maybe with evt-iload-autodetect: false) instead!');
+            ;;; kukit.E = 'Deprecated the use of "load" event for iframes. It will behave differently in the future. ';
+            ;;; kukit.E += 'Use the "iload" event (maybe with evt-iload-autodetect: false) instead!';
+            ;;; kukit.logWarning(kukit.E);
         } 
     } else {
         // Not an iframe. So iload is not usable.
         if (iloadoper) {
-            throw 'iload event can only be bound on an iframe node.';
+            ;;; kukit.E = 'iload event can only be bound on an iframe node.';
+            throw kukit.E;
         }
     }
     // Now, bind the events.
     if (loadoper) {
-        kukit.logDebug('EventRule #' + loadoper.eventrule.getNr() + ' mergeid ' + loadoper.eventrule.kss_selector.mergeid + ' event selected normal postponed execution.');
+        ;;; kukit.E = 'EventRule #' + loadoper.eventrule.getNr() + ' mergeid ';
+        ;;; kukit.E += loadoper.eventrule.kss_selector.mergeid;
+        ;;; kukit.E += ' event selected normal postponed execution.';
+        ;;; kukit.logDebug(kukit.E);
         // for any other node than iframe, or even for iframe in phase1, we need to execute immediately.
         var func_to_bind = loadoper.makeExecuteActionsHook();
-        kukit.engine.bindScheduler.addPost(func_to_bind, 'Execute load event for node ' + loadoper.node.tagName.toLowerCase());
+        ;;; kukit.E = 'Execute load event for node ' + loadoper.node.tagName.toLowerCase();
+        kukit.engine.bindScheduler.addPost(func_to_bind, kukit.E);
     }
     if (iloadoper) {
         var phase = iloadoper.node._kukitmark;
         // For phase 2 we need to execute posponed, for phase1 immediately.
         // XXX it would be better not need this and do always postponed.
         if (phase == 2 || (phase == 1 && kukit.engine.initializedOnDOMLoad)) {
-            kukit.logDebug('EventRule #' + iloadoper.eventrule.getNr() + ' mergeid ' + iloadoper.eventrule.kss_selector.mergeid + ' event selected delayed execution (when iframe loaded)');
+            ;;; kukit.E = 'EventRule #' + iloadoper.eventrule.getNr() + ' mergeid ';
+            ;;; kukit.E += iloadoper.eventrule.kss_selector.mergeid;
+            ;;; kukit.E += ' event selected delayed execution (when iframe loaded)';
+            ;;; kukit.logDebug(kukit.E);
             // We want the event execute once the iframe is loaded.
             // In a somewhat tricky way, we start the scheduler only from the normal delayed execution. This will enable that in
             // case we had a load event on the same node, it could modify the name and id parameters and we only start
@@ -366,15 +378,21 @@
             var g = function() {
                 var f = function() {
                     var func_to_bind = iloadoper.makeExecuteActionsHook();
-                    kukit.engine.bindScheduler.addPost(func_to_bind, 'Execute iload event for iframe ' + iloadoper.node.name);
+                    ;;; kukit.E = 'Execute iload event for iframe ' + iloadoper.node.name;
+                    kukit.engine.bindScheduler.addPost(func_to_bind, kukit.E);
                 };
                 new kukit.dom.EmbeddedContentLoadedScheduler(iloadoper.node.id, f, iloadoper.parms.autodetect);
-            }
-            kukit.engine.bindScheduler.addPost(g, 'Schedule iload event for iframe ' + iloadoper.node.name);
+            };
+            ;;; kukit.E = 'Schedule iload event for iframe ' + iloadoper.node.name;
+            kukit.engine.bindScheduler.addPost(g, kukit.E);
         } else {
-            kukit.logDebug('EventRule #' + iloadoper.eventrule.getNr() + ' mergeid ' + iloadoper.eventrule.kss_selector.mergeid + ' event selected normal postponed execution.');
+            ;;; kukit.E = 'EventRule #' + iloadoper.eventrule.getNr() + ' mergeid ';
+            ;;; kukit.E += iloadoper.eventrule.kss_selector.mergeid;
+            ;;; kukit.E += ' event selected normal postponed execution.';
+            ;;; kukit.logDebug(kukit.E);
             var func_to_bind = iloadoper.makeExecuteActionsHook();
-            kukit.engine.bindScheduler.addPost(func_to_bind, 'Execute iload event for iframe ' + iloadoper.node.name);
+            ;;; kukit.E = 'Execute iload event for iframe ' + iloadoper.node.name;
+            kukit.engine.bindScheduler.addPost(func_to_bind, kukit.E);
         }
     }
 };
@@ -399,8 +417,9 @@
 };
 
 kukit.pl.SpinnerEventBinder.prototype.__bind__ = function(name, func_to_bind, oper) {
-    oper.completeParms([], {'laziness': 0}, 'spinner event binding');
-    oper.evalInt('laziness', 'spinner event binding');
+    ;;; oper.componentname = 'spinner event binding';
+    oper.completeParms([], {'laziness': 0});
+    oper.evalInt('laziness');
     // Register the function with the global queue manager
     var state_to_bind = (name == 'spinneron');
     var self = this;
@@ -443,50 +462,50 @@
 kukit.commandsGlobalRegistry.registerFromAction('error', kukit.cr.makeGlobalCommand);
 
 kukit.actionsGlobalRegistry.register("logDebug", function (oper) {
-    oper.completeParms([], {'message': 'LogDebug action'}, 'logDebug action');
-    var node = oper.node;
-    var nodeName = '<DOCUMENT>';
-    if (node != null) {
-        nodeName = node.nodeName;
-    }
-    var message = oper.parms.message;
-    if (oper.eventrule) {
-        message = message + ', event=' + oper.eventrule.kss_selector.name + ', rule=#' + oper.eventrule.getNr() + ', node=' + nodeName; 
-    }
-    kukit.logDebug(message); 
-    if (kukit.hasFirebug) {
-        kukit.logDebug(oper.node);
-    }
+;;;     oper.completeParms([], {'message': 'LogDebug action'}, 'logDebug action');
+;;;     var node = oper.node;
+;;;     var nodeName = '<DOCUMENT>';
+;;;     if (node != null) {
+;;;         nodeName = node.nodeName;
+;;;     }
+;;;     var message = oper.parms.message;
+;;;     if (oper.eventrule) {
+;;;         message = message + ', event=' + oper.eventrule.kss_selector.name + ', rule=#' + oper.eventrule.getNr() + ', node=' + nodeName; 
+;;;     }
+;;;     kukit.logDebug(message); 
+;;;     if (kukit.hasFirebug) {
+;;;         kukit.logDebug(oper.node);
+;;;     }
 });
 kukit.commandsGlobalRegistry.registerFromAction('logDebug', kukit.cr.makeGlobalCommand);
 
 kukit.actionsGlobalRegistry.register("log", function (oper) {
-    oper.completeParms([], {'message': 'Log action'}, 'log action');
-    var node = oper.node;
-    var nodeName = '<DOCUMENT>';
-    if (node != null) {
-        nodeName = node.nodeName;
-    }
-    var message = oper.parms.message;
-    if (oper.eventrule) {
-        message = message + ', event=' + oper.eventrule.kss_selector.name + ', rule=#' + oper.eventrule.getNr() + ', node=' + nodeName; 
-    }
-    kukit.log(message);
+;;;     oper.completeParms([], {'message': 'Log action'}, 'log action');
+;;;     var node = oper.node;
+;;;     var nodeName = '<DOCUMENT>';
+;;;     if (node != null) {
+;;;         nodeName = node.nodeName;
+;;;     }
+;;;     var message = oper.parms.message;
+;;;     if (oper.eventrule) {
+;;;         message = message + ', event=' + oper.eventrule.kss_selector.name + ', rule=#' + oper.eventrule.getNr() + ', node=' + nodeName; 
+;;;     }
+;;;     kukit.log(message);
 });
 kukit.commandsGlobalRegistry.registerFromAction('log', kukit.cr.makeGlobalCommand);
 
 kukit.actionsGlobalRegistry.register("alert", function (oper) {
-    oper.completeParms([], {'message': 'Alert action'}, 'alert action');
-    var node = oper.node;
-    var nodeName = '<DOCUMENT>';
-    if (node != null) {
-        nodeName = node.nodeName;
-    }
-    var message = oper.parms.message;
-    if (oper.eventrule) {
-        message = message + ', rule=#' + oper.eventrule.getNr() + ', node=' + nodeName; 
-    }
-    alert(message);
+;;;     oper.completeParms([], {'message': 'Alert action'}, 'alert action');
+;;;     var node = oper.node;
+;;;     var nodeName = '<DOCUMENT>';
+;;;     if (node != null) {
+;;;         nodeName = node.nodeName;
+;;;     }
+;;;     var message = oper.parms.message;
+;;;     if (oper.eventrule) {
+;;;         message = message + ', rule=#' + oper.eventrule.getNr() + ', node=' + nodeName; 
+;;;     }
+;;;     alert(message);
 });
 kukit.commandsGlobalRegistry.registerFromAction('alert', kukit.cr.makeGlobalCommand);
 
@@ -499,9 +518,9 @@
 /*
 *  accepts both string and dom.
 */
-    oper.completeParms(['html'], {'withKssSetup':true},
-                       'replaceInnerHTML action');
-    oper.evalBool('withKssSetup', 'setup events on inserted nodes');
+    ;;; oper.componentname = 'replaceInnerHTML action';
+    oper.completeParms(['html'], {'withKssSetup': true});
+    oper.evalBool('withKssSetup');
     var node = oper.node;
     var insertedNodes;
     if (typeof(oper.parms.html) == 'string') {
@@ -522,8 +541,9 @@
 /*
 *  accepts both string and dom.
 */
-    oper.completeParms(['html'], {'withKssSetup':true}, 'replaceHTML action');
-    oper.evalBool('withKssSetup', 'setup events on inserted nodes');
+    ;;; oper.componentname = 'replaceHTML action';
+    oper.completeParms(['html'], {'withKssSetup':true});
+    oper.evalBool('withKssSetup');
     var node = oper.node;
     oper.parms.html = kukit.dom.forceToDom(oper.parms.html);
     var elements = oper.parms.html.childNodes;
@@ -549,42 +569,48 @@
 kukit.commandsGlobalRegistry.registerFromAction('replaceHTML', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('setAttribute', function(oper) {
-    oper.completeParms(['name', 'value'], {}, 'setAttribute action');
+    ;;; oper.componentname = 'setAttribute action';
+    oper.completeParms(['name', 'value'], {});
     if (oper.parms.name.toLowerCase() == 'style') {
-        throw 'Style attribute is not allowed with setAttribute';
+        ;;; kukit.E = 'Style attribute is not allowed with setAttribute';
+        throw kukit.E;
     }
     kukit.dom.setAttribute(oper.node, oper.parms.name, oper.parms.value);
 });
 kukit.commandsGlobalRegistry.registerFromAction('setAttribute', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('setKssAttribute', function(oper) {
-    oper.completeParms(['name', 'value'], {}, 'setKssAttribute action');
+    ;;; oper.componentname = 'setKssAttribute action';
+    oper.completeParms(['name', 'value'], {});
     kukit.dom.setKssAttribute(oper.node, oper.parms.name, oper.parms.value);
 });
 kukit.commandsGlobalRegistry.registerFromAction('setKssAttribute', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('setStyle', function(oper) {
-    oper.completeParms(['name', 'value'], {}, 'setStyle action');
+    ;;; oper.componentname = 'setStyle action';
+    oper.completeParms(['name', 'value'], {});
     oper.node.style[oper.parms.name] = oper.parms.value;
 });
 kukit.commandsGlobalRegistry.registerFromAction('setStyle', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('addClassName', function(oper) {
-    oper.completeParms(['name'], {}, 'addClassName action');
+    ;;; oper.componentname = 'addClassName action';
+    oper.completeParms(['name'], {});
     addClassName(oper.node, oper.parms.name);
 });
 kukit.commandsGlobalRegistry.registerFromAction('addClassName', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('removeClassName', function(oper) {
+    ;;; oper.componentname = 'removeClassName action';
     oper.completeParms(['name'], {}, 'removeClassName action');
     removeClassName(oper.node, oper.parms.name);
 });
 kukit.commandsGlobalRegistry.registerFromAction('removeClassName', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('insertHTMLAfter', function(oper) {
-    oper.completeParms(['html'], {'withKssSetup':true},
-                       'insertHTMLAfter action');
-    oper.evalBool('withKssSetup', 'setup events on inserted nodes');
+    ;;; oper.componentname = 'insertHTMLAfter action';
+    oper.completeParms(['html'], {'withKssSetup':true});
+    oper.evalBool('withKssSetup');
     oper.parms.html = kukit.dom.forceToDom(oper.parms.html);
     var content = oper.parms.html;
     var parentNode = oper.node.parentNode;
@@ -596,7 +622,7 @@
         insertedNodes = kukit.dom.insertBefore(content, parentNode, toNode);
     }
     // update the events for the new nodes
-    kukit.logDebug("Inserted nodes length: "+insertedNodes.length);
+    ;;; kukit.logDebug("Inserted nodes length: "+insertedNodes.length);
     if (oper.parms.withKssSetup) {
         kukit.engine.setupEvents(insertedNodes);
     }
@@ -604,16 +630,16 @@
 kukit.commandsGlobalRegistry.registerFromAction('insertHTMLAfter', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('insertHTMLBefore', function(oper) {
-    oper.completeParms(['html'], {'withKssSetup':true},
-                       'insertHTMLBefore action');
-    oper.evalBool('withKssSetup', 'setup events on inserted nodes');
+    ;;; oper.componentname = 'insertHTMLBefore action';
+    oper.completeParms(['html'], {'withKssSetup':true});
+    oper.evalBool('withKssSetup');
     oper.parms.html = kukit.dom.forceToDom(oper.parms.html);
     var content = oper.parms.html;
     var toNode = oper.node;
     var parentNode = toNode.parentNode;
     var insertedNodes = kukit.dom.insertBefore(content, parentNode, toNode);
     // update the events for the new nodes
-    kukit.logDebug("Inserted nodes length: "+insertedNodes.length);
+    ;;; kukit.logDebug("Inserted nodes length: "+insertedNodes.length);
     if (oper.parms.withKssSetup) {
         kukit.engine.setupEvents(insertedNodes);
     }
@@ -621,14 +647,14 @@
 kukit.commandsGlobalRegistry.registerFromAction('insertHTMLBefore', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('insertHTMLAsLastChild', function(oper) {
-    oper.completeParms(['html'], {'withKssSetup':true},
-                       'insertHTMLAsLastChild action');
-    oper.evalBool('withKssSetup', 'setup events on inserted nodes');
+    ;;; oper.componentname = 'insertHTMLAsLastChild action';
+    oper.completeParms(['html'], {'withKssSetup':true});
+    oper.evalBool('withKssSetup');
     oper.parms.html = kukit.dom.forceToDom(oper.parms.html);
     var insertedNodes = kukit.dom.appendChildren(oper.parms.html, oper.node);
     insertedNodes = kukit.dom.appendChildren(oper.parms.html.childNodes, oper.node);
     // update the events for the new nodes
-    kukit.logDebug("Inserted nodes length: "+insertedNodes.length);
+    ;;; kukit.logDebug("Inserted nodes length: "+insertedNodes.length);
     if (oper.parms.withKssSetup) {
         kukit.engine.setupEvents(insertedNodes);
     }
@@ -636,9 +662,9 @@
 kukit.commandsGlobalRegistry.registerFromAction('insertHTMLAsLastChild', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('insertHTMLAsFirstChild', function(oper) {
-    oper.completeParms(['html'], {'withKssSetup':true},
-                       'insertHTMLAsFirstChild action');
-    oper.evalBool('withKssSetup', 'setup events on inserted nodes');
+    ;;; oper.componentname = 'insertHTMLAsFirstChild action';
+    oper.completeParms(['html'], {'withKssSetup':true});
+    oper.evalBool('withKssSetup');
     oper.parms.html = kukit.dom.forceToDom(oper.parms.html);
     var content = oper.parms.html;
     var parentNode = oper.node;
@@ -650,7 +676,7 @@
         insertedNodes = kukit.dom.insertBefore(content, parentNode, toNode);
     }
     // update the events for the new nodes
-    kukit.logDebug("Inserted nodes length: "+insertedNodes.length);
+    ;;; kukit.logDebug("Inserted nodes length: "+insertedNodes.length);
     if (oper.parms.withKssSetup) {
         kukit.engine.setupEvents(insertedNodes);
     }
@@ -659,7 +685,8 @@
 
 
 kukit.actionsGlobalRegistry.register('deleteNodeAfter', function(oper) {
-    oper.completeParms([], {}, 'deleteNodeAfter action');
+    ;;; oper.componentname = 'deleteNodeAfter action';
+    ;;; oper.completeParms([], {});
     var parentNode = oper.node.parentNode;
     var toNode = kukit.dom.getNextSiblingTag(oper.node);
     if (toNode != null) {
@@ -669,7 +696,8 @@
 kukit.commandsGlobalRegistry.registerFromAction('deleteNodeAfter', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('deleteNodeBefore', function(oper) {
-    oper.completeParms([], {}, 'deleteNodeBefore action');
+    ;;; oper.componentname = 'deleteNodeBefore action';
+    ;;; oper.completeParms([], {});
     var parentNode = oper.node.parentNode;
     var toNode = kukit.dom.getPreviousSiblingTag(oper.node);
     parentNode.removeChild(toNode);
@@ -677,7 +705,8 @@
 kukit.commandsGlobalRegistry.registerFromAction('deleteNodeBefore', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('deleteNode', function(oper) {
-    oper.completeParms([], {}, 'deleteNode action');
+    ;;; oper.componentname = 'deleteNode action';
+    ;;; oper.completeParms([], {});
     var parentNode = oper.node.parentNode;
     parentNode.removeChild(oper.node);
 });
@@ -685,20 +714,23 @@
 
 kukit.actionsGlobalRegistry.register('clearChildNodes', function(oper) {
     // TODO get rid of none
-    oper.completeParms([], {'none': false}, 'clearChildNodes action');
+    ;;; oper.componentname = 'clearChildNodes action';
+    oper.completeParms([], {'none': false});
     kukit.dom.clearChildNodes(oper.node);
 });
 kukit.commandsGlobalRegistry.registerFromAction('clearChildNodes', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('focus', function(oper) {
     // TODO get rid of none
-    oper.completeParms([], {'none': false}, 'focus action');
+    ;;; oper.componentname = 'focus action';
+    oper.completeParms([], {'none': false});
     kukit.dom.focus(oper.node);
 });
 kukit.commandsGlobalRegistry.registerFromAction('focus', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('moveNodeAfter', function(oper) {
-    oper.completeParms(['html_id'], {}, 'moveNodeAfter action');
+    ;;; oper.componentname = 'moveNodeAfter action';
+    ;;; oper.completeParms(['html_id'], {});
     var node = oper.node;
     var parentNode = node.parentNode;
     parentNode.removeChild(node);
@@ -713,31 +745,49 @@
 kukit.commandsGlobalRegistry.registerFromAction('moveNodeAfter', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('moveNodeBefore', function(oper) {
-    oper.completeParms(['html_id'], {}, 'moveNodeBefore action');
+    ;;; oper.componentname = 'moveNodeBefore action';
+    ;;; oper.completeParms(['html_id'], {});
     var node = oper.node;
-    var parentNode = node.parentNode;
-    parentNode.removeChild(node);
+    // no need to remove it, as insertNode does it anyway
+    // var parentNode = node.parentNode;
+    // parentNode.removeChild(node);
     var toNode = document.getElementById(oper.parms.html_id);
+    var parentNode = toNode.parentNode;
     parentNode.insertBefore(node, toNode);
 });
 kukit.commandsGlobalRegistry.registerFromAction('moveNodeBefore', kukit.cr.makeSelectorCommand);
 
+kukit.actionsGlobalRegistry.register('moveNodeAsLastChild', function(oper) {
+    ;;; oper.componentname = 'moveNodeAsLastChild action';
+    ;;; oper.completeParms(['html_id'], {});
+    var node = oper.node;
+    // no need to remove it, as insertNode does it anyway
+    // var parentNode = node.parentNode;
+    // parentNode.removeChild(node);
+    var parentNode = document.getElementById(oper.parms.html_id);
+    parentNode.appendChild(node);
+});
+kukit.commandsGlobalRegistry.registerFromAction('moveNodeAsLastChild', kukit.cr.makeSelectorCommand);
+
 kukit.actionsGlobalRegistry.register('copyChildNodesFrom', function(oper) {
-    oper.completeParms(['html_id'], {}, 'copyChildNodesFrom action');
+    ;;; oper.componentname = 'copyChildNodesFrom action';
+    ;;; oper.completeParms(['html_id'], {});
     var fromNode = document.getElementById(oper.parms.html_id);
     Sarissa.copyChildNodes(fromNode, oper.node);
 });
 kukit.commandsGlobalRegistry.registerFromAction('copyChildNodesFrom', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('copyChildNodesTo', function(oper) {
-    oper.completeParms(['html_id'], {}, 'copyChildNodesTo action');
+    ;;; oper.componentname = 'copyChildNodesTo action';
+    ;;; oper.completeParms(['html_id'], {});
     toNode = document.getElementById(oper.parms.html_id);
-    Sarissa.copyChildNodes(oper.node, toNode)
+    Sarissa.copyChildNodes(oper.node, toNode);
 });
 kukit.commandsGlobalRegistry.registerFromAction('copyChildNodesTo', kukit.cr.makeSelectorCommand);
 
 kukit.actionsGlobalRegistry.register('setStateVar', function(oper) {
-    oper.completeParms(['varname', 'value'], {}, 'setStateVar action');
+    ;;; oper.componentname = 'setStateVar action';
+    ;;; oper.completeParms(['varname', 'value'], {});
     kukit.engine.statevars[oper.parms.varname] = oper.parms.value;
 });
 kukit.commandsGlobalRegistry.registerFromAction('setStateVar', kukit.cr.makeGlobalCommand);
@@ -746,7 +796,8 @@
     // Trigger continuation event. Event will be triggered on the same node or
     // on all the nodes bound for the current event state.
     // allows excess parms in the following check.
-    oper.completeParms(['name'], {'allnodes': 'false'}, 'continueEvent action', true);
+    ;;; oper.componentname = 'continue action';
+    oper.completeParms(['name'], {'allnodes': 'false'}, '', true);
     oper.evalBool('allnodes', 'continueEvent');
     var parms = oper.parms;
     var binderinstance = oper.binderinstance;
@@ -761,7 +812,8 @@
     if (parms.allnodes) {
         binderinstance.__continue_event_allnodes__(parms.name, actionparms);
     } else {
-        binderinstance.__continue_event__(parms.name, oper.node, actionparms);
+        // execution happens on the orignode
+        binderinstance.__continue_event__(parms.name, oper.orignode, actionparms);
     }
 });
 kukit.commandsGlobalRegistry.registerFromAction('continueEvent', kukit.cr.makeGlobalCommand);
@@ -770,9 +822,10 @@
     // Allows executing a local action on a different selection.
     //
     // allows excess parms in the following check
+    ;;; oper.componentname = 'executeCommand action';
     oper.completeParms(['name', 'selector'],
                        {'selectorType': null},
-                       'executeCommand action', true);
+                       '', true);
     var parms = oper.parms;
     // marshall it, the rest of the parms will be passed
     var actionparms = {};
@@ -789,7 +842,8 @@
 
 // Add/remove a class to/from a node
 kukit.actionsGlobalRegistry.register("toggleClass", function (oper) {
-    oper.completeParms(['classname'], {}, 'toggleClass action');
+    ;;; oper.componentname = 'toggleClass action';
+    ;;; oper.completeParms(['classname'], {});
 
     var node = oper.node;
     var classname = oper.parms.classname;

Modified: kukit/kukit.js/trunk/kukit/providerreg.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/providerreg.js	(original)
+++ kukit/kukit.js/trunk/kukit/providerreg.js	Mon Jun 11 18:04:11 2007
@@ -33,11 +33,11 @@
     if (typeof(func) == 'undefined') {
         throw 'func argument is mandatory when registering a parameter provider (ParamProviderRegistry.register).';
     }
-    if (this.content[name]) {
-        // Do not allow redefinition
-        kukit.logError('Error : parameter provider "' + name + '" already registered.');
-        return;
-    }
+    ;;; if (this.content[name]) {
+    ;;;    // Do not allow redefinition
+    ;;;    kukit.logError('Error : parameter provider "' + name + '" already registered.');
+    ;;;    return;
+    ;;; }
     this.content[name] = func;
 };
 
@@ -53,8 +53,9 @@
         if (name == '') {
             // default provider for the strings
             return kukit.pr.IdentityPP;
-        } else {
-            throw 'Error : undefined parameter provider "' + name + '"';
+         } else {
+            ;;; kukit.E = 'Error : undefined parameter provider "' + name + '"';
+            throw kukit.E;
         }
     }
     return func;
@@ -87,12 +88,16 @@
 
 kukit.pr.IdentityPP = function() {};
 kukit.pr.IdentityPP.prototype = {
+    /*
+    ;;; */
     check: function(args) {
         // check does not need to be used here actually.
         if (args.length != 1) {
             throw 'internal error, IdentityPP needs 1 argument';
         }
     },
+    /*
+    */
     eval: function(args, node) {
         return args[0];
     }
@@ -101,11 +106,15 @@
 
 kukit.pr.FormVarPP = function() {};
 kukit.pr.FormVarPP.prototype = {
+    /*
+    ;;; */
     check: function(args) {
         if (args.length != 2) {
             throw 'formVar method needs 2 arguments (formname, varname)';
         }
     },
+    /*
+    */
     eval: function(args, node) {
         return kukit.fo.getFormVar(new kukit.fo.NamedFormLocator(args[0]), args[1]);
     }
@@ -114,11 +123,15 @@
 
 kukit.pr.CurrentFormVarPP = function() {};
 kukit.pr.CurrentFormVarPP.prototype = {
+    /*
+    ;;; */
     check: function(args) {
         if (args.length != 0 && args.length != 1) {
             throw 'currentFormVar method needs 0 or 1 argument (varname)';
         }
     },
+    /*
+    */
     eval: function(args, node) {
         if (args.length == 1) {
             return kukit.fo.getFormVar(new kukit.fo.CurrentFormLocator(node), args[0]);
@@ -132,16 +145,21 @@
 
 kukit.pr.CurrentFormVarFromKssAttrPP = function() {};
 kukit.pr.CurrentFormVarFromKssAttrPP.prototype = {
+    /*
+    ;;; */
     check: function(args) {
         if (args.length != 1 && args.length != 2) {
             throw 'currentFormVarFromKssAttr method needs 1 or 2 argument (attrname, [recurseParents])';
         }
     },
+    /*
+    */
     eval: function(args, node) {
         var argname =  args[0];
         var recurseParents = false;
         if (args.length == 2) {
-            kukit.ut.evalBool(args[1], '2nd attribute of currentFormVarForKssAttr must be a boolean');
+            ;;; kukit.E = '2nd attribute of currentFormVarForKssAttr must be a boolean';
+            kukit.ut.evalBool(args[1], kukit.E);
             recurseParents = args[1];
         }
         var formvarname = kukit.dom.getRecursiveAttribute(node, argname, recurseParents, kukit.dom.getKssAttribute);
@@ -154,12 +172,16 @@
 /* BBB. To be deprecated at 2007-08-15 */
 kukit.pr.FormPP = function() {};
 kukit.pr.FormPP.prototype = {
+    /*
+    ;;; */
     check: function(args) {
         if (args.length != 1) {
             throw 'form method needs 1 arguments (formname)';
         }
         kukit.logWarning('Deprecated the form(formname) parameter provider, use xxx-kssSubmitForm: form(formname) instead!');
     },
+    /*
+    */
     eval: function(args, node) {
         return kukit.fo.getAllFormVars(new kukit.fo.NamedFormLocator(args[0]), new kukit.ut.DictCollector());
     }
@@ -169,12 +191,16 @@
 /* BBB. To be deprecated at 2007-08-15 */
 kukit.pr.CurrentFormPP = function() {};
 kukit.pr.CurrentFormPP.prototype = {
+    /*
+    ;;; */
     check: function(args) {
         if (args.length != 0) {
             throw 'currentForm method needs no argument';
         }
         kukit.logWarning('Deprecated the currentForm() parameter provider, use xxx-kssSubmitForm: currentForm() instead!');
     },
+    /*
+    */
     eval: function(args, node) {
         return kukit.fo.getAllFormVars(new kukit.fo.CurrentFormLocator(node), new kukit.ut.DictCollector());
     }
@@ -183,6 +209,8 @@
 
 kukit.pr.NodeAttrPP = function() {};
 kukit.pr.NodeAttrPP.prototype = {
+    /*
+    ;;; */
     check: function(args) {
         if (args.length != 1 && args.length != 2) {
             throw 'nodeAttr method needs 1 or 2 argument (attrname, [recurseParents])';
@@ -194,12 +222,15 @@
             throw 'attrname parameter in nodeAttr method cannot contain space.';
         }
     },
+    /*
+    */
     eval: function(args, node) {
         var argname = args[0];
         var recurseParents = false;
         if (args.length == 2) {
             recurseParents = args[1];
-            kukit.ut.evalBool(recurseParents, '2nd attribute of nodeAttr must be a boolean');
+            ;;; kukit.E = '2nd attribute of nodeAttr must be a boolean';
+            kukit.ut.evalBool(recurseParents, kukit.E);
         }
         return kukit.dom.getRecursiveAttribute(node, argname, recurseParents, kukit.dom.getAttribute);
     }
@@ -208,6 +239,8 @@
 
 kukit.pr.KssAttrPP = function() {};
 kukit.pr.KssAttrPP.prototype = {
+    /*
+    ;;; */
     check: function(args) {
         if (args.length != 1 && args.length != 2) {
             throw 'kssAttr method needs 1 or 2 argument (attrname, [recurseParents])';
@@ -216,12 +249,15 @@
             throw 'attrname parameter in kssAttr method cannot contain "-" or space.';
         }
     },
+    /*
+    */
     eval: function(args, node) {
         var argname =  args[0];
         var recurseParents = false;
         if (args.length == 2) {
             recurseParents = args[1];
-            kukit.ut.evalBool(recurseParents, '2nd attribute of kssAttr must be a boolean');
+            ;;; kukit.E = '2nd attribute of kssAttr must be a boolean';
+            kukit.ut.evalBool(recurseParents, kukit.E);
         }
         return kukit.dom.getRecursiveAttribute(node, argname, recurseParents, kukit.dom.getKssAttribute);
     }
@@ -230,11 +266,15 @@
 
 kukit.pr.NodeContentPP = function() {};
 kukit.pr.NodeContentPP.prototype = {
+    /*
+    ;;; */
     check: function(args) {
         if (args.length != 0 && args.length != 1) {
             throw 'nodeContent method needs 0 or 1 argument (recursive)';
         }
     },
+    /*
+    */
     eval: function(args, node) {
         var recursive = false;
         if (args.length == 1) {
@@ -247,17 +287,22 @@
 
 kukit.pr.StateVarPP = function() {};
 kukit.pr.StateVarPP.prototype = {
+    /*
+    ;;; */
     check: function(args) {
         if (args.length != 1) {
             throw 'stateVar method needs 1 argument (varname)';
         }
     },
+    /*
+    */
     eval: function(args, node) {
         var key = args[0];
         var value = kukit.engine.statevars[key];
         if (typeof(value) == 'undefined') {
             // notfound arguments will get null
-            throw 'Nonexistent statevar "'+ key +'"';
+            ;;; kukit.E = 'Nonexistent statevar "'+ key +'"';
+            throw kukit.E;
         }
         return value;
     }
@@ -266,17 +311,22 @@
 
 kukit.pr.PassPP = function() {};
 kukit.pr.PassPP.prototype = {
+    /*
+    ;;; */
     check: function(args) {
         if (args.length != 1) {
             throw 'pass method needs 1 argument (attrname)';
         }
     },
+    /*
+    */
     eval: function(args, node, defaultparms) {
         var key = args[0];
         var value = defaultparms[key];
         if (typeof(value) == 'undefined') {
             // notfound arguments will get null
-            throw 'Nonexistent default parm "'+ key +'"';
+            ;;; kukit.E = 'Nonexistent default parm "'+ key +'"';
+            throw kukit.E;
         }
         return value;
     }

Modified: kukit/kukit.js/trunk/kukit/requestmanager.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/requestmanager.js	(original)
+++ kukit/kukit.js/trunk/kukit/requestmanager.js	Mon Jun 11 18:04:11 2007
@@ -187,13 +187,13 @@
 // max request number
 kukit.rm.RequestManager.prototype.maxNr = 4;
 
-kukit.rm.RequestManager.prototype.getInfo = function() {
-    return '(RQ: ' + this.sentNr + ' OUT, ' + this.waitingQueue.size() + ' WAI)';
-};
-
-kukit.rm.RequestManager.prototype.log = function(txt) {
-    kukit.logDebug('RequestManager ' + this.namestr + txt + ' ' + this.getInfo());
-};
+;;; kukit.rm.RequestManager.prototype.getInfo = function() {
+;;;     return '(RQ: ' + this.sentNr + ' OUT, ' + this.waitingQueue.size() + ' WAI)';
+;;; };
+
+;;; kukit.rm.RequestManager.prototype.log = function(txt) {
+;;;     kukit.logDebug('RequestManager ' + this.namestr + txt + ' ' + this.getInfo());
+;;; };
 
 kukit.rm.RequestManager.prototype.setSpinnerState = function(newState) {
     if (this.spinnerState != newState) {
@@ -228,7 +228,7 @@
 
 kukit.rm.RequestManager.prototype.pushSentRequest = function(item, now) {
     this.sentNr += 1;
-    this.log('Notify server ' + item.url + ', rid=' + item.rid);
+    ;;; this.log('Notify server ' + item.url + ', rid=' + item.rid);
     // Set the spinner state
     this.setSpinnerState(true);
     // Set the timeout
@@ -253,7 +253,7 @@
         //var now = (new Date()).valueOf();
         //this.log('Next timeout check in: ' + (nextWake - now));
     } else {
-        this.log('Timeout checking suspended until the next requests');
+        ;;; this.log('Timeout checking suspended until the next requests');
         // Set the spinner state
         this.setSpinnerState(false);
     }
@@ -284,7 +284,7 @@
     if (waiting != null) {
         // see if we can send another request in place of the received one
         // request is waiting, send it.
-        this.log('Dequeue server notification at ' + waiting.url + ', rid=' + waiting.rid);
+        ;;; this.log('Dequeue server notification at ' + waiting.url + ', rid=' + waiting.rid);
         this.pushSentRequest(waiting, now);
     } else {
     //    this.log("Request queue empty.");
@@ -298,17 +298,17 @@
 kukit.rm.RequestManager.prototype.receiveItem = function(item, now) {
     // calls result processing
     var success = this.receivedResult(item, now);
-    if (success) {
-        this.log('Received result with rid=' + item.rid);
-    } else {
-        this.log('Received timed out result rid=' + item.rid + ', to be ignored');
-    }
+    ;;; if (success) {
+    ;;;     this.log('Received result with rid=' + item.rid);
+    ;;; } else {
+    ;;;     this.log('Received timed out result rid=' + item.rid + ', to be ignored');
+    ;;; }
     return success;
 };
 
 kukit.rm.RequestManager.prototype.timeoutItem = function(item) {
     /* Time out this item. */
-    this.log('Timed out request rid=' + item.rid);
+    ;;; this.log('Timed out request rid=' + item.rid);
     // Call the timeout hook on the item
     item.callTimeoutHook();
 };
@@ -339,7 +339,7 @@
         this.pushSentRequest(item, now);
     } else {
         this.pushWaitingRequest(item, now);
-        this.log('Queue server notification at ' + item.url + ', rid=' + item.rid);
+        ;;; this.log('Queue server notification at ' + item.url + ', rid=' + item.rid);
     }
 };
 

Modified: kukit/kukit.js/trunk/kukit/resourcedata.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/resourcedata.js	(original)
+++ kukit/kukit.js/trunk/kukit/resourcedata.js	Mon Jun 11 18:04:11 2007
@@ -47,18 +47,21 @@
     if (! name) {
         throw 'KssSelector must have name';
     }
-    if (name.indexOf('@') != -1)
-        throw new kukit.err.rd.KssSelectorError('Kss selector name must not contain @: "' + name + '"');
-    if (id && id.indexOf('@') != -1)
-        throw new kukit.err.rd.KssSelectorError('Kss selector id must not contain @: "' + id + '"');
-    if (namespace && namespace.indexOf('@') != -1)
-        throw new kukit.err.rd.KssSelectorError('Kss selector namespace must not contain @: "' + namespace + '"');
-    if (! isEvent) {
-        // method rule
-        if (css != 'document' && css != 'behaviour') {
-            throw new kukit.err.rd.KssSelectorError('KssSpecialSelector "' + name + '" must have one of the allowed names');
-        }
-    }
+    ;;; if (name.indexOf('@') != -1) {
+    ;;;    throw new kukit.err.rd.KssSelectorError('Kss selector name must not contain @: "' + name + '"');
+    ;;;    }
+    ;;; if (id && id.indexOf('@') != -1) {
+    ;;;     throw new kukit.err.rd.KssSelectorError('Kss selector id must not contain @: "' + id + '"');
+    ;;;    }
+    ;;; if (namespace && namespace.indexOf('@') != -1) {
+    ;;;     throw new kukit.err.rd.KssSelectorError('Kss selector namespace must not contain @: "' + namespace + '"');
+    ;;;    }
+    ;;; if (! isEvent) {
+    ;;;     // method rule
+    ;;;     if (css != 'document' && css != 'behaviour') {
+    ;;;         throw new kukit.err.rd.KssSelectorError('KssSpecialSelector "' + name + '" must have one of the allowed names');
+    ;;;    }
+    ;;; }
     this.css = css;
     this.name = name;
     this.namespace = namespace;
@@ -121,7 +124,7 @@
     // Check syntax
     var f = registry.get(this.methodname);
     this.pprovider = new f();
-    this.pprovider.check(this.args);
+    ;;; this.pprovider.check(this.args);
 };
 
 kukit.rd.KssMethodValue.prototype.evaluate = function(parms, key, node, defaultparms) {
@@ -155,13 +158,13 @@
         this.nr = kukit.rd.EventRuleNr;
         this.mergednr = null;
         kukit.rd.EventRuleNr = this.nr + 1;
-        var namestr;
-        if (kss_selector.namespace) {
-            namestr = kss_selector.namespace + '-' + kss_selector.name;
-        } else {
-            namestr = kss_selector.name;
-        }
-        kukit.logDebug("EventRule #" + this.getNr() + ": " + kss_selector.css + ' EVENT=' + namestr);
+        ;;; var namestr;
+        ;;; if (kss_selector.namespace) {
+        ;;;     namestr = kss_selector.namespace + '-' + kss_selector.name;
+        ;;; } else {
+        ;;;     namestr = kss_selector.name;
+        ;;; }
+        ;;; kukit.logDebug("EventRule #" + this.getNr() + ": " + kss_selector.css + ' EVENT=' + namestr);
         this.kss_selector = kss_selector;
         this.parms = parms;
         this.actions = actions;
@@ -192,9 +195,9 @@
                 counter += 1;
                 }
         }
-        if (counter > 0) {
-            kukit.logDebug('EventRule #' + this.getNr() + ' mergeid ' + this.kss_selector.mergeid + ' selected ' + counter + ' nodes');
-        }
+        ;;; if (counter > 0) {
+        ;;;     kukit.logDebug('EventRule #' + this.getNr() + ' mergeid ' + this.kss_selector.mergeid + ' selected ' + counter + ' nodes');
+        ;;; }
     } else if (typeof(in_nodes) == 'undefined') {
         // Method selector. They only need to be handled on the initial
         // pageload, when the in_nodes parameter is ommitted.
@@ -252,28 +255,28 @@
 };
 
 kukit.rd.EventRule.prototype.merge = function(other) {
-    if (! this.isMerged()) {
-        throw "Cannot merge into a genuine event rule";
-    }
-    if (this.kss_selector.isEventSelector) {
-        if (this.kss_selector.id != other.kss_selector.id) {
-            throw "Differing kss selector ids in event rule merge";
-        }
-        if (this.kss_selector.classname != other.kss_selector.classname) {
-            throw "Differing kss selector classes in event rule merge";
-        }
-    }
-    if (this.kss_selector.name != other.kss_selector.name) {
-        throw "Differing kss selector names in event rule merge";
-    }
+    ;;; if (! this.isMerged()) {
+    ;;;     throw "Cannot merge into a genuine event rule";
+    ;;; }
+    ;;; if (this.kss_selector.isEventSelector) {
+    ;;;     if (this.kss_selector.id != other.kss_selector.id) {
+    ;;;         throw "Differing kss selector ids in event rule merge";
+    ;;;     }
+    ;;;     if (this.kss_selector.classname != other.kss_selector.classname) {
+    ;;;         throw "Differing kss selector classes in event rule merge";
+    ;;;     }
+    ;;; }
+    ;;; if (this.kss_selector.name != other.kss_selector.name) {
+    ;;;     throw "Differing kss selector names in event rule merge";
+    ;;; }
     this.mergednr = this.mergednr + ',' + other.getNr();
     for (var key in other.parms) {
         this.parms[key] = other.parms[key];
     }
     this.actions.merge(other.actions);
-    if (this.mergednr.substr(0, 1) != 'X')
-        // ignore initial clone-merge
-        kukit.logDebug('Merged rule ' + this.mergednr + ' mergeid ' + this.kss_selector.mergeid);
+    ;;; if (this.mergednr.substr(0, 1) != 'X')
+    ;;;     // ignore initial clone-merge
+    ;;;     kukit.logDebug('Merged rule ' + this.mergednr + ' mergeid ' + this.kss_selector.mergeid);
 };
 
 kukit.rd.EventRule.prototype.mergeIntoDict = function(dict, key, eventrule) {
@@ -303,6 +306,13 @@
     this.content = {};
 };
 
+kukit.rd.ActionSet.prototype.hasActions = function() {
+    for (var name in this.content) {
+        return true;
+    }
+    return false;
+};
+
 kukit.rd.ActionSet.prototype.merge = function(other) {
     for (var key in other.content) {
         var action = this.content[key];
@@ -312,8 +322,9 @@
                 // new action
                 action = new kukit.rd.Action();
                 this.content[key] = action;
-            } else {
-                throw new kukit.err.rd.RuleMergeError('Cannot action-delete unexisting action, "' + key + '"');
+             } else {
+                ;;; kukit.E = new kukit.err.rd.RuleMergeError('Cannot action-delete unexisting action, "' + key + '"');
+                throw kukit.E;
             }
         }
         if (action2.type != 'X') {
@@ -366,9 +377,9 @@
 
 kukit.rd.ActionSet.prototype.deleteAction = function(name) {
     var action = this.content[name];
-    if (typeof(action) == 'undefined') {
-        throw('Action "' + name + '" does not exist and cannot be deleted.');
-    }
+    ;;; if (typeof(action) == 'undefined') {
+    ;;;     throw('Action "' + name + '" does not exist and cannot be deleted.');
+    ;;; }
     delete this.content[name];
 
 };
@@ -394,14 +405,14 @@
 };
 
 kukit.rd.Action.prototype.setName = function(name) {
-    if (this.name != null && this.name != name) {
-        throw new kukit.err.rd.RuleMergeError('Error overriding action name "' + this.name + '" to "' + name + '" (Unmatching action names at merge?)');
-    }
+    ;;; if (this.name != null && this.name != name) {
+    ;;;     throw new kukit.err.rd.RuleMergeError('Error overriding action name "' + this.name + '" to "' + name + '" (Unmatching action names at merge?)');
+    ;;; }
     this.name = name;
     if (name == 'default') {
-        if (this.type != null && this.type != 'D') {
-            throw new kukit.err.rd.RuleMergeError('Error setting action to default on action "' + this.name + '", current type "' + this.type + '"');
-        }
+        ;;; if (this.type != null && this.type != 'D') {
+        ;;;     throw new kukit.err.rd.RuleMergeError('Error setting action to default on action "' + this.name + '", current type "' + this.type + '"');
+        ;;; }
         this.setType('D');
     }
 };
@@ -413,20 +424,19 @@
     //  E = error / client
     //  D = default (unsettable)
     //  X = cancel action
-    if ((type != 'S' && type != 'C' && type != 'E' && type != 'X') ||
-            (this.type != null && this.type != type)) {
-        throw new kukit.err.rd.RuleMergeError('Error setting action type on action "' + this.name + '" from "' + this.type + '" to "' + type + '" (Attempt to merge client, server or error actions?)');
-    }
-    if (this.error != null && this.type != 'S') {
-        throw new kukit.err.rd.RuleMergeError('Error setting action error handler on action "' + this.name + '", this is only allowed on server actions.');
-    }
+    ;;; if ((type != 'S' && type != 'C' && type != 'E' && type != 'X') || (this.type != null && this.type != type)) {
+    ;;;     throw new kukit.err.rd.RuleMergeError('Error setting action type on action "' + this.name + '" from "' + this.type + '" to "' + type + '" (Attempt to merge client, server or error actions?)');
+    ;;; }
+    ;;; if (this.error != null && this.type != 'S') {
+    ;;;     throw new kukit.err.rd.RuleMergeError('Error setting action error handler on action "' + this.name + '", this is only allowed on server actions.');
+    ;;; }
     this.type = type;  
 };
 
 kukit.rd.Action.prototype.setError = function(error) {
-    if (this.type != null && this.type != 'S') {
-        throw new kukit.err.rd.RuleMergeError('Error setting action error handler on action "' + this.name + '", this is only allowed on server actions.');
-    }
+    ;;; if (this.type != null && this.type != 'S') {
+    ;;;     throw new kukit.err.rd.RuleMergeError('Error setting action error handler on action "' + this.name + '", this is only allowed on server actions.');
+    ;;; }
     this.error = error;  
 };
 
@@ -447,26 +457,25 @@
     }
 };
 
-kukit.rd.Action.prototype.makeActionOper = function(oper, defaultparms) {
+kukit.rd.Action.prototype.makeActionOper = function(oper) {
     // Fill the completed action parameters, based on the node
-    // if defaultparms is given, its values can be used with the 
-    // pass() function.
-    // The kssXxx parameters, reserved for the action, are put into
-    // aparms.
+    // The kssXxx parameters, reserved for the action, are 
+    // handled as appropriate.
     // A cloned oper is returned.
     var parms = {};
     var aparms = {};
-    if (typeof(defaultparms) == 'undefined') {
-        defaultparms = {};
+    // Make sure we have defaultparms on oper
+    if (typeof(oper.defaultparms) == 'undefined') {
+        oper.defaultparms = {};
     }
     for (var key in this.parms) {
         var kssvalue = this.parms[key]; 
         if (key.match(/^kss/)) {
             // kssXxx parameters are separated to aparms.
-            kssvalue.evaluate(aparms, key, oper.node, defaultparms); 
+            kssvalue.evaluate(aparms, key, oper.node, oper.defaultparms); 
         } else {
             // evaluate the method parameters into parms
-            kssvalue.evaluate(parms, key, oper.node, defaultparms); 
+            kssvalue.evaluate(parms, key, oper.node, oper.defaultparms); 
         }
     }
     var aoper = oper.clone({
@@ -478,7 +487,7 @@
 };
 
 kukit.rd.Action.prototype.execute = function(oper) {
-    oper = this.makeActionOper(oper, oper.parms);
+    oper = this.makeActionOper(oper);
     switch (this.type) {
         case 'D': {
             // Default action.
@@ -599,13 +608,13 @@
         }
         counter += 1;
     }
-    kukit.logDebug('Binding to ' + counter + ' nodes in grand total');
+    ;;; kukit.logDebug('Binding to ' + counter + ' nodes in grand total');
     // Execute the load actions in a deferred manner
     var loadactions = this.loadScheduler;
     if (! loadactions.empty()) {
-        kukit.logDebug('Start executing delayed load actions');
+        ;;; kukit.logDebug('Start executing delayed load actions');
         var nr = loadactions.executeAll();
-        kukit.logDebug('Executed ' + nr + ' load actions');
+        ;;; kukit.logDebug('Executed ' + nr + ' load actions');
     }
 };
 
@@ -647,9 +656,9 @@
     // Get the entry by the type which is now at css
     var category = eventrule.kss_selector.css;
     var dict = this.content[category];
-    if (typeof(dict) == 'undefined') {
-        throw 'Unknown method rule category "' + category + '"';
-    }
+    ;;; if (typeof(dict) == 'undefined') {
+    ;;;     throw 'Unknown method rule category "' + category + '"';
+    ;;; }
     // Merge into the corresponding category
     eventrule.mergeIntoDict(dict, eventrule.kss_selector.mergeid, eventrule);
 };
@@ -658,9 +667,9 @@
     // Returns the rule for a given event instance, 
     // Get the entry by category (= document or behaviour)
     var dict = this.content[category];
-    if (typeof(dict) == 'unde