[KSS-checkins] r50325 - in kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes: . kukit

reebalazs at codespeak.net reebalazs at codespeak.net
Fri Jan 4 17:57:46 CET 2008


Author: reebalazs
Date: Fri Jan  4 17:57:46 2008
New Revision: 50325

Modified:
   kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/   (props changed)
   kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/providerreg.js
   kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/selectorreg.js
Log:
Add kssWidget selector

Modified: kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/providerreg.js
==============================================================================
--- kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/providerreg.js	(original)
+++ kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/providerreg.js	Fri Jan  4 17:57:46 2008
@@ -345,7 +345,7 @@
                 kukit.dom.getKssValue, 
                 keytype, key);
         // return the id of the node where the markup is found
-        var id = markup.node.idd;
+        var id = markup.node.id;
         if (typeof(id) == 'undefined') {
             // notfound arguments will get null
             id = null;

Modified: kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/selectorreg.js
==============================================================================
--- kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/selectorreg.js	(original)
+++ kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/selectorreg.js	Fri Jan  4 17:57:46 2008
@@ -21,6 +21,7 @@
 
 // this will provide an arbitrary selector, and is designed to
 // be used with the makeAnyPP factory function.
+// It produces selectors that have a single input parameter.
 kukit.sr.AnyPP = function() {};
 kukit.sr.AnyPP.prototype = {
     check: function(args) {
@@ -160,3 +161,33 @@
     }
     return results;
 });
+
+kukit.sr.KssWidgetPP = function() {};
+kukit.sr.KssWidgetPP.prototype = {
+    check: function(args) {
+;;;     if (args.length != 2) {
+;;;         throw new Error('kssWidget selector method needs 2 arguments');
+;;;     }
+    },
+    eval: function(args, node, defaultParameters) {
+        var keytype =  args[0];
+        var key =  args[1];
+;;;     if (keytype.match(/[ -]/)) {
+;;;         kukit.E = 'keytype parameter in kssIdOfValue provider cannot contain';
+;;;         kukit.E += ' dashes or spaces.';
+;;;         throw new Error(kukit.E);
+;;;     }
+;;;     if (key.match(/[ -]/)) {
+;;;         kukit.E = 'key parameter in kssIdOfValue provider cannot contain';
+;;;         kukit.E += ' dashes or spaces.';
+;;;         throw new Error(kukit.E);
+;;;     }
+        var markup = kukit.dom.locateMarkup(node, true, 
+                kukit.dom.getKssValue, 
+                keytype, key);
+        // Just return the markup's node as a single result.
+        return [markup.node];
+    }
+};
+kukit.pprovidersGlobalRegistry.register('kssWidget', kukit.sr.KssWidgetPP, 'selection');
+


More information about the Kukit-checkins mailing list