From kukit-checkins at codespeak.net Sat Nov 1 08:07:41 2008 From: kukit-checkins at codespeak.net (VIAGRA INC) Date: Sat, 1 Nov 2008 08:07:41 +0100 (CET) Subject: [KSS-checkins] SALE 89% OFF Message-ID: <20081101-50557.28026.qmail@c3nat.acxiom.com> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20081101/eeca57f4/attachment-0001.htm From wiggy at codespeak.net Wed Nov 5 15:12:49 2008 From: wiggy at codespeak.net (wiggy at codespeak.net) Date: Wed, 5 Nov 2008 15:12:49 +0100 (CET) Subject: [KSS-checkins] r59725 - in kukit/kss.core/branch/1.4: docs kss/core/pluginregistry/json Message-ID: <20081105141249.E0610169E42@codespeak.net> Author: wiggy Date: Wed Nov 5 15:12:47 2008 New Revision: 59725 Modified: kukit/kss.core/branch/1.4/docs/HISTORY.txt kukit/kss.core/branch/1.4/kss/core/pluginregistry/json/utils.py Log: Use the real request in the json logic so skin layers, request parmeters are available Modified: kukit/kss.core/branch/1.4/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/branch/1.4/docs/HISTORY.txt (original) +++ kukit/kss.core/branch/1.4/docs/HISTORY.txt Wed Nov 5 15:12:47 2008 @@ -4,7 +4,10 @@ kss.core - 1.4dev Unreleased - - ... + - Use the real request in the json logic so skin layers, request parmeters, + etc. are available. + [wichert] + kss.core - 1.4.3 Released 2008-08-18 Modified: kukit/kss.core/branch/1.4/kss/core/pluginregistry/json/utils.py ============================================================================== --- kukit/kss.core/branch/1.4/kss/core/pluginregistry/json/utils.py (original) +++ kukit/kss.core/branch/1.4/kss/core/pluginregistry/json/utils.py Wed Nov 5 15:12:47 2008 @@ -14,10 +14,12 @@ 'Gets the addon javascript files for json' files = [] # Try adding the jsonserver files - request = TestRequest() + request = getattr(capi.getSiteManager(), 'REQUEST', None) + try: - # use the files already registered to that concat resource - jsonrpc = capi.getAdapter(request, Interface, 'jsonrpc.js') + if request is not None: + # use the files already registered to that concat resource + jsonrpc = capi.getAdapter(request, Interface, 'jsonrpc.js') except capi.ComponentLookupError: pass # JSON not present. else: From wiggy at codespeak.net Wed Nov 5 15:13:46 2008 From: wiggy at codespeak.net (wiggy at codespeak.net) Date: Wed, 5 Nov 2008 15:13:46 +0100 (CET) Subject: [KSS-checkins] r59726 - in kukit/kss.core/trunk: docs kss/core/pluginregistry/json Message-ID: <20081105141346.77CE3169E42@codespeak.net> Author: wiggy Date: Wed Nov 5 15:13:45 2008 New Revision: 59726 Modified: kukit/kss.core/trunk/docs/HISTORY.txt kukit/kss.core/trunk/kss/core/pluginregistry/json/utils.py Log: Merge r59725 from 1.4 branch Modified: kukit/kss.core/trunk/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/trunk/docs/HISTORY.txt (original) +++ kukit/kss.core/trunk/docs/HISTORY.txt Wed Nov 5 15:13:45 2008 @@ -4,8 +4,10 @@ kss.core - 1.5dev Unreleased - - ... - + - Use the real request in the json logic so skin layers, request parmeters, + etc. are available. + [wichert] + - Replaced license header of third-party sarissa.js to workaround the license detection of ohloh. sarissa.js is redistributed under GNU GPL v2 Modified: kukit/kss.core/trunk/kss/core/pluginregistry/json/utils.py ============================================================================== --- kukit/kss.core/trunk/kss/core/pluginregistry/json/utils.py (original) +++ kukit/kss.core/trunk/kss/core/pluginregistry/json/utils.py Wed Nov 5 15:13:45 2008 @@ -14,10 +14,12 @@ 'Gets the addon javascript files for json' files = [] # Try adding the jsonserver files - request = TestRequest() + request = getattr(capi.getSiteManager(), 'REQUEST', None) + try: - # use the files already registered to that concat resource - jsonrpc = capi.getAdapter(request, Interface, 'jsonrpc.js') + if request is not None: + # use the files already registered to that concat resource + jsonrpc = capi.getAdapter(request, Interface, 'jsonrpc.js') except capi.ComponentLookupError: pass # JSON not present. else: From kukit-checkins at codespeak.net Fri Nov 7 20:27:55 2008 From: kukit-checkins at codespeak.net (kukit-checkins at codespeak.net) Date: Fri, 7 Nov 2008 20:27:55 +0100 (CET) Subject: [KSS-checkins] invoice Message-ID: <20081107192755.2F8661684EC@codespeak.net> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20081107/b293cd6f/attachment.htm From kukit-checkins at codespeak.net Sat Nov 8 02:20:26 2008 From: kukit-checkins at codespeak.net (kukit-checkins at codespeak.net) Date: Sat, 8 Nov 2008 02:20:26 +0100 (CET) Subject: [KSS-checkins] order Message-ID: <20081108012026.B960E16841E@codespeak.net> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20081108/a35544c7/attachment.htm From kukit-checkins at codespeak.net Sun Nov 9 18:18:52 2008 From: kukit-checkins at codespeak.net (kukit-checkins at codespeak.net) Date: Sun, 9 Nov 2008 18:18:52 +0100 (CET) Subject: [KSS-checkins] Invitation to upsized dudes community Message-ID: <20081109171852.12C11168427@codespeak.net> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20081109/9b351107/attachment.htm From reebalazs at codespeak.net Mon Nov 10 08:02:40 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 10 Nov 2008 08:02:40 +0100 (CET) Subject: [KSS-checkins] r59845 - kukit/kukit.js/trunk/kukit Message-ID: <20081110070240.303C1168461@codespeak.net> Author: reebalazs Date: Mon Nov 10 08:02:38 2008 New Revision: 59845 Modified: kukit/kukit.js/trunk/kukit/actionreg.js kukit/kukit.js/trunk/kukit/dom.js kukit/kukit.js/trunk/kukit/errors.js kukit/kukit.js/trunk/kukit/forms.js kukit/kukit.js/trunk/kukit/kssparser.js kukit/kukit.js/trunk/kukit/oper.js kukit/kukit.js/trunk/kukit/plugin.js kukit/kukit.js/trunk/kukit/resourcedata.js kukit/kukit.js/trunk/kukit/serveraction.js kukit/kukit.js/trunk/kukit/tokenizer.js kukit/kukit.js/trunk/kukit/utils.js Log: Fix missing semicolons make default logging of xmlhttprequest readystate less verbose fix deprecations in plugin.js Modified: kukit/kukit.js/trunk/kukit/actionreg.js ============================================================================== --- kukit/kukit.js/trunk/kukit/actionreg.js (original) +++ kukit/kukit.js/trunk/kukit/actionreg.js Mon Nov 10 08:02:38 2008 @@ -35,7 +35,7 @@ ;;; if (typeof(func) == 'undefined') { ;;; kukit.e = '[func] argument is mandatory when registering an action'; ;;; kukit.e += ' [actionregistry.register].'; -;;; throw new error(kukit.e); +;;; throw new Error(kukit.e); ;;; } if (this.content[name]) { // do not allow redefinition Modified: kukit/kukit.js/trunk/kukit/dom.js ============================================================================== --- kukit/kukit.js/trunk/kukit/dom.js (original) +++ kukit/kukit.js/trunk/kukit/dom.js Mon Nov 10 08:02:38 2008 @@ -407,7 +407,7 @@ function(node, attrname, recurseParents, getter) { return dom.locateMarkup(node, recurseParents, getter, attrname).value; -} +}; /* * From http://xkr.us/articles/dom/iframe-document/ Modified: kukit/kukit.js/trunk/kukit/errors.js ============================================================================== --- kukit/kukit.js/trunk/kukit/errors.js (original) +++ kukit/kukit.js/trunk/kukit/errors.js Mon Nov 10 08:02:38 2008 @@ -146,8 +146,8 @@ ;;; }; -;;; err.parsingError = function(message, cursor){ -;;; var kw = {} +err.parsingError = function(message, cursor){ + var kw = {}; ;;; if (cursor) { ;;; kw.errpos = cursor.pos; ;;; kw.errrow = cursor.row; @@ -158,8 +158,8 @@ ;;; kw.errrow = null; ;;; kw.errcol = null; ;;; } -;;; return setErrorInfo(null, 'ParsingError', message, kw); -;;; }; + return setErrorInfo(null, 'ParsingError', message, kw); +}; /* Exceptions that re-throw (annotate) an already caught error */ @@ -186,7 +186,7 @@ ;;; err.kssParsingError = function(e, url){ -;;; var kw = {url: url} +;;; var kw = {url: url}; ;;; var message = 'Error parsing KSS at ' + url; ;;; return setErrorInfo(e, 'KssParsingError', message, kw); ;;; }; Modified: kukit/kukit.js/trunk/kukit/forms.js ============================================================================== --- kukit/kukit.js/trunk/kukit/forms.js (original) +++ kukit/kukit.js/trunk/kukit/forms.js Mon Nov 10 08:02:38 2008 @@ -132,7 +132,7 @@ this.initialize = function(target) { this.target = target; -} +}; this.queryForm = function() { // Find the form that contains the target node. Modified: kukit/kukit.js/trunk/kukit/kssparser.js ============================================================================== --- kukit/kukit.js/trunk/kukit/kssparser.js (original) +++ kukit/kukit.js/trunk/kukit/kssparser.js Mon Nov 10 08:02:38 2008 @@ -63,23 +63,23 @@ }; var _returnComment = function() { - return new kssp.Comment(this.cursor, kssp.openComment) + return new kssp.Comment(this.cursor, kssp.openComment); }; var _returnString = function() { - return new kssp.String(this.cursor, kssp.quote) + return new kssp.String(this.cursor, kssp.quote); }; var _returnString2 = function() { - return new kssp.String2(this.cursor, kssp.dquote) + return new kssp.String2(this.cursor, kssp.dquote); }; var _returnMethodArgs = function() { - return new kssp.MethodArgs(this.cursor, kssp.openParent) + return new kssp.MethodArgs(this.cursor, kssp.openParent); }; var _returnBackslashed = function() { - return new kssp.Backslashed(this.cursor, kssp.backslash) + return new kssp.Backslashed(this.cursor, kssp.backslash); }; /* @@ -556,7 +556,7 @@ this.process = function() { // For multivalue only - this.values = [] + this.values = []; // Parse all tokens (including first and last) var context = {'nextTokenIndex': 0}; this.txt = ''; @@ -955,7 +955,7 @@ while (context.nextTokenIndex < this.result.length) { this.digestTxt(context, kukit.tk.Fraction, kssp.Comment, kssp.String, kssp.String2); - var cursor = new kukit.tk.Cursor(context.txt + ' ') + var cursor = new kukit.tk.Cursor(context.txt + ' '); var parser = new kssp.KssSelector(cursor, null, true); this.selectors.push(parser.kssSelector); if (context.nextTokenIndex == this.result.length) break; @@ -972,10 +972,10 @@ }; kssp.KssSelectors = kukit.tk.mkParser('kssselectors', { "'": function() { - return new kssp.StringInSelector(this.cursor, kssp.quote) + return new kssp.StringInSelector(this.cursor, kssp.quote); }, '"': function() { - return new kssp.String2InSelector(this.cursor, kssp.dquote) + return new kssp.String2InSelector(this.cursor, kssp.dquote); }, ",": _mkReturnToken(kssp.comma), "{": _emitAndReturn, @@ -1113,7 +1113,7 @@ kssp.KssSelector = kukit.tk.mkParser('kssselector', { ":": function() { return [new kssp.colon(this.cursor), - new kssp.EventValue(this.cursor)] + new kssp.EventValue(this.cursor)]; }, "{": _emitAndReturn, "\/\*": _returnComment Modified: kukit/kukit.js/trunk/kukit/oper.js ============================================================================== --- kukit/kukit.js/trunk/kukit/oper.js (original) +++ kukit/kukit.js/trunk/kukit/oper.js Mon Nov 10 08:02:38 2008 @@ -289,14 +289,14 @@ if (this.eventRule) { // if it has actions, the answer is yes if (this.eventRule.actions.hasActions()) - return true + return true; // if we have a default action, we will return true in any case // because we may want to call it. // The reason for this check is, that a default action is also // valid, even if it received no parms in the eventRule, // in which case it is not present as an action. var kssevent = kukit.eventsGlobalRegistry.get( - this.getEventNamespace(), this.getEventName()) + this.getEventNamespace(), this.getEventName()); var methodName = kssevent.defaultActionMethodName; return (typeof methodName != 'undefined'); } else Modified: kukit/kukit.js/trunk/kukit/plugin.js ============================================================================== --- kukit/kukit.js/trunk/kukit/plugin.js (original) +++ kukit/kukit.js/trunk/kukit/plugin.js Mon Nov 10 08:02:38 2008 @@ -971,11 +971,11 @@ } } if (parms.allnodes) { - binder.__continueEvent_allNodes__(parms.name, + binder.continueEventAllNodes(parms.name, actionParameters); } else { // execution happens on the orignode - binder.__continueEvent__(parms.name, oper.orignode, + binder.continueEvent(parms.name, oper.orignode, actionParameters); } }); Modified: kukit/kukit.js/trunk/kukit/resourcedata.js ============================================================================== --- kukit/kukit.js/trunk/kukit/resourcedata.js (original) +++ kukit/kukit.js/trunk/kukit/resourcedata.js Mon Nov 10 08:02:38 2008 @@ -157,7 +157,7 @@ // key: value; this.initialize = function(txt) { this.txt = txt; -} +}; this.check = function(registry) { // use the IdentityPP provider. Modified: kukit/kukit.js/trunk/kukit/serveraction.js ============================================================================== --- kukit/kukit.js/trunk/kukit/serveraction.js (original) +++ kukit/kukit.js/trunk/kukit/serveraction.js Mon Nov 10 08:02:38 2008 @@ -135,8 +135,8 @@ }; this.notifyServer_done = function(domDoc) { -;;; var msg = 'Request readyState = ' + domDoc.readyState + '.'; -;;; kukit.logDebug(msg); +//;;; var msg = 'Request readyState = ' + domDoc.readyState + '.'; +//;;; kukit.logDebug(msg); if (domDoc.readyState == 4) { // notify the queue that we are done var success = this.oper.queueItem.receivedResult(); @@ -288,7 +288,8 @@ ;;; } throw kukit.err.responseParsingError(kukit.E); } - } + }; + if (dom == null) { // this should not happen ;;; kukit.E = 'Neither xml nor html payload.'; Modified: kukit/kukit.js/trunk/kukit/tokenizer.js ============================================================================== --- kukit/kukit.js/trunk/kukit/tokenizer.js (original) +++ kukit/kukit.js/trunk/kukit/tokenizer.js Mon Nov 10 08:02:38 2008 @@ -68,7 +68,7 @@ }; this.nextStep = function() { - var table = this.table + var table = this.table; var cursor = this.cursor; // Search for symbol according to table. var best_pos = cursor.text.length; @@ -239,7 +239,7 @@ tk.mkParser = function(symbol, table, _class) { // Poor man's subclassing. f = function(cursor, tokenClass, isTopLevelParser) { - this.table = table + this.table = table; this.cursor = cursor; this.startpos = cursor.pos; this.finished = false; Modified: kukit/kukit.js/trunk/kukit/utils.js ============================================================================== --- kukit/kukit.js/trunk/kukit/utils.js (original) +++ kukit/kukit.js/trunk/kukit/utils.js Mon Nov 10 08:02:38 2008 @@ -54,7 +54,7 @@ try { kukit.HAVE_SAFARI = navigator.vendor && navigator.vendor.indexOf('Apple') != -1; - kukit.HAVE_IE = eval("_SARISSA_IS_IE"); + kukit.HAVE_IE = eval("_SARISSA_IS_IE"); } catch (e) {} ;;; // Activation of extra logging panel: if necessary @@ -82,7 +82,7 @@ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; -} +}; // a null function that is used for logging kukit._null = function() {}; @@ -162,7 +162,7 @@ ;;; kukit.dom.createCookie(kukit._COOKIE_LOGLEVEL, level); ;;; // re-establish the log handlers, based on this cookie setting ;;; kukit._logger.updateLogLevel(); -} +}; // We want a way of knowing if Firebug is available : // it is very convenient to log a node in Firebug; @@ -192,7 +192,7 @@ ;;; this.logWarning = console.warn; ;;; this.logError = console.error; ;;; this.logFatal = console.error; -;;; } +;;; }; ;;; } ;;; // check whether the logging stuff of MochiKit is available @@ -211,7 +211,7 @@ ;;; this.logWarning = MochiKit.Logging.logWarning; ;;; this.logError = MochiKit.Logging.logError; ;;; this.logFatal = MochiKit.Logging.logFatal; -;;; } +;;; }; ;;; // make convenience url ;;; // javascript:kukit.showLog(); ;;; // instead of the need to say @@ -236,7 +236,7 @@ ;;; this.logWarning = function(str) { console.log('WARNING: '+str); }; ;;; this.logError = function(str) { console.log('ERROR: '+str); }; ;;; this.logFatal = function(str) { console.log('FATAL: '+str); }; -;;; } +;;; }; ;;; } // Initialize the logger with the solution we've just detected From kukit-checkins at codespeak.net Tue Nov 11 07:52:35 2008 From: kukit-checkins at codespeak.net (kukit-checkins at codespeak.net) Date: Tue, 11 Nov 2008 07:52:35 +0100 (CET) Subject: [KSS-checkins] Doctor Q&A Terrance Stiles Message-ID: <20081111065235.AD8A7168503@codespeak.net> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kukit-checkins/attachments/20081111/ef83530e/attachment-0001.htm From twilight at codespeak.net Wed Nov 12 11:25:07 2008 From: twilight at codespeak.net (twilight at codespeak.net) Date: Wed, 12 Nov 2008 11:25:07 +0100 (CET) Subject: [KSS-checkins] r59881 - kukit/kss.core/branch/bluraction Message-ID: <20081112102507.B03A31684F7@codespeak.net> Author: twilight Date: Wed Nov 12 11:25:05 2008 New Revision: 59881 Added: kukit/kss.core/branch/bluraction/ - copied from r59880, kukit/kss.core/trunk/ Log: Creating a branch for my new 'blur' action. From twilight at codespeak.net Wed Nov 12 12:21:37 2008 From: twilight at codespeak.net (twilight at codespeak.net) Date: Wed, 12 Nov 2008 12:21:37 +0100 (CET) Subject: [KSS-checkins] r59885 - kukit/kukit.js/branch/simon-bluraction Message-ID: <20081112112137.B1BA71684DB@codespeak.net> Author: twilight Date: Wed Nov 12 12:21:37 2008 New Revision: 59885 Added: kukit/kukit.js/branch/simon-bluraction/ - copied from r59884, kukit/kukit.js/trunk/ Log: Branching kukit.js at r59884 to add a blur action. From twilight at codespeak.net Wed Nov 12 12:24:16 2008 From: twilight at codespeak.net (twilight at codespeak.net) Date: Wed, 12 Nov 2008 12:24:16 +0100 (CET) Subject: [KSS-checkins] r59886 - in kukit/kss.core/branch/bluraction/kss/core: . plugins/core Message-ID: <20081112112416.52CB11684DC@codespeak.net> Author: twilight Date: Wed Nov 12 12:24:13 2008 New Revision: 59886 Modified: kukit/kss.core/branch/bluraction/kss/core/ (props changed) kukit/kss.core/branch/bluraction/kss/core/EXTERNALS.TXT kukit/kss.core/branch/bluraction/kss/core/plugins/core/commands.py Log: Initial, untested commit Modified: kukit/kss.core/branch/bluraction/kss/core/EXTERNALS.TXT ============================================================================== --- kukit/kss.core/branch/bluraction/kss/core/EXTERNALS.TXT (original) +++ kukit/kss.core/branch/bluraction/kss/core/EXTERNALS.TXT Wed Nov 12 12:24:13 2008 @@ -6,5 +6,5 @@ # # svn propset svn:externals -F EXTERNALS.TXT . # -kukit http://codespeak.net/svn/kukit/kukit.js/trunk +kukit http://codespeak.net/svn/kukit/kukit.js/branch/simon-bluraction Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/commands.py ============================================================================== --- kukit/kss.core/branch/bluraction/kss/core/plugins/core/commands.py (original) +++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/commands.py Wed Nov 12 12:24:13 2008 @@ -161,6 +161,10 @@ """ see interfaces.py """ command = self.commands.addCommand('focus', selector) + def blur(self, selector): + """ see interfaces.py """ + command = self.commands.addCommand('blur', selector) + # XXX Deprecated ones # BBB until 2007-10-18 From twilight at codespeak.net Wed Nov 12 12:24:26 2008 From: twilight at codespeak.net (twilight at codespeak.net) Date: Wed, 12 Nov 2008 12:24:26 +0100 (CET) Subject: [KSS-checkins] r59887 - kukit/kukit.js/branch/simon-bluraction/kukit Message-ID: <20081112112426.344201684DB@codespeak.net> Author: twilight Date: Wed Nov 12 12:24:25 2008 New Revision: 59887 Modified: kukit/kukit.js/branch/simon-bluraction/kukit/dom.js kukit/kukit.js/branch/simon-bluraction/kukit/plugin.js kukit/kukit.js/branch/simon-bluraction/kukit/selectorreg.js Log: Initial, untested commit Modified: kukit/kukit.js/branch/simon-bluraction/kukit/dom.js ============================================================================== --- kukit/kukit.js/branch/simon-bluraction/kukit/dom.js (original) +++ kukit/kukit.js/branch/simon-bluraction/kukit/dom.js Wed Nov 12 12:24:25 2008 @@ -143,6 +143,16 @@ }; }; +dom.blur = function(node) { + tagName = node.tagName.toLowerCase(); + if ((tagName == 'input') || (tagName == 'select') + || (tagName == 'textarea')) { + node.blur(); +;;;} else { +;;; kukit.logWarning('Blur on node that cannot be blurred !'); + }; +}; + /* * Gets the textual content of the node * if recursive=false (default), does not descend into sub nodes Modified: kukit/kukit.js/branch/simon-bluraction/kukit/plugin.js ============================================================================== --- kukit/kukit.js/branch/simon-bluraction/kukit/plugin.js (original) +++ kukit/kukit.js/branch/simon-bluraction/kukit/plugin.js Wed Nov 12 12:24:25 2008 @@ -882,6 +882,15 @@ kukit.commandsGlobalRegistry.registerFromAction('focus', kukit.cr.makeSelectorCommand); +kukit.actionsGlobalRegistry.register('blur', function(oper) { +;;; oper.componentName = '[blur] action'; + // TODO get rid of none + oper.evaluateParameters([], {'none': false}); + kukit.dom.blur(oper.node); +}); +kukit.commandsGlobalRegistry.registerFromAction('blur', + kukit.cr.makeSelectorCommand); + kukit.actionsGlobalRegistry.register('moveNodeAfter', function(oper) { ;;; oper.componentName = '[moveNodeAfter] action'; ;;; oper.evaluateParameters(['html_id'], {}); Modified: kukit/kukit.js/branch/simon-bluraction/kukit/selectorreg.js ============================================================================== --- kukit/kukit.js/branch/simon-bluraction/kukit/selectorreg.js (original) +++ kukit/kukit.js/branch/simon-bluraction/kukit/selectorreg.js Wed Nov 12 12:24:25 2008 @@ -36,9 +36,9 @@ this.check = function(args) { // check does not need to be used here actually. -;;; if (args.length != 1) { -;;; throw new Error('internal error, xxxselector() needs 1 argument'); -;;; } +//;;; if (args.length != 1) { +//;;; throw new Error('internal error, xxxselector() needs 1 argument'); +//;;; } }; this.eval = function(args, node, defaultParameters) { var f = kukit.selectorTypesGlobalRegistry.get(this.selector_type); From twilight at codespeak.net Wed Nov 12 17:22:18 2008 From: twilight at codespeak.net (twilight at codespeak.net) Date: Wed, 12 Nov 2008 17:22:18 +0100 (CET) Subject: [KSS-checkins] r59893 - in kukit/kss.core/branch/bluraction/kss/core/plugins/core: . demo demo/commandaction Message-ID: <20081112162218.C2DFB1684CD@codespeak.net> Author: twilight Date: Wed Nov 12 17:22:17 2008 New Revision: 59893 Added: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.kss kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.pt Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/configure.zcml kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/commandaction.py kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/configure.zcml kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/config.py kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/zopeconfig.py kukit/kss.core/branch/bluraction/kss/core/plugins/core/interfaces.py Log: Added tests for blur action. Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/configure.zcml ============================================================================== --- kukit/kss.core/branch/bluraction/kss/core/plugins/core/configure.zcml (original) +++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/configure.zcml Wed Nov 12 17:22:17 2008 @@ -276,6 +276,11 @@ /> + + + + + + + + + + + +

