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

reebalazs at codespeak.net reebalazs at codespeak.net
Mon Jan 1 14:09:13 CET 2007


Author: reebalazs
Date: Mon Jan  1 14:09:06 2007
New Revision: 36089

Modified:
   kukit/kukit.js/trunk/kukit/commandreg.js
   kukit/kukit.js/trunk/kukit/dom.js
   kukit/kukit.js/trunk/kukit/eventreg.js
   kukit/kukit.js/trunk/kukit/kssparser.js
   kukit/kukit.js/trunk/kukit/kukit.js
   kukit/kukit.js/trunk/kukit/plugin.js
   kukit/kukit.js/trunk/kukit/requestmanager.js
   kukit/kukit.js/trunk/kukit/resourcedata.js
   kukit/kukit.js/trunk/kukit/tokenizer.js
   kukit/kukit.js/trunk/kukit/utils.js
Log:
make changes to enable full compression.

Most of this will not be necessary with the enhanced parser though.

workarounds:
- missing semicolons
- don't use _SARISSA...
- /* */ in strings escaped

Modified: kukit/kukit.js/trunk/kukit/commandreg.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/commandreg.js	(original)
+++ kukit/kukit.js/trunk/kukit/commandreg.js	Mon Jan  1 14:09:06 2007
@@ -48,7 +48,7 @@
     // register a given action as a command, using the given vactor
     var f = kukit.ar.actionRegistry.get(srcname);
     factory(name, f);
-}
+};
 
 kukit.cr.CommandRegistry.prototype.register = function(name, klass) {
     if (this.content[name]) {
@@ -81,7 +81,7 @@
     command.parms = parms;
     command.transport = transport;
     return command;
-}
+};
 
 kukit.cr._Command_execute = function(oper) {
     var newoper = oper.clone({

Modified: kukit/kukit.js/trunk/kukit/dom.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/dom.js	(original)
+++ kukit/kukit.js/trunk/kukit/dom.js	Mon Jan  1 14:09:06 2007
@@ -38,13 +38,13 @@
         toNode = toNode.nextSibling;
     }
     return toNode;
-}
+};
 
 kukit.dom.insertBefore = function(nodeFrom, parentNode, nodeTo) {
     var ownerDoc = nodeTo.nodeType == Node.DOCUMENT_NODE ? nodeTo : nodeTo.ownerDocument;
     var nodes = nodeFrom.childNodes;
     var result = new Array();
-    if(ownerDoc.importNode && (!_SARISSA_IS_IE)) {
+    if(ownerDoc.importNode && (!kukit.HAVE_IE)) {
         for(var i=0;i < nodes.length;i++) {
             result[i] = parentNode.insertBefore(ownerDoc.importNode(nodes[i], true), nodeTo);
         }
@@ -59,7 +59,7 @@
 kukit.dom.appendChildren = function(nodes, toNode) {
     var ownerDoc = toNode.nodeType == Node.DOCUMENT_NODE ? toNode : toNode.ownerDocument;
     var result = new Array();
-    if(ownerDoc.importNode && (!_SARISSA_IS_IE)) {
+    if(ownerDoc.importNode && (!kukit.HAVE_IE)) {
         for(var i=0;i < nodes.length;i++) {
             result[i] = toNode.appendChild(ownerDoc.importNode(nodes[i], true));
         }
@@ -302,7 +302,7 @@
     //this.counter.timeout();
     // XXX can't execute immediately, it fails on IE.
     this.counter.start();
-}
+};
 
 // From http://xkr.us/articles/dom/iframe-document/
 // Note it's not necessary for the iframe to have the name
@@ -314,7 +314,7 @@
         doc = doc.document;
     }
     return doc
-}
+};
 
 kukit.dom.EmbeddedContentLoadedScheduler.prototype.check = function() {
     // quit if the init function has already been called

Modified: kukit/kukit.js/trunk/kukit/eventreg.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/eventreg.js	(original)
+++ kukit/kukit.js/trunk/kukit/eventreg.js	Mon Jan  1 14:09:06 2007
@@ -120,7 +120,7 @@
         throw 'In EventRegistry.register namespace cannot contain -';
     }
     return namespace + '-' + eventname;
-}
+};
 
 kukit.er.EventRegistry.prototype.exists = function(namespace, eventname) {
     var key = this._getKey(namespace, eventname);
@@ -165,7 +165,7 @@
         oper.binderinstance = this;
         method.call(this, name, oper);
     }
