Author: gotcha
Date: Sat Feb 17 18:25:44 2007
New Revision: 39133

Modified:
   kukit/kukit.js/trunk/kukit/commandreg.js
   kukit/kukit.js/trunk/kukit/dom.js
   kukit/kukit.js/trunk/kukit/forms.js
   kukit/kukit.js/trunk/kukit/kukit.js
   kukit/kukit.js/trunk/kukit/plugin.js
Log:
* deprecate rel= kukit or rel=k-stylesheet for rel=kinetic-stylesheet
* fix from Steve Hindle for radio buttons


Modified: kukit/kukit.js/trunk/kukit/commandreg.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/commandreg.js    (original)
+++ kukit/kukit.js/trunk/kukit/commandreg.js    Sat Feb 17 18:25:44 2007
@@ -28,7 +28,7 @@
 *  class CommandRegistry
 */
 kukit.cr.CommandRegistry = function () {
-    this.content = {};
+    this.commands = {};
 };
 
 /* 
@@ -55,19 +55,19 @@
 };
 
 kukit.cr.CommandRegistry.prototype.register = function(name, klass) {
-    if (this.content[name]) {
+    if (this.commands[name]) {
         // Do not allow redefinition
-        kukit.logError('Error : redefinition attempt of command ' + name);
+        kukit.logError('ValueError : command "' + name + '" is already 
registered.');
         return;
         }
-    this.content[name] = klass;
+    this.commands[name] = klass;
 };
 
 kukit.cr.CommandRegistry.prototype.get = function(name) {
-    var klass = this.content[name];
+    var klass = this.commands[name];
     if (! klass) {
         // not found
-        kukit.logError('Error : undefined command ' + name);
+        kukit.logError('ValueError : no command registered under name : ' + 
name);
         }
     return klass;
 };

Modified: kukit/kukit.js/trunk/kukit/dom.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/dom.js   (original)
+++ kukit/kukit.js/trunk/kukit/dom.js   Sat Feb 17 18:25:44 2007
@@ -213,7 +213,7 @@
 };
 
 
-/* Kukit attibutes: a workaround to provide attributes
+/* Kukit attributes: a workaround to provide attributes
    in our own namespace.
    Since namespaced attributes (kukit:name="value") are not allowed
    even in transitional XHTML, we must provide a way to

Modified: kukit/kukit.js/trunk/kukit/forms.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/forms.js (original)
+++ kukit/kukit.js/trunk/kukit/forms.js Sat Feb 17 18:25:44 2007
@@ -130,7 +130,18 @@
         }
     } else if (element.type == "checkbox") {
         value = element.checked;
+
+    } else if (element instanceof NodeList && element.item(0).type == "radio") 
{
+        var radioList = element;
+        value = null;
+        for (var i=0; i < radioList.length; i++) {
+            var radio = radioList.item(i);
+            if (radio.checked) {
+                value = radio.value;
+            }
+        }
     } else if (element.type == "radio") {
+    // for stupid people that use a single radio button
         if (element.checked) {
            value = element.value;
         } else {

Modified: kukit/kukit.js/trunk/kukit/kukit.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/kukit.js (original)
+++ kukit/kukit.js/trunk/kukit/kukit.js Sat Feb 17 18:25:44 2007
@@ -74,7 +74,7 @@
     var nodes = document.getElementsByTagName("link");
     var results = [];
     for (var i=0; i<nodes.length; i++) {
-        if (nodes[i].rel=="kukit" || nodes[i].rel=="k-stylesheet" ) {
+        if (kukit.isKineticStylesheet(nodes[i])) {
             var res_type = null;
             // Resource syntax is decided on type attribute.
             if((nodes[i].type == 'text/css') || (nodes[i].type == 'text/kss')) 
{
@@ -86,6 +86,20 @@
     return results;
 };
 
+kukit.isKineticStylesheet = function(node) {
+    var rel = node.rel;
+    if (rel=="kinetic-stylesheet") {
+        return true;
+    }
+    // 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.');
+        return true;
+    }
+    return false;
+}
+
 kukit.Engine.prototype.setupEvents = function(in_nodes) {
     var self = this;
     var f = function() {

Modified: kukit/kukit.js/trunk/kukit/plugin.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/plugin.js        (original)
+++ kukit/kukit.js/trunk/kukit/plugin.js        Sat Feb 17 18:25:44 2007
@@ -392,7 +392,8 @@
 /*
 *  accepts both string and dom.
 */
-    oper.completeParms(['html'], {}, 'replaceInnerHTML action');
+    oper.completeParms(['html'], {},
+                       'replaceInnerHTML action');
     var node = oper.node;
     var inserted;
     if (typeof(oper.parms.html) == 'string') {
@@ -610,17 +611,19 @@
     // Allows executing a local action on a different selection.
     //
     // allows excess parms in the following check
-    oper.completeParms(['commandName', 'commandSelector'], 
{'commandSelectorType': null}, 'executeCommand action', true);
+    oper.completeParms(['name', 'selector'],
+                       {'selectorType': null},
+                       'executeCommand action', true);
     var parms = oper.parms;
     // marshall it, the rest of the parms will be passed
     var actionparms = {};
     for (var key in parms) {
-        if (key != 'commandName' && key != 'commandSelector' && key != 
'commandSelectorType') {
+        if (key != 'name' && key != 'selector' && key != 'selectorType') {
             actionparms[key] = parms[key];
         }
     }
-    var command = new kukit.cr.makeCommand(parms.commandSelector,
-            parms.commandName, parms.commandSelectorType, actionparms);
+    var command = new kukit.cr.makeCommand(parms.selector,
+            parms.name, parms.selectorType, actionparms);
     command.execute(oper);
 });
 
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to