Personal tools
You are here: Home   Notes   KSS 1.4 Release Notes  
Search
 
Document Actions

KSS 1.4 Release Notes

by Balazs Ree last modified 2008-05-15 10:21

What's new, deprecated in KSS 1.4

What's new

  • Base2 is used for css selection, instead of the original cssQuery (if present). Significantly faster page load.

  • Multiple selectors are allowed in the same rule:

    selector1:click selector2:click { ... }

    or even:

    selector1:keyup selector2:keydown { ... }
  • Value providers can be recursive:

    nodeAttr(kssAttr(blah))
  • url() value provider; you can specify url together with server action:

action-server: blah url(http://foo.bar/blahblah);

This is alternate syntax for:

action-server: blah;
blah-kssUrl: "http://foo.bar/blahblah";

It might be handy if you want to call @@ url-s.

  • alias() value provider, this enables to use multiple client actions in the same rule:

    action-client: setAttribute;
    setAttribute-key: foo;
    setAttribute-value: bar;
    action-client: setAttribute alias(other);
    other-key: foo2;
    other-value: bar2;
  • Node selection can be specified together with the action, you can write:

    action-client: foo css(div.klass);

    instead of:

    action-client: foo;
    foo-kssSelector: css(div.klass);
  • Full form submits can be specified together with the action, you can write:

    action-server: foo currentForm();

    instead of:

    action-server: foo;
    foo-kssSubmitForm: currentForm();
  • Dynmaic "event binder id" can be specified with value providers:

  • xxxxx:click(kssAttr(blah)) { ... }

    Previously, only static event binder ids were allowed:

    xxxxx:click(blah) { ... }

    This is needed for upcoming use cases like drag and drop.

  • Major code refactoring, for better readibility and speedups.

  • Lots and lots of ecma unittests and selenium tests that test kss.core and the core plugin, are added. All tests can be run from a single click in any browser.

  • New and improved demos.

  • Deprecated

    form() and currentForm() in normal value providers that were allowed in KSS 1.2 are not allowed anymore.

    currentForm()

    currentForm() in a normal value provider like was previously allowed, not anymore:

    action-server:                     myServerAction;
    myServerAction-data: currentForm();

    You need to change it to:

    action-server:                     myServerAction;
    myServerAction-kssSubmitForm: currentForm();

    Or, if you want to use the new syntax:

    action-server:                     myServerAction currentForm();

    form()

    Similarly, for form() value provider, the following is not allowed anymore:

    action-server:                     myServerAction;
    myServerAction-data: form();

    You need to change it to:

    action-server:                     myServerAction;
    myServerAction-kssSubmitForm: form();

    Or, if you want to use the new syntax:

    action-server:                     myServerAction form();

    Server side changes

    On the server side, the method that received the form as a dictionary in one parameter, must define the values directly in the method signature, or access them from the form directly.

    So the following old code:

    def method(self, data):
    field1 = data['field1']
    field2 = data.get('field2', None)

    must be changed in one of the two ways shown in the following examples:

    def method(self, field1, field2=None):
    ...

    An alternate way is to get them from the request:

    def method(self):
    request = self.request
    field1 = request.form['field1']
    field2 = request.form.get('field2', None)

    Other

    • Demos and selenium tests are removed from kss.demo and are now placed together with the plugin in kss.core. This means, all 3rdparty plugins should now have a zope-only demo page with a selenium test, if the plugin is loaded the demo appears in the index and the test is run together with all tests. (Demos can be viewed and tested by kss.demo.) We also have kss.template that creates a skeleton kss plugin with all bells and whistles.

    • Implement loglevels based on cookies (also backported to 1.2.)

    • Other fixes (also backported to 1.2):

      • Fix error fallback handling
      • Fix multiple selection form fields marshalling on Safari and IE
      • Fix setKssAttribute action and command
      • Fix action-cancel