header

+ +

Blur

+

We test the blur action/command : it is used to remove focus from form + widgets.

+

The focus is removed from various widgets : input, + select, textarea, with both client and server + actions

+
+

+ Blur input. +

+
+ Select the input, then press the 'Space' key to remove focus from it. +
+
+
+ + +
+
+

+ Blur textarea. +

+
+ Select the textarea, then press the 'Space' key to remove focus from it. +
+
+
+ + +
+
+

+ Blur select. +

+
+ Select the select, then press the 'Space' key to remove focus from it. +
+
+
+ + +
+
+
+ + Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/commandaction.py ============================================================================== --- kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/commandaction.py (original) +++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/commandaction.py Wed Nov 12 17:22:17 2008 @@ -26,6 +26,12 @@ self.getCommandSet('core').focus('#' + id) return self.render() + #blur + + def blur(self, id): + self.getCommandSet('core').blur('#' + id) + return self.render() + #action-cancel def toCancel(self): Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/configure.zcml ============================================================================== --- kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/configure.zcml (original) +++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/configure.zcml Wed Nov 12 17:22:17 2008 @@ -61,6 +61,28 @@ permission="zope.View" /> + + + + + + + + Author: gotcha Date: Sat Nov 15 13:05:40 2008 New Revision: 59929 Modified: kukit/kukit.js/branch/ree-service-layer-and-refactoring/kukit/actionreg.js kukit/kukit.js/branch/ree-service-layer-and-refactoring/kukit/plugin.js kukit/kukit.js/branch/ree-service-layer-and-refactoring/kukit/registries.js Log: cosmetics Modified: kukit/kukit.js/branch/ree-service-layer-and-refactoring/kukit/actionreg.js ============================================================================== --- kukit/kukit.js/branch/ree-service-layer-and-refactoring/kukit/actionreg.js (original) +++ kukit/kukit.js/branch/ree-service-layer-and-refactoring/kukit/actionreg.js Sat Nov 15 13:05:40 2008 @@ -59,9 +59,9 @@ ar.actionRegistry = function() { this.register = function(name, func) { -;;; var msg='Deprecated kukit.ar.actionRegistry.register, use '; -;;; msg += 'kukit.actionsGlobalRegistry.register instead !'; -;;; kukit.logWarning(msg); +;;; var msg='Deprecated kukit.ar.actionRegistry.register, use '; +;;; msg += 'kukit.actionsGlobalRegistry.register instead !'; +;;; kukit.logWarning(msg); kukit.actionsGlobalRegistry.register(name, func); }; }; Modified: kukit/kukit.js/branch/ree-service-layer-and-refactoring/kukit/plugin.js ============================================================================== --- kukit/kukit.js/branch/ree-service-layer-and-refactoring/kukit/plugin.js (original) +++ kukit/kukit.js/branch/ree-service-layer-and-refactoring/kukit/plugin.js Sat Nov 15 13:05:40 2008 @@ -300,9 +300,9 @@ /* kukit.plugins.registerPlugins([ // START KSS REGISTRY - ['events', click, { + ['events', 'click', { defaultActionMethodName: null}], - ['events', dblclick, { + ['events', 'dblclick, { defaultActionMethodName: null}], ['events', 'keyup', { defaultActionMethodName: null}], Modified: kukit/kukit.js/branch/ree-service-layer-and-refactoring/kukit/registries.js ============================================================================== --- kukit/kukit.js/branch/ree-service-layer-and-refactoring/kukit/registries.js (original) +++ kukit/kukit.js/branch/ree-service-layer-and-refactoring/kukit/registries.js Sat Nov 15 13:05:40 2008 @@ -556,12 +556,6 @@ */ this.registerPlugins = function(items, registries) { - // registries is optional, and mainly used for tests - if (typeof(registries) == 'undefined') { - // use global registries - registries = kukit.plugins; - } - // for (var i=0; i Author: gotcha Date: Sat Nov 15 13:36:37 2008 New Revision: 59930 Added: kukit/kukit.js/branch/gotcha-simplify-service-layer/ - copied from r59929, kukit/kukit.js/branch/ree-service-layer-and-refactoring/ Log: branch to remove YAGNI From gotcha at codespeak.net Sat Nov 15 13:37:09 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sat, 15 Nov 2008 13:37:09 +0100 (CET) Subject: [KSS-checkins] r59931 - in kukit/kukit.js/branch/gotcha-simplify-service-layer: kukit tests Message-ID: <20081115123709.99011168421@codespeak.net> Author: gotcha Date: Sat Nov 15 13:37:09 2008 New Revision: 59931 Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_registries.js Log: remove loader Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js ============================================================================== --- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js (original) +++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js Sat Nov 15 13:37:09 2008 @@ -147,12 +147,7 @@ return factory; }; - this.bindItems = function(registries, registry, loader) { - // singleton: the singleton we want to finalize on. - // loader (optional): use it for all operations - // (this means we never get errors but the loader - // will be set up to load missing resources) - // + this.bindItems = function(registries, registry) { // Check if we are finalized. if (this.bound) { ;;; kukit.E = 'Attempt to bind already bound registry ['; @@ -163,7 +158,7 @@ ;;; kukit.logDebug(kukit.E); for (var name in this.factories) { var factory = this.factories[name]; - var item = factory.produceItem(loader); + var item = factory.produceItem(); if (typeof(item) != 'undefined') { // Set the item on the registry registry[name] = item; @@ -173,14 +168,7 @@ // this means that it can be accessed as registries.registryname registries[this.registryName] = registry; // Set bound state. - // We are bound if the loader has no items to load. - // If there is no loader, we are always bound at this point. - this.bound = ! loader || loader.empty(); -;;; if (! this.bound) { -;;; kukit.E = 'Postpone binding of registry [' + this.registryName + '],'; -;;; kukit.E = ' and request sources [', loader.getSources() + ']'; -;;; kukit.logDebug(kukit.E); -;;; } + this.bound = true; }; this.initialize.apply(this, arguments); @@ -229,6 +217,16 @@ } }; + this.getRegistryByType = function(type) { + var registry = this.schema[type]; + if (typeof(registrar) == 'undefined') { +;;; kukit.E = 'Registries.getRegistryByType() is called with unregistered type ['; +;;; kukit.E += type + '].'; + throw new Error(kukit.E); + } + return registry; + }; + }; /* end NamedRegistries */ /* @@ -297,7 +295,7 @@ this.sources[config.sourceName] = config; }; - this.produceItem = function(loader) { + this.produceItem = function() { var func; if (! this.preferredSources) { ;;; kukit.E = 'Undefined method ['; @@ -324,12 +322,6 @@ // if not, we continue with the next best choice. } if (! func) { - if (typeof(loader) != 'undefined') { - // We have a loading method. Let's add our needs. - loader.add(this.fallbackProvider); - // ... and simply go on. - return; - } else { // We raise an error. ;;; kukit.E = 'Could not bind item ['; ;;; kukit.E += this.name + '] on registry ['; @@ -338,9 +330,8 @@ ;;; kukit.E += 'of the following preferences: ['; ;;; kukit.E += this.preferredSources + ']'; throw new Error(kukit.E); - } } else { - // We found the func that we can finalze now. + // We found the func that we can finalize now. ;;; kukit.E = 'Using method ['; ;;; kukit.E += this.name + '] from source ['; ;;; kukit.E += item.sourceName + '] version ['; @@ -390,7 +381,7 @@ this.config = config; }; - this.produceItem = function(loader) { + this.produceItem = function() { // Just return the registered item. // If register was not called, we will return undefined, // which means the method will not be bound on the @@ -458,7 +449,7 @@ }; - this.produceItem = function(loader) { + this.produceItem = function() { // Just return the registered value. return this.config; }; @@ -555,7 +546,7 @@ * */ -this.registerPlugins = function(items, registries) { +this.registerPlugins = function(registries, items) { for (var i=0; i Author: gotcha Date: Sat Nov 15 13:48:11 2008 New Revision: 59932 Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_registries.js Log: rename function Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js ============================================================================== --- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js (original) +++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js Sat Nov 15 13:48:11 2008 @@ -158,7 +158,7 @@ ;;; kukit.logDebug(kukit.E); for (var name in this.factories) { var factory = this.factories[name]; - var item = factory.produceItem(); + var item = factory.create(); if (typeof(item) != 'undefined') { // Set the item on the registry registry[name] = item; @@ -295,7 +295,7 @@ this.sources[config.sourceName] = config; }; - this.produceItem = function() { + this.create = function() { var func; if (! this.preferredSources) { ;;; kukit.E = 'Undefined method ['; @@ -381,7 +381,7 @@ this.config = config; }; - this.produceItem = function() { + this.create = function() { // Just return the registered item. // If register was not called, we will return undefined, // which means the method will not be bound on the @@ -449,7 +449,7 @@ }; - this.produceItem = function() { + this.create = function() { // Just return the registered value. return this.config; }; Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_registries.js ============================================================================== --- kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_registries.js (original) +++ kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_registries.js Sat Nov 15 13:48:11 2008 @@ -47,7 +47,7 @@ this.doThat = function() { called.push("doThat"); } - this.produceItem = function(loader) { + this.create = function() { var signature = "FUNC " + this.name; called.push(signature); return signature; From gotcha at codespeak.net Sun Nov 16 13:38:39 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sun, 16 Nov 2008 13:38:39 +0100 (CET) Subject: [KSS-checkins] r59946 - in kukit/kukit.js/branch/gotcha-simplify-service-layer: kukit tests Message-ID: <20081116123839.106231683BF@codespeak.net> Author: gotcha Date: Sun Nov 16 13:38:37 2008 New Revision: 59946 Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/actionreg.js kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/commandreg.js kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/eventreg.js kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/providerreg.js kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/selectorreg.js kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/service.js kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_registries.js Log: remove NamedRegistries first step Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/actionreg.js ============================================================================== --- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/actionreg.js (original) +++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/actionreg.js Sun Nov 16 13:38:37 2008 @@ -36,7 +36,7 @@ ;;; kukit.e += ' [ActionRegistry.register].'; ;;; throw new Error(kukit.E); ;;; } - var actions = kukit.plugins.schema.actions; + var actions = kukit.registrars.actions; actions.getItemFactory(name).register({actionFunc: func}); }; Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/commandreg.js ============================================================================== --- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/commandreg.js (original) +++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/commandreg.js Sun Nov 16 13:38:37 2008 @@ -33,7 +33,7 @@ this.registerFromAction = function(srcname, factory, name) { - var actions = kukit.plugins.schema.actions; + var actions = kukit.registrars.actions; // // register a given action as a command, using the given vactor var action_factory = actions.getItemFactory(srcname); Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/eventreg.js ============================================================================== --- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/eventreg.js (original) +++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/eventreg.js Sun Nov 16 13:38:37 2008 @@ -78,7 +78,7 @@ } namespacedEventNames.push(eventName); // register the event informataion - var events = kukit.plugins.schema.events; + var events = kukit.registrars.events; events.getItemFactory(eventName).register({ defaultActionMethodName: defaultActionMethodName, parmTypes: null // missing from this api. @@ -87,7 +87,7 @@ // Register the bind iteration // This will specify the set of events that will be bound together, // with the specified iterator - var bindsequences = kukit.plugins.schema.bindsequences; + var bindsequences = kukit.registrars.bindsequences; bindsequences.getItemFactory('').register({ eventNames: namespacedEventNames, iterName: iterName, Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/providerreg.js ============================================================================== --- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/providerreg.js (original) +++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/providerreg.js Sun Nov 16 13:38:37 2008 @@ -43,7 +43,7 @@ returnType = 'string'; } // Always use the global plugins to get the descriptor. - var registry = kukit.plugins.schema[this.name]; + var registry = kukit.registrars[this.name]; registry.getItemFactory(name).register({providerClass: func, returnType: returnType}); }; Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js ============================================================================== --- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js (original) +++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js Sun Nov 16 13:38:37 2008 @@ -177,9 +177,11 @@ this.NamedRegistries = function() { - - this.schema = {}; + this.initialize = function(registrars) { + this.registrars = registrars; + }; + this.initializeRegistry = function(registryName, FactoryClass) { // This sets up the registry given by name with the // specified FactoryClass class, or checks it. @@ -193,19 +195,12 @@ ;;; kukit.E += registryName + '] without a FactoryClass parameter.'; ;;; throw new Error(kukit.E); ;;; } - // Check prohibited names - if (registryName == 'schema' || registryName == 'initializeRegistry') { -;;; kukit.E = 'Registries.initializeRegistry() cannot be called '; -;;; kukit.E += 'with a reserved name ['; -;;; kukit.E += registryName + '].'; - throw new Error(kukit.E); - } // see if we already have this registrar - var registrar = this.schema[registryName]; + var registrar = this.registrars[registryName]; // create the registrar on demand if (typeof(registrar) == 'undefined') { // create the registrar and store it on myself - this.schema[registryName] = new Registrar(registryName, FactoryClass); + this.registrars[registryName] = new Registrar(registryName, FactoryClass); } else { // check that the same FactoryClass was provided. If not, // it's a conflict. @@ -218,7 +213,7 @@ }; this.getRegistryByType = function(type) { - var registry = this.schema[type]; + var registry = this.registrars[type]; if (typeof(registrar) == 'undefined') { ;;; kukit.E = 'Registries.getRegistryByType() is called with unregistered type ['; ;;; kukit.E += type + '].'; @@ -227,6 +222,8 @@ return registry; }; + this.initialize.apply(this, arguments); + }; /* end NamedRegistries */ /* @@ -239,7 +236,7 @@ this.registrar = registrar; this.name = name; this.sources = {}; - this.preferredSources = null; + this.preferredsources = null; }; ;;; this._makeError = function(componentName, name) { @@ -322,21 +319,21 @@ // if not, we continue with the next best choice. } if (! func) { - // We raise an error. -;;; kukit.E = 'Could not bind item ['; -;;; kukit.E += this.name + '] on registry ['; -;;; kukit.E += this.registrar.registryName; -;;; kukit.E += '], because no provider found '; -;;; kukit.E += 'of the following preferences: ['; -;;; kukit.E += this.preferredSources + ']'; - throw new Error(kukit.E); + // We raise an error. +;;; kukit.E = 'Could not bind item ['; +;;; kukit.E += this.name + '] on registry ['; +;;; kukit.E += this.registrar.registryName; +;;; kukit.E += '], because no provider found '; +;;; kukit.E += 'of the following preferences: ['; +;;; kukit.E += this.preferredSources + ']'; + throw new Error(kukit.E); } else { // We found the func that we can finalize now. -;;; kukit.E = 'Using method ['; -;;; kukit.E += this.name + '] from source ['; -;;; kukit.E += item.sourceName + '] version ['; -;;; kukit.E += item.sourceVersion + '].'; -;;; kukit.log(kukit.E); +;;; var msg = 'Using method ['; +;;; msg += this.name + '] from source ['; +;;; msg += item.sourceName + '] version ['; +;;; msg += item.sourceVersion + '].'; +;;; kukit.log(msg); // Return the func, optionally prefixed with a checker. if (this.checker) { // if there is a checker, merge them together @@ -499,8 +496,9 @@ // Initialize global registries this.setupGlobalRegistries = function() { // instantiate registries - kukit.plugins = new this.NamedRegistries(); - kukit.services = new this.NamedRegistries(); + kukit.registrars = {} + kukit.plugins = new this.NamedRegistries(kukit.registrars); + kukit.services = new this.NamedRegistries(kukit.registrars); var r = kukit.plugins; r.initializeRegistry('events', this.PluginFactory); r.initializeRegistry('bindsequences', this.BindSequenceFactory); @@ -512,13 +510,12 @@ // Finalize global registries this.finalizeGlobalRegistries = function() { - var schema = kukit.plugins.schema; - schema.events.bindItems(kukit.plugins, {}); - schema.bindsequences.bindItems(kukit.plugins, {}); - schema.actions.bindItems(kukit.plugins, {}); - schema.valueproviders.bindItems(kukit.plugins, {}); - schema = kukit.services.schema; - schema.core.bindItems(kukit.services, {}); + var registrars = kukit.registrars; + registrars.events.bindItems(kukit.plugins, {}); + registrars.bindsequences.bindItems(kukit.plugins, {}); + registrars.actions.bindItems(kukit.plugins, {}); + registrars.valueproviders.bindItems(kukit.plugins, {}); + registrars.core.bindItems(kukit.services, {}); }; // At this point we setup the registries used by kukit, Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/selectorreg.js ============================================================================== --- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/selectorreg.js (original) +++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/selectorreg.js Sun Nov 16 13:38:37 2008 @@ -84,7 +84,7 @@ }; -var registrar = kukit.plugins.schema.valueproviders; +var registrar = kukit.registrars.valueproviders; registrar.getItemFactory('passnode').register({ providerClass: sr.PassnodePP, returnType: 'selection'}); @@ -114,7 +114,7 @@ ;;; throw new Error(kukit.E); ;;; } // Also register the selector param provider - var registrar = kukit.plugins.schema.valueproviders; + var registrar = kukit.registrars.valueproviders; var providerClass = sr.makeAnySelectorProvider(selectorFunc); registrar.getItemFactory(name).register({ providerClass: providerClass, Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/service.js ============================================================================== --- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/service.js (original) +++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/service.js Sun Nov 16 13:38:37 2008 @@ -2,7 +2,7 @@ new function() { // BEGIN CLOSURE service -var core = kukit.services.schema.core; +var core = kukit.registrars.core; // Requirements towards core services. It contains Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_registries.js ============================================================================== --- kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_registries.js (original) +++ kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_registries.js Sun Nov 16 13:38:37 2008 @@ -25,7 +25,8 @@ this.setUp = function() { // work with our own object, not interfering // with global object setup in registries.js - this.registries = new kukit.reg.NamedRegistries(); + this.registrars = {} + this.registries = new kukit.reg.NamedRegistries(this.registrars); }; }; /* end RegistriesTestCase */ kukit.RegistriesTestCaseBase.prototype = new kukit.UtilsTestCaseBase(); @@ -62,7 +63,7 @@ // We need to initialize it this.registries.initializeRegistry('dummytest', TestFactory); // Now we can access the schema. - var registrar = this.registries.schema.dummytest; + var registrar = this.registrars.dummytest; this.assert(typeof(registrar), 'object'); // Let's get two items registrar.getItemFactory('fooItem').doThis() @@ -77,20 +78,6 @@ this.assertListEquals(called, ['doThis', 'doThat']); }; - this.testReservedInterfaceNames = function() { - // Reserved registry names are prohibited. - // (thex would conflict with the NamedRegistries class) - var self = this; - this.assertThrows(function() { - this.registries.initializeRegistry('initializeRegistry', TestFactory); - }, - Error); - this.assertThrows(function() { - this.registries.initializeRegistry('schema', TestFactory); - }, - Error); - }; - this.testFinalizeRegistries = function() { // We have a singleton, called s. var s = {}; @@ -99,7 +86,7 @@ called = []; // Let's initialize a dummytest registry. this.registries.initializeRegistry('dummytest', TestFactory); - var registrar = this.registries.schema.dummytest; + var registrar = this.registrars.dummytest; // Let's get two factories registrar.getItemFactory('fooItem').doThis() registrar.getItemFactory('barItem').doThat() @@ -154,7 +141,8 @@ this.setUp = function() { // work with our own registries, not interfering // kukit.service or kukit.plugins. - this.registries = new kukit.reg.NamedRegistries(); + this.registrars = {} + this.registries = new kukit.reg.NamedRegistries(this.registrars); // Let's initialize a dummyservice registry. this.registries.initializeRegistry('dummyservice', kukit.reg.ServiceFactory); }; @@ -162,7 +150,7 @@ this.testServiceRegistry = function() { // We have a singleton, called s. var s = {}; - var registrar = this.registries.schema.dummyservice; + var registrar = this.registrars.dummyservice; // Requires four methods, thie defines their necessity and preferred providers registrar.getItemFactory('first').require({ preferredSources: ['corelib', 'extralib']}); @@ -214,7 +202,7 @@ // Test with a checker function. // We have a singleton, called s. var s = {}; - var registrar = this.registries.schema.dummyservice; + var registrar = this.registrars.dummyservice; // and a counter for the checker var checker_counter = 0; // Define three methods @@ -247,7 +235,7 @@ // a plugin first provides a method that another plugin later requires. // We have a singleton, called s. var s = {}; - var registrar = this.registries.schema.dummyservice; + var registrar = this.registrars.dummyservice; // Provide the method first registrar.getItemFactory('first').provide({ sourceName: 'corelib', @@ -265,7 +253,7 @@ this.testFinalizeTwice = function() { // A registrar can only be bound once. var s = {}; - var registrar = this.registries.schema.dummyservice; + var registrar = this.registrars.dummyservice; // Provide the method first registrar.getItemFactory('first').provide({ sourceName: 'corelib', @@ -286,7 +274,7 @@ this.testNotDefined = function() { // A method is provided but not required. var s = {}; - var registrar = this.registries.schema.dummyservice; + var registrar = this.registrars.dummyservice; // Provide the method first registrar.getItemFactory('first').provide({ sourceName: 'corelib', @@ -302,7 +290,7 @@ this.testDoubleProvided = function() { // A method cannot be provided twice by the same source. // Let's initialize a dimmytest registry. - var registrar = this.registries.schema.dummyservice; + var registrar = this.registrars.dummyservice; // Provide the method first registrar.getItemFactory('first').provide({ sourceName: 'corelib', @@ -320,7 +308,7 @@ this.testDoubleDefined = function() { // A method can only be required once. - var registrar = this.registries.schema.dummyservice; + var registrar = this.registrars.dummyservice; // Define the method first registrar.getItemFactory('first').require({ preferredSources: ['corelib', 'extralib']}); @@ -334,7 +322,7 @@ this.testNotProvided = function() { // No preferred provider can be found for a method. var s = {}; - var registrar = this.registries.schema.dummyservice; + var registrar = this.registrars.dummyservice; // Define the method first registrar.getItemFactory('first').require({ preferredSources: ['corelib', 'extralib']}); @@ -363,7 +351,8 @@ this.setUp = function() { // work with our own object, not interfering // kukit.plugins - this.registries = new kukit.reg.NamedRegistries(); + this.registrars = {} + this.registries = new kukit.reg.NamedRegistries(this.registrars); // Let's initialize an events and binditeration registry. this.registries.initializeRegistry('dummyevents', kukit.reg.PluginFactory); this.registries.initializeRegistry('dummybindsequences', kukit.reg.BindSequenceFactory); @@ -373,8 +362,8 @@ this.bind = function(oper) {}; }; this.testPluginRegistries = function() { - var events = this.registries.schema.dummyevents; - var bindsequences = this.registries.schema.dummybindsequences; + var events = this.registrars.dummyevents; + var bindsequences = this.registrars.dummybindsequences; // somewhere else, core registers the items: events.getItemFactory('click').register({ name: 'click', @@ -422,8 +411,8 @@ this.testPluginNoDoubleReg = function() { // No double registration for test plugins. - var events = this.registries.schema.dummyevents; - var bindsequences = this.registries.schema.dummybindsequences; + var events = this.registrars.dummyevents; + var bindsequences = this.registrars.dummybindsequences; // somewhere a plugin registers an item: events.getItemFactory('click').register({ name: 'click', @@ -445,8 +434,8 @@ this.testBindIterationNoDoubleReg = function() { // No double registration for test plugins. - var events = this.registries.schema.dummyevents; - var bindsequences = this.registries.schema.dummybindsequences; + var events = this.registrars.dummyevents; + var bindsequences = this.registrars.dummybindsequences; // somewhere else, core registers the items. // XXX registry name '' is used to call registry level methods bindsequences.getItemFactory('').register({ @@ -484,8 +473,8 @@ this.testOnlyRegisteredPluginsCanBeBound = function() { // We assure that if an item is produced but it is not registered, // it will not be bound on the configuration. - var events = this.registries.schema.dummyevents; - var bindsequences = this.registries.schema.dummybindsequences; + var events = this.registrars.dummyevents; + var bindsequences = this.registrars.dummybindsequences; // Just call up the factoryr: this will create it with config=null. events.getItemFactory('click'); // bind From gotcha at codespeak.net Sun Nov 16 15:51:27 2008 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Sun, 16 Nov 2008 15:51:27 +0100 (CET) Subject: [KSS-checkins] r59948 - in kukit/kukit.js/branch/gotcha-simplify-service-layer: kukit tests Message-ID: <20081116145127.B003A1683D0@codespeak.net> Author: gotcha Date: Sun Nov 16 15:51:27 2008 New Revision: 59948 Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/dom.js kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/service.js kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_registries.js Log: NamedRegistries removed Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/dom.js ============================================================================== --- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/dom.js (original) +++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/dom.js Sun Nov 16 15:51:27 2008 @@ -77,7 +77,7 @@ ;;; kukit.E = 'Selection error in kukit.dom.cssQuery'; throw new Error(kukit.E); } - return kukit.services.core.cssQuery(selector, inNodes); + return kukit.services.cssQuery(selector, inNodes); }; /* Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js ============================================================================== --- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js (original) +++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js Sun Nov 16 15:51:27 2008 @@ -1,6 +1,8 @@ kukit.reg = new function() { /* BEGIN CLOSURE kukit.reg */ +var reg = this; + /* * Kukit registry * @@ -32,7 +34,7 @@ * When various javascript code is loaded, it can set up the * schema for the registry it handles. For example, during the * loading of javascript, plugin code set up its registry, other code - * sets up core services it provides or depends on. + * sets up services it provides or depends on. * * The registries are managed by name in a collection of registries. * Before accessing the schema of any registry, it needs to @@ -98,8 +100,6 @@ * * registries.events.click - is an event's registry * registries.actions.setAttr - is an action's registry - * registries.core.cssQuery - is a core service method - * registries.core.forEach - is a core service method * * Kukit sets up the following registries for its own use. The * binding of these registries is done by kukit at the beginning @@ -118,14 +118,14 @@ * * name purpose attribute class * ---- ------- --------------- - * core core services kukit.reg.ServiceFactory + * services services kukit.reg.ServiceFactory * * * For more information, see ../tests/test_registries.js . * */ -var Registrar = function() { +reg.Registrar = function() { this.initialize = function(registryName, FactoryClass) { this.registryName = registryName; @@ -176,61 +176,11 @@ }; /* end Registrar */ -this.NamedRegistries = function() { - - this.initialize = function(registrars) { - this.registrars = registrars; - }; - - this.initializeRegistry = function(registryName, FactoryClass) { - // This sets up the registry given by name with the - // specified FactoryClass class, or checks it. - // This method needs to be called preceding the calls - // to getItemFactory on the given registrar. - // It can be called more times for the same registry. - // -;;; // Check for missing parameter; this will cause an error later anyway. -;;; if (! FactoryClass) { -;;; kukit.E = 'Registries.initializeRegistry() is called for registry ['; -;;; kukit.E += registryName + '] without a FactoryClass parameter.'; -;;; throw new Error(kukit.E); -;;; } - // see if we already have this registrar - var registrar = this.registrars[registryName]; - // create the registrar on demand - if (typeof(registrar) == 'undefined') { - // create the registrar and store it on myself - this.registrars[registryName] = new Registrar(registryName, FactoryClass); - } else { - // check that the same FactoryClass was provided. If not, - // it's a conflict. - if (registrar.FactoryClass != FactoryClass) { -;;; kukit.E = 'Registries.initializeRegistry() is called for registry ['; -;;; kukit.E += registryName + '] with a different FactoryClass than earlier.'; - throw new Error(kukit.E); - } - } - }; - - this.getRegistryByType = function(type) { - var registry = this.registrars[type]; - if (typeof(registrar) == 'undefined') { -;;; kukit.E = 'Registries.getRegistryByType() is called with unregistered type ['; -;;; kukit.E += type + '].'; - throw new Error(kukit.E); - } - return registry; - }; - - this.initialize.apply(this, arguments); - -}; /* end NamedRegistries */ - /* * KSS service layer resource */ -this.ServiceFactory = function() { +reg.ServiceFactory = function() { this.initialize = function(registrar, name) { this.registrar = registrar; @@ -358,7 +308,7 @@ * KSS plugin registry */ -this.PluginFactory = function() { +reg.PluginFactory = function() { this.initialize = function(registrar, name) { this.registrar = registrar; @@ -406,7 +356,7 @@ * may make sense, it can be put back in form of asserts on the * event names. */ -this.BindSequenceFactory = function() { +reg.BindSequenceFactory = function() { this.initialize = function(registrar, name) { this.registrar = registrar; @@ -467,18 +417,18 @@ * */ -this.cleanRoomSetUp = function(suite) { +reg.cleanRoomSetUp = function(suite) { this._saved_plugins = kukit.plugins; this._saved_services = kukit.services; this.setupGlobalRegistries(); }; -this.cleanRoomFinalize = function(suite) { +reg.cleanRoomFinalize = function(suite) { // Need to finalize (bind) these registries this.finalizeGlobalRegistries(); }; -this.cleanRoomTearDown = function(suite) { +reg.cleanRoomTearDown = function(suite) { // Revert the saved state kukit.plugins = this._saved_plugins; kukit.services = this._saved_services; @@ -494,35 +444,32 @@ */ // Initialize global registries -this.setupGlobalRegistries = function() { +reg.setupGlobalRegistries = function() { // instantiate registries - kukit.registrars = {} - kukit.plugins = new this.NamedRegistries(kukit.registrars); - kukit.services = new this.NamedRegistries(kukit.registrars); - var r = kukit.plugins; - r.initializeRegistry('events', this.PluginFactory); - r.initializeRegistry('bindsequences', this.BindSequenceFactory); - r.initializeRegistry('actions', this.PluginFactory); - r.initializeRegistry('valueproviders', this.PluginFactory); - r = kukit.services; - r.initializeRegistry('core', this.ServiceFactory); + kukit.registrars = {}; + kukit.plugins = {}; + kukit.registrars.events = new reg.Registrar('events', this.PluginFactory) + kukit.registrars.bindsequences = new reg.Registrar('bindsequences', this.BindSequenceFactory) + kukit.registrars.actions = new reg.Registrar('actions', this.PluginFactory) + kukit.registrars.valueproviders = new reg.Registrar('valueproviders', this.PluginFactory) + kukit.registrars.services = new reg.Registrar('services', this.ServiceFactory) }; // Finalize global registries -this.finalizeGlobalRegistries = function() { +reg.finalizeGlobalRegistries = function() { var registrars = kukit.registrars; registrars.events.bindItems(kukit.plugins, {}); registrars.bindsequences.bindItems(kukit.plugins, {}); registrars.actions.bindItems(kukit.plugins, {}); registrars.valueproviders.bindItems(kukit.plugins, {}); - registrars.core.bindItems(kukit.services, {}); + registrars.services.bindItems(kukit, {}); }; // At this point we setup the registries used by kukit, // that implies that any code can access them in the kukit namespace // kukit.plugins // kukit.services -this.setupGlobalRegistries(); +reg.setupGlobalRegistries(); // The finalization of these registries is done from bootstrap. @@ -543,7 +490,7 @@ * */ -this.registerPlugins = function(registries, items) { +reg.registerPlugins = function(registries, items) { for (var i=0; i Author: reebalazs Date: Thu Nov 20 11:35:14 2008 New Revision: 60009 Modified: kukit/kss.core/trunk/kss/core/pluginregistry/json/utils.py Log: Attempt to fix json support (was: Module kss.core.pluginregistry.json.utils, line 27, in getJsonAddonFiles UnboundLocalError: local variable 'jsonrpc' referenced before assignment) Modified: kukit/kss.core/trunk/kss/core/pluginregistry/json/utils.py ============================================================================== --- kukit/kss.core/trunk/kss/core/pluginregistry/json/utils.py (original) +++ kukit/kss.core/trunk/kss/core/pluginregistry/json/utils.py Thu Nov 20 11:35:14 2008 @@ -5,7 +5,6 @@ import os.path, logging import zope.component as capi from zope.interface import implements, Interface -from zope.publisher.browser import TestRequest from interfaces import IJSONStreamWriteable logger = logging.getLogger('kss.core') @@ -16,19 +15,19 @@ # Try adding the jsonserver files request = getattr(capi.getSiteManager(), 'REQUEST', None) - try: - if request is not None: + if request is not None: + try: # use the files already registered to that concat resource jsonrpc = capi.getAdapter(request, Interface, 'jsonrpc.js') - except capi.ComponentLookupError: - pass # JSON not present. - else: - # JSON present. - files.extend(jsonrpc.context.context.getPathList()) - # add the json kukit support file - plugins_dir = os.path.split(globals()['__file__'])[0] - files.append(os.path.join(plugins_dir, 'browser', 'jsonkukit.js')) - logger.info('Lazy plugin construction: Installed support for JSON-RPC transport.') + except capi.ComponentLookupError: + pass # JSON not present. + else: + # JSON present. + files.extend(jsonrpc.context.context.getPathList()) + # add the json kukit support file + plugins_dir = os.path.split(globals()['__file__'])[0] + files.append(os.path.join(plugins_dir, 'browser', 'jsonkukit.js')) + logger.info('Lazy plugin construction: Installed support for JSON-RPC transport.') return files class JsonCommandView(object): From reebalazs at codespeak.net Thu Nov 20 13:05:10 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 20 Nov 2008 13:05:10 +0100 (CET) Subject: [KSS-checkins] r60015 - in kukit/kukit.js/trunk: doc kukit Message-ID: <20081120120510.2A5AE168473@codespeak.net> Author: reebalazs Date: Thu Nov 20 13:05:09 2008 New Revision: 60015 Modified: kukit/kukit.js/trunk/doc/HISTORY.txt kukit/kukit.js/trunk/kukit/serveraction.js Log: Fix or improve calculateAbsoluteURL to handle absolute and relative urls correctly, as well as get rid of the double slash (//) issue. It also satisfies the tests kss_url_param and kss_url_param_multiprop, that now work as intended, with previous workaround removed. Modified: kukit/kukit.js/trunk/doc/HISTORY.txt ============================================================================== --- kukit/kukit.js/trunk/doc/HISTORY.txt (original) +++ kukit/kukit.js/trunk/doc/HISTORY.txt Thu Nov 20 13:05:09 2008 @@ -11,6 +11,14 @@ still broken in IE6) [gotcha] + - Fix or improve calculateAbsoluteURL to handle absolute + and relative urls correctly, as well as get rid of the + double slash (//) issue. + It also satisfies the tests kss_url_param and + kss_url_param_multiprop, that now work as intended, + with previous workaround removed. + [ree] + - Replaced license header of third-party sarissa.js to workaround the license detection of ohloh. sarissa.js is redistributed under GNU GPL v2 Modified: kukit/kukit.js/trunk/kukit/serveraction.js ============================================================================== --- kukit/kukit.js/trunk/kukit/serveraction.js (original) +++ kukit/kukit.js/trunk/kukit/serveraction.js Thu Nov 20 13:05:09 2008 @@ -63,24 +63,40 @@ this.notifyServer(); }; +/* + * calculateAbsoluteURL + * + * Makes absolute site url + * - if starts with http:// https:// : no change + * - if starts with /: interprets absolute from domain + * - otherwise: relative to current context + */ this.calculateAbsoluteURL = function(url) { - // - // If the url is an absolute path, it is used - // - // If the url is not an absolute path, it is put at the end of the context - // url. - // - // example: url='@theview/getName', - // context='http://your.site.com/portal/folder/object' - // - // result='http://your.site.com/portal/folder/object/@@theview/getName' - // - if (url.match(RegExp('/^https?:\/\//'))) { + // XXX packer breaks on following regexp constant, + // so it must be quoted + if (url.match(RegExp("/^https?:\/\//"))) { + // absolute already return url; - } else { - var result = kukit.engine.baseUrl + url; - return result; } + var absoluteMatch = url.match(RegExp(/^(\/)(.*)/)); + var path = kukit.engine.baseUrl; + if (absoluteMatch) { + // relative to domain + var base = path.match(RegExp(/^(.*:\/\/[^\/]*)(\/?)/))[1]; + // base is like: http://foo.bar without trailing / + url = base + url; + return url; + } + // final case: relative to current url + // (paranoia: add an / to the path *only* if it is + // *not* there) + // XXX packer breaks on following + // regexp constant, so it must be quoted + if (! path.match(RegExp("/$"))) { + path += '/'; + } + url = path + url; + return url; }; // Backparameters can be used on command execution. From reebalazs at codespeak.net Thu Nov 20 13:06:16 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 20 Nov 2008 13:06:16 +0100 (CET) Subject: [KSS-checkins] r60016 - in kukit/kss.core/trunk: docs kss/core/plugins/core/demo/coresyntax Message-ID: <20081120120616.1C0EF168473@codespeak.net> Author: reebalazs Date: Thu Nov 20 13:06:15 2008 New Revision: 60016 Modified: kukit/kss.core/trunk/docs/HISTORY.txt kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param.kss kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param.pt kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.kss kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.pt Log: Fix or improve calculateAbsoluteURL to handle absolute and relative urls correctly, as well as get rid of the double slash (//) issue. It also satisfies the tests kss_url_param and kss_url_param_multiprop, that now work as intended, with previous workaround removed. Modified: kukit/kss.core/trunk/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/trunk/docs/HISTORY.txt (original) +++ kukit/kss.core/trunk/docs/HISTORY.txt Thu Nov 20 13:06:15 2008 @@ -4,6 +4,14 @@ kss.core - 1.5dev Unreleased + - Fix or improve calculateAbsoluteURL to handle absolute + and relative urls correctly, as well as get rid of the + double slash (//) issue. + It also satisfies the tests kss_url_param and + kss_url_param_multiprop, that now work as intended, + with previous workaround removed. + [ree] + - Use the real request in the json logic so skin layers, request parmeters, etc. are available. [wichert] Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param.kss ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param.kss (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param.kss Thu Nov 20 13:06:15 2008 @@ -16,6 +16,6 @@ #button_3:click { action-server: urlMethodAnotherAlias; - urlMethodAnotherAlias-kssUrl: "@@urlMethod3/urlMethod3"; + urlMethodAnotherAlias-kssUrl: "@@urlMethod3"; } Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param.pt ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param.pt (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param.pt Thu Nov 20 13:06:15 2008 @@ -42,10 +42,10 @@