-}
+};
 
 /* This can be called on the event and will execute the
 *  desired event action. Parameters will be these + those
@@ -219,7 +219,7 @@
         special += 1;
     }
     kukit.logDebug('Event "' + name + '" executed on ' + executed + ' nodes, ' + special + ' special kss targets.');
-}
+};
 
 kukit.er.EventBinder_triggerevent = function(name, oper) {
     // Private. Called from __trigger_event__ or from main event execution.
@@ -232,7 +232,7 @@
         // In case there is no event rule, just call the default event action.
         // This is programmatic calling.
         var namespace = this.__event_namespace__;
-        kukit.logDebug('Calling implicit event "' + name + '" on namespace "' + namespace + '"')
+        kukit.logDebug('Calling implicit event "' + name + '" on namespace "' + namespace + '"');
         this._EventBinder_calldefault(namespace, name, oper);
     }
 };

Modified: kukit/kukit.js/trunk/kukit/kssparser.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/kssparser.js	(original)
+++ kukit/kukit.js/trunk/kukit/kssparser.js	Mon Jan  1 14:09:06 2007
@@ -25,8 +25,8 @@
 
 /* Tokens */
 
-kukit.kssp.commentbegin = kukit.tk.mkToken('commentbegin', "/*");
-kukit.kssp.commentend = kukit.tk.mkToken('commentend', "*/");
+kukit.kssp.commentbegin = kukit.tk.mkToken('commentbegin', "\/\*");
+kukit.kssp.commentend = kukit.tk.mkToken('commentend', "\*\/");
 kukit.kssp.openbrace = kukit.tk.mkToken('openbrace', "{");
 kukit.kssp.closebrace = kukit.tk.mkToken('closebrace', "}");
 kukit.kssp.openbracket = kukit.tk.mkToken('openbracket', "[");
@@ -44,7 +44,7 @@
 /* Parsers */
 
 kukit.kssp.document = kukit.tk.mkParser('document', {
-    "/*": 'new kukit.kssp.comment(this.src, kukit.kssp.commentbegin)',
+    "\/\*": 'new kukit.kssp.comment(this.src, kukit.kssp.commentbegin)',
     "{": 'new kukit.kssp.block(this.src, kukit.kssp.openbrace)'
     });
 kukit.kssp.document.prototype.process = function() {
@@ -78,7 +78,7 @@
 
 // it's not 100% good, but will do
 kukit.kssp.comment = kukit.tk.mkParser('comment', {
-    "*/": 'this.emitAndReturn(new kukit.kssp.commentend(this.src))'
+    "\*\/": 'this.emitAndReturn(new kukit.kssp.commentend(this.src))'
     });
 kukit.kssp.comment.prototype.process = function() {
     this.result = [];
@@ -210,7 +210,7 @@
     ",": 'this.emitAndReturn()',
     "'": 'new kukit.kssp.string(this.src, kukit.kssp.quote)',
     '"': 'new kukit.kssp.string2(this.src, kukit.kssp.dquote)',
-    "/*": 'new kukit.kssp.comment(this.src, kukit.kssp.commentbegin)',
+    "\/\*": 'new kukit.kssp.comment(this.src, kukit.kssp.commentbegin)',
     "(": 'new kukit.kssp.methodargs(this.src, kukit.kssp.openparent)'
     });
 kukit.kssp.propvalue.prototype.process = function() {
@@ -264,7 +264,7 @@
 kukit.kssp.propvalue.prototype.produceTxt = function(txt) {
     // txt parms are returned embedded
     this.value = new kukit.rd.KssTextValue(txt);
-}
+};
 
 // propvalue in method cannot contain method-style vars.
 kukit.kssp.propvalue_in_method = kukit.tk.mkParser('propvalue', {
@@ -275,7 +275,7 @@
     ",": 'this.emitAndReturn()',
     "'": 'new kukit.kssp.string(this.src, kukit.kssp.quote)',
     '"': 'new kukit.kssp.string2(this.src, kukit.kssp.dquote)',
-    "/*": 'new kukit.kssp.comment(this.src, kukit.kssp.commentbegin)'  //,
+    "\/\*": 'new kukit.kssp.comment(this.src, kukit.kssp.commentbegin)'  //,
     });
 kukit.kssp.propvalue_in_method.prototype.multiword_allowed = false;
 kukit.kssp.propvalue_in_method.prototype.process = kukit.kssp.propvalue.prototype.process;
