Author: reebalazs
Date: Fri Sep  7 15:28:39 2007
New Revision: 46400

Modified:
   kukit/kukit.js/trunk/kukit/dom.js
   kukit/kukit.js/trunk/kukit/plugin.js
   kukit/kukit.js/trunk/kukit/providerreg.js
Log:
Fix logging from the event binder of [load, iload], that caused document:load 
fail in development mode

Modified: kukit/kukit.js/trunk/kukit/dom.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/dom.js   (original)
+++ kukit/kukit.js/trunk/kukit/dom.js   Fri Sep  7 15:28:39 2007
@@ -279,6 +279,24 @@
     kukit.dom.setAttribute(node, fullName);
 };
 
+
+kukit.dom.getKssIdFilterFactory = function(prefix) {
+    var re_prefix = Regexp('^'+prefix);
+    return function(node, attrname) {
+        ;;; if (attrname != 'id') {
+        ;;;     throw new Error('getKssIdFilterFactory can only work on id, no 
other attributes');
+        ;;; }
+        var result = node.id;
+        if (result.match(re_prefix)) {
+            return result;
+        } else {
+            return null;
+        }
+    };
+};
+
+
+
 /* Recursive getting of node attributes
    getter is a function that gets the value from the node.
 */

Modified: kukit/kukit.js/trunk/kukit/plugin.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/plugin.js        (original)
+++ kukit/kukit.js/trunk/kukit/plugin.js        Fri Sep  7 15:28:39 2007
@@ -423,8 +423,18 @@
         // we need to execute immediately.
         var func_to_bind = loadoper.makeExecuteActionsHook();
         var remark = '';
-;;;     remark += '[load] event execution for node [';
-;;;     remark += loadoper.node.tagName.toLowerCase() + ']';
+;;;     remark += '[load] event execution for ';
+;;;     // loadoper can execute on document!
+;;;     // Is this the case? 
+;;;     if (loadoper.node == null) {
+;;;         // document:load
+;;;         remark += '[document]';
+;;;     } else {
+;;;         // <node>:load
+;;;         remark += 'node [';
+;;;         remark += loadoper.node.tagName.toLowerCase();
+;;;         remark += ']';
+;;;     }
         kukit.engine.bindScheduler.addPost(func_to_bind, remark);
     }
     if (iloadoper) {

Modified: kukit/kukit.js/trunk/kukit/providerreg.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/providerreg.js   (original)
+++ kukit/kukit.js/trunk/kukit/providerreg.js   Fri Sep  7 15:28:39 2007
@@ -316,3 +316,29 @@
 };
 kukit.pprovidersGlobalRegistry.register('pass', kukit.pr.PassPP);
 
+kukit.pr.KssIdPP = function() {};
+kukit.pr.KssIdPP.prototype = {
+    check: function(args) {
+;;;     if (args.length != 0 && args.length != 1) {
+;;;         kukit.E = 'kssId method needs 0 or 1 argument (type)';
+;;;         throw new Error(kukit.E);
+;;;     }
+;;;     if (! args[0].match(/~[a-z0-9]$/)) {
+;;;         kukit.E = 'type parameter in kssId method must be ';
+;;;         kukit.E += 'lowercase alphanumeric.';
+;;;         throw new Error(kukit.E);
+;;;     }
+    },
+    eval: function(args, node) {
+        var type =  args[0];
+        var prefix = 'kssid-';
+        if (args.length == 1) {
+            prefix += args[0] + '-';
+        }
+        return kukit.dom.getRecursiveAttribute(node, 'id', true,
+            kukit.dom.getKssIdFilterFactory(prefix));
+    }
+};
+kukit.pprovidersGlobalRegistry.register('kssId', kukit.pr.KssIdPP);
+
+
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to