Author: reebalazs
Date: Sat Jan 26 08:22:02 2008
New Revision: 51052

Modified:
   kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/doc/HISTORY.txt
   kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/kssparser.js
   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/resourcedata.js
   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/tests/test_kssparser.js
Log:
Remove postponed features, fix tests

Modified: 
kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/doc/HISTORY.txt
==============================================================================
--- kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/doc/HISTORY.txt     
(original)
+++ kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/doc/HISTORY.txt     
Sat Jan 26 08:22:02 2008
@@ -11,16 +11,20 @@
       This will enable to define value
       providers that recieve non-string parameters
       like a node selection.
+      [ree]
 
-      Remove previously deprecated form() and
+    - Remove previously deprecated form() and
       currentForm() value providers from normal
       action parameters (remark: they should
       be used with kssSelector.)
       They now give a parsing error.
+      [ree]
+
+    - Implement multiproperties in
+      action-client and action-server
+      [ree]
 
-      Implement multiproperties in
-      * action-client and action-server
-      * any value provider
+    - add url() and alias() providers
       [ree]
 
     - Use functions in token table instead of code strings

Modified: 
kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/kssparser.js
==============================================================================
--- kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/kssparser.js  
(original)
+++ kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/kssparser.js  
Sat Jan 26 08:22:02 2008
@@ -391,12 +391,10 @@
         // Normal selectors: can have more values
         // check its return types
         var allowedReturnTypes;
-;;;     allowedReturnTypes = {string: true, selection: true};
+;;;     allowedReturnTypes = {string: true};
 ;;;     kukit.E = 'action parameter [' + key + ']';
         var valuesByReturnType = this.preprocessValues(values, 
allowedReturnTypes, kukit.E);
         value = valuesByReturnType.string;
-        // Store the selector on the value.
-        value.selectionValue = valuesByReturnType.selection;
     }
     // store the (main, string) value
     action.parms[key] = value;

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    
    Sat Jan 26 08:22:02 2008
@@ -338,79 +338,6 @@
 
 };
 
