From laz at codespeak.net Mon Sep 3 10:57:10 2007 From: laz at codespeak.net (laz at codespeak.net) Date: Mon, 3 Sep 2007 10:57:10 +0200 (CEST) Subject: [KSS-checkins] r46256 - kukit/kss.base/trunk Message-ID: <20070903085710.63D1C815C@code0.codespeak.net> Author: laz Date: Mon Sep 3 10:57:07 2007 New Revision: 46256 Modified: kukit/kss.base/trunk/setup.py Log: Included kssconcatjs console script in entry points Modified: kukit/kss.base/trunk/setup.py ============================================================================== --- kukit/kss.base/trunk/setup.py (original) +++ kukit/kss.base/trunk/setup.py Mon Sep 3 10:57:07 2007 @@ -29,6 +29,9 @@ 'kss.plugin': [ 'kss-core=kss.base.plugin:KSSCore' ], + 'console_scripts': [ + 'kssconcatjs=kss.base.utils:KSSConcatJs' + ], }, test_suite='kss.base.tests.test_suite', ) From kukit-checkins at codespeak.net Tue Sep 4 21:23:24 2007 From: kukit-checkins at codespeak.net (Viagra.com Inc ®) Date: Tue, 4 Sep 2007 21:23:24 +0200 (CEST) Subject: [KSS-checkins] Official Site Message-ID: <9781780.86675.363825-9149@cimail62.msn.com> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20070904/6e1fe6b8/attachment.htm From reebalazs at codespeak.net Fri Sep 7 15:28:40 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Fri, 7 Sep 2007 15:28:40 +0200 (CEST) Subject: [KSS-checkins] r46400 - kukit/kukit.js/trunk/kukit Message-ID: <20070907132840.43907810F@code0.codespeak.net> Author: reebalazs Date: Fri Sep 7 15:28:39 2007 New Revision: 46400 Modified: kukit/kukit.js/trunk/kukit/dom.js kukit/kukit.js/trunk/kukit/plugin.js kukit/kukit.js/trunk/kukit/providerreg.js Log: Fix logging from the event binder of [load, iload], that caused document:load fail in development mode Modified: kukit/kukit.js/trunk/kukit/dom.js ============================================================================== --- kukit/kukit.js/trunk/kukit/dom.js (original) +++ kukit/kukit.js/trunk/kukit/dom.js Fri Sep 7 15:28:39 2007 @@ -279,6 +279,24 @@ kukit.dom.setAttribute(node, fullName); }; + +kukit.dom.getKssIdFilterFactory = function(prefix) { + var re_prefix = Regexp('^'+prefix); + return function(node, attrname) { + ;;; if (attrname != 'id') { + ;;; throw new Error('getKssIdFilterFactory can only work on id, no other attributes'); + ;;; } + var result = node.id; + if (result.match(re_prefix)) { + return result; + } else { + return null; + } + }; +}; + + + /* Recursive getting of node attributes getter is a function that gets the value from the node. */ Modified: kukit/kukit.js/trunk/kukit/plugin.js ============================================================================== --- kukit/kukit.js/trunk/kukit/plugin.js (original) +++ kukit/kukit.js/trunk/kukit/plugin.js Fri Sep 7 15:28:39 2007 @@ -423,8 +423,18 @@ // we need to execute immediately. var func_to_bind = loadoper.makeExecuteActionsHook(); var remark = ''; -;;; remark += '[load] event execution for node ['; -;;; remark += loadoper.node.tagName.toLowerCase() + ']'; +;;; remark += '[load] event execution for '; +;;; // loadoper can execute on document! +;;; // Is this the case? +;;; if (loadoper.node == null) { +;;; // document:load +;;; remark += '[document]'; +;;; } else { +;;; // :load +;;; remark += 'node ['; +;;; remark += loadoper.node.tagName.toLowerCase(); +;;; remark += ']'; +;;; } kukit.engine.bindScheduler.addPost(func_to_bind, remark); } if (iloadoper) { Modified: kukit/kukit.js/trunk/kukit/providerreg.js ============================================================================== --- kukit/kukit.js/trunk/kukit/providerreg.js (original) +++ kukit/kukit.js/trunk/kukit/providerreg.js Fri Sep 7 15:28:39 2007 @@ -316,3 +316,29 @@ }; kukit.pprovidersGlobalRegistry.register('pass', kukit.pr.PassPP); +kukit.pr.KssIdPP = function() {}; +kukit.pr.KssIdPP.prototype = { + check: function(args) { +;;; if (args.length != 0 && args.length != 1) { +;;; kukit.E = 'kssId method needs 0 or 1 argument (type)'; +;;; throw new Error(kukit.E); +;;; } +;;; if (! args[0].match(/~[a-z0-9]$/)) { +;;; kukit.E = 'type parameter in kssId method must be '; +;;; kukit.E += 'lowercase alphanumeric.'; +;;; throw new Error(kukit.E); +;;; } + }, + eval: function(args, node) { + var type = args[0]; + var prefix = 'kssid-'; + if (args.length == 1) { + prefix += args[0] + '-'; + } + return kukit.dom.getRecursiveAttribute(node, 'id', true, + kukit.dom.getKssIdFilterFactory(prefix)); + } +}; +kukit.pprovidersGlobalRegistry.register('kssId', kukit.pr.KssIdPP); + + From reebalazs at codespeak.net Fri Sep 7 15:30:14 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Fri, 7 Sep 2007 15:30:14 +0200 (CEST) Subject: [KSS-checkins] r46401 - kukit/kukit.js/trunk/kukit Message-ID: <20070907133014.3CB67810F@code0.codespeak.net> Author: reebalazs Date: Fri Sep 7 15:30:13 2007 New Revision: 46401 Modified: kukit/kukit.js/trunk/kukit/dom.js kukit/kukit.js/trunk/kukit/plugin.js kukit/kukit.js/trunk/kukit/providerreg.js Log: Oops, reverting last commit that contained unwanted items Modified: kukit/kukit.js/trunk/kukit/dom.js ============================================================================== --- kukit/kukit.js/trunk/kukit/dom.js (original) +++ kukit/kukit.js/trunk/kukit/dom.js Fri Sep 7 15:30:13 2007 @@ -279,24 +279,6 @@ kukit.dom.setAttribute(node, fullName); }; - -kukit.dom.getKssIdFilterFactory = function(prefix) { - var re_prefix = Regexp('^'+prefix); - return function(node, attrname) { - ;;; if (attrname != 'id') { - ;;; throw new Error('getKssIdFilterFactory can only work on id, no other attributes'); - ;;; } - var result = node.id; - if (result.match(re_prefix)) { - return result; - } else { - return null; - } - }; -}; - - - /* Recursive getting of node attributes getter is a function that gets the value from the node. */ Modified: kukit/kukit.js/trunk/kukit/plugin.js ============================================================================== --- kukit/kukit.js/trunk/kukit/plugin.js (original) +++ kukit/kukit.js/trunk/kukit/plugin.js Fri Sep 7 15:30:13 2007 @@ -423,18 +423,8 @@ // we need to execute immediately. var func_to_bind = loadoper.makeExecuteActionsHook(); var remark = ''; -;;; remark += '[load] event execution for '; -;;; // loadoper can execute on document! -;;; // Is this the case? -;;; if (loadoper.node == null) { -;;; // document:load -;;; remark += '[document]'; -;;; } else { -;;; // :load -;;; remark += 'node ['; -;;; remark += loadoper.node.tagName.toLowerCase(); -;;; remark += ']'; -;;; } +;;; remark += '[load] event execution for node ['; +;;; remark += loadoper.node.tagName.toLowerCase() + ']'; kukit.engine.bindScheduler.addPost(func_to_bind, remark); } if (iloadoper) { Modified: kukit/kukit.js/trunk/kukit/providerreg.js ============================================================================== --- kukit/kukit.js/trunk/kukit/providerreg.js (original) +++ kukit/kukit.js/trunk/kukit/providerreg.js Fri Sep 7 15:30:13 2007 @@ -316,29 +316,3 @@ }; kukit.pprovidersGlobalRegistry.register('pass', kukit.pr.PassPP); -kukit.pr.KssIdPP = function() {}; -kukit.pr.KssIdPP.prototype = { - check: function(args) { -;;; if (args.length != 0 && args.length != 1) { -;;; kukit.E = 'kssId method needs 0 or 1 argument (type)'; -;;; throw new Error(kukit.E); -;;; } -;;; if (! args[0].match(/~[a-z0-9]$/)) { -;;; kukit.E = 'type parameter in kssId method must be '; -;;; kukit.E += 'lowercase alphanumeric.'; -;;; throw new Error(kukit.E); -;;; } - }, - eval: function(args, node) { - var type = args[0]; - var prefix = 'kssid-'; - if (args.length == 1) { - prefix += args[0] + '-'; - } - return kukit.dom.getRecursiveAttribute(node, 'id', true, - kukit.dom.getKssIdFilterFactory(prefix)); - } -}; -kukit.pprovidersGlobalRegistry.register('kssId', kukit.pr.KssIdPP); - - From reebalazs at codespeak.net Fri Sep 7 15:30:57 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Fri, 7 Sep 2007 15:30:57 +0200 (CEST) Subject: [KSS-checkins] r46402 - kukit/kukit.js/trunk/kukit Message-ID: <20070907133057.3E53A8116@code0.codespeak.net> Author: reebalazs Date: Fri Sep 7 15:30:56 2007 New Revision: 46402 Modified: kukit/kukit.js/trunk/kukit/plugin.js Log: Fix logging from the event binder of [load, iload], that caused document:load fail in development mode (for real) Modified: kukit/kukit.js/trunk/kukit/plugin.js ============================================================================== --- kukit/kukit.js/trunk/kukit/plugin.js (original) +++ kukit/kukit.js/trunk/kukit/plugin.js Fri Sep 7 15:30:56 2007 @@ -423,8 +423,18 @@ // we need to execute immediately. var func_to_bind = loadoper.makeExecuteActionsHook(); var remark = ''; -;;; remark += '[load] event execution for node ['; -;;; remark += loadoper.node.tagName.toLowerCase() + ']'; +;;; remark += '[load] event execution for '; +;;; // loadoper can execute on document! +;;; // Is this the case? +;;; if (loadoper.node == null) { +;;; // document:load +;;; remark += '[document]'; +;;; } else { +;;; // :load +;;; remark += 'node ['; +;;; remark += loadoper.node.tagName.toLowerCase(); +;;; remark += ']'; +;;; } kukit.engine.bindScheduler.addPost(func_to_bind, remark); } if (iloadoper) { From reebalazs at codespeak.net Fri Sep 7 15:36:29 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Fri, 7 Sep 2007 15:36:29 +0200 (CEST) Subject: [KSS-checkins] r46403 - in kukit/kukit.js/branch/1.2: doc kukit Message-ID: <20070907133629.DD0B88115@code0.codespeak.net> Author: reebalazs Date: Fri Sep 7 15:36:28 2007 New Revision: 46403 Modified: kukit/kukit.js/branch/1.2/doc/HISTORY.txt kukit/kukit.js/branch/1.2/kukit/plugin.js Log: Merge from trunk -r46401:46402 : Fix logging from the event binder of [load, iload], that caused document:load fail in development mode Modified: kukit/kukit.js/branch/1.2/doc/HISTORY.txt ============================================================================== --- kukit/kukit.js/branch/1.2/doc/HISTORY.txt (original) +++ kukit/kukit.js/branch/1.2/doc/HISTORY.txt Fri Sep 7 15:36:28 2007 @@ -6,6 +6,9 @@ - ... + - Fixed an issue that caused document:load fail + [ree] + kukit.js - 1.2 Released 2007-08-17 - Move ;;; markers to first columns. Modified: kukit/kukit.js/branch/1.2/kukit/plugin.js ============================================================================== --- kukit/kukit.js/branch/1.2/kukit/plugin.js (original) +++ kukit/kukit.js/branch/1.2/kukit/plugin.js Fri Sep 7 15:36:28 2007 @@ -423,8 +423,18 @@ // we need to execute immediately. var func_to_bind = loadoper.makeExecuteActionsHook(); var remark = ''; -;;; remark += '[load] event execution for node ['; -;;; remark += loadoper.node.tagName.toLowerCase() + ']'; +;;; remark += '[load] event execution for '; +;;; // loadoper can execute on document! +;;; // Is this the case? +;;; if (loadoper.node == null) { +;;; // document:load +;;; remark += '[document]'; +;;; } else { +;;; // :load +;;; remark += 'node ['; +;;; remark += loadoper.node.tagName.toLowerCase(); +;;; remark += ']'; +;;; } kukit.engine.bindScheduler.addPost(func_to_bind, remark); } if (iloadoper) { From reebalazs at codespeak.net Fri Sep 7 16:44:24 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Fri, 7 Sep 2007 16:44:24 +0200 (CEST) Subject: [KSS-checkins] r46405 - kukit/kukit.js/trunk/kukit Message-ID: <20070907144424.44A888116@code0.codespeak.net> Author: reebalazs Date: Fri Sep 7 16:44:23 2007 New Revision: 46405 Modified: kukit/kukit.js/trunk/kukit/plugin.js Log: Another fix that disabled the binding of document:load Modified: kukit/kukit.js/trunk/kukit/plugin.js ============================================================================== --- kukit/kukit.js/trunk/kukit/plugin.js (original) +++ kukit/kukit.js/trunk/kukit/plugin.js Fri Sep 7 16:44:23 2007 @@ -354,7 +354,15 @@ } oper.evalBool('initial'); oper.evalBool('insert'); - var phase = oper.node._kukitmark; + var phase; + if (oper.node == null) { + // if the event is bound to a document node, + // we are in phase 1. + phase = 1; + } else { + // get the phase from the node + phase = oper.node._kukitmark; + } if (phase == 1 && ! oper.parms.initial) { ;;; var msg = 'EventRule #' + oper.eventRule.getIndex() + ' mergeId ['; ;;; msg += oper.eventRule.kssSelector.mergeId + '] event ignored,'; From reebalazs at codespeak.net Fri Sep 7 16:46:04 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Fri, 7 Sep 2007 16:46:04 +0200 (CEST) Subject: [KSS-checkins] r46406 - kukit/kukit.js/branch/1.2/kukit Message-ID: <20070907144604.9E11E8116@code0.codespeak.net> Author: reebalazs Date: Fri Sep 7 16:46:02 2007 New Revision: 46406 Modified: kukit/kukit.js/branch/1.2/kukit/plugin.js Log: Merge from trunk -r46401:46402 : Another fix that disabled the binding of document:load Modified: kukit/kukit.js/branch/1.2/kukit/plugin.js ============================================================================== --- kukit/kukit.js/branch/1.2/kukit/plugin.js (original) +++ kukit/kukit.js/branch/1.2/kukit/plugin.js Fri Sep 7 16:46:02 2007 @@ -354,7 +354,15 @@ } oper.evalBool('initial'); oper.evalBool('insert'); - var phase = oper.node._kukitmark; + var phase; + if (oper.node == null) { + // if the event is bound to a document node, + // we are in phase 1. + phase = 1; + } else { + // get the phase from the node + phase = oper.node._kukitmark; + } if (phase == 1 && ! oper.parms.initial) { ;;; var msg = 'EventRule #' + oper.eventRule.getIndex() + ' mergeId ['; ;;; msg += oper.eventRule.kssSelector.mergeId + '] event ignored,'; From reebalazs at codespeak.net Sun Sep 9 19:55:29 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Sep 2007 19:55:29 +0200 (CEST) Subject: [KSS-checkins] r46426 - kukit/kukit.js/branch/1.2/kukit Message-ID: <20070909175529.55F9680D2@code0.codespeak.net> Author: reebalazs Date: Sun Sep 9 19:55:26 2007 New Revision: 46426 Modified: kukit/kukit.js/branch/1.2/kukit/plugin.js Log: Port back -r46030:46031 from trunk in an appropriate form (Fix bug in replaceInnerHTML, Caused content not bound) Modified: kukit/kukit.js/branch/1.2/kukit/plugin.js ============================================================================== --- kukit/kukit.js/branch/1.2/kukit/plugin.js (original) +++ kukit/kukit.js/branch/1.2/kukit/plugin.js Sun Sep 9 19:55:26 2007 @@ -611,13 +611,17 @@ var insertedNodes; if (typeof(oper.parms.html) == 'string') { node.innerHTML = oper.parms.html; - insertedNodes = node.childNodes; + insertedNodes = []; + for (var i=0; i 0) { var parentNode = node.parentNode; var insertedNodes = []; From reebalazs at codespeak.net Sun Sep 9 19:57:20 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 9 Sep 2007 19:57:20 +0200 (CEST) Subject: [KSS-checkins] r46427 - kukit/kukit.js/branch/1.2/kukit Message-ID: <20070909175720.1E84480AD@code0.codespeak.net> Author: reebalazs Date: Sun Sep 9 19:57:20 2007 New Revision: 46427 Modified: kukit/kukit.js/branch/1.2/kukit/plugin.js Log: Port back -r46102:46103 from trunk (fix IE bug in forms, missing var) Modified: kukit/kukit.js/branch/1.2/kukit/plugin.js ============================================================================== --- kukit/kukit.js/branch/1.2/kukit/plugin.js (original) +++ kukit/kukit.js/branch/1.2/kukit/plugin.js Sun Sep 9 19:57:20 2007 @@ -83,7 +83,7 @@ if (! eventName) eventName = oper.getEventName(); var func = function(e) { - target = kukit.pl.getTargetForBrowserEvent(e); + var target = kukit.pl.getTargetForBrowserEvent(e); if (oper.parms.allowbubbling || target == oper.node) { // Execute the action, provide browserevent on oper // ... however, do it protected. We want the preventdefault From reebalazs at codespeak.net Mon Sep 10 19:32:52 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 10 Sep 2007 19:32:52 +0200 (CEST) Subject: [KSS-checkins] r46444 - kukit/kukit.js/tag/1.2.1 Message-ID: <20070910173252.19C188110@code0.codespeak.net> Author: reebalazs Date: Mon Sep 10 19:32:51 2007 New Revision: 46444 Added: kukit/kukit.js/tag/1.2.1/ - copied from r46443, kukit/kukit.js/branch/1.2/ Log: Branch for release From reebalazs at codespeak.net Mon Sep 10 19:37:24 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 10 Sep 2007 19:37:24 +0200 (CEST) Subject: [KSS-checkins] r46445 - in kukit/kukit.js/tag/1.2.1: . doc Message-ID: <20070910173724.9472980F0@code0.codespeak.net> Author: reebalazs Date: Mon Sep 10 19:37:24 2007 New Revision: 46445 Modified: kukit/kukit.js/tag/1.2.1/doc/HISTORY.txt kukit/kukit.js/tag/1.2.1/version.txt Log: Set release Modified: kukit/kukit.js/tag/1.2.1/doc/HISTORY.txt ============================================================================== --- kukit/kukit.js/tag/1.2.1/doc/HISTORY.txt (original) +++ kukit/kukit.js/tag/1.2.1/doc/HISTORY.txt Mon Sep 10 19:37:24 2007 @@ -2,9 +2,7 @@ (name of developer listed in brackets) -kukit.js - 1.2dev Unreleased - - - ... +kukit.js - 1.2.1 Released 2007-09-10 - Fixed an issue that caused document:load fail [ree] Modified: kukit/kukit.js/tag/1.2.1/version.txt ============================================================================== --- kukit/kukit.js/tag/1.2.1/version.txt (original) +++ kukit/kukit.js/tag/1.2.1/version.txt Mon Sep 10 19:37:24 2007 @@ -1 +1 @@ -1.2dev unreleased +1.2.1 Released 2007-09-10 From reebalazs at codespeak.net Mon Sep 10 19:38:38 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 10 Sep 2007 19:38:38 +0200 (CEST) Subject: [KSS-checkins] r46446 - kukit/kukit.js/branch/1.2/doc Message-ID: <20070910173838.2B75580F0@code0.codespeak.net> Author: reebalazs Date: Mon Sep 10 19:38:37 2007 New Revision: 46446 Modified: kukit/kukit.js/branch/1.2/doc/HISTORY.txt Log: Adjust history Modified: kukit/kukit.js/branch/1.2/doc/HISTORY.txt ============================================================================== --- kukit/kukit.js/branch/1.2/doc/HISTORY.txt (original) +++ kukit/kukit.js/branch/1.2/doc/HISTORY.txt Mon Sep 10 19:38:37 2007 @@ -6,6 +6,8 @@ - ... +kukit.js - 1.2.1 Released 2007-09-10 + - Fixed an issue that caused document:load fail [ree] From reebalazs at codespeak.net Mon Sep 10 19:40:48 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 10 Sep 2007 19:40:48 +0200 (CEST) Subject: [KSS-checkins] r46448 - kukit/kss.concatresource/tag/1.2.1 Message-ID: <20070910174048.E27B280F0@code0.codespeak.net> Author: reebalazs Date: Mon Sep 10 19:40:48 2007 New Revision: 46448 Added: kukit/kss.concatresource/tag/1.2.1/ - copied from r46447, kukit/kss.concatresource/branch/1.2/ Log: Branch for release From reebalazs at codespeak.net Mon Sep 10 19:43:22 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 10 Sep 2007 19:43:22 +0200 (CEST) Subject: [KSS-checkins] r46449 - in kukit/kss.concatresource/tag/1.2.1: . docs kss/concatresource Message-ID: <20070910174322.AD3F880F0@code0.codespeak.net> Author: reebalazs Date: Mon Sep 10 19:43:22 2007 New Revision: 46449 Removed: kukit/kss.concatresource/tag/1.2.1/setup.cfg Modified: kukit/kss.concatresource/tag/1.2.1/docs/HISTORY.txt kukit/kss.concatresource/tag/1.2.1/kss/concatresource/version.txt kukit/kss.concatresource/tag/1.2.1/setup.py Log: Set release Modified: kukit/kss.concatresource/tag/1.2.1/docs/HISTORY.txt ============================================================================== --- kukit/kss.concatresource/tag/1.2.1/docs/HISTORY.txt (original) +++ kukit/kss.concatresource/tag/1.2.1/docs/HISTORY.txt Mon Sep 10 19:43:22 2007 @@ -2,9 +2,10 @@ (name of developer listed in brackets) -kss.concatresource - 1.2dev Unreleased +kss.concatresource - 1.2.1 Released 2007-09-10 - - ... + - Prepare for release + [ree] kss.concatresource - 1.2 Released 2007-08-17 Modified: kukit/kss.concatresource/tag/1.2.1/kss/concatresource/version.txt ============================================================================== --- kukit/kss.concatresource/tag/1.2.1/kss/concatresource/version.txt (original) +++ kukit/kss.concatresource/tag/1.2.1/kss/concatresource/version.txt Mon Sep 10 19:43:22 2007 @@ -1 +1 @@ -1.2dev Unreleased +1.2.1 Released 2007-09-10 Deleted: /kukit/kss.concatresource/tag/1.2.1/setup.cfg ============================================================================== --- /kukit/kss.concatresource/tag/1.2.1/setup.cfg Mon Sep 10 19:43:22 2007 +++ (empty file) @@ -1,3 +0,0 @@ -[egg_info] -tag_build = dev -tag_svn_revision = true Modified: kukit/kss.concatresource/tag/1.2.1/setup.py ============================================================================== --- kukit/kss.concatresource/tag/1.2.1/setup.py (original) +++ kukit/kss.concatresource/tag/1.2.1/setup.py Mon Sep 10 19:43:22 2007 @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '1.2' +version = '1.2.1' setup(name='concatresource', version=version, From reebalazs at codespeak.net Mon Sep 10 19:44:15 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 10 Sep 2007 19:44:15 +0200 (CEST) Subject: [KSS-checkins] r46450 - kukit/kss.concatresource/branch/1.2/docs Message-ID: <20070910174415.020AF80F0@code0.codespeak.net> Author: reebalazs Date: Mon Sep 10 19:44:15 2007 New Revision: 46450 Modified: kukit/kss.concatresource/branch/1.2/docs/HISTORY.txt Log: Adjust history Modified: kukit/kss.concatresource/branch/1.2/docs/HISTORY.txt ============================================================================== --- kukit/kss.concatresource/branch/1.2/docs/HISTORY.txt (original) +++ kukit/kss.concatresource/branch/1.2/docs/HISTORY.txt Mon Sep 10 19:44:15 2007 @@ -6,6 +6,11 @@ - ... +kss.concatresource - 1.2.1 Released 2007-09-10 + + - Prepare for release + [ree] + kss.concatresource - 1.2 Released 2007-08-17 - Change ;;; rendering in devel mode From reebalazs at codespeak.net Mon Sep 10 19:45:13 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 10 Sep 2007 19:45:13 +0200 (CEST) Subject: [KSS-checkins] r46451 - kukit/kss.core/tag/1.2.1 Message-ID: <20070910174513.C951680F8@code0.codespeak.net> Author: reebalazs Date: Mon Sep 10 19:45:12 2007 New Revision: 46451 Added: kukit/kss.core/tag/1.2.1/ - copied from r46450, kukit/kss.core/branch/1.2/ Log: Branch for release From reebalazs at codespeak.net Mon Sep 10 19:52:14 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 10 Sep 2007 19:52:14 +0200 (CEST) Subject: [KSS-checkins] r46452 - in kukit/kss.core/tag/1.2.1: . docs kss/core kss/core/pluginregistry Message-ID: <20070910175214.B9A6D80F8@code0.codespeak.net> Author: reebalazs Date: Mon Sep 10 19:52:13 2007 New Revision: 46452 Removed: kukit/kss.core/tag/1.2.1/setup.cfg Modified: kukit/kss.core/tag/1.2.1/docs/HISTORY.txt kukit/kss.core/tag/1.2.1/kss/core/ (props changed) kukit/kss.core/tag/1.2.1/kss/core/EXTERNALS.TXT kukit/kss.core/tag/1.2.1/kss/core/pluginregistry/ (props changed) kukit/kss.core/tag/1.2.1/kss/core/pluginregistry/EXTERNALS.TXT kukit/kss.core/tag/1.2.1/kss/core/version.txt kukit/kss.core/tag/1.2.1/setup.py Log: Set release Modified: kukit/kss.core/tag/1.2.1/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/tag/1.2.1/docs/HISTORY.txt (original) +++ kukit/kss.core/tag/1.2.1/docs/HISTORY.txt Mon Sep 10 19:52:13 2007 @@ -2,9 +2,13 @@ (name of developer listed in brackets) -kss.core - 1.2dev Unreleased +kss.core - 1.2.1 Released 2007-09-10 - - ... + - Prepare for release. + [ree] + + - minor bug fixes + [ree, jfroche] kss.core - 1.2 Released 2007-08-17 Modified: kukit/kss.core/tag/1.2.1/kss/core/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/tag/1.2.1/kss/core/EXTERNALS.TXT (original) +++ kukit/kss.core/tag/1.2.1/kss/core/EXTERNALS.TXT Mon Sep 10 19:52:13 2007 @@ -5,4 +5,4 @@ # You can update your working dir by: # svn propset svn:externals -F EXTERNALS.TXT . # -kukit http://codespeak.net/svn/kukit/kukit.js/branch/1.2 +kukit http://codespeak.net/svn/kukit/kukit.js/tag/1.2.1 Modified: kukit/kss.core/tag/1.2.1/kss/core/pluginregistry/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/tag/1.2.1/kss/core/pluginregistry/EXTERNALS.TXT (original) +++ kukit/kss.core/tag/1.2.1/kss/core/pluginregistry/EXTERNALS.TXT Mon Sep 10 19:52:13 2007 @@ -7,4 +7,4 @@ # # concatresource is now included like as batteries -_concatresource https://codespeak.net/svn/kukit/kss.concatresource/branch/1.2/kss/concatresource +_concatresource https://codespeak.net/svn/kukit/kss.concatresource/tag/1.2.1/kss/concatresource Modified: kukit/kss.core/tag/1.2.1/kss/core/version.txt ============================================================================== --- kukit/kss.core/tag/1.2.1/kss/core/version.txt (original) +++ kukit/kss.core/tag/1.2.1/kss/core/version.txt Mon Sep 10 19:52:13 2007 @@ -1 +1 @@ -1.2dev unreleased +1.2.1 Released 2007-09-10 Deleted: /kukit/kss.core/tag/1.2.1/setup.cfg ============================================================================== --- /kukit/kss.core/tag/1.2.1/setup.cfg Mon Sep 10 19:52:13 2007 +++ (empty file) @@ -1,3 +0,0 @@ -[egg_info] -tag_build = dev -tag_svn_revision = true Modified: kukit/kss.core/tag/1.2.1/setup.py ============================================================================== --- kukit/kss.core/tag/1.2.1/setup.py (original) +++ kukit/kss.core/tag/1.2.1/setup.py Mon Sep 10 19:52:13 2007 @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import sys, os -version = '1.2' +version = '1.2.1' setup(name='kss.core', version=version, From reebalazs at codespeak.net Mon Sep 10 19:53:02 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 10 Sep 2007 19:53:02 +0200 (CEST) Subject: [KSS-checkins] r46453 - kukit/kss.core/branch/1.2/docs Message-ID: <20070910175302.9000D80F8@code0.codespeak.net> Author: reebalazs Date: Mon Sep 10 19:53:02 2007 New Revision: 46453 Modified: kukit/kss.core/branch/1.2/docs/HISTORY.txt Log: Set history Modified: kukit/kss.core/branch/1.2/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/branch/1.2/docs/HISTORY.txt (original) +++ kukit/kss.core/branch/1.2/docs/HISTORY.txt Mon Sep 10 19:53:02 2007 @@ -6,6 +6,14 @@ - ... +kss.core - 1.2.1 Released 2007-09-10 + + - Prepare for release. + [ree] + + - minor bug fixes + [ree, jfroche] + kss.core - 1.2 Released 2007-08-17 - Refactored js code. From reebalazs at codespeak.net Mon Sep 10 19:54:32 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 10 Sep 2007 19:54:32 +0200 (CEST) Subject: [KSS-checkins] r46454 - kukit/kss.demo/tag/1.2.1 Message-ID: <20070910175432.DD8CD8100@code0.codespeak.net> Author: reebalazs Date: Mon Sep 10 19:54:32 2007 New Revision: 46454 Added: kukit/kss.demo/tag/1.2.1/ - copied from r46453, kukit/kss.demo/branch/1.2/ Log: Branch for release From reebalazs at codespeak.net Mon Sep 10 19:58:33 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 10 Sep 2007 19:58:33 +0200 (CEST) Subject: [KSS-checkins] r46456 - in kukit/kss.demo/tag/1.2.1: . docs kss/demo Message-ID: <20070910175833.5F5BF8104@code0.codespeak.net> Author: reebalazs Date: Mon Sep 10 19:58:33 2007 New Revision: 46456 Removed: kukit/kss.demo/tag/1.2.1/setup.cfg Modified: kukit/kss.demo/tag/1.2.1/docs/HISTORY.txt kukit/kss.demo/tag/1.2.1/kss/demo/version.txt kukit/kss.demo/tag/1.2.1/setup.py Log: Set release Modified: kukit/kss.demo/tag/1.2.1/docs/HISTORY.txt ============================================================================== --- kukit/kss.demo/tag/1.2.1/docs/HISTORY.txt (original) +++ kukit/kss.demo/tag/1.2.1/docs/HISTORY.txt Mon Sep 10 19:58:33 2007 @@ -2,9 +2,10 @@ (name of developer listed in brackets) -kss.demo - 1.2dev Unreleased +kss.demo - 1.2.1 Released 2007-09-10 - - ... + - Prepare for release + [ree] kss.demo - 1.2 Released 2007-08-17 Modified: kukit/kss.demo/tag/1.2.1/kss/demo/version.txt ============================================================================== --- kukit/kss.demo/tag/1.2.1/kss/demo/version.txt (original) +++ kukit/kss.demo/tag/1.2.1/kss/demo/version.txt Mon Sep 10 19:58:33 2007 @@ -1 +1 @@ -1.2dev Unreleased +1.2.1 Released 2007-09-10 Deleted: /kukit/kss.demo/tag/1.2.1/setup.cfg ============================================================================== --- /kukit/kss.demo/tag/1.2.1/setup.cfg Mon Sep 10 19:58:33 2007 +++ (empty file) @@ -1,3 +0,0 @@ -[egg_info] -tag_build = dev -tag_svn_revision = true Modified: kukit/kss.demo/tag/1.2.1/setup.py ============================================================================== --- kukit/kss.demo/tag/1.2.1/setup.py (original) +++ kukit/kss.demo/tag/1.2.1/setup.py Mon Sep 10 19:58:33 2007 @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import sys, os -version = '1.2' +version = '1.2.1' setup(name='kss.demo', version=version, @@ -26,12 +26,11 @@ zip_safe=False, install_requires=[ # -*- Extra requirements: -*- - 'kss.core>=dev', + 'kss.core>=1.2.1', ], entry_points=""" # -*- Entry points: -*- """, dependency_links=[ - 'https://codespeak.net/svn/kukit/kss.core/branch/1.2#egg=kss.core-dev', ], ) From reebalazs at codespeak.net Mon Sep 10 19:59:07 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 10 Sep 2007 19:59:07 +0200 (CEST) Subject: [KSS-checkins] r46457 - kukit/kss.demo/branch/1.2/docs Message-ID: <20070910175907.EB79A8105@code0.codespeak.net> Author: reebalazs Date: Mon Sep 10 19:59:07 2007 New Revision: 46457 Modified: kukit/kss.demo/branch/1.2/docs/HISTORY.txt Log: Adjust history Modified: kukit/kss.demo/branch/1.2/docs/HISTORY.txt ============================================================================== --- kukit/kss.demo/branch/1.2/docs/HISTORY.txt (original) +++ kukit/kss.demo/branch/1.2/docs/HISTORY.txt Mon Sep 10 19:59:07 2007 @@ -6,6 +6,11 @@ - ... +kss.demo - 1.2.1 Released 2007-09-10 + + - Prepare for release + [ree] + kss.demo - 1.2 Released 2007-08-17 - Prepare for release From reebalazs at codespeak.net Thu Sep 13 00:30:23 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 13 Sep 2007 00:30:23 +0200 (CEST) Subject: [KSS-checkins] r46522 - kukit/kss.demo/branch/ree-demoload Message-ID: <20070912223023.D6F0680F0@code0.codespeak.net> Author: reebalazs Date: Thu Sep 13 00:30:22 2007 New Revision: 46522 Added: kukit/kss.demo/branch/ree-demoload/ - copied from r46521, kukit/kss.demo/trunk/ Log: Branch off for ree-demoload From reebalazs at codespeak.net Thu Sep 13 00:53:03 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 13 Sep 2007 00:53:03 +0200 (CEST) Subject: [KSS-checkins] r46525 - kukit/kss.demo/branch/ree-demoload Message-ID: <20070912225303.6EC5780C3@code0.codespeak.net> Author: reebalazs Date: Thu Sep 13 00:53:02 2007 New Revision: 46525 Removed: kukit/kss.demo/branch/ree-demoload/ Log: Rearrange branch From reebalazs at codespeak.net Thu Sep 13 00:55:42 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 13 Sep 2007 00:55:42 +0200 (CEST) Subject: [KSS-checkins] r46526 - in kukit/kss.demo: branch/ree-demoload trunk Message-ID: <20070912225542.925F980D5@code0.codespeak.net> Author: reebalazs Date: Thu Sep 13 00:55:41 2007 New Revision: 46526 Added: kukit/kss.demo/branch/ree-demoload/ - copied from r46525, kukit/kss.demo/trunk/ Removed: kukit/kss.demo/trunk/ Log: Copy wrong commit to a branch From reebalazs at codespeak.net Thu Sep 13 00:57:37 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 13 Sep 2007 00:57:37 +0200 (CEST) Subject: [KSS-checkins] r46527 - kukit/kss.demo/trunk Message-ID: <20070912225737.42EDA80D5@code0.codespeak.net> Author: reebalazs Date: Thu Sep 13 00:57:36 2007 New Revision: 46527 Added: kukit/kss.demo/trunk/ - copied from r46522, kukit/kss.demo/branch/ree-demoload/ Log: fix trunk (sorry ohloh) From reebalazs at codespeak.net Thu Sep 13 00:31:24 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 13 Sep 2007 00:31:24 +0200 (CEST) Subject: [KSS-checkins] r46523 - in kukit/kss.demo/trunk: docs kss/demo kss/demo/browser kss/demo/browser/commandaction kss/demo/browser/coreplugin kss/demo/browser/coresyntax kss/demo/browser/parameterfunction kss/demo/browser/selectors kss/demo/demo kss/demo/demo/parameterfunction Message-ID: <20070912223124.3CD9080F0@code0.codespeak.net> Author: reebalazs Date: Thu Sep 13 00:31:22 2007 New Revision: 46523 Added: kukit/kss.demo/trunk/kss/demo/browser/demoview.py - copied unchanged from r46458, kukit/kss.demo/trunk/kss/demo/demoview.py kukit/kss.demo/trunk/kss/demo/browser/registry.py kukit/kss.demo/trunk/kss/demo/demo/ - copied from r46458, kukit/kss.demo/trunk/kss/demo/browser/ kukit/kss.demo/trunk/kss/demo/demo/config.py kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/kssid.kss kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/kssid.pt kukit/kss.demo/trunk/kss/demo/events.py kukit/kss.demo/trunk/kss/demo/registry.py Removed: kukit/kss.demo/trunk/kss/demo/browser/autoupdate.kss kukit/kss.demo/trunk/kss/demo/browser/autoupdate.pt kukit/kss.demo/trunk/kss/demo/browser/basic_commands.kss kukit/kss.demo/trunk/kss/demo/browser/basic_commands.pt kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.kss kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.pt kukit/kss.demo/trunk/kss/demo/browser/commandaction/ kukit/kss.demo/trunk/kss/demo/browser/coreplugin/ kukit/kss.demo/trunk/kss/demo/browser/coresyntax/ kukit/kss.demo/trunk/kss/demo/browser/draganddrop.kss kukit/kss.demo/trunk/kss/demo/browser/draganddrop.pt kukit/kss.demo/trunk/kss/demo/browser/effects.kss kukit/kss.demo/trunk/kss/demo/browser/effects.pt kukit/kss.demo/trunk/kss/demo/browser/error_handling.kss kukit/kss.demo/trunk/kss/demo/browser/error_handling.pt kukit/kss.demo/trunk/kss/demo/browser/form_submit.kss kukit/kss.demo/trunk/kss/demo/browser/form_submit.pt kukit/kss.demo/trunk/kss/demo/browser/html_inserts.kss kukit/kss.demo/trunk/kss/demo/browser/html_inserts.pt kukit/kss.demo/trunk/kss/demo/browser/inline_edit.kss kukit/kss.demo/trunk/kss/demo/browser/inline_edit.pt kukit/kss.demo/trunk/kss/demo/browser/more_selectors.js kukit/kss.demo/trunk/kss/demo/browser/more_selectors.kss kukit/kss.demo/trunk/kss/demo/browser/more_selectors.pt kukit/kss.demo/trunk/kss/demo/browser/parameterfunction/ kukit/kss.demo/trunk/kss/demo/browser/preventdefault.kss kukit/kss.demo/trunk/kss/demo/browser/preventdefault.pt kukit/kss.demo/trunk/kss/demo/browser/selectors/ kukit/kss.demo/trunk/kss/demo/browser/tree.kss kukit/kss.demo/trunk/kss/demo/browser/tree.pt kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.kss kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.pt kukit/kss.demo/trunk/kss/demo/browser/two_selects.kss kukit/kss.demo/trunk/kss/demo/browser/two_selects.pt kukit/kss.demo/trunk/kss/demo/browser/xpath.kss kukit/kss.demo/trunk/kss/demo/browser/xpath.pt kukit/kss.demo/trunk/kss/demo/demoview.py Modified: kukit/kss.demo/trunk/docs/HISTORY.txt kukit/kss.demo/trunk/kss/demo/browser/configure.zcml kukit/kss.demo/trunk/kss/demo/browser/kss_demo_index.pt kukit/kss.demo/trunk/kss/demo/configure.zcml kukit/kss.demo/trunk/kss/demo/demo/configure.zcml kukit/kss.demo/trunk/kss/demo/interfaces.py Log: Implement demo loading. Modified: kukit/kss.demo/trunk/docs/HISTORY.txt ============================================================================== --- kukit/kss.demo/trunk/docs/HISTORY.txt (original) +++ kukit/kss.demo/trunk/docs/HISTORY.txt Thu Sep 13 00:31:22 2007 @@ -6,6 +6,9 @@ - ... + - Implement pluggable demos + [ree] + kss.demo - 1.2 Released 2007-08-17 - Prepare for release Deleted: /kukit/kss.demo/trunk/kss/demo/browser/autoupdate.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/autoupdate.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,9 +0,0 @@ -div#update-area:timeout { - evt-timeout-delay: 2000; - action-server: getCurrentTime; -} - -input#start-update:click { - action-server: getAutoupdateMarkup; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/autoupdate.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/autoupdate.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,37 +0,0 @@ - - - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

-

Three autoupdate

- -

Demo

-
-
- - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/basic_commands.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/basic_commands.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,21 +0,0 @@ - -button#copyFrom:click { - action-server: copyFromDivContent; -} - -button#copyTo:click { - action-server: copyToDivContent; -} - -button#moveTo:click { - action-server: moveToDivContent; -} - -button#clear:click { - action-server: clearDivContent; -} - -button#change:click { - action-server: getDivContent; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/basic_commands.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/basic_commands.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,121 +0,0 @@ - - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

- -

Kss mode

- -

Change tag content

-

Top div

-
- KSS -
- -

Bottom div

-
- copy here -
-

Javascript Styling

-

This page defines a link in the header which rel attribute points - to a .kss resource file on the server : - - - see the kss file here.

-

- This .kss file declares CSS selectors associated with events and server URLs called when the event occur. -

-

A javascript engine processes the XML content : it inserts javascript - events in the DOM.

-

- For instance, the click event of button with the id change will call asynchronously the getDivContent URL. - -

-

Server Asynchronous Call

-

- The events associated with Javascript just call the server asynchronously. -

-

- The response is a XML file. - The XML contains CSS selectors associated with commands. -

-

- The Javascript engine selects the DOM nodes to which it applies each command. -

-

- For instance, let's look at the moveToDivContent response. -

-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:kukit="http://www.kukit.org/commands/1.0"><body>
-<kukit:commands>
-<kukit:command selector="div#copy" name="copyChildNodesTo"
-               selectorType="">
-    <kukit:param name="html_id">demo</kukit:param>
-</kukit:command>
-<kukit:command selector="div#copy" name="clearChildNodes"
-               selectorType="">
-</kukit:command>
-</kukit:commands>
-</body></html>
-   
-

- The XML specifies two commands to apply to the div#copy node : -

-

- copyChildNodesTo copies the children of the DOM node to the node with id demo. -

-

- clearChildNodes removes the children of the DOM node. -

- - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,5 +0,0 @@ -input#submit:click { - evt-click-preventdefault: true; - action-server: save; - save-text_save: currentFormVar(text_save); -} Deleted: /kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,27 +0,0 @@ - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

- -

Cancel Submit Click Demo

-

saved !

-

Empty

-
-
- - - -
-
-
-

Kukit response

- - Modified: kukit/kss.demo/trunk/kss/demo/browser/configure.zcml ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/configure.zcml (original) +++ kukit/kss.demo/trunk/kss/demo/browser/configure.zcml Thu Sep 13 00:31:22 2007 @@ -1,19 +1,71 @@ - - - - - - + + + + - + + + + + + + + + + + + + + + + + + /> + + Deleted: /kukit/kss.demo/trunk/kss/demo/browser/draganddrop.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/draganddrop.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,54 +0,0 @@ -.draggable:dad-drag { -} - -.horizontal:dad-start { - evt-dad-start-constraint: horizontal; -} - -.horizontal:dad-end { - evt-dad-end-constraint: horizontal; -} - -.horizontal:dad-drag { - evt-dad-drag-constraint: horizontal; -} - -.vertical:dad-start { - evt-dad-start-constraint: vertical; -} - -.vertical:dad-end { - evt-dad-end-constraint: vertical; -} - -.vertical:dad-drag { - evt-dad-drag-constraint: vertical; -} - -} - -.draggable:dad-start { - action-client: logDebug; - action-client: setStyle; - setStyle-name: color; - setStyle-value: red; -} - -.draggable:dad-end { - action-client: logDebug; - action-client: setStyle; - setStyle-name: color; - setStyle-value: black; -} - - -.droppable:dad-drop { - action-client: replaceInnerHTML; - replaceInnerHTML-html: "dropped"; -} - -.droppable:dad-hover { - action-client: replaceInnerHTML; - replaceInnerHTML-html: "hovered"; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/draganddrop.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/draganddrop.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,66 +0,0 @@ - - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

-

Drag and drop

- - - - - - - - - - - -
FreeVerticalHorizontal
-
Drag me
-
Drop me here
-
or here
-
-
Drag me
-
Drop me here
-
or here
-
-
Drag me
-
Drop me here
-
or here
-
- - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/effects.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/effects.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,9 +0,0 @@ -.effects:click { - action-client: effect; - effect-type: nodeAttr('id'); -} - -input#resetEffects:click { - action-server: resetEffects; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/effects.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/effects.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,27 +0,0 @@ - - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

-

Effects

- -

Demo

-
Click here to make me fade
-
Click here to make me puff
-
Click here to make me blindup
- - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/error_handling.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/error_handling.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,50 +0,0 @@ - - -.clickable:click { - evt-click-preventdefault: true; - action-server: errTest; - errTest-id: nodeAttr(id); - errTest-act: kssAttr(act); -} - -/* This one adds the err handling to the second row - It also demonstrates kss rules are merged like css ones -*/ - -/* -.handled:click { - errTest-error: alert; - alert-message: nodeAttr(id); -} -*/ - -/* The next rule demonstrates that instead of executing a local - action on the originally selected node, we use executeCommand - which execute a given local action on a new set of selected nodes. -*/ - -.handled:click { - errTest-error: executeCommand; - executeCommand-commandSelector: 'update-status'; - executeCommand-commandSelectorType: htmlid; - executeCommand-commandName: replaceInnerHTML; - executeCommand-html: 'Error handler activated.'; -} - -/* Spinner control -*/ - -#spinner-status:spinneron { - evt-spinneron-laziness: 0; - action-client: setStyle; - setStyle-name: display; - setStyle-value: block; -} - -#spinner-status:spinneroff { - evt-spinneroff-laziness: 0; - action-client: setStyle; - setStyle-name: display; - setStyle-value: none; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/error_handling.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/error_handling.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,73 +0,0 @@ - - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

- -

Error handling demo

-
-
Loading...
-
-

-
-

We try four cases here. "No error" and "Empty action" are both valid responses, - except that the second one gives a response with no commands and so it issues a warning into - the kss log. "Error" gives a failed responses due to an exception in the server method - on the server.

-

The buttons in the first row have no error handled.

-
- - - - - -
-

The buttons in the second row have individual error handlers.

-
-
- - - - - -
-

- You can also try suspending your server process and start generating timed out requests. - Timed out responses are also handled like ones arriving with error. - The timeout period is by default 8 s now.

-

- In addition, the request queue manager queues up the outgoing responses and maximizes - their number (currently in 4): click like crazy on the buttons and you will see that - your server will not get hogged. More will be told about this topic in the upcoming - documentation.

- - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/form_submit.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/form_submit.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,5 +0,0 @@ -input#submit:click { - evt-click-preventdefault: true; - action-server: formSave; - formSave-data: currentForm(); -} Deleted: /kukit/kss.demo/trunk/kss/demo/browser/form_submit.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/form_submit.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,54 +0,0 @@ - - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

- -

Form Submit Demo

-

saved !

-

Empty

-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
- - -
-
-
- - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/html_inserts.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/html_inserts.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,21 +0,0 @@ - -button#insertBefore:click { - action-server: htmlInsertBefore; -} - -button#insertAfter:click { - action-server: htmlInsertAfter; -} - -button#insertAsFirstChild:click { - action-server: htmlInsertAsFirstChild; -} - -button#insertAsLastChild:click { - action-server: htmlInsertAsLastChild; -} - -button#insert:click { - action-server: htmlReplace; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/html_inserts.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/html_inserts.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,61 +0,0 @@ - - - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

-

HTML insertions (a.k.a. Change tags II.)

-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-

The playground:

-

KSS for a life.

- - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/inline_edit.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/inline_edit.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,20 +0,0 @@ -div#text:click { - action-server: getInputField; - getInputField-value: currentFormVar(value); -} - -div#text:keydown { -evt-keydown-allowbubbling: true; -evt-keydown-keycodes: 13; -action-client:log; -action-server: saveText; -saveText-value:currentFormVar(value); - -} - -input#save:click { - action-server: saveText; - saveText-value: currentFormVar(value); -} - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/inline_edit.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/inline_edit.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,22 +0,0 @@ - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

- -

Instant edit Demo

-
-
-
- click me! - -
-
-
- - Modified: kukit/kss.demo/trunk/kss/demo/browser/kss_demo_index.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/kss_demo_index.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/kss_demo_index.pt Thu Sep 13 00:31:22 2007 @@ -4,52 +4,29 @@ tal:attributes="href string:${context/@@absolute_url}/++resource++demo.css"/> -

KSS demos

- -

Parameter functions

- -

Selectors

- -

Core syntax

- -

Core plugin

- -

Commands/Actions

- - -

- -

Unit tests

+

KSS demos

+

Unit tests

- + + +

Core plugin

+
+ +

Plugin namespace core

+
+ +

Category

+
+ +
+ Deleted: /kukit/kss.demo/trunk/kss/demo/browser/more_selectors.js ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/more_selectors.js Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,37 +0,0 @@ - -/* Event plugins for the more_selector demo */ -kukit.more_selectors = {}; - -kukit.more_selectors.AnnoyClickerEvent = function() { -}; - -kukit.more_selectors.AnnoyClickerEvent.prototype.__bind_click__ = function(name, func_to_bind, oper) { - // validate and set parameters - oper.completeParms([], {'count': '3'}, 'annoyClicker event binding'); - oper.evalInt('count', 'annoyClicker event binding'); - if (oper.parms.count < 1) - throw 'Parameter count must be > 0, "' + oper.parms.count + '"'; - // overwrite countsomuch - this.countsomuch = oper.parms.count; - this.count = this.countsomuch; - // Just bind the event via the native event binder - oper.parms = {}; - kukit.pl.NativeEventBinder.prototype.__bind__('click', func_to_bind, oper); -}; - -kukit.more_selectors.AnnoyClickerEvent.prototype.__default_click__ = function(name, oper) { - oper.completeParms([], {}, 'annoyClicker event binding'); - this.count -= 1; - if (this.count == 0) { - // Continue with the real action. - this.count = this.countsomuch; - this.__continueEvent__('doit', oper.node, {}); - } else { - this.__continueEvent__('annoy', oper.node, {}); - } -}; - -kukit.eventsGlobalRegistry.register('annoyclicker', 'click', kukit.more_selectors.AnnoyClickerEvent, '__bind_click__', '__default_click__'); -kukit.eventsGlobalRegistry.register('annoyclicker', 'annoy', kukit.more_selectors.AnnoyClickerEvent, null, null); -kukit.eventsGlobalRegistry.register('annoyclicker', 'doit', kukit.more_selectors.AnnoyClickerEvent, null, null); - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/more_selectors.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/more_selectors.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,29 +0,0 @@ - -#button-one:annoyclicker-click(annoyMe) { -} - -behaviour:annoyclicker-doit(annoyMe) { - action-server: clickedButton; - clickedButton-id: nodeAttr(id); - action-client: log; - log-message: "Was here."; -} - -behaviour:annoyclicker-annoy(annoyMe) { - action-client: alert; - alert-message: "Keep trying until you get there"; -} - -#button-two:annoyclicker-click(annoyYou) { - evt-annoyclicker-click-count: 2; -} - -behaviour:annoyclicker-doit(annoyYou) { - action-server: clickedButton; - clickedButton-id: nodeAttr(id); -} - -behaviour:annoyclicker-annoy(annoyYou) { - action-client: alert; - alert-message: "Keep trying until you get there, from the second button"; -} Deleted: /kukit/kss.demo/trunk/kss/demo/browser/more_selectors.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/more_selectors.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,38 +0,0 @@ - - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

-

More complex selectors

- -

-This demo implements the annoyclicker-click kss plugin that shows a simple -pattern of creating stateful (class-like) events in a plugin -and how to bind them from kss. -

- -

-The first button and the second button are bound to two "event binder -instances", the first one sends every 3rd click to the server and -executes a local action otherwise; the second button does -the same but with a count of two. -

- - -

Demo

-
-
- - - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/preventdefault.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/preventdefault.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,62 +0,0 @@ - -a#follow:click { - evt-click-preventdefault: true; - action-client: log; -} - -/* preventdefault is explicit on this.*/ - -input[type="text"].text:keydown { - evt-keydown-preventdefault: true; - evt-keydown-keycodes: 13; - action-client: log; -} - -/* Since some browsers (mainly, some version of Safari) - do a little bit of fireworks with the events (yeah, - cause it fires them up all together) we disable the - default on all of them */ -input[type="text"].text:keypress { - evt-keypress-preventdefault: true; - evt-keypress-keycodes: 13; - action-client: log; -} - -input[type="text"].text:keyup { - evt-keyup-preventdefault: true; - evt-keyup-keycodes: 13; - action-client: log; -} - -/* This used to be the old hack for Safari, actually disabling - the default (submit) on button click. - Apparently the default action for Safari is not "submit the form" - but rather "click on submit", hence triggering another event - through an event */ -input[type="submit"]:click { - evt-click-preventdefault: true; - action-client: log; -} - -/* Second row, allowbubbling combined: */ - -div#follow-wrapper:click { - evt-click-preventdefault: true; - evt-click-allowbubbling: true; - action-client: log; -} - -/* preventdefault is explicit on this.*/ -div#text-wrapper:keydown { - evt-keydown-preventdefault: true; - evt-keydown-allowbubbling: true; - evt-keydown-keycodes: 13; - action-client: log; -} - -div#submit-wrapper:click { - evt-click-preventdefault: true; - evt-click-allowbubbling: true; - action-client: log; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/preventdefault.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/preventdefault.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,46 +0,0 @@ - - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

- -

Preventdefault Demo

-

- This is for testing the work of preventdefault to test a specific - workaround against a Safari bug. Specifically, none of the above - controls should cause a page reload. -

-
-

Do not follow

- - - - - -

The same with allowbubbling combined:

- -
- -
-
- -
-
- -
-
- - Added: kukit/kss.demo/trunk/kss/demo/browser/registry.py ============================================================================== --- (empty file) +++ kukit/kss.demo/trunk/kss/demo/browser/registry.py Thu Sep 13 00:31:22 2007 @@ -0,0 +1,36 @@ + +from kss.demo.interfaces import IKSSDemoRegistry +from zope.component import getUtility +try: + from Products.Five import BrowserView +except ImportError: + from zope.publisher.browser import BrowserView + +class KSSDemoRegistryView(BrowserView): + + def getSortedDemos(self): + """Get demos""" + registry = getUtility(IKSSDemoRegistry) + return registry.getSortedDemos() + + def getDemoGroups(self): + """Get demos groupped by plugin_namespace, category""" + demo_groups = [] + prev_plugin_namespace, prev_category = None, None + group = None + for demo in self.getSortedDemos(): + plugin_namespace = demo['plugin_namespace'] + category = demo['category'] + if prev_plugin_namespace != plugin_namespace or \ + prev_category != category: + # Start a new group. + group = [] + demo_groups.append(dict( + plugin_namespace = plugin_namespace, + category = category, + demos = group, + )) + prev_plugin_namespace = plugin_namespace + prev_category = category + group.append(demo) + return demo_groups Deleted: /kukit/kss.demo/trunk/kss/demo/browser/tree.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/tree.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,11 +0,0 @@ -.state-expanded:click { - action-server: collapseSubTree; - collapseSubTree-value: kssAttr("node"); - collapseSubTree-xvalue: kssAttr("xnode"); -} - -.state-collapsed:click { - action-server: expandSubTree; - expandSubTree-value: kssAttr("node"); - expandSubTree-xvalue: kssAttr("xnode"); -} Deleted: /kukit/kss.demo/trunk/kss/demo/browser/tree.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/tree.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,50 +0,0 @@ - - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

- -

Tree Demo

-

This is not finished yet.

-

In this demo we use attributes in a special namespace. This makes - it possible to put attributes to nodes without being forced to reuse "id" - or otherwise produce invalid html.

-

There are two ways to provide these attributes in pages: - with real xhtml (mimetype text/xhtml), namespace attributes can be used, - with transitional xhtml (mimetype text/html) - the attributes can be encoded into "class" attributes. Both are demonstrated - in this example in parallel, but in reality, one of these should be - used depending on the content type of the page.

-
-
    -
  • 1
  • -
  • 2
  • -
      -
    • 2.1
    • -
    • 2.2
    • -
    -
  • 3
  • -
      -
    • 3.1
    • -
    • 3.2
    • -
    -
- -
- - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,5 +0,0 @@ -select.master-select:change { - action-server: updateSlaveSelector; - updateSlaveSelector-masterid: nodeAttr("id"); - updateSlaveSelector-value: currentFormVar(); -} Deleted: /kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,39 +0,0 @@ - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

-

Master-slave selects revisited

-
-
- - -
-
- - -
-
- - -
-
- - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/two_selects.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/two_selects.kss Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,4 +0,0 @@ -select#first:change { - action-server: getCorrespondingSelect; - getCorrespondingSelect-value: currentFormVar(value); -} Deleted: /kukit/kss.demo/trunk/kss/demo/browser/two_selects.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/two_selects.pt Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,21 +0,0 @@ - - - - - - -

All demos

-

Start logging pane

-

View KSS resource

-

Two Selects

-
- - - -

Remove Node with XPath

-

XPath

-

next 1

-

next 2

-

next 3

- - - Modified: kukit/kss.demo/trunk/kss/demo/configure.zcml ============================================================================== --- kukit/kss.demo/trunk/kss/demo/configure.zcml (original) +++ kukit/kss.demo/trunk/kss/demo/configure.zcml Thu Sep 13 00:31:22 2007 @@ -15,509 +15,92 @@ title="View" /> - - + - + - - + - - + - - - + class=".simplecontent.SimpleContent" + meta_type="KssDemo SimpleContent" + addview="AddSimpleContent.html" + permission="zope.View" + global="True" + /> - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - + + + + - - - - - + + Added: kukit/kss.demo/trunk/kss/demo/demo/config.py ============================================================================== --- (empty file) +++ kukit/kss.demo/trunk/kss/demo/demo/config.py Thu Sep 13 00:31:22 2007 @@ -0,0 +1,32 @@ + +from kss.demo.interfaces import IKSSDemoCollection +from kss.demo.registry import KSSDemo +from zope.interface import implements + +class KSSCoreDemos(object): + implements(IKSSDemoCollection) + + demos = ( + KSSDemo('', '', "basic_commands.html", "Change tag content"), + KSSDemo('', '', "two_selects.html", "Two selects"), + KSSDemo('', '', "autoupdate.html", "Auto update"), + KSSDemo('', '', "inline_edit.html", "Inline edit"), + KSSDemo('', '', "cancel_submit.html", "Cancel Submit Click"), + KSSDemo('', '', "tree.html", "Tree"), + KSSDemo('', '', "more_selectors.html", "More complex selectors"), + KSSDemo('', '', "two_select_revisited.html", "Master-slave selects revisited"), + KSSDemo('', '', "form_submit.html", "Form submit"), + KSSDemo('', '', "effects.html", "Effects"), + KSSDemo('', '', "error_handling.html", "Error handling"), + KSSDemo('', '', "preventdefault.html", "Preventdefault (a.k.a. Safari workarounds)"), + KSSDemo('', '', "html_inserts.html", "HTML insertions (Change tag content returns)"), +## KSSDemo('', '', "draganddrop.html", "Scriptaculous drag and drop"), + KSSDemo('', 'Parameter functions', 'pf_forms.html', 'Forms'), + KSSDemo('', 'Selectors', 'selectors.html', 'Parent node selector'), + KSSDemo('', 'Core syntax', "kss_selector_param.html", "Kss selector parameters"), + KSSDemo('', 'Core syntax', "kss_url_param.html", "Kss url parameters"), + KSSDemo('', 'Core plugin', "kss_evt_preventbubbling.html", "Prevent bubbling KSS event parameter"), + KSSDemo('', 'Commands/Actions', "ca_focus.html", "Focus"), + KSSDemo('', 'Commands/Actions', "actions.html", "Toggle case action"), + ) + Modified: kukit/kss.demo/trunk/kss/demo/demo/configure.zcml ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/configure.zcml (original) +++ kukit/kss.demo/trunk/kss/demo/demo/configure.zcml Thu Sep 13 00:31:22 2007 @@ -1,19 +1,434 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/kssid.kss ============================================================================== --- (empty file) +++ kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/kssid.kss Thu Sep 13 00:31:22 2007 @@ -0,0 +1,91 @@ +#text:click { + action-client: executeCommand; + executeCommand-name: replaceInnerHTML; + executeCommand-selector: "#target"; + executeCommand-html: currentFormVar(); +} + +#text-by-name:click { + action-client: executeCommand; + executeCommand-name: replaceInnerHTML; + executeCommand-selector: "#target"; + executeCommand-html: currentFormVar(text-by-name); +} + +#text-by-kssname:click { + action-client: executeCommand; + executeCommand-name: replaceInnerHTML; + executeCommand-selector: "#target"; + executeCommand-html: currentFormVar(kssAttr(key1, true)); +} +#textarea:click { + action-client: executeCommand; + executeCommand-name: replaceInnerHTML; + executeCommand-selector: "#target"; + executeCommand-html: currentFormVar(); +} + +#textarea-by-name:click { + action-client: executeCommand; + executeCommand-name: replaceInnerHTML; + executeCommand-selector: "#target"; + executeCommand-html: currentFormVar("textarea-by-name"); +} + +#radio1:click { + action-client: executeCommand; + executeCommand-name: replaceInnerHTML; + executeCommand-selector: "#target"; + executeCommand-html: currentFormVar(); +} + +#radio2:click { + action-client: executeCommand; + executeCommand-name: replaceInnerHTML; + executeCommand-selector: "#target"; + executeCommand-html: currentFormVar(); +} + +#radio-by-name:click { + action-client: executeCommand; + executeCommand-name: replaceInnerHTML; + executeCommand-selector: "#target"; + executeCommand-html: currentFormVar(radio-by-name); +} + +#fullform-simple:click { + action-server: submitFullForm; + submitFullForm-form: currentForm(); +} + +#fullform-simplenamed:click { + action-server: submitFullForm; + submitFullForm-form: form(full1); +} + +#fullform-current:click { + action-server: submitFullFormIntoRequest; + submitFullFormIntoRequest-kssSubmitForm: currentForm(); +} + +#fullform-named:click { + action-server: submitFullFormIntoRequest; + submitFullFormIntoRequest-kssSubmitForm: form(full2); +} + +#fullform-namedbystring:click { + action-server: submitFullFormIntoRequest; + submitFullFormIntoRequest-kssSubmitForm: 'full2'; +} + +#single-select:click { + action-client: executeCommand; + executeCommand-name: replaceInnerHTML; + executeCommand-selector: "#target"; + executeCommand-html: currentFormVar(single-select); +} + +#multiple-select:click { + action-server: submitMultiSelect; + submitMultiSelect-items: currentFormVar(multiple-select); +} Added: kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/kssid.pt ============================================================================== --- (empty file) +++ kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/kssid.pt Thu Sep 13 00:31:22 2007 @@ -0,0 +1,224 @@ + + + + + + + +

Forms

+

We test the parameter functions related to forms : those functions + extract values from fields to use them in the kinetic stylesheet.

+

The inner HTML of the div below will be replaced with the + value of the form element.

+
Target
+ +

+ currentFormVar() with text field. +

+
+ Click the text field. +
+
+ +
+

+ currentFormVar(name) with text field. +

+
+ Click the button. +
+
+
+ Click me ! + +
+
+

+ currentFormVar(kssAttr('name')) with text field. +

+
+ Click the button. +
+
+
+ Click me ! + +
+
+ +

+ currentFormVar() with textarea field. +

+
+ Click the textarea field. +
+
+ +
+

+ currentFormVar(name) with textarea field. +

+
+ Click the button. +
+
+
+ Click me ! + +
+
+

+ currentFormVar() with radio field. +

+
+ Click one of the radio buttons. +
+
radio-1 + + radio-2 + +
+

+ currentFormVar(name) with radio field. +

+
+ Click the button. +
+
+ Click me ! + radio-1 + + radio-2 + +
+ +

+ currentFormVar(name) with select field. +

+
+ Click the button. +
+
+ Click me ! + +
+ +

+ currentFormVar(name) with multiple select field. +

+
+ Click the button. +
+
+ Click me ! + +
+ + +

+ form(full1) with simple field names, named form +

+
+ Click the button. +
+ Click me ! +
+
+

+ currentForm() with simple field names +

+
+ Click the button. +
+ Click me ! + + +
+
+

+ xxx-kssSubmitForm: form(full2) with complex field names, named form +

+
+ Click the button. +
+ Click me ! +

+ xxx-kssSubmitForm: 'field2' with complex field names, named form, given as string +

+
+ Click the button. +
+ Click me ! +
+

+ xxx-kssSubmitForm: currentForm() with complex field names +

+
+ Click the button. +
+ Click me ! +
+ value1: + + value2: + +
+ listval: + + +
+ recordval: + + +
+ recordsval: + + + + +
+
+ + + + Deleted: /kukit/kss.demo/trunk/kss/demo/demoview.py ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/demoview.py Thu Sep 13 00:31:22 2007 +++ (empty file) @@ -1,200 +0,0 @@ -# Copyright (c) 2005-2007 -# Authors: KSS Project Contributors (see docs/CREDITS.txt) -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -from kss.core import KSSView, force_unicode, KSSExplicitError, kssaction -import datetime - -class KSSDemoView(KSSView): - - def clearDivContent(self): - """ clear div content """ - self.getCommandSet('core').clearChildNodes('div#demo') - return self.render() - - def copyFromDivContent(self): - """ copy div content """ - self.getCommandSet('core').copyChildNodesFrom('div#copy', 'demo') - return self.render() - - def copyToDivContent(self): - """ copy div content """ - self.getCommandSet('core').copyChildNodesTo('div#copy', 'demo') - return self.render() - - def moveToDivContent(self): - """ copy div content """ - self.getCommandSet('core').copyChildNodesTo('div#copy', 'demo') - self.getCommandSet('core').clearChildNodes('div#copy') - return self.render() - - def getDivContent(self): - """ returns div content """ - self.getCommandSet('core').replaceInnerHTML('div#demo', '

it worked

') - self.getCommandSet('core').replaceInnerHTML('div#demo', '

it worked again

') - return self.render() - - def getCorrespondingSelect(self, value): - """ returns select content """ - mapping = {} - mapping['']=[] - mapping['animals']=['dog', 'cat', 'cow'] - mapping['machines']=['computer', 'car', 'airplane'] - # XXX Note that originally we just used replaceInnerHTML to just put - # the options inside the select, however this is principally broken - # on IE due to an IE bug. Microsoft has confirmed the bug but is not - # giving information on whether it has or it will ever be fixed. - # For further info, see http://support.microsoft.com/default.aspx?scid=kb;en-us;276228 - # The current solution, replace the outer node, works solidly. - result = ['') - self.getCommandSet('core').replaceHTML('select#second', ' '.join(result)) - return self.render() - - def getAutoupdateMarkup(self): - """ returns the current time """ - self.getCommandSet('core').replaceInnerHTML('div#update-wrapper', '
') - return self.render() - - def getCurrentTime(self): - """ returns the current time """ - self.getCommandSet('core').replaceInnerHTML('div#update-area', "

%s

" % str(datetime.datetime.now())) - return self.render() - - def getInputField(self, value): - 'Inserts the value as entered into an input field' - # We need to make unicode. But on Z2 we receive utf-8, on Z3 unicode - value = force_unicode(value, 'utf') - self.getCommandSet('core').replaceInnerHTML('div#text', - '
' \ - '' - ) - return self.render() - - def saveText(self, value): - 'Inserts the value to display it on the page' - # We need to make unicode. But on Z2 we receive utf-8, on Z3 unicode - value = force_unicode(value, 'utf') - self.getCommandSet('core').replaceInnerHTML('div#text', value+'') - return self.render() - - def expandSubTree(self, value, xvalue): - 'Expands given subtree' - self.getCommandSet('core').replaceInnerHTML('#text', 'works, expand %s (xhtml attr: %s)' % (value, xvalue)) - return self.render() - - def collapseSubTree(self, value, xvalue): - 'Collapses given subtree' - self.getCommandSet('core').replaceInnerHTML('#text', 'works, collapse %s (xhtml attr: %s)' % (value, xvalue)) - return self.render() - - def cancelSubmitSave(self, text_save): - # We need to make unicode. But on Z2 we receive utf-8, on Z3 unicode - text_save = force_unicode(text_save, 'utf') - self.getCommandSet('core').replaceInnerHTML('div#async', 'Async saved %s' % text_save) - return self.render() - - def removeNodeXpath(self): - # XXX the xpath selector is now moved out of the core, see suppl, product "azaxslt" - sel = self.getSelector('xpath', "//P[@id='xpath']/following-sibling::*[position()=1]") - self.getCommandSet('core').deleteNode(sel) - return self.render() - - def clickedButton(self, id): - 'Show status of the button clicked' - self.getCommandSet('core').replaceInnerHTML('#update-status', "

Button %s clicked. %s

" % (id, datetime.datetime.now())) - return self.render() - - def updateSlaveSelector(self, masterid, value): - """ returns select content """ - mapping = {} - mapping['']=[] - mapping['animals']=['dog', 'cat', 'cow'] - mapping['machines']=['computer', 'car', 'airplane'] - # calculate the slave id - master, _dummy = masterid.split('-') - slaveid = '%s-slave' % master - # make the payload - result = ['') - # XXX See above remark why we need to replace the outer select. - self.getCommandSet('core').replaceHTML('select#%s' % slaveid, ' '.join(result)) - return self.render() - - def formSubmitSave(self, data): - result = ['

Async saved:

'] - for key, value in data.items(): - result.append('' % (key, value)) - result.append('
Name:Value:
%s%s
') - # We need to make unicode. But on Z2 we receive utf-8, on Z3 unicode - retval = force_unicode(''.join(result), 'utf') - self.getCommandSet('core').replaceInnerHTML('div#async', retval) - return self.render() - - def reset(self): - self.getCommandSet('effects').effect('.effects', 'appear') - return self.render() - - @kssaction - def errTest(self, id, act): - if act == 'error': - raise Exception, 'We have an error here.' - elif act == 'explicit': - raise KssExplicitError, 'Explicit error raised.' - elif act == 'empty': - # Just do nothing, we want to return a response with no commands. - # This is valid behaviour, should raise no error, however - # gives a warning in the kukit log. - pass - ## XXX This is commented out by default, but you can try this on your own - ## server, together with the timeout buttons in the page template timeout buttons in the page template. - ## - #elif act == 'timeout': - # # Wait longer then timeout, this is currently 4 s - # time.sleep(6.0); - # # the next reply will never arrive. - # self.replaceInnerHTML('#update-status', u'Timeout response, button %s clicked. %s' % (id, datetime.datetime.now())) - else: - # act = noerror: standard response. - self.getCommandSet('core').replaceInnerHTML('#update-status', u'Normal response, button %s clicked. %s' % (id, datetime.datetime.now())) - return self.render() - - def htmlReplace(self): - """html replace""" - self.getCommandSet('core').replaceHTML('div#frame', '

KSS for a life.

') - return self.render() - - def htmlInsertBefore(self): - """html insert""" - self.getCommandSet('core').insertHTMLBefore('#core', '
KSS for a life. %s
' % (str(datetime.datetime.now()), )) - return self.render() - - def htmlInsertAfter(self): - """html insert""" - self.getCommandSet('core').insertHTMLAfter('#core', '
KSS for a life. %s
' % (str(datetime.datetime.now()), )) - return self.render() - - def htmlInsertAsFirstChild(self): - """html insert""" - self.getCommandSet('core').insertHTMLAsFirstChild('div#frame', '
KSS for a life. %s
' % (str(datetime.datetime.now()), )) - return self.render() - - def htmlInsertAsLastChild(self): - """html insert""" - self.getCommandSet('core').insertHTMLAsLastChild('div#frame', '
KSS for a life. %s
' % (str(datetime.datetime.now()), )) - return self.render() Added: kukit/kss.demo/trunk/kss/demo/events.py ============================================================================== --- (empty file) +++ kukit/kss.demo/trunk/kss/demo/events.py Thu Sep 13 00:31:22 2007 @@ -0,0 +1,31 @@ + +import zope.component +from zope.component.interfaces import ( + IUtilityRegistration, + IRegistrationEvent, +# ObjectEvent, + ) +from interfaces import ( + IKSSDemoCollection, + IKSSDemoRegistrationEvent, + ) +from zope.interface import implements + +class KSSDemoRegistrationEvent(object): + """Redispatch of registration for demo utilities""" + implements(IKSSDemoRegistrationEvent) + + at zope.component.adapter(IUtilityRegistration, IRegistrationEvent) +def dispatchRegistration(registration, event): + """When a demo utility is registered, add it to the registry. + When a demo utility is registered, + event handler registered for the particular component registered, + the registration and the event. + """ + component = registration.component + # Only dispatch registration of the interesting utilities. + new_event = KSSDemoRegistrationEvent() + if IKSSDemoCollection.providedBy(component): + handlers = zope.component.subscribers((component, registration, event, new_event), None) + for handler in handlers: + pass # getting them does the work Modified: kukit/kss.demo/trunk/kss/demo/interfaces.py ============================================================================== --- kukit/kss.demo/trunk/kss/demo/interfaces.py (original) +++ kukit/kss.demo/trunk/kss/demo/interfaces.py Thu Sep 13 00:31:22 2007 @@ -1,4 +1,60 @@ from zope.interface import Interface +from zope.schema import ( + TextLine, + List, + ) class ISimpleContent(Interface): pass + +class IKSSDemo(Interface): + """Represents an actual demo page""" + + plugin_namespace = TextLine( + title=u"plugin_namespace", + description=u'string with the name of the plugin.' + u'Or: "" when it is the core part.', + required=False, + ) + + category = TextLine( + title=u"component", + description=u'text that will appear as the title of the' + u'category. "" if out of category.', + required=False, + ) + + page_url = TextLine( + title=u"page_url", + description=u'(relative) url of the demo page. This should' + u'traverse on ISimpleContent.', + required=True, + ) + + title = TextLine( + title=u"title", + description=u'Title of the demo. This also identifies it' + u'for removal.', + required=True, + ) + +class IKSSDemoCollection(Interface): + """An utility that a demo needs to register""" + + demos = List( + title=u"demos", + description=u'The ordered list of demos contained in this collection', + required=True, + ) + +class IKSSDemoRegistry(Interface): + """Faciliates registration of demos. + + Implementations must look after the IDemoCollection + adapters, and use their content to set up themselves. + """ + +class IKSSDemoRegistrationEvent(Interface): + """Redispatched evend for registration of + IKSSDemoRegistry utilities. + """ Added: kukit/kss.demo/trunk/kss/demo/registry.py ============================================================================== --- (empty file) +++ kukit/kss.demo/trunk/kss/demo/registry.py Thu Sep 13 00:31:22 2007 @@ -0,0 +1,106 @@ +from zope.interface import implements +from interfaces import IKSSDemoRegistry +from zope.component import ( + adapter, + getSiteManager, + ) +from interfaces import ( + IKSSDemo, + IKSSDemoCollection, + IKSSDemoRegistrationEvent, + ) +from zope.component.interfaces import ( + IUtilityRegistration, + IRegistered, + IUnregistered, + ) + +class KSSDemo(object): + """Represents a demo. + Demos are organized in collections (provided by a plugin), + ans collections are registered to the registry. + """ + implements(IKSSDemo) + def __init__(self, plugin_namespace, category, page_url, title): + self.plugin_namespace = plugin_namespace + self.category = category + self.page_url = page_url + self.title = title + + # convenience access for page templates + __allow_access_to_unprotected_subobjects__ = 1 + def __getitem__(self, key): + return getattr(self, key) + +class KSSDemoRegistry(object): + """KSS demo registry. + """ + implements(IKSSDemoRegistry) + + def __init__(self): + self.demos_dict = {} + self.demos = [] + self.demos_are_sorted = [] + # Set up my handlers to get notified of new collections + # (works via redispatching by events.py) + site = getSiteManager() + site.registerHandler(self.registerDemoCollection) + site.registerHandler(self.unregisterDemoCollection) + + @adapter(IKSSDemoCollection, IUtilityRegistration, IRegistered, IKSSDemoRegistrationEvent) + def registerDemoCollection(self, demo_collection, registration=None, event=None, new_event=None): + """Add a demo collection to the registry. + """ + for demo in demo_collection.demos: + self.registerDemo(demo) + + @adapter(IKSSDemoCollection, IUtilityRegistration, IUnregistered, IKSSDemoRegistrationEvent) + def unregisterDemoCollection(self, demo_collection, registration=None, event=None, new_event=None): + """Remove a demo collection from the registry. + """ + for demo in demo_collection.demos: + self.unregisterDemo(demo) + + def registerDemo(self, demo): + """Register a demo + + It has the attributes specified in IKSSDemo: + + plugin_namespace - string with the name of the plugin. + Or: "" when it is the core part. + + category - text that will appear as the title of the + category. "" if out of category. + + demo_page - (relative) url of the demo page. This should + traverse on ISimpleContent. + + title - Title of the demo. This also identifies it + for removal. + """ + key = demo.plugin_namespace, demo.category, demo.page_url + if key in self.demos: + raise Exception, 'The demo for %s has already been registered. Cannot add.' % (key, ) + self.demos_dict[key] = demo + self.demos.append(demo) + self.demos_are_sorted = False + + def unregisterDemo(self, demo): + """Unregister the given demo.""" + key = demo.plugin_namespace, demo.category, demo.demo_page + try: + value = self.demos_dict[key] + except KeyError: + raise Exception, 'The demo for %s is yet unregistered. Cannot remove.' % (key, ) + del self.demos_dict[key] + self.demos.remove(value) + + def getSortedDemos(self): + """Get the (sorted) list of demos""" + if not self.demos_are_sorted: + self.demos.sort(key=lambda demo: ( + demo.plugin_namespace, + demo.category, + )) + self.demos_are_sorted = True + return list(self.demos) From reebalazs at codespeak.net Thu Sep 13 18:21:44 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 13 Sep 2007 18:21:44 +0200 (CEST) Subject: [KSS-checkins] r46541 - in kukit/kukit.js/branch/ree-binding-improvements: 3rd_party kukit tests Message-ID: <20070913162144.856FE8102@code0.codespeak.net> Author: reebalazs Date: Thu Sep 13 18:21:43 2007 New Revision: 46541 Added: kukit/kukit.js/branch/ree-binding-improvements/3rd_party/cssQuery-compat.js - copied unchanged from r46151, kukit/kukit.js/trunk/3rd_party/cssQuery-compat.js kukit/kukit.js/branch/ree-binding-improvements/tests/browserstub.js - copied unchanged from r46081, kukit/kukit.js/trunk/tests/browserstub.js Modified: kukit/kukit.js/branch/ree-binding-improvements/kukit/commandprocessor.js kukit/kukit.js/branch/ree-binding-improvements/kukit/dom.js kukit/kukit.js/branch/ree-binding-improvements/kukit/plugin.js kukit/kukit.js/branch/ree-binding-improvements/tests/runner.html kukit/kukit.js/branch/ree-binding-improvements/tests/runtests.sh Log: Backport base2 fix from trunk. Merges: -r44025:44031,44080:44081,46150:46151 Modified: kukit/kukit.js/branch/ree-binding-improvements/kukit/commandprocessor.js ============================================================================== --- kukit/kukit.js/branch/ree-binding-improvements/kukit/commandprocessor.js (original) +++ kukit/kukit.js/branch/ree-binding-improvements/kukit/commandprocessor.js Thu Sep 13 18:21:43 2007 @@ -79,14 +79,21 @@ var childCount = childNode.childNodes.length; var result; if (childCount == 0) { - // We take this a string (although this could be dom) result = ''; - } else if (childCount == 1 && childNode.firstChild.nodeType == 3) { + } else { + // (we do not interpret html inline content any more) // we have a single text node + // OR + // we have a single CDATA node (HTML parameter CDATA-style) + ;;; var isTextNode = childNode.firstChild.nodeType == 3; + ;;; var isCData = childNode.firstChild.nodeType == 4; + ;;; if (! (childCount == 1 && (isTextNode || isCData))) { + ;;; kukit.E = 'Bad payload, expected a text or a CDATA node'; + ;;; throw kukit.E; + ;;; } + // we consider this as html payload + // The result is always a string from here. result = childNode.firstChild.nodeValue; - } else { - // dom - result = childNode; } params[data] = result; } else { Modified: kukit/kukit.js/branch/ree-binding-improvements/kukit/dom.js ============================================================================== --- kukit/kukit.js/branch/ree-binding-improvements/kukit/dom.js (original) +++ kukit/kukit.js/branch/ree-binding-improvements/kukit/dom.js Thu Sep 13 18:21:43 2007 @@ -37,35 +37,16 @@ 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 && (!kukit.HAVE_IE)) { - for(var i=0;i < nodes.length;i++) { - result[i] = parentNode.insertBefore(ownerDoc.importNode(nodes[i], true), nodeTo); - } - } else { - for(var i=0;i < nodes.length;i++) { - result[i] = parentNode.insertBefore(nodes[i].cloneNode(true), nodeTo); - } +kukit.dom.insertBefore = function(nodes, parentNode, toNode) { + for(var i=0; i'; - var doc = (new DOMParser()).parseFromString(root_txt, "text/xml"); - var root = doc.getElementsByTagName('div')[0]; - - // XXX Sarissa bug; html docs would not have a - // working serialize, and so importNodes would fail on them. - // XXX Fixed in: Revision 1.23 - Sun Jul 10 18:53:53 2005 UTC - // use at least 0.9.6.1 - - param = root; - } - // Need to do this or else IE fails miserably. - // importNode acts strangely. - // on FF, you can execute it several times but the next condition - // always evaluated to False. - // on IE, it is a big problem to execute this for the second time - // but it needs to be executed once, thus the condition - if (param.ownerDocument != document) { - param = document.importNode(param, true); +kukit.dom.parseHTMLNodes = function(txt){ + var node = document.createElement('div'); + node.innerHTML = txt; + var resultNodes = []; + for (var i=0; i 0) { var parentNode = node.parentNode; var insertedNodes = []; @@ -611,20 +608,19 @@ ;;; oper.componentname = 'insertHTMLAfter action'; oper.completeParms(['html'], {'withKssSetup':true}); oper.evalBool('withKssSetup'); - oper.parms.html = kukit.dom.forceToDom(oper.parms.html); - var content = oper.parms.html; + var content = kukit.dom.parseHTMLNodes(oper.parms.html); var parentNode = oper.node.parentNode; var toNode = kukit.dom.getNextSiblingTag(oper.node); - var insertedNodes; if (toNode == null) { - insertedNodes = kukit.dom.appendChildren(content.childNodes, parentNode); + kukit.dom.appendChildren(content, parentNode); } else { - insertedNodes = kukit.dom.insertBefore(content, parentNode, toNode); + kukit.dom.insertBefore(content, parentNode, toNode); } +;;; kukit.logDebug(content.length + ' nodes inserted.'); // update the events for the new nodes ;;; kukit.logDebug("Inserted nodes length: "+insertedNodes.length); if (oper.parms.withKssSetup) { - kukit.engine.setupEvents(insertedNodes); + kukit.engine.setupEvents(content); } }); kukit.commandsGlobalRegistry.registerFromAction('insertHTMLAfter', kukit.cr.makeSelectorCommand); @@ -633,15 +629,15 @@ ;;; oper.componentname = 'insertHTMLBefore action'; oper.completeParms(['html'], {'withKssSetup':true}); oper.evalBool('withKssSetup'); - oper.parms.html = kukit.dom.forceToDom(oper.parms.html); - var content = oper.parms.html; + var content = kukit.dom.parseHTMLNodes(oper.parms.html); var toNode = oper.node; var parentNode = toNode.parentNode; - var insertedNodes = kukit.dom.insertBefore(content, parentNode, toNode); + kukit.dom.insertBefore(content, parentNode, toNode); +;;; kukit.logDebug(content.length + ' nodes inserted.'); // update the events for the new nodes ;;; kukit.logDebug("Inserted nodes length: "+insertedNodes.length); if (oper.parms.withKssSetup) { - kukit.engine.setupEvents(insertedNodes); + kukit.engine.setupEvents(content); } }); kukit.commandsGlobalRegistry.registerFromAction('insertHTMLBefore', kukit.cr.makeSelectorCommand); @@ -650,13 +646,13 @@ ;;; oper.componentname = 'insertHTMLAsLastChild action'; oper.completeParms(['html'], {'withKssSetup':true}); oper.evalBool('withKssSetup'); - oper.parms.html = kukit.dom.forceToDom(oper.parms.html); - var insertedNodes = kukit.dom.appendChildren(oper.parms.html, oper.node); - insertedNodes = kukit.dom.appendChildren(oper.parms.html.childNodes, oper.node); + var content = kukit.dom.parseHTMLNodes(oper.parms.html); + kukit.dom.appendChildren(content, oper.node); +;;; kukit.logDebug(content.length + ' nodes inserted.'); // update the events for the new nodes ;;; kukit.logDebug("Inserted nodes length: "+insertedNodes.length); if (oper.parms.withKssSetup) { - kukit.engine.setupEvents(insertedNodes); + kukit.engine.setupEvents(content); } }); kukit.commandsGlobalRegistry.registerFromAction('insertHTMLAsLastChild', kukit.cr.makeSelectorCommand); @@ -665,20 +661,19 @@ ;;; oper.componentname = 'insertHTMLAsFirstChild action'; oper.completeParms(['html'], {'withKssSetup':true}); oper.evalBool('withKssSetup'); - oper.parms.html = kukit.dom.forceToDom(oper.parms.html); - var content = oper.parms.html; + var content = kukit.dom.parseHTMLNodes(oper.parms.html); var parentNode = oper.node; var toNode = parentNode.firstChild; - var insertedNodes; if (toNode == null) { - insertedNodes = kukit.dom.appendChildren(content.childNodes, parentNode); + kukit.dom.appendChildren(content, parentNode); } else { - insertedNodes = kukit.dom.insertBefore(content, parentNode, toNode); + kukit.dom.insertBefore(content, parentNode, toNode); } +;;; kukit.logDebug(content.length + ' nodes inserted.'); // update the events for the new nodes ;;; kukit.logDebug("Inserted nodes length: "+insertedNodes.length); if (oper.parms.withKssSetup) { - kukit.engine.setupEvents(insertedNodes); + kukit.engine.setupEvents(content); } }); kukit.commandsGlobalRegistry.registerFromAction('insertHTMLAsFirstChild', kukit.cr.makeSelectorCommand); Modified: kukit/kukit.js/branch/ree-binding-improvements/tests/runner.html ============================================================================== --- kukit/kukit.js/branch/ree-binding-improvements/tests/runner.html (original) +++ kukit/kukit.js/branch/ree-binding-improvements/tests/runner.html Thu Sep 13 18:21:43 2007 @@ -1,107 +1,143 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- KSS ECMAScript Unit Tests -

- -

- This page is the entry to the ECMAScript Unit Tests. -

- -

- Tests are running from the filesystem. -

- - -
- Suite filter: - Test filter: -
-
-
-
-
-
-
- - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ KSS ECMAScript Unit Tests +

+ +

+ Kss is in + development + production + + mode.
+ Control development mode +

+ +

+ This page is the entry to the ECMAScript Unit Tests. +

+ +

+ Tests are running from the filesystem.
+ KSS is running in development (uncooked) mode. +

+ + +
+ Suite filter: + Test filter: +
+
+
+
+
+
+
+ + + Modified: kukit/kukit.js/branch/ree-binding-improvements/tests/runtests.sh ============================================================================== --- kukit/kukit.js/branch/ree-binding-improvements/tests/runtests.sh (original) +++ kukit/kukit.js/branch/ree-binding-improvements/tests/runtests.sh Thu Sep 13 18:21:43 2007 @@ -1,26 +1,28 @@ js \ - -f ecmaunit.js \ - -f unittestUtilities.js \ - -f ../kukit/utils.js \ - -f ../kukit/errors.js \ - -f ../kukit/oper.js \ - -f ../kukit/kukit.js \ - -f ../kukit/tokenizer.js \ - -f ../kukit/providerreg.js \ - -f ../kukit/resourcedata.js \ - -f ../kukit/kssparser.js \ - -f ../kukit/eventreg.js \ - -f ../kukit/actionreg.js \ - -f ../kukit/dom.js \ - -f ../kukit/commandreg.js \ - -f ../kukit/serveraction.js \ - -f ../kukit/requestmanager.js \ - -f ../kukit/commandprocessor.js \ - -f ../kukit/selectorreg.js \ - -f ../kukit/forms.js \ - -f ../kukit/plugin.js \ - -f test_utils.js \ - -f test_requestmanager.js \ - -f test_tokenizer.js \ - -f test_kssparser.js \ - runtests.js + -f ecmaunit.js \ + -f unittestUtilities.js \ + -f browserstub.js \ + -f ../3rd_party/base2-dom-fp.js \ + -f ../kukit/utils.js \ + -f ../kukit/errors.js \ + -f ../kukit/oper.js \ + -f ../kukit/kukit.js \ + -f ../kukit/tokenizer.js \ + -f ../kukit/providerreg.js \ + -f ../kukit/resourcedata.js \ + -f ../kukit/kssparser.js \ + -f ../kukit/eventreg.js \ + -f ../kukit/actionreg.js \ + -f ../kukit/dom.js \ + -f ../kukit/commandreg.js \ + -f ../kukit/serveraction.js \ + -f ../kukit/requestmanager.js \ + -f ../kukit/commandprocessor.js \ + -f ../kukit/selectorreg.js \ + -f ../kukit/forms.js \ + -f ../kukit/plugin.js \ + -f test_utils.js \ + -f test_requestmanager.js \ + -f test_tokenizer.js \ + -f test_kssparser.js \ + runtests.js From reebalazs at codespeak.net Thu Sep 13 18:22:55 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 13 Sep 2007 18:22:55 +0200 (CEST) Subject: [KSS-checkins] r46542 - in kukit/azax/branch/1.1-ree-binding-improvements: . plugins/core Message-ID: <20070913162255.C8B2D80F1@code0.codespeak.net> Author: reebalazs Date: Thu Sep 13 18:22:55 2007 New Revision: 46542 Modified: kukit/azax/branch/1.1-ree-binding-improvements/commands.py kukit/azax/branch/1.1-ree-binding-improvements/configure.zcml kukit/azax/branch/1.1-ree-binding-improvements/plugins/core/commands.py Log: Backport base2 fix from trunk. Merges: -r46602:46603,46026:46152 Modified: kukit/azax/branch/1.1-ree-binding-improvements/commands.py ============================================================================== --- kukit/azax/branch/1.1-ree-binding-improvements/commands.py (original) +++ kukit/azax/branch/1.1-ree-binding-improvements/commands.py Thu Sep 13 18:22:55 2007 @@ -127,7 +127,9 @@ def addHtmlParam(self, name, content=''): 'Add the param as an HTML content.' content = HtmlParser(content)().encode('ascii', 'xmlcharrefreplace') - self.addParam(name, content=content) + ##self.addParam(name, content=content) + # add html as cdata! + self.addCdataParam(name, content=content) def addXmlParam(self, name, content=''): 'Add the param as XML content' Modified: kukit/azax/branch/1.1-ree-binding-improvements/configure.zcml ============================================================================== --- kukit/azax/branch/1.1-ree-binding-improvements/configure.zcml (original) +++ kukit/azax/branch/1.1-ree-binding-improvements/configure.zcml Thu Sep 13 18:22:55 2007 @@ -35,6 +35,11 @@ /> + + Modified: kukit/azax/branch/1.1-ree-binding-improvements/plugins/core/commands.py ============================================================================== --- kukit/azax/branch/1.1-ree-binding-improvements/plugins/core/commands.py (original) +++ kukit/azax/branch/1.1-ree-binding-improvements/plugins/core/commands.py Thu Sep 13 18:22:55 2007 @@ -35,15 +35,13 @@ def replaceInnerHTML(self, selector, new_value): """ see interfaces.py """ - new_value = HtmlParser(new_value)().encode('ascii', 'xmlcharrefreplace') command = self.commands.addCommand('replaceInnerHTML', selector) - data = command.addParam('html', new_value) + data = command.addHtmlParam('html', new_value) def replaceHTML(self, selector, new_value): """ see interfaces.py """ - new_value = HtmlParser(new_value)().encode('ascii', 'xmlcharrefreplace') command = self.commands.addCommand('replaceHTML', selector) - data = command.addParam('html', new_value) + data = command.addHtmlParam('html', new_value) def setAttribute(self, selector, name, value): """ see interfaces.py """ @@ -59,27 +57,23 @@ def insertHTMLAfter(self, selector, new_value): """ see interfaces.py """ - new_value = HtmlParser(new_value)().encode('ascii', 'xmlcharrefreplace') command = self.commands.addCommand('insertHTMLAfter', selector) - data = command.addParam('html', new_value) + data = command.addHtmlParam('html', new_value) def insertHTMLAsFirstChild(self, selector, new_value): """ see interfaces.py """ - new_value = HtmlParser(new_value)().encode('ascii', 'xmlcharrefreplace') command = self.commands.addCommand('insertHTMLAsFirstChild', selector) - data = command.addParam('html', new_value) + data = command.addHtmlParam('html', new_value) def insertHTMLAsLastChild(self, selector, new_value): """ see interfaces.py """ - new_value = HtmlParser(new_value)().encode('ascii', 'xmlcharrefreplace') command = self.commands.addCommand('insertHTMLAsLastChild', selector) - data = command.addParam('html', new_value) + data = command.addHtmlParam('html', new_value) def insertHTMLBefore(self, selector, new_value): """ see interfaces.py """ - new_value = HtmlParser(new_value)().encode('ascii', 'xmlcharrefreplace') command = self.commands.addCommand('insertHTMLBefore', selector) - data = command.addParam('html', new_value) + data = command.addHtmlParam('html', new_value) def clearChildNodes(self, selector): """ see interfaces.py """ From reebalazs at codespeak.net Thu Sep 13 18:27:26 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 13 Sep 2007 18:27:26 +0200 (CEST) Subject: [KSS-checkins] r46543 - in kukit/kukit.js/branch/ree-binding-improvements/3rd_party: . firebuglite Message-ID: <20070913162726.7959380BE@code0.codespeak.net> Author: reebalazs Date: Thu Sep 13 18:27:26 2007 New Revision: 46543 Added: kukit/kukit.js/branch/ree-binding-improvements/3rd_party/LICENSE.txt - copied unchanged from r45702, kukit/kukit.js/trunk/3rd_party/LICENSE.txt kukit/kukit.js/branch/ree-binding-improvements/3rd_party/firebuglite/ - copied from r45702, kukit/kukit.js/trunk/3rd_party/firebuglite/ kukit/kukit.js/branch/ree-binding-improvements/3rd_party/firebuglite/errorIcon.png - copied unchanged from r45702, kukit/kukit.js/trunk/3rd_party/firebuglite/errorIcon.png kukit/kukit.js/branch/ree-binding-improvements/3rd_party/firebuglite/firebug.css - copied unchanged from r45702, kukit/kukit.js/trunk/3rd_party/firebuglite/firebug.css kukit/kukit.js/branch/ree-binding-improvements/3rd_party/firebuglite/firebug.html - copied unchanged from r45702, kukit/kukit.js/trunk/3rd_party/firebuglite/firebug.html kukit/kukit.js/branch/ree-binding-improvements/3rd_party/firebuglite/firebug.js - copied unchanged from r45702, kukit/kukit.js/trunk/3rd_party/firebuglite/firebug.js kukit/kukit.js/branch/ree-binding-improvements/3rd_party/firebuglite/firebugx.js - copied unchanged from r45702, kukit/kukit.js/trunk/3rd_party/firebuglite/firebugx.js kukit/kukit.js/branch/ree-binding-improvements/3rd_party/firebuglite/infoIcon.png - copied unchanged from r45702, kukit/kukit.js/trunk/3rd_party/firebuglite/infoIcon.png kukit/kukit.js/branch/ree-binding-improvements/3rd_party/firebuglite/warningIcon.png - copied unchanged from r45702, kukit/kukit.js/trunk/3rd_party/firebuglite/warningIcon.png Modified: kukit/kukit.js/branch/ree-binding-improvements/3rd_party/base2-dom-fp.js Log: Backport add Firebug Lite from trunk. Merges: -r45701:45702 Modified: kukit/kukit.js/branch/ree-binding-improvements/3rd_party/base2-dom-fp.js ============================================================================== --- kukit/kukit.js/branch/ree-binding-improvements/3rd_party/base2-dom-fp.js (original) +++ kukit/kukit.js/branch/ree-binding-improvements/3rd_party/base2-dom-fp.js Thu Sep 13 18:27:26 2007 @@ -1 +1 @@ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('q Y={};B l(){q G=l(){};G.I={v:l(c){u(y.A>1){q d=m[c];q e=y[1];u(E e=="l"&&d&&/\\6B\\b/.10(e)){q f=e;e=l(){q a=m.x;m.x=d;q b=f.N(m,y);m.x=a;t b};e.4c=f;e.2q=d}m[c]=e}H u(c){q g=G.I.v;u(G.2H){q h,i=0,57=["T","1s","50"];1c(h=57[i++])u(c[h]!=1N.I[h]){g.X(m,h,c[h])}}H u(E m!="l"){g=m.v||g}13(h 2u c)u(!1N.I[h]){g.X(m,h,c[h])}}t m},x:G};G.v=l(b,c){q d=G.I.v;G.2H=14;q e=B m;d.X(e,b);26 G.2H;q T=e.T;q f=e.T=l(){u(!G.2H){u(m.3B||m.T==f){m.3B=14;T.N(m,y);26 m.3B}H{q a=y[0];u(a!=F){(a.v||d).X(a,e)}t a}}};13(q i 2u G)f[i]=m[i];f.2q=m;f.x=G.x;f.I=e;f.1s=m.1s;d.X(f,c);u(E f.P=="l")f.P();t f};G=G.v({T:l(){m.v(y[0])}},{2q:1N,x:G,18:l(a){u(E a=="l"){a(m.I)}H{m.I.v(a)}t m}});q $31=36.$31||{};q K=l(a){t a};q 1P=l(a,b,c){u(!a){1K B(c||36.3q)(b||"5q 5m.");}};q 3m=l(a,b,c){u(b){q d=E b=="l"?1g(a,b):E a==b;1P(d,c||"48 2G.",47)}};q D=l(c){q d=y;t W(c).M(/%([1-9])/g,l(a,b){t b=0;i--){u(a[i]===b)t i}t-1},2B:l(a,b){q c=m.1S(a,b);u(c!=-1)m.3S(a,c);t b},3S:l(a,b){q c=a[b];m.2y(a,b,1);t c}});1i.I.C=l(a,b){C.1r(m,a,b)};1i.18(1n);C("3l,32,6D,23,3Q,6y,S,38,2y,6t".1x(","),l(b){1i[b]=l(a){t 1r.I[b].N(a,S(y,1))}});q 1C=l(){t 1i(m.T==1i?1r.N(F,y):y[0])};1C.I=1i.I;C(1i,l(a,b,c){u(1r[b]){1i[b]=1r[b];26 1i.I[b]}1C[b]=1i[b]});q 1I="#"+51(B 4S);q Z=1I+"3L";q 1R=1I+"4V";q 35=G.v({T:l(a){m[Z]=B 1C;m[1R]={};m.3N(a)},3e:l(){t B m.T(m)},2b:$31.2b||B 1v("k",D("t(\'%1\'+k)2u m[\'%2\']",1I,1R)),1Q:l(a){t m[1R][1I+a]},C:l(b,c){C(m[Z],l(a){b.X(c,m.1Q(a),a,m)},m)},3L:l(a,b){28(y.A){V 0:t m[Z].3e();V 1:t m[Z][a];2Z:t m[Z].S(a,b)}},3N:l(d){C(y,l(c){C(c,l(a,b){m.2d(b,a)},m)},m);t m},2B:l(a){q b=m.1Q(a);m[Z].2B(W(a));26 m[1R][1I+a];t b},2d:l(a,b){u(y.A==1)b=a;u(!m.2b(a)){m[Z].23(W(a))}m[1R][1I+a]=b;t b},1s:l(){t W(m[Z])},6h:l(a){t m.3N.N(m.3e(),y)},4V:l(a,b){q c=m.2L(K);28(y.A){V 0:t c;V 1:t c[a];2Z:t c.S(a,b)}}});35.18(1n);q 3G=35.v({2X:l(a,b){1P(!m.2b(a),"4O 4N.");t m.2d.N(m,y)},4K:l(){t m[Z].A},1S:l(a){t m[Z].1S(W(a))},3X:l(a,b,c){1P(!m.2b(b),"4O 4N.");m[Z].3X(a,W(b));t m.2d.N(m,S(y,1))},1U:l(a){t m.1Q(m[Z][a])},3S:l(a){t m.2B(m[Z][a])},3Q:l(){m[Z].3Q();t m},38:l(c){u(c){q d=m;m[Z].38(l(a,b){t c(d.1Q(a),d.1Q(b),a,b)})}H m[Z].38();t m},2d:l(a,b){u(y.A==1)b=a;b=m.T.2M.N(m.T,y);t m.x(a,b)},68:l(a,b){1P(a1)c[i-1]="y["+i+"]";1A("q 2i=5i[4c]("+c+")");t 2i}}}});q 2h=2f.v(F,{v:l(a,b){q c=m.L;u(b){c=b.L||c;26 b.L}q d=m.x(a,b);v(d,"L",c);t d}});2h.L=l(a){t m(a)};q R=1l.v({2F:l(a){t m.1T(a).2E},2D:l(a){1c(a&&(a=a.46)&&!m.20(a))3g;t a},45:l(a){q b=0;1c(a&&(a=a.44))b++;t b},2g:l(a){t a.3f},43:l(a){1c(a&&(a=a.44)&&!m.20(a))3g;t a},42:l(a){t a.6N},5e:l(a){a=a.6M;1c(a){u(a.1W==3||m.20(a))t J;a=a.46}t 14},"@U":{42:l(a){t a.6L},2F:l(a){t m.1T(a).6K},"@1H":{2g:l(a){t a.3f||a.11}}}},{1p:l(a,b){t m.40(a)?a==m.2g(b):a!=b&&a.1p(b)},1T:l(a){t m.40(a)?a:m.2g(a)},40:l(a){t 34(a&&a.3Z)},20:l(a){t 34(a&&a.5c)},"@!(1b.1p)":{1p:l(a,b){1c(b&&(b=b.3d)&&a!=b)3g;t!!b}},"@1H":{20:l(a){t m.x(a)&&a.3c!="!"}}});q 2l=2h.v({"@!(1b.59)":{59:l(a,b){u(R.1p(a,b)){t 4|16}H u(R.1p(b,a)){t 2|8}q c=m.$3b(a);q d=m.$3b(b);u(cd){t 2}t 0}}},{$3b:l(a){q b=0;1c(a){b=R.45(a)+"."+b;a=a.3d}t b},"@(1b.1M)":{$3b:l(a){t a.1M}}});q 1u=2l.v(F,{L:l(a){m.x(a);2K.L(a.2E);t a}});1u.2j("4i");q 1D=2l.v({"@U[67]":{3a:l(a,b){u(a.1q===1J||b=="56"||b=="3T"){t m.x(a,b,2)}q c=a.6E(b);t c&&c.55?c.54:F}},"@1H.+2A":{3a:l(a,b){u(a.1q===1J||b=="56"||b=="3T"){t m.x(a,b,2)}q c=a.5c[m.$25[b.53()]||b];t c?c.55?c.54:F:m.x(a,b)}}},{$25:"",P:l(){q a=m.$25.53().1x(",");q b=m.$25.1x(",");m.$25=1C.5f(a,b)},"@1H.+2A":{$25:"6C,6A,6z,6x,6w,6v,6u,6s,6r,6q"}});1D.2j("4Z");v(2m,{L:l(a){28(a.1W){V 1:t 1D.L(a);V 9:t 1u.L(a);2Z:t 2l.L(a)}t a}});q 3O={};q 1O=l(a){u(a){q b=1m(a);u(!3O[b]){2m.L(a);3O[b]=14}}t a};q 2K=2h.v();q 1V=2h.v({"@!(11.2c)":{3M:l(a,b,c,d){a.2G=b;a.4Y=c;a.3H=d},"@U":{3M:l(a){x(m,y);a.4X=!a.4Y},4W:l(a){u(a.3H!==J){a.2i=J}},6p:l(a){a.4X=14}}}},{"@U.+6o":{L:l(a){t m.x(v({4W:l(){u(m.3H!==J){m.2i=J}}},a))}},"@U.+2A":{L:l(a){m.x(a);a.3J=a.6n;t a}}});q 1y=2f.v({"@!(1b.1k)":{1k:l(a,b,c){q d=1m(a);q e=c.3p||1m(c);q f=m.$1w[d];u(!f)f=m.$1w[d]={};q g=f[b];q h=a["4T"+b];u(!g){g=f[b]={};u(h)g[0]=h}g[e]=c;u(h!==1J){a["4T"+b]=m.$33}},30:l(a,b){m.$33.X(a,b)},6m:l(a,b,c){q d=m.$1w[a.1L];u(d&&d[b]){26 d[b][c.1L]}},"@U.+2A":{1k:l(a,b,c){m.x(a,b,m.1O(c,a))},30:l(a,b){b.3J=a;2C{a.6l(b.2G,b)}2k(1B){m.x(a,b)}}}}},{1O:l(a,b){q c=l(){t a.N(b,y)};c.3p=1m(a);t c},"@!(1b.1k)":{$1w:{},$33:l(a){q b=14;q c=1y.$1w[m.1L];u(c){a=1V.L(a);q d=c[a.2G];13(q i 2u d){b=d[i].X(m,a);u(a.2i===J)b=J;u(b===J)4b}}t b},"@U":{$33:l(a){u(!a){q b=3U.3n(m)||R.2F(m);a=b.6k}t m.x(a)},"6j":{1O:l(a,b){t 19.$L(a,b)}}}}});v(1y,{1k:l(a,b,c,d){u(d)c=m.1O(c,d);m.x(a,b,c,J)},30:l(a,b){u(E b=="17"){q c=b;q d=R.1T(a);b=2J.2c(d,"4R");1V.3M(b,c,J,J)}m.x(a,b)}});q 2J=2f.v({"@!(11.2c)":{2c:l(a){t 1V.L({})},"@(11.4Q)":{2c:l(a){t 1V.L(a.4Q())}}},"@5a":{2c:l(a,b){t m.x(a,b=="4R"?"6g":b)}}});q 1f=B G({2Y:J,29:l(){u(!1f.2Y){1f.2Y=14;6f("Y.1y.30(11,\'1f\')",0)}},P:l(){1y.1k(11,"1f",l(){1f.2Y=14});1y.1k(36,"4P",1f.29)},"@(1k)":{P:l(){m.x();1k("4P",1f.29,J)}},"@(2N)":{P:l(){m.x();2N("6e",1f.29)}},"@U.+2A":{P:l(){m.x();11.6d("<4M 2W=4L 6c 3T=//:><\\/4M>");11.1w.4L.6a=l(){u(m.4J=="4I"){m.69();1f.29()}}}},"@5a":{P:l(){m.x();q a=66(l(){u(/65|4I/.10(11.4J)){63(a);1f.29()}},62)}}});1f.P();q 3i=2f.v({"@!(4G)":{4G:l(a,b){t b.60}}},{5Y:l(c){t W(c).M(/\\-([a-z])/g,l(a,b){t b.3F()})}});v(1u,{"@!(11.2E)":{L:l(a){m.x(a);a.2E=R.2F(a);t a}}});q 2T=2f.v({"@!(1b.4E)":{4E:l(a,b){t m.3E(a,"."+b.32(",."))}},"@!(1b.3s)":{3E:l(a,b){t B 1a(b).1h(a)},3s:l(a,b){t B 1a(b).1h(a,1)}}});v(2T.I,{3E:l(b){t v(m.x(b),"1U",l(a){t 1O(m.x(a))})},3s:l(a){t 1O(m.x(a))}});q 3k=2T.v();q 3j=2T.v({"@!(1b.4C)":{4C:l(a,b){t B 1a(b).10(a)}}});q 2I=G.v({T:l(b){b=b||[];m.A=b.A;m.1U=l(a){t b[a]}},A:0,C:l(a,b){2C{q c=m.A;13(q i=0;i](\\*|[\\w-]+))([^: >+~]*)(:\\w+-2r(\\([^)]+\\))?)([^: >+~]*)/,"$1$3$6$4")},1F:F,2Q:14,3C:l(b){q c=m.4x=[];t m.4v(m.D(W(b).M(1G.4u,l(a){c.23(a.S(1,-1));t"%"+c.A})))},D:l(a){t a.M(1G.4t,"$1").M(1G.4F,"$1 $2").M(1G.4s,"$1*$2")},4v:l(a){t m.2R.1h(a.M(1G.4r,">* "))},3w:l(a){t m.1F[a]||(m.1F[a]=m.2V(m.1h(m.3C(a))))},2V:l(a){t D(a,m.4x)}},{4u:/(["\'])[^\\1]*\\1/g,4s:/([\\s>+~,]|[^(]\\+|^)([#.:@])/g,4F:/(^|,)([^\\s>+~])/g,4t:/\\s*([\\s>+~(),]|^|$)\\s*/g,4r:/\\s\\*\\s/g,4q:l(c,d,e,f,g,h,i,j){f=/3y/i.10(c)?f+"+1-":"";u(!5K(d))d="5J+"+d;H u(d=="5H")d="2n";H u(d=="5G")d="2n+1";d=d.1x(/n\\+?/);q a=(d[0]=="")?1:(d[0]=="-")?-1:3A(d[0]);q b=3A(d[1])||0;q g=a<0;u(g){a=-a;u(a==1)b++}q k=D(a==0?"%3%7"+(f+b):"(%4%3-%2)%6%1%6b%5%4%3>=%2",a,b,e,f,h,i,j);u(g)k=g+"("+k+")";t k}});1a.3v={"=":"%1==\'%2\'","~=":/(^| )%1( |$)/,"|=":/^%1(-|$)/,"^=":/^%1/,"$=":/%1$/,"*=":/%1/};1a.3v[""]="%1!=F";1a.4p={"4o":"e%1.4o","1p":"R.42(e%1).1S(\'%2\')!=-1","3u":"e%1.3u","5F":"R.5e(e%1)","5E":"e%1.3u===J","5D-2r":"!R.43(e%1)","3y-2r":"!R.2D(e%1)","5C-2r":"!R.43(e%1)&&!R.2D(e%1)","4m":"e%1==R.1T(e%1).3Z"};B l(){q U=19.22("U");q 1H=19.22("1H");q 2s=19.22("(1b.1M)");q 3t="q p%2=0,i%2,e%2,n%2=e%1.";q 2x=2s?"e%1.1M":"1m(e%1)";q 4l="q g="+2x+";u(!p[g]){p[g]=1;";q 4k="r[r.A]=e%1;u(s)t e%1;";q 4U="1Z=l(4j,s){1Y={};q r=[],p={},1o=[%1],"+"d=R.1T(4j),c=d.4h?\'3F\':\'1s\';";q 3P=U?l(a,b){q c=a.1w[b]||F;u(!c||c.2W==b)t c;13(q i=0;i(\\\\*|[\\\\w-]+)":l(a,b){q c=U&&1z;12=b=="*";q d=3t;d+=c?"52":"3r";u(!12&&c)d+=".3R(\'%3\')";d+=";13(i%2=0;(e%2=n%2[i%2]);i%2++){";u(12){d+="u(e%2.1W==1){";12=1H}H{u(!c)d+="u(e%2.39==\'%3\'[c]()){"}t D(d,O++,1z=O,b)},"([+~])(\\\\*|[\\\\w-]+)":l(a,b,c){q d="";u(12&&U)d+="u(e%1.3c!=\'!\'){";12=J;q e=b=="+";u(!e){d+="1c(";2o=2}d+="e%1=R.2D(e%1)";d+=(e?";":"){")+"u(e%1";u(c!="*")d+="&&e%1.39==\'%2\'[c]()";d+="){";t D(d,O,c)},"#([\\\\w-]+)":l(a,b){12=J;q c="u(e%1.2W==\'%2\'){";u(1z)c+=D("i%1=n%1.A;",1z);t D(c,O,b)},"\\\\.([\\\\w-]+)":l(a,b){12=J;1o.23(B 15("(^|\\\\s)"+2t(b)+"(\\\\s|$)"));t D("u(1o[%2].10(e%1.1q)){",O,1o.A-1)},":2S\\\\((\\\\*|[\\\\w-]+)?([^)]*)\\\\)":l(a,b,c){q d=(b&&b!="*")?D("u(e%1.39==\'%2\'[c]()){",O,b):"";d+=2e.1h(c);t"u(!"+d.S(2,-1).M(/\\)\\{u\\(/g,"&&")+"){"},":5y(-3y)?-2r\\\\(([^)]+)\\\\)":l(a,b,c){12=J;b=D("1Y[p%1].A",O);q d="u(p%1!==e%1.3d.";d+=2s?"1M":"1L";d+=")p%1=4g(e%1.3d);q i=1Y[p%1]["+2x+"];u(";t D(d,O)+1G.4q(a,c,"i",b,"!","&&","%","==")+"){"},":([\\\\w-]+)(\\\\(([^)]+)\\\\))?":l(a,b,c,d){t"u("+D(1a.4p[b],O,d||"")+"){"},"\\\\[([\\\\w-]+)\\\\s*([^=]?=)?\\\\s*([^\\\\]]*)\\\\]":l(a,b,c,d){u(c){u(b=="5x")b=="1q";H u(b=="13")b=="5w";b=D("(e%1.3a(\'%2\')||e%1[\'%2\'])",O,b)}H{b=D("1D.3a(e%1,\'%2\')",O,b)}q e=1a.3v[c||""];u(1g(e,15)){1o.23(B 15(D(e.2O,2t(2e.2V(d)))));e="1o[%2].10(%1)";d=1o.A-1}t"u("+D(e,b,d)+"){"}});1a.3w=l(f){u(!1F[f]){1o=[];1Z="";q g=2e.3C(f).1x(",");C(g,l(a,b){O=1z=2o=0;q c=2e.1h(a);u(12&&U){c+=D("u(e%1.3c!=\'!\'){",O)}q d=(b||2o>1)?4l:"";c+=D(d+4k,O);q e=2v(c,/\\{/g).A;1c(e--)c+="}";1Z+=c});1A(D(4U,1o)+2e.2V(1Z)+"t r}");1F[f]=1Z}t 1F[f]}};2K.18(3i);1u.18(3k);1u.18(2J);1u.18(1y);1D.18(3j);1D.18(1y);q 3h=1u.v({"@!(11.1W)":{1W:9}},{"@(11.3V===1J)":{L:l(b){m.x(b);b.3V=F;b.1k("5v",l(a){b.3V=a.3J},J);t b}}});q 2z=1D.v({5u:l(a,b){u(!m.58(a,b)){a.1q+=(a.1q?" ":"")+b;t b}},58:l(a,b){q c=B 15("(^|\\\\s)"+b+"(\\\\s|$)");t c.10(a.1q)},5t:l(a,b){q c=B 15("(^|\\\\s)"+b+"(\\\\s|$)");a.1q=a.1q.M(c,"$2");t b}},{3Y:{},3R:"*",v:l(){q b=x(m,y);q c=(b.3R||"").3F().1x(",");C(c,l(a){2z.3Y[a]=b});t b},"@!(1b.3f)":{L:l(a){m.x(a);a.3f=R.2g(a);t a}}});v(2m,"L",l(a){u(E a.1q=="17"){(2z.3Y[a.3c]||2z).L(a)}H u(a.4h!==1J){3h.L(a)}H{m.x(a)}t a});1A(m.1d)};',62,423,'|||||||||||||||||||||function|this||||var|||return|if|extend||base|arguments||length|new|forEach|format|typeof|null|Base|else|prototype|false||bind|replace|apply|index|init||Traversal|slice|constructor|MSIE|case|String|call|base2|KEYS|test|document|wild|for|true|RegExp||string|implement|BOM|Selector|element|while|exports|Item|DOMContentLoaded|instanceOf|exec|IArray|name|addEventListener|Module|assignID|Enumerable|reg|contains|className|Array|toString|userAgent|Document|Function|all|split|EventTarget|list|eval|error|Array2|Element|closures|cache|Parser|MSIE5|HASH|undefined|throw|base2ID|sourceIndex|Object|_bind|assert|fetch|VALUES|indexOf|getDocument|item|Event|nodeType|Namespace|indexed|fn|isElement|RegGrp|detect|push|StopIteration|htmlAttributes|delete|imports|switch|fire|namespace|exists|createEvent|store|parser|Interface|getOwnerDocument|Binding|returnValue|createDelegate|catch|Node|DOM||dup|reduce|ancestor|child|INDEXED|rescape|in|match|version|ID|splice|HTMLElement|win|remove|try|getNextElementSibling|defaultView|getDefaultView|type|_prototyping|StaticNodeList|DocumentEvent|AbstractView|map|create|attachEvent|source|global|ignoreCase|sorter|not|NodeSelector|lang|unescape|id|add|fired|default|dispatchEvent|Legacy|join|dispatch|Boolean|Hash|window|charAt|sort|nodeName|getAttribute|getSourceIndex|tagName|parentNode|copy|ownerDocument|continue|HTMLDocument|ViewCSS|ElementSelector|DocumentSelector|concat|assertType|verify|Abstract|cloneID|Error|childNodes|matchSingle|VAR|disabled|operators|parse|base2_test|last|trim|parseInt|_constructing|escape|replacement|matchAll|toUpperCase|Collection|cancelable|callee|target|number|keys|initEvent|merge|_bound|getElementById|reverse|tags|removeAt|src|Window|activeElement|result|insertAt|bindings|documentElement|isDocument|_extend|getTextContent|getPreviousElementSibling|previousSibling|getNodeIndex|nextSibling|TypeError|Invalid|every|self|break|method|platform|gi|navigator|register|body|createElement|e0|STORE|TEST|root|alpha|checked|pseudoClasses|_nthChild|WILD_CARD|IMPLIED_ASTERISK|WHITESPACE|ESCAPE|optimise|is|_strings|STRING|IGNORE|evaluate|snapshotItem|matchesSelector|TRIM|getElementsByClassName|IMPLIED_SPACE|getComputedStyle|RESCAPE|complete|readyState|count|__ready|script|key|Duplicate|load|createEventObject|Events|Date|on|FN|values|preventDefault|cancelBubble|bubbles|setAttribute|valueOf|Number|children|toLowerCase|nodeValue|specified|href|members|hasClass|compareDocumentPosition|KHTML|max|attributes|Math|isEmpty|combine|pluck|invoke|object|filter|instantiated|be|failed|cannot|Infinity|Class|Assertion|onunload|uniqueID|removeClass|addClass|focus|htmlFor|class|nth|getElementsByTagName|span|cc_on|only|first|enabled|empty|odd|even|base2_|0n|isNaN|yet|supported|verboten|references|removeAttribute|Back|selector|CSS|valid|SyntaxError|snapshotLength|XPathResult|bounds|toCamelCase|of|currentStyle|out|100|clearInterval|Index|loaded|setInterval||storeAt|removeNode|onreadystatechange|70|defer|write|onload|setTimeout|UIEvents|union|getTimezoneOffset|Windows|event|fireEvent|removeEventListener|srcElement|mac|stopPropagation|longDesc|readOnly|maxLength|unshift|encType|tabIndex|accessKey|dateTime|shift|vAlign|rowSpan|bbase|colSpan|pop|getAttributeNode|from|operand|lastIndexOf|instanceof|insertBefore|parentWindow|innerText|firstChild|textContent|some'.split('|'),0,{})) +eval(function(p,a,c,k,e,r){var b,e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)a[c]=(r[b=e(c)]=k[c])?b:'\\x0';e=function(){return a.join('|')||'^'};k=[function(e){return r[e]}];c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b('+e(c)+')\\b','g'),k[c]);return p}('u U={1v:"U",4I:"0.9 (4J)",2c:q,1h:C o(1w){u 2c=1w;u 4K/*@3S=@3T@*/;u 30=1w.30;v(1w.31){u 1l=10.3U("span");u 1U=31.1U+" "+31.userAgent;v(!4K)1U=1U.D(/1m\\s[\\d.]+/,"");1U=1U.D(/([a-z])[\\s\\/](\\d)/4L,"$1$2");30=31.javaEnabled()&&30}t o(a){u r=L;u b=a.1V(0)=="!";v(b)a=a.J(1);a=a.D(/^([^\\(].*)$/,"/($1)/i.P(1U)");32{1W("r=!!"+a)}33(2d){}t!!(b^r)}}(q)};C o(1w){u 1h=U.1h;u J=2e.J||o(a){t 3V.X(a,3V.15(A,1))};u 34=1;u 3W=/^[1w$]/;u _3=/%([1-9])/g;u 4M=/^\\s\\s*/;u 4N=/\\s\\s*$/;u 4O=/([\\/()[\\]{}|*+-.,^$?\\\\])/g;u 3X=/1W/.P(1h)?/\\bbase\\b/:/./;u 4P=["V","1X","35"];u 4Q=R(C 19);u 3V=2e.M.J;u 2x=4R();o N(){v(q.V==N){q.x(A[0])}E{t x(A[0],N.M)}};N.M={V:N,y:o(){},x:1F(x)};N.2f=2g;N.36=1F(3Y);N.y=N.M.y;N.x=o(a,b){U.37=11;u c=C q;x(c,a);2y U.37;u d=c.V;o 1p(){v(!U.37){v(q.V==A.1G||q.3Z){q.3Z=11;d.X(q,A);2y q.3Z}E{t x(A[0],c)}}};c.V=1p;13(u i 1Y N)1p[i]=q[i];1p.2f=q;1p.y=1Z;1p.14=1Z;1p.M=c;x(1p,b);1p.14();t 1p};N.F=1F(2x),N.1a=o(a){v(1b(a,1H)){v(N.36(a)){a(q.M)}}E{x(q.M,a)}t q};N.14=1Z;u 2z=N.x({V:o(c,d){q.x(d);v(G q.14=="o")q.14();v(q.1v!="U"){U.40(q.1v,q);q.2h=H("u %1=U.%1;",q.1v)}u e=/[^\\s,]+/g;c.38=20.2A(q.38.1I(e),o(a,b){21(U[b],H("2z 18 found: \'%1\'.",b));t a+=U[b].2h},U.2h);c.1J=20.2A(q.1J.1I(e),o(a,b){q.2h+=H("u %2=%1.%2;",q.1v,b);t a+=H("v(!%1.%2)%1.%2=%2;",q.1v,b)},"",q)},1J:"",38:"",2h:"",1v:"",40:o(a,b){q[a]=b;q.1J+=","+a;q.2h+=H("u %1=%2.%1;",a,q.1v)}});u 41=N.x({V:o(){1K C 4S("Class cannot be instantiated.");}});u 1i=41.x(I,{x:o(c,d){u e=q.y();F(q,o(a,b){v(!1i[b]&&G a=="o"&&!3W.P(b)){x(e,b,a)}});e.1a(c);x(e,d);e.14();t e},1a:o(c){u d=q;v(G c=="o"){d.y(c);v(1i.36(c)){F(c,o(a,b){v(!1i[b]&&G a=="o"&&!3W.P(b)){x(d,b,a)}})}}E{2x(2g,c,o(a,b){v(b.1V(0)=="@"){v(1h(b.J(1))){F(a,A.1G)}}E v(!1i[b]&&G a=="o"){o 42(){t d[b].X(d,[q].1n(J(A)))};42.39=3X.P(a);x(d.M,b,42)}});x(d,c)}t d}});u 22=1i.x({4T:o(c,d,e){u f=11;32{q.F(c,o(a,b){f=d.15(e,a,b,c);v(!f)1K 2B;})}33(2d){v(2d!=2B)1K 2d;}t!!f},filter:o(d,e,f){u i=0;t q.2A(d,o(a,b,c){v(e.15(f,b,c,d)){a[i++]=b}t a},[])},invoke:o(b,c){u d=J(A,2);t q.2C(b,(G c=="o")?o(a){v(a!=I)t c.X(a,d)}:o(a){v(a!=I)t a[c].X(a,d)})},2C:o(c,d,e){u f=[],i=0;q.F(c,o(a,b){f[i++]=d.15(e,a,b,c)});t f},pluck:o(b,c){t q.2C(b,o(a){v(a!=I)t a[c]})},2A:o(c,d,e,f){u g=A.B>2;q.F(c,o(a,b){v(g){e=d.15(f,e,a,b,c)}E{e=a;g=11}});t e},some:o(c,d,e){t!q.4T(c,o(a,b){t!d.15(e,a,b,c)})}},{F:F});u 1c="#";u 3a=N.x({V:o(a){q.43(a)},1x:1F(1x),23:o(a){/*@3S@*//*@v(@3T<5.5)t $4U.23(q,1c+a);@E@*/t 1c+a 1Y q;/*@4V@*/},4W:o(a){t q[1c+a]},F:o(a,b){13(u c 1Y q)v(c.1V(0)==1c){a.15(b,q[c],c.J(1),q)}},43:o(d){F(A,o(c){F(c,o(a,b){q.24(b,a)},q)},q);t q},2i:o(a){u b=q[1c+a];2y q[1c+a];t b},24:o(a,b){v(A.B==1)b=a;t q[1c+a]=b},union:o(a){t q.43.X(q.1x(),A)}});3a.1a(22);u S="~";u 44=3a.x({V:o(a){q[S]=C 20;q.y(a)},3b:o(a,b){21(!q.23(a),"4X 4Y \'"+a+"\'.");t q.24.X(q,A)},1x:o(){u a=q.y();a[S]=q[S].1x();t a},2j:o(){t q[S].B},4Z:o(a){v(a<0)a+=q[S].B;u b=q[S][a];v(b!==1j)t q[1c+b]},F:o(a,b){u c=q[S];u d=c.B,i;13(i=0;i=0;i--){v(a[i]===b)t i}t-1},2C:o(c,d,e){u f=[];q.F(c,o(a,b){f[b]=d.15(e,a,b,c)});t f},2i:o(a,b){u c=q.25(a,b);v(c!=-1)q.3e(a,c);t b},3e:o(a,b){t q.3l(a,b,1)}}]);20.M.F=1F(3m);u String2=4b(R,"1V,charCodeAt,1n,25,5d,1I,D,search,J,1y,substr,5e,4c,3n",[{2k:2k}]);o 4b(c,d,e){u f=1i.x();F(d.1y(","),o(a){f[a]=3o(c.M[a])});F(e,f.1a,f);u g=o(){t f(q.V==f?c.X(c,A):A[0])};g.M=f.M;F(f,o(a,b){v(c[b]){f[b]=c[b];2y f.M[b]}g[b]=f[b]});t g};o y(a,b){t a.y.X(a,b)};o x(c,d){u e=A.1G;v(c!=I){v(A.B>2){u f=R(d);u g=A[2];v(f.1V(0)=="@"){t 1h(f.J(1))?e(c,g):c}v(c.x==e&&/^(y|x)$/.P(f)){t c}v(G g=="o"){u h=c[f];v(g!=h&&!3Y(g,h)){v(g.39||3X.P(g)){u i=g;o 39(){u a=q.y;q.y=h;u b=i.X(q,A);q.y=a;t b};g=39;g.method=i;g.2f=h}c[f]=g}}E{c[f]=g}}E v(d){u j=1b(d,1H)?1H:2g;v(U.37){F(4P,o(a){v(d[a]!=j.M[a]){e(c,a,d[a])}})}E{v(G c.x=="o"&&G c!="o"&&c.x!=e){e=3o(c.x)}}2x(j,d,o(a,b){e(c,b,a)})}}t c};o 3Y(a,b){1o(b&&b.2f!=a)b=b.2f;t!!b};v(G 2B=="1j"){2B=C 5f("2B")}o F(a,b,c,d){v(a==I)t;v(!d){v(1b(a,1H)){d=1H}E v(G a.F=="o"&&a.F!=A.1G){a.F(b,c);t}E v(G a.B=="49"){3m(a,b,c);t}}2x(d||2g,a,b,c)};o 3m(a,b,c){v(a==I)t;u d=a.B,i;v(G a=="27"){13(i=0;i1)?o(a,b,c,d){u e={};13(u f 1Y b){v(!e[f]&&a.M[f]===1j){e[f]=11;c.15(d,b[f],f,b)}}}:o(a,b,c,d){13(u e 1Y b){v(a.M[e]===1j){c.15(d,b[e],e,b)}}}};o 1b(a,b){4d(b,"o","5g \'1b\' operand.");/*@3S@*//*@v(@3T<5.1)v($4U.1b(a,b))t 11;@E@*/v(a instanceof b)t 11;/*@4V@*/v(4e(b))t L;v(4e(a.V))t b==2g;v(a!=I)3d(b){1d 2e:t!!(G a=="3i"&&a.2E&&a.3l);1d 1H:t!!(G a=="o"&&a.15);1d 19:t a.V.M.1X()==4Q;1d Date:t!!a.getTimezoneOffset;1d R:1d 57:1d Boolean:t G a==G b.M.35();1d 2g:t G a=="3i"&&G a.V=="o"}t L};o 4e(a){t a==N||N.36(a)};o 21(a,b,c){v(!a){1K C(c||5f)(b||"Assertion failed.");}};o 5h(a,b,c){v(b==I)b=a.1G.B;v(a.B<\\/5y>");10.1B.5z.onreadystatechange=o(){v(q.5A=="5B"){q.removeNode();1S.2t()}}}},"@4w":{14:o(){q.y();u a=setInterval(o(){v(/loaded|5B/.P(10.5A)){clearInterval(a);1S.2t()}},100)}}});u 4j=2p.x({"@!(10.2I.5C)":{5C:o(a,b,c){t b.currentStyle}}},{toCamelCase:o(c){t R(c).D(/\\-([a-z])/g,o(a,b){t b.3n()})}});u 3E=2p.x({"@!(1l.5D)":{5D:o(a,b){v(1b(b,2e)){b=b.2E(".")}t q.4x(a,"."+b)}},"@!(1l.4y)":{4x:o(a,b){t C Y(b).1e(a)},4y:o(a,b){t C Y(b).1e(a,1)}}});x(3E.M,{4x:o(b){t x(q.y(b),"1q",o(a){t 1N.O(q.y(a))})},4y:o(a){t 1N.O(q.y(a))}});u 4h=3E.x();u 4i=3E.x({"@!(1l.5E)":{5E:o(a,b){t C Y(b).P(a)}}});u 3s=N.x({V:o(b){b=b||[];q.B=b.B;q.1q=o(a){t b[a]}},B:0,F:o(a,b){u c=q.B;13(u i=0;i](\\*|[\\w-]+))([^: >+~]*)(:\\w+-Z(\\([^)]+\\))?)([^: >+~]*)/,"$1$3$6$4")},3G:I,3h:11,3H:o(b){u c=/\'/g;u d=q.5I=[];t q.5J(q.H(R(b).D(1s.5K,o(a){d.2D(a.J(1,-1).D(c,"\\\\\'"));t"\\5L"+d.B})))},H:o(a){t a.D(1s.5M,"$1").D(1s.5N,"$1 $2").D(1s.5O,"$1*$2")},5J:o(a){t q.2O.1e(a.D(1s.5P,">* "))},3F:o(a){t q.3G[a]||(q.3G[a]=q.2u(q.1e(q.3H(a))))},2u:o(c){u d=q.5I;t c.D(/\\5L(\\d+)/g,o(a,b){t d[b-1]})}},{5K:/(["\'])[^\\1]*\\1/g,5O:/([\\s>+~,]|[^(]\\+|^)([#.:@])/g,5N:/(^|,)([^\\s>+~])/g,5M:/\\s*([\\s>+~(),]|^|$)\\s*/g,5P:/\\s\\*\\s/g,2a:o(c,d,e,f,g,h,i,j){f=/1k/i.P(c)?f+"+1-":"";v(!isNaN(d))d="0n+"+d;E v(d=="even")d="2n";E v(d=="odd")d="2n+1";d=d.1y(/n\\+?/);u a=d[0]?(d[0]=="-")?-1:4a(d[0]):1;u b=4a(d[1])||0;u g=a<0;v(g){a=-a;v(a==1)b++}u l=H(a==0?"%3%7"+(f+b):"(%4%3-%2)%6%1%70%5%4%3>=%2",a,b,e,f,h,i,j);v(g)l=g+"("+l+")";t l}});Y.4A={"=":"%1==\'%2\'","!=":"%1!=\'%2\'","~=":/(^| )%1( |$)/,"|=":/^%1(-|$)/,"^=":/^%1/,"$=":/%1$/,"*=":/%1/};Y.4A[""]="%1!=I";Y.1t={"3I":"e%1.3I","17":"e%1[T.$2K].25(\'%2\')!=-1","2P":"e%1.2P","5Q":"T.5o(e%1)","4B":"e%1.2P===L","4C-Z":"!T.4o(e%1)","1k-Z":"!T.3w(e%1)","2Q-Z":"!T.4o(e%1)&&!T.3w(e%1)","4D":"e%1==T.2q(e%1).4q"};C o(1w){u 2b=1h("2b");u 2R=1h("2R");u 5R=1h("(1l.3J)");u 4E="u p%2=0,i%2,e%2,n%2=e%1.";u 34=5R?"e%1.3J":"1M(e%1)";u 5S="u g="+34+";v(!p[g]){p[g]=1;";u 5T="r[r.B]=e%1;v(s)t e%1;";u 5U="1Q=o(5V,s){2v++;u r=[],p={},1u=[%1],"+"d=T.2q(5V),c=d.body?\'3n\':\'1X\';";u 5W=2b?o(a,b){u c=a.1B[b]||I;v(!c||c.2M==b)t c;13(u i=0;i(\\\\*|[\\\\w-]+)":o(a,b){u c=2b&&1D;12=b=="*";u d=4E;d+=c?"children":"childNodes";v(!12&&c)d+=".4F(\'%3\')";d+=";13(i%2=0;(e%2=n%2[i%2]);i%2++){";v(12){d+="v(e%2.1A==1){";12=2R}E{v(!c)d+="v(e%2.2T==\'%3\'[c]()){"}t H(d,W++,1D=W,b)},"\\\\+(\\\\*|[\\\\w-]+)":o(a,b){u c="";v(12&&2b)c+="v(e%1.29!=\'!\'){";12=L;c+="e%1=T.3w(e%1);v(e%1";v(b!="*")c+="&&e%1.2T==\'%2\'[c]()";c+="){";t H(c,W,b)},"~(\\\\*|[\\\\w-]+)":o(a,b){u c="";v(12&&2b)c+="v(e%1.29!=\'!\'){";12=L;2S=2;c+="1o(e%1=e%1.3x){v(e%1.61==2v)2F;e%1.61=2v;v(";v(b=="*"){c+="e%1.1A==1";v(2R)c+="&&e%1.29!=\'!\'"}E c+="e%1.2T==\'%2\'[c]()";c+="){";t H(c,W,b)},"#([\\\\w-]+)":o(a,b){12=L;u c="v(e%1.2M==\'%2\'){";v(1D)c+=H("i%1=n%1.B;",1D);t H(c,W,b)},"\\\\.([\\\\w-]+)":o(a,b){12=L;1u.2D(C 19("(^|\\\\s)"+1L(b)+"(\\\\s|$)"));t H("v(1u[%2].P(e%1.1r)){",W,1u.B-1)},":18\\\\((\\\\*|[\\\\w-]+)?([^)]*)\\\\)":o(a,b,c){u d=(b&&b!="*")?H("v(e%1.2T==\'%2\'[c]()){",W,b):"";d+=2w.1e(c);t"v(!"+d.J(2,-1).D(/\\)\\{v\\(/g,"&&")+"){"},":2U(-1k)?-Z\\\\(([^)]+)\\\\)":o(a,b,c){12=L;b=H("e%1.2L.60",W);u d="v(p%1!==e%1.2L)";d+="p%1=5X(e%1.2L);u i=e%1.5Z;v(";t H(d,W)+1s.2a(a,c,"i",b,"!","&&","%","==")+"){"},":([\\\\w-]+)(\\\\(([^)]+)\\\\))?":o(a,b,c,d){t"v("+H(Y.1t[b],W,d||"")+"){"},"\\\\[([\\\\w-]+)\\\\s*([^=]?=)?\\\\s*([^\\\\]]*)\\\\]":o(a,b,c,d){u e=1z.$1T[b]||b;v(b=="62")e="1r";E v(b=="13")e="htmlFor";v(c){b=H("(e%1.%3||e%1.3L(\'%2\'))",W,b,e)}E{b=H("1z.3L(e%1,\'%2\')",W,b)}u f=Y.4A[c||""];v(1b(f,19)){1u.2D(C 19(H(f.3j,1L(2w.2u(d)))));f="1u[%2].P(%1)";d=1u.B-1}t"v("+H(f,b,d)+"){"}});Y.3F=o(a){v(!3K[a]){1u=[];1Q="";u b=2w.3H(a).1y(",");13(u i=0;i1?2:0;u c=2w.1e(b[i])||"1K;";v(12&&2b){c+=H("v(e%1.29!=\'!\'){",W)}u d=(2S>1)?5S:"";c+=H(d+5T,W);c+=2e(1I(c,/\\{/g).B+1).2E("}");1Q+=c}1W(H(5U,1u)+2w.2u(1Q)+"t s?I:r}");3K[a]=1Q}t 3K[a]}};u 2o=1s.x({V:o(){q.y(2o.4G);q.2O.55(1,"$1$4$3$6")},3H:o(a){t q.y(a).D(/,/g,"\\3M")},2u:o(a){t q.y(a.D(/\\[2V::\\*\\]/g,"").D(/(^|\\3M)\\//g,"$1./").D(/\\3M/g," | "))},"@63":{2u:o(a){t q.y(a.D(/1k\\(\\)/g,"2j(3N-1E::*)+2j(2W-1E::*)+1"))}}},{14:o(){q.2X.1T[""]="[@$1]";F(q.64,o(a,b){F(q.2X[b],a,q.4G)},q)},3O:{1t:{"4C-Z":"[1]","1k-Z":"[1k()]","2Q-Z":"[1k()=1]"}},4G:x({},{"@!4w":{"(^|\\\\3M) (\\\\*|[\\\\w-]+)#([\\\\w-]+)":"$1id(\'$3\')[2V::$2]","([ >])(\\\\*|[\\\\w-]+):([\\\\w-]+-Z(\\\\(([^)]+)\\\\))?)":o(a,b,c,d,e,f){u g=(b==" ")?"//*":"/*";v(/^2U/i.P(d)){g+=2a(d,f,"position()")}E{g+=2o.3O.1t[d]}t g+"[2V::"+c+"]"}}}),64:{65:o(a,b){q[1L(b)+"([\\\\w-]+)"]=a},66:o(a,b){q[1L(b)+"(\\\\*|[\\\\w-]+)"]=a},1T:o(a,b){q["\\\\[([\\\\w-]+)\\\\s*"+1L(b)+"\\\\s*([^\\\\]]*)\\\\]"]=a},1t:o(a,b){q[":"+b.D(/\\(\\)$/,"\\\\(([^)]+)\\\\)")]=a}},2X:{65:{"#":"[@2M=\'$1\'][1]",".":"[17(1n(\' \', at 62,\' \'),\' $1 \')]"},66:{" ":"/descendant::$1",">":"/Z::$1","+":"/2W-1E::*[1][2V::$1]","~":"/2W-1E::$1"},1T:{"*=":"[17(@$1,\'$2\')]","^=":"[starts-with(@$1,\'$2\')]","$=":"[5e(@$1,27-B(@$1)-27-B(\'$2\')+1)=\'$2\']","~=":"[17(1n(\' \',@$1,\' \'),\' $2 \')]","|=":"[17(1n(\'-\',@$1,\'-\'),\'-$2-\')]","!=":"[18(@$1=\'$2\')]","=":"[@$1=\'$2\']"},1t:{"5Q":"[18(Z::*) 3P 18(text())]","4C-Z":"[18(3N-1E::*)]","1k-Z":"[18(2W-1E::*)]","18()":68,"2U-Z()":2a,"2U-1k-Z()":2a,"2Q-Z":"[18(3N-1E::*) 3P 18(2W-1E::*)]","4D":"[18(parent::*)]"}},"@63":{14:o(){q.3O.1t["1k-Z"]=q.2X.1t["1k-Z"];q.3O.1t["2Q-Z"]=q.2X.1t["2Q-Z"];q.y()}}});o 68(a,b){u c=C 2o;t"[18("+c.1e(2k(b)).D(/\\[1\\]/g,"").D(/^(\\*|[\\w-]+)/,"[2V::$1]").D(/\\]\\[/g," 3P ").J(1,-1)+")]"};o 2a(a,b,c){t"["+1s.2a(a,b,c||"2j(3N-1E::*)+1","1k()","18"," 3P "," mod ","=")+"]"};Y.1a({2Y:o(){t Y.2Y(q)},"@(5F)":{$2N:o(a,b){v(Y.$2Z.P(q)){t q.y(a,b)}u c=T.2q(a);u d=b?9:7;u e=c.2N(q.2Y(),a,I,d,I);t b?e.singleNodeValue:e}},"@1m":{$2N:o(a,b){v(G a.69!="1j"&&!Y.$2Z.P(q)){u c=b?"selectSingleNode":"69";t a[c](q.2Y())}t q.y(a,b)}}});x(Y,{3Q:I,2Y:o(a){v(!q.3Q)q.3Q=C 2o;t q.3Q.3F(a)},$2Z:/:(3I|2P|4B|17)|^(#[\\w-]+\\s*)?\\w+$/,"@4w":{$2Z:/:(3I|2P|4B|17)|^(#[\\w-]+\\s*)?\\w+$|2U\\-/,"@!WebKit5":{$2Z:/./}}});u 28=3u.x({"@!(1l.6a)":{6a:o(a,b){v(T.17(a,b)){t 4|16}E v(T.17(b,a)){t 2|8}u c=28.3R(a);u d=28.3R(b);v(cd){t 2}t 0}}},{3R:o(a){u b=0;1o(a){b=T.5m(a)+"."+b;a=a.2L}t b},"@(1l.3J)":{3R:o(a){t a.3J}}});u 1O=28.x(I,{O:o(b){q.y(b);x(b,"3U",o(a){t 1N.O(q.y(a))});3q.O(b.2I);t b},"@!(10.2I)":{O:o(a){a.2I=T.3v(a);t q.y(a)}}});1O.3t("3U",2);u 1z=28.x({"@1m[67]":{3L:o(a,b,c){v(a.1r===1j||b=="6b"||b=="4v"){t q.y(a,b,2)}u d=a.getAttributeNode(b);t d&&d.6c?d.6d:I}},"@3z.+2H":{3L:o(a,b,c){v(a.1r===1j||b=="6b"||b=="4v"){t q.y(a,b,2)}u d=a.1T[q.$1T[b.4c()]||b];t d?d.6c?d.6d:I:q.y(a,b)}}},{$1T:{},"@3z.+2H":{14:o(){u a="colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc";u b=a.4c().1y(",");u c=a.1y(",");q.$1T=20.5b(b,c)}}});1z.3t("5H",3);3q.1a(4j);1O.1a(4h);1O.1a(3r);1O.1a(1g);1z.1a(4i);1z.1a(1g);u 4k=1O.x(I,{"@(10.4H===1j)":{O:o(b){q.y(b);b.4H=I;b.1C("focus",o(a){b.4H=a.3A},L);t b}}});u 2G=1z.x({addClass:o(a,b){v(!q.6e(a,b)){a.1r+=(a.1r?" ":"")+b;t b}},6e:o(a,b){u c=C 19("(^|\\\\s)"+b+"(\\\\s|$)");t c.P(a.1r)},removeClass:o(a,b){u c=C 19("(^|\\\\s)"+b+"(\\\\s|$)");a.1r=a.1r.D(c,"$2");t b}},{4l:{},4F:"*",x:o(){u b=y(q,A);u c=(b.4F||"").3n().1y(",");F(c,o(a){2G.4l[a]=b});t b},"@!(1l.3y)":{O:o(a){q.y(a);a.3y=T.2r(a);t a}}});1N.$=o(a,b){t C Y(a).1e(b,1)};1N.$$=o(a,b){t C Y(a).1e(b)};1W(q.1J)};',[],494,'||||||||||||||||||||||||function||this|||return|var|if||extend|base||arguments|length|new|replace|else|forEach|typeof|format|null|slice||false|prototype|Base|bind|test||String|_16|Traversal|base2|constructor|_35|apply|Selector|child|document|true|_36|for|init|call||contains|not|RegExp|implement|instanceOf|_15|case|exec|Item|EventTarget|detect|Module|undefined|last|element|MSIE|concat|while|klass|item|className|Parser|pseudoClasses|reg|name|_|copy|split|Element|nodeType|all|addEventListener|_37|sibling|delegate|callee|Function|match|exports|throw|rescape|assignID|DOM|Document|closures|fn|createEvent|DOMContentLoaded|attributes|platform|charAt|eval|toString|in|Undefined|Array2|assert|Enumerable|exists|store|indexOf|RegGrp|string|Node|tagName|_27|_28|global|error|Array|ancestor|Object|namespace|remove|count|trim|base2ID|Event||XPathParser|Interface|getDocument|getOwnerDocument|handleEvent|fire|unescape|indexed|parser|_10|delete|Namespace|reduce|StopIteration|map|push|join|break|HTMLElement|win|defaultView|isElement|TEXT|parentNode|id|evaluate|sorter|disabled|only|_29|_38|nodeName|nth|self|following|values|toXPath|NOT_XPATH|java|navigator|try|catch|_1|valueOf|ancestorOf|__prototyping|imports|_14|Hash|add|Math|switch|removeAt|sort|create|ignoreCase|object|source|partial|splice|_19|toUpperCase|unbind|type|AbstractView|DocumentEvent|StaticNodeList|createDelegate|Binding|getDefaultView|getNextElementSibling|nextSibling|ownerDocument|MSIE5|target|dispatchEvent|listener|fired|NodeSelector|parse|cache|escape|checked|sourceIndex|_39|getAttribute|x02|preceding|optimised|and|xpathParser|_41|cc_on|_jscript_version|createElement|_0|_2|_7|_12|__constructing|addName|Abstract|_13|merge|Collection|insertAt|default|reverse|replacement|number|parseInt|_18|toLowerCase|assertType|_20|_21|_22|DocumentSelector|ElementSelector|ViewCSS|HTMLDocument|bindings|attachEvent|continue|getPreviousElementSibling|isDocument|documentElement|initEvent|cancelable|returnValue|Events|src|KHTML|matchAll|matchSingle|b2_test|operators|enabled|first|root|_31|tags|rules|activeElement|version|alpha|jscript|gi|_4|_5|_6|_8|_9|_11|TypeError|every|Legacy|end|fetch|Duplicate|key|fetchAt|abs|Index|out|of|bounds|storeAt||Number|IGNORE|_17|index|combine|max|lastIndexOf|substring|Error|Invalid|assertArity|SyntaxError|_23|_24|_25|getNodeIndex|previousSibling|isEmpty|firstChild|parentWindow|bubbles|cancelBubble|preventDefault|on|event|createEventObject|load|script|__ready|readyState|complete|getComputedStyle|getElementsByClassName|matchesSelector|XPathResult|snapshotItem|setAttribute|_26|optimise|ESCAPE|x01|WHITESPACE|IMPLIED_SPACE|IMPLIED_ASTERISK|WILD_CARD|empty|_30|_32|_33|_34|e0|byId|register|b2_indexed|b2_index|b2_length|b2_adjacent|class|opera|types|identifiers|combinators||_40|selectNodes|compareDocumentPosition|href|specified|nodeValue|hasClass'.split('|'),0,{})); \ No newline at end of file From reebalazs at codespeak.net Thu Sep 13 18:41:21 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 13 Sep 2007 18:41:21 +0200 (CEST) Subject: [KSS-checkins] r46544 - kukit/azax/branch/1.1-ree-binding-improvements Message-ID: <20070913164121.D48D280BD@code0.codespeak.net> Author: reebalazs Date: Thu Sep 13 18:41:21 2007 New Revision: 46544 Modified: kukit/azax/branch/1.1-ree-binding-improvements/configure.zcml Log: Port back firebuglite support from trunk. Merges: -r45701:45702 Modified: kukit/azax/branch/1.1-ree-binding-improvements/configure.zcml ============================================================================== --- kukit/azax/branch/1.1-ree-binding-improvements/configure.zcml (original) +++ kukit/azax/branch/1.1-ree-binding-improvements/configure.zcml Thu Sep 13 18:41:21 2007 @@ -39,6 +39,11 @@ name="cssQuery-compat.js" /> + + Author: reebalazs Date: Thu Sep 13 18:45:23 2007 New Revision: 46545 Modified: kukit/kukit.js/branch/ree-binding-improvements/kukit/plugin.js Log: Port back important fixes from trunk, --r46401:46402,46102:46103 Modified: kukit/kukit.js/branch/ree-binding-improvements/kukit/plugin.js ============================================================================== --- kukit/kukit.js/branch/ree-binding-improvements/kukit/plugin.js (original) +++ kukit/kukit.js/branch/ree-binding-improvements/kukit/plugin.js Thu Sep 13 18:45:23 2007 @@ -81,7 +81,7 @@ if (! eventname) eventname = oper.getEventName(); var func = function(e) { - target = kukit.pl.getTargetForBrowserEvent(e); + var target = kukit.pl.getTargetForBrowserEvent(e); if (oper.parms.allowbubbling || target == oper.node) { // Execute the action, provide browserevent on oper // ... however, do it protected. We want the preventdefault @@ -358,8 +358,20 @@ ;;; kukit.logDebug(kukit.E); // for any other node than iframe, or even for iframe in phase1, we need to execute immediately. var func_to_bind = loadoper.makeExecuteActionsHook(); - ;;; kukit.E = 'Execute load event for node ' + loadoper.node.tagName.toLowerCase(); - kukit.engine.bindScheduler.addPost(func_to_bind, kukit.E); + var remark = ''; +;;; remark += '[load] event execution for '; +;;; // loadoper can execute on document! +;;; // Is this the case? +;;; if (loadoper.node == null) { +;;; // document:load +;;; remark += '[document]'; +;;; } else { +;;; // :load +;;; remark += 'node ['; +;;; remark += loadoper.node.tagName.toLowerCase(); +;;; remark += ']'; +;;; } + kukit.engine.bindScheduler.addPost(func_to_bind, remark); } if (iloadoper) { var phase = iloadoper.node._kukitmark; From jvloothuis at codespeak.net Thu Sep 13 21:59:31 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Thu, 13 Sep 2007 21:59:31 +0200 (CEST) Subject: [KSS-checkins] r46557 - kukit/kss.base-buildout/trunk Message-ID: <20070913195931.3DB2E80EB@code0.codespeak.net> Author: jvloothuis Date: Thu Sep 13 21:59:28 2007 New Revision: 46557 Modified: kukit/kss.base-buildout/trunk/buildout.cfg Log: Added template for creating plugins (uses Paster). Added Paster to the buildout to test this new template Modified: kukit/kss.base-buildout/trunk/buildout.cfg ============================================================================== --- kukit/kss.base-buildout/trunk/buildout.cfg (original) +++ kukit/kss.base-buildout/trunk/buildout.cfg Thu Sep 13 21:59:28 2007 @@ -1,6 +1,8 @@ [buildout] parts = test-runner scripts develop = kss.base +eggs = PasteScript + [test-runner] recipe = zc.recipe.testrunner @@ -10,3 +12,4 @@ [scripts] recipe = zc.recipe.egg eggs = kss.base + PasteScript From jvloothuis at codespeak.net Thu Sep 13 22:00:05 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Thu, 13 Sep 2007 22:00:05 +0200 (CEST) Subject: [KSS-checkins] r46558 - in kukit/kss.base/trunk: . kss/base kss/base/templates kss/base/templates/plugin kss/base/templates/plugin/+package+ kss/base/templates/plugin/+package+/javascript kss/base/templates/plugin/+package+/tests kss/base/templates/plugin/ez_setup Message-ID: <20070913200005.6E34980A4@code0.codespeak.net> Author: jvloothuis Date: Thu Sep 13 22:00:04 2007 New Revision: 46558 Added: kukit/kss.base/trunk/kss/base/templates/ kukit/kss.base/trunk/kss/base/templates/__init__.py kukit/kss.base/trunk/kss/base/templates/plugin/ kukit/kss.base/trunk/kss/base/templates/plugin/+package+/ kukit/kss.base/trunk/kss/base/templates/plugin/+package+/README.txt_tmpl kukit/kss.base/trunk/kss/base/templates/plugin/+package+/__init__.py_tmpl (contents, props changed) kukit/kss.base/trunk/kss/base/templates/plugin/+package+/commands.py_tmpl kukit/kss.base/trunk/kss/base/templates/plugin/+package+/helpers.py_tmpl (contents, props changed) kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/ kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js kukit/kss.base/trunk/kss/base/templates/plugin/+package+/plugin.py_tmpl kukit/kss.base/trunk/kss/base/templates/plugin/+package+/tests/ kukit/kss.base/trunk/kss/base/templates/plugin/+package+/tests/__init__.py_tmpl (contents, props changed) kukit/kss.base/trunk/kss/base/templates/plugin/README.txt_tmpl (contents, props changed) kukit/kss.base/trunk/kss/base/templates/plugin/ez_setup/ kukit/kss.base/trunk/kss/base/templates/plugin/ez_setup/README.txt (contents, props changed) kukit/kss.base/trunk/kss/base/templates/plugin/ez_setup/__init__.py (contents, props changed) kukit/kss.base/trunk/kss/base/templates/plugin/setup.py_tmpl (contents, props changed) Modified: kukit/kss.base/trunk/kss/base/utils.py kukit/kss.base/trunk/setup.py Log: Added template for creating plugins (uses Paster). Added: kukit/kss.base/trunk/kss/base/templates/__init__.py ============================================================================== Added: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/README.txt_tmpl ============================================================================== --- (empty file) +++ kukit/kss.base/trunk/kss/base/templates/plugin/+package+/README.txt_tmpl Thu Sep 13 22:00:04 2007 @@ -0,0 +1,29 @@ +================================================ +${project.center(48)} +================================================ + +Explain a bit a about your project here. + +Command sets +============ + +Describe the commandsets you provide with examples of how to use +it. The examples will be run as part of the tests. + + >>> from kss.base import KSSCommands, load_plugins + + >>> load_plugins('kss-core') + + >>> from kss.base.selectors import CSS + + >>> from {package}.commands import ${package.capitalize()}Commands + + >>> commands = KSSCommands() + >>> ${package} = ${package.capitalize()}Commands(commands) + +Add explanations and tests for your actions here. + + >>> ${package}.replaceInnerHTML(CSS('#someid'), 'example data') + >>> print commands.render() + yourAction(css('#someid'), parameter='example data') + Added: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/__init__.py_tmpl ============================================================================== --- (empty file) +++ kukit/kss.base/trunk/kss/base/templates/plugin/+package+/__init__.py_tmpl Thu Sep 13 22:00:04 2007 @@ -0,0 +1,8 @@ +""" +${package} + +This file loads the finished app from ${package}.config.middleware. + +""" + +from ${package}.wsgiapp import make_app Added: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/commands.py_tmpl ============================================================================== --- (empty file) +++ kukit/kss.base/trunk/kss/base/templates/plugin/+package+/commands.py_tmpl Thu Sep 13 22:00:04 2007 @@ -0,0 +1,8 @@ +from kss.base.commands import KSSCommandSet + +class ${package.capitalize()}Commands(KSSCommandSet): + + # Add your own actions here, you can use the following code as + # a starting point + def yourAction(self, selector, value): + self.commands.add('yourAction', selector, parameter=value) Added: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/helpers.py_tmpl ============================================================================== --- (empty file) +++ kukit/kss.base/trunk/kss/base/templates/plugin/+package+/helpers.py_tmpl Thu Sep 13 22:00:04 2007 @@ -0,0 +1,8 @@ +""" +Helper functions + +All names available in this module will be available under the Pylons h object. +""" +from webhelpers import * +from pylons.helpers import log +from pylons.i18n import get_lang, set_lang Added: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js ============================================================================== Added: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/plugin.py_tmpl ============================================================================== --- (empty file) +++ kukit/kss.base/trunk/kss/base/templates/plugin/+package+/plugin.py_tmpl Thu Sep 13 22:00:04 2007 @@ -0,0 +1,24 @@ +import os + +from ${package}.commands import ${package.capitalize()}Commands + +package_dir = os.path.dirname(os.path.abspath(__file__)) +javascript_dir = os.path.join(package_dir, 'javascript') + +class ${package.capitalize()}(Plugin): + + javascripts = [os.path.join(javascript_dir, 'plugin.js')] + + extra_javascripts = [] + + # if you need extra 3rd party Javascript files put them in the 3rd + # party directory and use the line below + # + # extra_javascripts = [] javascripts_from(os.path.join(package_dir, '3rd_party')) + + commandsets = { + '${project}': ${package.capitalize()}Commands, + } + + selectors = [] + Added: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/tests/__init__.py_tmpl ============================================================================== --- (empty file) +++ kukit/kss.base/trunk/kss/base/templates/plugin/+package+/tests/__init__.py_tmpl Thu Sep 13 22:00:04 2007 @@ -0,0 +1,12 @@ +import unittest +import doctest + +def test_suite(): + suite = unittest.TestSuite(( + doctest.DocFileSuite( + 'README.txt', + package='${package}', + optionflags=doctest.ELLIPSIS|doctest.REPORT_ONLY_FIRST_FAILURE, + ), + )) + return suite Added: kukit/kss.base/trunk/kss/base/templates/plugin/README.txt_tmpl ============================================================================== --- (empty file) +++ kukit/kss.base/trunk/kss/base/templates/plugin/README.txt_tmpl Thu Sep 13 22:00:04 2007 @@ -0,0 +1,17 @@ +This file is for you to describe the ${project} plugin. Typically +you would include information such as the information below: + + +Installation and Setup +====================== + +Install ``${project}`` using easy_install:: + + easy_install ${project} + +Documentation +============= + +Where to find documentation on this project? You will usually refer +people to the README.txt and other doctests located in package +(${package}). \ No newline at end of file Added: kukit/kss.base/trunk/kss/base/templates/plugin/ez_setup/README.txt ============================================================================== --- (empty file) +++ kukit/kss.base/trunk/kss/base/templates/plugin/ez_setup/README.txt Thu Sep 13 22:00:04 2007 @@ -0,0 +1,15 @@ +This directory exists so that Subversion-based projects can share a single +copy of the ``ez_setup`` bootstrap module for ``setuptools``, and have it +automatically updated in their projects when ``setuptools`` is updated. + +For your convenience, you may use the following svn:externals definition:: + + ez_setup svn://svn.eby-sarna.com/svnroot/ez_setup + +You can set this by executing this command in your project directory:: + + svn propedit svn:externals . + +And then adding the line shown above to the file that comes up for editing. +Then, whenever you update your project, ``ez_setup`` will be updated as well. + Added: kukit/kss.base/trunk/kss/base/templates/plugin/ez_setup/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.base/trunk/kss/base/templates/plugin/ez_setup/__init__.py Thu Sep 13 22:00:04 2007 @@ -0,0 +1,228 @@ +#!python +"""Bootstrap setuptools installation + +If you want to use setuptools in your package's setup.py, just include this +file in the same directory with it, and add this to the top of your setup.py:: + + from ez_setup import use_setuptools + use_setuptools() + +If you want to require a specific version of setuptools, set a download +mirror, or use an alternate download directory, you can do so by supplying +the appropriate options to ``use_setuptools()``. + +This file can also be run as a script to install or upgrade setuptools. +""" +import sys +DEFAULT_VERSION = "0.6c5" +DEFAULT_URL = "http://cheeseshop.python.org/packages/%s/s/setuptools/" % sys.version[:3] + +md5_data = { + 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca', + 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb', + 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b', + 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a', + 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618', + 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac', + 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5', + 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4', + 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c', + 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b', + 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27', + 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277', + 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa', + 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e', + 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e', + 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f', + 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2', + 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc', + 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167', + 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64', + 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d', +} + +import sys, os + +def _validate_md5(egg_name, data): + if egg_name in md5_data: + from md5 import md5 + digest = md5(data).hexdigest() + if digest != md5_data[egg_name]: + print >>sys.stderr, ( + "md5 validation of %s failed! (Possible download problem?)" + % egg_name + ) + sys.exit(2) + return data + + +def use_setuptools( + version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, + download_delay=15 +): + """Automatically find/download setuptools and make it available on sys.path + + `version` should be a valid setuptools version number that is available + as an egg for download under the `download_base` URL (which should end with + a '/'). `to_dir` is the directory where setuptools will be downloaded, if + it is not already available. If `download_delay` is specified, it should + be the number of seconds that will be paused before initiating a download, + should one be required. If an older version of setuptools is installed, + this routine will print a message to ``sys.stderr`` and raise SystemExit in + an attempt to abort the calling script. + """ + try: + import setuptools + if setuptools.__version__ == '0.0.1': + print >>sys.stderr, ( + "You have an obsolete version of setuptools installed. Please\n" + "remove it from your system entirely before rerunning this script." + ) + sys.exit(2) + except ImportError: + egg = download_setuptools(version, download_base, to_dir, download_delay) + sys.path.insert(0, egg) + import setuptools; setuptools.bootstrap_install_from = egg + + import pkg_resources + try: + pkg_resources.require("setuptools>="+version) + + except pkg_resources.VersionConflict, e: + # XXX could we install in a subprocess here? + print >>sys.stderr, ( + "The required version of setuptools (>=%s) is not available, and\n" + "can't be installed while this script is running. Please install\n" + " a more recent version first.\n\n(Currently using %r)" + ) % (version, e.args[0]) + sys.exit(2) + +def download_setuptools( + version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, + delay = 15 +): + """Download setuptools from a specified location and return its filename + + `version` should be a valid setuptools version number that is available + as an egg for download under the `download_base` URL (which should end + with a '/'). `to_dir` is the directory where the egg will be downloaded. + `delay` is the number of seconds to pause before an actual download attempt. + """ + import urllib2, shutil + egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) + url = download_base + egg_name + saveto = os.path.join(to_dir, egg_name) + src = dst = None + if not os.path.exists(saveto): # Avoid repeated downloads + try: + from distutils import log + if delay: + log.warn(""" +--------------------------------------------------------------------------- +This script requires setuptools version %s to run (even to display +help). I will attempt to download it for you (from +%s), but +you may need to enable firewall access for this script first. +I will start the download in %d seconds. + +(Note: if this machine does not have network access, please obtain the file + + %s + +and place it in this directory before rerunning this script.) +---------------------------------------------------------------------------""", + version, download_base, delay, url + ); from time import sleep; sleep(delay) + log.warn("Downloading %s", url) + src = urllib2.urlopen(url) + # Read/write all in one block, so we don't create a corrupt file + # if the download is interrupted. + data = _validate_md5(egg_name, src.read()) + dst = open(saveto,"wb"); dst.write(data) + finally: + if src: src.close() + if dst: dst.close() + return os.path.realpath(saveto) + +def main(argv, version=DEFAULT_VERSION): + """Install or upgrade setuptools and EasyInstall""" + + try: + import setuptools + except ImportError: + egg = None + try: + egg = download_setuptools(version, delay=0) + sys.path.insert(0,egg) + from setuptools.command.easy_install import main + return main(list(argv)+[egg]) # we're done here + finally: + if egg and os.path.exists(egg): + os.unlink(egg) + else: + if setuptools.__version__ == '0.0.1': + # tell the user to uninstall obsolete version + use_setuptools(version) + + req = "setuptools>="+version + import pkg_resources + try: + pkg_resources.require(req) + except pkg_resources.VersionConflict: + try: + from setuptools.command.easy_install import main + except ImportError: + from easy_install import main + main(list(argv)+[download_setuptools(delay=0)]) + sys.exit(0) # try to force an exit + else: + if argv: + from setuptools.command.easy_install import main + main(argv) + else: + print "Setuptools version",version,"or greater has been installed." + print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' + + + +def update_md5(filenames): + """Update our built-in md5 registry""" + + import re + from md5 import md5 + + for name in filenames: + base = os.path.basename(name) + f = open(name,'rb') + md5_data[base] = md5(f.read()).hexdigest() + f.close() + + data = [" %r: %r,\n" % it for it in md5_data.items()] + data.sort() + repl = "".join(data) + + import inspect + srcfile = inspect.getsourcefile(sys.modules[__name__]) + f = open(srcfile, 'rb'); src = f.read(); f.close() + + match = re.search("\nmd5_data = {\n([^}]+)}", src) + if not match: + print >>sys.stderr, "Internal error!" + sys.exit(2) + + src = src[:match.start(1)] + repl + src[match.end(1):] + f = open(srcfile,'w') + f.write(src) + f.close() + + +if __name__=='__main__': + if len(sys.argv)>2 and sys.argv[1]=='--md5update': + update_md5(sys.argv[2:]) + else: + main(sys.argv[1:]) + + + + + Added: kukit/kss.base/trunk/kss/base/templates/plugin/setup.py_tmpl ============================================================================== --- (empty file) +++ kukit/kss.base/trunk/kss/base/templates/plugin/setup.py_tmpl Thu Sep 13 22:00:04 2007 @@ -0,0 +1,21 @@ +from ez_setup import use_setuptools +use_setuptools() +from setuptools import setup, find_packages + +setup( + name=${repr(project)|empty}, + version=${repr(version)|empty}, + #description="", + #author="", + #author_email="", + #url="", + install_requires=["kss.base"], + packages=find_packages(), + include_package_data=True, + test_suite = '${package}.tests.test_suite', + entry_points={ + 'kss.plugin': [ + '${project}=${package}.plugin:${package.capitalize()}' + ], + }, +) Modified: kukit/kss.base/trunk/kss/base/utils.py ============================================================================== --- kukit/kss.base/trunk/kss/base/utils.py (original) +++ kukit/kss.base/trunk/kss/base/utils.py Thu Sep 13 22:00:04 2007 @@ -1,5 +1,8 @@ import optparse import ConfigParser + +from paste.script.templates import Template + from kss.base.javascript import packed from kss.base.plugin import load_plugins, activated_plugins @@ -149,3 +152,9 @@ self.writeToFile(self.options.outputFile, javascript) elif not self.options.noDisplayJavascript: print javascript + + +class KSSPluginTemplate(Template): + _template_dir = 'templates/plugin' + summary = 'KSS plugin template' + egg_plugins = ['kss.base'] Modified: kukit/kss.base/trunk/setup.py ============================================================================== --- kukit/kss.base/trunk/setup.py (original) +++ kukit/kss.base/trunk/setup.py Thu Sep 13 22:00:04 2007 @@ -29,6 +29,9 @@ 'kss.plugin': [ 'kss-core=kss.base.plugin:KSSCore' ], + 'paste.paster_create_template': [ + 'kss_plugin=kss.base.utils:KSSPluginTemplate', + ], 'console_scripts': [ 'kssconcatjs=kss.base.utils:KSSConcatJs' ], From jvloothuis at codespeak.net Fri Sep 14 21:52:14 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Fri, 14 Sep 2007 21:52:14 +0200 (CEST) Subject: [KSS-checkins] r46592 - kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript Message-ID: <20070914195214.6850480DD@code0.codespeak.net> Author: jvloothuis Date: Fri Sep 14 21:52:12 2007 New Revision: 46592 Added: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js_tmpl Removed: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js Log: Create a template for Javascript plugins. This has example code for the most common use cases. Deleted: /kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js ============================================================================== Added: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js_tmpl ============================================================================== --- (empty file) +++ kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js_tmpl Fri Sep 14 21:52:12 2007 @@ -0,0 +1,95 @@ +/* + +In this file you can put your own custom Javascript. In the following +sections you can find examples on how to create the most common +plugins. + +Lines beginning with `;;;` are automatically stripped when served in +production mode. Put these in front of lines with code like assertions +statements or logging calls. + +*/ + + +// Create the namespace for ${package} +if (typeof(${pacakge}) == 'undefined') { + var ${package} = {}; +} + + +//----------------------------------------------------------- +// Action example +//----------------------------------------------------------- +${package}.actionsGlobalRegistry.register('exampleAction', function (oper) { + // The following is used for logging +;;; oper.componentName = '[exampleAction] action'; + + // Validate the parameters to this action, you can add multiple + // required or optional parameters. Optional parameters will be + // initialized with a default when not passed. + oper.evaluateParameters(['requiredParameter'], + {'optionalParameter': 'default'}); + + // You can get at the node for which this action is executed like + // this. An action is always invoked on a single node. Even when + // it applies to multiple nodes (then it will be invoked multiple + // times on each node). + var node = oper.node; + + // Read a parameter from the parameters + var required = oper.parms.requiredParameter; + + // Add your specific action code here +}); +kukit.commandsGlobalRegistry.registerFromAction( + 'exampleAction', kukit.cr.makeSelectorCommand); + + +//----------------------------------------------------------- +// Value provider +//----------------------------------------------------------- +${package}.ExampleProvider = function() {}; +${package}.ExampleProvider.prototype = { + // The check function is executed during the parsing of KSS. Use + // this to make sure the arguments are correct. + check: function(args) { + // An example of what you could check is the argument length +;;; if (args.length != 2) { + // Raise an error in case something is wrong +;;; throw new Error('exampleProvider provider needs 2 arguments [one, two]'); +;;; } + }, + eval: function(args, node) { + // Return the value which for this provider + return 'example'; + } +}; +kukit.pprovidersGlobalRegistry.register( + 'exampleProvider', ${package}.ExampleProvider); +// The line above registers the value provider under the name +// `exampleProvider` + + + +//----------------------------------------------------------- +// Value provider +//----------------------------------------------------------- +${package}.ExampleEventBinder = function() { + // Add your initialization stuff here + this.exampleVar = {}; +}; + +${package}.ExampleEventBinder.prototype.__bind__ = + function(name, func_to_bind, oper) { + // The following is used for logging +;;; oper.componentName = 'example event binding'; + + // Validate the parameters to this action, you can add multiple + // required or optional parameters. Optional parameters will be + // initialized with a default when not passed. + oper.evaluateParameters(['delay'], {'repeat': 'true'}); + +}; + +kukit.eventsGlobalRegistry.register(null, 'exampleEvent', + ${package}.ExampleEventBinder, '__bind__', null); From gotcha at codespeak.net Sat Sep 15 00:27:23 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Sep 2007 00:27:23 +0200 (CEST) Subject: [KSS-checkins] r46594 - kukit/kukit.js/trunk/kukit Message-ID: <20070914222723.F01FA80CC@code0.codespeak.net> Author: gotcha Date: Sat Sep 15 00:27:23 2007 New Revision: 46594 Modified: kukit/kukit.js/trunk/kukit/actionreg.js Log: closures Modified: kukit/kukit.js/trunk/kukit/actionreg.js ============================================================================== --- kukit/kukit.js/trunk/kukit/actionreg.js (original) +++ kukit/kukit.js/trunk/kukit/actionreg.js Sat Sep 15 00:27:23 2007 @@ -17,56 +17,58 @@ * 02111-1307, USA. */ -kukit.ar = {}; - +kukit.ar = new function() { /// MODULE START + /* * class ActionRegistry * * The local event actions need to be registered here. */ -kukit.ar.ActionRegistry = function () { - this.content = {}; -}; - -kukit.ar.ActionRegistry.prototype.register = function(name, func) { -;;; if (typeof(func) == 'undefined') { -;;; kukit.E = '[func] argument is mandatory when registering an action'; -;;; kukit.E += ' [ActionRegistry.register].'; -;;; throw new Error(kukit.E); -;;; } - if (this.content[name]) { - // Do not allow redefinition -;;; kukit.logError('Error : action [' + name + '] already registered.'); - return; - } - this.content[name] = func; -}; - -kukit.ar.ActionRegistry.prototype.exists = function(name) { - var entry = this.content[name]; - return (typeof(entry) != 'undefined'); -}; - -kukit.ar.ActionRegistry.prototype.get = function(name) { - var func = this.content[name]; - if (! func) { - // not found -;;; kukit.E = 'Error : undefined local action [' + name + '].'; - throw Error(kukit.E); - } - return func; -}; + var ActionRegistry = function () { + this.content = {}; + }; + + ActionRegistry.prototype.register = function(name, func) { +;;; if (typeof(func) == 'undefined') { +;;; kukit.E = '[func] argument is mandatory when registering an action'; +;;; kukit.E += ' [ActionRegistry.register].'; +;;; throw new Error(kukit.E); +;;; } + if (this.content[name]) { + // Do not allow redefinition +;;; kukit.logError('Error : action [' + name + '] already registered.'); + return; + } + this.content[name] = func; + }; + + ActionRegistry.prototype.exists = function(name) { + var entry = this.content[name]; + return (typeof(entry) != 'undefined'); + }; + + ActionRegistry.prototype.get = function(name) { + var func = this.content[name]; + if (! func) { + // not found +;;; kukit.E = 'Error : undefined local action [' + name + '].'; + throw Error(kukit.E); + } + return func; + }; -kukit.actionsGlobalRegistry = new kukit.ar.ActionRegistry(); + kukit.actionsGlobalRegistry = new ActionRegistry(); /* XXX deprecated methods, to be removed asap */ -kukit.ar.actionRegistry = {}; -kukit.ar.actionRegistry.register = function(name, func) { -;;; var msg='Deprecated kukit.ar.actionRegistry.register, use '; -;;; msg += 'kukit.actionsGlobalRegistry.register instead !'; -;;; kukit.logWarning(msg); - kukit.actionsGlobalRegistry.register(name, func); -}; + this.actionRegistry = {}; + this.actionRegistry.register = function(name, func) { +;;; var msg='Deprecated kukit.ar.actionRegistry.register, use '; +;;; msg += 'kukit.actionsGlobalRegistry.register instead !'; +;;; kukit.logWarning(msg); + kukit.actionsGlobalRegistry.register(name, func); + }; + +}(); /// MODULE END From gotcha at codespeak.net Sat Sep 15 00:27:53 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Sep 2007 00:27:53 +0200 (CEST) Subject: [KSS-checkins] r46595 - kukit/kukit.js/trunk/kukit Message-ID: <20070914222753.3832A80D6@code0.codespeak.net> Author: gotcha Date: Sat Sep 15 00:27:52 2007 New Revision: 46595 Modified: kukit/kukit.js/trunk/kukit/commandreg.js Log: closures Modified: kukit/kukit.js/trunk/kukit/commandreg.js ============================================================================== --- kukit/kukit.js/trunk/kukit/commandreg.js (original) +++ kukit/kukit.js/trunk/kukit/commandreg.js Sat Sep 15 00:27:52 2007 @@ -19,14 +19,14 @@ /* Command registration */ -kukit.cr = {}; +kukit.cr = new function() { /// MODULE START /* -* class CommandRegistry +* class _CommandRegistry */ -kukit.cr.CommandRegistry = function () { - this.commands = {}; -}; + var _CommandRegistry = function () { + this.commands = {}; + }; /* * This is the proposed way of registration, as we like all commands to be @@ -42,119 +42,121 @@ * kukit.commandsGlobalRegistry.registerFromAction('replaceInnerHTML', * kukit.cr.makeSelectorCommand); */ -kukit.cr.CommandRegistry.prototype.registerFromAction = - function(srcname, factory, name) { - if (typeof(name) == 'undefined') { - // allows to set a different name as the action name, - // usable for backward - // compatibility setups - name = srcname; - } - // register a given action as a command, using the given vactor - var f = kukit.actionsGlobalRegistry.get(srcname); - factory(name, f); -}; - -kukit.cr.CommandRegistry.prototype.register = function(name, klass) { - if (this.commands[name]) { - // Do not allow redefinition -;;; var msg = 'ValueError : command [' + name + '] is already registered.'; -;;; kukit.logError(msg); - return; + _CommandRegistry.prototype.registerFromAction = + function(srcname, factory, name) { + if (typeof(name) == 'undefined') { + // allows to set a different name as the action name, + // usable for backward + // compatibility setups + name = srcname; } - this.commands[name] = klass; -}; + // register a given action as a command, using the given vactor + var f = kukit.actionsGlobalRegistry.get(srcname); + factory(name, f); + }; + + _CommandRegistry.prototype.register = function(name, klass) { + if (this.commands[name]) { + // Do not allow redefinition +;;; var msg = 'ValueError : command [' + name + '] is already registered.'; +;;; kukit.logError(msg); + return; + } + this.commands[name] = klass; + }; -kukit.cr.CommandRegistry.prototype.get = function(name) { - var klass = this.commands[name]; -;;; if (! klass) { -;;; // not found -;;; var msg = 'ValueError : no command registered under [' + name + '].'; -;;; kukit.logError(msg); -;;; } - return klass; -}; + _CommandRegistry.prototype.get = function(name) { + var klass = this.commands[name]; +;;; if (! klass) { +;;; // not found +;;; var msg = 'ValueError : no command registered under [' + name + '].'; +;;; kukit.logError(msg); +;;; } + return klass; + }; -kukit.commandsGlobalRegistry = new kukit.cr.CommandRegistry(); + kukit.commandsGlobalRegistry = new _CommandRegistry(); /* XXX deprecated methods, to be removed asap */ -kukit.cr.commandRegistry = {}; -kukit.cr.commandRegistry.registerFromAction = function(srcname, factory, name) { -;;; var msg = 'Deprecated kukit.cr.commandRegistry.registerFromAction,'; -;;; msg += ' use kukit.commandsGlobalRegistry.registerFromAction instead! ('; -;;; msg += srcname + ')'; -;;; kukit.logWarning(msg); - kukit.commandsGlobalRegistry.registerFromAction(srcname, factory, name); -}; + this.commandRegistry = {}; + this.commandRegistry.registerFromAction = function(srcname, factory, name) { +;;; var msg = 'Deprecated kukit.cr.commandRegistry.registerFromAction,'; +;;; msg += ' use kukit.commandsGlobalRegistry.registerFromAction instead! ('; +;;; msg += srcname + ')'; +;;; kukit.logWarning(msg); + kukit.commandsGlobalRegistry.registerFromAction(srcname, factory, name); + }; /* Command factories */ -kukit.cr.makeCommand = function(selector, name, type, parms, transport) { - var commandClass = kukit.commandsGlobalRegistry.get(name); - var command = new commandClass(); - command.selector = selector; - command.name = name; - command.selectorType = type; - command.parms = parms; - command.transport = transport; - return command; -}; - -kukit.cr._Command_execute = function(oper) { - var newoper = oper.clone({ - 'parms': this.parms, - 'orignode': oper.node, - 'node': null - }); - this.executeOnScope(newoper); -}; - -kukit.cr._Command_execute_selector = function(oper) { - var selfunc = kukit.selectorTypesGlobalRegistry.get(this.selectorType); - // When applying the selection, the original event target will be used - // as a starting point for the selection. - var nodes = selfunc(this.selector, oper.orignode, {}); -;;; var printType; -;;; if (this.selectorType) { -;;; printType = this.selectorType; -;;; } else { -;;; printType = 'default ('; -;;; printType += kukit.selectorTypesGlobalRegistry.defaultSelectorType; -;;; printType += ')'; -;;; } -;;; var msg = 'Selector type [' + printType + '], selector ['; -;;; msg += this.selector + '], selected nodes [' + nodes.length + '].'; -;;; kukit.logDebug(msg); -;;; if (!nodes || nodes.length == 0) { -;;; kukit.logWarning('Selector found no nodes.'); -;;; } - for (var i=0;i < nodes.length;i++) { - oper.node = nodes[i]; - //XXX error handling for wrong command name -;;; kukit.logDebug('[' + this.name + '] execution.'); - this.executeOnSingleNode(oper); - } -}; - -kukit.cr.makeSelectorCommand = function(name, executeOnSingleNode) { - var commandClass = function() {}; - commandClass.prototype = { - execute: kukit.cr._Command_execute, - executeOnScope: kukit.cr._Command_execute_selector, - executeOnSingleNode: executeOnSingleNode - }; - kukit.commandsGlobalRegistry.register(name, commandClass); -}; - -kukit.cr.makeGlobalCommand = function(name, executeOnce) { - var commandClass = function() {}; - commandClass.prototype = { - execute: kukit.cr._Command_execute, - executeOnScope: executeOnce, - executeOnSingleNode: executeOnce + this.makeCommand = function(selector, name, type, parms, transport) { + var commandClass = kukit.commandsGlobalRegistry.get(name); + var command = new commandClass(); + command.selector = selector; + command.name = name; + command.selectorType = type; + command.parms = parms; + command.transport = transport; + return command; + }; + + var _executeCommand = function(oper) { + var newoper = oper.clone({ + 'parms': this.parms, + 'orignode': oper.node, + 'node': null + }); + this.executeOnScope(newoper); }; - kukit.commandsGlobalRegistry.register(name, commandClass); -}; + + var _executeCommandOnSelector = function(oper) { + var selfunc = kukit.selectorTypesGlobalRegistry.get(this.selectorType); + // When applying the selection, the original event target will be used + // as a starting point for the selection. + var nodes = selfunc(this.selector, oper.orignode, {}); +;;; var printType; +;;; if (this.selectorType) { +;;; printType = this.selectorType; +;;; } else { +;;; printType = 'default ('; +;;; printType += kukit.selectorTypesGlobalRegistry.defaultSelectorType; +;;; printType += ')'; +;;; } +;;; var msg = 'Selector type [' + printType + '], selector ['; +;;; msg += this.selector + '], selected nodes [' + nodes.length + '].'; +;;; kukit.logDebug(msg); +;;; if (!nodes || nodes.length == 0) { +;;; kukit.logWarning('Selector found no nodes.'); +;;; } + for (var i=0;i < nodes.length;i++) { + oper.node = nodes[i]; + //XXX error handling for wrong command name +;;; kukit.logDebug('[' + this.name + '] execution.'); + this.executeOnSingleNode(oper); + } + }; + + this.makeSelectorCommand = function(name, executeOnSingleNode) { + var commandClass = function() {}; + commandClass.prototype = { + execute: _executeCommand, + executeOnScope: _executeCommandOnSelector, + executeOnSingleNode: executeOnSingleNode + }; + kukit.commandsGlobalRegistry.register(name, commandClass); + }; + + this.makeGlobalCommand = function(name, executeOnce) { + var commandClass = function() {}; + commandClass.prototype = { + execute: _executeCommand, + executeOnScope: executeOnce, + executeOnSingleNode: executeOnce + }; + kukit.commandsGlobalRegistry.register(name, commandClass); + }; + +}(); /// MODULE END From gotcha at codespeak.net Sat Sep 15 00:28:34 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Sep 2007 00:28:34 +0200 (CEST) Subject: [KSS-checkins] r46596 - kukit/kukit.js/trunk/kukit Message-ID: <20070914222834.11F0F80D6@code0.codespeak.net> Author: gotcha Date: Sat Sep 15 00:28:33 2007 New Revision: 46596 Modified: kukit/kukit.js/trunk/kukit/commandprocessor.js Log: closures Modified: kukit/kukit.js/trunk/kukit/commandprocessor.js ============================================================================== --- kukit/kukit.js/trunk/kukit/commandprocessor.js (original) +++ kukit/kukit.js/trunk/kukit/commandprocessor.js Sat Sep 15 00:28:33 2007 @@ -17,119 +17,121 @@ * 02111-1307, USA. */ -kukit.cp = {}; +kukit.cp = new function() { /// MODULE START /* * class CommandProcessor */ -kukit.cp.CommandProcessor = function() { - this.commands = new Array(); -}; - -kukit.cp.CommandProcessor.prototype.parseCommands = - function(commands, transport) { -;;; kukit.log('Parsing commands.'); -;;; kukit.logDebug('Number of commands : ' + commands.length + '.'); - for (var y=0;y < commands.length;y++) { - var command = commands[y]; - this.parseCommand(command, transport); - // If we receive an error command, we handle that separately. - // We abort immediately and let the processError handler do its job. - // This means that although no other commands should be in commands, - // we make sure we execute none of them. - var lastcommand = this.commands[this.commands.length-1]; - if (lastcommand.name == 'error') { -;;; throw kukit.err.explicitError(lastcommand); - throw new Error(kukit.E); + this.CommandProcessor = function() { + this.commands = new Array(); + }; + + this.CommandProcessor.prototype.parseCommands = + function(commands, transport) { +;;; kukit.log('Parsing commands.'); +;;; kukit.logDebug('Number of commands : ' + commands.length + '.'); + for (var y=0;y < commands.length;y++) { + var command = commands[y]; + this.parseCommand(command, transport); + // If we receive an error command, we handle that separately. + // We abort immediately and let the processError handler do its job. + // This means that although no other commands should be in commands, + // we make sure we execute none of them. + var lastcommand = this.commands[this.commands.length-1]; + if (lastcommand.name == 'error') { +;;; throw kukit.err.explicitError(lastcommand); + throw new Error(kukit.E); + } } - } -}; + }; -kukit.cp.CommandProcessor.prototype.parseCommand = - function(command, transport) { - var selector = ""; - var params = {}; - var name = ""; - - selector = command.getAttribute("selector"); - name = command.getAttribute("name"); - type = command.getAttribute("selectorType"); - if (name == null) - name = ""; - var childNodes = command.childNodes; - for (var n=0;n < childNodes.length;n++) { - var childNode = childNodes[n]; - if (childNode.nodeType != 1) - continue; - if (childNode.localName) { - // (here tolerate both cases) - if (childNode.localName.toLowerCase() != "param" - && childNode.nodeName.toLowerCase() != "kukit:param") { - throw new Error('Bad payload, expected param'); - } - } else { - //IE does not know DOM2 - if (childNode.nodeName.toLowerCase() != "kukit:param") { - throw new Error('Bad payload, expected kukit:param'); - } - } - data = childNode.getAttribute('name'); - if (data != null) { - // Decide if we have a string or a dom parameter - var childCount = childNode.childNodes.length; - var result; - if (childCount == 0) { - result = ''; + this.CommandProcessor.prototype.parseCommand = + function(command, transport) { + var selector = ""; + var params = {}; + var name = ""; + + selector = command.getAttribute("selector"); + name = command.getAttribute("name"); + type = command.getAttribute("selectorType"); + if (name == null) + name = ""; + var childNodes = command.childNodes; + for (var n=0;n < childNodes.length;n++) { + var childNode = childNodes[n]; + if (childNode.nodeType != 1) + continue; + if (childNode.localName) { + // (here tolerate both cases) + if (childNode.localName.toLowerCase() != "param" + && childNode.nodeName.toLowerCase() != "kukit:param") { + throw new Error('Bad payload, expected param'); + } + } else { + //IE does not know DOM2 + if (childNode.nodeName.toLowerCase() != "kukit:param") { + throw new Error('Bad payload, expected kukit:param'); + } + } + data = childNode.getAttribute('name'); + if (data != null) { + // Decide if we have a string or a dom parameter + var childCount = childNode.childNodes.length; + var result; + if (childCount == 0) { + result = ''; + } else { + // (we do not interpret html inline content any more) + // we have a single text node + // OR + // we have a single CDATA node (HTML parameter CDATA-style) +;;; var isTextNode = childNode.firstChild.nodeType == 3; +;;; var isCData = childNode.firstChild.nodeType == 4; +;;; if (! (childCount == 1 && (isTextNode || isCData))) { +;;; kukit.E = 'Bad payload, expected a text or a CDATA node'; +;;; throw new Error(kukit.E); +;;; } + // we consider this as html payload + // The result is always a string from here. + result = childNode.firstChild.nodeValue; + } + params[data] = result; } else { - // (we do not interpret html inline content any more) - // we have a single text node - // OR - // we have a single CDATA node (HTML parameter CDATA-style) - ;;; var isTextNode = childNode.firstChild.nodeType == 3; - ;;; var isCData = childNode.firstChild.nodeType == 4; - ;;; if (! (childCount == 1 && (isTextNode || isCData))) { - ;;; kukit.E = 'Bad payload, expected a text or a CDATA node'; - ;;; throw new Error(kukit.E); - ;;; } - // we consider this as html payload - // The result is always a string from here. - result = childNode.firstChild.nodeValue; + throw new Error('Bad payload, expected attribute "name"'); } - params[data] = result; - } else { - throw new Error('Bad payload, expected attribute "name"'); } - } - var command = new kukit.cr.makeCommand(selector, name, type, params, - transport); - this.addCommand(command); -}; - -kukit.cp.CommandProcessor.prototype.addCommand = function(command) { - this.commands[this.commands.length] = command; -}; - -kukit.cp.CommandProcessor.prototype.executeCommands = function(oper) { - kukit.engine.beginSetupEventsCollection(); - // node, eventRule, binderInstance are given on oper, in case - // the command was called up from an event - if (typeof(oper) == 'undefined' || oper == null) { - oper = new kukit.op.Oper(); - } - var commands = this.commands; - for (var y=0;y < commands.length;y++) { - var command = commands[y]; -;;; try { - command.execute(oper); -;;; } catch (e) { -;;; if (e.name == 'RuleMergeError' || e.name == 'EventBindError') { -;;; throw(e); -;;; } else { -;;; // augment the error message -;;; throw kukit.err.commandExecutionError(e, command); + var command = new kukit.cr.makeCommand(selector, name, type, params, + transport); + this.addCommand(command); + }; + + this.CommandProcessor.prototype.addCommand = function(command) { + this.commands[this.commands.length] = command; + }; + + this.CommandProcessor.prototype.executeCommands = function(oper) { + kukit.engine.beginSetupEventsCollection(); + // node, eventRule, binderInstance are given on oper, in case + // the command was called up from an event + if (typeof(oper) == 'undefined' || oper == null) { + oper = new kukit.op.Oper(); + } + var commands = this.commands; + for (var y=0;y < commands.length;y++) { + var command = commands[y]; +;;; try { + command.execute(oper); +;;; } catch (e) { +;;; if (e.name == 'RuleMergeError' || e.name == 'EventBindError') { +;;; throw(e); +;;; } else { +;;; // augment the error message +;;; throw kukit.err.commandExecutionError(e, command); +;;; } ;;; } -;;; } - } - kukit.engine.finishSetupEventsCollection(); -}; + } + kukit.engine.finishSetupEventsCollection(); + }; + +}(); /// MODULE END From gotcha at codespeak.net Sat Sep 15 00:28:53 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Sep 2007 00:28:53 +0200 (CEST) Subject: [KSS-checkins] r46597 - kukit/kukit.js/trunk/kukit Message-ID: <20070914222853.6C9DD80DD@code0.codespeak.net> Author: gotcha Date: Sat Sep 15 00:28:53 2007 New Revision: 46597 Modified: kukit/kukit.js/trunk/kukit/dom.js Log: closures Modified: kukit/kukit.js/trunk/kukit/dom.js ============================================================================== --- kukit/kukit.js/trunk/kukit/dom.js (original) +++ kukit/kukit.js/trunk/kukit/dom.js Sat Sep 15 00:28:53 2007 @@ -19,205 +19,197 @@ /* Generic dom helpers */ -kukit.dom = {}; +kukit.dom = new function() { /// MODULE START + + var dom = this; + + this.getPreviousSiblingTag = function(node) { + var toNode = node.previousSibling; + while ((toNode != null) && (toNode.nodeType != 1)) { + toNode = toNode.previousSibling; + } + return toNode; + }; + + this.getNextSiblingTag = function(node) { + var toNode = node.nextSibling; + while ((toNode != null) && (toNode.nodeType != 1)) { + toNode = toNode.nextSibling; + } + return toNode; + }; -kukit.dom.getPreviousSiblingTag = function(node) { - var toNode = node.previousSibling; - while ((toNode != null) && (toNode.nodeType != 1)) { - toNode = toNode.previousSibling; - } - return toNode; -}; - -kukit.dom.getNextSiblingTag = function(node) { - var toNode = node.nextSibling; - while ((toNode != null) && (toNode.nodeType != 1)) { - toNode = toNode.nextSibling; - } - return toNode; -}; - -kukit.dom.insertBefore = function(nodes, parentNode, toNode) { - for(var i=0; i Author: gotcha Date: Sat Sep 15 00:29:26 2007 New Revision: 46598 Modified: kukit/kukit.js/trunk/kukit/eventreg.js Log: fix commanet Modified: kukit/kukit.js/trunk/kukit/eventreg.js ============================================================================== --- kukit/kukit.js/trunk/kukit/eventreg.js (original) +++ kukit/kukit.js/trunk/kukit/eventreg.js Sat Sep 15 00:29:26 2007 @@ -24,7 +24,7 @@ /* * -* class CommandRegistry +* class EventRegistry * * available for plugin registration * From gotcha at codespeak.net Sat Sep 15 00:30:30 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Sep 2007 00:30:30 +0200 (CEST) Subject: [KSS-checkins] r46599 - kukit/kukit.js/trunk/kukit Message-ID: <20070914223030.1C58F80E5@code0.codespeak.net> Author: gotcha Date: Sat Sep 15 00:30:29 2007 New Revision: 46599 Modified: kukit/kukit.js/trunk/kukit/plugin.js Log: change addClass command implementation to use code in dom.js instead of code from Plone Modified: kukit/kukit.js/trunk/kukit/plugin.js ============================================================================== --- kukit/kukit.js/trunk/kukit/plugin.js (original) +++ kukit/kukit.js/trunk/kukit/plugin.js Sat Sep 15 00:30:29 2007 @@ -686,7 +686,7 @@ kukit.actionsGlobalRegistry.register('addClass', function(oper) { ;;; oper.componentName = '[addClass] action'; oper.evaluateParameters(['value'], {}); - addClassName(oper.node, oper.parms.value); + kukit.dom.addClassName(oper.node, oper.parms.value); }); kukit.commandsGlobalRegistry.registerFromAction('addClass', kukit.cr.makeSelectorCommand); @@ -694,7 +694,7 @@ kukit.actionsGlobalRegistry.register('removeClass', function(oper) { ;;; oper.componentName = '[removeClass] action'; oper.evaluateParameters(['value'], {}); - removeClassName(oper.node, oper.parms.value); + kukit.dom.removeClassName(oper.node, oper.parms.value); }); kukit.commandsGlobalRegistry.registerFromAction('removeClass', kukit.cr.makeSelectorCommand); From gotcha at codespeak.net Sat Sep 15 00:36:34 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Sep 2007 00:36:34 +0200 (CEST) Subject: [KSS-checkins] r46600 - kukit/kss.demo/trunk/kss/demo/browser Message-ID: <20070914223634.B8CD980DD@code0.codespeak.net> Author: gotcha Date: Sat Sep 15 00:36:34 2007 New Revision: 46600 Modified: kukit/kss.demo/trunk/kss/demo/browser/header_macros.pt Log: add slots for local css, include base kss by name Modified: kukit/kss.demo/trunk/kss/demo/browser/header_macros.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/header_macros.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/header_macros.pt Sat Sep 15 00:36:34 2007 @@ -1,21 +1,36 @@ - + + + + + + + + + + + + + + + + + + + + + + -

All demos

-

Start logging pane

-

View KSS resource

+ +

header

+

Three autoupdate

Demo

Modified: kukit/kss.demo/trunk/kss/demo/browser/basic_commands.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/basic_commands.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/basic_commands.pt Sat Sep 15 00:39:21 2007 @@ -1,17 +1,14 @@ - + + - - + + - -

All demos

-

Start logging pane

-

View KSS resource

-

Kss mode

+ + +

header

Change tag content

Top div

Modified: kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.pt Sat Sep 15 00:39:21 2007 @@ -1,14 +1,14 @@ - + + - + + + -

All demos

-

Start logging pane

-

View KSS resource

+ +

header

Cancel Submit Click Demo

saved !

Modified: kukit/kss.demo/trunk/kss/demo/browser/commandaction/actions.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/commandaction/actions.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/commandaction/actions.pt Sat Sep 15 00:39:21 2007 @@ -1,22 +1,25 @@ - + + - - - + + + + + + + + - + +

header

+

Core plugins

The core plugins are tested here.

Modified: kukit/kss.demo/trunk/kss/demo/browser/commandaction/focus.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/commandaction/focus.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/commandaction/focus.pt Sat Sep 15 00:39:21 2007 @@ -1,19 +1,15 @@ - + + - + + + - + +

header

+

Focus

We test the focus action/command : it is used to set focus to form widgets.

Modified: kukit/kss.demo/trunk/kss/demo/browser/coreplugin/kss_evt_preventbubbling.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/coreplugin/kss_evt_preventbubbling.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/coreplugin/kss_evt_preventbubbling.pt Sat Sep 15 00:39:21 2007 @@ -1,23 +1,26 @@ - + + - - - - - + + + + + + + + - + + +

header

Kss prevent bubbling demo

This demo shows how a rule can prevent bubbling of an event to its parent nodes

Modified: kukit/kss.demo/trunk/kss/demo/browser/coresyntax/kss_selector_param.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/coresyntax/kss_selector_param.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/coresyntax/kss_selector_param.pt Sat Sep 15 00:39:21 2007 @@ -1,19 +1,14 @@ - + + - + - - + + - + + +

header

Kss selector parameter demo

Modified: kukit/kss.demo/trunk/kss/demo/browser/coresyntax/kss_url_param.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/coresyntax/kss_url_param.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/coresyntax/kss_url_param.pt Sat Sep 15 00:39:21 2007 @@ -1,19 +1,15 @@ - + + - + - + + + + +

header

-

Kss url parameter

Modified: kukit/kss.demo/trunk/kss/demo/browser/draganddrop.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/draganddrop.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/draganddrop.pt Sat Sep 15 00:39:21 2007 @@ -1,42 +1,46 @@ - + + - - - + table.wrapper td.wide div { + margin-right: .5em; + } + table.wrapper td { + vertical-align: top; + } + + + + + -

All demos

-

Start logging pane

-

View KSS resource

+ +

header

Drag and drop

Modified: kukit/kss.demo/trunk/kss/demo/browser/effects.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/effects.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/effects.pt Sat Sep 15 00:39:21 2007 @@ -1,24 +1,29 @@ - + + - - - + + + + + + + + -

All demos

-

Start logging pane

-

View KSS resource

+ +

header

+

Effects

-

Demo

+

Demo

Click here to make me fade
Click here to make me puff
Click here to make me blindup
Modified: kukit/kss.demo/trunk/kss/demo/browser/error_handling.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/error_handling.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/error_handling.pt Sat Sep 15 00:39:21 2007 @@ -1,26 +1,30 @@ - + + - - - - + + + + + + + + + -

All demos

-

Start logging pane

-

View KSS resource

+ +

header

Error handling demo

Modified: kukit/kss.demo/trunk/kss/demo/browser/form_submit.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/form_submit.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/form_submit.pt Sat Sep 15 00:39:21 2007 @@ -1,15 +1,14 @@ - + + - + - + + -

All demos

-

Start logging pane

-

View KSS resource

+ +

header

Form Submit Demo

saved !

Modified: kukit/kss.demo/trunk/kss/demo/browser/html_inserts.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/html_inserts.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/html_inserts.pt Sat Sep 15 00:39:21 2007 @@ -1,32 +1,36 @@ - + + - - - + + + + + + + + - -

All demos

-

Start logging pane

-

View KSS resource

+ +

header

+

HTML insertions (a.k.a. Change tags II.)

  • Modified: kukit/kss.demo/trunk/kss/demo/browser/inline_edit.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/inline_edit.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/inline_edit.pt Sat Sep 15 00:39:21 2007 @@ -1,13 +1,15 @@ - + + - + + + -

    All demos

    -

    Start logging pane

    -

    View KSS resource

    + +

    header

    +

    Instant edit Demo

    Modified: kukit/kss.demo/trunk/kss/demo/browser/kss_demo_index.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/kss_demo_index.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/kss_demo_index.pt Sat Sep 15 00:39:21 2007 @@ -2,9 +2,12 @@ +

    KSS demos

    +

    Kss mode

    • Change tag content
    • Two selects
    • Modified: kukit/kss.demo/trunk/kss/demo/browser/more_selectors.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/more_selectors.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/more_selectors.pt Sat Sep 15 00:39:21 2007 @@ -1,18 +1,23 @@ - + + - - - + + + + + + + + -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      + +

      header

      +

      More complex selectors

      Modified: kukit/kss.demo/trunk/kss/demo/browser/parameterfunction/forms.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/parameterfunction/forms.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/parameterfunction/forms.pt Sat Sep 15 00:39:21 2007 @@ -1,19 +1,15 @@ - + + - + + + -

      + +

      header

      +

      Forms

      We test the parameter functions related to forms : those functions extract values from fields to use them in the kinetic stylesheet.

      Modified: kukit/kss.demo/trunk/kss/demo/browser/preventdefault.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/preventdefault.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/preventdefault.pt Sat Sep 15 00:39:21 2007 @@ -1,19 +1,22 @@ - + + - - - + + + + + + + + -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      + +

      header

      Preventdefault Demo

      Modified: kukit/kss.demo/trunk/kss/demo/browser/selectors/selectors.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/selectors/selectors.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/selectors/selectors.pt Sat Sep 15 00:39:21 2007 @@ -1,22 +1,24 @@ - + + - - - + + + + + + + + -

      + +

      header

      +

      Selectors

      We test the selectors which are used in KSS. The selectors allow you to specify what node to take action on etc.

      Modified: kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.pt Sat Sep 15 00:39:21 2007 @@ -1,13 +1,15 @@ - + + - + + + -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      + +

      header

      +

      Master-slave selects revisited

      Modified: kukit/kss.demo/trunk/kss/demo/browser/two_selects.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/two_selects.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/two_selects.pt Sat Sep 15 00:39:21 2007 @@ -1,13 +1,15 @@ - + + - + + + -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      + +

      header

      +

      Two Selects

      + tal:condition="devel_mode" + value="Switch to production mode." /> + tal:condition="not:devel_mode" + value="Switch to development mode." />
      +

      The cookie is global to the site and may be overridden by a + local utility (eg. ResourceRegistries, in Plone)

      +

      Back

      + From gotcha at codespeak.net Sat Sep 15 00:51:46 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Sep 2007 00:51:46 +0200 (CEST) Subject: [KSS-checkins] r46605 - kukit/kss.demo/trunk/kss/demo/tests/selenium_tests Message-ID: <20070914225146.2425380DD@code0.codespeak.net> Author: gotcha Date: Sat Sep 15 00:51:45 2007 New Revision: 46605 Modified: kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/kss_prevent_bubbling.html Log: test both production and development mode Modified: kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/kss_prevent_bubbling.html ============================================================================== --- kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/kss_prevent_bubbling.html (original) +++ kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/kss_prevent_bubbling.html Sat Sep 15 00:51:45 2007 @@ -13,6 +13,38 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -58,6 +90,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From gotcha at codespeak.net Sat Sep 15 00:51:55 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Sep 2007 00:51:55 +0200 (CEST) Subject: [KSS-checkins] r46606 - kukit/kss.demo/trunk/kss/demo/tests/selenium_tests Message-ID: <20070914225155.C035780DD@code0.codespeak.net> Author: gotcha Date: Sat Sep 15 00:51:55 2007 New Revision: 46606 Modified: kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/basic_commands.html Log: test both production and development mode Modified: kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/basic_commands.html ============================================================================== --- kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/basic_commands.html (original) +++ kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/basic_commands.html Sat Sep 15 00:51:55 2007 @@ -1,22 +1,251 @@ -demo1 +basic_commands
/demo/kss_evt_preventbubbling.html
clickAndWaitlink=Setup
assertTextPresentKss mode setup
clickAndWaitbutton_devel
assertTextPresentdevelopment
clickAndWaitlink=Back
assertTextPresentdevelopment
clickAt css=div#parent-nodeyou clicked the not bubbling A tag, event [click], rule #2, node [A].
clickAndWaitlink=Setup
assertTextPresentKss mode setup
clickAndWaitbutton_prod
assertTextPresentproduction
clickAndWaitlink=Back
assertTextPresentproduction
assertAlertNotPresent
clickAtcss=div#parent-node
assertAlertyou clicked inside the DIV tag
assertAlertNotPresent
clickAtcss=a#bubbling-node
assertAlertyou clicked the bubbling A tag
assertAlertyou clicked inside the DIV tag
assertAlertNotPresent
clickAtcss=a#not-bubbling-node
assertAlertyou clicked the not bubbling A tag
assertAlertNotPresent
- + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + From gotcha at codespeak.net Sat Sep 15 01:03:18 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Sep 2007 01:03:18 +0200 (CEST) Subject: [KSS-checkins] r46607 - kukit/kss.demo/trunk/kss/demo/tests/selenium_tests Message-ID: <20070914230318.3E8D780DD@code0.codespeak.net> Author: gotcha Date: Sat Sep 15 01:03:01 2007 New Revision: 46607 Modified: kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/actions.html Log: test addClass and removeClass; test both production and development mode Modified: kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/actions.html ============================================================================== --- kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/actions.html (original) +++ kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/actions.html Sat Sep 15 01:03:01 2007 @@ -1,18 +1,224 @@ -coreplugin +actions
demo1
basic_commands
open/demo/basic_commands.html/demo/basic_commands.html
clickAndWaitlink=Setup
assertTextPresentKss mode setup
clickAndWaitbutton_devel
assertTextPresentdevelopment
clickAndWaitlink=Back
assertTextPresentdevelopment
assertTextdemoKSS
assertTextcopycopy here
clickchange
waitForElementPresentworkedagain
assertElementPresentworkedagain
assertTextdemoit worked again
clickclear
waitForElementNotPresentworkedagain
assertNotTextdemoit worked again
clickcopyFrom
waitForNotTextcopycopy here
assertNotTextcopycopy here
assertElementNotPresentworkedagain
clickchange
waitForElementPresentworkedagain
assertElementPresentworkedagain
assertNotTextcopyit worked again
clickcopyFrom
waitForTextcopyit worked again
assertTextcopyit worked again
clickclear
waitForNotTextdemoit worked again
assertNotTextdemoit worked again
clickcopyTo
waitForTextdemoit worked again
assertTextdemoit worked again
clickclear
waitForNotTextdemoit worked again
assertNotTextdemoit worked again
clickmoveTo
waitForTextdemoit worked again
assertTextdemoit worked again
assertNotTextcopyit worked again
clickAndWaitlink=Setup
assertTextPresentKss mode setup
clickAndWaitbutton_prod
assertTextPresentproduction
clickAndWaitlink=Back
assertTextPresentproduction
assertText demoKSSKSS
assertText
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -38,7 +244,6 @@ - @@ -74,6 +279,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
coreplugin
actions
open /demo/actions.html
clickAndWaitlink=Setup
assertTextPresentKss mode setup
clickAndWaitbutton_devel
assertTextPresentdevelopment
clickAndWaitlink=Back
assertTextPresentdevelopment
assertAttributetoggleclass-button at classbutton click cursorPointer
clicktoggleclass-button
assertAttributetoggleclass-button at classbutton click cursorPointer selected
clicktoggleclass-button
assertAttributetoggleclass-button at classbutton click cursorPointer
assertAttributeserver-toggleclass-button at classbutton click cursorPointer
clickserver-toggleclass-button
waitForAttributeserver-toggleclass-button at classbutton click cursorPointer selected
assertAttributeserver-toggleclass-button at classbutton click cursorPointer selected
clickserver-toggleclass-button
waitForAttributeserver-toggleclass-button at classbutton click cursorPointer
assertAttributeserver-toggleclass-button at classbutton click cursorPointer
assertAttributeaddclass-button at classbutton click cursorPointer
clickaddclass-button
waitForAttributeaddclass-button at classbutton click cursorPointer selected
assertAttributeaddclass-button at classbutton click cursorPointer selected
assertAttributeserver-addclass-button at classbutton click cursorPointer
clickserver-addclass-button
waitForAttributeserver-addclass-button at classbutton click cursorPointer selected
assertAttributeserver-addclass-button at classbutton click cursorPointer selected
assertAttributeremoveclass-button at classbutton click cursorPointer selected
clickremoveclass-button
waitForAttributeremoveclass-button at classbutton click cursorPointer
assertAttributeremoveclass-button at classbutton click cursorPointer
assertAttributeserver-removeclass-button at classbutton click cursorPointer selected
clickserver-removeclass-button
waitForAttributeserver-removeclass-button at classbutton click cursorPointer
assertAttributeserver-removeclass-button at classbutton click cursorPointer
clickAndWaitlink=Setup
assertTextPresentKss mode setup
clickAndWaitbutton_prod
assertTextPresentproduction
clickAndWaitlink=Back
assertTextPresentproduction
assertAttribute toggleclass-button at classtoggleclass-button at class button click cursorPointer
assertAttribute server-toggleclass-button at classserver-toggleclass-button at class button click cursorPointer
assertAttributetoggleclass-button at classbutton click cursorPointer
clicktoggleclass-button
assertAttributetoggleclass-button at classbutton click cursorPointer selected
clicktoggleclass-button
assertAttributetoggleclass-button at classbutton click cursorPointer
assertAttributeserver-toggleclass-button at classbutton click cursorPointer
clickserver-toggleclass-button
waitForAttributeserver-toggleclass-button at classbutton click cursorPointer selected
assertAttributeserver-toggleclass-button at classbutton click cursorPointer selected
clickserver-toggleclass-button
waitForAttributeserver-toggleclass-button at classbutton click cursorPointer
assertAttributeserver-toggleclass-button at classbutton click cursorPointer
assertAttributeaddclass-button at classbutton click cursorPointer
clickaddclass-button
waitForAttributeaddclass-button at classbutton click cursorPointer selected
assertAttributeaddclass-button at classbutton click cursorPointer selected
assertAttributeserver-addclass-button at classbutton click cursorPointer
clickserver-addclass-button
waitForAttributeserver-addclass-button at classbutton click cursorPointer selected
assertAttributeserver-addclass-button at classbutton click cursorPointer selected
assertAttributeremoveclass-button at classbutton click cursorPointer selected
clickremoveclass-button
waitForAttributeremoveclass-button at classbutton click cursorPointer
assertAttributeremoveclass-button at classbutton click cursorPointer
assertAttributeserver-removeclass-button at classbutton click cursorPointer selected
clickserver-removeclass-button
waitForAttributeserver-removeclass-button at classbutton click cursorPointer
assertAttributeserver-removeclass-button at classbutton click cursorPointer
From gotcha at codespeak.net Sat Sep 15 09:59:15 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Sep 2007 09:59:15 +0200 (CEST) Subject: [KSS-checkins] r46608 - kukit/kukit.js/trunk/kukit Message-ID: <20070915075915.4F07580C4@code0.codespeak.net> Author: gotcha Date: Sat Sep 15 09:59:13 2007 New Revision: 46608 Modified: kukit/kukit.js/trunk/kukit/dom.js Log: use _ in identifiers to mark private api Modified: kukit/kukit.js/trunk/kukit/dom.js ============================================================================== --- kukit/kukit.js/trunk/kukit/dom.js (original) +++ kukit/kukit.js/trunk/kukit/dom.js Sat Sep 15 09:59:13 2007 @@ -84,8 +84,8 @@ * Decide which query to use */ - var USE_BASE2 = (typeof(base2) != 'undefined'); - if (USE_BASE2) { + var _USE_BASE2 = (typeof(base2) != 'undefined'); + if (_USE_BASE2) { ;;; kukit.log('Using cssQuery from base2.'); var _cssQuery = function(selector, inNodes) { // global scope, always. @@ -225,9 +225,9 @@ be getting '' for nonexistent values anyway. */ - var kssAttrNamespace = 'kssattr'; + var _kssAttrNamespace = 'kssattr'; - var getKssClassAttribute = function(node, attrname) { + var _getKssClassAttribute = function(node, attrname) { // Gets a given kss attribute from the class var klass = dom.getAttribute(node, 'class'); var result = null; @@ -237,7 +237,7 @@ var elem = splitclass[i]; var splitelem = elem.split('-', 3); if (splitelem.length == 3 && - splitelem[0] == kssAttrNamespace + splitelem[0] == _kssAttrNamespace && splitelem[1] == attrname) { // Found it. (The last one will be valid, // in case of duplication) @@ -253,21 +253,21 @@ this.getKssAttribute = function(node, attrname) { // Gets a given kss attribute // first from the namespace, then from the class - var fullName = kssAttrNamespace + ':' + attrname; + var fullName = _kssAttrNamespace + ':' + attrname; var result = dom.getAttribute(node, fullName); // XXX if this was '' it is the same as notfound, // so it shadows the class attribute! // This means setting an attribute to '' is the same as deleting it - // at least at the moment if (! result) { - result = getKssClassAttribute(node, attrname); + result = _getKssClassAttribute(node, attrname); } return result; }; this.setKssAttribute = function(node, attrname, value) { // Sets a given kss attribute on the namespace - var fullName = kssAttrNamespace + ':' + attrname; + var fullName = _kssAttrNamespace + ':' + attrname; dom.setAttribute(node, fullName); }; @@ -324,7 +324,7 @@ * Note it's not necessary for the iframe to have the name * attribute since we don't access it from window.frames by name. */ - var getIframeDocument = function(framename) { + var _getIframeDocument = function(framename) { var iframe = document.getElementById(framename); var doc = iframe.contentWindow || iframe.contentDocument; if (doc.document) { @@ -337,7 +337,7 @@ ;;; kukit.logDebug('Is iframe loaded ?'); - var doc = getIframeDocument(this.framename); + var doc = _getIframeDocument(this.framename); // quit if the init function has already been called // XXX I believe we want to call the function too, then @@ -411,14 +411,14 @@ return tags; }; - var hasClassName = function(node, class_name) { + var _hasClassName = function(node, class_name) { return new RegExp('\\b'+class_name+'\\b').test(node.className); }; this.addClassName = function(node, class_name) { if (!node.className) { node.className = class_name; - } else if (!hasClassName(node, class_name)) { + } else if (!_hasClassName(node, class_name)) { var className = node.className+" "+class_name; // cleanup node.className = className.split(/\s+/).join(' '); From reebalazs at codespeak.net Sat Sep 15 11:09:30 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 15 Sep 2007 11:09:30 +0200 (CEST) Subject: [KSS-checkins] r46612 - kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript Message-ID: <20070915090930.BA3B580C6@code0.codespeak.net> Author: reebalazs Date: Sat Sep 15 11:09:30 2007 New Revision: 46612 Modified: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js_tmpl Log: Enhancements on plugin.js in the plugin skeleton Modified: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js_tmpl ============================================================================== --- kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js_tmpl (original) +++ kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js_tmpl Sat Sep 15 11:09:30 2007 @@ -6,23 +6,22 @@ Lines beginning with `;;;` are automatically stripped when served in production mode. Put these in front of lines with code like assertions -statements or logging calls. +statements or logging calls. (But never put ;;; embedded inside multiline +(), [] or {} constructs like an "if" condition or a "switch" statement.) */ - -// Create the namespace for ${package} -if (typeof(${pacakge}) == 'undefined') { - var ${package} = {}; -} - +// CLOSURE for plugin ${namespace} +// The closure makes all the embedded code private. +function () { +// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------- // Action example //----------------------------------------------------------- -${package}.actionsGlobalRegistry.register('exampleAction', function (oper) { +kukit.actionsGlobalRegistry.register('${namespace}-exampleAction', function (oper) { // The following is used for logging -;;; oper.componentName = '[exampleAction] action'; +;;; oper.componentName = '[${namespace}-exampleAction] action'; // Validate the parameters to this action, you can add multiple // required or optional parameters. Optional parameters will be @@ -30,6 +29,10 @@ oper.evaluateParameters(['requiredParameter'], {'optionalParameter': 'default'}); + // optionally, you can check if a parameter is of a given data type, + // and convert to it. + oper.evalBool('requiredParameter'); + // You can get at the node for which this action is executed like // this. An action is always invoked on a single node. Even when // it applies to multiple nodes (then it will be invoked multiple @@ -41,55 +44,75 @@ // Add your specific action code here }); -kukit.commandsGlobalRegistry.registerFromAction( - 'exampleAction', kukit.cr.makeSelectorCommand); +// The line above registers the action under the name +// `${namespace}-exampleAction`. +kukit.commandsGlobalRegistry.registerFromAction( + '${namespace}-exampleAction', kukit.cr.makeSelectorCommand); +// The line above also defines the action as a command +// with selectors. To make a global command that executes +// without a selector, exactly once, use makeGlobalCommand. +// It is a good idea to always make an action into a command as well. //----------------------------------------------------------- // Value provider //----------------------------------------------------------- -${package}.ExampleProvider = function() {}; -${package}.ExampleProvider.prototype = { +var ExampleProvider = function() {}; +ExampleProvider.prototype = { // The check function is executed during the parsing of KSS. Use // this to make sure the arguments are correct. - check: function(args) { - // An example of what you could check is the argument length + // Use ;;; in the beginning of each line in check. +;;; check: function(args) { +;;; // An example of what you could check is the argument length ;;; if (args.length != 2) { - // Raise an error in case something is wrong +;;; // Raise an error in case something is wrong ;;; throw new Error('exampleProvider provider needs 2 arguments [one, two]'); ;;; } - }, +;;; }, eval: function(args, node) { // Return the value which for this provider return 'example'; } }; kukit.pprovidersGlobalRegistry.register( - 'exampleProvider', ${package}.ExampleProvider); + '${namespace}-exampleProvider', ExampleProvider); // The line above registers the value provider under the name -// `exampleProvider` +// `${namespace}-exampleProvider` //----------------------------------------------------------- -// Value provider +// Simple event binder for stateful events //----------------------------------------------------------- -${package}.ExampleEventBinder = function() { + +var ExampleEventBinder = function() { // Add your initialization stuff here this.exampleVar = {}; }; - -${package}.ExampleEventBinder.prototype.__bind__ = +ExampleEventBinder.prototype.__bind__ = function(name, func_to_bind, oper) { // The following is used for logging -;;; oper.componentName = 'example event binding'; +;;; oper.componentName = '[${namespace}-example] event binding'; // Validate the parameters to this action, you can add multiple // required or optional parameters. Optional parameters will be // initialized with a default when not passed. oper.evaluateParameters(['delay'], {'repeat': 'true'}); + // optionally, you can check if a parameter is of a given data type, + // and convert to it. + oper.evalInt('delay'); + oper.evalBool('repeat'); + + // Add your specific event code here }; -kukit.eventsGlobalRegistry.register(null, 'exampleEvent', - ${package}.ExampleEventBinder, '__bind__', null); +kukit.eventsGlobalRegistry.register('${namespace}', 'exampleEvent', + ExampleEventBinder, '__bind__', null); +// The above line registers the ${namespace}-exampleEvent +// with the binder method __bind__. + + +// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +}(); +// END CLOSURE plugin ${namespace} From reebalazs at codespeak.net Sat Sep 15 11:28:04 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 15 Sep 2007 11:28:04 +0200 (CEST) Subject: [KSS-checkins] r46614 - kukit/kss.base/trunk/kss/base/templates/plugin Message-ID: <20070915092804.D115380C6@code0.codespeak.net> Author: reebalazs Date: Sat Sep 15 11:27:51 2007 New Revision: 46614 Modified: kukit/kss.base/trunk/kss/base/templates/plugin/README.txt_tmpl Log: Modify README.txt Modified: kukit/kss.base/trunk/kss/base/templates/plugin/README.txt_tmpl ============================================================================== --- kukit/kss.base/trunk/kss/base/templates/plugin/README.txt_tmpl (original) +++ kukit/kss.base/trunk/kss/base/templates/plugin/README.txt_tmpl Sat Sep 15 11:27:51 2007 @@ -1,6 +1,5 @@ -This file is for you to describe the ${project} plugin. Typically -you would include information such as the information below: +KSS plugin package "${namespace}" Installation and Setup ====================== @@ -14,4 +13,4 @@ Where to find documentation on this project? You will usually refer people to the README.txt and other doctests located in package -(${package}). \ No newline at end of file +(${package}). From gotcha at codespeak.net Sat Sep 15 11:47:01 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Sep 2007 11:47:01 +0200 (CEST) Subject: [KSS-checkins] r46618 - kukit/kukit.js/branch/firekiss Message-ID: <20070915094701.6FBD38097@code0.codespeak.net> Author: gotcha Date: Sat Sep 15 11:46:59 2007 New Revision: 46618 Added: kukit/kukit.js/branch/firekiss/ - copied from r45901, kukit/kukit.js/trunk/ Log: branch for firekiss From reebalazs at codespeak.net Sat Sep 15 11:55:22 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 15 Sep 2007 11:55:22 +0200 (CEST) Subject: [KSS-checkins] r46619 - kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript Message-ID: <20070915095522.BD3E0809F@code0.codespeak.net> Author: reebalazs Date: Sat Sep 15 11:55:22 2007 New Revision: 46619 Modified: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js_tmpl Log: __bind__ -> bind Modified: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js_tmpl ============================================================================== --- kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js_tmpl (original) +++ kukit/kss.base/trunk/kss/base/templates/plugin/+package+/javascript/plugin.js_tmpl Sat Sep 15 11:55:22 2007 @@ -89,7 +89,7 @@ // Add your initialization stuff here this.exampleVar = {}; }; -ExampleEventBinder.prototype.__bind__ = +ExampleEventBinder.prototype.bind = function(name, func_to_bind, oper) { // The following is used for logging ;;; oper.componentName = '[${namespace}-example] event binding'; @@ -108,9 +108,9 @@ }; kukit.eventsGlobalRegistry.register('${namespace}', 'exampleEvent', - ExampleEventBinder, '__bind__', null); + ExampleEventBinder, 'bind', null); // The above line registers the ${namespace}-exampleEvent -// with the binder method __bind__. +// with the binder method bind. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< From jvloothuis at codespeak.net Sat Sep 15 12:08:19 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 15 Sep 2007 12:08:19 +0200 (CEST) Subject: [KSS-checkins] r46624 - in kukit/kss.base/trunk/kss/base/templates/plugin: +package+ . Message-ID: <20070915100819.9CF3F80AE@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 15 12:08:19 2007 New Revision: 46624 Added: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/config.py_tmpl - copied unchanged from r46618, kukit/kss.base/trunk/kss/base/templates/plugin/+package+/plugin.py_tmpl Removed: kukit/kss.base/trunk/kss/base/templates/plugin/+package+/plugin.py_tmpl Modified: kukit/kss.base/trunk/kss/base/templates/plugin/setup.py_tmpl Log: Renamed plugin.py to config.py because it only contains configuration and this names reflects that better Deleted: /kukit/kss.base/trunk/kss/base/templates/plugin/+package+/plugin.py_tmpl ============================================================================== --- /kukit/kss.base/trunk/kss/base/templates/plugin/+package+/plugin.py_tmpl Sat Sep 15 12:08:19 2007 +++ (empty file) @@ -1,24 +0,0 @@ -import os - -from ${package}.commands import ${package.capitalize()}Commands - -package_dir = os.path.dirname(os.path.abspath(__file__)) -javascript_dir = os.path.join(package_dir, 'javascript') - -class ${package.capitalize()}(Plugin): - - javascripts = [os.path.join(javascript_dir, 'plugin.js')] - - extra_javascripts = [] - - # if you need extra 3rd party Javascript files put them in the 3rd - # party directory and use the line below - # - # extra_javascripts = [] javascripts_from(os.path.join(package_dir, '3rd_party')) - - commandsets = { - '${project}': ${package.capitalize()}Commands, - } - - selectors = [] - Modified: kukit/kss.base/trunk/kss/base/templates/plugin/setup.py_tmpl ============================================================================== --- kukit/kss.base/trunk/kss/base/templates/plugin/setup.py_tmpl (original) +++ kukit/kss.base/trunk/kss/base/templates/plugin/setup.py_tmpl Sat Sep 15 12:08:19 2007 @@ -15,7 +15,7 @@ test_suite = '${package}.tests.test_suite', entry_points={ 'kss.plugin': [ - '${project}=${package}.plugin:${package.capitalize()}' + '${project}=${package}.config:${package.capitalize()}' ], }, ) From jvloothuis at codespeak.net Sat Sep 15 12:27:39 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 15 Sep 2007 12:27:39 +0200 (CEST) Subject: [KSS-checkins] r46625 - kukit/buildout Message-ID: <20070915102739.5403880B1@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 15 12:27:39 2007 New Revision: 46625 Added: kukit/buildout/ Log: New home for all buildouts From jvloothuis at codespeak.net Sat Sep 15 12:29:41 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 15 Sep 2007 12:29:41 +0200 (CEST) Subject: [KSS-checkins] r46626 - in kukit: buildout/kss.base kss.base-buildout Message-ID: <20070915102941.21BC680B1@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 15 12:29:30 2007 New Revision: 46626 Added: kukit/buildout/kss.base/ - copied from r46625, kukit/kss.base-buildout/ Removed: kukit/kss.base-buildout/ Log: Moved to cleanup the root From jvloothuis at codespeak.net Sat Sep 15 12:37:59 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 15 Sep 2007 12:37:59 +0200 (CEST) Subject: [KSS-checkins] r46627 - kukit/kss.templates Message-ID: <20070915103759.34F87809D@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 15 12:37:58 2007 New Revision: 46627 Added: kukit/kss.templates/ Log: Templates for use with Paster Script From jvloothuis at codespeak.net Sat Sep 15 12:38:13 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 15 Sep 2007 12:38:13 +0200 (CEST) Subject: [KSS-checkins] r46628 - kukit/kss.templates/trunk Message-ID: <20070915103813.0BCC980AE@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 15 12:38:12 2007 New Revision: 46628 Added: kukit/kss.templates/trunk/ Log: Templates for use with Paster Script From jvloothuis at codespeak.net Sat Sep 15 12:43:32 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 15 Sep 2007 12:43:32 +0200 (CEST) Subject: [KSS-checkins] r46629 - kukit/buildout/kss.templates Message-ID: <20070915104332.35A5F809D@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 15 12:43:31 2007 New Revision: 46629 Added: kukit/buildout/kss.templates/ Log: Buildout for kss.templates From jvloothuis at codespeak.net Sat Sep 15 12:43:42 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 15 Sep 2007 12:43:42 +0200 (CEST) Subject: [KSS-checkins] r46630 - kukit/buildout/kss.templates/trunk Message-ID: <20070915104342.AE53980B1@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 15 12:43:37 2007 New Revision: 46630 Added: kukit/buildout/kss.templates/trunk/ Log: Buildout for kss.templates From jvloothuis at codespeak.net Sat Sep 15 12:46:14 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 15 Sep 2007 12:46:14 +0200 (CEST) Subject: [KSS-checkins] r46631 - in kukit/buildout/kss.templates/trunk: . src Message-ID: <20070915104614.54268809D@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 15 12:46:14 2007 New Revision: 46631 Added: kukit/buildout/kss.templates/trunk/bootstrap.py kukit/buildout/kss.templates/trunk/buildout.cfg kukit/buildout/kss.templates/trunk/src/ (props changed) kukit/buildout/kss.templates/trunk/src/EXTERNALS.txt Log: Start of buildout Added: kukit/buildout/kss.templates/trunk/bootstrap.py ============================================================================== --- (empty file) +++ kukit/buildout/kss.templates/trunk/bootstrap.py Sat Sep 15 12:46:14 2007 @@ -0,0 +1,52 @@ +############################################################################## +# +# Copyright (c) 2006 Zope Corporation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +############################################################################## +"""Bootstrap a buildout-based project + +Simply run this script in a directory containing a buildout.cfg. +The script accepts buildout command-line options, so you can +use the -c option to specify an alternate configuration file. + +$Id$ +""" + +import os, shutil, sys, tempfile, urllib2 + +tmpeggs = tempfile.mkdtemp() + +ez = {} +exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' + ).read() in ez +ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) + +import pkg_resources + +cmd = 'from setuptools.command.easy_install import main; main()' +if sys.platform == 'win32': + cmd = '"%s"' % cmd # work around spawn lamosity on windows + +ws = pkg_resources.working_set +assert os.spawnle( + os.P_WAIT, sys.executable, sys.executable, + '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout', + dict(os.environ, + PYTHONPATH= + ws.find(pkg_resources.Requirement.parse('setuptools')).location + ), + ) == 0 + +ws.add_entry(tmpeggs) +ws.require('zc.buildout') +import zc.buildout.buildout +zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) +shutil.rmtree(tmpeggs) Added: kukit/buildout/kss.templates/trunk/buildout.cfg ============================================================================== --- (empty file) +++ kukit/buildout/kss.templates/trunk/buildout.cfg Sat Sep 15 12:46:14 2007 @@ -0,0 +1,9 @@ +[buildout] +parts = scripts +develop = kss.templates +eggs = PasteScript + +[scripts] +recipe = zc.recipe.egg +eggs = kss.base + PasteScript Added: kukit/buildout/kss.templates/trunk/src/EXTERNALS.txt ============================================================================== --- (empty file) +++ kukit/buildout/kss.templates/trunk/src/EXTERNALS.txt Sat Sep 15 12:46:14 2007 @@ -0,0 +1 @@ +kss.templates http://codespeak.net/svn/kukit/kss.templates/trunk/ From jvloothuis at codespeak.net Sat Sep 15 12:49:09 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 15 Sep 2007 12:49:09 +0200 (CEST) Subject: [KSS-checkins] r46632 - in kukit/kss.templates/trunk: kss kss/templates plugin plugin/+package+ Message-ID: <20070915104909.E665E809D@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 15 12:49:09 2007 New Revision: 46632 Added: kukit/kss.templates/trunk/kss/ kukit/kss.templates/trunk/kss/templates/ kukit/kss.templates/trunk/plugin/ - copied from r46618, kukit/kss.base/trunk/kss/base/templates/plugin/ kukit/kss.templates/trunk/plugin/+package+/config.py_tmpl - copied unchanged from r46624, kukit/kss.base/trunk/kss/base/templates/plugin/+package+/config.py_tmpl kukit/kss.templates/trunk/plugin/setup.py_tmpl - copied unchanged from r46624, kukit/kss.base/trunk/kss/base/templates/plugin/setup.py_tmpl Removed: kukit/kss.templates/trunk/plugin/+package+/plugin.py_tmpl Log: Moving plugin template to kss.templates Deleted: /kukit/kss.base/trunk/kss/base/templates/plugin/+package+/plugin.py_tmpl ============================================================================== --- /kukit/kss.base/trunk/kss/base/templates/plugin/+package+/plugin.py_tmpl Sat Sep 15 12:49:09 2007 +++ (empty file) @@ -1,24 +0,0 @@ -import os - -from ${package}.commands import ${package.capitalize()}Commands - -package_dir = os.path.dirname(os.path.abspath(__file__)) -javascript_dir = os.path.join(package_dir, 'javascript') - -class ${package.capitalize()}(Plugin): - - javascripts = [os.path.join(javascript_dir, 'plugin.js')] - - extra_javascripts = [] - - # if you need extra 3rd party Javascript files put them in the 3rd - # party directory and use the line below - # - # extra_javascripts = [] javascripts_from(os.path.join(package_dir, '3rd_party')) - - commandsets = { - '${project}': ${package.capitalize()}Commands, - } - - selectors = [] - From jvloothuis at codespeak.net Sat Sep 15 13:14:34 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 15 Sep 2007 13:14:34 +0200 (CEST) Subject: [KSS-checkins] r46634 - kukit/buildout/kss.templates/trunk Message-ID: <20070915111434.4580E80B6@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 15 13:14:34 2007 New Revision: 46634 Modified: kukit/buildout/kss.templates/trunk/buildout.cfg Log: First working version Modified: kukit/buildout/kss.templates/trunk/buildout.cfg ============================================================================== --- kukit/buildout/kss.templates/trunk/buildout.cfg (original) +++ kukit/buildout/kss.templates/trunk/buildout.cfg Sat Sep 15 13:14:34 2007 @@ -1,9 +1,9 @@ [buildout] parts = scripts -develop = kss.templates +develop = src/kss.templates eggs = PasteScript [scripts] recipe = zc.recipe.egg -eggs = kss.base +eggs = kss.templates PasteScript From jvloothuis at codespeak.net Sat Sep 15 13:16:16 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 15 Sep 2007 13:16:16 +0200 (CEST) Subject: [KSS-checkins] r46635 - in kukit/kss.templates/trunk: . kss kss/templates kss/templates/plugin plugin Message-ID: <20070915111616.C999E80B6@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 15 13:16:16 2007 New Revision: 46635 Added: kukit/kss.templates/trunk/kss/__init__.py kukit/kss.templates/trunk/kss/templates/__init__.py kukit/kss.templates/trunk/kss/templates/plugin/ - copied from r46632, kukit/kss.templates/trunk/plugin/ kukit/kss.templates/trunk/kss/templates/util.py - copied, changed from r46618, kukit/kss.base/trunk/kss/base/utils.py kukit/kss.templates/trunk/setup.py - copied, changed from r46618, kukit/kss.base/trunk/setup.py Removed: kukit/kss.templates/trunk/plugin/ Log: First working version Added: kukit/kss.templates/trunk/kss/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.templates/trunk/kss/__init__.py Sat Sep 15 13:16:16 2007 @@ -0,0 +1,6 @@ +# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages +try: + __import__('pkg_resources').declare_namespace(__name__) +except ImportError: + from pkgutil import extend_path + __path__ = extend_path(__path__, __name__) Added: kukit/kss.templates/trunk/kss/templates/__init__.py ============================================================================== --- (empty file) +++ kukit/kss.templates/trunk/kss/templates/__init__.py Sat Sep 15 13:16:16 2007 @@ -0,0 +1,6 @@ +# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages +try: + __import__('pkg_resources').declare_namespace(__name__) +except ImportError: + from pkgutil import extend_path + __path__ = extend_path(__path__, __name__) Copied: kukit/kss.templates/trunk/kss/templates/util.py (from r46618, kukit/kss.base/trunk/kss/base/utils.py) ============================================================================== --- kukit/kss.base/trunk/kss/base/utils.py (original) +++ kukit/kss.templates/trunk/kss/templates/util.py Sat Sep 15 13:16:16 2007 @@ -1,160 +1,10 @@ -import optparse -import ConfigParser - -from paste.script.templates import Template - -from kss.base.javascript import packed -from kss.base.plugin import load_plugins, activated_plugins - - -class KSSConcatJs(object): - '''Prints out or saves a packed javascript of loaded plugins''' - - configSection = "KSSConcatJs" - - def __init__(self): - self.getOptions() - if self.options.configFile: - self.getConfig(self.options.configFile) - self.handleCreation() - - - def getOptions(self): - '''Gets the arguments passed to the script (override config)''' - parser = optparse.OptionParser() - - parser.add_option('-m', '--message', - action='store', - dest='message', - help="message (comment) that will be added to the generated javascript") - parser.add_option('--list', - action='store_true', - dest='listPlugins', - help="lists activated plugins") - parser.add_option('--compression-level', - action='store', - dest='compressionLevel', - help="specifies the compression level (devel / stripped / safe / full / safe-devel / full-devel)") - parser.add_option('--plugin', - action='append', - dest='pluginsToHandle', - help="specifies one additional plugin to load; if you want to specify multiple plugins you can do it by calling --plugin multiple times") - parser.add_option('--no-display', - action='store_true', - dest='noDisplayJavascript', - help="avoids the display of resulting javascript in console") - parser.add_option('--output-file', - action='store', - dest='outputFile', - help="outputs the resulting javascript to the specified file") - parser.add_option('--include-extras', - action='store', - dest='includeExtras', - help="specifies if 3rd party javascripts have to be packed too") - parser.add_option('-v', '--verbose', - action='store_true', - dest='verboseMode', - help="verbose mode") - parser.add_option('-F', - action='store', - dest='configFile', - help="loads options from the specified config file") - - options, args = parser.parse_args() - self.options = options - - - def getConfig(self, fileName): - '''Gets the values in config file only if not overrided by argument''' - config = ConfigParser.ConfigParser() - config.read(fileName) - listParameters = ['pluginsToHandle'] - strParameters = ['compressionLevel', \ - 'outputFile'] - boolParameters = ['listPlugins', \ - 'noDisplayJavascript', \ - 'includeExtras', \ - 'verboseMode'] - for param in strParameters: - if not hasattr(self.options, param): - try: - setattr(self.options, \ - param, \ - config.get(self.configSection, param)) - except ConfigParser.NoOptionError: - pass - for param in boolParameters: - if not hasattr(self.options, param): - try: - setattr(self.options, \ - param, \ - config.getboolean(self.configSection, param)) - except ConfigParser.NoOptionError: - pass - for param in listParameters: - #this is a list so the condition doesn't work with hasattr - if not bool(self.options.pluginsToHandle): - try: - paramList = config.get(self.configSection, param).split(' ') - setattr(self.options, \ - param, \ - paramList) - except ConfigParser.NoOptionError: - pass - - - def makeJS(self, compressionLevel=None, includeExtras=False): - '''Returns a compacted javascript generated from loaded javascripts''' - return packed(compressionLevel, include_extras=False) - - - def setComment(self, javascript, message): - '''Add a comment to the generated javascript''' - return "/* %s */\n\n%s" % (message, javascript) - - def writeToFile(self, fileName, fileContent): - '''Writes the packed javascript to file''' - file = open(fileName, 'w') - file.write(fileContent) - file.close() - - - def listPlugins(self): - '''Displays activated plugins''' - if self.options.verboseMode: - print "Activated plugins :" - for id, plugin in activated_plugins(): - print " * %s" % id - else: - for id, plugin in activated_plugins(): - print id - - - def handleCreation(self): - '''Handles the JS creation regarding options and/or config''' - corePlugin = ('kss-core', ) - if self.options.pluginsToHandle: - plugins = tuple(self.options.pluginsToHandle) + corePlugin - else: - plugins = corePlugin - self.loadedPlugins = load_plugins(*plugins) - - if self.options.listPlugins: - self.listPlugins() - - javascript = self.makeJS(self.options.compressionLevel, \ - self.options.includeExtras) - - if self.options.message: - javascript = self.setComment(javascript, self.options.message) - - if self.options.outputFile: - self.writeToFile(self.options.outputFile, javascript) - elif not self.options.noDisplayJavascript: - print javascript - +from paste.script.templates import Template, var class KSSPluginTemplate(Template): - _template_dir = 'templates/plugin' + _template_dir = 'plugin' summary = 'KSS plugin template' - egg_plugins = ['kss.base'] + egg_plugins = ['kss.templates'] + vars = [ + var('namespace', + 'The namespace for your plugin (something like `my-namespace`)'), + ] Copied: kukit/kss.templates/trunk/setup.py (from r46618, kukit/kss.base/trunk/setup.py) ============================================================================== --- kukit/kss.base/trunk/setup.py (original) +++ kukit/kss.templates/trunk/setup.py Sat Sep 15 13:16:16 2007 @@ -3,9 +3,9 @@ version = '0.1' -setup(name='kss.base', +setup(name='kss.templates', version=version, - description="KSS (Kinetic Style Sheets) framework", + description="Templates for creating KSS plugins", long_description="""\ """, # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers @@ -17,7 +17,7 @@ author='KSS Project', author_email='kss-devel at codespeak.net', url='http://kssproject.org', - license='LGPL', + license='GPL', packages=find_packages(exclude=['ez_setup']), namespace_packages=['kss'], include_package_data=True, @@ -26,15 +26,9 @@ 'setuptools', ], entry_points={ - 'kss.plugin': [ - 'kss-core=kss.base.plugin:KSSCore' - ], 'paste.paster_create_template': [ - 'kss_plugin=kss.base.utils:KSSPluginTemplate', - ], - 'console_scripts': [ - 'kssconcatjs=kss.base.utils:KSSConcatJs' + 'kss_plugin=kss.templates.util:KSSPluginTemplate', ], }, - test_suite='kss.base.tests.test_suite', + #test_suite='kss.templates.tests.test_suite', ) From reebalazs at codespeak.net Sat Sep 15 18:11:27 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sat, 15 Sep 2007 18:11:27 +0200 (CEST) Subject: [KSS-checkins] r46645 - kukit/kss.demo/branch/ree-demoload/kss/demo/demo Message-ID: <20070915161127.7D9918097@code0.codespeak.net> Author: reebalazs Date: Sat Sep 15 18:11:26 2007 New Revision: 46645 Added: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py Removed: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/config.py Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml Log: Rename config.py to zopeconfig.py Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/demo/config.py ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/demo/config.py Sat Sep 15 18:11:26 2007 +++ (empty file) @@ -1,32 +0,0 @@ - -from kss.demo.interfaces import IKSSDemoCollection -from kss.demo.registry import KSSDemo -from zope.interface import implements - -class KSSCoreDemos(object): - implements(IKSSDemoCollection) - - demos = ( - KSSDemo('', '', "basic_commands.html", "Change tag content"), - KSSDemo('', '', "two_selects.html", "Two selects"), - KSSDemo('', '', "autoupdate.html", "Auto update"), - KSSDemo('', '', "inline_edit.html", "Inline edit"), - KSSDemo('', '', "cancel_submit.html", "Cancel Submit Click"), - KSSDemo('', '', "tree.html", "Tree"), - KSSDemo('', '', "more_selectors.html", "More complex selectors"), - KSSDemo('', '', "two_select_revisited.html", "Master-slave selects revisited"), - KSSDemo('', '', "form_submit.html", "Form submit"), - KSSDemo('', '', "effects.html", "Effects"), - KSSDemo('', '', "error_handling.html", "Error handling"), - KSSDemo('', '', "preventdefault.html", "Preventdefault (a.k.a. Safari workarounds)"), - KSSDemo('', '', "html_inserts.html", "HTML insertions (Change tag content returns)"), -## KSSDemo('', '', "draganddrop.html", "Scriptaculous drag and drop"), - KSSDemo('', 'Parameter functions', 'pf_forms.html', 'Forms'), - KSSDemo('', 'Selectors', 'selectors.html', 'Parent node selector'), - KSSDemo('', 'Core syntax', "kss_selector_param.html", "Kss selector parameters"), - KSSDemo('', 'Core syntax', "kss_url_param.html", "Kss url parameters"), - KSSDemo('', 'Core plugin', "kss_evt_preventbubbling.html", "Prevent bubbling KSS event parameter"), - KSSDemo('', 'Commands/Actions', "ca_focus.html", "Focus"), - KSSDemo('', 'Commands/Actions', "actions.html", "Toggle case action"), - ) - Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml Sat Sep 15 18:11:26 2007 @@ -20,7 +20,7 @@ Added: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py Sat Sep 15 18:11:26 2007 @@ -0,0 +1,32 @@ + +from kss.demo.interfaces import IKSSDemoCollection +from kss.demo.registry import KSSDemo +from zope.interface import implements + +class KSSCoreDemos(object): + implements(IKSSDemoCollection) + + demos = ( + KSSDemo('', '', "basic_commands.html", "Change tag content"), + KSSDemo('', '', "two_selects.html", "Two selects"), + KSSDemo('', '', "autoupdate.html", "Auto update"), + KSSDemo('', '', "inline_edit.html", "Inline edit"), + KSSDemo('', '', "cancel_submit.html", "Cancel Submit Click"), + KSSDemo('', '', "tree.html", "Tree"), + KSSDemo('', '', "more_selectors.html", "More complex selectors"), + KSSDemo('', '', "two_select_revisited.html", "Master-slave selects revisited"), + KSSDemo('', '', "form_submit.html", "Form submit"), + KSSDemo('', '', "effects.html", "Effects"), + KSSDemo('', '', "error_handling.html", "Error handling"), + KSSDemo('', '', "preventdefault.html", "Preventdefault (a.k.a. Safari workarounds)"), + KSSDemo('', '', "html_inserts.html", "HTML insertions (Change tag content returns)"), +## KSSDemo('', '', "draganddrop.html", "Scriptaculous drag and drop"), + KSSDemo('', 'Parameter functions', 'pf_forms.html', 'Forms'), + KSSDemo('', 'Selectors', 'selectors.html', 'Parent node selector'), + KSSDemo('', 'Core syntax', "kss_selector_param.html", "Kss selector parameters"), + KSSDemo('', 'Core syntax', "kss_url_param.html", "Kss url parameters"), + KSSDemo('', 'Core plugin', "kss_evt_preventbubbling.html", "Prevent bubbling KSS event parameter"), + KSSDemo('', 'Commands/Actions', "ca_focus.html", "Focus"), + KSSDemo('', 'Commands/Actions', "actions.html", "Toggle case action"), + ) + From gotcha at codespeak.net Sat Sep 15 21:39:14 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Sep 2007 21:39:14 +0200 (CEST) Subject: [KSS-checkins] r46655 - kukit/firekiss/trunk/content Message-ID: <20070915193914.82FD080AD@code0.codespeak.net> Author: gotcha Date: Sat Sep 15 21:39:14 2007 New Revision: 46655 Modified: kukit/firekiss/trunk/content/firekiss-panel.js Log: panel with KSS, inspector with Ajax rules, hover on value providers Modified: kukit/firekiss/trunk/content/firekiss-panel.js ============================================================================== --- kukit/firekiss/trunk/content/firekiss-panel.js (original) +++ kukit/firekiss/trunk/content/firekiss-panel.js Sat Sep 15 21:39:14 2007 @@ -68,12 +68,162 @@ // ************************************************************************************************ -function KSSheet(href) { - this.href = href; +/* var KSSPropTag = + DIV({class: "cssProp editGroup", $disabledStyle: "$prop.disabled"}, + SPAN({class: "cssPropName editable"}, "$prop.name"), + SPAN({class: "cssColon"}, ":"), + SPAN({class: "cssPropValue editable"}, "$prop.value$prop.important"), + SPAN({class: "cssSemi"}, ";") + ); */ + +var KSSPropTag = + DIV({class: "cssProp", $disabledStyle: "$prop.disabled", _repObject:"$prop"}, + SPAN({class: "cssPropName"}, "$prop.name"), + SPAN({class: "cssColon"}, ":"), + SPAN({class: "cssPropValue"}, "$prop.value"), + SPAN({class: "cssSemi"}, ";") + ); + +var KSSRuleTag = + TAG("$rule.tag", {rule: "$rule"}); + +var KSSRuleTag = + DIV({class: "cssRule insertInto", _repObject: "$rule.rule.style", + "ruleId": "$rule.id"}, + DIV({class: "cssHead"}, + SPAN({class: "cssSelector"}, "$rule.selector"), " {" + ), + FOR("prop", "$rule.props", + KSSPropTag + ), + DIV({class: "editable insertBefore"}, "}") + ); + +// ************************************************************************************************ + +function KSSProperty(name, value, property, node) { + this.disabled = ''; + this.name = name; + this.value = value + this.property = property; + this.node = node; } + +KSSPropertyRep = domplate(Firebug.Rep, -KSSheet.prototype = { -} +{ + getTooltip: function(property) + { + var value = property.value; + var node = property.node; + var property = property.property; + if (property == null) { + return null; + }; + if (node == null) { + return 'Cannot evaluate [' + value + '].'; + }; + if (property.isMethod) { + return property.pprovider.eval(property.args, node); + }; + }, + + className: "KSSProperty", + + supportsObject: function(object) + { + return object instanceof KSSProperty; + } +}); + +Firebug.registerRep(KSSPropertyRep); + +// ************************************************************************************************ + +function KSSRule(engineRule, node) { + this.style = 'KSSRule.style'; + this.selector = this.computeSelectorText(engineRule.kssSelector); + this.id = 'KSSRule.id'; + this.props = []; + this.computeProperties(engineRule, node); +} + +KSSRule.prototype.computeSelectorText = function(kssSelector) { + var selectorText = kssSelector.css + ':'; + selectorText += this.computeEvent(kssSelector); + return selectorText; +} + +KSSRule.prototype.computeEvent = function(kssSelector) { + var eventName = '' + if (kssSelector.namespace != null) { + eventName += kssSelector.namespace + '-'; + } + eventName += kssSelector.name; + return eventName; +} + +KSSRule.prototype.computeActionType = function(action) { + var actionType = 'unknown'; + if (action.type == 'S') { + actionType = 'server'; + } else if (action.type == 'C') { + actionType = 'client'; + } else if (action.type == 'X') { + actionType = 'cancel'; + } else if (action.type == 'E') { + actionType = 'error'; + } + return actionType; +} + +KSSRule.prototype.computeActionPropertyValue = function(propValue) { + if (propValue.isMethod) { + return this.computeMethodValue(propValue); + } else { + return propValue.txt; + } +} + +KSSRule.prototype.computeMethodValue = function(propValue) { + var method = propValue.methodName + '('; + var parmsCount = propValue.args.length; + for (var i = 0; i < parmsCount; ++i) { + method += propValue.args[i]; + if (i+1 < parmsCount) { + method += ', '; + } + } + method += ')'; + return method; +} + +KSSRule.prototype.computeProperties = function(engineRule, node) { + for (key in engineRule.parms) { + var name = 'evt-' + this.computeEvent(engineRule.kssSelector); + name += '-' + key; + var prop = new KSSProperty(name, engineRule.parms[key], null, node); + this.props.push(prop) + } + for (actionName in engineRule.actions.content) { + var action = engineRule.actions.content[actionName]; + var name = 'action-' + this.computeActionType(action); + var prop = new KSSProperty(name, actionName, null, node); + this.props.push(prop) + for (key in action.parms) { + var name = actionName + '-' + key; + var value = this.computeActionPropertyValue(action.parms[key]); + var prop = new KSSProperty(name, value, action.parms[key], node); + this.props.push(prop) + } + for (key in action.kssParms) { + var name = actionName + '-' + key; + var value = this.computeActionPropertyValue(action.parms[key]); + var prop = new KSSProperty(name, value, action.parms[key], node); + this.props.push(prop) + } + } +} // ************************************************************************************************ @@ -83,8 +233,15 @@ KSSPanel.prototype = domplate(Firebug.Panel, { - kssTag: H1($STR('Kiss')), - name: "kss", + template: domplate( + { + tag: + FOR("rule", "$rules", + KSSRuleTag + ) + }), + + name: "kstylesheet", title: "KSS", kiss: function() @@ -102,37 +259,22 @@ return []; else { - var kineticSheets = - this.context.window.kukit.engine.getRuleSheetLinks(); + var kineticSheets = this.context.window.kukit.engine.getRuleProcessors(); for (var i = 0; i < kineticSheets.length; ++i) - this.addSheet(new KSSheet(kineticSheets[i].href)); + this.kineticSheets.push(kineticSheets[i]); } }, - addSheet: function(sheet) - { - this.kineticSheets.push(sheet); - - /*for (var i = 0; i < sheet.cssRules.length; ++i) - { - var rule = sheet.cssRules[i]; - if (rule instanceof CSSImportRule) - addSheet(rule.styleSheet); - }*/ - }, - - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // extends Panel searchable: true, editable: false, - /*initialize: function() + initialize: function() { Firebug.Panel.initialize.apply(this, arguments); - },*/ + }, show: function(state) @@ -145,7 +287,6 @@ this.panelNode.scrollTop = state.scrollTop; } - this.kss = this.kssTag.replace({}, this.panelNode, this); }, hide: function() @@ -191,14 +332,13 @@ updateLocation: function(kineticSheet) { - /*if (styleSheet.editStyleSheet) - styleSheet = styleSheet.editStyleSheet.sheet; - - var rules = this.getStyleSheetRules(this.context, styleSheet); - if (rules.length) - this.template.tag.replace({rules: rules}, this.panelNode); - else - FirebugReps.Warning.tag.replace({object: "EmptyStyleSheet"}, this.panelNode);*/ + var rules = []; + for (var i = 0; i < kineticSheet.rules.length; ++i) { + var rule = new KSSRule(kineticSheet.rules[i], null); + rules.push({tag: KSSRuleTag, rule: rule, id: rule.id, + selector: rule.selector, props: rule.props}); + } + this.template.tag.replace({rules: rules}, this.panelNode); }, updateSelection: function(object) @@ -230,7 +370,61 @@ }); +// ************************************************************************************************ + +function KSSElementPanel() {} + +KSSElementPanel.prototype = extend(KSSPanel.prototype, +{ + // extends Panel + + template: domplate( + { + tag: + FOR("rule", "$rules", + KSSRuleTag + ), + + noRuleTag: + P('No KSS rules'), + }), + + name: "kss", + title: "Ajax", + parentPanel: "html", + + show: function(state) + { + // Do nothing, and don't call superclass + }, + + supportsObject: function(object) + { + return 1; + //return object instanceof Element ? 1 : 0; + }, + + updateSelection: function(element) + { + + if (element && element.kukitEventRules) { + var rules = []; + for (var i = 0; i < element.kukitEventRules.length; ++i) { + var rule = new KSSRule(element.kukitEventRules[i], element); + rules.push({tag: KSSRuleTag, rule: rule, id: rule.id, + selector: rule.selector, props: rule.props}); + } + this.template.tag.replace({rules: rules}, this.panelNode); + } else { + this.template.noRuleTag.replace({}, this.panelNode); + } + + + }, +}); + Firebug.registerModule(Firebug.Firekiss); Firebug.registerPanel(KSSPanel); +Firebug.registerPanel(KSSElementPanel); }}); From gotcha at codespeak.net Sat Sep 15 21:39:49 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Sep 2007 21:39:49 +0200 (CEST) Subject: [KSS-checkins] r46656 - kukit/kukit.js/branch/firekiss/kukit Message-ID: <20070915193949.AAFE480B3@code0.codespeak.net> Author: gotcha Date: Sat Sep 15 21:39:49 2007 New Revision: 46656 Modified: kukit/kukit.js/branch/firekiss/kukit/eventreg.js kukit/kukit.js/branch/firekiss/kukit/kssparser.js kukit/kukit.js/branch/firekiss/kukit/plugin.js kukit/kukit.js/branch/firekiss/kukit/resourcedata.js Log: changes to cooperate with firekiss at revision 46655 Modified: kukit/kukit.js/branch/firekiss/kukit/eventreg.js ============================================================================== --- kukit/kukit.js/branch/firekiss/kukit/eventreg.js (original) +++ kukit/kukit.js/branch/firekiss/kukit/eventreg.js Sat Sep 15 21:39:49 2007 @@ -572,7 +572,7 @@ }; kukit.er.BinderInfo.prototype.startBindingPhase = function () { - // The bindind phase starts and it has the information for + // The binding phase starts and it has the information for // the currently on-bound events. this.binding = new kukit.er.OperRegistry(); }; Modified: kukit/kukit.js/branch/firekiss/kukit/kssparser.js ============================================================================== --- kukit/kukit.js/branch/firekiss/kukit/kssparser.js (original) +++ kukit/kukit.js/branch/firekiss/kukit/kssparser.js Sat Sep 15 21:39:49 2007 @@ -424,7 +424,7 @@ /* * class PropValueInPseudo * -* PropValue in pseudo must ba single word with no spaces around. +* PropValue in pseudo must be single word with no spaces around. */ kukit.kssp.PropValueInPseudo = kukit.tk.mkParser('propvalue', { "{": 'this.emitAndReturn()', @@ -683,16 +683,6 @@ // Store event rules in the common list for (var i=0; i Author: gotcha Date: Sat Sep 15 22:44:09 2007 New Revision: 46660 Modified: kukit/kukit.js/trunk/kukit/eventreg.js kukit/kukit.js/trunk/kukit/kssparser.js kukit/kukit.js/trunk/kukit/plugin.js kukit/kukit.js/trunk/kukit/resourcedata.js Log: merge 46655:46656 from firekiss branch Modified: kukit/kukit.js/trunk/kukit/eventreg.js ============================================================================== --- kukit/kukit.js/trunk/kukit/eventreg.js (original) +++ kukit/kukit.js/trunk/kukit/eventreg.js Sat Sep 15 22:44:09 2007 @@ -572,7 +572,7 @@ }; kukit.er.BinderInfo.prototype.startBindingPhase = function () { - // The bindind phase starts and it has the information for + // The binding phase starts and it has the information for // the currently on-bound events. this.binding = new kukit.er.OperRegistry(); }; Modified: kukit/kukit.js/trunk/kukit/kssparser.js ============================================================================== --- kukit/kukit.js/trunk/kukit/kssparser.js (original) +++ kukit/kukit.js/trunk/kukit/kssparser.js Sat Sep 15 22:44:09 2007 @@ -456,7 +456,7 @@ /* * class EventValue * -* PropValue in pseudo must ba single word with no spaces around. +* PropValue in pseudo must be single word with no spaces around. */ kukit.kssp.EventValue = kukit.tk.mkParser('propValue', { "{": 'this.emitAndReturn()', @@ -791,17 +791,6 @@ // Store event rules in the common list for (var i=0; i Author: gotcha Date: Sat Sep 15 22:45:56 2007 New Revision: 46661 Modified: kukit/kukit.js/trunk/doc/HISTORY.txt Log: changes Modified: kukit/kukit.js/trunk/doc/HISTORY.txt ============================================================================== --- kukit/kukit.js/trunk/doc/HISTORY.txt (original) +++ kukit/kukit.js/trunk/doc/HISTORY.txt Sat Sep 15 22:45:56 2007 @@ -4,6 +4,9 @@ kukit.js - 1.4dev Unreleased + - Store some data on HTML nodes for FireKiss + [gotcha] + - Enhance javascript exception, they now properly show the place where the exception generated, and also the annotated error reasons of kss. From jvloothuis at codespeak.net Sun Sep 16 10:26:33 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 16 Sep 2007 10:26:33 +0200 (CEST) Subject: [KSS-checkins] r46670 - kukit/buildout/kss.base/trunk Message-ID: <20070916082633.A192B80CE@code0.codespeak.net> Author: jvloothuis Date: Sun Sep 16 10:26:27 2007 New Revision: 46670 Modified: kukit/buildout/kss.base/trunk/buildout.cfg Log: Removed paster because templates have been moved to a different package Modified: kukit/buildout/kss.base/trunk/buildout.cfg ============================================================================== --- kukit/buildout/kss.base/trunk/buildout.cfg (original) +++ kukit/buildout/kss.base/trunk/buildout.cfg Sun Sep 16 10:26:27 2007 @@ -1,7 +1,7 @@ [buildout] parts = test-runner scripts develop = kss.base -eggs = PasteScript +eggs = [test-runner] @@ -12,4 +12,4 @@ [scripts] recipe = zc.recipe.egg eggs = kss.base - PasteScript + From jvloothuis at codespeak.net Sun Sep 16 10:27:19 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 16 Sep 2007 10:27:19 +0200 (CEST) Subject: [KSS-checkins] r46671 - in kukit/kss.base/trunk: . kss/base/templates/plugin Message-ID: <20070916082719.3371480BD@code0.codespeak.net> Author: jvloothuis Date: Sun Sep 16 10:27:18 2007 New Revision: 46671 Removed: kukit/kss.base/trunk/kss/base/templates/plugin/ Modified: kukit/kss.base/trunk/setup.py Log: Moved templates to different kss.templates package Modified: kukit/kss.base/trunk/setup.py ============================================================================== --- kukit/kss.base/trunk/setup.py (original) +++ kukit/kss.base/trunk/setup.py Sun Sep 16 10:27:18 2007 @@ -1,5 +1,4 @@ from setuptools import setup, find_packages -import sys, os version = '0.1' @@ -17,7 +16,7 @@ author='KSS Project', author_email='kss-devel at codespeak.net', url='http://kssproject.org', - license='LGPL', + license='GPL', packages=find_packages(exclude=['ez_setup']), namespace_packages=['kss'], include_package_data=True, @@ -29,9 +28,6 @@ 'kss.plugin': [ 'kss-core=kss.base.plugin:KSSCore' ], - 'paste.paster_create_template': [ - 'kss_plugin=kss.base.utils:KSSPluginTemplate', - ], 'console_scripts': [ 'kssconcatjs=kss.base.utils:KSSConcatJs' ], From jvloothuis at codespeak.net Sun Sep 16 10:28:14 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 16 Sep 2007 10:28:14 +0200 (CEST) Subject: [KSS-checkins] r46672 - kukit/kss.base/trunk/kss/base/templates Message-ID: <20070916082814.EF82D80BD@code0.codespeak.net> Author: jvloothuis Date: Sun Sep 16 10:28:14 2007 New Revision: 46672 Removed: kukit/kss.base/trunk/kss/base/templates/ Log: Removed templates left over folder From reebalazs at codespeak.net Sun Sep 16 13:35:02 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 16 Sep 2007 13:35:02 +0200 (CEST) Subject: [KSS-checkins] r46677 - in kukit/kss.demo/branch/ree-demoload/kss/demo: browser demo Message-ID: <20070916113502.621BA80C7@code0.codespeak.net> Author: reebalazs Date: Sun Sep 16 13:35:01 2007 New Revision: 46677 Added: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/demoview.py - copied unchanged from r46645, kukit/kss.demo/branch/ree-demoload/kss/demo/browser/demoview.py Removed: kukit/kss.demo/branch/ree-demoload/kss/demo/browser/demoview.py Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml Log: Fix relocation that I broke and did not notice Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/browser/demoview.py ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/browser/demoview.py Sun Sep 16 13:35:01 2007 +++ (empty file) @@ -1,200 +0,0 @@ -# Copyright (c) 2005-2007 -# Authors: KSS Project Contributors (see docs/CREDITS.txt) -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -from kss.core import KSSView, force_unicode, KSSExplicitError, kssaction -import datetime - -class KSSDemoView(KSSView): - - def clearDivContent(self): - """ clear div content """ - self.getCommandSet('core').clearChildNodes('div#demo') - return self.render() - - def copyFromDivContent(self): - """ copy div content """ - self.getCommandSet('core').copyChildNodesFrom('div#copy', 'demo') - return self.render() - - def copyToDivContent(self): - """ copy div content """ - self.getCommandSet('core').copyChildNodesTo('div#copy', 'demo') - return self.render() - - def moveToDivContent(self): - """ copy div content """ - self.getCommandSet('core').copyChildNodesTo('div#copy', 'demo') - self.getCommandSet('core').clearChildNodes('div#copy') - return self.render() - - def getDivContent(self): - """ returns div content """ - self.getCommandSet('core').replaceInnerHTML('div#demo', '

it worked

') - self.getCommandSet('core').replaceInnerHTML('div#demo', '

it worked again

') - return self.render() - - def getCorrespondingSelect(self, value): - """ returns select content """ - mapping = {} - mapping['']=[] - mapping['animals']=['dog', 'cat', 'cow'] - mapping['machines']=['computer', 'car', 'airplane'] - # XXX Note that originally we just used replaceInnerHTML to just put - # the options inside the select, however this is principally broken - # on IE due to an IE bug. Microsoft has confirmed the bug but is not - # giving information on whether it has or it will ever be fixed. - # For further info, see http://support.microsoft.com/default.aspx?scid=kb;en-us;276228 - # The current solution, replace the outer node, works solidly. - result = ['') - self.getCommandSet('core').replaceHTML('select#second', ' '.join(result)) - return self.render() - - def getAutoupdateMarkup(self): - """ returns the current time """ - self.getCommandSet('core').replaceInnerHTML('div#update-wrapper', '
') - return self.render() - - def getCurrentTime(self): - """ returns the current time """ - self.getCommandSet('core').replaceInnerHTML('div#update-area', "

%s

" % str(datetime.datetime.now())) - return self.render() - - def getInputField(self, value): - 'Inserts the value as entered into an input field' - # We need to make unicode. But on Z2 we receive utf-8, on Z3 unicode - value = force_unicode(value, 'utf') - self.getCommandSet('core').replaceInnerHTML('div#text', - '
' \ - '' - ) - return self.render() - - def saveText(self, value): - 'Inserts the value to display it on the page' - # We need to make unicode. But on Z2 we receive utf-8, on Z3 unicode - value = force_unicode(value, 'utf') - self.getCommandSet('core').replaceInnerHTML('div#text', value+'') - return self.render() - - def expandSubTree(self, value, xvalue): - 'Expands given subtree' - self.getCommandSet('core').replaceInnerHTML('#text', 'works, expand %s (xhtml attr: %s)' % (value, xvalue)) - return self.render() - - def collapseSubTree(self, value, xvalue): - 'Collapses given subtree' - self.getCommandSet('core').replaceInnerHTML('#text', 'works, collapse %s (xhtml attr: %s)' % (value, xvalue)) - return self.render() - - def cancelSubmitSave(self, text_save): - # We need to make unicode. But on Z2 we receive utf-8, on Z3 unicode - text_save = force_unicode(text_save, 'utf') - self.getCommandSet('core').replaceInnerHTML('div#async', 'Async saved %s' % text_save) - return self.render() - - def removeNodeXpath(self): - # XXX the xpath selector is now moved out of the core, see suppl, product "azaxslt" - sel = self.getSelector('xpath', "//P[@id='xpath']/following-sibling::*[position()=1]") - self.getCommandSet('core').deleteNode(sel) - return self.render() - - def clickedButton(self, id): - 'Show status of the button clicked' - self.getCommandSet('core').replaceInnerHTML('#update-status', "

Button %s clicked. %s

" % (id, datetime.datetime.now())) - return self.render() - - def updateSlaveSelector(self, masterid, value): - """ returns select content """ - mapping = {} - mapping['']=[] - mapping['animals']=['dog', 'cat', 'cow'] - mapping['machines']=['computer', 'car', 'airplane'] - # calculate the slave id - master, _dummy = masterid.split('-') - slaveid = '%s-slave' % master - # make the payload - result = ['') - # XXX See above remark why we need to replace the outer select. - self.getCommandSet('core').replaceHTML('select#%s' % slaveid, ' '.join(result)) - return self.render() - - def formSubmitSave(self, data): - result = ['

Async saved:

'] - for key, value in data.items(): - result.append('' % (key, value)) - result.append('
Name:Value:
%s%s
') - # We need to make unicode. But on Z2 we receive utf-8, on Z3 unicode - retval = force_unicode(''.join(result), 'utf') - self.getCommandSet('core').replaceInnerHTML('div#async', retval) - return self.render() - - def reset(self): - self.getCommandSet('effects').effect('.effects', 'appear') - return self.render() - - @kssaction - def errTest(self, id, act): - if act == 'error': - raise Exception, 'We have an error here.' - elif act == 'explicit': - raise KssExplicitError, 'Explicit error raised.' - elif act == 'empty': - # Just do nothing, we want to return a response with no commands. - # This is valid behaviour, should raise no error, however - # gives a warning in the kukit log. - pass - ## XXX This is commented out by default, but you can try this on your own - ## server, together with the timeout buttons in the page template timeout buttons in the page template. - ## - #elif act == 'timeout': - # # Wait longer then timeout, this is currently 4 s - # time.sleep(6.0); - # # the next reply will never arrive. - # self.replaceInnerHTML('#update-status', u'Timeout response, button %s clicked. %s' % (id, datetime.datetime.now())) - else: - # act = noerror: standard response. - self.getCommandSet('core').replaceInnerHTML('#update-status', u'Normal response, button %s clicked. %s' % (id, datetime.datetime.now())) - return self.render() - - def htmlReplace(self): - """html replace""" - self.getCommandSet('core').replaceHTML('div#frame', '

KSS for a life.

') - return self.render() - - def htmlInsertBefore(self): - """html insert""" - self.getCommandSet('core').insertHTMLBefore('#core', '
KSS for a life. %s
' % (str(datetime.datetime.now()), )) - return self.render() - - def htmlInsertAfter(self): - """html insert""" - self.getCommandSet('core').insertHTMLAfter('#core', '
KSS for a life. %s
' % (str(datetime.datetime.now()), )) - return self.render() - - def htmlInsertAsFirstChild(self): - """html insert""" - self.getCommandSet('core').insertHTMLAsFirstChild('div#frame', '
KSS for a life. %s
' % (str(datetime.datetime.now()), )) - return self.render() - - def htmlInsertAsLastChild(self): - """html insert""" - self.getCommandSet('core').insertHTMLAsLastChild('div#frame', '
KSS for a life. %s
' % (str(datetime.datetime.now()), )) - return self.render() Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml Sun Sep 16 13:35:01 2007 @@ -40,7 +40,7 @@ Author: jvloothuis Date: Sun Sep 16 18:38:56 2007 New Revision: 46678 Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/commands.py_tmpl kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/configure.zcml_tmpl kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/interfaces.py_tmpl Modified: kukit/kss.templates/trunk/kss/templates/util.py Log: Added a new template which should (in the future) work with the current kss.core Modified: kukit/kss.templates/trunk/kss/templates/util.py ============================================================================== --- kukit/kss.templates/trunk/kss/templates/util.py (original) +++ kukit/kss.templates/trunk/kss/templates/util.py Sun Sep 16 18:38:56 2007 @@ -8,3 +8,8 @@ var('namespace', 'The namespace for your plugin (something like `my-namespace`)'), ] + +class KSSZopePluginTemplate(Template): + _template_dir = 'zope_plugin' + summary = 'KSS Zope plugin template' + required_templates = ['kss_plugin'] Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/commands.py_tmpl ============================================================================== --- (empty file) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/commands.py_tmpl Sun Sep 16 18:38:56 2007 @@ -0,0 +1,10 @@ +from kss.core.kssview import CommandSet + +class ${package.capitalize()}Commands(CommandSet): + + # Add your own actions here, you can use the following code as + # a starting point + def yourAction(self, selector, data): + command = self.commands.addCommand('yourAction', selector) + # Repeat for each parameter you need + command.addParam('parameter', data) Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/configure.zcml_tmpl ============================================================================== --- (empty file) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/configure.zcml_tmpl Sun Sep 16 18:38:56 2007 @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/interfaces.py_tmpl ============================================================================== --- (empty file) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/interfaces.py_tmpl Sun Sep 16 18:38:56 2007 @@ -0,0 +1,7 @@ +from zope.interface import Interface + +class I${package.capitalize()}Commands(Interface): + '''Documentation for your command set''' + + def yourAction(selector, data): + '''Documentation on yourAction''' From gotcha at codespeak.net Tue Sep 18 09:25:08 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Tue, 18 Sep 2007 09:25:08 +0200 (CEST) Subject: [KSS-checkins] r46703 - kukit/kukit.js/trunk/kukit Message-ID: <20070918072508.AB9828134@code0.codespeak.net> Author: gotcha Date: Tue Sep 18 09:25:07 2007 New Revision: 46703 Modified: kukit/kukit.js/trunk/kukit/dom.js Log: fix indentation Modified: kukit/kukit.js/trunk/kukit/dom.js ============================================================================== --- kukit/kukit.js/trunk/kukit/dom.js (original) +++ kukit/kukit.js/trunk/kukit/dom.js Tue Sep 18 09:25:07 2007 @@ -21,195 +21,195 @@ kukit.dom = new function() { /// MODULE START - var dom = this; +var dom = this; - this.getPreviousSiblingTag = function(node) { - var toNode = node.previousSibling; - while ((toNode != null) && (toNode.nodeType != 1)) { - toNode = toNode.previousSibling; - } - return toNode; - }; - - this.getNextSiblingTag = function(node) { - var toNode = node.nextSibling; - while ((toNode != null) && (toNode.nodeType != 1)) { - toNode = toNode.nextSibling; - } - return toNode; - }; - - this.insertBefore = function(nodes, parentNode, toNode) { - for(var i=0; i Author: gotcha Date: Tue Sep 18 10:00:23 2007 New Revision: 46706 Modified: kukit/kukit.js/trunk/kukit/dom.js Log: remove a few characters Modified: kukit/kukit.js/trunk/kukit/dom.js ============================================================================== --- kukit/kukit.js/trunk/kukit/dom.js (original) +++ kukit/kukit.js/trunk/kukit/dom.js Tue Sep 18 10:00:23 2007 @@ -23,7 +23,7 @@ var dom = this; -this.getPreviousSiblingTag = function(node) { +dom.getPreviousSiblingTag = function(node) { var toNode = node.previousSibling; while ((toNode != null) && (toNode.nodeType != 1)) { toNode = toNode.previousSibling; @@ -31,7 +31,7 @@ return toNode; }; -this.getNextSiblingTag = function(node) { +dom.getNextSiblingTag = function(node) { var toNode = node.nextSibling; while ((toNode != null) && (toNode.nodeType != 1)) { toNode = toNode.nextSibling; @@ -39,24 +39,24 @@ return toNode; }; -this.insertBefore = function(nodes, parentNode, toNode) { +dom.insertBefore = function(nodes, parentNode, toNode) { for(var i=0; i Author: gotcha Date: Tue Sep 18 10:42:59 2007 New Revision: 46711 Modified: kukit/kukit.js/trunk/kukit/actionreg.js kukit/kukit.js/trunk/kukit/commandprocessor.js kukit/kukit.js/trunk/kukit/commandreg.js Log: fix indentation Modified: kukit/kukit.js/trunk/kukit/actionreg.js ============================================================================== --- kukit/kukit.js/trunk/kukit/actionreg.js (original) +++ kukit/kukit.js/trunk/kukit/actionreg.js Tue Sep 18 10:42:59 2007 @@ -18,57 +18,58 @@ */ kukit.ar = new function() { /// MODULE START + +var ar = this; /* * class ActionRegistry * * The local event actions need to be registered here. */ - var ActionRegistry = function () { - this.content = {}; - }; - - ActionRegistry.prototype.register = function(name, func) { -;;; if (typeof(func) == 'undefined') { -;;; kukit.E = '[func] argument is mandatory when registering an action'; -;;; kukit.E += ' [ActionRegistry.register].'; -;;; throw new Error(kukit.E); -;;; } - if (this.content[name]) { - // Do not allow redefinition -;;; kukit.logError('Error : action [' + name + '] already registered.'); - return; - } - this.content[name] = func; - }; - - ActionRegistry.prototype.exists = function(name) { - var entry = this.content[name]; - return (typeof(entry) != 'undefined'); - }; - - ActionRegistry.prototype.get = function(name) { - var func = this.content[name]; - if (! func) { - // not found -;;; kukit.E = 'Error : undefined local action [' + name + '].'; - throw Error(kukit.E); - } - return func; - }; - - kukit.actionsGlobalRegistry = new ActionRegistry(); +var ActionRegistry = function () { + this.content = {}; +}; + +ActionRegistry.prototype.register = function(name, func) { +;;;if (typeof(func) == 'undefined') { +;;; kukit.E = '[func] argument is mandatory when registering an action'; +;;; kukit.E += ' [ActionRegistry.register].'; +;;; throw new Error(kukit.E); +;;;} + if (this.content[name]) { + // Do not allow redefinition +;;; kukit.logError('Error : action [' + name + '] already registered.'); + return; + } + this.content[name] = func; +}; + +ActionRegistry.prototype.exists = function(name) { + var entry = this.content[name]; + return (typeof(entry) != 'undefined'); +}; + +ActionRegistry.prototype.get = function(name) { + var func = this.content[name]; + if (! func) { + // not found +;;; kukit.E = 'Error : undefined local action [' + name + '].'; + throw Error(kukit.E); + } + return func; +}; +kukit.actionsGlobalRegistry = new ActionRegistry(); /* XXX deprecated methods, to be removed asap */ - this.actionRegistry = {}; - this.actionRegistry.register = function(name, func) { -;;; var msg='Deprecated kukit.ar.actionRegistry.register, use '; -;;; msg += 'kukit.actionsGlobalRegistry.register instead !'; -;;; kukit.logWarning(msg); - kukit.actionsGlobalRegistry.register(name, func); - }; +ar.actionRegistry = {}; +ar.actionRegistry.register = function(name, func) { +;;;var msg='Deprecated kukit.ar.actionRegistry.register, use '; +;;;msg += 'kukit.actionsGlobalRegistry.register instead !'; +;;;kukit.logWarning(msg); + kukit.actionsGlobalRegistry.register(name, func); +}; }(); /// MODULE END Modified: kukit/kukit.js/trunk/kukit/commandprocessor.js ============================================================================== --- kukit/kukit.js/trunk/kukit/commandprocessor.js (original) +++ kukit/kukit.js/trunk/kukit/commandprocessor.js Tue Sep 18 10:42:59 2007 @@ -19,119 +19,121 @@ kukit.cp = new function() { /// MODULE START +var cp = this; + /* * class CommandProcessor */ - this.CommandProcessor = function() { - this.commands = new Array(); - }; - - this.CommandProcessor.prototype.parseCommands = - function(commands, transport) { -;;; kukit.log('Parsing commands.'); -;;; kukit.logDebug('Number of commands : ' + commands.length + '.'); - for (var y=0;y < commands.length;y++) { - var command = commands[y]; - this.parseCommand(command, transport); - // If we receive an error command, we handle that separately. - // We abort immediately and let the processError handler do its job. - // This means that although no other commands should be in commands, - // we make sure we execute none of them. - var lastcommand = this.commands[this.commands.length-1]; - if (lastcommand.name == 'error') { -;;; throw kukit.err.explicitError(lastcommand); - throw new Error(kukit.E); - } +cp.CommandProcessor = function() { + this.commands = new Array(); +}; + +cp.CommandProcessor.prototype.parseCommands = + function(commands, transport) { +;;;kukit.log('Parsing commands.'); +;;;kukit.logDebug('Number of commands : ' + commands.length + '.'); + for (var y=0;y < commands.length;y++) { + var command = commands[y]; + this.parseCommand(command, transport); + // If we receive an error command, we handle that separately. + // We abort immediately and let the processError handler do its job. + // This means that although no other commands should be in commands, + // we make sure we execute none of them. + var lastcommand = this.commands[this.commands.length-1]; + if (lastcommand.name == 'error') { +;;; throw kukit.err.explicitError(lastcommand); + throw new Error(kukit.E); } - }; + } +}; - this.CommandProcessor.prototype.parseCommand = - function(command, transport) { - var selector = ""; - var params = {}; - var name = ""; - - selector = command.getAttribute("selector"); - name = command.getAttribute("name"); - type = command.getAttribute("selectorType"); - if (name == null) - name = ""; - var childNodes = command.childNodes; - for (var n=0;n < childNodes.length;n++) { - var childNode = childNodes[n]; - if (childNode.nodeType != 1) - continue; - if (childNode.localName) { - // (here tolerate both cases) - if (childNode.localName.toLowerCase() != "param" - && childNode.nodeName.toLowerCase() != "kukit:param") { - throw new Error('Bad payload, expected param'); - } - } else { - //IE does not know DOM2 - if (childNode.nodeName.toLowerCase() != "kukit:param") { - throw new Error('Bad payload, expected kukit:param'); - } - } - data = childNode.getAttribute('name'); - if (data != null) { - // Decide if we have a string or a dom parameter - var childCount = childNode.childNodes.length; - var result; - if (childCount == 0) { - result = ''; - } else { - // (we do not interpret html inline content any more) - // we have a single text node - // OR - // we have a single CDATA node (HTML parameter CDATA-style) -;;; var isTextNode = childNode.firstChild.nodeType == 3; -;;; var isCData = childNode.firstChild.nodeType == 4; -;;; if (! (childCount == 1 && (isTextNode || isCData))) { -;;; kukit.E = 'Bad payload, expected a text or a CDATA node'; -;;; throw new Error(kukit.E); -;;; } - // we consider this as html payload - // The result is always a string from here. - result = childNode.firstChild.nodeValue; - } - params[data] = result; +cp.CommandProcessor.prototype.parseCommand = + function(command, transport) { + var selector = ""; + var params = {}; + var name = ""; + + selector = command.getAttribute("selector"); + name = command.getAttribute("name"); + type = command.getAttribute("selectorType"); + if (name == null) + name = ""; + var childNodes = command.childNodes; + for (var n=0;n < childNodes.length;n++) { + var childNode = childNodes[n]; + if (childNode.nodeType != 1) + continue; + if (childNode.localName) { + // (here tolerate both cases) + if (childNode.localName.toLowerCase() != "param" + && childNode.nodeName.toLowerCase() != "kukit:param") { + throw new Error('Bad payload, expected param'); + } + } else { + //IE does not know DOM2 + if (childNode.nodeName.toLowerCase() != "kukit:param") { + throw new Error('Bad payload, expected kukit:param'); + } + } + data = childNode.getAttribute('name'); + if (data != null) { + // Decide if we have a string or a dom parameter + var childCount = childNode.childNodes.length; + var result; + if (childCount == 0) { + result = ''; } else { - throw new Error('Bad payload, expected attribute "name"'); + // (we do not interpret html inline content any more) + // we have a single text node + // OR + // we have a single CDATA node (HTML parameter CDATA-style) +;;; var isTextNode = childNode.firstChild.nodeType == 3; +;;; var isCData = childNode.firstChild.nodeType == 4; +;;; if (! (childCount == 1 && (isTextNode || isCData))) { +;;; kukit.E = 'Bad payload, expected a text or a CDATA node'; +;;; throw new Error(kukit.E); +;;; } + // we consider this as html payload + // The result is always a string from here. + result = childNode.firstChild.nodeValue; } + params[data] = result; + } else { + throw new Error('Bad payload, expected attribute "name"'); } - var command = new kukit.cr.makeCommand(selector, name, type, params, - transport); - this.addCommand(command); - }; - - this.CommandProcessor.prototype.addCommand = function(command) { - this.commands[this.commands.length] = command; - }; - - this.CommandProcessor.prototype.executeCommands = function(oper) { - kukit.engine.beginSetupEventsCollection(); - // node, eventRule, binderInstance are given on oper, in case - // the command was called up from an event - if (typeof(oper) == 'undefined' || oper == null) { - oper = new kukit.op.Oper(); - } - var commands = this.commands; - for (var y=0;y < commands.length;y++) { - var command = commands[y]; -;;; try { - command.execute(oper); -;;; } catch (e) { -;;; if (e.name == 'RuleMergeError' || e.name == 'EventBindError') { -;;; throw(e); -;;; } else { -;;; // augment the error message -;;; throw kukit.err.commandExecutionError(e, command); -;;; } -;;; } - } - kukit.engine.finishSetupEventsCollection(); - }; + } + var command = new kukit.cr.makeCommand(selector, name, type, params, + transport); + this.addCommand(command); +}; + +cp.CommandProcessor.prototype.addCommand = function(command) { + this.commands[this.commands.length] = command; +}; + +cp.CommandProcessor.prototype.executeCommands = function(oper) { + kukit.engine.beginSetupEventsCollection(); + // node, eventRule, binderInstance are given on oper, in case + // the command was called up from an event + if (typeof(oper) == 'undefined' || oper == null) { + oper = new kukit.op.Oper(); + } + var commands = this.commands; + for (var y=0;y < commands.length;y++) { + var command = commands[y]; +;;; try { + command.execute(oper); +;;; } catch (e) { +;;; if (e.name == 'RuleMergeError' || e.name == 'EventBindError') { +;;; throw(e); +;;; } else { +;;; // augment the error message +;;; throw kukit.err.commandExecutionError(e, command); +;;; } +;;; } + } + kukit.engine.finishSetupEventsCollection(); +}; }(); /// MODULE END Modified: kukit/kukit.js/trunk/kukit/commandreg.js ============================================================================== --- kukit/kukit.js/trunk/kukit/commandreg.js (original) +++ kukit/kukit.js/trunk/kukit/commandreg.js Tue Sep 18 10:42:59 2007 @@ -21,12 +21,14 @@ kukit.cr = new function() { /// MODULE START +var cr = this; + /* * class _CommandRegistry */ - var _CommandRegistry = function () { - this.commands = {}; - }; +var _CommandRegistry = function () { + this.commands = {}; +}; /* * This is the proposed way of registration, as we like all commands to be @@ -42,121 +44,121 @@ * kukit.commandsGlobalRegistry.registerFromAction('replaceInnerHTML', * kukit.cr.makeSelectorCommand); */ - _CommandRegistry.prototype.registerFromAction = - function(srcname, factory, name) { - if (typeof(name) == 'undefined') { - // allows to set a different name as the action name, - // usable for backward - // compatibility setups - name = srcname; +_CommandRegistry.prototype.registerFromAction = + function(srcname, factory, name) { + if (typeof(name) == 'undefined') { + // allows to set a different name as the action name, + // usable for backward + // compatibility setups + name = srcname; + } + // register a given action as a command, using the given vactor + var f = kukit.actionsGlobalRegistry.get(srcname); + factory(name, f); +}; + +_CommandRegistry.prototype.register = function(name, klass) { + if (this.commands[name]) { + // Do not allow redefinition +;;; var msg = 'ValueError : command [' + name + '] is already registered.'; +;;; kukit.logError(msg); + return; } - // register a given action as a command, using the given vactor - var f = kukit.actionsGlobalRegistry.get(srcname); - factory(name, f); - }; - - _CommandRegistry.prototype.register = function(name, klass) { - if (this.commands[name]) { - // Do not allow redefinition -;;; var msg = 'ValueError : command [' + name + '] is already registered.'; -;;; kukit.logError(msg); - return; - } - this.commands[name] = klass; - }; + this.commands[name] = klass; +}; - _CommandRegistry.prototype.get = function(name) { - var klass = this.commands[name]; -;;; if (! klass) { -;;; // not found -;;; var msg = 'ValueError : no command registered under [' + name + '].'; -;;; kukit.logError(msg); -;;; } - return klass; - }; +_CommandRegistry.prototype.get = function(name) { + var klass = this.commands[name]; +;;;if (! klass) { +;;; // not found +;;; var msg = 'ValueError : no command registered under [' + name + '].'; +;;; kukit.logError(msg); +;;; } + return klass; +}; - kukit.commandsGlobalRegistry = new _CommandRegistry(); +kukit.commandsGlobalRegistry = new _CommandRegistry(); /* XXX deprecated methods, to be removed asap */ - this.commandRegistry = {}; - this.commandRegistry.registerFromAction = function(srcname, factory, name) { -;;; var msg = 'Deprecated kukit.cr.commandRegistry.registerFromAction,'; -;;; msg += ' use kukit.commandsGlobalRegistry.registerFromAction instead! ('; -;;; msg += srcname + ')'; -;;; kukit.logWarning(msg); - kukit.commandsGlobalRegistry.registerFromAction(srcname, factory, name); - }; +cr.commandRegistry = {}; +cr.commandRegistry.registerFromAction = function(srcname, factory, name) { +;;;var msg = 'Deprecated kukit.cr.commandRegistry.registerFromAction,'; +;;;msg += ' use kukit.commandsGlobalRegistry.registerFromAction instead! ('; +;;;msg += srcname + ')'; +;;;kukit.logWarning(msg); + kukit.commandsGlobalRegistry.registerFromAction(srcname, factory, name); +}; /* Command factories */ - this.makeCommand = function(selector, name, type, parms, transport) { - var commandClass = kukit.commandsGlobalRegistry.get(name); - var command = new commandClass(); - command.selector = selector; - command.name = name; - command.selectorType = type; - command.parms = parms; - command.transport = transport; - return command; - }; - - var _executeCommand = function(oper) { - var newoper = oper.clone({ - 'parms': this.parms, - 'orignode': oper.node, - 'node': null - }); - this.executeOnScope(newoper); - }; - - var _executeCommandOnSelector = function(oper) { - var selfunc = kukit.selectorTypesGlobalRegistry.get(this.selectorType); - // When applying the selection, the original event target will be used - // as a starting point for the selection. - var nodes = selfunc(this.selector, oper.orignode, {}); -;;; var printType; -;;; if (this.selectorType) { -;;; printType = this.selectorType; -;;; } else { -;;; printType = 'default ('; -;;; printType += kukit.selectorTypesGlobalRegistry.defaultSelectorType; -;;; printType += ')'; -;;; } -;;; var msg = 'Selector type [' + printType + '], selector ['; -;;; msg += this.selector + '], selected nodes [' + nodes.length + '].'; -;;; kukit.logDebug(msg); -;;; if (!nodes || nodes.length == 0) { -;;; kukit.logWarning('Selector found no nodes.'); -;;; } - for (var i=0;i < nodes.length;i++) { - oper.node = nodes[i]; - //XXX error handling for wrong command name -;;; kukit.logDebug('[' + this.name + '] execution.'); - this.executeOnSingleNode(oper); - } - }; - - this.makeSelectorCommand = function(name, executeOnSingleNode) { - var commandClass = function() {}; - commandClass.prototype = { - execute: _executeCommand, - executeOnScope: _executeCommandOnSelector, - executeOnSingleNode: executeOnSingleNode - }; - kukit.commandsGlobalRegistry.register(name, commandClass); - }; - - this.makeGlobalCommand = function(name, executeOnce) { - var commandClass = function() {}; - commandClass.prototype = { - execute: _executeCommand, - executeOnScope: executeOnce, - executeOnSingleNode: executeOnce - }; - kukit.commandsGlobalRegistry.register(name, commandClass); +cr.makeCommand = function(selector, name, type, parms, transport) { + var commandClass = kukit.commandsGlobalRegistry.get(name); + var command = new commandClass(); + command.selector = selector; + command.name = name; + command.selectorType = type; + command.parms = parms; + command.transport = transport; + return command; +}; + +var _executeCommand = function(oper) { + var newoper = oper.clone({ + 'parms': this.parms, + 'orignode': oper.node, + 'node': null + }); + this.executeOnScope(newoper); +}; + +var _executeCommandOnSelector = function(oper) { + var selfunc = kukit.selectorTypesGlobalRegistry.get(this.selectorType); + // When applying the selection, the original event target will be used + // as a starting point for the selection. + var nodes = selfunc(this.selector, oper.orignode, {}); +;;;var printType; +;;;if (this.selectorType) { +;;; printType = this.selectorType; +;;;} else { +;;; printType = 'default ('; +;;; printType += kukit.selectorTypesGlobalRegistry.defaultSelectorType; +;;; printType += ')'; +;;;} +;;;var msg = 'Selector type [' + printType + '], selector ['; +;;;msg += this.selector + '], selected nodes [' + nodes.length + '].'; +;;;kukit.logDebug(msg); +;;;if (!nodes || nodes.length == 0) { +;;; kukit.logWarning('Selector found no nodes.'); +;;;} + for (var i=0;i < nodes.length;i++) { + oper.node = nodes[i]; + //XXX error handling for wrong command name +;;; kukit.logDebug('[' + this.name + '] execution.'); + this.executeOnSingleNode(oper); + } +}; + +cr.makeSelectorCommand = function(name, executeOnSingleNode) { + var commandClass = function() {}; + commandClass.prototype = { + execute: _executeCommand, + executeOnScope: _executeCommandOnSelector, + executeOnSingleNode: executeOnSingleNode + }; + kukit.commandsGlobalRegistry.register(name, commandClass); +}; + +cr.makeGlobalCommand = function(name, executeOnce) { + var commandClass = function() {}; + commandClass.prototype = { + execute: _executeCommand, + executeOnScope: executeOnce, + executeOnSingleNode: executeOnce }; + kukit.commandsGlobalRegistry.register(name, commandClass); +}; }(); /// MODULE END From reebalazs at codespeak.net Tue Sep 18 13:57:48 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Tue, 18 Sep 2007 13:57:48 +0200 (CEST) Subject: [KSS-checkins] r46723 - kukit/kss.demo/branch/ree-demoload/kss/demo/demo Message-ID: <20070918115748.427558142@code0.codespeak.net> Author: reebalazs Date: Tue Sep 18 13:57:47 2007 New Revision: 46723 Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py Log: Remove something that I forgot to remove in the previous commit. Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py Tue Sep 18 13:57:47 2007 @@ -45,7 +45,3 @@ selenium_tests = ( KSSSeleniumTestDirectory('selenium_tests'), ) - -# Create the utility. We need this and use "component" in zcml, -# to allow specifying multiple interfaces for the utility. -resource = KSSCoreDemos() From reebalazs at codespeak.net Tue Sep 18 13:56:05 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Tue, 18 Sep 2007 13:56:05 +0200 (CEST) Subject: [KSS-checkins] r46722 - in kukit/kss.demo/branch/ree-demoload/kss/demo: . browser demo demo/selenium_tests selenium_utils tests/selenium_tests Message-ID: <20070918115605.F238C8142@code0.codespeak.net> Author: reebalazs Date: Tue Sep 18 13:56:03 2007 New Revision: 46722 Added: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/ - copied from r46645, kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/ kukit/kss.demo/branch/ree-demoload/kss/demo/resource.py kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/ (props changed) - copied from r46645, kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/ Removed: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/__init__.py kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/createpythontests.py kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/patterns.py.txt kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/selenium.py kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/seleniumtestcase.py kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/actions.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/autopupdate.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/basic_commands.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/ca_focus.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/cancel_submit.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/inline_edit.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/kss_prevent_bubbling.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/kss_selector_param.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/pf_forms.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/preventdefault.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/selectors.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/suite.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/two_select_revisited.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/two_selects.html kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/urlparam.html kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/ Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/browser/configure.zcml kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py kukit/kss.demo/branch/ree-demoload/kss/demo/configure.zcml kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py kukit/kss.demo/branch/ree-demoload/kss/demo/events.py kukit/kss.demo/branch/ree-demoload/kss/demo/interfaces.py kukit/kss.demo/branch/ree-demoload/kss/demo/registry.py kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/createpythontests.py Log: Add selenuim tests to registry With this, the selenium tests are moved to the demos dir. Temporarily, the selenium_utils/createpythontests.py method is disabled: since before porting to kss.base, we have no pythonland registry, we must do it from under zope, by calling .../@@kss_demo_registry_admin/cookSeleniumTests Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/browser/configure.zcml ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/browser/configure.zcml (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/browser/configure.zcml Tue Sep 18 13:56:03 2007 @@ -67,5 +67,14 @@ permission="zope.View" /> + + + Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py Tue Sep 18 13:56:03 2007 @@ -34,3 +34,17 @@ prev_category = category group.append(demo) return demo_groups + +class KSSDemoRegistryAdminView(BrowserView): + """Things that only admin should do""" + + def cookSeleniumTests(self): + """Cook selenium tests + + The *.html tests from each plugin are produced + into the file seltest_all.pty in the directory + of kss.demo.selenium_utils . + """ + registry = getUtility(IKSSDemoRegistry) + registry.cookSeleniumTests() + return "Selenium tests cooked OK. (%i)" % (len(registry.selenium_tests), ) Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/configure.zcml ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/configure.zcml (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/configure.zcml Tue Sep 18 13:56:03 2007 @@ -98,6 +98,7 @@ Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml Tue Sep 18 13:56:03 2007 @@ -21,10 +21,10 @@ - \w*)\}') - -def formatcommand(command, *args): - if not command: - return '' # Change this to raise an exception? - - arguments = [] - for arg in args: - if not arg: - continue - matched = variable_regexp.match(arg) - if matched is None: - arguments.append('"%s"'%arg) - else: - arguments.append("self.getVar('%s')"%matched.group('varname')) - return 'self.%s(%s)' % (command, ', '.join(arguments)) - -htmlparser = HTMLTreeBuilder.TreeBuilder() -tests = [] -for filename in glob.glob('*.html'): - tree = HTMLTreeBuilder.parse(filename) - root = tree.getroot() - - try: - testname = root.find('.//title').text - except AttributeError: - continue - commands = [] - for row in root.findall('.//tbody/tr'): - commands.append(formatcommand(*[td.text for td in row.findall('td')])) - - testfilename = 'seltest_%s.py' % testname - testbody=' def test_%s(self):\n'%testname+' '*8+'\n '.join(commands)+'\n' - tests.append(testbody) - -f = open('seltest_all.py', 'wb') -f.write(template.substitute(dict( - testname=testname, - tests='\n'.join(tests), - ))) -f.close() Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/patterns.py.txt ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/patterns.py.txt Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,23 +0,0 @@ -#header for selenium IDE -#----------------------- -from seleniumtestcase import SeleniumTestCase -import unittest, time - -def getTestClass(): - return ${className} - -class ${className}(SeleniumTestCase): - - def ${methodName}(self): - sel = self.selenium -#footer for selenium IDE -#----------------------- - -def test_suite(): - return unittest.makeSuite(getTestClass()) - -if __name__ == "__main__": - unittest.main() - - -#bin/zopectl test--package-path ~/tmp/kss.selenium/src/kss.demo/kss/demo/tests kss.demo.tests --test-file-pattern=^seltest --tests-pattern=selenium_tests Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/selenium.py ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/selenium.py Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,1405 +0,0 @@ - -""" -Copyright 2006 ThoughtWorks, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" -__docformat__ = "restructuredtext en" - -# This file has been automatically generated via XSL - -import httplib -import urllib -import re - -class selenium: - """ -Defines an object that runs Selenium commands. - - Element Locators - ~~~~~~~~~~~~~~~~ - Element Locators tell Selenium which HTML element a command refers to. - The format of a locator is: - \ *locatorType*\ **=**\ \ *argument* - We support the following strategies for locating elements: - - * \ **identifier**\ =\ *id* - Select the element with the specified @id attribute. If no match is - found, select the first element whose @name attribute is \ *id*. - (This is normally the default; see below.) - * \ **id**\ =\ *id* - Select the element with the specified @id attribute. - * \ **name**\ =\ *name* - Select the first element with the specified @name attribute. - - * username - * name=username - - - - The name may optionally be followed by one or more \ *element-filters*, separated from the name by whitespace. If the \ *filterType* is not specified, \ **value**\ is assumed. - - * name=flavour value=chocolate - - - * \ **dom**\ =\ *javascriptExpression* - - Find an element by evaluating the specified string. This allows you to traverse the HTML Document Object - Model using JavaScript. Note that you must not return a value in this string; simply make it the last expression in the block. - * dom=document.forms['myForm'].myDropdown - * dom=document.images[56] - * dom=function foo() { return document.links[1]; }; foo(); - - - - * \ **xpath**\ =\ *xpathExpression* - Locate an element using an XPath expression. - * xpath=//img[@alt='The image alt text'] - * xpath=//table[@id='table1']//tr[4]/td[2] - - - * \ **link**\ =\ *textPattern* - Select the link (anchor) element which contains text matching the - specified \ *pattern*. - * link=The link text - - - * \ **css**\ =\ *cssSelectorSyntax* - Select the element using css selectors. Please refer to CSS2 selectors, CSS3 selectors for more information. You can also check the TestCssLocators test in the selenium test suite for an example of usage, which is included in the downloaded selenium core package. - * css=a[href="#id3"] - * css=span#firstChild + span - - - - Currently the css selector locator supports all css1, css2 and css3 selectors except namespace in css3, some pseudo classes(:nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :visited, :hover, :active, :focus, :indeterminate) and pseudo elements(::first-line, ::first-letter, ::selection, ::before, ::after). - - - Without an explicit locator prefix, Selenium uses the following default - strategies: - - * \ **dom**\ , for locators starting with "document." - * \ **xpath**\ , for locators starting with "//" - * \ **identifier**\ , otherwise - - Element Filters - ~~~~~~~~~~~~~~~Element filters can be used with a locator to refine a list of candidate elements. They are currently used only in the 'name' element-locator. - Filters look much like locators, ie. - \ *filterType*\ **=**\ \ *argument*Supported element-filters are: - \ **value=**\ \ *valuePattern* - - Matches elements based on their values. This is particularly useful for refining a list of similarly-named toggle-buttons.\ **index=**\ \ *index* - - Selects a single element based on its position in the list (offset from zero).String-match Patterns - ~~~~~~~~~~~~~~~~~~~~~ - Various Pattern syntaxes are available for matching string values: - - * \ **glob:**\ \ *pattern* - Match a string against a "glob" (aka "wildmat") pattern. "Glob" is a - kind of limited regular-expression syntax typically used in command-line - shells. In a glob pattern, "*" represents any sequence of characters, and "?" - represents any single character. Glob patterns match against the entire - string. - * \ **regexp:**\ \ *regexp* - Match a string using a regular-expression. The full power of JavaScript - regular-expressions is available. - * \ **exact:**\ \ *string* - Match a string exactly, verbatim, without any of that fancy wildcard - stuff. - - - If no pattern prefix is specified, Selenium assumes that it's a "glob" - pattern. - - - """ - -### This part is hard-coded in the XSL - def __init__(self, host, port, browserStartCommand, browserURL): - self.host = host - self.port = port - self.browserStartCommand = browserStartCommand - self.browserURL = browserURL - self.sessionId = None - - def start(self): - result = self.get_string("getNewBrowserSession", [self.browserStartCommand, self.browserURL]) - try: - self.sessionId = long(result) - except ValueError: - raise Exception, result - - def stop(self): - self.do_command("testComplete", []) - self.sessionId = None - - def do_command(self, verb, args): - conn = httplib.HTTPConnection(self.host, self.port) - commandString = u'/selenium-server/driver/?cmd=' + urllib.quote_plus(unicode(verb).encode('utf-8')) - for i in range(len(args)): - commandString = commandString + '&' + unicode(i+1) + '=' + urllib.quote_plus(unicode(args[i]).encode('utf-8')) - if (None != self.sessionId): - commandString = commandString + "&sessionId=" + unicode(self.sessionId) - conn.request("GET", commandString) - - response = conn.getresponse() - #print response.status, response.reason - data = unicode(response.read(), "UTF-8") - result = response.reason - #print "Selenium Result: " + repr(data) + "\n\n" - if (not data.startswith('OK')): - raise Exception, data - return data - - def get_string(self, verb, args): - result = self.do_command(verb, args) - return result[3:] - - def get_string_array(self, verb, args): - csv = self.get_string(verb, args) - token = "" - tokens = [] - escape = False - for i in range(len(csv)): - letter = csv[i] - if (escape): - token = token + letter - escape = False - continue - if (letter == '\\'): - escape = True - elif (letter == ','): - tokens.append(token) - token = "" - else: - token = token + letter - tokens.append(token) - return tokens - - def get_number(self, verb, args): - # Is there something I need to do here? - return self.get_string(verb, args) - - def get_number_array(self, verb, args): - # Is there something I need to do here? - return self.get_string_array(verb, args) - - def get_boolean(self, verb, args): - boolstr = self.get_string(verb, args) - if ("true" == boolstr): - return True - if ("false" == boolstr): - return False - raise ValueError, "result is neither 'true' nor 'false': " + boolstr - - def get_boolean_array(self, verb, args): - boolarr = self.get_string_array(verb, args) - for i in range(len(boolarr)): - if ("true" == boolstr): - boolarr[i] = True - continue - if ("false" == boolstr): - boolarr[i] = False - continue - raise ValueError, "result is neither 'true' nor 'false': " + boolarr[i] - return boolarr - - - -### From here on, everything's auto-generated from XML - - - def click(self,locator): - """ - Clicks on a link, button, checkbox or radio button. If the click action - causes a new page to load (like a link usually does), call - waitForPageToLoad. - - 'locator' is an element locator - """ - self.do_command("click", [locator,]) - - - def double_click(self,locator): - """ - Double clicks on a link, button, checkbox or radio button. If the double click action - causes a new page to load (like a link usually does), call - waitForPageToLoad. - - 'locator' is an element locator - """ - self.do_command("doubleClick", [locator,]) - - - def click_at(self,locator,coordString): - """ - Clicks on a link, button, checkbox or radio button. If the click action - causes a new page to load (like a link usually does), call - waitForPageToLoad. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("clickAt", [locator,coordString,]) - - - def double_click_at(self,locator,coordString): - """ - Doubleclicks on a link, button, checkbox or radio button. If the action - causes a new page to load (like a link usually does), call - waitForPageToLoad. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("doubleClickAt", [locator,coordString,]) - - - def fire_event(self,locator,eventName): - """ - Explicitly simulate an event, to trigger the corresponding "on\ *event*" - handler. - - 'locator' is an element locator - 'eventName' is the event name, e.g. "focus" or "blur" - """ - self.do_command("fireEvent", [locator,eventName,]) - - - def key_press(self,locator,keySequence): - """ - Simulates a user pressing and releasing a key. - - 'locator' is an element locator - 'keySequence' is Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119". - """ - self.do_command("keyPress", [locator,keySequence,]) - - - def shift_key_down(self): - """ - Press the shift key and hold it down until doShiftUp() is called or a new page is loaded. - - """ - self.do_command("shiftKeyDown", []) - - - def shift_key_up(self): - """ - Release the shift key. - - """ - self.do_command("shiftKeyUp", []) - - - def meta_key_down(self): - """ - Press the meta key and hold it down until doMetaUp() is called or a new page is loaded. - - """ - self.do_command("metaKeyDown", []) - - - def meta_key_up(self): - """ - Release the meta key. - - """ - self.do_command("metaKeyUp", []) - - - def alt_key_down(self): - """ - Press the alt key and hold it down until doAltUp() is called or a new page is loaded. - - """ - self.do_command("altKeyDown", []) - - - def alt_key_up(self): - """ - Release the alt key. - - """ - self.do_command("altKeyUp", []) - - - def control_key_down(self): - """ - Press the control key and hold it down until doControlUp() is called or a new page is loaded. - - """ - self.do_command("controlKeyDown", []) - - - def control_key_up(self): - """ - Release the control key. - - """ - self.do_command("controlKeyUp", []) - - - def key_down(self,locator,keySequence): - """ - Simulates a user pressing a key (without releasing it yet). - - 'locator' is an element locator - 'keySequence' is Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119". - """ - self.do_command("keyDown", [locator,keySequence,]) - - - def key_up(self,locator,keySequence): - """ - Simulates a user releasing a key. - - 'locator' is an element locator - 'keySequence' is Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119". - """ - self.do_command("keyUp", [locator,keySequence,]) - - - def mouse_over(self,locator): - """ - Simulates a user hovering a mouse over the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseOver", [locator,]) - - - def mouse_out(self,locator): - """ - Simulates a user moving the mouse pointer away from the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseOut", [locator,]) - - - def mouse_down(self,locator): - """ - Simulates a user pressing the mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseDown", [locator,]) - - - def mouse_down_at(self,locator,coordString): - """ - Simulates a user pressing the mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("mouseDownAt", [locator,coordString,]) - - - def mouse_up(self,locator): - """ - Simulates a user pressing the mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseUp", [locator,]) - - - def mouse_up_at(self,locator,coordString): - """ - Simulates a user pressing the mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("mouseUpAt", [locator,coordString,]) - - - def mouse_move(self,locator): - """ - Simulates a user pressing the mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseMove", [locator,]) - - - def mouse_move_at(self,locator,coordString): - """ - Simulates a user pressing the mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("mouseMoveAt", [locator,coordString,]) - - - def type(self,locator,value): - """ - Sets the value of an input field, as though you typed it in. - - Can also be used to set the value of combo boxes, check boxes, etc. In these cases, - value should be the value of the option selected, not the visible text. - - - 'locator' is an element locator - 'value' is the value to type - """ - self.do_command("type", [locator,value,]) - - - def set_speed(self,value): - """ - Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation). By default, there is no such delay, i.e., - the delay is 0 milliseconds. - - 'value' is the number of milliseconds to pause after operation - """ - self.do_command("setSpeed", [value,]) - - - def get_speed(self): - """ - Get execution speed (i.e., get the millisecond length of the delay following each selenium operation). By default, there is no such delay, i.e., - the delay is 0 milliseconds. - - See also setSpeed. - - """ - self.do_command("getSpeed", []) - - - def check(self,locator): - """ - Check a toggle-button (checkbox/radio) - - 'locator' is an element locator - """ - self.do_command("check", [locator,]) - - - def uncheck(self,locator): - """ - Uncheck a toggle-button (checkbox/radio) - - 'locator' is an element locator - """ - self.do_command("uncheck", [locator,]) - - - def select(self,selectLocator,optionLocator): - """ - Select an option from a drop-down using an option locator. - - - Option locators provide different ways of specifying options of an HTML - Select element (e.g. for selecting a specific option, or for asserting - that the selected option satisfies a specification). There are several - forms of Select Option Locator. - - * \ **label**\ =\ *labelPattern* - matches options based on their labels, i.e. the visible text. (This - is the default.) - * label=regexp:^[Oo]ther - - - * \ **value**\ =\ *valuePattern* - matches options based on their values. - * value=other - - - * \ **id**\ =\ *id* - matches options based on their ids. - * id=option1 - - - * \ **index**\ =\ *index* - matches an option based on its index (offset from zero). - * index=2 - - - - - If no option locator prefix is provided, the default behaviour is to match on \ **label**\ . - - - - 'selectLocator' is an element locator identifying a drop-down menu - 'optionLocator' is an option locator (a label by default) - """ - self.do_command("select", [selectLocator,optionLocator,]) - - - def add_selection(self,locator,optionLocator): - """ - Add a selection to the set of selected options in a multi-select element using an option locator. - - @see #doSelect for details of option locators - - 'locator' is an element locator identifying a multi-select box - 'optionLocator' is an option locator (a label by default) - """ - self.do_command("addSelection", [locator,optionLocator,]) - - - def remove_selection(self,locator,optionLocator): - """ - Remove a selection from the set of selected options in a multi-select element using an option locator. - - @see #doSelect for details of option locators - - 'locator' is an element locator identifying a multi-select box - 'optionLocator' is an option locator (a label by default) - """ - self.do_command("removeSelection", [locator,optionLocator,]) - - - def submit(self,formLocator): - """ - Submit the specified form. This is particularly useful for forms without - submit buttons, e.g. single-input "Search" forms. - - 'formLocator' is an element locator for the form you want to submit - """ - self.do_command("submit", [formLocator,]) - - - def open(self,url): - """ - Opens an URL in the test frame. This accepts both relative and absolute - URLs. - - The "open" command waits for the page to load before proceeding, - ie. the "AndWait" suffix is implicit. - - \ *Note*: The URL must be on the same domain as the runner HTML - due to security restrictions in the browser (Same Origin Policy). If you - need to open an URL on another domain, use the Selenium Server to start a - new browser session on that domain. - - 'url' is the URL to open; may be relative or absolute - """ - self.do_command("open", [url,]) - - - def open_window(self,url,windowID): - """ - Opens a popup window (if a window with that ID isn't already open). - After opening the window, you'll need to select it using the selectWindow - command. - - This command can also be a useful workaround for bug SEL-339. In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). - In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using - an empty (blank) url, like this: openWindow("", "myFunnyWindow"). - - - 'url' is the URL to open, which can be blank - 'windowID' is the JavaScript window ID of the window to select - """ - self.do_command("openWindow", [url,windowID,]) - - - def select_window(self,windowID): - """ - Selects a popup window; once a popup window has been selected, all - commands go to that window. To select the main window again, use null - as the target. - - Selenium has several strategies for finding the window object referred to by the "windowID" parameter. - 1.) if windowID is null, then it is assumed the user is referring to the original window instantiated by the browser). - 2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed - that this variable contains the return value from a call to the JavaScript window.open() method. - 3.) Otherwise, selenium looks in a hash it maintains that maps string names to window objects. Each of these string - names matches the second parameter "windowName" past to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag) - (which selenium intercepts). - If you're having trouble figuring out what is the name of a window that you want to manipulate, look at the selenium log messages - which identify the names of windows created via window.open (and therefore intercepted by selenium). You will see messages - like the following for each window as it is opened: - ``debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"`` - In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). - (This is bug SEL-339.) In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using - an empty (blank) url, like this: openWindow("", "myFunnyWindow"). - - - 'windowID' is the JavaScript window ID of the window to select - """ - self.do_command("selectWindow", [windowID,]) - - - def select_frame(self,locator): - """ - Selects a frame within the current window. (You may invoke this command - multiple times to select nested frames.) To select the parent frame, use - "relative=parent" as a locator; to select the top frame, use "relative=top". - - You may also use a DOM expression to identify the frame you want directly, - like this: ``dom=frames["main"].frames["subframe"]`` - - - 'locator' is an element locator identifying a frame or iframe - """ - self.do_command("selectFrame", [locator,]) - - - def get_log_messages(self): - """ - Return the contents of the log. - - This is a placeholder intended to make the code generator make this API - available to clients. The selenium server will intercept this call, however, - and return its recordkeeping of log messages since the last call to this API. - Thus this code in JavaScript will never be called. - The reason I opted for a servercentric solution is to be able to support - multiple frames served from different domains, which would break a - centralized JavaScript logging mechanism under some conditions. - - - """ - return self.get_string("getLogMessages", []) - - - def get_whether_this_frame_match_frame_expression(self,currentFrameString,target): - """ - Determine whether current/locator identify the frame containing this running code. - - This is useful in proxy injection mode, where this code runs in every - browser frame and window, and sometimes the selenium server needs to identify - the "current" frame. In this case, when the test calls selectFrame, this - routine is called for each frame to figure out which one has been selected. - The selected frame will return true, while all others will return false. - - - 'currentFrameString' is starting frame - 'target' is new frame (which might be relative to the current one) - """ - return self.get_boolean("getWhetherThisFrameMatchFrameExpression", [currentFrameString,target,]) - - - def get_whether_this_window_match_window_expression(self,currentWindowString,target): - """ - Determine whether currentWindowString plus target identify the window containing this running code. - - This is useful in proxy injection mode, where this code runs in every - browser frame and window, and sometimes the selenium server needs to identify - the "current" window. In this case, when the test calls selectWindow, this - routine is called for each window to figure out which one has been selected. - The selected window will return true, while all others will return false. - - - 'currentWindowString' is starting window - 'target' is new window (which might be relative to the current one, e.g., "_parent") - """ - return self.get_boolean("getWhetherThisWindowMatchWindowExpression", [currentWindowString,target,]) - - - def wait_for_pop_up(self,windowID,timeout): - """ - Waits for a popup window to appear and load up. - - 'windowID' is the JavaScript window ID of the window that will appear - 'timeout' is a timeout in milliseconds, after which the action will return with an error - """ - self.do_command("waitForPopUp", [windowID,timeout,]) - - - def choose_cancel_on_next_confirmation(self): - """ - By default, Selenium's overridden window.confirm() function will - return true, as if the user had manually clicked OK. After running - this command, the next call to confirm() will return false, as if - the user had clicked Cancel. - - """ - self.do_command("chooseCancelOnNextConfirmation", []) - - - def answer_on_next_prompt(self,answer): - """ - Instructs Selenium to return the specified answer string in response to - the next JavaScript prompt [window.prompt()]. - - 'answer' is the answer to give in response to the prompt pop-up - """ - self.do_command("answerOnNextPrompt", [answer,]) - - - def go_back(self): - """ - Simulates the user clicking the "back" button on their browser. - - """ - self.do_command("goBack", []) - - - def refresh(self): - """ - Simulates the user clicking the "Refresh" button on their browser. - - """ - self.do_command("refresh", []) - - - def close(self): - """ - Simulates the user clicking the "close" button in the titlebar of a popup - window or tab. - - """ - self.do_command("close", []) - - - def is_alert_present(self): - """ - Has an alert occurred? - - - This function never throws an exception - - - - """ - return self.get_boolean("isAlertPresent", []) - - - def is_prompt_present(self): - """ - Has a prompt occurred? - - - This function never throws an exception - - - - """ - return self.get_boolean("isPromptPresent", []) - - - def is_confirmation_present(self): - """ - Has confirm() been called? - - - This function never throws an exception - - - - """ - return self.get_boolean("isConfirmationPresent", []) - - - def get_alert(self): - """ - Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts. - - Getting an alert has the same effect as manually clicking OK. If an - alert is generated but you do not get/verify it, the next Selenium action - will fail. - NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert - dialog. - NOTE: Selenium does NOT support JavaScript alerts that are generated in a - page's onload() event handler. In this case a visible dialog WILL be - generated and Selenium will hang until someone manually clicks OK. - - - """ - return self.get_string("getAlert", []) - - - def get_confirmation(self): - """ - Retrieves the message of a JavaScript confirmation dialog generated during - the previous action. - - - By default, the confirm function will return true, having the same effect - as manually clicking OK. This can be changed by prior execution of the - chooseCancelOnNextConfirmation command. If an confirmation is generated - but you do not get/verify it, the next Selenium action will fail. - - - NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible - dialog. - - - NOTE: Selenium does NOT support JavaScript confirmations that are - generated in a page's onload() event handler. In this case a visible - dialog WILL be generated and Selenium will hang until you manually click - OK. - - - - """ - return self.get_string("getConfirmation", []) - - - def get_prompt(self): - """ - Retrieves the message of a JavaScript question prompt dialog generated during - the previous action. - - Successful handling of the prompt requires prior execution of the - answerOnNextPrompt command. If a prompt is generated but you - do not get/verify it, the next Selenium action will fail. - NOTE: under Selenium, JavaScript prompts will NOT pop up a visible - dialog. - NOTE: Selenium does NOT support JavaScript prompts that are generated in a - page's onload() event handler. In this case a visible dialog WILL be - generated and Selenium will hang until someone manually clicks OK. - - - """ - return self.get_string("getPrompt", []) - - - def get_location(self): - """ - Gets the absolute URL of the current page. - - """ - return self.get_string("getLocation", []) - - - def get_title(self): - """ - Gets the title of the current page. - - """ - return self.get_string("getTitle", []) - - - def get_body_text(self): - """ - Gets the entire text of the page. - - """ - return self.get_string("getBodyText", []) - - - def get_value(self,locator): - """ - Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). - For checkbox/radio elements, the value will be "on" or "off" depending on - whether the element is checked or not. - - 'locator' is an element locator - """ - return self.get_string("getValue", [locator,]) - - - def get_text(self,locator): - """ - Gets the text of an element. This works for any element that contains - text. This command uses either the textContent (Mozilla-like browsers) or - the innerText (IE-like browsers) of the element, which is the rendered - text shown to the user. - - 'locator' is an element locator - """ - return self.get_string("getText", [locator,]) - - - def get_eval(self,script): - """ - Gets the result of evaluating the specified JavaScript snippet. The snippet may - have multiple lines, but only the result of the last line will be returned. - - Note that, by default, the snippet will run in the context of the "selenium" - object itself, so ``this`` will refer to the Selenium object, and ``window`` will - refer to the top-level runner test window, not the window of your application. - If you need a reference to the window of your application, you can refer - to ``this.browserbot.getCurrentWindow()`` and if you need to use - a locator to refer to a single element in your application page, you can - use ``this.page().findElement("foo")`` where "foo" is your locator. - - - 'script' is the JavaScript snippet to run - """ - return self.get_string("getEval", [script,]) - - - def is_checked(self,locator): - """ - Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button. - - 'locator' is an element locator pointing to a checkbox or radio button - """ - return self.get_boolean("isChecked", [locator,]) - - - def get_table(self,tableCellAddress): - """ - Gets the text from a cell of a table. The cellAddress syntax - tableLocator.row.column, where row and column start at 0. - - 'tableCellAddress' is a cell address, e.g. "foo.1.4" - """ - return self.get_string("getTable", [tableCellAddress,]) - - - def get_selected_labels(self,selectLocator): - """ - Gets all option labels (visible text) for selected options in the specified select or multi-select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectedLabels", [selectLocator,]) - - - def get_selected_label(self,selectLocator): - """ - Gets option label (visible text) for selected option in the specified select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string("getSelectedLabel", [selectLocator,]) - - - def get_selected_values(self,selectLocator): - """ - Gets all option values (value attributes) for selected options in the specified select or multi-select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectedValues", [selectLocator,]) - - - def get_selected_value(self,selectLocator): - """ - Gets option value (value attribute) for selected option in the specified select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string("getSelectedValue", [selectLocator,]) - - - def get_selected_indexes(self,selectLocator): - """ - Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectedIndexes", [selectLocator,]) - - - def get_selected_index(self,selectLocator): - """ - Gets option index (option number, starting at 0) for selected option in the specified select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string("getSelectedIndex", [selectLocator,]) - - - def get_selected_ids(self,selectLocator): - """ - Gets all option element IDs for selected options in the specified select or multi-select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectedIds", [selectLocator,]) - - - def get_selected_id(self,selectLocator): - """ - Gets option element ID for selected option in the specified select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string("getSelectedId", [selectLocator,]) - - - def is_something_selected(self,selectLocator): - """ - Determines whether some option in a drop-down menu is selected. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_boolean("isSomethingSelected", [selectLocator,]) - - - def get_select_options(self,selectLocator): - """ - Gets all option labels in the specified select drop-down. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectOptions", [selectLocator,]) - - - def get_attribute(self,attributeLocator): - """ - Gets the value of an element attribute. - - 'attributeLocator' is an element locator followed by an - """ - return self.get_string("getAttribute", [attributeLocator,]) - - - def is_text_present(self,pattern): - """ - Verifies that the specified text pattern appears somewhere on the rendered page shown to the user. - - 'pattern' is a pattern to match with the text of the page - """ - return self.get_boolean("isTextPresent", [pattern,]) - - - def is_element_present(self,locator): - """ - Verifies that the specified element is somewhere on the page. - - 'locator' is an element locator - """ - return self.get_boolean("isElementPresent", [locator,]) - - - def is_visible(self,locator): - """ - Determines if the specified element is visible. An - element can be rendered invisible by setting the CSS "visibility" - property to "hidden", or the "display" property to "none", either for the - element itself or one if its ancestors. This method will fail if - the element is not present. - - 'locator' is an element locator - """ - return self.get_boolean("isVisible", [locator,]) - - - def is_editable(self,locator): - """ - Determines whether the specified input element is editable, ie hasn't been disabled. - This method will fail if the specified element isn't an input element. - - 'locator' is an element locator - """ - return self.get_boolean("isEditable", [locator,]) - - - def get_all_buttons(self): - """ - Returns the IDs of all buttons on the page. - - If a given button has no ID, it will appear as "" in this array. - - - """ - return self.get_string_array("getAllButtons", []) - - - def get_all_links(self): - """ - Returns the IDs of all links on the page. - - If a given link has no ID, it will appear as "" in this array. - - - """ - return self.get_string_array("getAllLinks", []) - - - def get_all_fields(self): - """ - Returns the IDs of all input fields on the page. - - If a given field has no ID, it will appear as "" in this array. - - - """ - return self.get_string_array("getAllFields", []) - - - def get_attribute_from_all_windows(self,attributeName): - """ - Returns every instance of some attribute from all known windows. - - 'attributeName' is name of an attribute on the windows - """ - return self.get_string_array("getAttributeFromAllWindows", [attributeName,]) - - - def dragdrop(self,locator,movementsString): - """ - deprecated - use dragAndDrop instead - - 'locator' is an element locator - 'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300" - """ - self.do_command("dragdrop", [locator,movementsString,]) - - - def drag_and_drop(self,locator,movementsString): - """ - Drags an element a certain distance and then drops it - - 'locator' is an element locator - 'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300" - """ - self.do_command("dragAndDrop", [locator,movementsString,]) - - - def drag_and_drop_to_object(self,locatorOfObjectToBeDragged,locatorOfDragDestinationObject): - """ - Drags an element and drops it on another element - - 'locatorOfObjectToBeDragged' is an element to be dragged - 'locatorOfDragDestinationObject' is an element whose location (i.e., whose top left corner) will be the point where locatorOfObjectToBeDragged is dropped - """ - self.do_command("dragAndDropToObject", [locatorOfObjectToBeDragged,locatorOfDragDestinationObject,]) - - - def window_focus(self,windowName): - """ - Gives focus to a window - - 'windowName' is name of the window to be given focus - """ - self.do_command("windowFocus", [windowName,]) - - - def window_maximize(self,windowName): - """ - Resize window to take up the entire screen - - 'windowName' is name of the window to be enlarged - """ - self.do_command("windowMaximize", [windowName,]) - - - def get_all_window_ids(self): - """ - Returns the IDs of all windows that the browser knows about. - - """ - return self.get_string_array("getAllWindowIds", []) - - - def get_all_window_names(self): - """ - Returns the names of all windows that the browser knows about. - - """ - return self.get_string_array("getAllWindowNames", []) - - - def get_all_window_titles(self): - """ - Returns the titles of all windows that the browser knows about. - - """ - return self.get_string_array("getAllWindowTitles", []) - - - def get_html_source(self): - """ - Returns the entire HTML source between the opening and - closing "html" tags. - - """ - return self.get_string("getHtmlSource", []) - - - def set_cursor_position(self,locator,position): - """ - Moves the text cursor to the specified position in the given input element or textarea. - This method will fail if the specified element isn't an input element or textarea. - - 'locator' is an element locator pointing to an input element or textarea - 'position' is the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field. You can also set the cursor to -1 to move it to the end of the field. - """ - self.do_command("setCursorPosition", [locator,position,]) - - - def get_element_index(self,locator): - """ - Get the relative index of an element to its parent (starting from 0). The comment node and empty text node - will be ignored. - - 'locator' is an element locator pointing to an element - """ - return self.get_number("getElementIndex", [locator,]) - - - def is_ordered(self,locator1,locator2): - """ - Check if these two elements have same parent and are ordered. Two same elements will - not be considered ordered. - - 'locator1' is an element locator pointing to the first element - 'locator2' is an element locator pointing to the second element - """ - return self.get_boolean("isOrdered", [locator1,locator2,]) - - - def get_element_position_left(self,locator): - """ - Retrieves the horizontal position of an element - - 'locator' is an element locator pointing to an element OR an element itself - """ - return self.get_number("getElementPositionLeft", [locator,]) - - - def get_element_position_top(self,locator): - """ - Retrieves the vertical position of an element - - 'locator' is an element locator pointing to an element OR an element itself - """ - return self.get_number("getElementPositionTop", [locator,]) - - - def get_element_width(self,locator): - """ - Retrieves the width of an element - - 'locator' is an element locator pointing to an element - """ - return self.get_number("getElementWidth", [locator,]) - - - def get_element_height(self,locator): - """ - Retrieves the height of an element - - 'locator' is an element locator pointing to an element - """ - return self.get_number("getElementHeight", [locator,]) - - - def get_cursor_position(self,locator): - """ - Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers. - - Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to - return the position of the last location of the cursor, even though the cursor is now gone from the page. This is filed as SEL-243. - - This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element. - - 'locator' is an element locator pointing to an input element or textarea - """ - return self.get_number("getCursorPosition", [locator,]) - - - def set_context(self,context,logLevelThreshold): - """ - Writes a message to the status bar and adds a note to the browser-side - log. - - If logLevelThreshold is specified, set the threshold for logging - to that level (debug, info, warn, error). - (Note that the browser-side logs will \ *not* be sent back to the - server, and are invisible to the Client Driver.) - - - 'context' is the message to be sent to the browser - 'logLevelThreshold' is one of "debug", "info", "warn", "error", sets the threshold for browser-side logging - """ - self.do_command("setContext", [context,logLevelThreshold,]) - - - def get_expression(self,expression): - """ - Returns the specified expression. - - This is useful because of JavaScript preprocessing. - It is used to generate commands like assertExpression and waitForExpression. - - - 'expression' is the value to return - """ - return self.get_string("getExpression", [expression,]) - - - def wait_for_condition(self,script,timeout): - """ - Runs the specified JavaScript snippet repeatedly until it evaluates to "true". - The snippet may have multiple lines, but only the result of the last line - will be considered. - - Note that, by default, the snippet will be run in the runner's test window, not in the window - of your application. To get the window of your application, you can use - the JavaScript snippet ``selenium.browserbot.getCurrentWindow()``, and then - run your JavaScript in there - - - 'script' is the JavaScript snippet to run - 'timeout' is a timeout in milliseconds, after which this command will return with an error - """ - self.do_command("waitForCondition", [script,timeout,]) - - - def set_timeout(self,timeout): - """ - Specifies the amount of time that Selenium will wait for actions to complete. - - Actions that require waiting include "open" and the "waitFor*" actions. - - The default timeout is 30 seconds. - - 'timeout' is a timeout in milliseconds, after which the action will return with an error - """ - self.do_command("setTimeout", [timeout,]) - - - def wait_for_page_to_load(self,timeout): - """ - Waits for a new page to load. - - You can use this command instead of the "AndWait" suffixes, "clickAndWait", "selectAndWait", "typeAndWait" etc. - (which are only available in the JS API). - Selenium constantly keeps track of new pages loading, and sets a "newPageLoaded" - flag when it first notices a page load. Running any other Selenium command after - turns the flag to false. Hence, if you want to wait for a page to load, you must - wait immediately after a Selenium command that caused a page-load. - - - 'timeout' is a timeout in milliseconds, after which this command will return with an error - """ - self.do_command("waitForPageToLoad", [timeout,]) - - - def get_cookie(self): - """ - Return all cookies of the current page under test. - - """ - return self.get_string("getCookie", []) - - - def create_cookie(self,nameValuePair,optionsString): - """ - Create a new cookie whose path and domain are same with those of current page - under test, unless you specified a path for this cookie explicitly. - - 'nameValuePair' is name and value of the cookie in a format "name=value" - 'optionsString' is options for the cookie. Currently supported options include 'path' and 'max_age'. the optionsString's format is "path=/path/, max_age=60". The order of options are irrelevant, the unit of the value of 'max_age' is second. - """ - self.do_command("createCookie", [nameValuePair,optionsString,]) - - - def delete_cookie(self,name,path): - """ - Delete a named cookie with specified path. - - 'name' is the name of the cookie to be deleted - 'path' is the path property of the cookie to be deleted - """ - self.do_command("deleteCookie", [name,path,]) - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/seleniumtestcase.py ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/seleniumtestcase.py Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,113 +0,0 @@ -import os -import unittest -import time - -from selenium import selenium -try: - browser = os.environ["SELENIUMBROWSER"] -except: - browser = "*firefox" -try: - target = os.environ["SELENIUMTARGET"] -except: - target = "http://localhost:8080" - - -def trymanytimes(func): - '''Decorate a test method with this to make it try for ten seconds''' - def newfunc(*args, **kwargs): - exc = None - for i in range(10): - try: - func(*args, **kwargs) - except Exception, e: - exc = e - time.sleep(1) - else: - return - raise exc - return newfunc - -class SeleniumTestCase(unittest.TestCase): - def setUp(self): - self.verificationErrors = [] - self.selenium = selenium("localhost", 4444, browser, target) - self.selenium.start() - self.storedvars = {} - - def tearDown(self): - self.selenium.stop() - self.assertEqual([], self.verificationErrors) - - def __getattr__(self, name): - try: - return getattr(self.__dict__['selenium'], name) - except KeyError: - return super(SeleniumTestCase, self).__getattr__(name) - - def open(self, url): - self.selenium.open(url) - - def click(self, target): - self.selenium.click(target) - - @trymanytimes - def waitForText(self, target, text): - self.failUnless(text in self.selenium.get_text(target)) - - @trymanytimes - def waitForNotText(self, target, text): - self.failIf(text in self.selenium.get_text(target)) - - @trymanytimes - def waitForTextPresent(self, text): - self.failUnless(self.selenium.is_text_present(text)) - - @trymanytimes - def waitForElementNotPresent(self, target): - self.failIf(self.selenium.is_element_present(target)) - - @trymanytimes - def waitForElementPresent(self, target): - self.failUnless(self.selenium.is_element_present(target)) - - @trymanytimes - def waitForValue(self, target, value): - self.failUnless(self.selenium.get_value(target)) - - @trymanytimes - def waitForAttribute(self, target, value): - self.assertEqual(self.selenium.get_attribute(target), value) - - def assertText(self, target, text=''): - self.assertEqual(self.selenium.get_text(target), text) - - def assertNotText(self, target, text=''): - self.failIfEqual(self.selenium.get_text(target), text) - - def assertValue(self, target, value=''): - self.assertEqual(self.selenium.get_value(target), value) - - def assertElementPresent(self, target): - self.failUnless(self.selenium.is_element_present(target)) - - def assertElementNotPresent(self, target): - self.failIf(self.selenium.is_element_present(target)) - - def pause(self, seconds): - time.sleep(float(seconds)/1000) - - def assertTextPresent(self, text): - self.failUnless(self.selenium.is_text_present(text)) - - def assertTextNotPresent(self, text): - self.failIf(self.selenium.is_text_present(text)) - - def assertAttribute(self, target, value): - self.assertEqual(self.selenium.get_attribute(target), value) - - def storeText(self, target, varname): - self.storedvars[varname] = self.selenium.get_text(target) - - def getVar(self, varname): - return self.storedvars[varname] Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py Tue Sep 18 13:56:03 2007 @@ -1,10 +1,21 @@ -from kss.demo.interfaces import IKSSDemoCollection -from kss.demo.registry import KSSDemo +from kss.demo.interfaces import ( + IKSSDemoResource, + IKSSSeleniumTestResource, + ) +from kss.demo.resource import ( + KSSDemo, + KSSSeleniumTestDirectory, + ) from zope.interface import implements +# Create a mesh of provided interfaces +# This is needed, because an utility must have a single interface. +class resource_interface(IKSSDemoResource, IKSSSeleniumTestResource): + pass + class KSSCoreDemos(object): - implements(IKSSDemoCollection) + implements(resource_interface) demos = ( KSSDemo('', '', "basic_commands.html", "Change tag content"), @@ -30,3 +41,11 @@ KSSDemo('', 'Commands/Actions', "actions.html", "Toggle case action"), ) + # directories are relative from the location of this .py file + selenium_tests = ( + KSSSeleniumTestDirectory('selenium_tests'), + ) + +# Create the utility. We need this and use "component" in zcml, +# to allow specifying multiple interfaces for the utility. +resource = KSSCoreDemos() Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/events.py ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/events.py (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/events.py Tue Sep 18 13:56:03 2007 @@ -3,10 +3,10 @@ from zope.component.interfaces import ( IUtilityRegistration, IRegistrationEvent, -# ObjectEvent, ) from interfaces import ( - IKSSDemoCollection, + IKSSDemoResource, + IKSSSeleniumTestResource, IKSSDemoRegistrationEvent, ) from zope.interface import implements @@ -25,7 +25,8 @@ component = registration.component # Only dispatch registration of the interesting utilities. new_event = KSSDemoRegistrationEvent() - if IKSSDemoCollection.providedBy(component): + if IKSSDemoResource.providedBy(component) or \ + IKSSSeleniumTestResource.providedBy(component): handlers = zope.component.subscribers((component, registration, event, new_event), None) for handler in handlers: pass # getting them does the work Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/interfaces.py ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/interfaces.py (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/interfaces.py Tue Sep 18 13:56:03 2007 @@ -7,6 +7,10 @@ class ISimpleContent(Interface): pass +# -- +# Resources +# -- + class IKSSDemo(Interface): """Represents an actual demo page""" @@ -38,23 +42,104 @@ required=True, ) -class IKSSDemoCollection(Interface): +class IKSSSeleniumTestDirectory(Interface): + """Represents an actual selenium test directory""" + + test_directory = TextLine( + title=u"test directory", + description=u'Relative directory path, contains *.html selenium tests', + required=False, + ) + +# -- +# Resource definition interfaces +# -- + +class IKSSDemoResource(Interface): """An utility that a demo needs to register""" + # list of IKSSDemo demos = List( title=u"demos", - description=u'The ordered list of demos contained in this collection', + description=u'The ordered list of demos contained in this plugin', required=True, ) +class IKSSSeleniumTestResource(Interface): + """An utility that a demo needs to register""" + + # list of IKSSSeleniumTestDir + selenium_tests = List( + title=u"selenium tests", + description=u'The list of selenium test directories contained in this plugin', + required=True, + ) + +# -- +# The registry itself +# -- + class IKSSDemoRegistry(Interface): """Faciliates registration of demos. - Implementations must look after the IDemoCollection + Implementations must look after the IKSSDemoResource + adapters, and use their content to set up themselves. + """ + + def registerDemo(demo): + """Register a demo + + It has the attributes specified in IKSSDemo: + + plugin_namespace - string with the name of the plugin. + Or: "" when it is the core part. + + category - text that will appear as the title of the + category. "" if out of category. + + demo_page - (relative) url of the demo page. This should + traverse on ISimpleContent. + + title - Title of the demo. This also identifies it + for removal. + """ + + def unregisterDemo(demo): + """Unregister the given demo.""" + + def getSortedDemos(): + """Get the (sorted) list of demos""" + +class IKSSSeleniumTestRegistry(Interface): + """Faciliates registration of demos. + + Implementations must look after the IKSSSeleniumTestResource adapters, and use their content to set up themselves. """ + def registerSeleniumTestFile(test_filename): + """Register a selenium test directory + + It test_dir has the "filename" attributes specified in IKSSSeleniumTest. + """ + + def unregisterSeleniumTestFile(test_filename): + """Unregister the given test directory.""" + + def cookSeleniumTests(): + """Cook selenium tests + + The *.html tests from each plugin are produced + into the file seltest_all.pty in the directory + of kss.demo.selenium_utils . + """ + +# -- +# Event that gets redispatched, for allowing +# the listeners to filter on component +# -- + class IKSSDemoRegistrationEvent(Interface): """Redispatched evend for registration of - IKSSDemoRegistry utilities. + IKSSPDemoRegistry utilities. """ Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/registry.py ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/registry.py (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/registry.py Tue Sep 18 13:56:03 2007 @@ -1,12 +1,13 @@ from zope.interface import implements -from interfaces import IKSSDemoRegistry from zope.component import ( adapter, getSiteManager, ) from interfaces import ( - IKSSDemo, - IKSSDemoCollection, + IKSSDemoRegistry, + IKSSSeleniumTestRegistry, + IKSSDemoResource, + IKSSSeleniumTestResource, IKSSDemoRegistrationEvent, ) from zope.component.interfaces import ( @@ -14,51 +15,63 @@ IRegistered, IUnregistered, ) - -class KSSDemo(object): - """Represents a demo. - Demos are organized in collections (provided by a plugin), - ans collections are registered to the registry. - """ - implements(IKSSDemo) - def __init__(self, plugin_namespace, category, page_url, title): - self.plugin_namespace = plugin_namespace - self.category = category - self.page_url = page_url - self.title = title - - # convenience access for page templates - __allow_access_to_unprotected_subobjects__ = 1 - def __getitem__(self, key): - return getattr(self, key) +import sys, os, re, textwrap +from elementtree import HTMLTreeBuilder +from string import Template +import kss.demo.selenium_utils +# shut the mouth of pyflakes +kss.demo.selenium_utils + +# -- +# Registry implementation for use with Zope +# -- + +def getRootDirOfModule(module_name): + return os.path.dirname(sys.modules[module_name].__file__) + +def getRootDirOfClass(cls): + return getRootDirOfModule(cls.__module__) + +def getRootDirOfInstance(obj): + return getRootDirOfClass(obj.__class__) + +# Create a mesh of provided interfaces +# This is needed, because an utility must have a single interface. +class registry_interface(IKSSDemoRegistry, IKSSSeleniumTestRegistry): + pass class KSSDemoRegistry(object): """KSS demo registry. """ - implements(IKSSDemoRegistry) + implements(registry_interface) def __init__(self): - self.demos_dict = {} - self.demos = [] - self.demos_are_sorted = [] - # Set up my handlers to get notified of new collections + # We will set up my handlers to get notified of new plugins # (works via redispatching by events.py) site = getSiteManager() - site.registerHandler(self.registerDemoCollection) - site.registerHandler(self.unregisterDemoCollection) + # registry for demos + self.demos_dict = {} + self.demos = [] + self.demos_are_sorted = False + site.registerHandler(self.registerDemosFromPlugin) + site.registerHandler(self.unregisterDemosFromPlugin) + # registry for selenium tests + self.selenium_tests = [] + site.registerHandler(self.registerSeleniumTestsFromPlugin) + site.registerHandler(self.unregisterSeleniumTestsFromPlugin) - @adapter(IKSSDemoCollection, IUtilityRegistration, IRegistered, IKSSDemoRegistrationEvent) - def registerDemoCollection(self, demo_collection, registration=None, event=None, new_event=None): + @adapter(IKSSDemoResource, IUtilityRegistration, IRegistered, IKSSDemoRegistrationEvent) + def registerDemosFromPlugin(self, plugin, registration=None, event=None, new_event=None): """Add a demo collection to the registry. """ - for demo in demo_collection.demos: + for demo in plugin.demos: self.registerDemo(demo) - @adapter(IKSSDemoCollection, IUtilityRegistration, IUnregistered, IKSSDemoRegistrationEvent) - def unregisterDemoCollection(self, demo_collection, registration=None, event=None, new_event=None): + @adapter(IKSSDemoResource, IUtilityRegistration, IUnregistered, IKSSDemoRegistrationEvent) + def unregisterDemosFromPlugin(self, plugin, registration=None, event=None, new_event=None): """Remove a demo collection from the registry. """ - for demo in demo_collection.demos: + for demo in plugin.demos: self.unregisterDemo(demo) def registerDemo(self, demo): @@ -104,3 +117,121 @@ )) self.demos_are_sorted = True return list(self.demos) + + # -- + # Selenium tests + # -- + + @staticmethod + def _getSeleniumTestsFromPlugin(plugin): + test_filenames = [] + root_dir = getRootDirOfInstance(plugin) + for selenium_test_directory in plugin.selenium_tests: + tests_root_dir = os.path.join(root_dir, selenium_test_directory.test_directory) + for test_filename in os.listdir(tests_root_dir): + if test_filename.lower().endswith('.html') or \ + test_filename.endswith('.htm'): + test_filenames.append(os.path.join(tests_root_dir, test_filename)) + return test_filenames + + @adapter(IKSSSeleniumTestResource, IUtilityRegistration, IRegistered, IKSSDemoRegistrationEvent) + def registerSeleniumTestsFromPlugin(self, plugin, registration=None, event=None, new_event=None): + """Add a demo collection to the registry. + """ + for test_filename in self._getSeleniumTestsFromPlugin(plugin): + self.registerSeleniumTestFile(test_filename) + + @adapter(IKSSSeleniumTestResource, IUtilityRegistration, IUnregistered, IKSSDemoRegistrationEvent) + def unregisterSeleniumTestsFromPlugin(self, plugin, registration=None, event=None, new_event=None): + """Remove a demo collection from the registry. + """ + for test_filename in self._getSeleniumTestsFromPlugin(plugin): + self.registerSeleniumTestFile(test_filename) + + def registerSeleniumTestFile(self, test_filename): + """Register a selenium test by absolute filename + """ + if test_filename in self.selenium_tests: + raise Exception, 'The selenium test for %s has already been registered. Cannot add.' % (test_filename, ) + self.selenium_tests.append(test_filename) + + def unregisterSeleniumTestFile(self, test_filename): + """Unregister the given selenium test.""" + try: + del self.selenium_tests[test_filename] + except KeyError: + raise Exception, 'The selenium test for %s is yet unregistered. Cannot remove.' % (test_filename, ) + + template = Template(textwrap.dedent('''\ + from seleniumtestcase import SeleniumTestCase + import unittest, time + + class seltest_$testname(SeleniumTestCase): + + $tests + + def test_suite(): + return unittest.makeSuite(seltest_$testname) + + if __name__ == "__main__": + unittest.main() + ''')) + + variable_regexp = re.compile('\$\{(?P\w*)\}') + @classmethod + def formatcommand(cls, command, *args): + if not command: + return '' # Change this to raise an exception? + + arguments = [] + for arg in args: + if not arg: + continue + matched = cls.variable_regexp.match(arg) + if matched is None: + arguments.append('"%s"'%arg) + else: + arguments.append("self.getVar('%s')"%matched.group('varname')) + return 'self.%s(%s)' % (command, ', '.join(arguments)) + + def cookSeleniumTests(self): + """Cook selenium tests + + The *.html tests from each plugin are produced + into the file seltest_all.pty in the directory + of kss.demo.selenium_utils . + """ + # Try to open the file for writing. + output_dir = getRootDirOfModule('kss.demo.selenium_utils') + output_filename = os.path.join(output_dir, 'seltest_all.py') + try: + f = open(output_filename, 'wb') + except IOError, exc: + raise IOError, ('Cannot open file "%s" for writing. ' + 'Make sure zope process has write access in directory. ' + '["%s"]') \ + % (output_filename, exc) + + htmlparser = HTMLTreeBuilder.TreeBuilder() + tests = [] + for filename in self.selenium_tests: + tree = HTMLTreeBuilder.parse(filename) + root = tree.getroot() + + try: + testname = root.find('.//title').text + except AttributeError: + continue + commands = [] + for row in root.findall('.//tbody/tr'): + commands.append(self.formatcommand(*[td.text for td in row.findall('td')])) + + testfilename = 'seltest_%s.py' % testname + testbody=' def test_%s(self):\n'%testname+' '*8+'\n '.join(commands)+'\n' + tests.append(testbody) + + f.write(self.template.substitute(dict( + testname=testname, + tests='\n'.join(tests), + ))) + f.close() Added: kukit/kss.demo/branch/ree-demoload/kss/demo/resource.py ============================================================================== --- (empty file) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/resource.py Tue Sep 18 13:56:03 2007 @@ -0,0 +1,39 @@ +from zope.interface import implements +from interfaces import ( + IKSSDemo, + IKSSSeleniumTestDirectory, + ) + +# -- +# Reference implementations for the described elements +# They are designed to be passive +# -- + +class KSSDemo(object): + """Represents a demo. + """ + implements(IKSSDemo) + def __init__(self, plugin_namespace, category, page_url, title): + self.plugin_namespace = plugin_namespace + self.category = category + self.page_url = page_url + self.title = title + + # convenience access for page templates + __allow_access_to_unprotected_subobjects__ = 1 + def __getitem__(self, key): + return getattr(self, key) + +class KSSSeleniumTestDirectory(object): + """Represents a selenium test directory. + """ + implements(IKSSSeleniumTestDirectory) + def __init__(self, test_directory): + self.test_directory = test_directory + + # convenience access for page templates + __allow_access_to_unprotected_subobjects__ = 1 + def __getitem__(self, key): + return getattr(self, key) + + Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/actions.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/actions.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,79 +0,0 @@ - - - -coreplugin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
coreplugin
open/demo/actions.html
assertAttributetoggleclass-button at classbutton click cursorPointer
clicktoggleclass-button
assertAttributetoggleclass-button at classbutton click cursorPointer selected
clicktoggleclass-button
assertAttributetoggleclass-button at classbutton click cursorPointer
assertAttributeserver-toggleclass-button at classbutton click cursorPointer
clickserver-toggleclass-button
waitForAttributeserver-toggleclass-button at classbutton click cursorPointer selected
assertAttributeserver-toggleclass-button at classbutton click cursorPointer selected
clickserver-toggleclass-button
waitForAttributeserver-toggleclass-button at classbutton click cursorPointer
assertAttributeserver-toggleclass-button at classbutton click cursorPointer
- - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/autopupdate.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/autopupdate.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,64 +0,0 @@ - - - -autopupdate - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
autopupdate
open/demo/autoupdate.html
assertTextupdate-wrapper
clickstart-update
waitForElementPresentupdate-area
assertElementPresentupdate-area
assertTextupdate-area
storeTextupdate-areaupdateText
assertTextupdate-area${updateText}
pause3000
assertNotTextupdate-area${updateText}
- - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/basic_commands.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/basic_commands.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,184 +0,0 @@ - - - -demo1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
demo1
open/demo/basic_commands.html
assertTextdemoKSS
assertTextcopycopy here
clickchange
waitForElementPresentworkedagain
assertElementPresentworkedagain
assertTextdemoit worked again
clickclear
waitForElementNotPresentworkedagain
assertNotTextdemoit worked again
clickcopyFrom
waitForNotTextcopycopy here
assertNotTextcopycopy here
assertElementNotPresentworkedagain
clickchange
waitForElementPresentworkedagain
assertElementPresentworkedagain
assertNotTextcopyit worked again
clickcopyFrom
waitForTextcopyit worked again
assertTextcopyit worked again
clickclear
waitForNotTextdemoit worked again
assertNotTextdemoit worked again
clickcopyTo
waitForTextdemoit worked again
assertTextdemoit worked again
clickclear
waitForNotTextdemoit worked again
assertNotTextdemoit worked again
clickmoveTo
waitForTextdemoit worked again
assertTextdemoit worked again
assertNotTextcopyit worked again
- - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/ca_focus.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/ca_focus.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,174 +0,0 @@ - - - -ca_focus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ca_focus
open/demo/ca_focus.html
assertTextPresentFocus on none.
clickfocus-to-text
waitForTextPresentFocus on text.
assertTextPresentFocus on text.
clickfocus-to-textarea
waitForTextPresentFocus on textarea.
assertTextPresentFocus on textarea.
clickfocus-to-select
waitForTextPresentFocus on select.
assertTextPresentFocus on select.
clickfocus-to-radio
waitForTextPresentFocus on radio-1.
assertTextPresentFocus on radio-1.
clickfocus-to-checkbox
waitForTextPresentFocus on checkbox-1.
assertTextPresentFocus on checkbox-1.
clickserver-focus-to-text
waitForTextPresentFocus on text.
assertTextPresentFocus on text.
clickserver-focus-to-textarea
waitForTextPresentFocus on textarea.
assertTextPresentFocus on textarea.
clickserver-focus-to-select
waitForTextPresentFocus on select.
assertTextPresentFocus on select.
clickserver-focus-to-radio
waitForTextPresentFocus on radio-1.
assertTextPresentFocus on radio-1.
clickserver-focus-to-checkbox
waitForTextPresentFocus on checkbox-1.
assertTextPresentFocus on checkbox-1.
- - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/cancel_submit.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/cancel_submit.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,44 +0,0 @@ - - - -cancel_submit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
cancel_submit
open/demo/cancel_submit.html
assertValuetext_save
typetext_saveabc
clicksubmit
waitForTextasyncAsync saved abc
assertTextasyncAsync saved abc
- - Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/createpythontests.py ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/createpythontests.py (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/createpythontests.py Tue Sep 18 13:56:03 2007 @@ -1,5 +1,9 @@ #!/usr/bin/env python +raise SystemExit, 'Due to changes in the plugin registry, command line ' \ + 'method is disabled until kss.demo is ported to kss.base.\n' \ + ' (Hint: call .../@@kss_demo_registry_admin/cookSeleniumTests from zope.)' + # Generate selenium test controller files from HTML selenium tests from elementtree import HTMLTreeBuilder, ElementTree Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/inline_edit.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/inline_edit.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,69 +0,0 @@ - - - -inline_edit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
inline_edit
open/demo/inline_edit.html
assertTextPresentclick me!
assertTexttextclick me!
clicktext
waitForValuevalueclick me!
assertValuevalueclick me!
typevaluechange
clicksave
waitForTextPresentchange
assertTextPresentchange
assertTextNotPresentclick me!
- - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/kss_prevent_bubbling.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/kss_prevent_bubbling.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,69 +0,0 @@ - - - -kss_prevent_bubbling - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
kss_prevent_bubbling
open/demo/kss_evt_preventbubbling.html
clickAtcss=div#parent-node
assertAlertyou clicked inside the DIV tag, event [click], rule #0, node [DIV].
assertAlertNotPresent
clickAtcss=a#bubbling-node
assertAlertyou clicked the bubbling A tag, event [click], rule #1, node [A].
assertAlertyou clicked inside the DIV tag, event [click], rule #0, node [DIV].
assertAlertNotPresent
clickAtcss=a#not-bubbling-node
assertAlertyou clicked the not bubbling A tag, event [click], rule #2, node [A].
assertAlertNotPresent
- - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/kss_selector_param.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/kss_selector_param.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,109 +0,0 @@ - - - -kss_selector_param - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
kss_selector_param
open/demo/kss_selector_param.html
clickbutton_1
waitForValuebutton_2RESET ME
assertValuebutton_2RESET ME
clickbutton_2
waitForValuebutton_2Watch me
assertValuebutton_2Watch me
clickbutton_3
waitForValuebutton_4RESET ME
assertValuebutton_4RESET ME
clickbutton_4
waitForValuebutton_4Watch me
assertValuebutton_4Watch me
clickbutton_5
waitForValuebutton_6RESET ME
assertValuebutton_6RESET ME
clickbutton_6
waitForValuebutton_6Watch me
assertValuebutton_6Watch me
- - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/pf_forms.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/pf_forms.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,119 +0,0 @@ - - - -pf_forms - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
pf_forms
open/demo/pf_forms.html
assertElementPresenttarget
assertTexttargetTarget
clicktext
waitForTexttargettext
assertTexttargettext
clicktext-by-name
waitForTexttargettext-by-name
assertTexttargettext-by-name
clicktextarea
waitForTexttargettextarea
assertTexttargettextarea
clicktextarea-by-name
waitForTexttargettextarea-by-name
assertTexttargettextarea-by-name
clickradio1
waitForTexttargetradio-1
assertTexttargetradio-1
clickradio-by-name
waitForTexttargetradio-2
assertTexttargetradio-2
- - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/preventdefault.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/preventdefault.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,49 +0,0 @@ - - - -preventdefault - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
preventdefault
open/demo/preventdefault.html
waitForTextPresent
assertValuetextDo not submit on enter
typetextSubmit me
keyPresstext\13
pause3000
verifyValuetextSubmit me
- - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/selectors.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/selectors.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,74 +0,0 @@ - - - -selectors - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
selectors
open/demo/selectors.html
clickparentnodenotok
pause1000
assertTexttargetTarget Click me!
clickparentnodeok
waitForTexttargetok
assertTexttargetok
clickparentnodechain
waitForTextcss=#nesteddivs0 div.insertedselected
assertTextcss=#nesteddivs1 div.insertedselected
assertTextcss=#nesteddivs0 div.insertedselected
assertTextcss=#nesteddivs2 div.insertedselected
- - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/suite.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/suite.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,14 +0,0 @@ - - - - - - - - -
Test Suite
ChangeTagContent
- - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/two_select_revisited.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/two_select_revisited.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,139 +0,0 @@ - - - -two_select_revisited - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
two_select_revisited
open/demo/two_select_revisited.html
assertTextfirst-masteranimals machines
assertTextfirst-slave
selectfirst-masterlabel=animals
waitForTextfirst-slavedog cat cow
assertTextfirst-slavedog cat cow
selectfirst-masterlabel=machines
waitForTextfirst-slavecomputer car airplane
assertTextfirst-slavecomputer car airplane
assertTextsecond-masteranimals machines
assertTextsecond-slave
selectsecond-masterlabel=animals
waitForTextsecond-slavedog cat cow
assertTextsecond-slavedog cat cow
selectsecond-masterlabel=machines
waitForTextsecond-slavecomputer car airplane
assertTextsecond-slavecomputer car airplane
assertTextthird-masteranimals machines
assertTextthird-slave
selectthird-masterlabel=animals
waitForTextthird-slavedog cat cow
assertTextthird-slavedog cat cow
selectthird-masterlabel=machines
waitForTextthird-slavecomputer car airplane
assertTextthird-slavecomputer car airplane
- - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/two_selects.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/two_selects.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,59 +0,0 @@ - - - -two_selects - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
two_selects
open/demo/two_selects.html
assertTextfirstanimals machines
assertTextsecond
selectfirstlabel=animals
waitForTextseconddog cat cow
assertTextseconddog cat cow
selectfirstlabel=machines
waitForTextsecondcomputer car airplane
assertTextsecondcomputer car airplane
- - Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/urlparam.html ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/tests/selenium_tests/urlparam.html Tue Sep 18 13:56:03 2007 +++ (empty file) @@ -1,69 +0,0 @@ - - - -urlparam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
urlparam
open/demo/kss_url_param.html
assertElementPresenttarget
clickbutton_1
waitForTextPresentMethod 1 called
assertTextPresentMethod 1 called
clickbutton_2
waitForTextPresentMethod 2 called
assertTextPresentMethod 2 called
clickbutton_3
waitForTextPresentMethod 3 called
assertTextPresentMethod 3 called
- - From reebalazs at codespeak.net Tue Sep 18 14:11:16 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Tue, 18 Sep 2007 14:11:16 +0200 (CEST) Subject: [KSS-checkins] r46724 - in kukit/kss.demo/branch/ree-demoload/kss/demo: . demo Message-ID: <20070918121116.042248143@code0.codespeak.net> Author: reebalazs Date: Tue Sep 18 14:11:16 2007 New Revision: 46724 Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py kukit/kss.demo/branch/ree-demoload/kss/demo/registry.py Log: Change names of mesh interfaces Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py Tue Sep 18 14:11:16 2007 @@ -11,11 +11,11 @@ # Create a mesh of provided interfaces # This is needed, because an utility must have a single interface. -class resource_interface(IKSSDemoResource, IKSSSeleniumTestResource): +class IResource(IKSSDemoResource, IKSSSeleniumTestResource): pass class KSSCoreDemos(object): - implements(resource_interface) + implements(IResource) demos = ( KSSDemo('', '', "basic_commands.html", "Change tag content"), Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/registry.py ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/registry.py (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/registry.py Tue Sep 18 14:11:16 2007 @@ -37,13 +37,13 @@ # Create a mesh of provided interfaces # This is needed, because an utility must have a single interface. -class registry_interface(IKSSDemoRegistry, IKSSSeleniumTestRegistry): +class IRegistry(IKSSDemoRegistry, IKSSSeleniumTestRegistry): pass class KSSDemoRegistry(object): """KSS demo registry. """ - implements(registry_interface) + implements(IRegistry) def __init__(self): # We will set up my handlers to get notified of new plugins From kukit-checkins at codespeak.net Thu Sep 20 22:27:57 2007 From: kukit-checkins at codespeak.net (Viagra.com Inc) Date: Thu, 20 Sep 2007 22:27:57 +0200 (CEST) Subject: [KSS-checkins] Lovers package at discount price! Message-ID: <20070920112929.3318.qmail@host30-221-dynamic.11-79-r.retail.telecomitalia.it> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20070920/b4135e9d/attachment.htm From kukit-checkins at codespeak.net Fri Sep 21 22:24:57 2007 From: kukit-checkins at codespeak.net (VIAGRA ® Official Site) Date: Fri, 21 Sep 2007 22:24:57 +0200 (CEST) Subject: [KSS-checkins] September 78% OFF Message-ID: <20070922042624.59719.qmail@ppp91-76-96-89.pppoe.mtu-net.ru> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20070921/e775300a/attachment.htm From jvloothuis at codespeak.net Fri Sep 21 22:39:23 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Fri, 21 Sep 2007 22:39:23 +0200 (CEST) Subject: [KSS-checkins] r46806 - kukit/kukit.js/trunk/utils Message-ID: <20070921203923.E70AE813F@code0.codespeak.net> Author: jvloothuis Date: Fri Sep 21 22:39:22 2007 New Revision: 46806 Added: kukit/kukit.js/trunk/utils/kss-mode.el Log: Added Emacs mode for KSS Added: kukit/kukit.js/trunk/utils/kss-mode.el ============================================================================== --- (empty file) +++ kukit/kukit.js/trunk/utils/kss-mode.el Fri Sep 21 22:39:22 2007 @@ -0,0 +1,117 @@ +;;; kss.el --- KSS major mode + +;; Copyright (C) 2001 Free Software Foundation, Inc. + +;; Author: Jeroen Vloothuis +;; Keywords: extensions + +;; This file is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; This file is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; This mode adds support for KSS (Kinetic Style Sheets). + +;; + +;;; Code: + +(defvar kss-mode-map + (let ((map (make-sparse-keymap))) + (define-key map [foo] 'kss-do-foo) + map) + "Keymap for `kss-mode'.") + +(defvar kss-mode-syntax-table + (let ((st (make-syntax-table))) + (modify-syntax-entry ?* ". 23") + (modify-syntax-entry ?/ ". 14") + st) + "Syntax table for `kss-mode'.") + +(defvar kss-font-lock-keywords + `( + ;; CSS selectors + ("^\\([#_[:alnum:]][^:]+\\):[[:alnum:]-]+[[:blank:]]*{" + (1 font-lock-constant-face)) + + ;; Events + (":\\([[:alnum:]-]+\\)[[:blank:]]*{" + (1 font-lock-type-face)) + + ;; Event parameters + ("\\(evt-[[:alnum:]-]+\\):" + (1 font-lock-type-face)) + + ;; KSS keywords + (,(concat (regexp-opt + '("action-client" "action-server" + "evt-load-initial" "evt-timeout-delay" + "evt-timeout-repeat") t) ":") + (1 font-lock-keyword-face)) + ) + "Keyword highlighting specification for `kss-mode'.") + +;; (defvar kss-imenu-generic-expression +;; ...) + +;; (defvar kss-outline-regexp +;; ...) + +;;;###autoload +(define-derived-mode kss-mode fundamental-mode "KSS" + "A major mode for editing KSS files." + :syntax-table kss-mode-syntax-table + + (setq comment-start "/* " + comment-end " */" + comment-start-skip "/\\*[ \n\t]+") + + (set (make-local-variable 'comment-start) "/* ") + (set (make-local-variable 'comment-end) " */") + (set (make-local-variable 'comment-start-skip) "/\\*[ \n\t]+") + + (set (make-local-variable 'font-lock-defaults) + '(kss-font-lock-keywords)) + (set (make-local-variable 'indent-line-function) 'kss-indent-line) +;; (set (make-local-variable 'imenu-generic-expression) +;; kss-imenu-generic-expression) +;; (set (make-local-variable 'outline-regexp) kss-outline-regexp) +) + +;;; Indentation + +(defun kss-indent-line () + "Indent current line of KSS code." + (interactive) + (indent-line-to + (save-excursion + (setq column (kss-calculate-indentation))))) + + +(defun kss-calculate-indentation () + "Return the column to which the current line should be indented." + (forward-line -1) + + (cond ((re-search-forward "{[[:blank:]]*" + (+ (line-end-position) 1) t) 4) + ((looking-at "[[:blank:]]*}[[:blank:]]*$") 0) + ((equal (point-min) (point)) 0) + (t (kss-calculate-indentation)))) + + +(provide 'kss-mode) +;;; kss.el ends here + From jvloothuis at codespeak.net Sat Sep 22 15:15:57 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 22 Sep 2007 15:15:57 +0200 (CEST) Subject: [KSS-checkins] r46822 - kukit/docs/creating-plugins-plone-conf-2007 Message-ID: <20070922131557.EC71C80F7@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 22 15:15:56 2007 New Revision: 46822 Added: kukit/docs/creating-plugins-plone-conf-2007/ Log: From jvloothuis at codespeak.net Sat Sep 22 15:21:11 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 22 Sep 2007 15:21:11 +0200 (CEST) Subject: [KSS-checkins] r46823 - in kukit/docs/creating-plugins-plone-conf-2007: . src src/plonedemo src/plonedemo/plonedemo Message-ID: <20070922132111.D0D3580F7@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 22 15:21:11 2007 New Revision: 46823 Added: kukit/docs/creating-plugins-plone-conf-2007/bootstrap.py kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg kukit/docs/creating-plugins-plone-conf-2007/src/ (props changed) kukit/docs/creating-plugins-plone-conf-2007/src/EXTERNALS.txt kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/ kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/ kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/__init__.py kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/configure.zcml kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/setup.py Log: Added basic builout setup Added: kukit/docs/creating-plugins-plone-conf-2007/bootstrap.py ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/bootstrap.py Sat Sep 22 15:21:11 2007 @@ -0,0 +1,55 @@ +############################################################################## +# +# Copyright (c) 2006 Zope Corporation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +############################################################################## +"""Bootstrap a buildout-based project + +Simply run this script in a directory containing a buildout.cfg. +The script accepts buildout command-line options, so you can +use the -c option to specify an alternate configuration file. + +$Id: bootstrap.py 75593 2007-05-06 21:11:27Z jim $ +""" + +import os, shutil, sys, tempfile, urllib2 + +tmpeggs = tempfile.mkdtemp() + +try: + import pkg_resources +except ImportError: + ez = {} + exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' + ).read() in ez + ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) + + import pkg_resources + +cmd = 'from setuptools.command.easy_install import main; main()' +if sys.platform == 'win32': + cmd = '"%s"' % cmd # work around spawn lamosity on windows + +ws = pkg_resources.working_set +assert os.spawnle( + os.P_WAIT, sys.executable, sys.executable, + '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout', + dict(os.environ, + PYTHONPATH= + ws.find(pkg_resources.Requirement.parse('setuptools')).location + ), + ) == 0 + +ws.add_entry(tmpeggs) +ws.require('zc.buildout') +import zc.buildout.buildout +zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) +shutil.rmtree(tmpeggs) Added: kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg Sat Sep 22 15:21:11 2007 @@ -0,0 +1,43 @@ +[buildout] +find-links = + http://download.zope.org/distribution/ + http://effbot.org/downloads + +parts = scripts plone zope2 instance +eggs = PasteScript +develop = +# src/kssplugindemo +# src/ploneconf + src/kss.templates + +[scripts] +recipe = zc.recipe.egg +eggs = + kss.templates + PasteScript + +[plone] +recipe = plone.recipe.plone + +[zope2] +recipe = plone.recipe.zope2install +url = ${plone:zope2-url} + +[instance] +recipe = plone.recipe.zope2instance +zope2-location = ${zope2:location} +user = admin:admin +http-address = 8080 +debug-mode = on +verbose-security = on +eggs = +# plonedemo +# kssplugindemo + +zeo-client = off +products = ${plone:products} + +zcml= +# plonedemo +# kssplugindemo + Added: kukit/docs/creating-plugins-plone-conf-2007/src/EXTERNALS.txt ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/EXTERNALS.txt Sat Sep 22 15:21:11 2007 @@ -0,0 +1,7 @@ +# +# created by: svn propset svn:externals -F ./EXTERNALS.txt . +# + +kss.templates http://codespeak.net/svn/kukit/kss.templates/trunk + + Added: kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/__init__.py ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/__init__.py Sat Sep 22 15:21:11 2007 @@ -0,0 +1,30 @@ +from Products.CMFCore import utils +from Products.Archetypes.public import process_types, listTypes +from config import GLOBALS, PKG_NAME +from config import AddFilesystemGateway + +from Products.GenericSetup import EXTENSION +from Products.GenericSetup import profile_registry +import Products.CMFPlone.interfaces + +def initialize(context): + import content + profile_registry.registerProfile( name='default', + title='xmlcontent', + description='', + path='profiles/default', + product='xmlcontent', + profile_type=EXTENSION, + for_=Products.CMFPlone.interfaces.IPloneSiteRoot) + + content_types, constructors, ftis = process_types( + listTypes(PKG_NAME), + PKG_NAME) + + utils.ContentInit( + PKG_NAME + ' Content', + content_types = content_types, + permission = AddFilesystemGateway, + extra_constructors = constructors, + fti = ftis, + ).initialize(context) Added: kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/configure.zcml ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/configure.zcml Sat Sep 22 15:21:11 2007 @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + Added: kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/setup.py ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/setup.py Sat Sep 22 15:21:11 2007 @@ -0,0 +1,33 @@ +from setuptools import setup, find_packages + +version = '0.1' + +setup(name='xmlcontent', + version=version, + description="Transparent XML publishing for Zope/Plone", + long_description="""\ +xmlcontent contains a mechanism to publish XML content from the file +system with the full feature set of Zope 3. + +It does this by creating a proxy object for each XML file. Based on a +declaration in the XML file a marker interface is set as well. This +makes it possible to create views and adapters for this proxy object, +thereby being able to display and even index it. +""", + classifiers=[ + "Framework :: Plone", + "License :: OSI Approved :: LGPL", + "Programming Language :: Python", + ], + keywords='plone xml', + author='Jeroen Vloothuis', + author_email='jeroen.vloothuis at xs4all.nl', + url='http://svn.plone.org/svn/collective/xmlcontent', + license='GPL', + packages=find_packages(exclude=['ez_setup']), + include_package_data=True, + zip_safe=False, + install_requires=[ + 'setuptools', + ], + ) From jvloothuis at codespeak.net Sat Sep 22 16:51:40 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 22 Sep 2007 16:51:40 +0200 (CEST) Subject: [KSS-checkins] r46824 - in kukit/kss.templates/trunk: . kss/templates kss/templates/plugin Message-ID: <20070922145140.9FBC38111@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 22 16:51:39 2007 New Revision: 46824 Modified: kukit/kss.templates/trunk/kss/templates/plugin/setup.py_tmpl kukit/kss.templates/trunk/kss/templates/util.py kukit/kss.templates/trunk/setup.py Log: Added the Zope template Modified: kukit/kss.templates/trunk/kss/templates/plugin/setup.py_tmpl ============================================================================== --- kukit/kss.templates/trunk/kss/templates/plugin/setup.py_tmpl (original) +++ kukit/kss.templates/trunk/kss/templates/plugin/setup.py_tmpl Sat Sep 22 16:51:39 2007 @@ -15,7 +15,7 @@ test_suite = '${package}.tests.test_suite', entry_points={ 'kss.plugin': [ - '${project}=${package}.config:${package.capitalize()}' + '${namespace}=${package}.config:${package.capitalize()}' ], }, ) Modified: kukit/kss.templates/trunk/kss/templates/util.py ============================================================================== --- kukit/kss.templates/trunk/kss/templates/util.py (original) +++ kukit/kss.templates/trunk/kss/templates/util.py Sat Sep 22 16:51:39 2007 @@ -3,7 +3,7 @@ class KSSPluginTemplate(Template): _template_dir = 'plugin' summary = 'KSS plugin template' - egg_plugins = ['kss.templates'] + egg_plugins = [] vars = [ var('namespace', 'The namespace for your plugin (something like `my-namespace`)'), Modified: kukit/kss.templates/trunk/setup.py ============================================================================== --- kukit/kss.templates/trunk/setup.py (original) +++ kukit/kss.templates/trunk/setup.py Sat Sep 22 16:51:39 2007 @@ -28,6 +28,7 @@ entry_points={ 'paste.paster_create_template': [ 'kss_plugin=kss.templates.util:KSSPluginTemplate', + 'kss_zope_plugin=kss.templates.util:KSSZopePluginTemplate', ], }, #test_suite='kss.templates.tests.test_suite', From jvloothuis at codespeak.net Sat Sep 22 17:08:01 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 22 Sep 2007 17:08:01 +0200 (CEST) Subject: [KSS-checkins] r46825 - in kukit/kss.templates/trunk/kss/templates/plugin: . ez_setup Message-ID: <20070922150801.3AF9B8115@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 22 17:07:59 2007 New Revision: 46825 Removed: kukit/kss.templates/trunk/kss/templates/plugin/ez_setup/ Modified: kukit/kss.templates/trunk/kss/templates/plugin/setup.py_tmpl Log: Remove ez_setup because it can cause problems with buildout Modified: kukit/kss.templates/trunk/kss/templates/plugin/setup.py_tmpl ============================================================================== --- kukit/kss.templates/trunk/kss/templates/plugin/setup.py_tmpl (original) +++ kukit/kss.templates/trunk/kss/templates/plugin/setup.py_tmpl Sat Sep 22 17:07:59 2007 @@ -1,5 +1,3 @@ -from ez_setup import use_setuptools -use_setuptools() from setuptools import setup, find_packages setup( From jvloothuis at codespeak.net Sat Sep 22 17:39:29 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 22 Sep 2007 17:39:29 +0200 (CEST) Subject: [KSS-checkins] r46826 - in kukit/kss.templates/trunk/kss/templates: plugin/+package+ zope_plugin Message-ID: <20070922153929.EAD6E8131@code0.codespeak.net> Author: jvloothuis Date: Sat Sep 22 17:39:29 2007 New Revision: 46826 Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/setup.py_tmpl Modified: kukit/kss.templates/trunk/kss/templates/plugin/+package+/__init__.py_tmpl Log: Fixed some problems in the Zope plugin template with unneeded code and dependencies on kss.base Modified: kukit/kss.templates/trunk/kss/templates/plugin/+package+/__init__.py_tmpl ============================================================================== --- kukit/kss.templates/trunk/kss/templates/plugin/+package+/__init__.py_tmpl (original) +++ kukit/kss.templates/trunk/kss/templates/plugin/+package+/__init__.py_tmpl Sat Sep 22 17:39:29 2007 @@ -1,8 +0,0 @@ -""" -${package} - -This file loads the finished app from ${package}.config.middleware. - -""" - -from ${package}.wsgiapp import make_app Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/setup.py_tmpl ============================================================================== --- (empty file) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/setup.py_tmpl Sat Sep 22 17:39:29 2007 @@ -0,0 +1,19 @@ +from setuptools import setup, find_packages + +setup( + name=${repr(project)|empty}, + version=${repr(version)|empty}, + #description="", + #author="", + #author_email="", + #url="", + install_requires=["kss.core"], + packages=find_packages(), + include_package_data=True, + test_suite = '${package}.tests.test_suite', + entry_points={ + 'kss.plugin': [ + '${namespace}=${package}.config:${package.capitalize()}' + ], + }, +) From reebalazs at codespeak.net Sun Sep 23 10:29:06 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 23 Sep 2007 10:29:06 +0200 (CEST) Subject: [KSS-checkins] r46837 - kukit/kss.demo/branch/ree-demoload/kss/demo/demo Message-ID: <20070923082906.CA45D80FF@code0.codespeak.net> Author: reebalazs Date: Sun Sep 23 10:29:05 2007 New Revision: 46837 Removed: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/kss_demo_index.pt Log: Remove unneeded file Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/demo/kss_demo_index.pt ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/demo/kss_demo_index.pt Sun Sep 23 10:29:05 2007 +++ (empty file) @@ -1,55 +0,0 @@ - - - - - -

KSS demos

- -

Parameter functions

- -

Selectors

- -

Core syntax

- -

Core plugin

- -

Commands/Actions

- - -

- -

Unit tests

- - - - From jvloothuis at codespeak.net Sun Sep 23 13:32:16 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 23 Sep 2007 13:32:16 +0200 (CEST) Subject: [KSS-checkins] r46838 - kukit/docs/creating-plugins-plone-conf-2007 Message-ID: <20070923113216.265418102@code0.codespeak.net> Author: jvloothuis Date: Sun Sep 23 13:32:14 2007 New Revision: 46838 Modified: kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg Log: Made the link with the demo plugin etc. work Modified: kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg ============================================================================== --- kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg (original) +++ kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg Sun Sep 23 13:32:14 2007 @@ -1,13 +1,12 @@ [buildout] find-links = http://download.zope.org/distribution/ - http://effbot.org/downloads parts = scripts plone zope2 instance eggs = PasteScript develop = -# src/kssplugindemo -# src/ploneconf + src/KSSDemoPlugin + src/plonedemo src/kss.templates [scripts] @@ -31,13 +30,14 @@ debug-mode = on verbose-security = on eggs = -# plonedemo -# kssplugindemo + ${plone:eggs} + kssdemoplugin + plonedemo zeo-client = off products = ${plone:products} zcml= -# plonedemo -# kssplugindemo + plonedemo + kssdemoplugin From jvloothuis at codespeak.net Sun Sep 23 13:32:50 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 23 Sep 2007 13:32:50 +0200 (CEST) Subject: [KSS-checkins] r46839 - in kukit/docs/creating-plugins-plone-conf-2007/src: KSSDemoPlugin KSSDemoPlugin/kssdemoplugin KSSDemoPlugin/kssdemoplugin/javascript KSSDemoPlugin/kssdemoplugin/tests plonedemo plonedemo/plonedemo Message-ID: <20070923113250.496988103@code0.codespeak.net> Author: jvloothuis Date: Sun Sep 23 13:32:49 2007 New Revision: 46839 Added: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/README.txt kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/README.txt kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/__init__.py kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/commands.py kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/config.py kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/configure.zcml kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/helpers.py kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/interfaces.py kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/javascript/ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/javascript/plugin.js kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/tests/ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/tests/__init__.py kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/setup.py Modified: kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/__init__.py kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/configure.zcml kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/setup.py Log: First start of the demo (there is one working value provider) Added: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/README.txt ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/README.txt Sun Sep 23 13:32:49 2007 @@ -0,0 +1,16 @@ + +KSS plugin package "demo-plugin" + +Installation and Setup +====================== + +Install ``KSSDemoPlugin`` using easy_install:: + + easy_install KSSDemoPlugin + +Documentation +============= + +Where to find documentation on this project? You will usually refer +people to the README.txt and other doctests located in package +(kssdemoplugin). Added: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/README.txt ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/README.txt Sun Sep 23 13:32:49 2007 @@ -0,0 +1,29 @@ +================================================ + KSSDemoPlugin +================================================ + +Explain a bit a about your project here. + +Command sets +============ + +Describe the commandsets you provide with examples of how to use +it. The examples will be run as part of the tests. + + >>> from kss.base import KSSCommands, load_plugins + + >>> load_plugins('kss-core') + + >>> from kss.base.selectors import CSS + + >>> from {package}.commands import KssdemopluginCommands + + >>> commands = KSSCommands() + >>> kssdemoplugin = KssdemopluginCommands(commands) + +Add explanations and tests for your actions here. + + >>> kssdemoplugin.replaceInnerHTML(CSS('#someid'), 'example data') + >>> print commands.render() + yourAction(css('#someid'), parameter='example data') + Added: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/__init__.py ============================================================================== Added: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/commands.py ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/commands.py Sun Sep 23 13:32:49 2007 @@ -0,0 +1,10 @@ +from kss.core.kssview import CommandSet + +class KssdemopluginCommands(CommandSet): + + # Add your own actions here, you can use the following code as + # a starting point + def yourAction(self, selector, data): + command = self.commands.addCommand('yourAction', selector) + # Repeat for each parameter you need + command.addParam('parameter', data) Added: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/config.py ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/config.py Sun Sep 23 13:32:49 2007 @@ -0,0 +1,24 @@ +import os + +from kssdemoplugin.commands import KssdemopluginCommands + +package_dir = os.path.dirname(os.path.abspath(__file__)) +javascript_dir = os.path.join(package_dir, 'javascript') + +class Kssdemoplugin(Plugin): + + javascripts = [os.path.join(javascript_dir, 'plugin.js')] + + extra_javascripts = [] + + # if you need extra 3rd party Javascript files put them in the 3rd + # party directory and use the line below + # + # extra_javascripts = [] javascripts_from(os.path.join(package_dir, '3rd_party')) + + commandsets = { + 'KSSDemoPlugin': KssdemopluginCommands, + } + + selectors = [] + Added: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/configure.zcml ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/configure.zcml Sun Sep 23 13:32:49 2007 @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/helpers.py ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/helpers.py Sun Sep 23 13:32:49 2007 @@ -0,0 +1,8 @@ +""" +Helper functions + +All names available in this module will be available under the Pylons h object. +""" +from webhelpers import * +from pylons.helpers import log +from pylons.i18n import get_lang, set_lang Added: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/interfaces.py ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/interfaces.py Sun Sep 23 13:32:49 2007 @@ -0,0 +1,7 @@ +from zope.interface import Interface + +class IKssdemopluginCommands(Interface): + '''Documentation for your command set''' + + def yourAction(selector, data): + '''Documentation on yourAction''' Added: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/javascript/plugin.js ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/javascript/plugin.js Sun Sep 23 13:32:49 2007 @@ -0,0 +1,120 @@ +/* + +In this file you can put your own custom Javascript. In the following +sections you can find examples on how to create the most common +plugins. + +Lines beginning with `;;;` are automatically stripped when served in +production mode. Put these in front of lines with code like assertions +statements or logging calls. (But never put ;;; embedded inside multiline +(), [] or {} constructs like an "if" condition or a "switch" statement.) + +*/ + +// CLOSURE for plugin demo-plugin +// The closure makes all the embedded code private. +new function () { +// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +//----------------------------------------------------------- +// Action example +//----------------------------------------------------------- +kukit.actionsGlobalRegistry.register('demo-plugin-exampleAction', function (oper) { + // The following is used for logging +;;; oper.componentName = '[demo-plugin-exampleAction] action'; + + // Validate the parameters to this action, you can add multiple + // required or optional parameters. Optional parameters will be + // initialized with a default when not passed. + oper.evaluateParameters(['requiredParameter'], + {'optionalParameter': 'default'}); + + // optionally, you can check if a parameter is of a given data type, + // and convert to it. + oper.evalBool('requiredParameter'); + + // You can get at the node for which this action is executed like + // this. An action is always invoked on a single node. Even when + // it applies to multiple nodes (then it will be invoked multiple + // times on each node). + var node = oper.node; + + // Read a parameter from the parameters + var required = oper.parms.requiredParameter; + + // Add your specific action code here +}); +// The line above registers the action under the name +// `demo-plugin-exampleAction`. + +kukit.commandsGlobalRegistry.registerFromAction( + 'demo-plugin-exampleAction', kukit.cr.makeSelectorCommand); +// The line above also defines the action as a command +// with selectors. To make a global command that executes +// without a selector, exactly once, use makeGlobalCommand. +// It is a good idea to always make an action into a command as well. + + + +//----------------------------------------------------------- +// Value provider +//----------------------------------------------------------- +var ExampleProvider = function() {}; +ExampleProvider.prototype = { + // The check function is executed during the parsing of KSS. Use + // this to make sure the arguments are correct. + // Use ;;; in the beginning of each line in check. +;;; check: function(args) { +;;; // An example of what you could check is the argument length +;;; if (args.length != 1) { +;;; // Raise an error in case something is wrong +;;; throw new Error('exampleProvider provider needs 1 argument [message]'); +;;; } +;;; }, + eval: function(args, node) { + // Return the value which for this provider + return window.prompt(args[0]); + } +}; +kukit.pprovidersGlobalRegistry.register( + 'demo-plugin-prompt', ExampleProvider); +// The line above registers the value provider under the name +// `demo-plugin-exampleProvider` + + + + +//----------------------------------------------------------- +// Simple event binder for stateful events +//----------------------------------------------------------- + +var ExampleEventBinder = function() { + // Add your initialization stuff here + this.exampleVar = {}; +}; +ExampleEventBinder.prototype.__bind__ = function(name, func_to_bind, oper) { + // The following is used for logging +;;; oper.componentName = '[demo-plugin-example] event binding'; + + // Validate the parameters to this action, you can add multiple + // required or optional parameters. Optional parameters will be + // initialized with a default when not passed. + oper.evaluateParameters(['delay'], {'repeat': 'true'}); + + // optionally, you can check if a parameter is of a given data type, + // and convert to it. + oper.evalInt('delay'); + oper.evalBool('repeat'); + + // Add your specific event code here +}; + +kukit.eventsGlobalRegistry.register('demo-plugin', 'exampleEvent', + ExampleEventBinder, '__bind__', null); +// The above line registers the demo-plugin-exampleEvent +// with the binder method __bind__. + + +// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +}(); +// END CLOSURE plugin demo-plugin Added: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/tests/__init__.py ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/tests/__init__.py Sun Sep 23 13:32:49 2007 @@ -0,0 +1,12 @@ +import unittest +import doctest + +def test_suite(): + suite = unittest.TestSuite(( + doctest.DocFileSuite( + 'README.txt', + package='kssdemoplugin', + optionflags=doctest.ELLIPSIS|doctest.REPORT_ONLY_FIRST_FAILURE, + ), + )) + return suite Added: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/setup.py ============================================================================== --- (empty file) +++ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/setup.py Sun Sep 23 13:32:49 2007 @@ -0,0 +1,19 @@ +from setuptools import setup, find_packages + +setup( + name='KSSDemoPlugin', + version="", + #description="", + #author="", + #author_email="", + #url="", + install_requires=["kss.core"], + packages=find_packages(), + include_package_data=True, + test_suite = 'kssdemoplugin.tests.test_suite', + entry_points={ + 'kss.plugin': [ + 'demo-plugin=kssdemoplugin.config:Kssdemoplugin' + ], + }, +) Modified: kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/__init__.py ============================================================================== --- kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/__init__.py (original) +++ kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/__init__.py Sun Sep 23 13:32:49 2007 @@ -1,30 +0,0 @@ -from Products.CMFCore import utils -from Products.Archetypes.public import process_types, listTypes -from config import GLOBALS, PKG_NAME -from config import AddFilesystemGateway - -from Products.GenericSetup import EXTENSION -from Products.GenericSetup import profile_registry -import Products.CMFPlone.interfaces - -def initialize(context): - import content - profile_registry.registerProfile( name='default', - title='xmlcontent', - description='', - path='profiles/default', - product='xmlcontent', - profile_type=EXTENSION, - for_=Products.CMFPlone.interfaces.IPloneSiteRoot) - - content_types, constructors, ftis = process_types( - listTypes(PKG_NAME), - PKG_NAME) - - utils.ContentInit( - PKG_NAME + ' Content', - content_types = content_types, - permission = AddFilesystemGateway, - extra_constructors = constructors, - fti = ftis, - ).initialize(context) Modified: kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/configure.zcml ============================================================================== --- kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/configure.zcml (original) +++ kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/configure.zcml Sun Sep 23 13:32:49 2007 @@ -1,38 +1,21 @@ + xmlns:five="http://namespaces.zope.org/five" + xmlns:genericsetup="http://namespaces.zope.org/genericsetup"> - - - - - - - - - - - - + Modified: kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/setup.py ============================================================================== --- kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/setup.py (original) +++ kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/setup.py Sun Sep 23 13:32:49 2007 @@ -2,27 +2,21 @@ version = '0.1' -setup(name='xmlcontent', +setup(name='plonedemo', version=version, - description="Transparent XML publishing for Zope/Plone", - long_description="""\ -xmlcontent contains a mechanism to publish XML content from the file -system with the full feature set of Zope 3. - -It does this by creating a proxy object for each XML file. Based on a -declaration in the XML file a marker interface is set as well. This -makes it possible to create views and adapters for this proxy object, -thereby being able to display and even index it. + description="Demonstration package for the KSS demo plugin", + long_description=""" +This shows the usage of the KSS demo plugin within Plone. """, classifiers=[ "Framework :: Plone", - "License :: OSI Approved :: LGPL", + "License :: OSI Approved :: GPL", "Programming Language :: Python", ], - keywords='plone xml', + keywords='plone kss', author='Jeroen Vloothuis', author_email='jeroen.vloothuis at xs4all.nl', - url='http://svn.plone.org/svn/collective/xmlcontent', +# url='', license='GPL', packages=find_packages(exclude=['ez_setup']), include_package_data=True, From jvloothuis at codespeak.net Sun Sep 23 13:33:44 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 23 Sep 2007 13:33:44 +0200 (CEST) Subject: [KSS-checkins] r46840 - kukit/kss.templates/trunk/kss/templates/plugin/+package+/javascript Message-ID: <20070923113344.BFE418102@code0.codespeak.net> Author: jvloothuis Date: Sun Sep 23 13:33:44 2007 New Revision: 46840 Modified: kukit/kss.templates/trunk/kss/templates/plugin/+package+/javascript/plugin.js_tmpl Log: Fixed the namespace declaration so it actually works Modified: kukit/kss.templates/trunk/kss/templates/plugin/+package+/javascript/plugin.js_tmpl ============================================================================== --- kukit/kss.templates/trunk/kss/templates/plugin/+package+/javascript/plugin.js_tmpl (original) +++ kukit/kss.templates/trunk/kss/templates/plugin/+package+/javascript/plugin.js_tmpl Sun Sep 23 13:33:44 2007 @@ -13,7 +13,7 @@ // CLOSURE for plugin ${namespace} // The closure makes all the embedded code private. -function () { +new function () { // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //----------------------------------------------------------- From jvloothuis at codespeak.net Mon Sep 24 22:05:35 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Mon, 24 Sep 2007 22:05:35 +0200 (CEST) Subject: [KSS-checkins] r46853 - kukit/kss.templates/trunk/kss/templates/plugin/+package+ Message-ID: <20070924200535.789B28102@code0.codespeak.net> Author: jvloothuis Date: Mon Sep 24 22:05:34 2007 New Revision: 46853 Removed: kukit/kss.templates/trunk/kss/templates/plugin/+package+/helpers.py_tmpl Log: Removed silly helpers module (served no purpose) Deleted: /kukit/kss.templates/trunk/kss/templates/plugin/+package+/helpers.py_tmpl ============================================================================== --- /kukit/kss.templates/trunk/kss/templates/plugin/+package+/helpers.py_tmpl Mon Sep 24 22:05:34 2007 +++ (empty file) @@ -1,8 +0,0 @@ -""" -Helper functions - -All names available in this module will be available under the Pylons h object. -""" -from webhelpers import * -from pylons.helpers import log -from pylons.i18n import get_lang, set_lang From gotcha at codespeak.net Tue Sep 25 09:05:20 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Tue, 25 Sep 2007 09:05:20 +0200 (CEST) Subject: [KSS-checkins] r46856 - kukit/kukit.js/trunk/kukit Message-ID: <20070925070520.9974F812E@code0.codespeak.net> Author: gotcha Date: Tue Sep 25 09:05:19 2007 New Revision: 46856 Modified: kukit/kukit.js/trunk/kukit/errors.js kukit/kukit.js/trunk/kukit/eventreg.js kukit/kukit.js/trunk/kukit/forms.js Log: more closures Modified: kukit/kukit.js/trunk/kukit/errors.js ============================================================================== --- kukit/kukit.js/trunk/kukit/errors.js (original) +++ kukit/kukit.js/trunk/kukit/errors.js Tue Sep 25 09:05:19 2007 @@ -19,6 +19,8 @@ kukit.err = new function () { /// MODULE START +var err = this; + /* * Exception factory * @@ -104,27 +106,27 @@ /* Protects a function */ -;;; this.explicitError = function(errorcommand){ +;;; err.explicitError = function(errorcommand){ ;;; var kw = {'errorcommand':errorcommand}; ;;; var message = 'Explicit error'; ;;; return setErrorInfo(null, 'ExplicitError', message, kw); ;;; }; -;;; this.responseParsingError = function(message){ +;;; err.responseParsingError = function(message){ ;;; return setErrorInfo(null, 'ResponseParsingError', message); ;;; }; -;;; this.ruleMergeError = function(message){ +;;; err.ruleMergeError = function(message){ ;;; return setErrorInfo(null, 'RuleMergeError', message); ;;; }; -;;; this.kssSelectorError = function(message){ +;;; err.kssSelectorError = function(message){ ;;; return setErrorInfo(null, 'RuleMergeError', message); ;;; }; -;;; this.parsingError = function(message, cursor){ +;;; err.parsingError = function(message, cursor){ ;;; var kw = {} ;;; if (cursor) { ;;; kw.errpos = cursor.pos; @@ -142,13 +144,13 @@ /* Exceptions that re-throw (annotate) an already caught error */ -;;; this.commandExecutionError = function(e, command){ +;;; err.commandExecutionError = function(e, command){ ;;; var message = 'Command [' + command.name + '] failed'; ;;; return setErrorInfo(e, 'CommandExecutionError', message); ;;; }; -;;; this.eventBindError = function(e, eventNames, eventNamespaces){ +;;; err.eventBindError = function(e, eventNames, eventNamespaces){ ;;; var kw = {}; ;;; kw.eventNames = eventNames; ;;; kw.eventNamespaces = eventNamespaces; @@ -158,19 +160,19 @@ ;;; }; -;;; this.undefinedEventError = function(e, message){ +;;; err.undefinedEventError = function(e, message){ ;;; return setErrorInfo(e, 'UndefinedEventError', message); ;;; }; -;;; this.kssParsingError = function(e, url){ +;;; err.kssParsingError = function(e, url){ ;;; var kw = {url: url} ;;; var message = 'Error parsing KSS at ' + url; ;;; return setErrorInfo(e, 'KssParsingError', message, kw); ;;; }; -;;; this.eventSetupError = function(e, message){ +;;; err.eventSetupError = function(e, message){ ;;; var message = 'Error setting up events'; ;;; return setErrorInfo(e, 'EventSetupError', message); ;;; }; Modified: kukit/kukit.js/trunk/kukit/eventreg.js ============================================================================== --- kukit/kukit.js/trunk/kukit/eventreg.js (original) +++ kukit/kukit.js/trunk/kukit/eventreg.js Tue Sep 25 09:05:19 2007 @@ -17,14 +17,15 @@ * 02111-1307, USA. */ -kukit.er = {}; +kukit.er = new function() { /// MODULE START +var er = this; -kukit.er.eventClassCounter = 0; +var _eventClassCounter = 0; /* * -* class EventRegistry +* class _EventRegistry * * available for plugin registration * @@ -38,7 +39,7 @@ * func must be a class (constructor) function, this is the class that * implements the binder. */ -kukit.er.EventRegistry = function () { +var _EventRegistry = function () { this.content = {}; this.classes = {}; this.eventSets = []; @@ -46,10 +47,10 @@ /* binder registration */ -kukit.er.EventRegistry.prototype.registerBinder = function(className, func) { +_EventRegistry.prototype.registerBinder = function(className, func) { if (typeof(func) == 'undefined') { ;;; kukit.E = 'func argument is mandatory when registering an event'; -;;; kukit.E += ' binder (EventRegistry.registerBinder).'; +;;; kukit.E += ' binder (_EventRegistry.registerBinder).'; throw new Error(kukit.E); } if (this.classes[className]) { @@ -60,16 +61,16 @@ } // Decorate and store the class - kukit.er.decorateEventBinderClass(func); + decorateEventBinderClass(func); this.classes[className] = func; }; -kukit.er.EventRegistry.prototype.existsBinder = function(className) { +_EventRegistry.prototype.existsBinder = function(className) { var func = this.classes[className]; return (typeof(func) != 'undefined'); }; -kukit.er.EventRegistry.prototype.getBinder = function(className) { +_EventRegistry.prototype.getBinder = function(className) { var func = this.classes[className]; if (! func) { // not found @@ -81,25 +82,25 @@ /* events (methods) registration helpers (not to be called directly) */ -kukit.er.EventRegistry.prototype._register = +_EventRegistry.prototype._register = function(namespace, eventName, klass, bindMethodName, defaultActionMethodName, iterName) { if (typeof(defaultActionMethodName) == 'undefined') { -;;; kukit.E = 'Missing arguments when calling [EventRegistry.register].'; +;;; kukit.E = 'Missing arguments when calling [_EventRegistry.register].'; throw new Error(kukit.E); } // Find out the class name. (Not specified now.) var className = klass.prototype.__className__; if (typeof(className) == 'undefined') { // Create a className, and register it too. - className = '' + kukit.er.eventClassCounter; - kukit.er.eventClassCounter += 1; + className = '' + _eventClassCounter; + _eventClassCounter += 1; this.registerBinder(className, klass); klass.prototype.__className__ = className; } if (!eventName) { ;;; kukit.E = '[eventName] argument cannot be empty when registering'; -;;; kukit.E += ' an event with [EventRegistry.register].'; +;;; kukit.E += ' an event with [_EventRegistry.register].'; throw new Error(kukit.E); } var key = this._getKey(namespace, eventName); @@ -110,25 +111,25 @@ } ;;; kukit.E = 'Attempt to register key [' + key; ;;; kukit.E += '] twice when registering'; -;;; kukit.E += ' an event with [EventRegistry.register].'; +;;; kukit.E += ' an event with [_EventRegistry.register].'; throw new Error(kukit.E); } // check bindMethodName and defaultActionMethodName if (bindMethodName && ! klass.prototype[bindMethodName]) { -;;; kukit.E = 'In EventRegistry.register bind method [' + bindMethodName; +;;; kukit.E = 'In _EventRegistry.register bind method [' + bindMethodName; ;;; kukit.E += '] is undefined for event [' + eventName; ;;; kukit.E += '] namespace [' + namespace + '].'; throw new Error(kukit.E); } if (defaultActionMethodName && ! klass.prototype[defaultActionMethodName]) { -;;; kukit.E = 'In EventRegistry.register default action method ['; +;;; kukit.E = 'In _EventRegistry.register default action method ['; ;;; kukit.E += defaultActionMethodName + '] is undefined for event ['; ;;; kukit.E += eventName + '] namespace [' + namespace + '].'; throw new Error(kukit.E); } // check the iterator. - if (! kukit.er.getBindIterator(iterName)) { -;;; kukit.E = 'In EventRegistry.register unknown bind iterator ['; + if (! er.getBindIterator(iterName)) { +;;; kukit.E = 'In _EventRegistry.register unknown bind iterator ['; ;;; kukit.E += iterName + '].'; throw new Error(kukit.E); } @@ -143,7 +144,7 @@ /* events (methods) binding [ForAll] registration */ -kukit.er.EventRegistry.prototype._registerEventSet = +_EventRegistry.prototype._registerEventSet = function(namespace, names, iterName, bindMethodName) { // At this name the values should be checked already. so this should // be called _after_ _register. @@ -157,7 +158,7 @@ /* there are the actual registration methods, to be called from plugins */ -kukit.er.EventRegistry.prototype.register = +_EventRegistry.prototype.register = function(namespace, eventName, klass, bindMethodName, defaultActionMethodName) { this._register(namespace, eventName, klass, bindMethodName, @@ -166,7 +167,7 @@ bindMethodName); }; -kukit.er.EventRegistry.prototype.registerForAllEvents = +_EventRegistry.prototype.registerForAllEvents = function(namespace, eventNames, klass, bindMethodName, defaultActionMethodName, iterName) { if (typeof(eventNames) == 'string') { @@ -180,24 +181,24 @@ this._registerEventSet(namespace, eventNames, iterName, bindMethodName); }; -kukit.er.EventRegistry.prototype._getKey = function(namespace, eventName) { +_EventRegistry.prototype._getKey = function(namespace, eventName) { if (namespace == null) { namespace = ''; } else if (namespace.split('-') > 1) { -;;; kukit.E = 'In [EventRegistry.register], [namespace] cannot have'; +;;; kukit.E = 'In [_EventRegistry.register], [namespace] cannot have'; ;;; kukit.E += 'dashes.'; throw new Error(kukit.E); } return namespace + '-' + eventName; }; -kukit.er.EventRegistry.prototype.exists = function(namespace, eventName) { +_EventRegistry.prototype.exists = function(namespace, eventName) { var key = this._getKey(namespace, eventName); var entry = this.content[key]; return (typeof(entry) != 'undefined'); }; -kukit.er.EventRegistry.prototype.get = function(namespace, eventName) { +_EventRegistry.prototype.get = function(namespace, eventName) { var key = this._getKey(namespace, eventName); var entry = this.content[key]; if (typeof(entry) == 'undefined') { @@ -213,15 +214,14 @@ return entry; }; -kukit.eventsGlobalRegistry = new kukit.er.EventRegistry(); - +kukit.eventsGlobalRegistry = new _EventRegistry(); /* XXX deprecated methods, to be removed asap */ -kukit.er.eventRegistry = {}; -kukit.er.eventRegistry.register = function(namespace, eventName, klass, +var _eventRegistry = {}; +_eventRegistry.register = function(namespace, eventName, klass, bindMethodName, defaultActionMethodName) { -;;; var msg = 'Deprecated kukit.er.eventRegistry.register,'; +;;; var msg = 'Deprecated _eventRegistry.register,'; ;;; msg += ' use kukit.eventsGlobalRegistry.register instead ! ['; ;;; msg += namespace + '-' + eventName + '].'; ;;; kukit.logWarning(msg); @@ -297,7 +297,7 @@ * so we create a new oper below */ -kukit.er.EventBinder__continueEvent__ = +var _EventBinder__continueEvent__ = function(name, node, defaultParameters) { // Trigger a continuation event bound to a given state instance, given node // (or on document, if node = null) @@ -346,7 +346,7 @@ ;;; kukit.logDebug('Continuation event [' + name + '] executed on same node.'); }; -kukit.er.EventBinder__continueEvent_allNodes__ = +var _EventBinder__continueEvent_allNodes__ = function(name, defaultParameters) { // Trigger an event bound to a given state instance, on all nodes. // (or on document, if node = null) @@ -372,21 +372,28 @@ ;;; kukit.logDebug('Event [' + name + '] executed on ' + executed + ' nodes.'); }; -kukit.er.EventBinder_makeFuncToBind = function(name, node) { - var executor = new kukit.er.LateBinder(this, name, node); +var _EventBinder_makeFuncToBind = function(name, node) { + var executor = new er._LateBinder(this, name, node); return function() { executor.executeActions(); }; }; -kukit.er.LateBinder = function(binderInstance, name, node) { +/* +* +* class _LateBinder +* +* postpone binding of actions until called first time +* +*/ +var _LateBinder = function(binderInstance, name, node) { this.binderInstance = binderInstance; this.name = name; this.node = node; this.bound = null; }; -kukit.er.LateBinder.prototype.executeActions = function() { +_LateBinder.prototype.executeActions = function() { if (! this.bound) { ;;; var msg = 'Attempt of late binding for event [' + this.name; ;;; msg += '], node [' + this.node.nodeName + '].'; @@ -413,7 +420,7 @@ this.bound(); }; -kukit.er.EventBinder_triggerEvent = function(name, oper) { +var _EventBinder_triggerEvent = function(name, oper) { // Private. Called from __continueEvent__ or from main event execution. oper.binderInstance = this; if (oper.eventRule) { @@ -441,7 +448,7 @@ /* (default) method call handling */ -kukit.er.EventBinder_callMethod = function(namespace, name, oper, methodName) { +var _EventBinder_callMethod = function(namespace, name, oper, methodName) { // hidden method for calling just a method and checking that is exists. // (called from oper) var method = this[methodName]; @@ -456,13 +463,13 @@ method.call(this, name, oper); }; -kukit.er.decorateEventBinderClass = function(cls) { - cls.prototype.__continueEvent__ = kukit.er.EventBinder__continueEvent__; +var decorateEventBinderClass = function(cls) { + cls.prototype.__continueEvent__ = _EventBinder__continueEvent__; cls.prototype.__continueEvent_allNodes__ = - kukit.er.EventBinder__continueEvent_allNodes__; - cls.prototype._EventBinder_triggerEvent = kukit.er.EventBinder_triggerEvent; - cls.prototype._EventBinder_callMethod = kukit.er.EventBinder_callMethod; - cls.prototype.__makeFuncToBind__ = kukit.er.EventBinder_makeFuncToBind; + _EventBinder__continueEvent_allNodes__; + cls.prototype._EventBinder_triggerEvent = _EventBinder_triggerEvent; + cls.prototype._EventBinder_callMethod = _EventBinder_callMethod; + cls.prototype.__makeFuncToBind__ = _EventBinder_makeFuncToBind; }; /* Event instance registry @@ -473,11 +480,11 @@ * */ -kukit.er.BinderInfoRegistry = function () { +er.BinderInfoRegistry = function () { this.info = {}; }; -kukit.er.BinderInfoRegistry.prototype.getOrCreateBinderInfo = +er.BinderInfoRegistry.prototype.getOrCreateBinderInfo = function (id, className, namespace) { // Get or create the event. var binderInfo = this.info[id]; @@ -489,7 +496,7 @@ var binder = kukit.eventsGlobalRegistry.getBinder(className); var binderInstance = new binder(); - binderInfo = this.info[id] = new kukit.er.BinderInfo(binderInstance); + binderInfo = this.info[id] = new _BinderInfo(binderInstance); // decorate it with id and class binderInstance.__binderId__ = id; @@ -508,7 +515,7 @@ return binderInfo; }; -kukit.er.BinderInfoRegistry.prototype.getBinderInfoById = function (id) { +er.BinderInfoRegistry.prototype.getBinderInfoById = function (id) { // Get an event. var binderInfo = this.info[id]; if (typeof(binderInfo) == 'undefined') { @@ -518,7 +525,7 @@ return binderInfo; }; -kukit.er.BinderInfoRegistry.prototype.getSingletonBinderInfoByName = +er.BinderInfoRegistry.prototype.getSingletonBinderInfoByName = function (namespace, name) { //Get className var className = kukit.eventsGlobalRegistry.get(namespace, name).className; @@ -533,7 +540,7 @@ return binderInfo; }; -kukit.er.BinderInfoRegistry.prototype.startBindingPhase = function () { +er.BinderInfoRegistry.prototype.startBindingPhase = function () { // At the end of the binding phase, we want to process our events. This // must include all the binder instances we bound in this phase. for (var id in this.info) { @@ -543,7 +550,7 @@ } }; -kukit.er.BinderInfoRegistry.prototype.processBindingEvents = function () { +er.BinderInfoRegistry.prototype.processBindingEvents = function () { // At the end of the binding phase, we want to process our events. This // must include all the binder instances we bound in this phase. for (var id in this.info) { @@ -554,30 +561,30 @@ }; /* -* class BinderInfo +* class _BinderInfo * * Information about the given binder instance. This contains the instance and * various binding info. Follows the workflow of the binding in different stages. * */ -kukit.er.BinderInfo = function (binderInstance) { +var _BinderInfo = function (binderInstance) { this.binderInstance = binderInstance; - this.bound = new kukit.er.OperRegistry(); + this.bound = new _OperRegistry(); this.startBindingPhase(); }; -kukit.er.BinderInfo.prototype.getBinderInstance = function () { +_BinderInfo.prototype.getBinderInstance = function () { return this.binderInstance; }; -kukit.er.BinderInfo.prototype.startBindingPhase = function () { +_BinderInfo.prototype.startBindingPhase = function () { // The binding phase starts and it has the information for // the currently on-bound events. - this.binding = new kukit.er.OperRegistry(); + this.binding = new _OperRegistry(); }; -kukit.er.BinderInfo.prototype.bindOper = function (oper) { +_BinderInfo.prototype.bindOper = function (oper) { // We mark a given oper. This means a binding on the binderInstance // for given event, node and eventRule (containing event namespace, // name, and evt- parms.) @@ -588,7 +595,7 @@ this.binding.bindOper(oper); }; -kukit.er.BinderInfo.prototype.processBindingEvents = function () { +_BinderInfo.prototype.processBindingEvents = function () { // We came to the end of the binding phase. Now we process all our binding // events, This will do the actual binding on the browser side. this.binding.processBindingEvents(this.binderInstance); @@ -600,7 +607,7 @@ /* -* class OperRegistry +* class _OperRegistry * * OperRegistry is associated with a binder instance in the * BinderInfoRegistry, and remembers bounding information. @@ -609,13 +616,13 @@ * a given event setup phase. */ -kukit.er.OperRegistry = function () { +var _OperRegistry = function () { this.infoPerName = {}; this.infoPerNode = {}; }; -// XXX XXX XXX we can do this without full cloning, more efficiently. -kukit.er.OperRegistry.prototype.propagateTo = function (newreg) { +// XXX we can do this without full cloning, more efficiently. +_OperRegistry.prototype.propagateTo = function (newreg) { for (var key in this.infoPerName) { var rulesPerName = this.infoPerName[key]; for (var name in rulesPerName) { @@ -625,7 +632,7 @@ } }; -kukit.er.OperRegistry.prototype.checkOperBindable = +_OperRegistry.prototype.checkOperBindable = function (oper, name, nodeHash) { // Check if the binding with this oper could be done. // Throw exception otherwise. @@ -652,7 +659,7 @@ return rulesPerName; }; -kukit.er.OperRegistry.prototype.bindOper = function (oper) { +_OperRegistry.prototype.bindOper = function (oper) { // Marks binding between binderInstance, eventName, node. var name = oper.eventRule.kssSelector.name; var nodeHash = kukit.rd.hashNode(oper.node); @@ -669,7 +676,7 @@ // XXX This will need refactoring. /// We would only want to lookup from our registry and not the other way around. -kukit.er.OperRegistry.prototype.processBindingEvents = +_OperRegistry.prototype.processBindingEvents = function (binderInstance) { var eventRegistry = kukit.eventsGlobalRegistry; for (var i=0; i < eventRegistry.eventSets.length; i++) { @@ -680,7 +687,7 @@ // Process the binding event set. // This will call the actual bindmethods // according to the specified iterator. - var iterator = kukit.er.getBindIterator(eventSet.iterName); + var iterator = er.getBindIterator(eventSet.iterName); iterator.call(this, eventSet, binderInstance); } } @@ -690,7 +697,7 @@ // XXX The following methods will probably disappear as iterators // replace their functionality. -kukit.er.OperRegistry.prototype.getBoundOperForNode = function (name, node) { +_OperRegistry.prototype.getBoundOperForNode = function (name, node) { // Get the oper that is bound to a given eventName // to a node in this binderInstance // returns null, if there is no such oper. @@ -707,7 +714,7 @@ return oper; }; -kukit.er.OperRegistry.prototype.getBoundOpers = function (name) { +_OperRegistry.prototype.getBoundOpers = function (name) { // Get the opers bound to a given eventName (to any node) // in this binderInstance var opers = []; @@ -732,7 +739,7 @@ // given iteration specifies. // -kukit.er.getBindIterator = function(iterName) { +er.getBindIterator = function(iterName) { // attempt to find canonical version of string // and shout if it does not match. // String must start uppercase. @@ -752,10 +759,10 @@ ;;; kukit.logWarning(msg); iterName = canonical; } - return kukit.er.OperRegistry.prototype['_iterate' + iterName]; + return _OperRegistry.prototype['_iterate' + iterName]; }; -kukit.er.OperRegistry.prototype.callBindMethod = +_OperRegistry.prototype.callBindMethod = function (eventSet, binderInstance, p1, p2, p3, p4, p5, p6) { var method = binderInstance[eventSet.bindMethodName]; // Protect the binding for better logging @@ -772,7 +779,7 @@ // This calls the bind method by each bound oper one by one. // Eventname and funcToBind are passed too. // this is the legacy ([EachLegacy]) way -kukit.er.OperRegistry.prototype._iterateEachLegacy = +_OperRegistry.prototype._iterateEachLegacy = function (eventSet, binderInstance) { for (var i=0; i + + + + + - @@ -30,8 +31,8 @@ + + + + + + + + + + + + + + Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/demoview.py_templ ============================================================================== --- (empty file) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/demoview.py_templ Tue Sep 25 10:10:30 2007 @@ -0,0 +1,11 @@ +from kss.core import KSSView, kssaction + +class KSSDemoView(KSSView): + + # Create the server actions needed for your demo. + # Use the following method as example. + @kssaction + def myDemoAction(self): + """my demo action""" + # XXX replace this with what you need to do + self.getCommandSet('core').clearChildNodes('div#demo') Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.kss_templ ============================================================================== --- (empty file) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.kss_templ Tue Sep 25 10:10:30 2007 @@ -0,0 +1,10 @@ + +/* Set up kss rules needed for your demo. + * Use the following rule as an example only. + */ + +div#exampleId:click { + action-server: myAction; + myAction-value: kssAttr(myattr); +} + Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_templ ============================================================================== --- (empty file) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_templ Tue Sep 25 10:10:30 2007 @@ -0,0 +1,16 @@ + + + + + + +

All demos

+

View KSS resource

+ +

My demo

+
+ click me! +
+ + Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/selenium_tests/README.txt_templ ============================================================================== --- (empty file) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/selenium_tests/README.txt_templ Tue Sep 25 10:10:30 2007 @@ -0,0 +1,4 @@ + +Save sour selenium tests into this directory, in html format. +All the tests ending with .html will be processed automatically. + Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/zopeconfig.py_tmpl ============================================================================== --- (empty file) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/zopeconfig.py_tmpl Tue Sep 25 10:10:30 2007 @@ -0,0 +1,35 @@ + +from kss.demo.interfaces import ( + IKSSDemoResource, + IKSSSeleniumTestResource, + ) +from kss.demo.resource import ( + KSSDemo, + KSSSeleniumTestDirectory, + ) +from zope.interface import implements + +# Create a mesh of provided interfaces +# This is needed, because an utility must have a single interface. +class IResource(IKSSDemoResource, IKSSSeleniumTestResource): + pass + +# XXX you do not need to change anything above here +# ------------------------------------------------- + +class KSSDemos(object): + implements(IResource) + + demos = ( + # List your demos here. + # (Second parameter can be a subcategory within the demo if needed.) + KSSDemo('##NAMESPACE##', '', "my_demo.html", "My demo (change this title)"), + + ) + + # directories are relative from the location of this .py file + selenium_tests = ( + # if you only have one test directory, you + # need not change anything here. + KSSSeleniumTestDirectory('selenium_tests'), + ) Modified: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/interfaces.py_tmpl ============================================================================== --- kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/interfaces.py_tmpl (original) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/interfaces.py_tmpl Tue Sep 25 10:10:30 2007 @@ -3,5 +3,5 @@ class I${package.capitalize()}Commands(Interface): '''Documentation for your command set''' - def yourAction(selector, data): - '''Documentation on yourAction''' + def yourCommand(selector, data): + '''Documentation on yourCommand''' From jvloothuis at codespeak.net Tue Sep 25 21:08:13 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 25 Sep 2007 21:08:13 +0200 (CEST) Subject: [KSS-checkins] r46874 - kukit/buildout/kss-ep-2007-presentation Message-ID: <20070925190813.DA36B8142@code0.codespeak.net> Author: jvloothuis Date: Tue Sep 25 21:08:11 2007 New Revision: 46874 Added: kukit/buildout/kss-ep-2007-presentation/ Log: New buildout for the presentation I gave at EP From jvloothuis at codespeak.net Tue Sep 25 21:14:04 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 25 Sep 2007 21:14:04 +0200 (CEST) Subject: [KSS-checkins] r46875 - in kukit/buildout/kss-ep-2007-presentation: . src Message-ID: <20070925191404.A4E428130@code0.codespeak.net> Author: jvloothuis Date: Tue Sep 25 21:14:04 2007 New Revision: 46875 Added: kukit/buildout/kss-ep-2007-presentation/bootstrap.py kukit/buildout/kss-ep-2007-presentation/buildout.cfg kukit/buildout/kss-ep-2007-presentation/src/ (props changed) kukit/buildout/kss-ep-2007-presentation/src/EXTERNALS.txt Log: Initial (non working) version Added: kukit/buildout/kss-ep-2007-presentation/bootstrap.py ============================================================================== --- (empty file) +++ kukit/buildout/kss-ep-2007-presentation/bootstrap.py Tue Sep 25 21:14:04 2007 @@ -0,0 +1,52 @@ +############################################################################## +# +# Copyright (c) 2006 Zope Corporation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +############################################################################## +"""Bootstrap a buildout-based project + +Simply run this script in a directory containing a buildout.cfg. +The script accepts buildout command-line options, so you can +use the -c option to specify an alternate configuration file. + +$Id$ +""" + +import os, shutil, sys, tempfile, urllib2 + +tmpeggs = tempfile.mkdtemp() + +ez = {} +exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' + ).read() in ez +ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) + +import pkg_resources + +cmd = 'from setuptools.command.easy_install import main; main()' +if sys.platform == 'win32': + cmd = '"%s"' % cmd # work around spawn lamosity on windows + +ws = pkg_resources.working_set +assert os.spawnle( + os.P_WAIT, sys.executable, sys.executable, + '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout', + dict(os.environ, + PYTHONPATH= + ws.find(pkg_resources.Requirement.parse('setuptools')).location + ), + ) == 0 + +ws.add_entry(tmpeggs) +ws.require('zc.buildout') +import zc.buildout.buildout +zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) +shutil.rmtree(tmpeggs) Added: kukit/buildout/kss-ep-2007-presentation/buildout.cfg ============================================================================== --- (empty file) +++ kukit/buildout/kss-ep-2007-presentation/buildout.cfg Tue Sep 25 21:14:04 2007 @@ -0,0 +1,16 @@ +[buildout] +parts = +develop = + src/kss.base + src/kss.pylons + src/KSSPylonsWiki +eggs = PasterScript + +[scripts] +recipe = zc.recipe.egg +eggs = + PasterScript + kss.base + kss.pylons + ksspylonswiki + Added: kukit/buildout/kss-ep-2007-presentation/src/EXTERNALS.txt ============================================================================== --- (empty file) +++ kukit/buildout/kss-ep-2007-presentation/src/EXTERNALS.txt Tue Sep 25 21:14:04 2007 @@ -0,0 +1,3 @@ +kss.pylons https://codespeak.net/svn/kukit/kss.pylons/trunk +kss.base http://codespeak.net/svn/kukit/kss.base/trunk +KSSPylonsWiki https://codespeak.net/svn/kukit/KSSPylonsWiki/trunk From jvloothuis at codespeak.net Tue Sep 25 21:19:16 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 25 Sep 2007 21:19:16 +0200 (CEST) Subject: [KSS-checkins] r46877 - in kukit: kss.plugin.scriptaculous kss.scriptaculous Message-ID: <20070925191916.056318148@code0.codespeak.net> Author: jvloothuis Date: Tue Sep 25 21:19:16 2007 New Revision: 46877 Added: kukit/kss.plugin.scriptaculous/ (props changed) - copied from r46876, kukit/kss.scriptaculous/ Removed: kukit/kss.scriptaculous/ Log: New home for the plugin From jvloothuis at codespeak.net Tue Sep 25 22:32:54 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 25 Sep 2007 22:32:54 +0200 (CEST) Subject: [KSS-checkins] r46880 - in kukit/KSSPylonsWiki/trunk: . ez_setup ksspylonswiki ksspylonswiki/config ksspylonswiki/controllers ksspylonswiki/lib ksspylonswiki/models ksspylonswiki/templates Message-ID: <20070925203254.9C6EE814E@code0.codespeak.net> Author: jvloothuis Date: Tue Sep 25 22:32:54 2007 New Revision: 46880 Removed: kukit/KSSPylonsWiki/trunk/ez_setup/ Modified: kukit/KSSPylonsWiki/trunk/development.ini kukit/KSSPylonsWiki/trunk/ksspylonswiki/config/environment.py kukit/KSSPylonsWiki/trunk/ksspylonswiki/config/middleware.py kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/error.py kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/ksspage.py kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/page.py kukit/KSSPylonsWiki/trunk/ksspylonswiki/lib/app_globals.py kukit/KSSPylonsWiki/trunk/ksspylonswiki/lib/base.py kukit/KSSPylonsWiki/trunk/ksspylonswiki/lib/helpers.py kukit/KSSPylonsWiki/trunk/ksspylonswiki/models/__init__.py kukit/KSSPylonsWiki/trunk/ksspylonswiki/templates/autohandler kukit/KSSPylonsWiki/trunk/ksspylonswiki/websetup.py kukit/KSSPylonsWiki/trunk/setup.py Log: Made the wiki demo work again with current kss.base (without effects for now) Modified: kukit/KSSPylonsWiki/trunk/development.ini ============================================================================== --- kukit/KSSPylonsWiki/trunk/development.ini (original) +++ kukit/KSSPylonsWiki/trunk/development.ini Tue Sep 25 22:32:54 2007 @@ -31,7 +31,7 @@ # pylons.database.session_context. # %(here) may include a ':' character on Windows environments; this can # invalidate the URI when specifying a SQLite db via path name -sqlalchemy.dburi = sqlite:///%(here)s/ksswiki.db +sqlalchemy.default.url = sqlite:///%(here)s/ksswiki.db # WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* # Debug mode will enable the interactive debugging tool, allowing ANYONE to Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/config/environment.py ============================================================================== --- kukit/KSSPylonsWiki/trunk/ksspylonswiki/config/environment.py (original) +++ kukit/KSSPylonsWiki/trunk/ksspylonswiki/config/environment.py Tue Sep 25 22:32:54 2007 @@ -1,28 +1,38 @@ import os -import pylons.config +from sqlalchemy import engine_from_config +from pylons import config + import webhelpers from ksspylonswiki.config.routing import make_map +import ksspylonswiki.lib.app_globals as app_globals +import ksspylonswiki.lib.helpers def load_environment(global_conf={}, app_conf={}): - map = make_map(global_conf, app_conf) - # Setup our paths - root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - paths = {'root_path': root_path, - 'controllers': os.path.join(root_path, 'controllers'), - 'templates': [os.path.join(root_path, path) for path in \ - ('components', 'templates')], - 'static_files': os.path.join(root_path, 'public') - } - - # The following template options are passed to your template engines - tmpl_options = {} + # Initialize config with the basic options + + root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + paths = dict(root=root, + controllers=os.path.join(root, 'controllers'), + static_files=os.path.join(root, 'public'), + templates=[os.path.join(root, 'templates')]) + + # Initialize config with the basic options + config.init_app(global_conf, app_conf, package='ksspylonswiki', + template_engine='pylonsmyghty', paths=paths) + + config['routes.map'] = make_map() + config['pylons.g'] = app_globals.Globals() + config['pylons.h'] = ksspylonswiki.lib.helpers + + # Customize templating options via this variable + tmpl_options = config['buffet.template_options'] tmpl_options['myghty.log_errors'] = True tmpl_options['myghty.escapes'] = dict(l=webhelpers.auto_link, s=webhelpers.simple_format) + + + + config['pylons.g'].sa_engine = engine_from_config(config, + 'sqlalchemy.default.') - # Add your own template options config options here, note that all config options will override - # any Pylons config options - - # Return our loaded config object - return pylons.config.Config(tmpl_options, map, paths) Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/config/middleware.py ============================================================================== --- kukit/KSSPylonsWiki/trunk/ksspylonswiki/config/middleware.py (original) +++ kukit/KSSPylonsWiki/trunk/ksspylonswiki/config/middleware.py Tue Sep 25 22:32:54 2007 @@ -1,75 +1,67 @@ -from paste import httpexceptions from paste.cascade import Cascade from paste.urlparser import StaticURLParser from paste.registry import RegistryManager -from paste.deploy.config import ConfigMiddleware, CONFIG from paste.deploy.converters import asbool from pylons.error import error_template from pylons.middleware import ErrorHandler, ErrorDocuments, StaticJavascripts, error_mapper -import pylons.wsgiapp +from pylons.wsgiapp import PylonsApp +from pylons import config -from ksspylonswiki.config.environment import load_environment -import ksspylonswiki.lib.helpers -from ksspylonswiki.lib import app_globals -from kss.pylons import middleware, initialize_command_set, initialize_javascript +from ksspylonswiki.config.environment import load_environment +from kss.pylons import middleware +from kss.base import load_plugins +load_plugins('kss-core') def make_app(global_conf, full_stack=True, **app_conf): - """Create a WSGI application and return it - - global_conf is a dict representing the Paste configuration options, the - paste.deploy.converters should be used when parsing Paste config options - to ensure they're treated properly. - + """Create a Pylons WSGI application and return it + + ``global_conf`` + The inherited configuration for this application. Normally from + the [DEFAULT] section of the Paste ini file. + + ``full_stack`` + Whether or not this application provides a full WSGI stack (by + default, meaning it handles its own exceptions and errors). + Disable full_stack when this application is "managed" by + another WSGI middleware. + + ``app_conf`` + The application's local configuration. Normally specified in the + [app:] section of the Paste ini file (where + defaults to main). """ - # Setup the Paste CONFIG object, adding app_conf/global_conf for legacy code - conf = global_conf.copy() - conf.update(app_conf) - conf.update(dict(app_conf=app_conf, global_conf=global_conf)) - CONFIG.push_process_config(conf) - - # Load our Pylons configuration defaults - config = load_environment(global_conf, app_conf) - config.init_app(global_conf, app_conf, package='ksspylonswiki') - - # Load our default Pylons WSGI app and make g available - app = pylons.wsgiapp.PylonsApp(config, helpers=ksspylonswiki.lib.helpers, - g=app_globals.Globals) - g = app.globals - app = ConfigMiddleware(app, conf) - - # YOUR MIDDLEWARE - # Put your own middleware here, so that any problems are caught by the error - # handling middleware underneath - - # If errror handling and exception catching will be handled by middleware - # for multiple apps, you will want to set full_stack = False in your config - # file so that it can catch the problems. + # Configure the Pylons environment + load_environment(global_conf, app_conf) + + # The Pylons WSGI app + app = PylonsApp() + + # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares) + if asbool(full_stack): - # Change HTTPExceptions to HTTP responses - app = httpexceptions.make_middleware(app, global_conf) - - # Error Handling - app = ErrorHandler(app, global_conf, error_template=error_template, **config.errorware) - - # Display error documents for 401, 403, 404 status codes (if debug is disabled also - # intercepts 500) + # Handle Python exceptions + app = ErrorHandler(app, global_conf, error_template=error_template, + **config['pylons.errorware']) + + # Display error documents for 401, 403, 404 status codes (and + # 500 when debug is disabled) app = ErrorDocuments(app, global_conf, mapper=error_mapper, **app_conf) - + # Establish the Registry for this application app = RegistryManager(app) - - static_app = StaticURLParser(config.paths['static_files']) - javascripts_app = StaticJavascripts() # KSS intialization - initialize_command_set('core', 'scriptaculous') - kss_javascripts_app = middleware.StaticKSSJavascripts() - initialize_javascript(kss_javascripts_app, 'kukit', 'scriptaculous') + kss_javascripts_app = middleware.KSSJavascripts() + extra_javascripts_app = middleware.ExtraJavascripts() - - app = Cascade([static_app, kss_javascripts_app, javascripts_app, app]) + # Static files + javascripts_app = StaticJavascripts() + static_app = StaticURLParser(config['pylons.paths']['static_files']) + app = Cascade([static_app, kss_javascripts_app, + extra_javascripts_app, javascripts_app, app]) return app + Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/error.py ============================================================================== --- kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/error.py (original) +++ kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/error.py Tue Sep 25 22:32:54 2007 @@ -1,33 +1,39 @@ import os.path -from paste import fileapp -from pylons.middleware import media_path, error_document_template -from pylons.util import get_prefix + +import paste.fileapp +from pylons.middleware import error_document_template, media_path + from ksspylonswiki.lib.base import * class ErrorController(BaseController): - """ - Class to generate error documents as and when they are required. This behaviour of this - class can be altered by changing the parameters to the ErrorDocuments middleware in - your config/middleware.py file. + """Generates error documents as and when they are required. + + The ErrorDocuments middleware forwards to ErrorController when error + related status codes are returned from the application. + + This behaviour can be altered by changing the parameters to the + ErrorDocuments middleware in your config/middleware.py file. """ def document(self): - """ - Change this method to change how error documents are displayed - """ - page = error_document_template % { - 'prefix': get_prefix(request.environ), - 'code': request.params.get('code', ''), - 'message': request.params.get('message', ''), - } - return Response(page) + """Render the error document""" + page = error_document_template % \ + dict(prefix=request.environ.get('SCRIPT_NAME', ''), + code=request.params.get('code', ''), + message=request.params.get('message', '')) + return page def img(self, id): + """Serve Pylons' stock images""" return self._serve_file(os.path.join(media_path, 'img', id)) - + def style(self, id): + """Serve Pylons' stock stylesheets""" return self._serve_file(os.path.join(media_path, 'style', id)) def _serve_file(self, path): - fapp = fileapp.FileApp(path) + """Call Paste's FileApp (a WSGI application) to serve the file + at the specified path + """ + fapp = paste.fileapp.FileApp(path) return fapp(request.environ, self.start_response) Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/ksspage.py ============================================================================== --- kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/ksspage.py (original) +++ kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/ksspage.py Tue Sep 25 22:32:54 2007 @@ -1,91 +1,103 @@ -from ksspylonswiki.lib.base import * -from kss.commands import KSSCommands -from kss.commands.selectors import CSS -from kss.pylons import render_kss_response +from ksspylonswiki.lib.base import response, BaseController, c, request, render +from kss.base import KSSCommands +from kss.base.selectors import CSS + +from ksspylonswiki.models import Page, Session, wikiwords + class KsspageController(BaseController): + def _dispatch_call(self): + response.headers['Content-Type'] = 'text/xml' + commands = super(KsspageController, self)._dispatch_call() + return commands.render() + def edit(self): title = request.params.get('title') c.title = title - page = model.Page.get_by(title=title) + page_q = Session.query(Page) + page = page_q.filter_by(title=title).first() if page: c.content = page.content form = render('/edit.myt', fragment=True) commands = KSSCommands() - core = commands.get('core') - core.replace_inner_html(CSS('div.content'), form) + core = commands.lookup('core') + core.replaceInnerHTML(CSS('div.content'), form) - return render_kss_response(commands) + return commands def save(self): title = request.params.get('title') - page = model.Page.get_by(title=title) + page_q = Session.query(Page) + page = page_q.filter_by(title=title).first() if not page: - page = model.Page() + page = Page() page.title = title page.content = request.params.get('content','') c.title = page.title c.content = page.get_wiki_content() c.message = 'Successfully saved' - page.flush() + Session.save(page) + Session.commit() html = render('/page.myt', fragment=True) commands = KSSCommands() - core = commands.get('core') - core.replace_inner_html(CSS('div.content'), html) + core = commands.lookup('core') + core.replaceInnerHTML(CSS('div.content'), html) core.insert_html_as_first_child( CSS('div.content'), '') - scriptaculous = commands.get('scriptaculous') - scriptaculous.effect(CSS('div.message'), 'blinddown') - scriptaculous.effect(CSS('div.message'), 'blindup', delay=2) +# scriptaculous = commands.lookup('scriptaculous') +# scriptaculous.effect(CSS('div.message'), 'blinddown') +# scriptaculous.effect(CSS('div.message'), 'blindup', delay=2) - return render_kss_response(commands) + return commands def page(self): title = request.params.get('title') - page = model.Page.get_by(title=title) + page_q = Session.query(Page) + page = page_q.filter_by(title=title).first() c.title = title if page: c.content = page.get_wiki_content() commands = KSSCommands() - core = commands.get('core') + core = commands.lookup('core') content_html = render('/page.myt', fragment=True) - core.replace_inner_html(CSS('div.content'), content_html) + core.replaceInnerHTML(CSS('div.content'), content_html) footer_html = render('/footer.myt', fragment=True) - core.replace_html(CSS('p.footer'), footer_html) + core.replaceHTML(CSS('p.footer'), footer_html) - return render_kss_response(commands) + return commands def list(self): - c.titles = [page.title for page in model.Page.select()] + c.titles = [page.title for page in Session.query(Page).all()] html = render('/titles.myt', fragment=True) commands = KSSCommands() - core = commands.get('core') - core.replace_inner_html(CSS('div.content'), html) + core = commands.lookup('core') + core.replaceInnerHTML(CSS('div.content'), html) footer_html = render('/footer.myt', fragment=True) - core.replace_html(CSS('p.footer'), footer_html) + core.replaceHTML(CSS('p.footer'), footer_html) - return render_kss_response(commands) + return commands def delete(self): title = request.params.get('title') - page = model.Page.get_by(title=title) - page.delete() - page.flush() + page_q = Session.query(Page) + page = page_q.filter_by(title=title).first() + Session.delete(page) + Session.commit() commands = KSSCommands() - scriptaculous = commands.get('scriptaculous') - scriptaculous.effect(CSS('li.kssattr-title-%s' % title), 'fade') +# scriptaculous = commands.lookup('scriptaculous') +# scriptaculous.effect(CSS('li.kssattr-title-%s' % title), 'fade') - return render_kss_response(commands) + return commands Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/page.py ============================================================================== --- kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/page.py (original) +++ kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/page.py Tue Sep 25 22:32:54 2007 @@ -1,44 +1,48 @@ -from ksspylonswiki.lib.base import * -from pylons.database import make_session +from ksspylonswiki.models import Page, Session, wikiwords +from ksspylonswiki.lib.base import c, render_response, request, BaseController + +from pylons.controllers.util import abort class PageController(BaseController): - def __before__(self): - model.ctx.current = make_session() def index(self, title): - page = model.Page.get_by(title=title) + page_q = Session.query(Page) + page = page_q.filter_by(title=title).first() if page: c.content = page.get_wiki_content() return render_response('/page.myt') - elif model.wikiwords.match(title): + elif wikiwords.match(title): return render_response('/new_page.myt') abort(404) def edit(self, title): - page = model.Page.get_by(title=title) + page_q = Session.query(Page) + page = page_q.filter_by(title=title).first() if page: c.content = page.content return render_response('/edit.myt') def save(self, title): - page = model.Page.get_by(title=title) + page_q = Session.query(Page) + page = page_q.filter_by(title=title).first() if not page: - page = model.Page() + page = Page() page.title = title page.content = request.params.get('content','') c.title = page.title c.content = page.get_wiki_content() c.message = 'Successfully saved' - page.flush() + Session.save(page) + Session.commit() return render_response('/page.myt') def list(self): - c.titles = [page.title for page in model.Page.select()] + c.titles = [page.title for page in Session.query(Page).all()] return render_response('/titles.myt') def delete(self, title): - page = model.Page.get_by(title=title) - page.delete() - page.flush() + page_q = Session.query(Page) + page = page_q.filter_by(title=title).first() + Session.delete(page) + Session.commit() return self.list() - Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/lib/app_globals.py ============================================================================== --- kukit/KSSPylonsWiki/trunk/ksspylonswiki/lib/app_globals.py (original) +++ kukit/KSSPylonsWiki/trunk/ksspylonswiki/lib/app_globals.py Tue Sep 25 22:32:54 2007 @@ -1,35 +1,14 @@ -class Globals(object): +"""The application's Globals object""" +from pylons import config - def __init__(self, global_conf, app_conf, **extra): - """ - Globals acts as a container for objects available throughout - the life of the application. +class Globals(object): + """Globals acts as a container for objects available throughout the + life of the application + """ - One instance of Globals is created by Pylons during - application initialization and is available during requests - via the 'g' variable. - - ``global_conf`` - The same variable used throughout ``config/middleware.py`` - namely, the variables from the ``[DEFAULT]`` section of the - configuration file. - - ``app_conf`` - The same ``kw`` dictionary used throughout - ``config/middleware.py`` namely, the variables from the - section in the config file for your application. - - ``extra`` - The configuration returned from ``load_config`` in - ``config/middleware.py`` which may be of use in the setup of - your global variables. - - """ - pass - - def __del__(self): - """ - Put any cleanup code to be run when the application finally exits - here. + def __init__(self): + """One instance of Globals is created during application + initialization and is available during requests via the 'g' + variable """ pass Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/lib/base.py ============================================================================== --- kukit/KSSPylonsWiki/trunk/ksspylonswiki/lib/base.py (original) +++ kukit/KSSPylonsWiki/trunk/ksspylonswiki/lib/base.py Tue Sep 25 22:32:54 2007 @@ -1,4 +1,4 @@ -from pylons import Response, c, g, cache, request, session +from pylons import c, cache, config, g, request, response, session from pylons.controllers import WSGIController from pylons.decorators import jsonify, validate from pylons.templating import render, render_response @@ -12,7 +12,11 @@ # Insert any code to be run per request here. The Routes match # is under environ['pylons.routes_dict'] should you want to check # the action or route vars here - return WSGIController.__call__(self, environ, start_response) + try: + return WSGIController.__call__(self, environ, start_response) + finally: + model.Session.remove() + # Include the '_' function in the public names __all__ = [__name for __name in locals().keys() if not __name.startswith('_') \ Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/lib/helpers.py ============================================================================== --- kukit/KSSPylonsWiki/trunk/ksspylonswiki/lib/helpers.py (original) +++ kukit/KSSPylonsWiki/trunk/ksspylonswiki/lib/helpers.py Tue Sep 25 22:32:54 2007 @@ -7,4 +7,4 @@ from pylons.helpers import log from pylons.i18n import get_lang, set_lang from kss.pylons.helpers import * -from kss.scriptaculous.helpers import * +# from kss.scriptaculous.helpers import * Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/models/__init__.py ============================================================================== --- kukit/KSSPylonsWiki/trunk/ksspylonswiki/models/__init__.py (original) +++ kukit/KSSPylonsWiki/trunk/ksspylonswiki/models/__init__.py Tue Sep 25 22:32:54 2007 @@ -1,19 +1,26 @@ -from sqlalchemy import * -from sqlalchemy.ext.assignmapper import assign_mapper -from pylons.database import create_engine -from pylons.database import session_context as ctx import re import sets -import ksspylonswiki.lib.helpers as h + from docutils.core import publish_parts +from pylons import config +from sqlalchemy import Column, MetaData, Table, types +from sqlalchemy.orm import mapper +from sqlalchemy.orm import scoped_session, sessionmaker + +import ksspylonswiki.lib.helpers as h + +Session = scoped_session(sessionmaker(autoflush=True, transactional=True, + bind=config['pylons.g'].sa_engine)) + +metadata = MetaData() + wikiwords = re.compile(r"\b([A-Z]\w+[A-Z]+\w+)") -meta = MetaData() -pages_table = Table('pages', meta, - Column('title', String(40), primary_key=True), - Column('content', String(), default='')) +pages_table = Table('pages', metadata, + Column('title', types.String(40), primary_key=True), + Column('content', types.String(), default='')) class Page(object): def __str__(self): @@ -29,4 +36,4 @@ content = content.replace(title, link) return content -page_mapper = assign_mapper(ctx, Page, pages_table) +page_mapper = mapper(Page, pages_table) Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/templates/autohandler ============================================================================== --- kukit/KSSPylonsWiki/trunk/ksspylonswiki/templates/autohandler (original) +++ kukit/KSSPylonsWiki/trunk/ksspylonswiki/templates/autohandler Tue Sep 25 22:32:54 2007 @@ -3,8 +3,7 @@ QuickWiki <% h.stylesheet_link_tag('/quick.css') %> <% h.stylesheet_link_tag('/quick.css') %> - <% h.kss_javascripts() %> - <% h.scriptaculous_javascripts() %> + <% h.kss_javascripts() %> <% h.kss_base_tag() %> Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/websetup.py ============================================================================== --- kukit/KSSPylonsWiki/trunk/ksspylonswiki/websetup.py (original) +++ kukit/KSSPylonsWiki/trunk/ksspylonswiki/websetup.py Tue Sep 25 22:32:54 2007 @@ -1,27 +1,30 @@ -import paste.deploy -from pylons.database import create_engine -import ksspylonswiki.models as model +import logging + +from paste.deploy import appconfig +from pylons import config + +from ksspylonswiki.config.environment import load_environment + +log = logging.getLogger(__name__) def setup_config(command, filename, section, vars): - """ - Place any commands to setup ksspylonswiki here. - """ - conf = paste.deploy.appconfig('config:' + filename) - conf.update(dict(app_conf=conf.local_conf, global_conf=conf.global_conf)) - paste.deploy.CONFIG.push_process_config(conf) - - uri = conf['sqlalchemy.dburi'] - engine = create_engine(uri) + """Place any commands to setup quickwiki here""" + conf = appconfig('config:' + filename) + load_environment(conf.global_conf, conf.local_conf) - print 'Connecting to database', uri - model.meta.connect(engine) + # Populate the DB on 'paster setup-app' + import ksspylonswiki.models as model - print 'Creating tables' - model.meta.create_all() + log.info("Setting up database connectivity...") + engine = config['pylons.g'].sa_engine + log.info("Creating tables...") + model.metadata.create_all(bind=engine) + log.info("Successfully set up.") - print 'Adding front page data' + log.info("Adding front page data...") page = model.Page() page.title = 'FrontPage' - page.content = 'Welcome to the KSSWiki front page.' - page.flush() - print 'Successfully setup.' + page.content = 'Welcome to the QuickWiki front page.' + model.Session.save(page) + model.Session.commit() + log.info("Successfully set up.") Modified: kukit/KSSPylonsWiki/trunk/setup.py ============================================================================== --- kukit/KSSPylonsWiki/trunk/setup.py (original) +++ kukit/KSSPylonsWiki/trunk/setup.py Tue Sep 25 22:32:54 2007 @@ -1,5 +1,3 @@ -from ez_setup import use_setuptools -use_setuptools() from setuptools import setup, find_packages setup( @@ -11,7 +9,7 @@ author_email="jeroen.vloothuis at xs4all.nl", #url="", install_requires=["Pylons>=0.9.5", "docutils==0.4", "SQLAlchemy>=0.3.6", - ],#"kss.commands>=dev"], + "Myghty"],#"kss.commands>=dev"], packages=find_packages(), include_package_data=True, test_suite = 'nose.collector', From jvloothuis at codespeak.net Tue Sep 25 22:33:20 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Tue, 25 Sep 2007 22:33:20 +0200 (CEST) Subject: [KSS-checkins] r46881 - in kukit/buildout/kss-ep-2007-presentation: . src Message-ID: <20070925203320.6A5828159@code0.codespeak.net> Author: jvloothuis Date: Tue Sep 25 22:33:20 2007 New Revision: 46881 Modified: kukit/buildout/kss-ep-2007-presentation/buildout.cfg kukit/buildout/kss-ep-2007-presentation/src/ (props changed) kukit/buildout/kss-ep-2007-presentation/src/EXTERNALS.txt Log: Made the buildout work (requires Python 2.5) Modified: kukit/buildout/kss-ep-2007-presentation/buildout.cfg ============================================================================== --- kukit/buildout/kss-ep-2007-presentation/buildout.cfg (original) +++ kukit/buildout/kss-ep-2007-presentation/buildout.cfg Tue Sep 25 22:33:20 2007 @@ -1,15 +1,17 @@ [buildout] -parts = +parts = scripts develop = src/kss.base src/kss.pylons src/KSSPylonsWiki -eggs = PasterScript + +eggs = PasteScript + [scripts] recipe = zc.recipe.egg eggs = - PasterScript + PasteScript kss.base kss.pylons ksspylonswiki Modified: kukit/buildout/kss-ep-2007-presentation/src/EXTERNALS.txt ============================================================================== --- kukit/buildout/kss-ep-2007-presentation/src/EXTERNALS.txt (original) +++ kukit/buildout/kss-ep-2007-presentation/src/EXTERNALS.txt Tue Sep 25 22:33:20 2007 @@ -1,3 +1,4 @@ kss.pylons https://codespeak.net/svn/kukit/kss.pylons/trunk kss.base http://codespeak.net/svn/kukit/kss.base/trunk KSSPylonsWiki https://codespeak.net/svn/kukit/KSSPylonsWiki/trunk +kss.plugin.scriptaculous https://codespeak.net/svn/kukit/kss.plugin.scriptaculous/trunk From reebalazs at codespeak.net Wed Sep 26 08:22:35 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 26 Sep 2007 08:22:35 +0200 (CEST) Subject: [KSS-checkins] r46886 - in kukit/kss.templates/trunk/kss/templates: plugin/+package+/javascript zope_plugin/+package+ zope_plugin/+package+/demo zope_plugin/+package+/demo/selenium_tests Message-ID: <20070926062235.53AE48150@code0.codespeak.net> Author: reebalazs Date: Wed Sep 26 08:22:33 2007 New Revision: 46886 Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/README.txt_tmpl kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/demoview.py_tmpl - copied unchanged from r46857, kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/demoview.py_templ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.kss_tmpl - copied unchanged from r46857, kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.kss_templ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_tmpl - copied, changed from r46857, kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_templ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/selenium_tests/README.txt_tmpl - copied unchanged from r46857, kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/selenium_tests/README.txt_templ Removed: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/demoview.py_templ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.kss_templ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_templ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/selenium_tests/README.txt_templ Modified: kukit/kss.templates/trunk/kss/templates/plugin/+package+/javascript/plugin.js_tmpl kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/zopeconfig.py_tmpl Log: Fix templates Modified: kukit/kss.templates/trunk/kss/templates/plugin/+package+/javascript/plugin.js_tmpl ============================================================================== --- kukit/kss.templates/trunk/kss/templates/plugin/+package+/javascript/plugin.js_tmpl (original) +++ kukit/kss.templates/trunk/kss/templates/plugin/+package+/javascript/plugin.js_tmpl Wed Sep 26 08:22:33 2007 @@ -92,7 +92,7 @@ ExampleEventBinder.prototype.__bind__ = function(name, func_to_bind, oper) { // The following is used for logging -;;; oper.componentName = '[${namespace}-example] event binding'; +;;; oper.componentName = '[${namespace}-exampleEvent] event binding'; // Validate the parameters to this action, you can add multiple // required or optional parameters. Optional parameters will be Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/README.txt_tmpl ============================================================================== --- (empty file) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/README.txt_tmpl Wed Sep 26 08:22:33 2007 @@ -0,0 +1,8 @@ +================================================ +${project.center(48)} +================================================ + +Explain a bit a about your project here. + +(XXX TODO add zope-specific text here) + Deleted: /kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/demoview.py_templ ============================================================================== --- /kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/demoview.py_templ Wed Sep 26 08:22:33 2007 +++ (empty file) @@ -1,11 +0,0 @@ -from kss.core import KSSView, kssaction - -class KSSDemoView(KSSView): - - # Create the server actions needed for your demo. - # Use the following method as example. - @kssaction - def myDemoAction(self): - """my demo action""" - # XXX replace this with what you need to do - self.getCommandSet('core').clearChildNodes('div#demo') Deleted: /kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.kss_templ ============================================================================== --- /kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.kss_templ Wed Sep 26 08:22:33 2007 +++ (empty file) @@ -1,10 +0,0 @@ - -/* Set up kss rules needed for your demo. - * Use the following rule as an example only. - */ - -div#exampleId:click { - action-server: myAction; - myAction-value: kssAttr(myattr); -} - Deleted: /kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_templ ============================================================================== --- /kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_templ Wed Sep 26 08:22:33 2007 +++ (empty file) @@ -1,16 +0,0 @@ - - - - - - -

All demos

-

View KSS resource

- -

My demo

-
- click me! -
- - Copied: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_tmpl (from r46857, kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_templ) ============================================================================== --- kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_templ (original) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_tmpl Wed Sep 26 08:22:33 2007 @@ -1,7 +1,7 @@ + tal:attributes="href string:$${context/@@absolute_url}/++resource++my_demo.kss"/> Deleted: /kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/selenium_tests/README.txt_templ ============================================================================== --- /kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/selenium_tests/README.txt_templ Wed Sep 26 08:22:33 2007 +++ (empty file) @@ -1,4 +0,0 @@ - -Save sour selenium tests into this directory, in html format. -All the tests ending with .html will be processed automatically. - Modified: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/zopeconfig.py_tmpl ============================================================================== --- kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/zopeconfig.py_tmpl (original) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/zopeconfig.py_tmpl Wed Sep 26 08:22:33 2007 @@ -23,7 +23,7 @@ demos = ( # List your demos here. # (Second parameter can be a subcategory within the demo if needed.) - KSSDemo('##NAMESPACE##', '', "my_demo.html", "My demo (change this title)"), + KSSDemo('${namespace}', '', 'my_demo.html', 'My demo (change this title)'), ) From reebalazs at codespeak.net Wed Sep 26 09:17:51 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Wed, 26 Sep 2007 09:17:51 +0200 (CEST) Subject: [KSS-checkins] r46887 - in kukit/kss.demo/branch/ree-demoload/kss/demo: browser demo Message-ID: <20070926071751.B7266815D@code0.codespeak.net> Author: reebalazs Date: Wed Sep 26 09:17:50 2007 New Revision: 46887 Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/browser/kss_demo_index.pt kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml Log: Plugin resource utility must be named. (And: small change in index template) Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/browser/kss_demo_index.pt ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/browser/kss_demo_index.pt (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/browser/kss_demo_index.pt Wed Sep 26 09:17:50 2007 @@ -14,7 +14,7 @@

Core plugin

-

Plugin namespace core

+

Plugin namespace: core

Category

Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml Wed Sep 26 09:17:50 2007 @@ -20,6 +20,7 @@ Author: reebalazs Date: Wed Sep 26 09:27:41 2007 New Revision: 46888 Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/__init__.py_tmpl Modified: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/configure.zcml_tmpl kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/demoview.py_tmpl kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_tmpl Log: Fix resource utility to be named utility, and modify the example demo to actually do something. Added: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/__init__.py_tmpl ============================================================================== --- (empty file) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/__init__.py_tmpl Wed Sep 26 09:27:41 2007 @@ -0,0 +1,4 @@ +"""\ +Module init +""" + Modified: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/configure.zcml_tmpl ============================================================================== --- kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/configure.zcml_tmpl (original) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/configure.zcml_tmpl Wed Sep 26 09:27:41 2007 @@ -10,6 +10,7 @@ View KSS resource

My demo

-
+
click me!
From jvloothuis at codespeak.net Wed Sep 26 17:24:44 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Wed, 26 Sep 2007 17:24:44 +0200 (CEST) Subject: [KSS-checkins] r46903 - in kukit/kss.plugin.scriptaculous/trunk: . kss/plugin kss/plugin/scriptaculous kss/plugin/scriptaculous/3rd_party kss/plugin/scriptaculous/javascript kss/plugin/scriptaculous/scriptaculous kss/scriptaculous Message-ID: <20070926152444.1921B8182@code0.codespeak.net> Author: jvloothuis Date: Wed Sep 26 17:24:43 2007 New Revision: 46903 Added: kukit/kss.plugin.scriptaculous/trunk/kss/plugin/ kukit/kss.plugin.scriptaculous/trunk/kss/plugin/__init__.py (props changed) - copied unchanged from r46877, kukit/kss.plugin.scriptaculous/trunk/kss/__init__.py kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/ (props changed) - copied from r46877, kukit/kss.plugin.scriptaculous/trunk/kss/scriptaculous/ kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/3rd_party/ (props changed) - copied from r46877, kukit/kss.plugin.scriptaculous/trunk/kss/scriptaculous/scriptaculous/3rd_party/ kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/javascript/ kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/javascript/plugin.js (props changed) - copied unchanged from r46877, kukit/kss.plugin.scriptaculous/trunk/kss/scriptaculous/scriptaculous/plugin.js Removed: kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/scriptaculous/ kukit/kss.plugin.scriptaculous/trunk/kss/scriptaculous/ Modified: kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/__init__.py kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/commands.py kukit/kss.plugin.scriptaculous/trunk/setup.py Log: Made the plugin work with kss.base Modified: kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/__init__.py ============================================================================== --- kukit/kss.plugin.scriptaculous/trunk/kss/scriptaculous/__init__.py (original) +++ kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/__init__.py Wed Sep 26 17:24:43 2007 @@ -6,10 +6,3 @@ __path__ = extend_path(__path__, __name__) -import os -from kss.pylons.middleware import StaticJavascriptPlugin - -javascript_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), - 'scriptaculous') - -javascript_app = StaticJavascriptPlugin(javascript_path) Modified: kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/commands.py ============================================================================== --- kukit/kss.plugin.scriptaculous/trunk/kss/scriptaculous/commands.py (original) +++ kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/commands.py Wed Sep 26 17:24:43 2007 @@ -1,4 +1,4 @@ -from kss.commands import KSSCommandSet +from kss.base.commands import KSSCommandSet class KSSScriptaculousCommands(KSSCommandSet): def effect(self, selector, type, queue=None, scope=None, delay=None): @@ -25,4 +25,4 @@ raise ValueError('Queue must be `front` or `end`') self.commands.add('effect', selector, type=type, - queue=queue, scope=scope, delay=delay) + queue=queue, scope=scope, delay=delay and str(delay)) Modified: kukit/kss.plugin.scriptaculous/trunk/setup.py ============================================================================== --- kukit/kss.plugin.scriptaculous/trunk/setup.py (original) +++ kukit/kss.plugin.scriptaculous/trunk/setup.py Wed Sep 26 17:24:43 2007 @@ -2,7 +2,7 @@ version = '0.1' -setup(name='kss.scriptaculous', +setup(name='kss.plugin.scriptaculous', version=version, description="KSS (Kinetic Style Sheets) scriptaculous support", long_description="""\ @@ -23,15 +23,11 @@ zip_safe=False, install_requires=[ 'setuptools', - 'kss.pluginregistry>=dev', - 'kss.commands>=dev', + 'kss.base>=dev', ], entry_points={ - 'kss.javascript': [ - 'scriptaculous=kss.scriptaculous:javascript_app', - ], - 'kss.commandset': [ - 'scriptaculous=kss.scriptaculous.commands:KSSScriptaculousCommands' + 'kss.plugin': [ + 'scriptaculous-effects=kss.plugin.scriptaculous.config:Scriptaculous' ], }, test_suite='kss.scriptaculous.tests.test_suite', From jvloothuis at codespeak.net Wed Sep 26 17:25:43 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Wed, 26 Sep 2007 17:25:43 +0200 (CEST) Subject: [KSS-checkins] r46904 - in kukit/KSSPylonsWiki/trunk/ksspylonswiki: config controllers Message-ID: <20070926152543.191638183@code0.codespeak.net> Author: jvloothuis Date: Wed Sep 26 17:25:42 2007 New Revision: 46904 Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/config/middleware.py kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/ksspage.py Log: Wiki now support the scriptaculous plugin (again) Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/config/middleware.py ============================================================================== --- kukit/KSSPylonsWiki/trunk/ksspylonswiki/config/middleware.py (original) +++ kukit/KSSPylonsWiki/trunk/ksspylonswiki/config/middleware.py Wed Sep 26 17:25:42 2007 @@ -14,7 +14,7 @@ from kss.pylons import middleware from kss.base import load_plugins -load_plugins('kss-core') +load_plugins('kss-core', 'scriptaculous-effects') def make_app(global_conf, full_stack=True, **app_conf): """Create a Pylons WSGI application and return it Modified: kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/ksspage.py ============================================================================== --- kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/ksspage.py (original) +++ kukit/KSSPylonsWiki/trunk/ksspylonswiki/controllers/ksspage.py Wed Sep 26 17:25:42 2007 @@ -2,7 +2,7 @@ from kss.base import KSSCommands from kss.base.selectors import CSS -from ksspylonswiki.models import Page, Session, wikiwords +from ksspylonswiki.models import Page, Session class KsspageController(BaseController): @@ -49,9 +49,9 @@ core.insert_html_as_first_child( CSS('div.content'), '') -# scriptaculous = commands.lookup('scriptaculous') -# scriptaculous.effect(CSS('div.message'), 'blinddown') -# scriptaculous.effect(CSS('div.message'), 'blindup', delay=2) + scriptaculous = commands.lookup('scriptaculous') + scriptaculous.effect(CSS('div.message'), 'blinddown') + scriptaculous.effect(CSS('div.message'), 'blindup', delay=2) return commands @@ -96,8 +96,8 @@ commands = KSSCommands() -# scriptaculous = commands.lookup('scriptaculous') -# scriptaculous.effect(CSS('li.kssattr-title-%s' % title), 'fade') + scriptaculous = commands.lookup('scriptaculous') + scriptaculous.effect(CSS('li.kssattr-title-%s' % title), 'fade') return commands From jvloothuis at codespeak.net Wed Sep 26 17:26:23 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Wed, 26 Sep 2007 17:26:23 +0200 (CEST) Subject: [KSS-checkins] r46905 - kukit/kss.base/trunk/kss/base Message-ID: <20070926152623.23A928184@code0.codespeak.net> Author: jvloothuis Date: Wed Sep 26 17:26:22 2007 New Revision: 46905 Modified: kukit/kss.base/trunk/kss/base/javascript.py kukit/kss.base/trunk/kss/base/plugin.py Log: Added priority system to make sure the core js is always the first when concatinating Modified: kukit/kss.base/trunk/kss/base/javascript.py ============================================================================== --- kukit/kss.base/trunk/kss/base/javascript.py (original) +++ kukit/kss.base/trunk/kss/base/javascript.py Wed Sep 26 17:26:22 2007 @@ -6,7 +6,9 @@ def concatinated(include_extras=False): '''Concatinate the Javascript files for all activate plugins''' scripts = [] - for id, plugin in activated_plugins(): + + for id, plugin in sorted(activated_plugins(), + key=lambda item: item[1].priority): if include_extras: javascripts = plugin.javascripts + plugin.extra_javascripts else: Modified: kukit/kss.base/trunk/kss/base/plugin.py ============================================================================== --- kukit/kss.base/trunk/kss/base/plugin.py (original) +++ kukit/kss.base/trunk/kss/base/plugin.py Wed Sep 26 17:26:22 2007 @@ -6,6 +6,8 @@ from kss.base import selectors as kss_selectors class Plugin(object): + priority = 100 + def register_commandsets(self, registry): for name, commandset in self.commandsets.iteritems(): registry.register(name, commandset) @@ -75,6 +77,8 @@ class KSSCore(Plugin): '''The KSS core plugin has all the standard functionality''' + priority = -1000 + javascripts = [os.path.join(kukit_dir, 'kukit', js) for js in core_js] extra_javascripts = javascripts_from(os.path.join(kukit_dir, '3rd_party')) From jvloothuis at codespeak.net Wed Sep 26 17:26:54 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Wed, 26 Sep 2007 17:26:54 +0200 (CEST) Subject: [KSS-checkins] r46906 - kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous Message-ID: <20070926152654.90CB38182@code0.codespeak.net> Author: jvloothuis Date: Wed Sep 26 17:26:54 2007 New Revision: 46906 Added: kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/config.py Log: Added missing config file (whoops)' Added: kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/config.py ============================================================================== --- (empty file) +++ kukit/kss.plugin.scriptaculous/trunk/kss/plugin/scriptaculous/config.py Wed Sep 26 17:26:54 2007 @@ -0,0 +1,25 @@ +import os + +from kss.base.plugin import Plugin, javascripts_from +from kss.plugin.scriptaculous.commands import KSSScriptaculousCommands + +package_dir = os.path.dirname(os.path.abspath(__file__)) +javascript_dir = os.path.join(package_dir, 'javascript') + +class Scriptaculous(Plugin): + + javascripts = [os.path.join(javascript_dir, 'plugin.js')] + + extra_javascripts = javascripts_from(os.path.join(package_dir, '3rd_party')) + + # if you need extra 3rd party Javascript files put them in the 3rd + # party directory and use the line below + # + # extra_javascripts = [] javascripts_from(os.path.join(package_dir, '3rd_party')) + + commandsets = { + 'scriptaculous': KSSScriptaculousCommands, + } + + selectors = [] + From jvloothuis at codespeak.net Wed Sep 26 17:27:24 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Wed, 26 Sep 2007 17:27:24 +0200 (CEST) Subject: [KSS-checkins] r46907 - kukit/buildout/kss-ep-2007-presentation Message-ID: <20070926152724.DDCBD8183@code0.codespeak.net> Author: jvloothuis Date: Wed Sep 26 17:27:24 2007 New Revision: 46907 Modified: kukit/buildout/kss-ep-2007-presentation/buildout.cfg Log: Added scriptaculous plugin Modified: kukit/buildout/kss-ep-2007-presentation/buildout.cfg ============================================================================== --- kukit/buildout/kss-ep-2007-presentation/buildout.cfg (original) +++ kukit/buildout/kss-ep-2007-presentation/buildout.cfg Wed Sep 26 17:27:24 2007 @@ -4,6 +4,7 @@ src/kss.base src/kss.pylons src/KSSPylonsWiki + src/kss.plugin.scriptaculous eggs = PasteScript @@ -15,4 +16,4 @@ kss.base kss.pylons ksspylonswiki - + kss.plugin.scriptaculous From kukit-checkins at codespeak.net Wed Sep 26 18:43:50 2007 From: kukit-checkins at codespeak.net (Viagra.com Inc) Date: Wed, 26 Sep 2007 18:43:50 +0200 (CEST) Subject: [KSS-checkins] September 70% OFF Message-ID: <20070926074556.13838.qmail@AOrleans-258-1-116-100.w90-21.abo.wanadoo.fr> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20070926/9b49a16d/attachment.htm From jvloothuis at codespeak.net Wed Sep 26 21:53:44 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Wed, 26 Sep 2007 21:53:44 +0200 (CEST) Subject: [KSS-checkins] r46912 - kukit/docs/euro-python-2007 Message-ID: <20070926195344.6D42F8170@code0.codespeak.net> Author: jvloothuis Date: Wed Sep 26 21:53:44 2007 New Revision: 46912 Modified: kukit/docs/euro-python-2007/kss-protocol.html kukit/docs/euro-python-2007/presentation.kss kukit/docs/euro-python-2007/python-integration.html Log: Updated for Python-NL meeting Modified: kukit/docs/euro-python-2007/kss-protocol.html ============================================================================== --- kukit/docs/euro-python-2007/kss-protocol.html (original) +++ kukit/docs/euro-python-2007/kss-protocol.html Wed Sep 26 21:53:44 2007 @@ -65,19 +65,23 @@

]]>', 'withKssSetup': u'True', }, 'name': 'replaceInnerHTML', 'selector': 'div#demo'}, {'selectorType': '', 'params': { - 'html': u'

it worked again

', + 'html': u'it worked again]]>', 'withKssSetup': u'True', }, 'name': 'replaceInnerHTML', 'selector': 'div#demo'}, ]) @@ -70,5 +70,4 @@ def test_suite(): return unittest.TestSuite(( unittest.makeSuite(KSSDemoTestCase), - doctest.DocTestSuite('kss.demo.demoview'), )) From reebalazs at codespeak.net Thu Sep 27 12:09:58 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 27 Sep 2007 12:09:58 +0200 (CEST) Subject: [KSS-checkins] r46941 - in kukit/kss.core/trunk/kss/core: browser tests Message-ID: <20070927100958.C03F28191@code0.codespeak.net> Author: reebalazs Date: Thu Sep 27 12:09:56 2007 New Revision: 46941 Modified: kukit/kss.core/trunk/kss/core/browser/kukitresponse.pt kukit/kss.core/trunk/kss/core/tests/test_kssview_core.py Log: Remove the wrapping from the kukit commands payload. Since we use CDATA for the html parts now, the wrapping hack is not needed any more. Modified: kukit/kss.core/trunk/kss/core/browser/kukitresponse.pt ============================================================================== --- kukit/kss.core/trunk/kss/core/browser/kukitresponse.pt (original) +++ kukit/kss.core/trunk/kss/core/browser/kukitresponse.pt Thu Sep 27 12:09:56 2007 @@ -1,9 +1,7 @@ - - + + xmlns:metal="http://xml.zope.org/namespaces/metal"> -

it worked

+ it worked]]>
- +
Modified: kukit/kss.core/trunk/kss/core/tests/test_kssview_core.py ============================================================================== --- kukit/kss.core/trunk/kss/core/tests/test_kssview_core.py (original) +++ kukit/kss.core/trunk/kss/core/tests/test_kssview_core.py Thu Sep 27 12:09:56 2007 @@ -99,14 +99,13 @@ def _wrapped_commands(self, inline): header = textwrap.dedent(u'''\ - - + + ''') footer = textwrap.dedent('''\ - + ''') return header + inline + footer From reebalazs at codespeak.net Thu Sep 27 19:41:29 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 27 Sep 2007 19:41:29 +0200 (CEST) Subject: [KSS-checkins] r46971 - kukit/kss.demo/branch/ree-demoload/kss/demo/browser Message-ID: <20070927174129.6111A8173@code0.codespeak.net> Author: reebalazs Date: Thu Sep 27 19:41:28 2007 New Revision: 46971 Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/browser/kss_demo_index.pt kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py Log: Make index template z3 compatible with respect to lack of repeat(...).first(...) support Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/browser/kss_demo_index.pt ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/browser/kss_demo_index.pt (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/browser/kss_demo_index.pt Thu Sep 27 19:41:28 2007 @@ -10,13 +10,13 @@
  • Run all tests
  • - +

    Core plugin

    - +

    Plugin namespace: core

    - +

    Category

      Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py Thu Sep 27 19:41:28 2007 @@ -21,17 +21,32 @@ for demo in self.getSortedDemos(): plugin_namespace = demo['plugin_namespace'] category = demo['category'] - if prev_plugin_namespace != plugin_namespace or \ - prev_category != category: + # Set a flag on first rows in group, + # since z3 seems not to handle rpeeat(..).first() + # These will be used for grouping + if prev_plugin_namespace != plugin_namespace: + is_first_plugin_namespace = True + prev_plugin_namespace = plugin_namespace + else: + is_first_plugin_namespace = False + if prev_category != category: + is_first_category = True + prev_category = category + else: + is_first_category = False + # If plugin_namespace or category changed, time to + # start a new group. + if is_first_plugin_namespace or is_first_category: # Start a new group. group = [] demo_groups.append(dict( plugin_namespace = plugin_namespace, category = category, demos = group, + is_first_plugin_namespace = is_first_plugin_namespace, + is_first_category = is_first_category, )) - prev_plugin_namespace = plugin_namespace - prev_category = category + # In any case append our demo to the group group.append(demo) return demo_groups From gotcha at codespeak.net Thu Sep 27 23:52:26 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Thu, 27 Sep 2007 23:52:26 +0200 (CEST) Subject: [KSS-checkins] r46981 - in kukit/kukit.js/trunk: kukit tests Message-ID: <20070927215226.2E9728172@code0.codespeak.net> Author: gotcha Date: Thu Sep 27 23:52:25 2007 New Revision: 46981 Modified: kukit/kukit.js/trunk/kukit/eventreg.js kukit/kukit.js/trunk/kukit/resourcedata.js kukit/kukit.js/trunk/tests/test_kssparser.js Log: fix broken tests; add tests for wrong nammespace-event identifiers; improve error message in those cases Modified: kukit/kukit.js/trunk/kukit/eventreg.js ============================================================================== --- kukit/kukit.js/trunk/kukit/eventreg.js (original) +++ kukit/kukit.js/trunk/kukit/eventreg.js Thu Sep 27 23:52:25 2007 @@ -167,6 +167,23 @@ bindMethodName); }; +_EventRegistry.prototype.unregister = + function(namespace, eventName) { + var key = this._getKey(namespace, eventName); + delete this.content[key]; + var found = null; + for (var i=0; i < this.eventSets.length; i++) { + var eventSet = this.eventSets[i]; + if (eventSet['namespace'] == namespace) { + found = i; + break; + } + } + if (found != null) { + this.eventSets.splice(found, 1); + } +}; + _EventRegistry.prototype.registerForAllEvents = function(namespace, eventNames, klass, bindMethodName, defaultActionMethodName, iterName) { @@ -204,10 +221,10 @@ if (typeof(entry) == 'undefined') { ;;; if (key.substr(0, 1) == '-') { ;;; key = key.substring(1); -;;; kukit.E = 'Error : undefined global event key '; -;;; kukit.E += key + ' (or maybe namespace is missing ?).'; +;;; kukit.E = 'Error : undefined global event ['; +;;; kukit.E += key + '] (or maybe namespace is missing ?).'; ;;; } else { -;;; kukit.E = 'Error : undefined event key [' + key + '].'; +;;; kukit.E = 'Error : undefined namespace or event in [' + key + '].'; ;;; } throw new Error(kukit.E); } Modified: kukit/kukit.js/trunk/kukit/resourcedata.js ============================================================================== --- kukit/kukit.js/trunk/kukit/resourcedata.js (original) +++ kukit/kukit.js/trunk/kukit/resourcedata.js Thu Sep 27 23:52:25 2007 @@ -74,22 +74,19 @@ this.className = null; this.id = id; // finish up the KSS on it - // XXX GC instead of relying on exceptions, test if key exists -;;; try { - this.setIdAndClass(); -;;; } catch(e) { -;;; // foolishly, we don't know the position at this point -;;; var msg = 'Undefined event : ['; -;;; msg += namespace + ':' + name + '].'; -;;; throw kukit.err.kssSelectorError(msg); -;;; } + this.setIdAndClass(); }; kukit.rd.KssSelector.prototype.setIdAndClass = function() { // Sets up id and class on the selector, based on registration info // XXX GC instead of relying on exceptions, test if key exists - this.className = kukit.eventsGlobalRegistry.get( - this.namespace, this.name).className; + try { + this.className = kukit.eventsGlobalRegistry.get( + this.namespace, this.name).className; + } catch(e) { + throw kukit.err.parsingError(e.message); + } + if (this.id == null) { // singleton for class this.id = kukit.rd.makeId(this.namespace, this.className); Modified: kukit/kukit.js/trunk/tests/test_kssparser.js ============================================================================== --- kukit/kukit.js/trunk/tests/test_kssparser.js (original) +++ kukit/kukit.js/trunk/tests/test_kssparser.js Thu Sep 27 23:52:25 2007 @@ -26,6 +26,12 @@ kukit.KssParserTestCaseBase = function() { this.setUp = function() { + kukit.eventsGlobalRegistry.register('dnd', 'drag', + kukit.pl.NativeEventBinder, '__bind__nodeordocument', null); + }; + + this.tearDown = function() { + kukit.eventsGlobalRegistry.unregister('dnd', 'drag'); }; this.assertKssParmValueEquals = function(a, b, reason) { @@ -374,15 +380,15 @@ +"#calendar-previous a:dnd-drag(shelve) {\n" +" action-server : whatever\n" +"}\n" - +"#button-one:annoyClicker-click(annoy-me) {\n" + +"#button-one:annoyclicker-click(annoy-me) {\n" +" action-server: clickedButton;\n" +" clickedButton-id: nodeAttr(id);\n" +"}\n" - +"document:annoy(annoyMe) {\n" + +"document:annoyclicker-annoy(annoyMe) {\n" +" action-client: alert;\n" +' alert-message: "You are an idiot! Ha ha ha. (But just keep on trying...)";\n' +"}\n" - +"document:annoyClicker-annoy(annoyMe) {\n" + +"document:annoyclicker-annoy(annoyMe) {\n" +" action-client: alert;\n" +' alert-message: "You are an idiot! Ha ha ha. (But just keep on trying...)";\n' +"}\n" @@ -393,8 +399,8 @@ +" action-client: log;\n" +' log-message: "Logging";\n' +"}\n" - +"document:annoyClicker-annoy(annoyMe) {\n" - +" evt-annoyClicker-annoy-preventdefault: true;\n" + +"document:annoyclicker-annoy(annoyMe) {\n" + +" evt-annoyclicker-annoy-preventdefault: true;\n" +" action-client: namespaced-alert;\n" +' namespaced-alert-message: "You are an idiot! Ha ha ha. (But just keep on trying...)";\n' +'}\n' @@ -435,7 +441,6 @@ this.assertEquals(rule.kssSelector.css, '#calendar-previous a'); this.assertEquals(rule.kssSelector.name, 'click'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['kukitresponse/kukitGetPreviousMonth']; this.assertEquals(action.type, 'S'); this.assertEquals(action.name, 'kukitresponse/kukitGetPreviousMonth'); @@ -454,7 +459,6 @@ this.assertEquals(rule.kssSelector.css, 'div#update-area'); this.assertEquals(rule.kssSelector.name, 'timeout'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['getCurrentTime']; this.assertEquals(action.type, 'S'); this.assertEquals(action.name, 'getCurrentTime'); @@ -473,7 +477,6 @@ this.assertEquals(rule.kssSelector.isEventSelector, true); this.assertEquals(rule.kssSelector.name, 'click'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['kukitresponse/kukitGetPreviousMonth']; this.assertEquals(action.type, 'S'); this.assertEquals(action.name, 'kukitresponse/kukitGetPreviousMonth'); @@ -491,7 +494,6 @@ this.assertEquals(rule.kssSelector.isEventSelector, true); this.assertEquals(rule.kssSelector.name, 'click'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['kukitGetPreviousMonth']; this.assertEquals(action.type, 'S'); this.assertEquals(action.name, 'kukitGetPreviousMonth'); @@ -519,7 +521,7 @@ }); // rule 5 - //#button-one:annoyClicker-click(annoyMe) { + //#button-one:annoyclicker-click(annoyMe) { // kss-action: clickedButton; // id: nodeAttr(id); //} @@ -528,7 +530,7 @@ this.assertEquals(rule.kssSelector.css, '#button-one'); this.assertEquals(rule.kssSelector.isEventSelector, true); this.assertEquals(rule.kssSelector.name, 'click'); - this.assertEquals(rule.kssSelector.namespace, 'annoyClicker'); + this.assertEquals(rule.kssSelector.namespace, 'annoyclicker'); this.assertEquals(rule.kssSelector.id, 'annoy-me'); action = rule.actions.content['clickedButton']; this.assertEquals(action.type, 'S'); @@ -539,7 +541,7 @@ }); // rule 6 - // document:annoy(annoyMe) { + // document:annoyclicker-annoy(annoyMe) { // kss-action: alert; // message: "You are an idiot! Ha ha ha. (But just keep on trying...)"; //} @@ -548,7 +550,7 @@ this.assertEquals(rule.kssSelector.css, 'document'); this.assertEquals(rule.kssSelector.isMethodSelector, true); this.assertEquals(rule.kssSelector.name, 'annoy'); - this.assertEquals(rule.kssSelector.namespace, null); + this.assertEquals(rule.kssSelector.namespace, 'annoyclicker'); this.assertEquals(rule.kssSelector.id, 'annoyMe'); action = rule.actions.content['alert']; this.assertEquals(action.type, 'C'); @@ -559,7 +561,7 @@ }); // rule 7 - // document:annoyClicker-annoy(annoyMe) { + // document:annoyclicker-annoy(annoyMe) { // annoy#annoy-me { // kss-action: alert; // message: "You are an idiot! Ha ha ha. (But just keep on trying...)"; @@ -569,7 +571,7 @@ this.assertEquals(rule.kssSelector.css, 'document'); this.assertEquals(rule.kssSelector.isMethodSelector, true); this.assertEquals(rule.kssSelector.name, 'annoy'); - this.assertEquals(rule.kssSelector.namespace, 'annoyClicker'); + this.assertEquals(rule.kssSelector.namespace, 'annoyclicker'); this.assertEquals(rule.kssSelector.id, 'annoyMe'); action = rule.actions.content['alert']; this.assertEquals(action.type, 'C'); @@ -586,7 +588,6 @@ this.assertEquals(rule.kssSelector.css, 'div#update-area'); this.assertEquals(rule.kssSelector.name, 'timeout'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['getCurrentTime']; this.assertEquals(action.type, 'S'); this.assertEquals(action.name, 'getCurrentTime'); @@ -603,8 +604,8 @@ }); // rule 9 - //document:annoyClicker-annoy(annoyMe) {\n" - // evt-annoyClicker-annoy-preventdefault: true;\n" + //document:annoyclicker-annoy(annoyMe) {\n" + // evt-annoyclicker-annoy-preventdefault: true;\n" // action-client: namespaced-alert;\n" // namespaced-alert-message: "You are an idiot! Ha ha ha. (But just keep on trying...)";\n' //} @@ -613,7 +614,7 @@ this.assertEquals(rule.kssSelector.css, 'document'); this.assertEquals(rule.kssSelector.isMethodSelector, true); this.assertEquals(rule.kssSelector.name, 'annoy'); - this.assertEquals(rule.kssSelector.namespace, 'annoyClicker'); + this.assertEquals(rule.kssSelector.namespace, 'annoyclicker'); this.assertEquals(rule.kssSelector.id, 'annoyMe'); action = rule.actions.content['namespaced-alert']; this.assertEquals(action.type, 'C'); @@ -637,7 +638,6 @@ this.assertEquals(rule.kssSelector.css, '#button_1'); this.assertEquals(rule.kssSelector.name, 'click'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['setStyle']; this.assertEquals(action.type, 'C'); this.assertEquals(action.name, 'setStyle'); @@ -663,7 +663,6 @@ this.assertEquals(rule.kssSelector.css, '#button_3'); this.assertEquals(rule.kssSelector.name, 'click'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['setStyle']; this.assertEquals(action.type, 'C'); this.assertEquals(action.name, 'setStyle'); @@ -686,7 +685,6 @@ this.assertEquals(rule.kssSelector.isEventSelector, true); this.assertEquals(rule.kssSelector.name, 'click'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['kukitGetPreviousMonth']; this.assertEquals(action.type, 'S'); this.assertEquals(action.name, 'kukitGetPreviousMonth'); @@ -722,7 +720,6 @@ this.assertEquals(rule.kssSelector.css, '.inlineEditable'); this.assertEquals(rule.kssSelector.name, 'blur'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['kukitresponse']; this.assertEquals((typeof(action) != 'undefined'), true); this.assertEquals(action.type, 'S'); @@ -758,7 +755,6 @@ this.assertEquals(rule.kssSelector.css, '.inlineEditable'); this.assertEquals(rule.kssSelector.name, 'blur'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['default']; this.assertEquals((typeof(action) != 'undefined'), true); this.assertEquals(action.error, 'errors'); @@ -771,19 +767,16 @@ kukit.KssParserSelectorTestCase = function() { this.name = 'kukit.KssParserSelectorTestCase'; - this.setUp = function() { - }; - this.testSelectorWithBinderId = function() { // Parsing event selector params - var txt= "a:drag(hello)"; + var txt= "a:dnd-drag(hello)"; var cursor = new kukit.tk.Cursor(txt); var parser = new kukit.kssp.KssSelector(cursor, null, true); this.assertEquals(parser.finished, true); this.assertEquals(parser.kssSelector.isEventSelector, true); this.assertEquals(parser.kssSelector.css, 'a'); this.assertEquals(parser.kssSelector.name, 'drag'); - this.assertEquals(parser.kssSelector.namespace, null); + this.assertEquals(parser.kssSelector.namespace, 'dnd'); this.assertEquals(parser.kssSelector.id, 'hello'); }; @@ -806,45 +799,43 @@ // maybe in std css space is not allowed in the parents, // but we tolerate it - txt= " a div#id:drag( hello)"; + txt= " a div#id:dnd-drag( hello)"; cursor = new kukit.tk.Cursor(txt); parser = new kukit.kssp.KssSelector(cursor, null, true); this.assertEquals(parser.kssSelector.isEventSelector, true); this.assertEquals(parser.kssSelector.css, ' a div#id'); this.assertEquals(parser.kssSelector.name, 'drag'); - this.assertEquals(parser.kssSelector.namespace, null); + this.assertEquals(parser.kssSelector.namespace, 'dnd'); this.assertEquals(parser.kssSelector.id, 'hello'); // We do not allow space here - txt= " a div#id:drag (hello)"; + txt= " a div#id:dnd-drag (hello)"; cursor = new kukit.tk.Cursor(txt); this.assertParsingError(kukit.kssp.KssSelector, cursor, null, true, 'Wrong event selector : missing event qualifier : or :().', 25); // We do not allow space here - txt= " a div#id: drag(hello)"; + txt= " a div#id: dnd-drag(hello)"; cursor = new kukit.tk.Cursor(txt); this.assertParsingError(kukit.kssp.KssSelector, cursor, null, true, 'Wrong event selector : missing event qualifier : or :().', 23); - txt= "a div#id:drop "; + txt= "a div#id:click "; cursor = new kukit.tk.Cursor(txt); parser = new kukit.kssp.KssSelector(cursor, null, true); this.assertEquals(parser.kssSelector.isEventSelector, true); this.assertEquals(parser.kssSelector.css, 'a div#id'); - this.assertEquals(parser.kssSelector.name, 'drop'); + this.assertEquals(parser.kssSelector.name, 'click'); this.assertEquals(parser.kssSelector.namespace, null); - this.assertEquals(parser.kssSelector.id, null); - txt= "a div.class:drop "; + txt= "a div.class:click "; cursor = new kukit.tk.Cursor(txt); parser = new kukit.kssp.KssSelector(cursor, null, true); this.assertEquals(parser.finished, true); this.assertEquals(parser.kssSelector.isEventSelector, true); this.assertEquals(parser.kssSelector.css, 'a div.class'); - this.assertEquals(parser.kssSelector.name, 'drop'); + this.assertEquals(parser.kssSelector.name, 'click'); this.assertEquals(parser.kssSelector.namespace, null); - this.assertEquals(parser.kssSelector.id, null); txt= "a:click "; cursor = new kukit.tk.Cursor(txt); @@ -854,16 +845,15 @@ this.assertEquals(parser.kssSelector.css, 'a'); this.assertEquals(parser.kssSelector.name, 'click'); this.assertEquals(parser.kssSelector.namespace, null); - this.assertEquals(parser.kssSelector.id, null); // two params: not allowed - txt= "a:drop('hello', bello)"; + txt= "a:click('hello', bello)"; cursor = new kukit.tk.Cursor(txt); this.assertParsingError(kukit.kssp.KssSelector, cursor, null, true, 'Wrong event selector ::() can have only one parameter.', 22); // zero params: not std css but tolerated - txt= "a:drop()"; + txt= "a:click()"; cursor = new kukit.tk.Cursor(txt); parser = new kukit.kssp.KssSelector(cursor, null, true); this.assertParsingError(kukit.kssp.KssSelector, cursor, null, true, @@ -897,15 +887,14 @@ this.assertEquals(parser.kssSelector.css, "a[href=hello].class:lang(hu) div#id"); this.assertEquals(parser.kssSelector.name, 'click'); this.assertEquals(parser.kssSelector.namespace, null); - this.assertEquals(parser.kssSelector.id, null); - txt= "a[href=hello].class:lang(hu) div#id:drop(hello) "; + txt= "a[href=hello].class:lang(hu) div#id:click(hello) "; cursor = new kukit.tk.Cursor(txt); parser = new kukit.kssp.KssSelector(cursor, null, true); this.assertEquals(parser.finished, true); this.assertEquals(parser.kssSelector.isEventSelector, true); this.assertEquals(parser.kssSelector.css, "a[href=hello].class:lang(hu) div#id"); - this.assertEquals(parser.kssSelector.name, 'drop'); + this.assertEquals(parser.kssSelector.name, 'click'); this.assertEquals(parser.kssSelector.namespace, null); this.assertEquals(parser.kssSelector.id, 'hello'); @@ -923,7 +912,6 @@ this.assertEquals(parser.kssSelector.css, " a:lang(hu, uh) b"); this.assertEquals(parser.kssSelector.name, 'click'); this.assertEquals(parser.kssSelector.namespace, null); - this.assertEquals(parser.kssSelector.id, null); // Comment in the end txt= " a:lang(hu, uh) b:click/*comment here*/"; @@ -934,7 +922,6 @@ this.assertEquals(parser.kssSelector.css, " a:lang(hu, uh) b"); this.assertEquals(parser.kssSelector.name, 'click'); this.assertEquals(parser.kssSelector.namespace, null); - this.assertEquals(parser.kssSelector.id, null); // Should be ok. txt= "a:lang(hu)/*comment here*/b:click "; @@ -944,18 +931,16 @@ this.assertEquals(parser.kssSelector.css, "a:lang(hu)/*comment here*/b"); this.assertEquals(parser.kssSelector.name, 'click'); this.assertEquals(parser.kssSelector.namespace, null); - this.assertEquals(parser.kssSelector.id, null); // Should be ok. - txt= "a:lang(hu) click/*comment here*/b:clack "; + txt= "a:lang(hu) click/*comment here*/b:load "; cursor = new kukit.tk.Cursor(txt); parser = new kukit.kssp.KssSelector(cursor, null, true); this.assertEquals(parser.finished, true); this.assertEquals(parser.kssSelector.isEventSelector, true); this.assertEquals(parser.kssSelector.css, "a:lang(hu) click/*comment here*/b"); - this.assertEquals(parser.kssSelector.name, 'clack'); + this.assertEquals(parser.kssSelector.name, 'load'); this.assertEquals(parser.kssSelector.namespace, null); - this.assertEquals(parser.kssSelector.id, null); txt= "a:click:clack "; cursor = new kukit.tk.Cursor(txt); @@ -977,7 +962,7 @@ this.assertParsingError(kukit.kssp.KssSelector, cursor, null, true, 'Wrong event selector : missing event qualifier : or :().', 28); - txt= "/*comment here*/click:clack "; + txt= "/*comment here*/div:click "; cursor = new kukit.tk.Cursor(txt); parser = new kukit.kssp.KssSelector(cursor, null, true); @@ -1004,14 +989,14 @@ this.assertEquals(parser.kssSelector.namespace, null); this.assertEquals(parser.kssSelector.id, 'hello'); - txt= " document:native-click(hello) "; + txt= " document:dnd-drag(hello) "; cursor = new kukit.tk.Cursor(txt); parser = new kukit.kssp.KssSelector(cursor, null, true); this.assertEquals(parser.finished, true); this.assertEquals(parser.kssSelector.isMethodSelector, true); this.assertEquals(parser.kssSelector.css, 'document'); - this.assertEquals(parser.kssSelector.name, 'click'); - this.assertEquals(parser.kssSelector.namespace, 'native'); + this.assertEquals(parser.kssSelector.name, 'drag'); + this.assertEquals(parser.kssSelector.namespace, 'dnd'); this.assertEquals(parser.kssSelector.id, 'hello'); txt= "document"; @@ -1036,17 +1021,59 @@ this.assertEquals(parser.kssSelector.id, 'hello'); } + + this.testKssSelectorWithWrongEventWithoutNamespace = function() { + txt= " document:clack "; + cursor = new kukit.tk.Cursor(txt); + this.assertParsingError(kukit.kssp.KssSelector, cursor, null, true, + 'Error : undefined global event [clack] (or maybe namespace is missing ?).'); + txt= " document:clack(hello) "; + cursor = new kukit.tk.Cursor(txt); + this.assertParsingError(kukit.kssp.KssSelector, cursor, null, true, + 'Error : undefined global event [clack] (or maybe namespace is missing ?).'); + } + + this.testKssSelectorWithRightEventAndMissingNamespace = function() { + txt= " document:drag "; + cursor = new kukit.tk.Cursor(txt); + this.assertParsingError(kukit.kssp.KssSelector, cursor, null, true, + 'Error : undefined global event [drag] (or maybe namespace is missing ?).'); + txt= " document:drag(hello) "; + cursor = new kukit.tk.Cursor(txt); + this.assertParsingError(kukit.kssp.KssSelector, cursor, null, true, + 'Error : undefined global event [drag] (or maybe namespace is missing ?).'); + } + + this.testKssSelectorWithUndefinedNamespaceWhenNamespace = function() { + txt= " document:dad-drag "; + cursor = new kukit.tk.Cursor(txt); + this.assertParsingError(kukit.kssp.KssSelector, cursor, null, true, + 'Error : undefined namespace or event in [dad-drag].'); + txt= " document:dad-drag(hello) "; + cursor = new kukit.tk.Cursor(txt); + this.assertParsingError(kukit.kssp.KssSelector, cursor, null, true, + 'Error : undefined namespace or event in [dad-drag].'); + } + + this.testKssSelectorWithUndefinedEventNameWhenNameSpace = function() { + txt= " document:dnd-drog "; + cursor = new kukit.tk.Cursor(txt); + this.assertParsingError(kukit.kssp.KssSelector, cursor, null, true, + 'Error : undefined namespace or event in [dnd-drog].'); + txt= " document:dnd-drog(hello) "; + cursor = new kukit.tk.Cursor(txt); + this.assertParsingError(kukit.kssp.KssSelector, cursor, null, true, + 'Error : undefined namespace or event in [dnd-drog].'); + } }; kukit.KssParserSelectorTestCase.prototype = new kukit.KssParserTestCaseBase; kukit.KssParserSelectorsTestCase = function() { this.name = 'kukit.KssParserSelectorsTestCase'; - this.setUp = function() { - }; this.testSingleSelector = function() { - var txt= "a:drag(hello)"; + var txt= "a:dnd-drag(hello)"; var cursor = new kukit.tk.Cursor(txt); var parser = new kukit.kssp.KssSelectors(cursor, null, true); this.assertEquals(parser.finished, true); @@ -1055,12 +1082,12 @@ this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, 'a'); this.assertEquals(kssSelector.name, 'drag'); - this.assertEquals(kssSelector.namespace, null); + this.assertEquals(kssSelector.namespace, 'dnd'); this.assertEquals(kssSelector.id, 'hello'); }; this.testMultipleSelectors = function() { - var txt= "a:drag(hello), div a:click"; + var txt= "a:dnd-drag(hello), div a:click"; var cursor = new kukit.tk.Cursor(txt); var parser = new kukit.kssp.KssSelectors(cursor, null, true); this.assertEquals(parser.finished, true); @@ -1069,19 +1096,18 @@ this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, 'a'); this.assertEquals(kssSelector.name, 'drag'); - this.assertEquals(kssSelector.namespace, null); + this.assertEquals(kssSelector.namespace, 'dnd'); this.assertEquals(kssSelector.id, 'hello'); var kssSelector = parser.selectors[1]; this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, 'div a'); this.assertEquals(kssSelector.name, 'click'); this.assertEquals(kssSelector.namespace, null); - this.assertEquals(kssSelector.id, null); }; this.testMultipleSelectorsWithComment = function() { - var txt= "a:drag(hello), /* a comment */ div a:click"; + var txt= "a:dnd-drag(hello), /* a comment */ div a:click"; var cursor = new kukit.tk.Cursor(txt); var parser = new kukit.kssp.KssSelectors(cursor, null, true); this.assertEquals(parser.finished, true); @@ -1090,18 +1116,17 @@ this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, 'a'); this.assertEquals(kssSelector.name, 'drag'); - this.assertEquals(kssSelector.namespace, null); + this.assertEquals(kssSelector.namespace, 'dnd'); this.assertEquals(kssSelector.id, 'hello'); var kssSelector = parser.selectors[1]; this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, 'div a'); this.assertEquals(kssSelector.name, 'click'); this.assertEquals(kssSelector.namespace, null); - this.assertEquals(kssSelector.id, null); }; this.testSingleSelectorWithCommaInDoubleQuoteStringInSelector = function() { - var txt = 'a[value="Hi, I am a comma"]:drag(hello)'; + var txt = 'a[value="Hi, I am a comma"]:dnd-drag(hello)'; var cursor = new kukit.tk.Cursor(txt); var parser = new kukit.kssp.KssSelectors(cursor, null, true); this.assertEquals(parser.finished, true); @@ -1110,12 +1135,12 @@ this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, 'a[value="Hi, I am a comma"]'); this.assertEquals(kssSelector.name, 'drag'); - this.assertEquals(kssSelector.namespace, null); + this.assertEquals(kssSelector.namespace, 'dnd'); this.assertEquals(kssSelector.id, 'hello'); }; this.testSingleSelectorWithCommaInSingleQuoteStringInSelector = function() { - var txt = "a[value='Hi, I am a comma']:drag(hello)"; + var txt = "a[value='Hi, I am a comma']:dnd-drag(hello)"; var cursor = new kukit.tk.Cursor(txt); var parser = new kukit.kssp.KssSelectors(cursor, null, true); this.assertEquals(parser.finished, true); @@ -1124,12 +1149,12 @@ this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, "a[value='Hi, I am a comma']"); this.assertEquals(kssSelector.name, 'drag'); - this.assertEquals(kssSelector.namespace, null); + this.assertEquals(kssSelector.namespace, 'dnd'); this.assertEquals(kssSelector.id, 'hello'); }; this.testMultipleSelectorsWithCommaInDoubleQuoteStringInSelector = function() { - var txt = 'a[value="Hi, I am a comma"]:drag(hello), div a:click'; + var txt = 'a[value="Hi, I am a comma"]:dnd-drag(hello), div a:click'; var cursor = new kukit.tk.Cursor(txt); var parser = new kukit.kssp.KssSelectors(cursor, null, true); this.assertEquals(parser.finished, true); @@ -1138,18 +1163,17 @@ this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, 'a[value="Hi, I am a comma"]'); this.assertEquals(kssSelector.name, 'drag'); - this.assertEquals(kssSelector.namespace, null); + this.assertEquals(kssSelector.namespace, 'dnd'); this.assertEquals(kssSelector.id, 'hello'); var kssSelector = parser.selectors[1]; this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, 'div a'); this.assertEquals(kssSelector.name, 'click'); this.assertEquals(kssSelector.namespace, null); - this.assertEquals(kssSelector.id, null); }; this.testMultipleSelectorsWithCommaInSingleQuoteStringInSelector = function() { - var txt = "a[value='Hi, I am a comma']:drag(hello), div a:click"; + var txt = "a[value='Hi, I am a comma']:dnd-drag(hello), div a:click"; var cursor = new kukit.tk.Cursor(txt); var parser = new kukit.kssp.KssSelectors(cursor, null, true); this.assertEquals(parser.finished, true); @@ -1158,18 +1182,17 @@ this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, "a[value='Hi, I am a comma']"); this.assertEquals(kssSelector.name, 'drag'); - this.assertEquals(kssSelector.namespace, null); + this.assertEquals(kssSelector.namespace, 'dnd'); this.assertEquals(kssSelector.id, 'hello'); var kssSelector = parser.selectors[1]; this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, 'div a'); this.assertEquals(kssSelector.name, 'click'); this.assertEquals(kssSelector.namespace, null); - this.assertEquals(kssSelector.id, null); }; this.testMultipleSelectorsWithCommentAndNewline = function() { - var txt= "a:drag(hello), /* a comment */ \n div a:click"; + var txt= "a:dnd-drag(hello), /* a comment */ \n div a:click"; var cursor = new kukit.tk.Cursor(txt); var parser = new kukit.kssp.KssSelectors(cursor, null, true); this.assertEquals(parser.finished, true); @@ -1178,18 +1201,17 @@ this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, 'a'); this.assertEquals(kssSelector.name, 'drag'); - this.assertEquals(kssSelector.namespace, null); + this.assertEquals(kssSelector.namespace, 'dnd'); this.assertEquals(kssSelector.id, 'hello'); var kssSelector = parser.selectors[1]; this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, 'div a'); this.assertEquals(kssSelector.name, 'click'); this.assertEquals(kssSelector.namespace, null); - this.assertEquals(kssSelector.id, null); }; this.testMultipleSelectorsWithNewline = function() { - var txt= "a:drag(hello), \n div a:click"; + var txt= "a:dnd-drag(hello), \n div a:click"; var cursor = new kukit.tk.Cursor(txt); var parser = new kukit.kssp.KssSelectors(cursor, null, true); this.assertEquals(parser.finished, true); @@ -1198,18 +1220,17 @@ this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, 'a'); this.assertEquals(kssSelector.name, 'drag'); - this.assertEquals(kssSelector.namespace, null); + this.assertEquals(kssSelector.namespace, 'dnd'); this.assertEquals(kssSelector.id, 'hello'); var kssSelector = parser.selectors[1]; this.assertEquals(kssSelector.isEventSelector, true); this.assertEquals(kssSelector.css, 'div a'); this.assertEquals(kssSelector.name, 'click'); this.assertEquals(kssSelector.namespace, null); - this.assertEquals(kssSelector.id, null); }; this.testSingleSelectorWithFirstComma = function() { - var txt= ",a:drag(hello),"; + var txt= ",a:dnd-drag(hello),"; var cursor = new kukit.tk.Cursor(txt); var msg = 'Wrong event selector : missing event'; this.assertParsingError(kukit.kssp.KssSelectors, cursor, null, true, @@ -1217,7 +1238,7 @@ } this.testSingleSelectorWithMiddleComma = function() { - var txt= "a:drag(hello),,p:click"; + var txt= "a:dnd-drag(hello),,p:click"; var cursor = new kukit.tk.Cursor(txt); var msg = 'Wrong event selector : missing event'; this.assertParsingError(kukit.kssp.KssSelectors, cursor, null, true, @@ -1225,7 +1246,7 @@ } this.testSingleSelectorWithAdditionalComma = function() { - var txt= "a:drag(hello),"; + var txt= "a:dnd-drag(hello),"; var cursor = new kukit.tk.Cursor(txt); var msg = 'Wrong event selector : trailing comma'; this.assertParsingError(kukit.kssp.KssSelectors, cursor, null, true, @@ -1233,7 +1254,7 @@ } this.testSingleSelectorWithAdditionalCommas = function() { - var txt= "a:drag(hello),,"; + var txt= "a:dnd-drag(hello),,"; var cursor = new kukit.tk.Cursor(txt); var msg = 'Wrong event selector : missing event'; this.assertParsingError(kukit.kssp.KssSelectors, cursor, null, true, @@ -1263,7 +1284,6 @@ this.assertEquals(rule.kssSelector.css, '#calendar-previous a'); this.assertEquals(rule.kssSelector.name, 'click'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['kukitresponse/kukitGetPreviousMonth']; this.assertEquals(action.type, 'S'); this.assertEquals(action.name, 'kukitresponse/kukitGetPreviousMonth'); @@ -1276,7 +1296,6 @@ this.assertEquals(rule.kssSelector.css, '.inlineEditable'); this.assertEquals(rule.kssSelector.name, 'blur'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['kukitresponse/kukitGetPreviousMonth']; this.assertEquals(action.type, 'S'); this.assertEquals(action.name, 'kukitresponse/kukitGetPreviousMonth'); @@ -1309,7 +1328,6 @@ this.assertEquals(rule.kssSelector.css, '#calendar-previous a'); this.assertEquals(rule.kssSelector.name, 'click'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['kukitresponse/kukitGetPreviousMonth']; this.assertEquals(action.type, 'S'); this.assertEquals(action.name, 'kukitresponse/kukitGetPreviousMonth'); @@ -1322,7 +1340,6 @@ this.assertEquals(rule.kssSelector.css, '.inlineEditable'); this.assertEquals(rule.kssSelector.name, 'keydown'); this.assertEquals(rule.kssSelector.namespace, null); - this.assertEquals(rule.kssSelector.id, null); action = rule.actions.content['kukitresponse/kukitGetPreviousMonth']; this.assertEquals(action.type, 'S'); @@ -1357,12 +1374,12 @@ +"#calendar-previous a:click,\n" +".inlineEditable:keydown{ \n" +" evt-click-allowbubbling: true;\n" - +" evt-annoyClicker-annoy-preventdefault: true;\n" + +" evt-annoyclicker-annoy-preventdefault: true;\n" +" action-server : kukitresponse/kukitGetPreviousMonth;\n" +"}\n" var cursor = new kukit.tk.Cursor(txt); this.assertParsingError(kukit.kssp.Document, cursor, null, true, - 'Wrong value for evt-[-] [annoyClicker-annoy] : - should exist in the event of the selectors.', 6); + 'Wrong value for evt-[-] [annoyclicker-annoy] : - should exist in the event of the selectors.', 6); } }; From jfroche at codespeak.net Thu Sep 27 23:59:13 2007 From: jfroche at codespeak.net (jfroche at codespeak.net) Date: Thu, 27 Sep 2007 23:59:13 +0200 (CEST) Subject: [KSS-checkins] r46983 - kukit/kukit.js/trunk/tests Message-ID: <20070927215913.31CBC8172@code0.codespeak.net> Author: jfroche Date: Thu Sep 27 23:59:12 2007 New Revision: 46983 Modified: kukit/kukit.js/trunk/tests/test_kssparser.js Log: Rename annoyclicker- to dnd- to avoid dependency of tests with demo Modified: kukit/kukit.js/trunk/tests/test_kssparser.js ============================================================================== --- kukit/kukit.js/trunk/tests/test_kssparser.js (original) +++ kukit/kukit.js/trunk/tests/test_kssparser.js Thu Sep 27 23:59:12 2007 @@ -27,13 +27,13 @@ this.setUp = function() { kukit.eventsGlobalRegistry.register('dnd', 'drag', - kukit.pl.NativeEventBinder, '__bind__nodeordocument', null); + kukit.pl.NativeEventBinder, '__bind__nodeordocument', null); }; - + this.tearDown = function() { kukit.eventsGlobalRegistry.unregister('dnd', 'drag'); }; - + this.assertKssParmValueEquals = function(a, b, reason) { if (typeof(reason) == 'undefined') { reason = ''; @@ -380,15 +380,15 @@ +"#calendar-previous a:dnd-drag(shelve) {\n" +" action-server : whatever\n" +"}\n" - +"#button-one:annoyclicker-click(annoy-me) {\n" + +"#button-one:dnd-drag(annoy-me) {\n" +" action-server: clickedButton;\n" +" clickedButton-id: nodeAttr(id);\n" +"}\n" - +"document:annoyclicker-annoy(annoyMe) {\n" + +"document:dnd-drag(annoyMe) {\n" +" action-client: alert;\n" +' alert-message: "You are an idiot! Ha ha ha. (But just keep on trying...)";\n' +"}\n" - +"document:annoyclicker-annoy(annoyMe) {\n" + +"document:dnd-drag(annoyMe) {\n" +" action-client: alert;\n" +' alert-message: "You are an idiot! Ha ha ha. (But just keep on trying...)";\n' +"}\n" @@ -399,8 +399,8 @@ +" action-client: log;\n" +' log-message: "Logging";\n' +"}\n" - +"document:annoyclicker-annoy(annoyMe) {\n" - +" evt-annoyclicker-annoy-preventdefault: true;\n" + +"document:dnd-drag(annoyMe) {\n" + +" evt-dnd-drag-preventdefault: true;\n" +" action-client: namespaced-alert;\n" +' namespaced-alert-message: "You are an idiot! Ha ha ha. (But just keep on trying...)";\n' +'}\n' @@ -521,7 +521,7 @@ }); // rule 5 - //#button-one:annoyclicker-click(annoyMe) { + //#button-one:dnd-drag(annoyMe) { // kss-action: clickedButton; // id: nodeAttr(id); //} @@ -529,8 +529,8 @@ this.assertDictEquals(rule.parms, {}); this.assertEquals(rule.kssSelector.css, '#button-one'); this.assertEquals(rule.kssSelector.isEventSelector, true); - this.assertEquals(rule.kssSelector.name, 'click'); - this.assertEquals(rule.kssSelector.namespace, 'annoyclicker'); + this.assertEquals(rule.kssSelector.name, 'drag'); + this.assertEquals(rule.kssSelector.namespace, 'dnd'); this.assertEquals(rule.kssSelector.id, 'annoy-me'); action = rule.actions.content['clickedButton']; this.assertEquals(action.type, 'S'); @@ -541,7 +541,7 @@ }); // rule 6 - // document:annoyclicker-annoy(annoyMe) { + // document:dnd-drag(annoyMe) { // kss-action: alert; // message: "You are an idiot! Ha ha ha. (But just keep on trying...)"; //} @@ -549,8 +549,8 @@ this.assertDictEquals(rule.parms, {}); this.assertEquals(rule.kssSelector.css, 'document'); this.assertEquals(rule.kssSelector.isMethodSelector, true); - this.assertEquals(rule.kssSelector.name, 'annoy'); - this.assertEquals(rule.kssSelector.namespace, 'annoyclicker'); + this.assertEquals(rule.kssSelector.name, 'drag'); + this.assertEquals(rule.kssSelector.namespace, 'dnd'); this.assertEquals(rule.kssSelector.id, 'annoyMe'); action = rule.actions.content['alert']; this.assertEquals(action.type, 'C'); @@ -561,7 +561,7 @@ }); // rule 7 - // document:annoyclicker-annoy(annoyMe) { + // document:dnd-drag(annoyMe) { // annoy#annoy-me { // kss-action: alert; // message: "You are an idiot! Ha ha ha. (But just keep on trying...)"; @@ -570,8 +570,8 @@ this.assertDictEquals(rule.parms, {}); this.assertEquals(rule.kssSelector.css, 'document'); this.assertEquals(rule.kssSelector.isMethodSelector, true); - this.assertEquals(rule.kssSelector.name, 'annoy'); - this.assertEquals(rule.kssSelector.namespace, 'annoyclicker'); + this.assertEquals(rule.kssSelector.name, 'drag'); + this.assertEquals(rule.kssSelector.namespace, 'dnd'); this.assertEquals(rule.kssSelector.id, 'annoyMe'); action = rule.actions.content['alert']; this.assertEquals(action.type, 'C'); @@ -604,8 +604,8 @@ }); // rule 9 - //document:annoyclicker-annoy(annoyMe) {\n" - // evt-annoyclicker-annoy-preventdefault: true;\n" + //document:dnd-drag(annoyMe) {\n" + // evt-dnd-drag-preventdefault: true;\n" // action-client: namespaced-alert;\n" // namespaced-alert-message: "You are an idiot! Ha ha ha. (But just keep on trying...)";\n' //} @@ -613,8 +613,8 @@ this.assertDictEquals(rule.parms, {'preventdefault': 'true'}); this.assertEquals(rule.kssSelector.css, 'document'); this.assertEquals(rule.kssSelector.isMethodSelector, true); - this.assertEquals(rule.kssSelector.name, 'annoy'); - this.assertEquals(rule.kssSelector.namespace, 'annoyclicker'); + this.assertEquals(rule.kssSelector.name, 'drag'); + this.assertEquals(rule.kssSelector.namespace, 'dnd'); this.assertEquals(rule.kssSelector.id, 'annoyMe'); action = rule.actions.content['namespaced-alert']; this.assertEquals(action.type, 'C'); @@ -1374,12 +1374,12 @@ +"#calendar-previous a:click,\n" +".inlineEditable:keydown{ \n" +" evt-click-allowbubbling: true;\n" - +" evt-annoyclicker-annoy-preventdefault: true;\n" + +" evt-dnd-drag-preventdefault: true;\n" +" action-server : kukitresponse/kukitGetPreviousMonth;\n" +"}\n" var cursor = new kukit.tk.Cursor(txt); this.assertParsingError(kukit.kssp.Document, cursor, null, true, - 'Wrong value for evt-[-] [annoyclicker-annoy] : - should exist in the event of the selectors.', 6); + 'Wrong value for evt-[-] [dnd-drag] : - should exist in the event of the selectors.', 6); } }; From gotcha at codespeak.net Fri Sep 28 12:05:16 2007 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Fri, 28 Sep 2007 12:05:16 +0200 (CEST) Subject: [KSS-checkins] r46997 - kukit/kukit.js/trunk/kukit Message-ID: <20070928100516.24FCE8176@code0.codespeak.net> Author: gotcha Date: Fri Sep 28 12:05:15 2007 New Revision: 46997 Modified: kukit/kukit.js/trunk/kukit/commandprocessor.js kukit/kukit.js/trunk/kukit/eventreg.js kukit/kukit.js/trunk/kukit/oper.js kukit/kukit.js/trunk/kukit/plugin.js kukit/kukit.js/trunk/kukit/resourcedata.js Log: - rename binderInstance to binder - move makeId and makeMergeId from rd to er Modified: kukit/kukit.js/trunk/kukit/commandprocessor.js ============================================================================== --- kukit/kukit.js/trunk/kukit/commandprocessor.js (original) +++ kukit/kukit.js/trunk/kukit/commandprocessor.js Fri Sep 28 12:05:15 2007 @@ -113,7 +113,7 @@ cp.CommandProcessor.prototype.executeCommands = function(oper) { kukit.engine.beginSetupEventsCollection(); - // node, eventRule, binderInstance are given on oper, in case + // node, eventRule, binder are given on oper, in case // the command was called up from an event if (typeof(oper) == 'undefined' || oper == null) { oper = new kukit.op.Oper(); Modified: kukit/kukit.js/trunk/kukit/eventreg.js ============================================================================== --- kukit/kukit.js/trunk/kukit/eventreg.js (original) +++ kukit/kukit.js/trunk/kukit/eventreg.js Fri Sep 28 12:05:15 2007 @@ -70,7 +70,7 @@ return (typeof(func) != 'undefined'); }; -_EventRegistry.prototype.getBinder = function(className) { +_EventRegistry.prototype.getBinderClass = function(className) { var func = this.classes[className]; if (! func) { // not found @@ -264,7 +264,7 @@ * * trigger an event bound to a given state instance, same node * -* binderInstance.__continueEvent__('doit', oper.node, {'extravalue': '5'}); +* binder.__continueEvent__('doit', oper.node, {'extravalue': '5'}); * * with kss rule: * @@ -283,7 +283,7 @@ * trigger an event bound to a given state instance, and the document * (different from current scope) * -* binderInstance.__continueEvent__('doit', null, {'extravalue': '5'}); +* binder.__continueEvent__('doit', null, {'extravalue': '5'}); * * with kss rule: * @@ -301,7 +301,7 @@ * * trigger an event on all the nodes + document bound to a given state instance * -* binderInstance.__continueEvent_allNodes__('doit', {'extravalue': '5'}); +* binder.__continueEvent_allNodes__('doit', {'extravalue': '5'}); * * with kss rule: * @@ -403,15 +403,15 @@ * postpone binding of actions until called first time * */ -var _LateBinder = function(binderInstance, name, node) { - this.binderInstance = binderInstance; +var _LateBinder = function(binder, name, node) { + this.binder = binder; this.name = name; this.node = node; - this.bound = null; + this.boundEvent = null; }; _LateBinder.prototype.executeActions = function() { - if (! this.bound) { + if (! this.boundEvent) { ;;; var msg = 'Attempt of late binding for event [' + this.name; ;;; msg += '], node [' + this.node.nodeName + '].'; ;;; kukit.log(msg); @@ -419,27 +419,27 @@ kukit.log(this.node); } var info = kukit.engine.binderInfoRegistry.getBinderInfoById( - this.binderInstance.__binderId__); + this.binder.__binderId__); var oper = info.bound.getBoundOperForNode(this.name, this.node); if (oper) { // (if eventRule is null here, we could still have the default // method, so go on.) oper.parms = {}; - this.bound = function() { - this.binderInstance._EventBinder_triggerEvent(this.name, oper); + this.boundEvent = function() { + this.binder._EventBinder_triggerEvent(this.name, oper); }; ;;; kukit.log('Node bound.'); } else { ;;; kukit.logWarning('No node bound.'); - this.bound = function() {}; + this.boundEvent = function() {}; } } - this.bound(); + this.boundEvent(); }; var _EventBinder_triggerEvent = function(name, oper) { // Private. Called from __continueEvent__ or from main event execution. - oper.binderInstance = this; + oper.binder = this; if (oper.eventRule) { // Call the actions, if we had an event rule. // This includes calling the default action. @@ -476,7 +476,7 @@ throw new Error(kukit.E); } // call it - oper.binderInstance = this; + oper.binder = this; method.call(this, name, oper); }; @@ -510,22 +510,22 @@ ;;; var msg = 'Instantiating event id [' + id + '], className ['; ;;; msg += className + '], namespace [' + namespace + '].'; ;;; kukit.logDebug(msg); - var binder = kukit.eventsGlobalRegistry.getBinder(className); - var binderInstance = new binder(); + var binderClass = kukit.eventsGlobalRegistry.getBinderClass(className); + var binder = new binderClass(); - binderInfo = this.info[id] = new _BinderInfo(binderInstance); + binderInfo = this.info[id] = new _BinderInfo(binder); // decorate it with id and class - binderInstance.__binderId__ = id; - binderInstance.__binderClassName__ = className; - binderInstance.__eventNamespace__ = namespace; + binder.__binderId__ = id; + binder.__binderClassName__ = className; + binder.__eventNamespace__ = namespace; // store the bound rules - //binderInstance.__bound_rules__ = []; - } else if (binderInfo.getBinderInstance().__binderClassName__ != + //binder.__bound_rules__ = []; + } else if (binderInfo.getBinder().__binderClassName__ != className) { // just paranoia ;;; kukit.E = 'Conflicting class for event id [' + id + '], ['; -;;; kukit.E += binderInfo.getBinderInstance().__binderClassName__; +;;; kukit.E += binderInfo.getBinder().__binderClassName__; ;;; kukit.E += '] != [' + className + '].'; throw new Error(kukit.E); } @@ -547,7 +547,7 @@ //Get className var className = kukit.eventsGlobalRegistry.get(namespace, name).className; // Get an event. - var id = kukit.rd.makeId(namespace, className); + var id = er.makeId(namespace, className); var binderInfo = this.info[id]; if (typeof(binderInfo) == 'undefined') { ;;; kukit.E = 'Singleton event with namespace [' + namespace; @@ -585,14 +585,14 @@ * */ -var _BinderInfo = function (binderInstance) { - this.binderInstance = binderInstance; +var _BinderInfo = function (binder) { + this.binder = binder; this.bound = new _OperRegistry(); this.startBindingPhase(); }; -_BinderInfo.prototype.getBinderInstance = function () { - return this.binderInstance; +_BinderInfo.prototype.getBinder = function () { + return this.binder; }; _BinderInfo.prototype.startBindingPhase = function () { @@ -602,7 +602,7 @@ }; _BinderInfo.prototype.bindOper = function (oper) { - // We mark a given oper. This means a binding on the binderInstance + // We mark a given oper. This means a binding on the binder // for given event, node and eventRule (containing event namespace, // name, and evt- parms.) // @@ -615,7 +615,7 @@ _BinderInfo.prototype.processBindingEvents = function () { // We came to the end of the binding phase. Now we process all our binding // events, This will do the actual binding on the browser side. - this.binding.processBindingEvents(this.binderInstance); + this.binding.processBindingEvents(this.binder); // Now we to add these to the new ones. this.binding.propagateTo(this.bound); // Delete them from the registry, to protect against accidents. @@ -677,7 +677,7 @@ }; _OperRegistry.prototype.bindOper = function (oper) { - // Marks binding between binderInstance, eventName, node. + // Marks binding between binder, eventName, node. var name = oper.eventRule.kssSelector.name; var nodeHash = kukit.rd.hashNode(oper.node); var rulesPerName = this.checkOperBindable(oper, name, nodeHash); @@ -694,18 +694,18 @@ // XXX This will need refactoring. /// We would only want to lookup from our registry and not the other way around. _OperRegistry.prototype.processBindingEvents = - function (binderInstance) { + function (binder) { var eventRegistry = kukit.eventsGlobalRegistry; for (var i=0; i < eventRegistry.eventSets.length; i++) { var eventSet = eventRegistry.eventSets[i]; // Only process binding events (and ignore non-binding ones) if (eventSet.bindMethodName) { - if (binderInstance.__eventNamespace__ == eventSet.namespace) { + if (binder.__eventNamespace__ == eventSet.namespace) { // Process the binding event set. // This will call the actual bindmethods // according to the specified iterator. var iterator = er.getBindIterator(eventSet.iterName); - iterator.call(this, eventSet, binderInstance); + iterator.call(this, eventSet, binder); } } } @@ -716,7 +716,7 @@ _OperRegistry.prototype.getBoundOperForNode = function (name, node) { // Get the oper that is bound to a given eventName - // to a node in this binderInstance + // to a node in this binder // returns null, if there is no such oper. var rulesPerName = this.infoPerName[name]; if (typeof(rulesPerName) == 'undefined') { @@ -733,7 +733,7 @@ _OperRegistry.prototype.getBoundOpers = function (name) { // Get the opers bound to a given eventName (to any node) - // in this binderInstance + // in this binder var opers = []; var rulesPerName = this.infoPerName[name]; if (typeof(rulesPerName) != 'undefined') { @@ -751,8 +751,8 @@ // the oper registry. // // Iterators receive the eventSet as a parameter -// plus a binderInstance and a method. They need to iterate by calling this -// as method.call(binderInstance, ...); where ... can be any parms this +// plus a binder and a method. They need to iterate by calling this +// as method.call(binder, ...); where ... can be any parms this // given iteration specifies. // @@ -780,11 +780,11 @@ }; _OperRegistry.prototype.callBindMethod = - function (eventSet, binderInstance, p1, p2, p3, p4, p5, p6) { - var method = binderInstance[eventSet.bindMethodName]; + function (eventSet, binder, p1, p2, p3, p4, p5, p6) { + var method = binder[eventSet.bindMethodName]; // Protect the binding for better logging ;;; try { - method.call(binderInstance, p1, p2, p3, p4, p5, p6); + method.call(binder, p1, p2, p3, p4, p5, p6); ;;; } catch(e) { ;;; var names = eventSet.names; ;;; var namespace = eventSet.namespace; @@ -797,7 +797,7 @@ // Eventname and funcToBind are passed too. // this is the legacy ([EachLegacy]) way _OperRegistry.prototype._iterateEachLegacy = - function (eventSet, binderInstance) { + function (eventSet, binder) { for (var i=0; i Author: jvloothuis Date: Sat Sep 29 12:29:51 2007 New Revision: 47012 Added: kukit/docs/creating-plugins-plone-conf-2007/kss-presentation.odp (contents, props changed) Modified: kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg Log: Initial checkin of the slides for my presentation Modified: kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg ============================================================================== --- kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg (original) +++ kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg Sat Sep 29 12:29:51 2007 @@ -25,7 +25,7 @@ [instance] recipe = plone.recipe.zope2instance zope2-location = ${zope2:location} -user = admin:admin +user = admin:admi http-address = 8080 debug-mode = on verbose-security = on Added: kukit/docs/creating-plugins-plone-conf-2007/kss-presentation.odp ============================================================================== Binary file. No diff available. From jvloothuis at codespeak.net Sun Sep 30 13:07:42 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 30 Sep 2007 13:07:42 +0200 (CEST) Subject: [KSS-checkins] r47032 - kukit/docs/creating-plugins-plone-conf-2007 Message-ID: <20070930110742.17C5280EC@code0.codespeak.net> Author: jvloothuis Date: Sun Sep 30 13:07:40 2007 New Revision: 47032 Modified: kukit/docs/creating-plugins-plone-conf-2007/kss-presentation.odp Log: Added first code slides (value provider) Modified: kukit/docs/creating-plugins-plone-conf-2007/kss-presentation.odp ============================================================================== Binary files. No diff available. From jvloothuis at codespeak.net Sun Sep 30 16:34:50 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 30 Sep 2007 16:34:50 +0200 (CEST) Subject: [KSS-checkins] r47042 - in kukit/docs/creating-plugins-plone-conf-2007: . src/KSSDemoPlugin/kssdemoplugin src/KSSDemoPlugin/kssdemoplugin/javascript src/plonedemo/plonedemo Message-ID: <20070930143450.CA2D580E8@code0.codespeak.net> Author: jvloothuis Date: Sun Sep 30 16:34:48 2007 New Revision: 47042 Modified: kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg kukit/docs/creating-plugins-plone-conf-2007/kss-presentation.odp kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/configure.zcml kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/javascript/plugin.js kukit/docs/creating-plugins-plone-conf-2007/src/plonedemo/plonedemo/configure.zcml Log: Added an example action which renders rects on a canvas Modified: kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg ============================================================================== --- kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg (original) +++ kukit/docs/creating-plugins-plone-conf-2007/buildout.cfg Sun Sep 30 16:34:48 2007 @@ -40,4 +40,3 @@ zcml= plonedemo kssdemoplugin - Modified: kukit/docs/creating-plugins-plone-conf-2007/kss-presentation.odp ============================================================================== Binary files. No diff available. Modified: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/configure.zcml ============================================================================== --- kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/configure.zcml (original) +++ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/configure.zcml Sun Sep 30 16:34:48 2007 @@ -28,13 +28,13 @@ - - - - - - - + - @@ -13,9 +14,17 @@ for="Products.CMFPlone.interfaces.IPloneSiteRoot" /> - - + + + + + + From reebalazs at codespeak.net Sun Sep 30 20:06:25 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 30 Sep 2007 20:06:25 +0200 (CEST) Subject: [KSS-checkins] r47044 - kukit/kss.core/trunk/kss/core/pluginregistry/browser Message-ID: <20070930180625.23BA28101@code0.codespeak.net> Author: reebalazs Date: Sun Sep 30 20:06:23 2007 New Revision: 47044 Added: kukit/kss.core/trunk/kss/core/pluginregistry/browser/interfaces.py Modified: kukit/kss.core/trunk/kss/core/pluginregistry/browser/configure.zcml kukit/kss.core/trunk/kss/core/pluginregistry/browser/develui.pt kukit/kss.core/trunk/kss/core/pluginregistry/browser/develview.py Log: Fix @@kss_devel_mode to work on Zope 3. Modified: kukit/kss.core/trunk/kss/core/pluginregistry/browser/configure.zcml ============================================================================== --- kukit/kss.core/trunk/kss/core/pluginregistry/browser/configure.zcml (original) +++ kukit/kss.core/trunk/kss/core/pluginregistry/browser/configure.zcml Sun Sep 30 20:06:23 2007 @@ -10,7 +10,7 @@ class=".develview.DevelView" name="kss_devel_mode" permission="zope.Public" - allowed_attributes="ison isoff set unset ui ui_js ui_css ui_kss" + allowed_interface=".interfaces.IDevelView" /> -

      Kss mode setup

      @@ -93,7 +93,7 @@ -

      Back

      +

      Back

      Modified: kukit/kss.core/trunk/kss/core/pluginregistry/browser/develview.py ============================================================================== --- kukit/kss.core/trunk/kss/core/pluginregistry/browser/develview.py (original) +++ kukit/kss.core/trunk/kss/core/pluginregistry/browser/develview.py Sun Sep 30 20:06:23 2007 @@ -6,12 +6,41 @@ from zope.publisher.browser import BrowserView from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile +from interfaces import IDevelView +from zope.interface import implements +from zope.traversing.interfaces import ITraverser +from zope.publisher.interfaces import NotFound COOKIE_NAME = '__kss_devel' class DevelView(BrowserView): + implements(IDevelView) - def ison(self, REQUEST=None): + # Zope3 requires the implementation of + # IBrowserPublisher, in order for the methods + # to be traversable. + # + # An alternative would be: + # + # + # + # + + def publishTraverse(self, request, name): + try: + return getattr(self, name) + except AttributeError: + raise NotFound(self.context, name, request) + + def browserDefault(self, request): + # make ui the default method + return self, ('ui', ) + + # -- + # Accessable methods + # -- + + def ison(self): '''Checks if running in development mode Two ways to induce development mode: @@ -36,8 +65,6 @@ pass result = bool(ison) - if REQUEST is not None: - result = str(result) return result def isoff(self, REQUEST=None): @@ -48,40 +75,46 @@ return result def set(self): - 'XXX' + 'Sets development mode cookie' self.request.response.setCookie(COOKIE_NAME, '1', path='/') def unset(self): - 'XXX' + 'Unsets development mode cookie' self.request.response.expireCookie(COOKIE_NAME, path='/') _ui = ViewPageTemplateFile('develui.pt', content_type='text/html;charset=utf-8') def ui(self): - 'XXX' + 'User interface for interactive switching' + options = {} if 'devel' in self.request.form: self.set() - self.request.cookies[COOKIE_NAME] = '1' + # setting it also to have immediate effect in the page + options['devel_mode'] = True if 'prod' in self.request.form: self.unset() if COOKIE_NAME in self.request.cookies: - del self.request.cookies[COOKIE_NAME] - return self._ui() + # setting it also to have immediate effect in the page + options['devel_mode'] = False + return self._ui(**options) def ui_js(self): - 'XXX' - resource = self.context.restrictedTraverse('++resource++kss_devel_ui.js') + 'Javascript needed for the ui' + resource = ITraverser(self.context).traverse('++resource++kss_devel_ui.js', + request=self.request) cooked = resource.GET() return cooked def ui_css(self): - 'XXX' - resource = self.context.restrictedTraverse('++resource++kss_devel_ui.css') + 'CSS needed for the ui' + resource = ITraverser(self.context).traverse('++resource++kss_devel_ui.css', + request=self.request) cooked = resource.GET() return cooked def ui_kss(self): - 'XXX' - resource = self.context.restrictedTraverse('++resource++kss_devel_ui.kss') + 'KSS needed for the ui' + resource = ITraverser(self.context).traverse('++resource++kss_devel_ui.kss', + request=self.request) cooked = resource.GET() return cooked Added: kukit/kss.core/trunk/kss/core/pluginregistry/browser/interfaces.py ============================================================================== --- (empty file) +++ kukit/kss.core/trunk/kss/core/pluginregistry/browser/interfaces.py Sun Sep 30 20:06:23 2007 @@ -0,0 +1,40 @@ + + +from zope.publisher.interfaces.browser import IBrowserPublisher + +class IDevelView(IBrowserPublisher): + + def ison(): + '''Checks if running in development mode + + Two ways to induce development mode: + + - set the cookie on the request + + - switch portal_js tool into debug mode, this will + select development mode without the cookie + + ''' + + def isoff(): + 'Check if running in production mode' + + def set(): + 'Sets development mode cookie' + + def unset(): + 'Unsets development mode cookie' + + def ui(): + 'User interface for interactive switching' + + def ui_js(): + 'Javascript needed for the ui' + + def ui_css(): + 'CSS needed for the ui' + + def ui_kss(): + 'KSS needed for the ui' + + From jvloothuis at codespeak.net Sun Sep 30 21:37:08 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sun, 30 Sep 2007 21:37:08 +0200 (CEST) Subject: [KSS-checkins] r47046 - kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/javascript Message-ID: <20070930193708.E38728111@code0.codespeak.net> Author: jvloothuis Date: Sun Sep 30 21:37:08 2007 New Revision: 47046 Modified: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/javascript/plugin.js Log: Fixed up the plugin a bit more Modified: kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/javascript/plugin.js ============================================================================== --- kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/javascript/plugin.js (original) +++ kukit/docs/creating-plugins-plone-conf-2007/src/KSSDemoPlugin/kssdemoplugin/javascript/plugin.js Sun Sep 30 21:37:08 2007 @@ -22,18 +22,21 @@ kukit.actionsGlobalRegistry.register('demoplugin-canvasRect', function (oper) { ;;; oper.componentName = '[demoplugin-canvasRect] action'; - oper.evaluateParameters(['fromX', 'fromY', 'toX', 'toY'], + oper.evaluateParameters(['x', 'y', 'width', 'height'], {'fillStyle': 'rgb(0, 255, 0)'}); - oper.evalInt('fromX'); - oper.evalInt('fromY'); - oper.evalInt('toX'); - oper.evalInt('toY'); + oper.evalInt('x'); + oper.evalInt('y'); + oper.evalInt('width'); + oper.evalInt('height'); + + var x = oper.parms.x; + var y = oper.parms.y; var ctx = oper.node.getContext("2d"); ctx.fillStyle = oper.parms.fillStyle; - ctx.fillRect(oper.parms.fromX, oper.parms.fromY, - oper.parms.toX, oper.parms.toY); + ctx.fillRect(x, y, + oper.parms.width, oper.parms.height); }); kukit.commandsGlobalRegistry.registerFromAction( 'demoplugin-canvasRect', kukit.cr.makeSelectorCommand); @@ -42,30 +45,32 @@ //----------------------------------------------------------- // Value provider //----------------------------------------------------------- -var ExampleProvider = function() {}; -ExampleProvider.prototype = { - // The check function is executed during the parsing of KSS. Use - // this to make sure the arguments are correct. - // Use ;;; in the beginning of each line in check. +var RandomProvider = function() {}; +RandomProvider.prototype = { ;;; check: function(args) { ;;; // An example of what you could check is the argument length -;;; if (args.length != 1) { +;;; if (args.length < 1) { ;;; // Raise an error in case something is wrong -;;; throw new Error('exampleProvider provider needs 1 argument [message]'); +;;; throw new Error('demoplugin-random needs at least 1 argument [max]'); ;;; } ;;; }, eval: function(args, node) { // Return the value which for this provider - return window.prompt(args[0]); + if(args.length == 2){ + var min = args[0]; + var max = args[1]; + } else { + var min = 0; + var max = args[0]; + } + var range = max - min; + var rand = (Math.random() * range) + min; + return rand; + } }; kukit.pprovidersGlobalRegistry.register( - 'demoplugin-prompt', ExampleProvider); -// The line above registers the value provider under the name -// `demoplugin-exampleProvider` - - - + 'demoplugin-random', RandomProvider); //----------------------------------------------------------- // Simple event binder for stateful events From reebalazs at codespeak.net Sun Sep 30 21:53:52 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 30 Sep 2007 21:53:52 +0200 (CEST) Subject: [KSS-checkins] r47048 - kukit/kss.demo/branch/ree-demoload/kss/demo/demo Message-ID: <20070930195352.B3B3E810F@code0.codespeak.net> Author: reebalazs Date: Sun Sep 30 21:53:52 2007 New Revision: 47048 Removed: kukit/kss.demo/branch/ree-demoload/kss/demo/demo/body_macros.pt kukit/kss.demo/branch/ree-demoload/kss/demo/demo/header_macros.pt Log: Remove macros from ./demos, they are in ./browser but I forgot to remove them. Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/demo/body_macros.pt ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/demo/body_macros.pt Sun Sep 30 21:53:52 2007 +++ (empty file) @@ -1,17 +0,0 @@ - - - - -

      - Kss is in - development - production - - mode.
      - Control development mode -

      - -
      - - \ No newline at end of file Deleted: /kukit/kss.demo/branch/ree-demoload/kss/demo/demo/header_macros.pt ============================================================================== --- /kukit/kss.demo/branch/ree-demoload/kss/demo/demo/header_macros.pt Sun Sep 30 21:53:52 2007 +++ (empty file) @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From reebalazs at codespeak.net Sun Sep 30 22:21:37 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 30 Sep 2007 22:21:37 +0200 (CEST) Subject: [KSS-checkins] r47050 - kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo Message-ID: <20070930202137.26D6980BC@code0.codespeak.net> Author: reebalazs Date: Sun Sep 30 22:21:36 2007 New Revision: 47050 Modified: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_tmpl Log: Update templates to kss.demo trunk Modified: kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_tmpl ============================================================================== --- kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_tmpl (original) +++ kukit/kss.templates/trunk/kss/templates/zope_plugin/+package+/demo/my_demo.pt_tmpl Sun Sep 30 22:21:36 2007 @@ -1,16 +1,16 @@ - + - -

      All demos

      -

      View KSS resource

      +

      header

      + -

      My demo

      -
      - click me! -
      +

      My demo

      +
      + click me! +
      + + From reebalazs at codespeak.net Sun Sep 30 22:34:28 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 30 Sep 2007 22:34:28 +0200 (CEST) Subject: [KSS-checkins] r47051 - kukit/kss.demo/branch/ree-demoload/kss/demo/browser Message-ID: <20070930203428.4B93780D9@code0.codespeak.net> Author: reebalazs Date: Sun Sep 30 22:34:28 2007 New Revision: 47051 Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py Log: Make @@kss_demo_registry_admin/cookSeleniumTests work with Zope3 Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py Sun Sep 30 22:34:28 2007 @@ -1,8 +1,12 @@ from kss.demo.interfaces import IKSSDemoRegistry +from zope.publisher.interfaces.browser import IBrowserPublisher +from zope.publisher.interfaces import NotFound from zope.component import getUtility +from zope.interface import implements try: from Products.Five import BrowserView + BrowserView # make pyflakes happy except ImportError: from zope.publisher.browser import BrowserView @@ -52,6 +56,31 @@ class KSSDemoRegistryAdminView(BrowserView): """Things that only admin should do""" + implements(IBrowserPublisher) + + # Zope3 requires the implementation of + # IBrowserPublisher, in order for the methods + # to be traversable. + # + # An alternative would be: + # + # + # + # + + def publishTraverse(self, request, name): + try: + return getattr(self, name) + except AttributeError: + raise NotFound(self.context, name, request) + + def browserDefault(self, request): + # make ui the default method + return self, ('cookSeleniumTests', ) + + # -- + # Accessable methods + # -- def cookSeleniumTests(self): """Cook selenium tests From reebalazs at codespeak.net Sun Sep 30 22:52:50 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 30 Sep 2007 22:52:50 +0200 (CEST) Subject: [KSS-checkins] r47052 - kukit/kss.demo/branch/ree-demoload/kss/demo/browser Message-ID: <20070930205250.C3E9980FB@code0.codespeak.net> Author: reebalazs Date: Sun Sep 30 22:52:50 2007 New Revision: 47052 Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/browser/configure.zcml Log: Make @@kss_demo_registry_admin/cookSeleniumTests available for Manager only. Modified: kukit/kss.demo/branch/ree-demoload/kss/demo/browser/configure.zcml ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/browser/configure.zcml (original) +++ kukit/kss.demo/branch/ree-demoload/kss/demo/browser/configure.zcml Sun Sep 30 22:52:50 2007 @@ -67,14 +67,19 @@ permission="zope.View" /> + + + - From reebalazs at codespeak.net Sun Sep 30 23:15:16 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Sun, 30 Sep 2007 23:15:16 +0200 (CEST) Subject: [KSS-checkins] r47053 - in kukit/kss.demo/trunk: docs kss/demo kss/demo/browser kss/demo/browser/commandaction kss/demo/browser/coreplugin kss/demo/browser/coresyntax kss/demo/browser/parameterfunction kss/demo/browser/selectors kss/demo/demo kss/demo/demo/commandaction kss/demo/demo/coreplugin kss/demo/demo/coresyntax kss/demo/demo/parameterfunction kss/demo/demo/selectors kss/demo/demo/selenium_tests kss/demo/selenium_utils kss/demo/tests kss/demo/tests/selenium_tests Message-ID: <20070930211516.46081810D@code0.codespeak.net> Author: reebalazs Date: Sun Sep 30 23:15:13 2007 New Revision: 47053 Added: kukit/kss.demo/trunk/kss/demo/browser/registry.py - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py kukit/kss.demo/trunk/kss/demo/demo/ - copied from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/ kukit/kss.demo/trunk/kss/demo/demo/__init__.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/__init__.py kukit/kss.demo/trunk/kss/demo/demo/autoupdate.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/autoupdate.kss kukit/kss.demo/trunk/kss/demo/demo/autoupdate.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/autoupdate.pt kukit/kss.demo/trunk/kss/demo/demo/basic_commands.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/basic_commands.kss kukit/kss.demo/trunk/kss/demo/demo/basic_commands.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/basic_commands.pt kukit/kss.demo/trunk/kss/demo/demo/cancel_submit.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/cancel_submit.kss kukit/kss.demo/trunk/kss/demo/demo/cancel_submit.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/cancel_submit.pt kukit/kss.demo/trunk/kss/demo/demo/commandaction/ - copied from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/commandaction/ kukit/kss.demo/trunk/kss/demo/demo/commandaction/__init__.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/commandaction/__init__.py kukit/kss.demo/trunk/kss/demo/demo/commandaction/actions.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/commandaction/actions.kss kukit/kss.demo/trunk/kss/demo/demo/commandaction/actions.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/commandaction/actions.pt kukit/kss.demo/trunk/kss/demo/demo/commandaction/commandaction.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/commandaction/commandaction.py kukit/kss.demo/trunk/kss/demo/demo/commandaction/configure.zcml - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/commandaction/configure.zcml kukit/kss.demo/trunk/kss/demo/demo/commandaction/focus.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/commandaction/focus.kss kukit/kss.demo/trunk/kss/demo/demo/commandaction/focus.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/commandaction/focus.pt kukit/kss.demo/trunk/kss/demo/demo/configure.zcml - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/configure.zcml kukit/kss.demo/trunk/kss/demo/demo/coreplugin/ - copied from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coreplugin/ kukit/kss.demo/trunk/kss/demo/demo/coreplugin/__init__.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coreplugin/__init__.py kukit/kss.demo/trunk/kss/demo/demo/coreplugin/configure.zcml - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coreplugin/configure.zcml kukit/kss.demo/trunk/kss/demo/demo/coreplugin/demoview.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coreplugin/demoview.py kukit/kss.demo/trunk/kss/demo/demo/coreplugin/kss_evt_preventbubbling.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coreplugin/kss_evt_preventbubbling.kss kukit/kss.demo/trunk/kss/demo/demo/coreplugin/kss_evt_preventbubbling.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coreplugin/kss_evt_preventbubbling.pt kukit/kss.demo/trunk/kss/demo/demo/coresyntax/ - copied from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coresyntax/ kukit/kss.demo/trunk/kss/demo/demo/coresyntax/__init__.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coresyntax/__init__.py kukit/kss.demo/trunk/kss/demo/demo/coresyntax/configure.zcml - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coresyntax/configure.zcml kukit/kss.demo/trunk/kss/demo/demo/coresyntax/demoview.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coresyntax/demoview.py kukit/kss.demo/trunk/kss/demo/demo/coresyntax/kss_selector_param.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coresyntax/kss_selector_param.kss kukit/kss.demo/trunk/kss/demo/demo/coresyntax/kss_selector_param.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coresyntax/kss_selector_param.pt kukit/kss.demo/trunk/kss/demo/demo/coresyntax/kss_url_param.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coresyntax/kss_url_param.kss kukit/kss.demo/trunk/kss/demo/demo/coresyntax/kss_url_param.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coresyntax/kss_url_param.pt kukit/kss.demo/trunk/kss/demo/demo/demo.css - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/demo.css kukit/kss.demo/trunk/kss/demo/demo/demoview.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/demoview.py kukit/kss.demo/trunk/kss/demo/demo/draganddrop.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/draganddrop.kss kukit/kss.demo/trunk/kss/demo/demo/draganddrop.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/draganddrop.pt kukit/kss.demo/trunk/kss/demo/demo/effects.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/effects.kss kukit/kss.demo/trunk/kss/demo/demo/effects.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/effects.pt kukit/kss.demo/trunk/kss/demo/demo/error_handling.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/error_handling.kss kukit/kss.demo/trunk/kss/demo/demo/error_handling.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/error_handling.pt kukit/kss.demo/trunk/kss/demo/demo/form_submit.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/form_submit.kss kukit/kss.demo/trunk/kss/demo/demo/form_submit.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/form_submit.pt kukit/kss.demo/trunk/kss/demo/demo/html_inserts.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/html_inserts.kss kukit/kss.demo/trunk/kss/demo/demo/html_inserts.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/html_inserts.pt kukit/kss.demo/trunk/kss/demo/demo/inline_edit.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/inline_edit.kss kukit/kss.demo/trunk/kss/demo/demo/inline_edit.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/inline_edit.pt kukit/kss.demo/trunk/kss/demo/demo/more_selectors.js - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/more_selectors.js kukit/kss.demo/trunk/kss/demo/demo/more_selectors.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/more_selectors.kss kukit/kss.demo/trunk/kss/demo/demo/more_selectors.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/more_selectors.pt kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/ - copied from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/parameterfunction/ kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/__init__.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/parameterfunction/__init__.py kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/configure.zcml - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/parameterfunction/configure.zcml kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/forms.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/parameterfunction/forms.kss kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/forms.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/parameterfunction/forms.pt kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/kssid.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/parameterfunction/kssid.kss kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/kssid.pt - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/parameterfunction/kssid.pt kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/parameterfunction_view.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/parameterfunction/parameterfunction_view.py kukit/kss.demo/trunk/kss/demo/demo/preventdefault.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/preventdefault.kss kukit/kss.demo/trunk/kss/demo/demo/preventdefault.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/preventdefault.pt kukit/kss.demo/trunk/kss/demo/demo/selectors/ - copied from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selectors/ kukit/kss.demo/trunk/kss/demo/demo/selectors/__init__.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selectors/__init__.py kukit/kss.demo/trunk/kss/demo/demo/selectors/configure.zcml - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selectors/configure.zcml kukit/kss.demo/trunk/kss/demo/demo/selectors/selectors.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selectors/selectors.kss kukit/kss.demo/trunk/kss/demo/demo/selectors/selectors.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selectors/selectors.pt kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/ - copied from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/ kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/actions.html - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/actions.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/autopupdate.html - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/autopupdate.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/basic_commands.html - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/basic_commands.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/ca_focus.html - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/ca_focus.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/cancel_submit.html - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/cancel_submit.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/inline_edit.html - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/inline_edit.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/kss_prevent_bubbling.html - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/kss_prevent_bubbling.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/kss_selector_param.html - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/kss_selector_param.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/pf_forms.html - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/pf_forms.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/preventdefault.html - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/preventdefault.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/selectors.html - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/selectors.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/suite.html - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/suite.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/two_select_revisited.html - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/two_select_revisited.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/two_selects.html - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/two_selects.html kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/urlparam.html - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/urlparam.html kukit/kss.demo/trunk/kss/demo/demo/tree.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/tree.kss kukit/kss.demo/trunk/kss/demo/demo/tree.pt - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/tree.pt kukit/kss.demo/trunk/kss/demo/demo/two_select_revisited.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/two_select_revisited.kss kukit/kss.demo/trunk/kss/demo/demo/two_select_revisited.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/two_select_revisited.pt kukit/kss.demo/trunk/kss/demo/demo/two_selects.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/two_selects.kss kukit/kss.demo/trunk/kss/demo/demo/two_selects.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/two_selects.pt kukit/kss.demo/trunk/kss/demo/demo/xpath.kss - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/xpath.kss kukit/kss.demo/trunk/kss/demo/demo/xpath.pt - copied, changed from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/xpath.pt kukit/kss.demo/trunk/kss/demo/demo/zopeconfig.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/zopeconfig.py kukit/kss.demo/trunk/kss/demo/events.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/events.py kukit/kss.demo/trunk/kss/demo/registry.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/registry.py kukit/kss.demo/trunk/kss/demo/resource.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/resource.py kukit/kss.demo/trunk/kss/demo/selenium_utils/ (props changed) - copied from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/ kukit/kss.demo/trunk/kss/demo/selenium_utils/__init__.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/__init__.py kukit/kss.demo/trunk/kss/demo/selenium_utils/createpythontests.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/createpythontests.py kukit/kss.demo/trunk/kss/demo/selenium_utils/patterns.py.txt - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/patterns.py.txt kukit/kss.demo/trunk/kss/demo/selenium_utils/selenium.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/selenium.py kukit/kss.demo/trunk/kss/demo/selenium_utils/seleniumtestcase.py - copied unchanged from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/selenium_utils/seleniumtestcase.py Removed: kukit/kss.demo/trunk/kss/demo/browser/autoupdate.kss kukit/kss.demo/trunk/kss/demo/browser/autoupdate.pt kukit/kss.demo/trunk/kss/demo/browser/basic_commands.kss kukit/kss.demo/trunk/kss/demo/browser/basic_commands.pt kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.kss kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.pt kukit/kss.demo/trunk/kss/demo/browser/commandaction/ kukit/kss.demo/trunk/kss/demo/browser/coreplugin/ kukit/kss.demo/trunk/kss/demo/browser/coresyntax/ kukit/kss.demo/trunk/kss/demo/browser/draganddrop.kss kukit/kss.demo/trunk/kss/demo/browser/draganddrop.pt kukit/kss.demo/trunk/kss/demo/browser/effects.kss kukit/kss.demo/trunk/kss/demo/browser/effects.pt kukit/kss.demo/trunk/kss/demo/browser/error_handling.kss kukit/kss.demo/trunk/kss/demo/browser/error_handling.pt kukit/kss.demo/trunk/kss/demo/browser/form_submit.kss kukit/kss.demo/trunk/kss/demo/browser/form_submit.pt kukit/kss.demo/trunk/kss/demo/browser/html_inserts.kss kukit/kss.demo/trunk/kss/demo/browser/html_inserts.pt kukit/kss.demo/trunk/kss/demo/browser/inline_edit.kss kukit/kss.demo/trunk/kss/demo/browser/inline_edit.pt kukit/kss.demo/trunk/kss/demo/browser/more_selectors.js kukit/kss.demo/trunk/kss/demo/browser/more_selectors.kss kukit/kss.demo/trunk/kss/demo/browser/more_selectors.pt kukit/kss.demo/trunk/kss/demo/browser/parameterfunction/ kukit/kss.demo/trunk/kss/demo/browser/preventdefault.kss kukit/kss.demo/trunk/kss/demo/browser/preventdefault.pt kukit/kss.demo/trunk/kss/demo/browser/selectors/ kukit/kss.demo/trunk/kss/demo/browser/tree.kss kukit/kss.demo/trunk/kss/demo/browser/tree.pt kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.kss kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.pt kukit/kss.demo/trunk/kss/demo/browser/two_selects.kss kukit/kss.demo/trunk/kss/demo/browser/two_selects.pt kukit/kss.demo/trunk/kss/demo/browser/xpath.kss kukit/kss.demo/trunk/kss/demo/browser/xpath.pt kukit/kss.demo/trunk/kss/demo/demoview.py kukit/kss.demo/trunk/kss/demo/tests/selenium_tests/ Modified: kukit/kss.demo/trunk/docs/HISTORY.txt kukit/kss.demo/trunk/kss/demo/browser/configure.zcml kukit/kss.demo/trunk/kss/demo/browser/kss_demo_index.pt kukit/kss.demo/trunk/kss/demo/configure.zcml kukit/kss.demo/trunk/kss/demo/interfaces.py kukit/kss.demo/trunk/kss/demo/tests/test_demoview.py Log: Merge in ree-demoload branch Modified: kukit/kss.demo/trunk/docs/HISTORY.txt ============================================================================== --- kukit/kss.demo/trunk/docs/HISTORY.txt (original) +++ kukit/kss.demo/trunk/docs/HISTORY.txt Sun Sep 30 23:15:13 2007 @@ -6,6 +6,9 @@ - ... + - Implement pluggable demos + [ree] + kss.demo - 1.2 Released 2007-08-17 - Prepare for release Deleted: /kukit/kss.demo/trunk/kss/demo/browser/autoupdate.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/autoupdate.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,9 +0,0 @@ -div#update-area:timeout { - evt-timeout-delay: 2000; - action-server: getCurrentTime; -} - -input#start-update:click { - action-server: getAutoupdateMarkup; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/autoupdate.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/autoupdate.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - -

      header

      - -

      Three autoupdate

      - -

      Demo

      -
      -
      - - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/basic_commands.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/basic_commands.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,21 +0,0 @@ - -button#copyFrom:click { - action-server: copyFromDivContent; -} - -button#copyTo:click { - action-server: copyToDivContent; -} - -button#moveTo:click { - action-server: moveToDivContent; -} - -button#clear:click { - action-server: clearDivContent; -} - -button#change:click { - action-server: getDivContent; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/basic_commands.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/basic_commands.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,118 +0,0 @@ - - - - - - - - - - -

      header

      - -

      Change tag content

      -

      Top div

      -
      - KSS -
      - -

      Bottom div

      -
      - copy here -
      -

      Javascript Styling

      -

      This page defines a link in the header which rel attribute points - to a .kss resource file on the server : - - - see the kss file here.

      -

      - This .kss file declares CSS selectors associated with events and server URLs called when the event occur. -

      -

      A javascript engine processes the XML content : it inserts javascript - events in the DOM.

      -

      - For instance, the click event of button with the id change will call asynchronously the getDivContent URL. - -

      -

      Server Asynchronous Call

      -

      - The events associated with Javascript just call the server asynchronously. -

      -

      - The response is a XML file. - The XML contains CSS selectors associated with commands. -

      -

      - The Javascript engine selects the DOM nodes to which it applies each command. -

      -

      - For instance, let's look at the moveToDivContent response. -

      -
      -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      -<html xmlns="http://www.w3.org/1999/xhtml"
      -      xmlns:kukit="http://www.kukit.org/commands/1.0"><body>
      -<kukit:commands>
      -<kukit:command selector="div#copy" name="copyChildNodesTo"
      -               selectorType="">
      -    <kukit:param name="html_id">demo</kukit:param>
      -</kukit:command>
      -<kukit:command selector="div#copy" name="clearChildNodes"
      -               selectorType="">
      -</kukit:command>
      -</kukit:commands>
      -</body></html>
      -   
      -

      - The XML specifies two commands to apply to the div#copy node : -

      -

      - copyChildNodesTo copies the children of the DOM node to the node with id demo. -

      -

      - clearChildNodes removes the children of the DOM node. -

      - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,5 +0,0 @@ -input#submit:click { - evt-click-preventdefault: true; - action-server: save; - save-text_save: currentFormVar(text_save); -} Deleted: /kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/cancel_submit.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,27 +0,0 @@ - - - - - - - - - - -

      header

      - -

      Cancel Submit Click Demo

      -

      saved !

      -

      Empty

      -
      -
      - - - -
      -
      -
      -

      Kukit response

      - - Modified: kukit/kss.demo/trunk/kss/demo/browser/configure.zcml ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/configure.zcml (original) +++ kukit/kss.demo/trunk/kss/demo/browser/configure.zcml Sun Sep 30 23:15:13 2007 @@ -1,19 +1,85 @@ - - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + Deleted: /kukit/kss.demo/trunk/kss/demo/browser/draganddrop.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/draganddrop.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,54 +0,0 @@ -.draggable:dad-drag { -} - -.horizontal:dad-start { - evt-dad-start-constraint: horizontal; -} - -.horizontal:dad-end { - evt-dad-end-constraint: horizontal; -} - -.horizontal:dad-drag { - evt-dad-drag-constraint: horizontal; -} - -.vertical:dad-start { - evt-dad-start-constraint: vertical; -} - -.vertical:dad-end { - evt-dad-end-constraint: vertical; -} - -.vertical:dad-drag { - evt-dad-drag-constraint: vertical; -} - -} - -.draggable:dad-start { - action-client: logDebug; - action-client: setStyle; - setStyle-name: color; - setStyle-value: red; -} - -.draggable:dad-end { - action-client: logDebug; - action-client: setStyle; - setStyle-name: color; - setStyle-value: black; -} - - -.droppable:dad-drop { - action-client: replaceInnerHTML; - replaceInnerHTML-html: "dropped"; -} - -.droppable:dad-hover { - action-client: replaceInnerHTML; - replaceInnerHTML-html: "hovered"; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/draganddrop.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/draganddrop.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - -

      header

      -

      Drag and drop

      - - - - - - - - - - - -
      FreeVerticalHorizontal
      -
      Drag me
      -
      Drop me here
      -
      or here
      -
      -
      Drag me
      -
      Drop me here
      -
      or here
      -
      -
      Drag me
      -
      Drop me here
      -
      or here
      -
      - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/effects.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/effects.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,9 +0,0 @@ -.effects:click { - action-client: effect; - effect-type: nodeAttr('id'); -} - -input#resetEffects:click { - action-server: resetEffects; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/effects.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/effects.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - -

      header

      - -

      Effects

      - -

      Demo

      -
      Click here to make me fade
      -
      Click here to make me puff
      -
      Click here to make me blindup
      - - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/error_handling.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/error_handling.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,50 +0,0 @@ - - -.clickable:click { - evt-click-preventdefault: true; - action-server: errTest; - errTest-id: nodeAttr(id); - errTest-act: kssAttr(act); -} - -/* This one adds the err handling to the second row - It also demonstrates kss rules are merged like css ones -*/ - -/* -.handled:click { - errTest-error: alert; - alert-message: nodeAttr(id); -} -*/ - -/* The next rule demonstrates that instead of executing a local - action on the originally selected node, we use executeCommand - which execute a given local action on a new set of selected nodes. -*/ - -.handled:click { - errTest-error: executeCommand; - executeCommand-commandSelector: 'update-status'; - executeCommand-commandSelectorType: htmlid; - executeCommand-commandName: replaceInnerHTML; - executeCommand-html: 'Error handler activated.'; -} - -/* Spinner control -*/ - -#spinner-status:spinneron { - evt-spinneron-laziness: 0; - action-client: setStyle; - setStyle-name: display; - setStyle-value: block; -} - -#spinner-status:spinneroff { - evt-spinneroff-laziness: 0; - action-client: setStyle; - setStyle-name: display; - setStyle-value: none; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/error_handling.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/error_handling.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - -

      header

      - -

      Error handling demo

      -
      -
      Loading...
      -
      -

      -
      -

      We try four cases here. "No error" and "Empty action" are both valid responses, - except that the second one gives a response with no commands and so it issues a warning into - the kss log. "Error" gives a failed responses due to an exception in the server method - on the server.

      -

      The buttons in the first row have no error handled.

      -
      - - - - - -
      -

      The buttons in the second row have individual error handlers.

      -
      -
      - - - - - -
      -

      - You can also try suspending your server process and start generating timed out requests. - Timed out responses are also handled like ones arriving with error. - The timeout period is by default 8 s now.

      -

      - In addition, the request queue manager queues up the outgoing responses and maximizes - their number (currently in 4): click like crazy on the buttons and you will see that - your server will not get hogged. More will be told about this topic in the upcoming - documentation.

      - - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/form_submit.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/form_submit.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,5 +0,0 @@ -input#submit:click { - evt-click-preventdefault: true; - action-server: formSave; - formSave-data: currentForm(); -} Deleted: /kukit/kss.demo/trunk/kss/demo/browser/form_submit.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/form_submit.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,53 +0,0 @@ - - - - - - - - - - -

      header

      - -

      Form Submit Demo

      -

      saved !

      -

      Empty

      -
      -
      -
      - -
      -
      -
      - -
      -
      -
      - -
      -
      -
      - -
      -
      -
      - -
      -
      - - -
      -
      -
      - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/html_inserts.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/html_inserts.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,21 +0,0 @@ - -button#insertBefore:click { - action-server: htmlInsertBefore; -} - -button#insertAfter:click { - action-server: htmlInsertAfter; -} - -button#insertAsFirstChild:click { - action-server: htmlInsertAsFirstChild; -} - -button#insertAsLastChild:click { - action-server: htmlInsertAsLastChild; -} - -button#insert:click { - action-server: htmlReplace; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/html_inserts.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/html_inserts.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - -

      header

      - -

      HTML insertions (a.k.a. Change tags II.)

      -
        -
      • - -
      • -
      • - -
      • -
      • - -
      • -
      • - -
      • -
      • - -
      • -
      -

      The playground:

      -

      KSS for a life.

      - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/inline_edit.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/inline_edit.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,20 +0,0 @@ -div#text:click { - action-server: getInputField; - getInputField-value: currentFormVar(value); -} - -div#text:keydown { -evt-keydown-allowbubbling: true; -evt-keydown-keycodes: 13; -action-client:log; -action-server: saveText; -saveText-value:currentFormVar(value); - -} - -input#save:click { - action-server: saveText; - saveText-value: currentFormVar(value); -} - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/inline_edit.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/inline_edit.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,24 +0,0 @@ - - - - - - - - - - -

      header

      - - -

      Instant edit Demo

      -
      -
      -
      - click me! - -
      -
      -
      - - Modified: kukit/kss.demo/trunk/kss/demo/browser/kss_demo_index.pt ============================================================================== --- kukit/kss.demo/trunk/kss/demo/browser/kss_demo_index.pt (original) +++ kukit/kss.demo/trunk/kss/demo/browser/kss_demo_index.pt Sun Sep 30 23:15:13 2007 @@ -6,53 +6,30 @@ tal:attributes="href string:${context/@@absolute_url}/@@kss_devel_mode/ui_css"/> -

      KSS demos

      +

      KSS demos

      Kss mode

      - -

      Parameter functions

      - -

      Selectors

      - -

      Core syntax

      - -

      Core plugin

      - -

      Commands/Actions

      - - -

      - -

      Unit tests

      +

      Unit tests

      - + + +

      Core plugin

      +
      + +

      Plugin namespace: core

      +
      + +

      Category

      +
      + +
      + Deleted: /kukit/kss.demo/trunk/kss/demo/browser/more_selectors.js ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/more_selectors.js Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,37 +0,0 @@ - -/* Event plugins for the more_selector demo */ -kukit.more_selectors = {}; - -kukit.more_selectors.AnnoyClickerEvent = function() { -}; - -kukit.more_selectors.AnnoyClickerEvent.prototype.__bind_click__ = function(name, func_to_bind, oper) { - // validate and set parameters - oper.evaluateParameters([], {'count': '3'}, 'annoyClicker event binding'); - oper.evalInt('count', 'annoyClicker event binding'); - if (oper.parms.count < 1) - throw 'Parameter count must be > 0, "' + oper.parms.count + '"'; - // overwrite countsomuch - this.countsomuch = oper.parms.count; - this.count = this.countsomuch; - // Just bind the event via the native event binder - oper.parms = {}; - kukit.pl.NativeEventBinder.prototype.__bind__('click', func_to_bind, oper); -}; - -kukit.more_selectors.AnnoyClickerEvent.prototype.__default_click__ = function(name, oper) { - oper.evaluateParameters([], {}, 'annoyClicker event binding'); - this.count -= 1; - if (this.count == 0) { - // Continue with the real action. - this.count = this.countsomuch; - this.__continueEvent__('doit', oper.node, {}); - } else { - this.__continueEvent__('annoy', oper.node, {}); - } -}; - -kukit.eventsGlobalRegistry.register('annoyclicker', 'click', kukit.more_selectors.AnnoyClickerEvent, '__bind_click__', '__default_click__'); -kukit.eventsGlobalRegistry.register('annoyclicker', 'annoy', kukit.more_selectors.AnnoyClickerEvent, null, null); -kukit.eventsGlobalRegistry.register('annoyclicker', 'doit', kukit.more_selectors.AnnoyClickerEvent, null, null); - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/more_selectors.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/more_selectors.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,29 +0,0 @@ - -#button-one:annoyclicker-click(annoyMe) { -} - -behaviour:annoyclicker-doit(annoyMe) { - action-server: clickedButton; - clickedButton-id: nodeAttr(id); - action-client: log; - log-message: "Was here."; -} - -behaviour:annoyclicker-annoy(annoyMe) { - action-client: alert; - alert-message: "Keep trying until you get there"; -} - -#button-two:annoyclicker-click(annoyYou) { - evt-annoyclicker-click-count: 2; -} - -behaviour:annoyclicker-doit(annoyYou) { - action-server: clickedButton; - clickedButton-id: nodeAttr(id); -} - -behaviour:annoyclicker-annoy(annoyYou) { - action-client: alert; - alert-message: "Keep trying until you get there, from the second button"; -} Deleted: /kukit/kss.demo/trunk/kss/demo/browser/more_selectors.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/more_selectors.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - -

      header

      - -

      More complex selectors

      - -

      -This demo implements the annoyclicker-click kss plugin that shows a simple -pattern of creating stateful (class-like) events in a plugin -and how to bind them from kss. -

      - -

      -The first button and the second button are bound to two "event binder -instances", the first one sends every 3rd click to the server and -executes a local action otherwise; the second button does -the same but with a count of two. -

      - - -

      Demo

      -
      -
      - - - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/preventdefault.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/preventdefault.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,62 +0,0 @@ - -a#follow:click { - evt-click-preventdefault: true; - action-client: log; -} - -/* preventdefault is explicit on this.*/ - -input[type="text"].text:keydown { - evt-keydown-preventdefault: true; - evt-keydown-keycodes: 13; - action-client: log; -} - -/* Since some browsers (mainly, some version of Safari) - do a little bit of fireworks with the events (yeah, - cause it fires them up all together) we disable the - default on all of them */ -input[type="text"].text:keypress { - evt-keypress-preventdefault: true; - evt-keypress-keycodes: 13; - action-client: log; -} - -input[type="text"].text:keyup { - evt-keyup-preventdefault: true; - evt-keyup-keycodes: 13; - action-client: log; -} - -/* This used to be the old hack for Safari, actually disabling - the default (submit) on button click. - Apparently the default action for Safari is not "submit the form" - but rather "click on submit", hence triggering another event - through an event */ -input[type="submit"]:click { - evt-click-preventdefault: true; - action-client: log; -} - -/* Second row, allowbubbling combined: */ - -div#follow-wrapper:click { - evt-click-preventdefault: true; - evt-click-allowbubbling: true; - action-client: log; -} - -/* preventdefault is explicit on this.*/ -div#text-wrapper:keydown { - evt-keydown-preventdefault: true; - evt-keydown-allowbubbling: true; - evt-keydown-keycodes: 13; - action-client: log; -} - -div#submit-wrapper:click { - evt-click-preventdefault: true; - evt-click-allowbubbling: true; - action-client: log; -} - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/preventdefault.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/preventdefault.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - -

      header

      - -

      Preventdefault Demo

      -

      - This is for testing the work of preventdefault to test a specific - workaround against a Safari bug. Specifically, none of the above - controls should cause a page reload. -

      -
      -

      Do not follow

      - - - - - -

      The same with allowbubbling combined:

      - -
      - -
      -
      - -
      -
      - -
      -
      - - Copied: kukit/kss.demo/trunk/kss/demo/browser/registry.py (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/browser/registry.py (original) +++ kukit/kss.demo/trunk/kss/demo/browser/registry.py Sun Sep 30 23:15:13 2007 @@ -1,8 +1,12 @@ from kss.demo.interfaces import IKSSDemoRegistry +from zope.publisher.interfaces.browser import IBrowserPublisher +from zope.publisher.interfaces import NotFound from zope.component import getUtility +from zope.interface import implements try: from Products.Five import BrowserView + BrowserView # make pyflakes happy except ImportError: from zope.publisher.browser import BrowserView @@ -52,6 +56,31 @@ class KSSDemoRegistryAdminView(BrowserView): """Things that only admin should do""" + implements(IBrowserPublisher) + + # Zope3 requires the implementation of + # IBrowserPublisher, in order for the methods + # to be traversable. + # + # An alternative would be: + # + # + # + # + + def publishTraverse(self, request, name): + try: + return getattr(self, name) + except AttributeError: + raise NotFound(self.context, name, request) + + def browserDefault(self, request): + # make ui the default method + return self, ('cookSeleniumTests', ) + + # -- + # Accessable methods + # -- def cookSeleniumTests(self): """Cook selenium tests Deleted: /kukit/kss.demo/trunk/kss/demo/browser/tree.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/tree.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,11 +0,0 @@ -.state-expanded:click { - action-server: collapseSubTree; - collapseSubTree-value: kssAttr("node"); - collapseSubTree-xvalue: kssAttr("xnode"); -} - -.state-collapsed:click { - action-server: expandSubTree; - expandSubTree-value: kssAttr("node"); - expandSubTree-xvalue: kssAttr("xnode"); -} Deleted: /kukit/kss.demo/trunk/kss/demo/browser/tree.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/tree.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,50 +0,0 @@ - - - - - - - -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      - -

      Tree Demo

      -

      This is not finished yet.

      -

      In this demo we use attributes in a special namespace. This makes - it possible to put attributes to nodes without being forced to reuse "id" - or otherwise produce invalid html.

      -

      There are two ways to provide these attributes in pages: - with real xhtml (mimetype text/xhtml), namespace attributes can be used, - with transitional xhtml (mimetype text/html) - the attributes can be encoded into "class" attributes. Both are demonstrated - in this example in parallel, but in reality, one of these should be - used depending on the content type of the page.

      -
      -
        -
      • 1
      • -
      • 2
      • -
          -
        • 2.1
        • -
        • 2.2
        • -
        -
      • 3
      • -
          -
        • 3.1
        • -
        • 3.2
        • -
        -
      - -
      - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,5 +0,0 @@ -select.master-select:change { - action-server: updateSlaveSelector; - updateSlaveSelector-masterid: nodeAttr("id"); - updateSlaveSelector-value: currentFormVar(); -} Deleted: /kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/two_select_revisited.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,41 +0,0 @@ - - - - - - - - - - -

      header

      - -

      Master-slave selects revisited

      -
      -
      - - -
      -
      - - -
      -
      - - -
      -
      - - Deleted: /kukit/kss.demo/trunk/kss/demo/browser/two_selects.kss ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/two_selects.kss Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,4 +0,0 @@ -select#first:change { - action-server: getCorrespondingSelect; - getCorrespondingSelect-value: currentFormVar(value); -} Deleted: /kukit/kss.demo/trunk/kss/demo/browser/two_selects.pt ============================================================================== --- /kukit/kss.demo/trunk/kss/demo/browser/two_selects.pt Sun Sep 30 23:15:13 2007 +++ (empty file) @@ -1,23 +0,0 @@ - - - - - - - - - - -

      header

      - -

      Two Selects

      -
      - - - -

      Remove Node with XPath

      -

      XPath

      -

      next 1

      -

      next 2

      -

      next 3

      - - - Modified: kukit/kss.demo/trunk/kss/demo/configure.zcml ============================================================================== --- kukit/kss.demo/trunk/kss/demo/configure.zcml (original) +++ kukit/kss.demo/trunk/kss/demo/configure.zcml Sun Sep 30 23:15:13 2007 @@ -15,509 +15,93 @@ title="View" /> - - + - + - - + - - + - - - + class=".simplecontent.SimpleContent" + meta_type="KssDemo SimpleContent" + addview="AddSimpleContent.html" + permission="zope.View" + global="True" + /> - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - + + + + - - - - - + + Copied: kukit/kss.demo/trunk/kss/demo/demo/autoupdate.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/autoupdate.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/autoupdate.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/autoupdate.pt Sun Sep 30 23:15:13 2007 @@ -1,32 +1,25 @@ - + + - - - - + + + + + + + + -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      + +

      header

      +

      Three autoupdate

      Demo

      Copied: kukit/kss.demo/trunk/kss/demo/demo/basic_commands.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/basic_commands.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/basic_commands.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/basic_commands.pt Sun Sep 30 23:15:13 2007 @@ -1,17 +1,14 @@ - + + - - + + - -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      -

      Kss mode

      + + +

      header

      Change tag content

      Top div

      Copied: kukit/kss.demo/trunk/kss/demo/demo/cancel_submit.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/cancel_submit.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/cancel_submit.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/cancel_submit.pt Sun Sep 30 23:15:13 2007 @@ -1,14 +1,14 @@ - + + - + + + -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      + +

      header

      Cancel Submit Click Demo

      saved !

      Copied: kukit/kss.demo/trunk/kss/demo/demo/commandaction/actions.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/commandaction/actions.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/commandaction/actions.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/commandaction/actions.pt Sun Sep 30 23:15:13 2007 @@ -1,22 +1,25 @@ - + + - - - + + + + + + + + - + +

      header

      +

      Core plugins

      The core plugins are tested here.

      Copied: kukit/kss.demo/trunk/kss/demo/demo/commandaction/focus.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/commandaction/focus.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/commandaction/focus.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/commandaction/focus.pt Sun Sep 30 23:15:13 2007 @@ -1,19 +1,15 @@ - + + - + + + - + +

      header

      +

      Focus

      We test the focus action/command : it is used to set focus to form widgets.

      Copied: kukit/kss.demo/trunk/kss/demo/demo/coreplugin/kss_evt_preventbubbling.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coreplugin/kss_evt_preventbubbling.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coreplugin/kss_evt_preventbubbling.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/coreplugin/kss_evt_preventbubbling.pt Sun Sep 30 23:15:13 2007 @@ -1,23 +1,26 @@ - + + - - - - - + + + + + + + + - + + +

      header

      Kss prevent bubbling demo

      This demo shows how a rule can prevent bubbling of an event to its parent nodes

      Copied: kukit/kss.demo/trunk/kss/demo/demo/coresyntax/kss_selector_param.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coresyntax/kss_selector_param.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coresyntax/kss_selector_param.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/coresyntax/kss_selector_param.pt Sun Sep 30 23:15:13 2007 @@ -1,19 +1,14 @@ - + + - + - - + + - + + +

      header

      Kss selector parameter demo

      Copied: kukit/kss.demo/trunk/kss/demo/demo/coresyntax/kss_url_param.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coresyntax/kss_url_param.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/coresyntax/kss_url_param.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/coresyntax/kss_url_param.pt Sun Sep 30 23:15:13 2007 @@ -1,19 +1,15 @@ - + + - + - + + + + +

      header

      -

      Kss url parameter

      Copied: kukit/kss.demo/trunk/kss/demo/demo/draganddrop.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/draganddrop.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/draganddrop.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/draganddrop.pt Sun Sep 30 23:15:13 2007 @@ -1,42 +1,46 @@ - + + - - - + table.wrapper td.wide div { + margin-right: .5em; + } + table.wrapper td { + vertical-align: top; + } + + + + + -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      + +

      header

      Drag and drop

      Copied: kukit/kss.demo/trunk/kss/demo/demo/effects.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/effects.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/effects.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/effects.pt Sun Sep 30 23:15:13 2007 @@ -1,24 +1,29 @@ - + + - - - + + + + + + + + -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      + +

      header

      +

      Effects

      -

      Demo

      +

      Demo

      Click here to make me fade
      Click here to make me puff
      Click here to make me blindup
      Copied: kukit/kss.demo/trunk/kss/demo/demo/error_handling.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/error_handling.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/error_handling.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/error_handling.pt Sun Sep 30 23:15:13 2007 @@ -1,26 +1,30 @@ - + + - - - - + + + + + + + + + -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      + +

      header

      Error handling demo

      Copied: kukit/kss.demo/trunk/kss/demo/demo/form_submit.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/form_submit.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/form_submit.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/form_submit.pt Sun Sep 30 23:15:13 2007 @@ -1,15 +1,14 @@ - + + - + - + + -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      + +

      header

      Form Submit Demo

      saved !

      Copied: kukit/kss.demo/trunk/kss/demo/demo/html_inserts.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/html_inserts.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/html_inserts.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/html_inserts.pt Sun Sep 30 23:15:13 2007 @@ -1,32 +1,36 @@ - + + - - - + + + + + + + + - -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      + +

      header

      +

      HTML insertions (a.k.a. Change tags II.)

      • Copied: kukit/kss.demo/trunk/kss/demo/demo/inline_edit.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/inline_edit.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/inline_edit.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/inline_edit.pt Sun Sep 30 23:15:13 2007 @@ -1,13 +1,15 @@ - + + - + + + -

        All demos

        -

        Start logging pane

        -

        View KSS resource

        + +

        header

        +

        Instant edit Demo

        Copied: kukit/kss.demo/trunk/kss/demo/demo/more_selectors.js (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/more_selectors.js) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/more_selectors.js (original) +++ kukit/kss.demo/trunk/kss/demo/demo/more_selectors.js Sun Sep 30 23:15:13 2007 @@ -7,7 +7,7 @@ kukit.more_selectors.AnnoyClickerEvent.prototype.__bind_click__ = function(name, func_to_bind, oper) { // validate and set parameters - oper.completeParms([], {'count': '3'}, 'annoyClicker event binding'); + oper.evaluateParameters([], {'count': '3'}, 'annoyClicker event binding'); oper.evalInt('count', 'annoyClicker event binding'); if (oper.parms.count < 1) throw 'Parameter count must be > 0, "' + oper.parms.count + '"'; @@ -20,7 +20,7 @@ }; kukit.more_selectors.AnnoyClickerEvent.prototype.__default_click__ = function(name, oper) { - oper.completeParms([], {}, 'annoyClicker event binding'); + oper.evaluateParameters([], {}, 'annoyClicker event binding'); this.count -= 1; if (this.count == 0) { // Continue with the real action. Copied: kukit/kss.demo/trunk/kss/demo/demo/more_selectors.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/more_selectors.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/more_selectors.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/more_selectors.pt Sun Sep 30 23:15:13 2007 @@ -1,18 +1,23 @@ - + + - - - + + + + + + + + -

        All demos

        -

        Start logging pane

        -

        View KSS resource

        + +

        header

        +

        More complex selectors

        Copied: kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/forms.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/parameterfunction/forms.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/parameterfunction/forms.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/parameterfunction/forms.pt Sun Sep 30 23:15:13 2007 @@ -1,19 +1,15 @@ - + + - + + + -

        + +

        header

        +

        Forms

        We test the parameter functions related to forms : those functions extract values from fields to use them in the kinetic stylesheet.

        Copied: kukit/kss.demo/trunk/kss/demo/demo/preventdefault.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/preventdefault.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/preventdefault.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/preventdefault.pt Sun Sep 30 23:15:13 2007 @@ -1,19 +1,22 @@ - + + - - - + + + + + + + + -

        All demos

        -

        Start logging pane

        -

        View KSS resource

        + +

        header

        Preventdefault Demo

        Copied: kukit/kss.demo/trunk/kss/demo/demo/selectors/selectors.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selectors/selectors.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selectors/selectors.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/selectors/selectors.pt Sun Sep 30 23:15:13 2007 @@ -1,22 +1,24 @@ - + + - - - + + + + + + + + -

        + +

        header

        +

        Selectors

        We test the selectors which are used in KSS. The selectors allow you to specify what node to take action on etc.

        Copied: kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/actions.html (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/actions.html) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/actions.html (original) +++ kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/actions.html Sun Sep 30 23:15:13 2007 @@ -1,18 +1,224 @@ -coreplugin +actions
      - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -38,7 +244,6 @@ - @@ -74,6 +279,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      coreplugin
      actions
      open /demo/actions.html
      clickAndWaitlink=Setup
      assertTextPresentKss mode setup
      clickAndWaitbutton_devel
      assertTextPresentdevelopment
      clickAndWaitlink=Back
      assertTextPresentdevelopment
      assertAttributetoggleclass-button at classbutton click cursorPointer
      clicktoggleclass-button
      assertAttributetoggleclass-button at classbutton click cursorPointer selected
      clicktoggleclass-button
      assertAttributetoggleclass-button at classbutton click cursorPointer
      assertAttributeserver-toggleclass-button at classbutton click cursorPointer
      clickserver-toggleclass-button
      waitForAttributeserver-toggleclass-button at classbutton click cursorPointer selected
      assertAttributeserver-toggleclass-button at classbutton click cursorPointer selected
      clickserver-toggleclass-button
      waitForAttributeserver-toggleclass-button at classbutton click cursorPointer
      assertAttributeserver-toggleclass-button at classbutton click cursorPointer
      assertAttributeaddclass-button at classbutton click cursorPointer
      clickaddclass-button
      waitForAttributeaddclass-button at classbutton click cursorPointer selected
      assertAttributeaddclass-button at classbutton click cursorPointer selected
      assertAttributeserver-addclass-button at classbutton click cursorPointer
      clickserver-addclass-button
      waitForAttributeserver-addclass-button at classbutton click cursorPointer selected
      assertAttributeserver-addclass-button at classbutton click cursorPointer selected
      assertAttributeremoveclass-button at classbutton click cursorPointer selected
      clickremoveclass-button
      waitForAttributeremoveclass-button at classbutton click cursorPointer
      assertAttributeremoveclass-button at classbutton click cursorPointer
      assertAttributeserver-removeclass-button at classbutton click cursorPointer selected
      clickserver-removeclass-button
      waitForAttributeserver-removeclass-button at classbutton click cursorPointer
      assertAttributeserver-removeclass-button at classbutton click cursorPointer
      clickAndWaitlink=Setup
      assertTextPresentKss mode setup
      clickAndWaitbutton_prod
      assertTextPresentproduction
      clickAndWaitlink=Back
      assertTextPresentproduction
      assertAttribute toggleclass-button at classtoggleclass-button at class button click cursorPointer
      assertAttribute server-toggleclass-button at classserver-toggleclass-button at class button click cursorPointer
      assertAttributetoggleclass-button at classbutton click cursorPointer
      clicktoggleclass-button
      assertAttributetoggleclass-button at classbutton click cursorPointer selected
      clicktoggleclass-button
      assertAttributetoggleclass-button at classbutton click cursorPointer
      assertAttributeserver-toggleclass-button at classbutton click cursorPointer
      clickserver-toggleclass-button
      waitForAttributeserver-toggleclass-button at classbutton click cursorPointer selected
      assertAttributeserver-toggleclass-button at classbutton click cursorPointer selected
      clickserver-toggleclass-button
      waitForAttributeserver-toggleclass-button at classbutton click cursorPointer
      assertAttributeserver-toggleclass-button at classbutton click cursorPointer
      assertAttributeaddclass-button at classbutton click cursorPointer
      clickaddclass-button
      waitForAttributeaddclass-button at classbutton click cursorPointer selected
      assertAttributeaddclass-button at classbutton click cursorPointer selected
      assertAttributeserver-addclass-button at classbutton click cursorPointer
      clickserver-addclass-button
      waitForAttributeserver-addclass-button at classbutton click cursorPointer selected
      assertAttributeserver-addclass-button at classbutton click cursorPointer selected
      assertAttributeremoveclass-button at classbutton click cursorPointer selected
      clickremoveclass-button
      waitForAttributeremoveclass-button at classbutton click cursorPointer
      assertAttributeremoveclass-button at classbutton click cursorPointer
      assertAttributeserver-removeclass-button at classbutton click cursorPointer selected
      clickserver-removeclass-button
      waitForAttributeserver-removeclass-button at classbutton click cursorPointer
      assertAttributeserver-removeclass-button at classbutton click cursorPointer
      Copied: kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/basic_commands.html (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/basic_commands.html) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/basic_commands.html (original) +++ kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/basic_commands.html Sun Sep 30 23:15:13 2007 @@ -1,22 +1,251 @@ -demo1 +basic_commands - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Copied: kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/kss_prevent_bubbling.html (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/kss_prevent_bubbling.html) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/selenium_tests/kss_prevent_bubbling.html (original) +++ kukit/kss.demo/trunk/kss/demo/demo/selenium_tests/kss_prevent_bubbling.html Sun Sep 30 23:15:13 2007 @@ -13,6 +13,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -58,6 +90,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copied: kukit/kss.demo/trunk/kss/demo/demo/two_select_revisited.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/two_select_revisited.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/two_select_revisited.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/two_select_revisited.pt Sun Sep 30 23:15:13 2007 @@ -1,13 +1,15 @@ - + + - + + + -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      + +

      header

      +

      Master-slave selects revisited

      Copied: kukit/kss.demo/trunk/kss/demo/demo/two_selects.pt (from r47044, kukit/kss.demo/branch/ree-demoload/kss/demo/demo/two_selects.pt) ============================================================================== --- kukit/kss.demo/branch/ree-demoload/kss/demo/demo/two_selects.pt (original) +++ kukit/kss.demo/trunk/kss/demo/demo/two_selects.pt Sun Sep 30 23:15:13 2007 @@ -1,13 +1,15 @@ - + + - + + + -

      All demos

      -

      Start logging pane

      -

      View KSS resource

      + +

      header

      +

      Two Selects

      '] - result.extend(['' % item for item in mapping[value]]) - result.append('') - self.getCommandSet('core').replaceHTML('select#second', ' '.join(result)) - return self.render() - - def getAutoupdateMarkup(self): - """ returns the current time """ - self.getCommandSet('core').replaceInnerHTML('div#update-wrapper', '
      ') - return self.render() - - def getCurrentTime(self): - """ returns the current time """ - self.getCommandSet('core').replaceInnerHTML('div#update-area', "

      %s

      " % str(datetime.datetime.now())) - return self.render() - - def getInputField(self, value): - 'Inserts the value as entered into an input field' - # We need to make unicode. But on Z2 we receive utf-8, on Z3 unicode - value = force_unicode(value, 'utf') - self.getCommandSet('core').replaceInnerHTML('div#text', - '
      ' \ - '' - ) - return self.render() - - def saveText(self, value): - 'Inserts the value to display it on the page' - # We need to make unicode. But on Z2 we receive utf-8, on Z3 unicode - value = force_unicode(value, 'utf') - self.getCommandSet('core').replaceInnerHTML('div#text', value+'') - return self.render() - - def expandSubTree(self, value, xvalue): - 'Expands given subtree' - self.getCommandSet('core').replaceInnerHTML('#text', 'works, expand %s (xhtml attr: %s)' % (value, xvalue)) - return self.render() - - def collapseSubTree(self, value, xvalue): - 'Collapses given subtree' - self.getCommandSet('core').replaceInnerHTML('#text', 'works, collapse %s (xhtml attr: %s)' % (value, xvalue)) - return self.render() - - def cancelSubmitSave(self, text_save): - # We need to make unicode. But on Z2 we receive utf-8, on Z3 unicode - text_save = force_unicode(text_save, 'utf') - self.getCommandSet('core').replaceInnerHTML('div#async', 'Async saved %s' % text_save) - return self.render() - - def removeNodeXpath(self): - # XXX the xpath selector is now moved out of the core, see suppl, product "azaxslt" - sel = self.getSelector('xpath', "//P[@id='xpath']/following-sibling::*[position()=1]") - self.getCommandSet('core').deleteNode(sel) - return self.render() - - def clickedButton(self, id): - 'Show status of the button clicked' - self.getCommandSet('core').replaceInnerHTML('#update-status', "

      Button %s clicked. %s

      " % (id, datetime.datetime.now())) - return self.render() - - def updateSlaveSelector(self, masterid, value): - """ returns select content """ - mapping = {} - mapping['']=[] - mapping['animals']=['dog', 'cat', 'cow'] - mapping['machines']=['computer', 'car', 'airplane'] - # calculate the slave id - master, _dummy = masterid.split('-') - slaveid = '%s-slave' % master - # make the payload - result = ['') - # XXX See above remark why we need to replace the outer select. - self.getCommandSet('core').replaceHTML('select#%s' % slaveid, ' '.join(result)) - return self.render() - - def formSubmitSave(self, data): - result = ['

      Async saved:

      demo1
      basic_commands
      open/demo/basic_commands.html/demo/basic_commands.html
      clickAndWaitlink=Setup
      assertTextPresentKss mode setup
      clickAndWaitbutton_devel
      assertTextPresentdevelopment
      clickAndWaitlink=Back
      assertTextPresentdevelopment
      assertTextdemoKSS
      assertTextcopycopy here
      clickchange
      waitForElementPresentworkedagain
      assertElementPresentworkedagain
      assertTextdemoit worked again
      clickclear
      waitForElementNotPresentworkedagain
      assertNotTextdemoit worked again
      clickcopyFrom
      waitForNotTextcopycopy here
      assertNotTextcopycopy here
      assertElementNotPresentworkedagain
      clickchange
      waitForElementPresentworkedagain
      assertElementPresentworkedagain
      assertNotTextcopyit worked again
      clickcopyFrom
      waitForTextcopyit worked again
      assertTextcopyit worked again
      clickclear
      waitForNotTextdemoit worked again
      assertNotTextdemoit worked again
      clickcopyTo
      waitForTextdemoit worked again
      assertTextdemoit worked again
      clickclear
      waitForNotTextdemoit worked again
      assertNotTextdemoit worked again
      clickmoveTo
      waitForTextdemoit worked again
      assertTextdemoit worked again
      assertNotTextcopyit worked again
      clickAndWaitlink=Setup
      assertTextPresentKss mode setup
      clickAndWaitbutton_prod
      assertTextPresentproduction
      clickAndWaitlink=Back
      assertTextPresentproduction
      assertText demoKSSKSS
      assertText/demo/kss_evt_preventbubbling.html
      clickAndWaitlink=Setup
      assertTextPresentKss mode setup
      clickAndWaitbutton_devel
      assertTextPresentdevelopment
      clickAndWaitlink=Back
      assertTextPresentdevelopment
      clickAt css=div#parent-nodeyou clicked the not bubbling A tag, event [click], rule #2, node [A].
      clickAndWaitlink=Setup
      assertTextPresentKss mode setup
      clickAndWaitbutton_prod
      assertTextPresentproduction
      clickAndWaitlink=Back
      assertTextPresentproduction
      assertAlertNotPresent
      clickAtcss=div#parent-node
      assertAlertyou clicked inside the DIV tag
      assertAlertNotPresent
      clickAtcss=a#bubbling-node
      assertAlertyou clicked the bubbling A tag
      assertAlertyou clicked inside the DIV tag
      assertAlertNotPresent
      clickAtcss=a#not-bubbling-node
      assertAlertyou clicked the not bubbling A tag
      assertAlertNotPresent
      '] - for key, value in data.items(): - result.append('' % (key, value)) - result.append('
      Name:Value:
      %s%s
      ') - # We need to make unicode. But on Z2 we receive utf-8, on Z3 unicode - retval = force_unicode(''.join(result), 'utf') - self.getCommandSet('core').replaceInnerHTML('div#async', retval) - return self.render() - - def reset(self): - self.getCommandSet('effects').effect('.effects', 'appear') - return self.render() - - @kssaction - def errTest(self, id, act): - if act == 'error': - raise Exception, 'We have an error here.' - elif act == 'explicit': - raise KssExplicitError, 'Explicit error raised.' - elif act == 'empty': - # Just do nothing, we want to return a response with no commands. - # This is valid behaviour, should raise no error, however - # gives a warning in the kukit log. - pass - ## XXX This is commented out by default, but you can try this on your own - ## server, together with the timeout buttons in the page template timeout buttons in the page template. - ## - #elif act == 'timeout': - # # Wait longer then timeout, this is currently 4 s - # time.sleep(6.0); - # # the next reply will never arrive. - # self.replaceInnerHTML('#update-status', u'Timeout response, button %s clicked. %s' % (id, datetime.datetime.now())) - else: - # act = noerror: standard response. - self.getCommandSet('core').replaceInnerHTML('#update-status', u'Normal response, button %s clicked. %s' % (id, datetime.datetime.now())) - return self.render() - - def htmlReplace(self): - """html replace""" - self.getCommandSet('core').replaceHTML('div#frame', '

      KSS for a life.

      ') - return self.render() - - def htmlInsertBefore(self): - """html insert""" - self.getCommandSet('core').insertHTMLBefore('#core', '
      KSS for a life. %s
      ' % (str(datetime.datetime.now()), )) - return self.render() - - def htmlInsertAfter(self): - """html insert""" - self.getCommandSet('core').insertHTMLAfter('#core', '
      KSS for a life. %s
      ' % (str(datetime.datetime.now()), )) - return self.render() - - def htmlInsertAsFirstChild(self): - """html insert""" - self.getCommandSet('core').insertHTMLAsFirstChild('div#frame', '
      KSS for a life. %s
      ' % (str(datetime.datetime.now()), )) - return self.render() - - def htmlInsertAsLastChild(self): - """html insert""" - self.getCommandSet('core').insertHTMLAsLastChild('div#frame', '
      KSS for a life. %s
      ' % (str(datetime.datetime.now()), )) - return self.render() Modified: kukit/kss.demo/trunk/kss/demo/interfaces.py ============================================================================== --- kukit/kss.demo/trunk/kss/demo/interfaces.py (original) +++ kukit/kss.demo/trunk/kss/demo/interfaces.py Sun Sep 30 23:15:13 2007 @@ -1,4 +1,145 @@ from zope.interface import Interface +from zope.schema import ( + TextLine, + List, + ) class ISimpleContent(Interface): pass + +# -- +# Resources +# -- + +class IKSSDemo(Interface): + """Represents an actual demo page""" + + plugin_namespace = TextLine( + title=u"plugin_namespace", + description=u'string with the name of the plugin.' + u'Or: "" when it is the core part.', + required=False, + ) + + category = TextLine( + title=u"component", + description=u'text that will appear as the title of the' + u'category. "" if out of category.', + required=False, + ) + + page_url = TextLine( + title=u"page_url", + description=u'(relative) url of the demo page. This should' + u'traverse on ISimpleContent.', + required=True, + ) + + title = TextLine( + title=u"title", + description=u'Title of the demo. This also identifies it' + u'for removal.', + required=True, + ) + +class IKSSSeleniumTestDirectory(Interface): + """Represents an actual selenium test directory""" + + test_directory = TextLine( + title=u"test directory", + description=u'Relative directory path, contains *.html selenium tests', + required=False, + ) + +# -- +# Resource definition interfaces +# -- + +class IKSSDemoResource(Interface): + """An utility that a demo needs to register""" + + # list of IKSSDemo + demos = List( + title=u"demos", + description=u'The ordered list of demos contained in this plugin', + required=True, + ) + +class IKSSSeleniumTestResource(Interface): + """An utility that a demo needs to register""" + + # list of IKSSSeleniumTestDir + selenium_tests = List( + title=u"selenium tests", + description=u'The list of selenium test directories contained in this plugin', + required=True, + ) + +# -- +# The registry itself +# -- + +class IKSSDemoRegistry(Interface): + """Faciliates registration of demos. + + Implementations must look after the IKSSDemoResource + adapters, and use their content to set up themselves. + """ + + def registerDemo(demo): + """Register a demo + + It has the attributes specified in IKSSDemo: + + plugin_namespace - string with the name of the plugin. + Or: "" when it is the core part. + + category - text that will appear as the title of the + category. "" if out of category. + + demo_page - (relative) url of the demo page. This should + traverse on ISimpleContent. + + title - Title of the demo. This also identifies it + for removal. + """ + + def unregisterDemo(demo): + """Unregister the given demo.""" + + def getSortedDemos(): + """Get the (sorted) list of demos""" + +class IKSSSeleniumTestRegistry(Interface): + """Faciliates registration of demos. + + Implementations must look after the IKSSSeleniumTestResource + adapters, and use their content to set up themselves. + """ + + def registerSeleniumTestFile(test_filename): + """Register a selenium test directory + + It test_dir has the "filename" attributes specified in IKSSSeleniumTest. + """ + + def unregisterSeleniumTestFile(test_filename): + """Unregister the given test directory.""" + + def cookSeleniumTests(): + """Cook selenium tests + + The *.html tests from each plugin are produced + into the file seltest_all.pty in the directory + of kss.demo.selenium_utils . + """ + +# -- +# Event that gets redispatched, for allowing +# the listeners to filter on component +# -- + +class IKSSDemoRegistrationEvent(Interface): + """Redispatched evend for registration of + IKSSPDemoRegistry utilities. + """ Modified: kukit/kss.demo/trunk/kss/demo/tests/test_demoview.py ============================================================================== --- kukit/kss.demo/trunk/kss/demo/tests/test_demoview.py (original) +++ kukit/kss.demo/trunk/kss/demo/tests/test_demoview.py Sun Sep 30 23:15:13 2007 @@ -58,11 +58,11 @@ res = view.getDivContent() self.assertEquals(res, [ {'selectorType': '', 'params': { - 'html': u'

      it worked

      ', + 'html': u'it worked

      ]]>', 'withKssSetup': u'True', }, 'name': 'replaceInnerHTML', 'selector': 'div#demo'}, {'selectorType': '', 'params': { - 'html': u'

      it worked again

      ', + 'html': u'it worked again]]>', 'withKssSetup': u'True', }, 'name': 'replaceInnerHTML', 'selector': 'div#demo'}, ]) @@ -70,5 +70,4 @@ def test_suite(): return unittest.TestSuite(( unittest.makeSuite(KSSDemoTestCase), - doctest.DocTestSuite('kss.demo.demoview'), ))