Alias URL with @@

- Click the button; it will call @@urlMethod3/urlMethod3 on the server. + Click the button; it will call @@urlMethod3 on the server.
#button_3:click {
     action-server: urlMethodAnotherAlias;
-    urlMethodAnotherAlias-kssUrl: "@@urlMethod3/urlMethod3";
+    urlMethodAnotherAlias-kssUrl: "@@urlMethod3";
 }
Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.kss ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.kss (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.kss Thu Nov 20 13:06:15 2008 @@ -14,7 +14,7 @@ } #button_3:click { - action-server: urlMethodAnotherAlias url("@@urlMethod3/urlMethod3"); + action-server: urlMethodAnotherAlias url("@@urlMethod3"); } #button_4:click { Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.pt ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.pt (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.pt Thu Nov 20 13:06:15 2008 @@ -41,9 +41,9 @@

Alias URL with @@

- Click the button; it will call @@urlMethod3/urlMethod3 on the server. + Click the button; it will call @@urlMethod3 on the server.
#button_3:click {
-    action-server: urlMethodAnotherAlias url("@@urlMethod3/urlMethod3");
+    action-server: urlMethodAnotherAlias url("@@urlMethod3");
 }
@@ -53,7 +53,7 @@

Alias URL from provider

- Click the button; it will call @@urlMethod3/urlMethod3 on the server. + Click the button; it will call urlMethod3 on the server.
#button_4:click {
     action-server: urlMethodAnotherAlias url(kssAttr(methodname, true));
 }