@@ -291,7 +291,7 @@
     "\t": 'this.emitAndReturn()',
     "\n": 'this.emitAndReturn()',
     "\r": 'this.emitAndReturn()',
-    "/*": 'this.emitAndReturn()',
+    "\/\*": 'this.emitAndReturn()',
     ":": 'this.emitAndReturn()',
     "(": 'this.emitAndReturn(new kukit.kssp.methodargs(this.src, kukit.kssp.openparent))'
     });
@@ -301,7 +301,7 @@
 kukit.kssp.propvalue_in_pseudo.prototype.produceTxt = function(txt) {
     // txt parms are returned embedded
     this.value = new kukit.rd.KssPseudoValue(txt, []);
-}
+};
 
 kukit.kssp.string = kukit.tk.mkParser('string', {
     "'": 'this.emitAndReturn(new kukit.kssp.quote(this.src))',
@@ -345,7 +345,7 @@
     '"': 'new kukit.kssp.string2(this.src, kukit.kssp.dquote)',
     ",": 'new kukit.kssp.comma(this.src)',
     ")": 'this.emitAndReturn(new kukit.kssp.closeparent(this.src))',
-    "/*": 'new kukit.kssp.comment(this.src, kukit.kssp.commentbegin)'
+    "\/\*": 'new kukit.kssp.comment(this.src, kukit.kssp.commentbegin)'
     });
 kukit.kssp.methodargs.prototype.process = function() {
     this.args = [];
@@ -381,7 +381,7 @@
 kukit.kssp.kssselector = kukit.tk.mkParser('kssselector', {
     ":": '[new kukit.kssp.colon(this.src), new kukit.kssp.propvalue_in_pseudo(this.src)]',
     "{": 'this.emitAndReturn()',
-    "/*": 'new kukit.kssp.comment(this.src, kukit.kssp.commentbegin)'
+    "\/\*": 'new kukit.kssp.comment(this.src, kukit.kssp.commentbegin)'
     });
 kukit.kssp.kssselector.prototype.process = function() {
     var name;

Modified: kukit/kukit.js/trunk/kukit/kukit.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/kukit.js	(original)
+++ kukit/kukit.js/trunk/kukit/kukit.js	Mon Jan  1 14:09:06 2007
@@ -271,10 +271,9 @@
 };
 
 kukit.notifyServer_done = function(domDoc, oper) {
-    if (domDoc.readyState == 4)
-    {
+    if (domDoc.readyState == 4) {
         // notify the queue that we are done
-        var success = oper.queueItem.receivedResult()
+        var success = oper.queueItem.receivedResult();
         // We only process if the response has not been timed
         // out by the queue in the meantime.
         if (success) {

Modified: kukit/kukit.js/trunk/kukit/plugin.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/plugin.js	(original)
+++ kukit/kukit.js/trunk/kukit/plugin.js	Mon Jan  1 14:09:06 2007
@@ -255,7 +255,7 @@
         // We want the event execute once the iframe is loaded.
         var f = function() {
             kukit.bindScheduler.addPost(func_to_bind, 'Execute load event for iframe ' + oper.node.name);
-        }
+        };
         new kukit.dom.EmbeddedContentLoadedScheduler(oper.node.id, f);
 
     } else {
@@ -275,7 +275,7 @@
     var self = this;
     var timeoutSetState = function(spinnerevent) {
        self.timeoutSetState(spinnerevent);
-    }
+    };
     this.scheduler = new kukit.ut.Scheduler(timeoutSetState);
 };
 

Modified: kukit/kukit.js/trunk/kukit/requestmanager.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/requestmanager.js	(original)
+++ kukit/kukit.js/trunk/kukit/requestmanager.js	Mon Jan  1 14:09:06 2007
@@ -89,7 +89,7 @@
     if (a.expire < b.expire) return -1;
     else if (a.expire > b.expire) return +1;
     else return 0;
-}
+};
 
 kukit.rm.TimerQueue.prototype.push = function(item) {
     // push a given slot
@@ -148,7 +148,7 @@
     var self = this;
     var timeoutItem = function(item) {
        self.timeoutItem(item);
-    }
+    };
     this.timerQueue = new kukit.rm.TimerQueue(timeoutItem);
     if (typeof(name) == 'undefined') {
         name = null;
@@ -165,7 +165,7 @@
     // sets the timeout scheduler
     var checkTimeout = function() {
        self.checkTimeout();
-    }
+    };
     if (typeof(schedulerClass) == 'undefined') {
         schedulerClass = kukit.ut.Scheduler;
     }
