Author: reebalazs
Date: Mon May  7 13:46:29 2007
New Revision: 42793

Modified:
   kukit/kukit.js/branch/ree-stripout-comments/kukit/dom.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/oper.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js
   kukit/kukit.js/branch/ree-stripout-comments/kukit/utils.js
Log:
A few commentification fixes and improvements.

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/dom.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/dom.js    (original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/dom.js    Mon May  7 
13:46:29 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';
+        ;;; throw 'Selection error in kukit.dom.cssQuery';
+        throw 'E';
     }
     return kukit.dom._cssQuery(selector, in_nodes);
 };

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js       
(original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js       Mon May 
 7 13:46:29 2007
@@ -678,12 +678,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);
-        throw 'E';
-    }
+    ;;; } 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.

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/oper.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/oper.js   (original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/oper.js   Mon May  7 
13:46:29 2007
@@ -118,20 +118,21 @@
                 // The value already contains the results
                 nodes = this.aparms[key];
             } break;
-            ;;; default: {
-            ;;;    throw 'No kss parameter "' + key + '" allowed in 
action-client. (Normal parameters cannot start with kss.)';
-            ;;; } break;
+            default: {
+               ;;; throw 'No kss parameter "' + key + '" allowed in 
action-client. (Normal parameters cannot start with kss.)';
+               throw '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);
@@ -184,8 +185,7 @@
                 // Value will be evaluated.
             } break;
             default: {
-                ;;; throw 'No kss parameter "' + key + '" allowed in 
action-server. (Normal parameters cannot start with kss.)';
-                throw 'E';
+                throw 'No kss parameter "' + key + '" allowed in 
action-server. (Normal parameters cannot start with kss.)';
             } break;
         }
     }
@@ -221,6 +221,7 @@
         // (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;

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js (original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js Mon May  7 
13:46:29 2007
@@ -140,9 +140,9 @@
 };
 
 kukit.pl.NativeEventBinder.prototype.__bind__nodeorwindow = function(name, 
func_to_bind, oper) {
-    ;;; if (oper.node == null) {
-    ;;;     oper.node = window;
-    ;;; }
+    if (oper.node == null) {
+        oper.node = window;
+    }
     this.__bind__(name, func_to_bind, oper);
 };
 
@@ -252,23 +252,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();
@@ -278,6 +272,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);
     }
 };
 
@@ -299,7 +297,7 @@
         // 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.componentname = 'load event binding';
         oper.completeParms([], {'initial': 'true', 'insert': 'true'});
@@ -572,7 +570,8 @@
     ;;; oper.componentname = 'setAttribute action';
     oper.completeParms(['name', 'value'], {});
     if (oper.parms.name.toLowerCase() == 'style') {
-        throw 'Style attribute is not allowed with setAttribute';
+        ;;; throw 'Style attribute is not allowed with setAttribute';
+        throw 'E';
     }
     kukit.dom.setAttribute(oper.node, oper.parms.name, oper.parms.value);
 });
@@ -766,7 +765,7 @@
     ;;; 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);
 

Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/utils.js
==============================================================================
--- kukit/kukit.js/branch/ree-stripout-comments/kukit/utils.js  (original)
+++ kukit/kukit.js/branch/ree-stripout-comments/kukit/utils.js  Mon May  7 
13:46:29 2007
@@ -277,7 +277,8 @@
 
 kukit.ut.TimerCounter.prototype.start = function() {
     if (this.timer) {
-        throw 'Timer already started.';
+        ;;; throw 'Timer already started.';
+        throw 'E';
     }
     var self = this;
     var func = function() {
@@ -392,14 +393,14 @@
                 break;
             }
             ;;; kukit.log('Starting ' + item.remark);
-            var ts_start = (new Date()).valueOf();
+            ;;; var ts_start = (new Date()).valueOf();
             try {
                 item.func();
             } catch(e) {
                 this.lock = false;
-                throw(e);
+                throw e;
             }
-            var ts_end = (new Date()).valueOf();
+            ;;; var ts_end = (new Date()).valueOf();
             ;;; kukit.log('Finished ' + item.remark + ' in ' + (ts_end - 
ts_start) + ' ms');
         }
         this.lock = false;
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to