Author: gotcha
Date: Sat Sep 15 21:39:49 2007
New Revision: 46656

Modified:
   kukit/kukit.js/branch/firekiss/kukit/eventreg.js
   kukit/kukit.js/branch/firekiss/kukit/kssparser.js
   kukit/kukit.js/branch/firekiss/kukit/plugin.js
   kukit/kukit.js/branch/firekiss/kukit/resourcedata.js
Log:
changes to cooperate with firekiss at revision 46655

Modified: kukit/kukit.js/branch/firekiss/kukit/eventreg.js
==============================================================================
--- kukit/kukit.js/branch/firekiss/kukit/eventreg.js    (original)
+++ kukit/kukit.js/branch/firekiss/kukit/eventreg.js    Sat Sep 15 21:39:49 2007
@@ -572,7 +572,7 @@
 };
 
 kukit.er.BinderInfo.prototype.startBindingPhase = function () {
-    // The bindind phase starts and it has the information for
+    // The binding phase starts and it has the information for
     // the currently on-bound events.
     this.binding = new kukit.er.OperRegistry();
 };

Modified: kukit/kukit.js/branch/firekiss/kukit/kssparser.js
==============================================================================
--- kukit/kukit.js/branch/firekiss/kukit/kssparser.js   (original)
+++ kukit/kukit.js/branch/firekiss/kukit/kssparser.js   Sat Sep 15 21:39:49 2007
@@ -424,7 +424,7 @@
 /*
 * class PropValueInPseudo
 *
-* PropValue in pseudo must ba single word with no spaces around.
+* PropValue in pseudo must be single word with no spaces around.
 */
 kukit.kssp.PropValueInPseudo = kukit.tk.mkParser('propvalue', {
     "{": 'this.emitAndReturn()',
@@ -683,16 +683,6 @@
         // Store event rules in the common list
         for (var i=0; i<parser.eventRules.length; i++) {
             var rule = parser.eventRules[i];
-            // finish up the KSS on it
-;;;         try {
-            rule.kssSelector.setIdAndClass();
-;;;         } catch(e) {
-;;;             // foolishly, we don't know the position at this point
-;;;             kukit.E = 'Undefined event : [';
-;;;             kukit.E += rule.kssSelector.namespace;
-;;;             kukit.E += ':' + rule.kssSelector.name + '].';
-;;;             throw new kukit.err.tk.ParsingError(kukit.E);
-;;;         }
             this.rules.push(rule);
         }
 ;;; } catch(e) {

Modified: kukit/kukit.js/branch/firekiss/kukit/plugin.js
==============================================================================
--- kukit/kukit.js/branch/firekiss/kukit/plugin.js      (original)
+++ kukit/kukit.js/branch/firekiss/kukit/plugin.js      Sat Sep 15 21:39:49 2007
@@ -354,7 +354,7 @@
     }
     oper.evalBool('initial');
     oper.evalBool('insert');
-    var phase = oper.node._kukitmark;
+    var phase = oper.node._kukitMark;
     if (phase == 1 && ! oper.parms.initial) {
 ;;;     var msg = 'EventRule #' + oper.eventRule.getIndex() + ' mergeId [';
 ;;;     msg += oper.eventRule.kssSelector.mergeId + '] event ignored,';
@@ -428,7 +428,7 @@
         kukit.engine.bindScheduler.addPost(func_to_bind, remark);
     }
     if (iloadoper) {
-        var phase = iloadoper.node._kukitmark;
+        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)) {

Modified: kukit/kukit.js/branch/firekiss/kukit/resourcedata.js
==============================================================================
--- kukit/kukit.js/branch/firekiss/kukit/resourcedata.js        (original)
+++ kukit/kukit.js/branch/firekiss/kukit/resourcedata.js        Sat Sep 15 
21:39:49 2007
@@ -41,9 +41,12 @@
 kukit.rd.KssSelector = function(isEvent, css, name, namespace, id) {
     this.isEventSelector = isEvent;
     this.isMethodSelector = ! isEvent;
-    if (! name) {
-        throw 'KssSelector must have name';
-    }
+// XXX GC row and column are wrong...
+// XXX move parsing errors to parser
+;;; if (! name) {
+;;;     var msg = 'Kss selector must have a name.';
+;;;     throw new kukit.err.rd.KssSelectorError(msg);
+;;; }
 ;;; if (name.indexOf('@') != -1) {
 ;;;     var msg = 'Kss selector name must not contain @: [' + name + '].';
 ;;;     throw new kukit.err.rd.KssSelectorError(msg);
@@ -61,7 +64,7 @@
 ;;;     // method rule
 ;;;     if (css != 'document' && css != 'behaviour') {
 ;;;         var msg = 'KssSpecialSelector [' + name;
-;;;         msg = msg + '] must have one of the allowed names';
+;;;         msg = msg + '] must have one of the allowed names.';
 ;;;         throw new kukit.err.rd.KssSelectorError(msg);
 ;;;    }
 ;;; }
@@ -69,11 +72,23 @@
     this.name = name;
     this.namespace = namespace;
     this.className = null;
-    this.id = id;
+    this.i = id;
+    // finish up the KSS on it
+    // XXX GC instead of relying on exceptions, test if key exists
+;;; try {
+        this.setIdAndClass();
+;;; } catch(e) {
+;;;     // foolishly, we don't know the position at this point
+;;;     kukit.E = 'Undefined event : [';
+;;;     kukit.E += namespace;
+;;;     kukit.E += ':' + name + '].';
+;;;     throw new kukit.err.rd.KssSelectorError(kukit.E);
+;;; }
 };
 
 kukit.rd.KssSelector.prototype.setIdAndClass = function() {
     // Sets up id and class on the selector, based on registration info
+    // XXX GC instead of relying on exceptions, test if key exists
     this.className = kukit.eventsGlobalRegistry.get(
         this.namespace, this.name).className;
     if (this.id == null) {
@@ -211,7 +226,7 @@
             // XXX never rebind to any node again!
             // this compensates that cssQuery is returning
             // results out of the subtree
-            if (typeof(node._kukitmark) == 'undefined') {
+            if (typeof(node._kukitMark) == 'undefined') {
                 ruletable.add(node, this);
                 counter += 1;
                 }
@@ -248,6 +263,7 @@
 */
 
 kukit.rd.EventRule.prototype.bind = function(node) {
+    this.store(node);
     // Creation of the binding oper
     var oper = new kukit.op.Oper();
     var binderInfo = this.getBinderInfo();
@@ -259,6 +275,13 @@
     binderInfo.bindOper(oper); 
 };
 
+kukit.rd.EventRule.prototype.store = function(node) {
+    if (typeof(node.kukitEventRules) == 'undefined') {
+        var rules = [];
+        node.kukitEventRules = rules;
+    }
+    node.kukitEventRules.push(this);
+};
 
 /*
 * Merging event rules
@@ -653,10 +676,10 @@
     for (var nodehash in this.nodes) {
         var nodeval = this.nodes[nodehash];
         // XXX Mark the node, disabling rebinding in a second round
-        nodeval.node._kukitmark = phase;
+        nodeval.node._kukitMark = phase;
         for (var id in nodeval.val) {
             var eventRule = nodeval.val[id];
-            eventRule.bind(nodeval.node);            
+            eventRule.bind(nodeval.node);
         }
         counter += 1;
     }
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to