-var _KssValuePP = function() {
-
-    this.check = function(args) {
-;;;     if (args.length != 2 && args.length != 3) {
-;;;         kukit.E = 'kssValue provider needs 2 or 3 argument (keytype, key,';
-;;;         kukit.E += ' [recurseParents]).';
-;;;         throw new Error(kukit.E);
-;;;     }
-    };
-
-    this.eval = function(args, node) {
-        var keytype =  args[0];
-        var key =  args[1];
-        // recurseParents is by default true
-        var recurseParents = true;
-;;;     if (keytype.match(/[ -]/)) {
-;;;         kukit.E = 'keytype parameter in kssValue provider cannot contain';
-;;;         kukit.E += ' dashes or spaces.';
-;;;         throw new Error(kukit.E);
-;;;     }
-;;;     if (key.match(/[ -]/)) {
-;;;         kukit.E = 'key parameter in kssValue provider cannot contain';
-;;;         kukit.E += ' dashes or spaces.';
-;;;         throw new Error(kukit.E);
-;;;     }
-        if (args.length == 3) {
-            recurseParents = args[2];
-;;;         kukit.E = '3rd attribute of kssAttr must be a boolean.';
-            recurseParents = kukit.ut.evalBool(recurseParents, kukit.E);
-        }
-        return kukit.dom.locateMarkup(node, recurseParents, 
-                kukit.dom.getKssValue, 
-                keytype, key).value;
-
-    };
-
-};
-
-var _KssIdOfValuePP = function() {
-
-    this.check = function(args) {
-;;;     if (args.length != 2) {
-;;;         kukit.E = 'kssIdOfValue provider needs 2 arguments (keytype, 
key).';
-;;;         throw new Error(kukit.E);
-;;;     }
-    },
-
-    this.eval = function(args, node) {
-        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);
-        // return the id of the node where the markup is found
-        var id = markup.node.id;
-        if (typeof(id) == 'undefined') {
-            // notfound arguments will get null
-            id = null;
-        }
-        return id;
-    }
-};
-
 
 /* The url() provider just passes the parameter, and is used to have
  * a different return type. It can be used in the line of action-server.
@@ -458,8 +385,6 @@
 kukit.pprovidersGlobalRegistry.register('pass', _PassPP);
 kukit.pprovidersGlobalRegistry.register('nodeContent', _NodeContentPP);
 kukit.pprovidersGlobalRegistry.register('nodeAttr', _NodeAttrPP);
-kukit.pprovidersGlobalRegistry.register('kssValue', _KssValuePP);
-kukit.pprovidersGlobalRegistry.register('kssIdOfValue', _KssIdOfValuePP);
 // returnType = 'url'
 kukit.pprovidersGlobalRegistry.register('url', _UrlPP, 'url');
 // returnType = 'alias'

Modified: 
kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/resourcedata.js
==============================================================================
--- 
kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/resourcedata.js   
    (original)
+++ 
kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/kukit/resourcedata.js   
    Sat Jan 26 08:22:02 2008
@@ -229,20 +229,6 @@
 
 this.evaluate =
     function(node, defaultParameters) {
-    // In case we have a selector, evaluate it.
-    if (this.selectionValue) {
-        var nodes = this.selectionValue.evaluate(node, defaultParameters)
-        // This must have returned exactly one node. If not, we raise error.
-        if (nodes.length != 1) {
-;;;         kukit.E = 'Selection provider [' + this.selectionValue.methodName;
-;;;         kukit.E += '] of value provider [' + this.methodName;
-;;;         kukit.E += '] must select exactly one node, '
-;;;         kukit.E += 'got [' + nodes.length + '] instead.';
-            throw new Error(kukit.E);
-        }
-        // Use this as node!
-        node = nodes[0];
-    }
     // First recursivly evaluate all arguments
     var newArgs = [];
     for(var i=0; i < this.args.length; i++){

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    
    Sat Jan 26 08:22:02 2008
@@ -185,35 +185,6 @@
     return results;
 });
 
-var _KssMarkedNodePP = function() {
-    this.check = function(args){
-;;;     if (args.length != 2) {
-;;;         throw new Error('kssMarkedNode selector method needs 2 arguments 
(keyType, key)');
-;;;     }
-    };
-
-    this.eval = function(args, node, defaultParameters) {
-        var keyType =  args[0];
-        var key =  args[1];
-;;;     if (keyType.match(/[ -]/)) {
-;;;         kukit.E = 'keyType parameter in kssMarkedNode selection provider 
cannot contain';
-;;;         kukit.E += ' dashes or spaces.';
-;;;         throw new Error(kukit.E);
-;;;     }
-;;;     if (key.match(/[ -]/)) {
-;;;         kukit.E = 'key parameter in kssMarkedNode 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 selection result.
-        return [markup.node];
-    };
-
-};
-kukit.pprovidersGlobalRegistry.register('kssMarkedNode', _KssMarkedNodePP, 
'selection');
 
 }();                              /// MODULE END
 

Modified: 
kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/tests/test_kssparser.js
==============================================================================
--- 
kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/tests/test_kssparser.js 
    (original)
+++ 
kukit/kukit.js/branch/ree-1.4-markup-and-syntax-changes/tests/test_kssparser.js 
    Sat Jan 26 08:22:02 2008
@@ -1042,7 +1042,7 @@
         this.assertParsingError(kukit.kssp.Document, cursor, null, true,
             // XXX This error message will be fixed in service-layer branch
             // XXX This will also fix running from IE, currently broken at 
error assert.
-            'Missing [string] value in the action parameter [message]., at row 
1, column 11');
+            'Provider result type [selection] not allowed in the action 
parameter [message]., at row 1, column 11');
     };
 
     this.testNormalParameterRejectsFormData = function() {
@@ -1333,8 +1333,8 @@
             'Wrong value for key [action-server] : value providers are not 
allowed for action-<QUALIFIER> keys., at row 1, column 11');
     };
 
-    this.testNormalProviderAcceptsValueAndSelector = function() {
-        // normal parameters accepts value and selector
+    this.testNormalProviderRejectsValueAndSelector = function() {
+        // normal parameters rejects value and selector
         //
         // This test can only run in development mode, pass otherwise.
         if (! kukit.isDevelMode) {return;}
@@ -1344,42 +1344,14 @@
                + "    log-message:   kssAttr(blah) htmlid('id');\n"
                + "}\n"
         var cursor = new kukit.tk.Cursor(txt);
-        var parser = new kukit.kssp.Document(cursor, null, true);
-        this.assertEquals(parser.finished, true);
-    };
-
-    this.testNormalProviderAcceptsSelectorAndValue = function() {
-        // normal parameters accepts value and selector
-        //
-        // This test can only run in development mode, pass otherwise.
-        if (! kukit.isDevelMode) {return;}
-        //
-        var txt= "#id:click {\n"
-               + "    action-client: log;\n"
-               + "    log-message:   htmlid('id') kssAttr(blah);\n"
-               + "}\n"
-        var cursor = new kukit.tk.Cursor(txt);
-        var parser = new kukit.kssp.Document(cursor, null, true);
-        this.assertEquals(parser.finished, true);
+        this.assertParsingError(kukit.kssp.Document, cursor, null, true,
+            // XXX This error message will be fixed in service-layer branch
+            // XXX This will also fix running from IE, currently broken at 
error assert.
+            'Provider result type [selection] not allowed in the action 
parameter [message]., at row 1, column 11'); 
     };
 
-    this.testNormalProviderAcceptsStringAndSelector = function() {
-        // normal parameters accepts string and selector
-        // although this does not make much sense... but it's allowed.
-        //
-        // This test can only run in development mode, pass otherwise.
-        if (! kukit.isDevelMode) {return;}
-        //
-        var txt= "#id:click {\n"
-               + "    action-client: log;\n"
-               + "    log-message:   'message' htmlid('id');\n"
-               + "}\n"
-        var cursor = new kukit.tk.Cursor(txt);
-        var parser = new kukit.kssp.Document(cursor, null, true);
-        this.assertEquals(parser.finished, true);
-    };
 
-    this.testNormalProviderAcceptsSelectorAndString = function() {
+    this.testNormalProviderRejectsSelectorAndString = function() {
         // normal parameters accepts selector and string
         // although this does not make much sense... but it's allowed.
         //
@@ -1391,11 +1363,13 @@
                + "    log-message:   htmlid('id') 'message';\n"
                + "}\n"
         var cursor = new kukit.tk.Cursor(txt);
-        var parser = new kukit.kssp.Document(cursor, null, true);
-        this.assertEquals(parser.finished, true);
+        this.assertParsingError(kukit.kssp.Document, cursor, null, true,
+            // XXX This error message will be fixed in service-layer branch
+            // XXX This will also fix running from IE, currently broken at 
error assert.
+            'Provider result type [selection] not allowed in the action 
parameter [message]., at row 1, column 11') 
     };
 
-    this.testNormalProviderAcceptsValueAndSelector = function() {
+    this.testNormalProviderRejectsSelector = function() {
         // normal parameters accepts value and selector
         //
         // This test can only run in development mode, pass otherwise.
@@ -1403,11 +1377,13 @@
         //
         var txt= "#id:click {\n"
                + "    action-client: log;\n"
-               + "    log-message:   kssAttr(blah) htmlid('id');\n"
+               + "    log-message:   htmlid('id');\n"
                + "}\n"
         var cursor = new kukit.tk.Cursor(txt);
-        var parser = new kukit.kssp.Document(cursor, null, true);
-        this.assertEquals(parser.finished, true);
+        this.assertParsingError(kukit.kssp.Document, cursor, null, true,
+            // XXX This error message will be fixed in service-layer branch
+            // XXX This will also fix running from IE, currently broken at 
error assert.
+            'Provider result type [selection] not allowed in the action 
parameter [message]., at row 1, column 11') 
     };
 
     this.testAliasedClientAction = function() {
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to