@@ -231,7 +231,7 @@
     var self = this;
     var func = function(item, now) {
         return self.receiveItem(item, now);
-    }
+    };
     item.setReceivedCallback(func);
     // Call the function
     item.sendHook(item);

Modified: kukit/kukit.js/trunk/kukit/resourcedata.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/resourcedata.js	(original)
+++ kukit/kukit.js/trunk/kukit/resourcedata.js	Mon Jan  1 14:09:06 2007
@@ -350,7 +350,7 @@
 */
 
 kukit.rd.EventRule.prototype.bind = function(node) {
-    var oper = new kukit.op.Oper()
+    var oper = new kukit.op.Oper();
     oper.node = node;
     oper.binderinstance = this.getBinderInstance();
     oper.eventrule = this;
@@ -371,7 +371,7 @@
         newoper.binderinstance._EventBinder_triggerevent(name, newoper);
     };
     // do the binding    
-    var bindoper = new kukit.op.Oper()
+    var bindoper = new kukit.op.Oper();
     bindoper.node = node;
     bindoper.binderinstance = oper.binderinstance;
     bindoper.eventrule = this;
@@ -538,7 +538,7 @@
     this.error = null;
     this.parms = {};
     this.type = null;
-}
+};
 
 kukit.rd.Action.prototype.setName = function(name) {
     if (this.name != null && this.name != name) {

Modified: kukit/kukit.js/trunk/kukit/tokenizer.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/tokenizer.js	(original)
+++ kukit/kukit.js/trunk/kukit/tokenizer.js	Mon Jan  1 14:09:06 2007
@@ -28,7 +28,7 @@
     var kw = this.__superinit__(name, message);
     kw.errpos = errpos;
     kw.message = kw.message + ' at position ' + errpos;
-    return kw
+    return kw;
 };
 
 /* Class methods of tokens and parsers */
@@ -195,7 +195,7 @@
         }
         this.endpos = src.pos;
         this.src = null;
-    }
+    };
     f.prototype = new kukit.tk._TokenBase;
     f.prototype.symbol = symbol;
     f.prototype.txt = txt;
@@ -222,7 +222,7 @@
         // post processing
         this.process();
         this.src = null;
-    }
+    };
     f.prototype = new kukit.tk._ParserBase;
     f.prototype.symbol = symbol;
     return f;

Modified: kukit/kukit.js/trunk/kukit/utils.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/utils.js	(original)
+++ kukit/kukit.js/trunk/kukit/utils.js	Mon Jan  1 14:09:06 2007
@@ -29,6 +29,9 @@
 // Browser identification. We need this one only atm.
 try {
     kukit.HAVE_SAFARI = navigator.vendor && navigator.vendor.indexOf('Apple') != -1;
+    // this one is taken from sarissa. Howewer we can't reuse it since it starts with _.
+    kukit.HAVE_IE = document.all && window.ActiveXObject && navigator.userAgent.toLowerCase().indexOf("msie") > -1  && navigator.userAgent.toLowerCase().indexOf("opera") == -1;
+
 } catch (e) {}
 
 /* check whether the logging stuff of Firebug is available */
@@ -116,13 +119,13 @@
             }
         }
         return err;
-    }
+    };
     exc.prototype.__init__ = function(name, message) {
         var kw = {};
         kw.name = name;
         kw.message = message;
         return kw;
-    }
+    };
     return exc;
 };
 


More information about the Kukit-checkins mailing list