From reebalazs at codespeak.net Thu Nov 20 13:21:48 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 20 Nov 2008 13:21:48 +0100 (CET) Subject: [KSS-checkins] r60017 - in kukit/kss.core/trunk: docs kss/core/plugins/core/demo/commandaction kss/core/plugins/core/demo/selenium_tests Message-ID: <20081120122148.3108C16846C@codespeak.net> Author: reebalazs Date: Thu Nov 20 13:21:47 2008 New Revision: 60017 Modified: kukit/kss.core/trunk/docs/HISTORY.txt kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/cancel.kss kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/cancel.pt kukit/kss.core/trunk/kss/core/plugins/core/demo/selenium_tests/ca_cancel.html Log: Fix the ca_cancel (action-cancel) test that was broken on IE7 because it contained the same id more times. Modified: kukit/kss.core/trunk/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/trunk/docs/HISTORY.txt (original) +++ kukit/kss.core/trunk/docs/HISTORY.txt Thu Nov 20 13:21:47 2008 @@ -4,6 +4,10 @@ kss.core - 1.5dev Unreleased + - Fix the ca_cancel (action-cancel) test that was broken + on IE7 because it contained the same id more times. + [ree] + - Fix or improve calculateAbsoluteURL to handle absolute and relative urls correctly, as well as get rid of the double slash (//) issue. Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/cancel.kss ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/cancel.kss (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/cancel.kss Thu Nov 20 13:21:47 2008 @@ -2,7 +2,7 @@ action-server: cancel; } -#standard #without:click { +#standard .without:click { action-cancel: cancel; } @@ -11,7 +11,7 @@ test-html: action; } -#alias #without:click { +#alias .without:click { action-cancel: test; } Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/cancel.pt ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/cancel.pt (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/commandaction/cancel.pt Thu Nov 20 13:21:47 2008 @@ -15,16 +15,16 @@

Standard case

    -
  • with
  • -
  • without
  • +
  • with
  • +
  • without

Alias case

    -
  • with
  • -
  • without
  • +
  • with
  • +
  • without
Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/selenium_tests/ca_cancel.html ============================================================================== --- kukit/kss.core/trunk/kss/core/plugins/core/demo/selenium_tests/ca_cancel.html (original) +++ kukit/kss.core/trunk/kss/core/plugins/core/demo/selenium_tests/ca_cancel.html Thu Nov 20 13:21:47 2008 @@ -20,7 +20,7 @@ click - css=#standard #with + css=#standard .with @@ -35,7 +35,7 @@ click - css=#standard #without + css=#standard .without @@ -50,7 +50,7 @@ click - css=#standard #with + css=#standard .with @@ -70,7 +70,7 @@ click - css=#alias #with + css=#alias .with @@ -85,7 +85,7 @@ click - css=#alias #without + css=#alias .without @@ -100,7 +100,7 @@ click - css=#alias #with + css=#alias .with From reebalazs at codespeak.net Thu Nov 20 16:32:32 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 20 Nov 2008 16:32:32 +0100 (CET) Subject: [KSS-checkins] r60024 - kukit/kss.core/branch/1.4/kss/core/pluginregistry/json Message-ID: <20081120153232.CA3821684C5@codespeak.net> Author: reebalazs Date: Thu Nov 20 16:32:32 2008 New Revision: 60024 Modified: kukit/kss.core/branch/1.4/kss/core/pluginregistry/json/utils.py Log: Backport -r60008:60009 from trunk (Attempt to fix json support) Modified: kukit/kss.core/branch/1.4/kss/core/pluginregistry/json/utils.py ============================================================================== --- kukit/kss.core/branch/1.4/kss/core/pluginregistry/json/utils.py (original) +++ kukit/kss.core/branch/1.4/kss/core/pluginregistry/json/utils.py Thu Nov 20 16:32:32 2008 @@ -5,7 +5,6 @@ import os.path, logging import zope.component as capi from zope.interface import implements, Interface -from zope.publisher.browser import TestRequest from interfaces import IJSONStreamWriteable logger = logging.getLogger('kss.core') @@ -16,19 +15,19 @@ # Try adding the jsonserver files request = getattr(capi.getSiteManager(), 'REQUEST', None) - try: - if request is not None: + if request is not None: + try: # use the files already registered to that concat resource jsonrpc = capi.getAdapter(request, Interface, 'jsonrpc.js') - except capi.ComponentLookupError: - pass # JSON not present. - else: - # JSON present. - files.extend(jsonrpc.context.context.getPathList()) - # add the json kukit support file - plugins_dir = os.path.split(globals()['__file__'])[0] - files.append(os.path.join(plugins_dir, 'browser', 'jsonkukit.js')) - logger.info('Lazy plugin construction: Installed support for JSON-RPC transport.') + except capi.ComponentLookupError: + pass # JSON not present. + else: + # JSON present. + files.extend(jsonrpc.context.context.getPathList()) + # add the json kukit support file + plugins_dir = os.path.split(globals()['__file__'])[0] + files.append(os.path.join(plugins_dir, 'browser', 'jsonkukit.js')) + logger.info('Lazy plugin construction: Installed support for JSON-RPC transport.') return files class JsonCommandView(object): From reebalazs at codespeak.net Thu Nov 20 16:43:50 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 20 Nov 2008 16:43:50 +0100 (CET) Subject: [KSS-checkins] r60025 - in kukit/kukit.js/branch/1.4: doc kukit Message-ID: <20081120154350.697F01684C5@codespeak.net> Author: reebalazs Date: Thu Nov 20 16:43:49 2008 New Revision: 60025 Modified: kukit/kukit.js/branch/1.4/doc/HISTORY.txt kukit/kukit.js/branch/1.4/kukit/serveraction.js Log: Backport from trunk -r60016: Fix or improve calculateAbsoluteURL Modified: kukit/kukit.js/branch/1.4/doc/HISTORY.txt ============================================================================== --- kukit/kukit.js/branch/1.4/doc/HISTORY.txt (original) +++ kukit/kukit.js/branch/1.4/doc/HISTORY.txt Thu Nov 20 16:43:49 2008 @@ -8,6 +8,14 @@ kukit.js - 1.4.3 Released 2008-08-18 + - Fix or improve calculateAbsoluteURL to handle absolute + and relative urls correctly, as well as get rid of the + double slash (//) issue. + It also satisfies the tests kss_url_param and + kss_url_param_multiprop, that now work as intended, + with previous workaround removed. + [ree] + - Replaced license header of third-party sarissa.js to workaround the license detection of ohloh. sarissa.js is redistributed under GNU GPL v2 Modified: kukit/kukit.js/branch/1.4/kukit/serveraction.js ============================================================================== --- kukit/kukit.js/branch/1.4/kukit/serveraction.js (original) +++ kukit/kukit.js/branch/1.4/kukit/serveraction.js Thu Nov 20 16:43:49 2008 @@ -53,24 +53,40 @@ this.notifyServer(); }; +/* + * calculateAbsoluteURL + * + * Makes absolute site url + * - if starts with http:// https:// : no change + * - if starts with /: interprets absolute from domain + * - otherwise: relative to current context + */ this.calculateAbsoluteURL = function(url) { - // - // If the url is an absolute path, it is used - // - // If the url is not an absolute path, it is put at the end of the context - // url. - // - // example: url='@theview/getName', - // context='http://your.site.com/portal/folder/object' - // - // result='http://your.site.com/portal/folder/object/@@theview/getName' - // - if (url.match(RegExp('/^https?:\/\//'))) { + // XXX packer breaks on following regexp constant, + // so it must be quoted + if (url.match(RegExp("/^https?:\/\//"))) { + // absolute already return url; - } else { - var result = kukit.engine.baseUrl + url; - return result; } + var absoluteMatch = url.match(RegExp(/^(\/)(.*)/)); + var path = kukit.engine.baseUrl; + if (absoluteMatch) { + // relative to domain + var base = path.match(RegExp(/^(.*:\/\/[^\/]*)(\/?)/))[1]; + // base is like: http://foo.bar without trailing / + url = base + url; + return url; + } + // final case: relative to current url + // (paranoia: add an / to the path *only* if it is + // *not* there) + // XXX packer breaks on following + // regexp constant, so it must be quoted + if (! path.match(RegExp("/$"))) { + path += '/'; + } + url = path + url; + return url; }; // Backparameters can be used on command execution. From reebalazs at codespeak.net Thu Nov 20 16:44:06 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 20 Nov 2008 16:44:06 +0100 (CET) Subject: [KSS-checkins] r60026 - in kukit/kss.core/branch/1.4: docs kss/core/plugins/core/demo/coresyntax Message-ID: <20081120154406.A6A311684C7@codespeak.net> Author: reebalazs Date: Thu Nov 20 16:44:05 2008 New Revision: 60026 Modified: kukit/kss.core/branch/1.4/docs/HISTORY.txt kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param.kss kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param.pt kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.kss kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.pt Log: Backport from trunk -r60016: Fix or improve calculateAbsoluteURL Modified: kukit/kss.core/branch/1.4/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/branch/1.4/docs/HISTORY.txt (original) +++ kukit/kss.core/branch/1.4/docs/HISTORY.txt Thu Nov 20 16:44:05 2008 @@ -4,6 +4,14 @@ kss.core - 1.4dev Unreleased + - Fix or improve calculateAbsoluteURL to handle absolute + and relative urls correctly, as well as get rid of the + double slash (//) issue. + It also satisfies the tests kss_url_param and + kss_url_param_multiprop, that now work as intended, + with previous workaround removed. + [ree] + - Use the real request in the json logic so skin layers, request parmeters, etc. are available. [wichert] Modified: kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param.kss ============================================================================== --- kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param.kss (original) +++ kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param.kss Thu Nov 20 16:44:05 2008 @@ -16,6 +16,6 @@ #button_3:click { action-server: urlMethodAnotherAlias; - urlMethodAnotherAlias-kssUrl: "@@urlMethod3/urlMethod3"; + urlMethodAnotherAlias-kssUrl: "@@urlMethod3"; } Modified: kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param.pt ============================================================================== --- kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param.pt (original) +++ kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param.pt Thu Nov 20 16:44:05 2008 @@ -42,10 +42,10 @@

Alias URL with @@

- Click the button; it will call @@urlMethod3/urlMethod3 on the server. + Click the button; it will call @@urlMethod3 on the server.
#button_3:click {
     action-server: urlMethodAnotherAlias;
-    urlMethodAnotherAlias-kssUrl: "@@urlMethod3/urlMethod3";
+    urlMethodAnotherAlias-kssUrl: "@@urlMethod3";
 }
Modified: kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.kss ============================================================================== --- kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.kss (original) +++ kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.kss Thu Nov 20 16:44:05 2008 @@ -14,7 +14,7 @@ } #button_3:click { - action-server: urlMethodAnotherAlias url("@@urlMethod3/urlMethod3"); + action-server: urlMethodAnotherAlias url("@@urlMethod3"); } #button_4:click { Modified: kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.pt ============================================================================== --- kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.pt (original) +++ kukit/kss.core/branch/1.4/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.pt Thu Nov 20 16:44:05 2008 @@ -41,9 +41,9 @@

Alias URL with @@

- Click the button; it will call @@urlMethod3/urlMethod3 on the server. + Click the button; it will call @@urlMethod3 on the server.
#button_3:click {
-    action-server: urlMethodAnotherAlias url("@@urlMethod3/urlMethod3");
+    action-server: urlMethodAnotherAlias url("@@urlMethod3");
 }
@@ -53,7 +53,7 @@

Alias URL from provider

- Click the button; it will call @@urlMethod3/urlMethod3 on the server. + Click the button; it will call urlMethod3 on the server.
#button_4:click {
     action-server: urlMethodAnotherAlias url(kssAttr(methodname, true));
 }
From reebalazs at codespeak.net Thu Nov 20 16:45:34 2008 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Thu, 20 Nov 2008 16:45:34 +0100 (CET) Subject: [KSS-checkins] r60027 - kukit/kss.core/branch/1.4/docs Message-ID: <20081120154534.0B6401684C7@codespeak.net> Author: reebalazs Date: Thu Nov 20 16:45:33 2008 New Revision: 60027 Modified: kukit/kss.core/branch/1.4/docs/HISTORY.txt Log: Backport from trunk -r60017: Fix the ca_cancel (action-cancel) test that was broken on IE7 Modified: kukit/kss.core/branch/1.4/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/branch/1.4/docs/HISTORY.txt (original) +++ kukit/kss.core/branch/1.4/docs/HISTORY.txt Thu Nov 20 16:45:33 2008 @@ -4,6 +4,10 @@ kss.core - 1.4dev Unreleased + - Fix the ca_cancel (action-cancel) test that was broken + on IE7 because it contained the same id more times. + [ree] + - Fix or improve calculateAbsoluteURL to handle absolute and relative urls correctly, as well as get rid of the double slash (//) issue. From twilight at codespeak.net Sat Nov 29 10:57:03 2008 From: twilight at codespeak.net (twilight at codespeak.net) Date: Sat, 29 Nov 2008 10:57:03 +0100 (CET) Subject: [KSS-checkins] r60223 - in kukit/kss.core/branch/bluraction: docs kss/core/pluginregistry/json kss/core/plugins/core/demo/coresyntax Message-ID: <20081129095703.C9B89168478@codespeak.net> Author: twilight Date: Sat Nov 29 10:57:00 2008 New Revision: 60223 Modified: kukit/kss.core/branch/bluraction/docs/HISTORY.txt kukit/kss.core/branch/bluraction/kss/core/pluginregistry/json/utils.py kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param.kss kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param.pt kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.kss kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.pt Log: Merge recent changes from r59726 to HEAD Modified: kukit/kss.core/branch/bluraction/docs/HISTORY.txt ============================================================================== --- kukit/kss.core/branch/bluraction/docs/HISTORY.txt (original) +++ kukit/kss.core/branch/bluraction/docs/HISTORY.txt Sat Nov 29 10:57:00 2008 @@ -4,6 +4,18 @@ kss.core - 1.5dev Unreleased + - Fix the ca_cancel (action-cancel) test that was broken + on IE7 because it contained the same id more times. + [ree] + + - Fix or improve calculateAbsoluteURL to handle absolute + and relative urls correctly, as well as get rid of the + double slash (//) issue. + It also satisfies the tests kss_url_param and + kss_url_param_multiprop, that now work as intended, + with previous workaround removed. + [ree] + - Use the real request in the json logic so skin layers, request parmeters, etc. are available. [wichert] Modified: kukit/kss.core/branch/bluraction/kss/core/pluginregistry/json/utils.py ============================================================================== --- kukit/kss.core/branch/bluraction/kss/core/pluginregistry/json/utils.py (original) +++ kukit/kss.core/branch/bluraction/kss/core/pluginregistry/json/utils.py Sat Nov 29 10:57:00 2008 @@ -5,7 +5,6 @@ import os.path, logging import zope.component as capi from zope.interface import implements, Interface -from zope.publisher.browser import TestRequest from interfaces import IJSONStreamWriteable logger = logging.getLogger('kss.core') @@ -16,19 +15,19 @@ # Try adding the jsonserver files request = getattr(capi.getSiteManager(), 'REQUEST', None) - try: - if request is not None: + if request is not None: + try: # use the files already registered to that concat resource jsonrpc = capi.getAdapter(request, Interface, 'jsonrpc.js') - except capi.ComponentLookupError: - pass # JSON not present. - else: - # JSON present. - files.extend(jsonrpc.context.context.getPathList()) - # add the json kukit support file - plugins_dir = os.path.split(globals()['__file__'])[0] - files.append(os.path.join(plugins_dir, 'browser', 'jsonkukit.js')) - logger.info('Lazy plugin construction: Installed support for JSON-RPC transport.') + except capi.ComponentLookupError: + pass # JSON not present. + else: + # JSON present. + files.extend(jsonrpc.context.context.getPathList()) + # add the json kukit support file + plugins_dir = os.path.split(globals()['__file__'])[0] + files.append(os.path.join(plugins_dir, 'browser', 'jsonkukit.js')) + logger.info('Lazy plugin construction: Installed support for JSON-RPC transport.') return files class JsonCommandView(object): Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param.kss ============================================================================== --- kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param.kss (original) +++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param.kss Sat Nov 29 10:57:00 2008 @@ -16,6 +16,6 @@ #button_3:click { action-server: urlMethodAnotherAlias; - urlMethodAnotherAlias-kssUrl: "@@urlMethod3/urlMethod3"; + urlMethodAnotherAlias-kssUrl: "@@urlMethod3"; } Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param.pt ============================================================================== --- kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param.pt (original) +++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param.pt Sat Nov 29 10:57:00 2008 @@ -42,10 +42,10 @@

Alias URL with @@

- Click the button; it will call @@urlMethod3/urlMethod3 on the server. + Click the button; it will call @@urlMethod3 on the server.
#button_3:click {
     action-server: urlMethodAnotherAlias;
-    urlMethodAnotherAlias-kssUrl: "@@urlMethod3/urlMethod3";
+    urlMethodAnotherAlias-kssUrl: "@@urlMethod3";
 }
Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.kss ============================================================================== --- kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.kss (original) +++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.kss Sat Nov 29 10:57:00 2008 @@ -14,7 +14,7 @@ } #button_3:click { - action-server: urlMethodAnotherAlias url("@@urlMethod3/urlMethod3"); + action-server: urlMethodAnotherAlias url("@@urlMethod3"); } #button_4:click { Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.pt ============================================================================== --- kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.pt (original) +++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/coresyntax/kss_url_param_multiprop.pt Sat Nov 29 10:57:00 2008 @@ -41,9 +41,9 @@

Alias URL with @@

- Click the button; it will call @@urlMethod3/urlMethod3 on the server. + Click the button; it will call @@urlMethod3 on the server.
#button_3:click {
-    action-server: urlMethodAnotherAlias url("@@urlMethod3/urlMethod3");
+    action-server: urlMethodAnotherAlias url("@@urlMethod3");
 }
@@ -53,7 +53,7 @@

Alias URL from provider

- Click the button; it will call @@urlMethod3/urlMethod3 on the server. + Click the button; it will call urlMethod3 on the server.
#button_4:click {
     action-server: urlMethodAnotherAlias url(kssAttr(methodname, true));
 }
From twilight at codespeak.net Sat Nov 29 11:01:24 2008 From: twilight at codespeak.net (twilight at codespeak.net) Date: Sat, 29 Nov 2008 11:01:24 +0100 (CET) Subject: [KSS-checkins] r60224 - in kukit/kukit.js/branch/simon-bluraction: doc kukit Message-ID: <20081129100124.6B1D3168478@codespeak.net> Author: twilight Date: Sat Nov 29 11:01:23 2008 New Revision: 60224 Modified: kukit/kukit.js/branch/simon-bluraction/doc/HISTORY.txt kukit/kukit.js/branch/simon-bluraction/kukit/serveraction.js Log: Merge recent changes from r59726 to HEAD Modified: kukit/kukit.js/branch/simon-bluraction/doc/HISTORY.txt ============================================================================== --- kukit/kukit.js/branch/simon-bluraction/doc/HISTORY.txt (original) +++ kukit/kukit.js/branch/simon-bluraction/doc/HISTORY.txt Sat Nov 29 11:01:23 2008 @@ -11,6 +11,14 @@ still broken in IE6) [gotcha] + - Fix or improve calculateAbsoluteURL to handle absolute + and relative urls correctly, as well as get rid of the + double slash (//) issue. + It also satisfies the tests kss_url_param and + kss_url_param_multiprop, that now work as intended, + with previous workaround removed. + [ree] + - Replaced license header of third-party sarissa.js to workaround the license detection of ohloh. sarissa.js is redistributed under GNU GPL v2 Modified: kukit/kukit.js/branch/simon-bluraction/kukit/serveraction.js ============================================================================== --- kukit/kukit.js/branch/simon-bluraction/kukit/serveraction.js (original) +++ kukit/kukit.js/branch/simon-bluraction/kukit/serveraction.js Sat Nov 29 11:01:23 2008 @@ -63,24 +63,40 @@ this.notifyServer(); }; +/* + * calculateAbsoluteURL + * + * Makes absolute site url + * - if starts with http:// https:// : no change + * - if starts with /: interprets absolute from domain + * - otherwise: relative to current context + */ this.calculateAbsoluteURL = function(url) { - // - // If the url is an absolute path, it is used - // - // If the url is not an absolute path, it is put at the end of the context - // url. - // - // example: url='@theview/getName', - // context='http://your.site.com/portal/folder/object' - // - // result='http://your.site.com/portal/folder/object/@@theview/getName' - // - if (url.match(RegExp('/^https?:\/\//'))) { + // XXX packer breaks on following regexp constant, + // so it must be quoted + if (url.match(RegExp("/^https?:\/\//"))) { + // absolute already return url; - } else { - var result = kukit.engine.baseUrl + url; - return result; } + var absoluteMatch = url.match(RegExp(/^(\/)(.*)/)); + var path = kukit.engine.baseUrl; + if (absoluteMatch) { + // relative to domain + var base = path.match(RegExp(/^(.*:\/\/[^\/]*)(\/?)/))[1]; + // base is like: http://foo.bar without trailing / + url = base + url; + return url; + } + // final case: relative to current url + // (paranoia: add an / to the path *only* if it is + // *not* there) + // XXX packer breaks on following + // regexp constant, so it must be quoted + if (! path.match(RegExp("/$"))) { + path += '/'; + } + url = path + url; + return url; }; // Backparameters can be used on command execution. From twilight at codespeak.net Sat Nov 29 13:10:56 2008 From: twilight at codespeak.net (twilight at codespeak.net) Date: Sat, 29 Nov 2008 13:10:56 +0100 (CET) Subject: [KSS-checkins] r60228 - in kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo: commandaction selenium_tests Message-ID: <20081129121056.B0355168444@codespeak.net> Author: twilight Date: Sat Nov 29 13:10:56 2008 New Revision: 60228 Added: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/selenium_tests/ca_blur.html Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.kss kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.pt kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/commandaction.py Log: Added selenium test for blur action and event Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.kss ============================================================================== --- kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.kss (original) +++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.kss Sat Nov 29 13:10:56 2008 @@ -1,11 +1,15 @@ +.blurrable:blur, .remote-blurrable:blur { + action-client: replaceInnerHTML; + replaceInnerHTML-kssSelector: css("#target code"); + replaceInnerHTML-html: nodeAttr(id); +} .blurrable:keypress { evt-keypress-preventdefault: true; evt-keypress-keycodes: 32; - action-client: blur samenode(); + action-client: blur; } .remote-blurrable:keypress { evt-keypress-preventdefault: true; evt-keypress-keycodes: 32; action-server: blur; - blur-id: nodeAttr('id'); } Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.pt ============================================================================== --- kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.pt (original) +++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/blur.pt Sat Nov 29 13:10:56 2008 @@ -15,7 +15,11 @@ widgets.

The focus is removed from various widgets : input, select, textarea, with both client and server - actions

+ actions.

+

(It would also be nice to use something like document.activeElement + to test whether the browser is actually gaining and losing focus, + but that's difficult to get working cross-browser...)

+
Blur away from none.

Blur input. @@ -26,7 +30,7 @@
- +

@@ -57,6 +61,30 @@

+

+ Blur radio. +

+
+ Select the radio, then press the 'Space' key to remove focus from it. +
+
+
+ + +
+
+

+ Blur checkbox. +

+
+ Select the checkbox, then press the 'Space' key to remove focus from it. +
+
+
+ + +
+
Modified: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/commandaction.py ============================================================================== --- kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/commandaction.py (original) +++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/commandaction/commandaction.py Sat Nov 29 13:10:56 2008 @@ -1,4 +1,4 @@ -from kss.core import KSSView +from kss.core import KSSView, kssaction class ActionsView(KSSView): @@ -28,9 +28,11 @@ #blur - def blur(self, id): - self.getCommandSet('core').blur('#' + id) - return self.render() + @kssaction + def blur(self): + core = self.getCommandSet('core') + samenode = core.getSameNodeSelector() + core.blur(samenode) #action-cancel Added: kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/selenium_tests/ca_blur.html ============================================================================== --- (empty file) +++ kukit/kss.core/branch/bluraction/kss/core/plugins/core/demo/selenium_tests/ca_blur.html Sat Nov 29 13:10:56 2008 @@ -0,0 +1,124 @@ + + + +ca_blur + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ca_focus
open/demo/ca_blur.html
assertTextPresentBlur away from none.
fireEventinputblur
assertTextPresentBlur away from input.
fireEventremote-inputblur
assertTextPresentBlur away from remote-input.
fireEventtextareablur
assertTextPresentBlur away from textarea.
fireEventremote-textareablur
assertTextPresentBlur away from remote-textarea.
fireEventselectblur
assertTextPresentBlur away from select.
fireEventremote-selectblur
assertTextPresentBlur away from remote-select.
fireEventradioblur
assertTextPresentBlur away from radio.
fireEventremote-radioblur
assertTextPresentBlur away from remote-radio.
fireEventcheckboxblur
assertTextPresentBlur away from checkbox.
fireEventremote-checkboxblur
assertTextPresentBlur away from remote-checkbox.
+ +