you clicked inside the DIV tag, event [click], rule #0, node [DIV].
@@ -35,12 +35,12 @@
assertAlert
-
you clicked the bubbling A tag, rule=#1, node=A
+
you clicked the bubbling A tag, event [click], rule #1, node [A].
assertAlert
-
you clicked inside the DIV tag, rule=#0, node=DIV
+
you clicked inside the DIV tag, event [click], rule #0, node [DIV].
@@ -55,7 +55,7 @@
assertAlert
-
you clicked the not bubbling A tag, rule=#2, node=A
+
you clicked the not bubbling A tag, event [click], rule #2, node [A].
From gotcha at codespeak.net Thu Aug 16 22:41:33 2007
From: gotcha at codespeak.net (gotcha at codespeak.net)
Date: Thu, 16 Aug 2007 22:41:33 +0200 (CEST)
Subject: [KSS-checkins] r45757 -
kukit/kss.concatresource/trunk/kss/concatresource/compression
Message-ID: <20070816204133.B755E815D@code0.codespeak.net>
Author: gotcha
Date: Thu Aug 16 22:41:33 2007
New Revision: 45757
Modified:
kukit/kss.concatresource/trunk/kss/concatresource/compression/javascript.py
Log:
replace ;;; by spaces instead of removing it
Modified: kukit/kss.concatresource/trunk/kss/concatresource/compression/javascript.py
==============================================================================
--- kukit/kss.concatresource/trunk/kss/concatresource/compression/javascript.py (original)
+++ kukit/kss.concatresource/trunk/kss/concatresource/compression/javascript.py Thu Aug 16 22:41:33 2007
@@ -14,11 +14,12 @@
return ''.join(result)
def remove_markers(data):
- 'Removes the ;;; markers but leaves the lines.'
+ 'Replaces the ;;; markers by spaces but leaves the lines.'
result = []
for line in data.splitlines(True):
if line.lstrip().startswith(';;;'):
line = line.lstrip()[3:]
+ result.append(' ')
result.append(line)
return ''.join(result)
From gotcha at codespeak.net Thu Aug 16 22:32:23 2007
From: gotcha at codespeak.net (gotcha at codespeak.net)
Date: Thu, 16 Aug 2007 22:32:23 +0200 (CEST)
Subject: [KSS-checkins] r45752 - kukit/kukit.js/trunk/kukit
Message-ID: <20070816203223.174898173@code0.codespeak.net>
Author: gotcha
Date: Thu Aug 16 22:32:22 2007
New Revision: 45752
Modified:
kukit/kukit.js/trunk/kukit/actionreg.js
kukit/kukit.js/trunk/kukit/commandprocessor.js
kukit/kukit.js/trunk/kukit/commandreg.js
kukit/kukit.js/trunk/kukit/dom.js
kukit/kukit.js/trunk/kukit/errors.js
kukit/kukit.js/trunk/kukit/eventreg.js
kukit/kukit.js/trunk/kukit/forms.js
kukit/kukit.js/trunk/kukit/kssparser.js
kukit/kukit.js/trunk/kukit/kukit.js
kukit/kukit.js/trunk/kukit/oper.js
kukit/kukit.js/trunk/kukit/plugin.js
kukit/kukit.js/trunk/kukit/providerreg.js
kukit/kukit.js/trunk/kukit/requestmanager.js
kukit/kukit.js/trunk/kukit/resourcedata.js
kukit/kukit.js/trunk/kukit/selectorreg.js
kukit/kukit.js/trunk/kukit/serveraction.js
kukit/kukit.js/trunk/kukit/tokenizer.js
kukit/kukit.js/trunk/kukit/utils.js
Log:
merge gotcha-code-cleanup
Modified: kukit/kukit.js/trunk/kukit/actionreg.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/actionreg.js (original)
+++ kukit/kukit.js/trunk/kukit/actionreg.js Thu Aug 16 22:32:22 2007
@@ -1,9 +1,6 @@
/*
-* Copyright (c) 2005-2006
-* Authors:
-* Godefroid Chapelle
-* Florian Schulze
-* Bal?zs Re?
+* Copyright (c) 2005-2007
+* Authors: KSS Project Contributors (see doc/CREDITS.txt)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
@@ -32,12 +29,14 @@
};
kukit.ar.ActionRegistry.prototype.register = function(name, func) {
- ;;; if (typeof(func) == 'undefined') {
- ;;; throw 'func argument is mandatory when registering an action (ActionRegistry.register).';
- ;;; }
+;;; if (typeof(func) == 'undefined') {
+;;; kukit.E = '[func] argument is mandatory when registering an action';
+;;; kukit.E += ' [ActionRegistry.register].';
+;;; throw kukit.E;
+;;; }
if (this.content[name]) {
// Do not allow redefinition
- ;;; kukit.logError('Error : action "' + name + '" already registered.');
+;;; kukit.logError('Error : action [' + name + '] already registered.');
return;
}
this.content[name] = func;
@@ -52,9 +51,8 @@
var func = this.content[name];
if (! func) {
// not found
- ;;; kukit.E = 'Error : undefined local action "' + name + '"';
+;;; kukit.E = 'Error : undefined local action [' + name + '].';
throw kukit.E;
- //kukit.logError(kukit.E);
}
return func;
};
@@ -66,7 +64,9 @@
kukit.ar.actionRegistry = {};
kukit.ar.actionRegistry.register = function(name, func) {
- ;;; kukit.logWarning('Deprecated kukit.ar.actionRegistry.register, use kukit.actionsGlobalRegistry.register instead! (' + name + ')');
+;;; 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/trunk/kukit/commandprocessor.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/commandprocessor.js (original)
+++ kukit/kukit.js/trunk/kukit/commandprocessor.js Thu Aug 16 22:32:22 2007
@@ -1,9 +1,6 @@
/*
-* Copyright (c) 2005-2006
-* Authors:
-* Godefroid Chapelle
-* Florian Schulze
-* Bal?zs Re?
+* Copyright (c) 2005-2007
+* Authors: KSS Project Contributors (see doc/CREDITS.txt)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
@@ -29,9 +26,10 @@
this.commands = new Array();
};
-kukit.cp.CommandProcessor.prototype.parseCommands = function(commands, transport) {
- ;;; kukit.log('Parse commands');
- ;;; kukit.logDebug('Number of commands: ' + commands.length);
+kukit.cp.CommandProcessor.prototype.parseCommands =
+ function(commands, transport) {
+;;; kukit.log('Parsing commands.');
+;;; kukit.logDebug('Number of commands : ' + commands.length + '.');
for (var y=0;y < commands.length;y++) {
var command = commands[y];
this.parseCommand(command, transport);
@@ -41,13 +39,14 @@
// we make sure we execute none of them.
var lastcommand = this.commands[this.commands.length-1];
if (lastcommand.name == 'error') {
- ;;; kukit.E = new kukit.err.ExplicitError(lastcommand);
+;;; kukit.E = new kukit.err.ExplicitError(lastcommand);
throw kukit.E;
}
}
};
-kukit.cp.CommandProcessor.prototype.parseCommand = function(command, transport) {
+kukit.cp.CommandProcessor.prototype.parseCommand =
+ function(command, transport) {
var selector = "";
var params = {};
var name = "";
@@ -64,7 +63,8 @@
continue;
if (childNode.localName) {
// (here tolerate both cases)
- if (childNode.localName.toLowerCase() != "param" && childNode.nodeName.toLowerCase() != "kukit:param") {
+ if (childNode.localName.toLowerCase() != "param"
+ && childNode.nodeName.toLowerCase() != "kukit:param") {
throw 'Bad payload, expected param';
}
} else {
@@ -93,7 +93,8 @@
throw 'Bad payload, expected attribute "name"';
}
}
- var command = new kukit.cr.makeCommand(selector, name, type, params, transport);
+ var command = new kukit.cr.makeCommand(selector, name, type, params,
+ transport);
this.addCommand(command);
};
@@ -103,7 +104,7 @@
kukit.cp.CommandProcessor.prototype.executeCommands = function(oper) {
kukit.engine.beginSetupEventsCollection();
- // node, eventrule, binderinstance are given on oper, in case
+ // node, eventRule, binderInstance are given on oper, in case
// the command was called up from an event
if (typeof(oper) == 'undefined' || oper == null) {
oper = new kukit.op.Oper();
@@ -111,16 +112,16 @@
var commands = this.commands;
for (var y=0;y < commands.length;y++) {
var command = commands[y];
- ;;; try {
+;;; try {
command.execute(oper);
- ;;; } catch (e) {
- ;;; if (e.name == 'RuleMergeError' || e.name == 'EventBindError') {
- ;;; throw(e);
- ;;; } else {
- ;;; // augment the error message
- ;;; throw new kukit.err.CommandExecutionError(e, command);
- ;;; }
- ;;; }
+;;; } catch (e) {
+;;; if (e.name == 'RuleMergeError' || e.name == 'EventBindError') {
+;;; throw(e);
+;;; } else {
+;;; // augment the error message
+;;; throw new kukit.err.CommandExecutionError(e, command);
+;;; }
+;;; }
}
kukit.engine.finishSetupEventsCollection();
};
Modified: kukit/kukit.js/trunk/kukit/commandreg.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/commandreg.js (original)
+++ kukit/kukit.js/trunk/kukit/commandreg.js Thu Aug 16 22:32:22 2007
@@ -1,9 +1,6 @@
/*
-* Copyright (c) 2005-2006
-* Authors:
-* Godefroid Chapelle
-* Florian Schulze
-* Bal?zs Re?
+* Copyright (c) 2005-2007
+* Authors: KSS Project Contributors (see doc/CREDITS.txt)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
@@ -38,14 +35,18 @@
* Examples:
*
* kukit.actionsGlobalRegistry.register('log', f1);
-* kukit.commandsGlobalRegistry.registerFromAction('log', kukit.cr.makeGlobalCommand);
+* kukit.commandsGlobalRegistry.registerFromAction('log',
+* kukit.cr.makeGlobalCommand);
*
* kukit.actionsGlobalRegistry.register('replaceInnerHTML', f2);
-* kukit.commandsGlobalRegistry.registerFromAction('replaceInnerHTML', kukit.cr.makeSelectorCommand);
+* kukit.commandsGlobalRegistry.registerFromAction('replaceInnerHTML',
+* kukit.cr.makeSelectorCommand);
*/
-kukit.cr.CommandRegistry.prototype.registerFromAction = function(srcname, factory, name) {
+kukit.cr.CommandRegistry.prototype.registerFromAction =
+ function(srcname, factory, name) {
if (typeof(name) == 'undefined') {
- // allows to set a different name as the action name, usable for backward
+ // allows to set a different name as the action name,
+ // usable for backward
// compatibility setups
name = srcname;
}
@@ -57,7 +58,8 @@
kukit.cr.CommandRegistry.prototype.register = function(name, klass) {
if (this.commands[name]) {
// Do not allow redefinition
- ;;; kukit.logError('ValueError : command "' + name + '" is already registered.');
+;;; var msg = 'ValueError : command [' + name + '] is already registered.';
+;;; kukit.logError(msg);
return;
}
this.commands[name] = klass;
@@ -65,10 +67,11 @@
kukit.cr.CommandRegistry.prototype.get = function(name) {
var klass = this.commands[name];
- ;;; if (! klass) {
- ;;; // not found
- ;;; kukit.logError('ValueError : no command registered under name : ' + name);
- ;;; }
+;;; if (! klass) {
+;;; // not found
+;;; var msg = 'ValueError : no command registered under [' + name + '].';
+;;; kukit.logError(msg);
+;;; }
return klass;
};
@@ -79,7 +82,10 @@
kukit.cr.commandRegistry = {};
kukit.cr.commandRegistry.registerFromAction = function(srcname, factory, name) {
- ;;; kukit.logWarning('Deprecated kukit.cr.commandRegistry.registerFromAction, use kukit.commandsGlobalRegistry.registerFromAction instead! (' + srcname + ')');
+;;; var msg = 'Deprecated kukit.cr.commandRegistry.registerFromAction,';
+;;; msg += ' use kukit.commandsGlobalRegistry.registerFromAction instead! (';
+;;; msg += srcname + ')';
+;;; kukit.logWarning(msg);
kukit.commandsGlobalRegistry.registerFromAction(srcname, factory, name);
};
@@ -110,20 +116,24 @@
// When applying the selection, the original event target will be used
// as a starting point for the selection.
var nodes = selfunc(this.selector, oper.orignode, {});
- ;;; var printtype;
- ;;; if (this.selectorType) {
- ;;; printtype = this.selectorType;
- ;;; } else {
- ;;; printtype = 'default (' + kukit.selectorTypesGlobalRegistry.defaultSelectorType + ')';
- ;;; }
- ;;; kukit.logDebug('Selector type: ' + printtype + ', selector : "' + this.selector + '", selected nodes:' + nodes.length);
- ;;; if (!nodes || nodes.length == 0) {
- ;;; kukit.logWarning('Selector found no nodes');
- ;;; }
+;;; var printType;
+;;; if (this.selectorType) {
+;;; printType = this.selectorType;
+;;; } else {
+;;; printType = 'default (';
+;;; printType += kukit.selectorTypesGlobalRegistry.defaultSelectorType;
+;;; printType += ')';
+;;; }
+;;; var msg = 'Selector type [' + printType + '], selector [';
+;;; msg += this.selector + '], selected nodes [' + nodes.length + '].';
+;;; kukit.logDebug(msg);
+;;; if (!nodes || nodes.length == 0) {
+;;; kukit.logWarning('Selector found no nodes.');
+;;; }
for (var i=0;i < nodes.length;i++) {
oper.node = nodes[i];
//XXX error handling for wrong command name
- ;;; kukit.logDebug('Command Name: ' + this.name);
+;;; kukit.logDebug('[' + this.name + '] execution.');
this.executeOnSingleNode(oper);
}
};
Modified: kukit/kukit.js/trunk/kukit/dom.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/dom.js (original)
+++ kukit/kukit.js/trunk/kukit/dom.js Thu Aug 16 22:32:22 2007
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2005-2007
-* Authors: KSS Project Contributors (see docs/CREDITS.txt)
+* Authors: KSS Project Contributors (see doc/CREDITS.txt)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
@@ -38,23 +38,27 @@
};
kukit.dom.insertBefore = function(nodeFrom, parentNode, nodeTo) {
- var ownerDoc = nodeTo.nodeType == Node.DOCUMENT_NODE ? nodeTo : nodeTo.ownerDocument;
+ var ownerDoc = nodeTo.nodeType == Node.DOCUMENT_NODE ?
+ nodeTo : nodeTo.ownerDocument;
var nodes = nodeFrom.childNodes;
var result = new Array();
if(ownerDoc.importNode && (!kukit.HAVE_IE)) {
for(var i=0;i < nodes.length;i++) {
- result[i] = parentNode.insertBefore(ownerDoc.importNode(nodes[i], true), nodeTo);
+ var imported = ownerDoc.importNode(nodes[i], true);
+ result[i] = parentNode.insertBefore(imported, nodeTo);
}
} else {
for(var i=0;i < nodes.length;i++) {
- result[i] = parentNode.insertBefore(nodes[i].cloneNode(true), nodeTo);
+ var cloned = nodes[i].cloneNode(true);
+ result[i] = parentNode.insertBefore(cloned, nodeTo);
}
}
return result;
};
kukit.dom.appendChildren = function(nodes, toNode) {
- var ownerDoc = toNode.nodeType == Node.DOCUMENT_NODE ? toNode : toNode.ownerDocument;
+ var ownerDoc = toNode.nodeType == Node.DOCUMENT_NODE ?
+ toNode : toNode.ownerDocument;
var result = new Array();
if(ownerDoc.importNode && (!kukit.HAVE_IE)) {
for(var i=0;i < nodes.length;i++) {
@@ -79,21 +83,29 @@
// This is to assure that all methods that accept a dom can accept a string
// instead.
if (typeof(param) == 'string') {
- //
- // now convert to dom
- //
-
- //param = "";
- // ***BROKEN*** param = "";
- //param = "";
-
- // This is a good solution since it does not do magic to
- // our html - BUT html is parsed as xml
- // so we currently preprocess it on the server
- // and remove html named entities from it.
- //
- var root_txt = '
' + param + '
';
- var doc = (new DOMParser()).parseFromString(root_txt, "text/xml");
+//
+// now convert to dom
+//
+
+// param
+//
+//
+
+// ***BROKEN*** param
+//
+//
+
+// param
+//
+
+// This is a good solution since it does not do magic to
+// our html - BUT html is parsed as xml
+// so we currently preprocess it on the server
+// and remove html named entities from it.
+//
+ var rootText = '
';
+ rootText += param + '
';
+ var doc = (new DOMParser()).parseFromString(rootText, "text/xml");
var root = doc.getElementsByTagName('div')[0];
// XXX Sarissa bug; html docs would not have a
@@ -118,36 +130,36 @@
/*
* really the query should start from the document root, but
-* limited to in_nodes subtrees!
+* limited to inNodes subtrees!
*/
-kukit.dom.cssQuery = function(selector, in_nodes) {
+kukit.dom.cssQuery = function(selector, inNodes) {
// to eliminate possible errors
- if (typeof(in_nodes) != 'undefined' && in_nodes == null) {
- ;;; kukit.E = 'Selection error in kukit.dom.cssQuery';
+ if (typeof(inNodes) != 'undefined' && inNodes == null) {
+;;; kukit.E = 'Selection error in kukit.dom.cssQuery';
throw kukit.E;
}
- return kukit.dom._cssQuery(selector, in_nodes);
+ return kukit.dom._cssQuery(selector, inNodes);
};
/*
* Decide which query to use
*/
-kukit.dom._cssQuery = function(selector, in_nodes) {
+kukit.dom._cssQuery = function(selector, inNodes) {
var USE_BASE2 = (typeof(base2) != 'undefined');
if (USE_BASE2) {
- ;;; kukit.log('Using cssQuery from base2');
+;;; kukit.log('Using cssQuery from base2.');
kukit.dom._cssQuery = kukit.dom._cssQuery_base2
} else {
- ;;; kukit.log('Using original cssQuery');
+;;; kukit.log('Using original cssQuery.');
kukit.dom._cssQuery = kukit.dom._cssQuery_orig
}
- return kukit.dom._cssQuery(selector, in_nodes);
+ return kukit.dom._cssQuery(selector, inNodes);
};
-kukit.dom._cssQuery_base2 = function(selector, in_nodes) {
+kukit.dom._cssQuery_base2 = function(selector, inNodes) {
// global scope, always.
// This is very bad. However the binding makes sure that
// nodes once bound will never be bound again
@@ -161,7 +173,7 @@
return nodes;
};
-kukit.dom._cssQuery_orig = function(selector, in_nodes) {
+kukit.dom._cssQuery_orig = function(selector, inNodes) {
// global scope, always.
// This is very bad. However the binding makes sure that
// nodes once bound will never be bound again
@@ -173,10 +185,11 @@
kukit.dom.focus = function(node) {
tagName = node.tagName.toLowerCase();
- if ((tagName == 'input') || (tagName == 'select') || (tagName == 'textarea')) {
+ if ((tagName == 'input') || (tagName == 'select')
+ || (tagName == 'textarea')) {
node.focus();
- ;;; } else {
- ;;; kukit.logWarning('Focus on node that cannot have focus !');
+;;; } else {
+;;; kukit.logWarning('Focus on node that cannot have focus !');
}
};
@@ -219,9 +232,9 @@
if (attrname.toLowerCase() == 'style') {
throw 'Style attribute is not allowed with getAttribute';
}
- ;;;if (typeof(attrname) != 'string') {
- ;;; throw 'value error : attrname must be string';
- ;;;}
+;;; if (typeof(attrname) != 'string') {
+;;; throw 'value error : attrname must be string';
+;;; }
// The code hereunder does not work for kssattr:xxx args
// var value = node[argname];
@@ -293,9 +306,11 @@
for (var i=0; i
-* Florian Schulze
-* Bal?zs Re?
+* Copyright (c) 2005-2007
+* Authors: KSS Project Contributors (see doc/CREDITS.txt)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
@@ -76,49 +73,58 @@
;;; // this should be thrown with the error command as parameter
;;; kukit.err.ExplicitError = kukit.err.exceptionFactory('ExplicitError');
-;;; kukit.err.ExplicitError.prototype.__superinit__ = kukit.err.ExplicitError.prototype.__init__;
-;;; kukit.err.ExplicitError.prototype.__init__ = function(name, errorcommand) {
+;;; kukit.err.ee = kukit.err.ExplicitError;
+;;; kukit.err.ee.prototype.__superinit__ = kukit.err.ee.prototype.__init__;
+;;; kukit.err.ee.prototype.__init__ = function(name, errorcommand) {
;;; var message = 'Explicit error';
;;; var kw = this.__superinit__(name, message);
;;; kw.errorcommand = errorcommand;
;;; return kw;
;;; };
-;;; kukit.err.ResponseParsingError = kukit.err.exceptionFactory('ResponseParsingError');
+;;; var name = 'ResponseParsingError';
+;;; kukit.err.ResponseParsingError = kukit.err.exceptionFactory(name);
-;;; kukit.err.CommandExecutionError = kukit.err.exceptionFactory('CommandExecutionError');
-;;; kukit.err.CommandExecutionError.prototype.__superinit__ = kukit.err.CommandExecutionError.prototype.__init__;
-;;; kukit.err.CommandExecutionError.prototype.__init__ = function(name, e, command) {
+;;; var name = 'CommandExecutionError';
+;;; kukit.err.CommandExecutionError = kukit.err.exceptionFactory(name);
+;;; kukit.err.cex = kukit.err.CommandExecutionError;
+;;; kukit.err.cex.prototype.__superinit__ = kukit.err.cex.prototype.__init__;
+;;; kukit.err.cex.prototype.__init__ = function(name, e, command) {
;;; var kw = this.__superinit__(name, '');
-;;; kw.message = 'Command "' + command.name + '": ' + e.toString();
+;;; kw.message = 'Command [' + command.name + '] ' + e.toString();
;;; return kw;
;;; };
kukit.err.rd = {};
;;; kukit.err.rd.RuleMergeError = kukit.err.exceptionFactory('RuleMergeError');
-;;; kukit.err.rd.KssSelectorError = kukit.err.exceptionFactory('KssSelectorError');
+;;; var name = 'KssSelectorError';
+;;; kukit.err.rd.KssSelectorError = kukit.err.exceptionFactory(name);
-;;; kukit.err.rd.EventBindError = kukit.err.exceptionFactory('EventBindError');
-;;; kukit.err.rd.EventBindError.prototype.__superinit__ = kukit.err.rd.EventBindError.prototype.__init__;
-;;; kukit.err.rd.EventBindError.prototype.__init__ = function(name, message, eventname, eventnamespace) {
+;;; var name = 'EventBindError';
+;;; kukit.err.rd.EventBindError = kukit.err.exceptionFactory(name);
+;;; kukit.err.rd.ebe = kukit.err.rd.EventBindError;
+;;; kukit.err.rd.ebe.prototype.__superinit__ = kukit.err.rd.ebe.prototype.__init__;
+;;; kukit.err.rd.ebe.prototype.__init__ = function(name, message, eventName, eventNamespace) {
;;; var kw = this.__superinit__(name, message);
-;;; kw.eventname = eventname;
-;;; kw.eventnamespace = eventnamespace;
-;;; kw.message = kw.message + ' when binding event name "' + eventname + '" on namespace "' + eventnamespace + '"';
+;;; kw.eventName = eventName;
+;;; kw.eventNamespace = eventNamespace;
+;;; kw.message += ' When binding event name [' + eventName;
+;;; kw.message += '] in namespace [' + eventNamespace + '].';
;;; return kw;
;;; };
kukit.err.tk = {};
;;; kukit.err.tk.ParsingError = kukit.err.exceptionFactory('ParsingError');
-;;; kukit.err.tk.ParsingError.prototype.__superinit__ = kukit.err.tk.ParsingError.prototype.__init__;
-;;; kukit.err.tk.ParsingError.prototype.__init__ = function(name, message, cursor) {
+;;; kukit.err.tk.pe = kukit.err.tk.ParsingError;
+;;; kukit.err.tk.pe.prototype.__superinit__ = kukit.err.tk.pe.prototype.__init__;
+;;; kukit.err.tk.pe.prototype.__init__ = function(name, message, cursor) {
;;; var kw = this.__superinit__(name, message);
;;; if (cursor) {
;;; kw.errpos = cursor.pos;
;;; kw.errrow = cursor.row;
;;; kw.errcol = cursor.col;
-;;; kw.message = kw.message + ' at row ' + kw.errrow + ', column ' + kw.errcol;
+;;; kw.message += ' at row ' + kw.errrow + ', column ' + kw.errcol;
;;; } else {
;;; kw.errpos = null;
;;; kw.errrow = null;
Modified: kukit/kukit.js/trunk/kukit/eventreg.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/eventreg.js (original)
+++ kukit/kukit.js/trunk/kukit/eventreg.js Thu Aug 16 22:32:22 2007
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2005-2007
-* Authors: KSS Project Contributors (see docs/CREDITS.txt)
+* Authors: KSS Project Contributors (see doc/CREDITS.txt)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
@@ -30,48 +30,50 @@
*
* usage:
*
-* kukit.eventsGlobalRegistry.register(namespace, eventname, func,
-* bindmethodname, defaultactionmethodname);
+* kukit.eventsGlobalRegistry.register(namespace, eventName, func,
+* bindMethodName, defaultActionMethodName);
*
* namespace = null: means global namespace
-* defaultactionmethodname = null: if there is no default action implemented
+* defaultActionMethodName = null: if there is no default action implemented
* func must be a class (constructor) function, this is the class that
* implements the binder.
*/
kukit.er.EventRegistry = function () {
this.content = {};
this.classes = {};
- this.eventsets = [];
+ this.eventSets = [];
};
/* binder registration */
-kukit.er.EventRegistry.prototype.registerBinder = function(classname, func) {
+kukit.er.EventRegistry.prototype.registerBinder = function(className, func) {
if (typeof(func) == 'undefined') {
- ;;; kukit.E = 'func argument is mandatory when registering an event binder (EventRegistry.registerBinder).';
+;;; kukit.E = 'func argument is mandatory when registering an event';
+;;; kukit.E += ' binder (EventRegistry.registerBinder).';
throw kukit.E;
}
- if (this.classes[classname]) {
+ if (this.classes[className]) {
// Do not allow redefinition
- ;;; kukit.logError('Error : event class "' + classname + '" already registered.');
+;;; var msg = 'Error : event class [' + className + '] already registered.';
+;;; kukit.logError(msg);
return;
}
// Decorate and store the class
kukit.er.decorateEventBinderClass(func);
- this.classes[classname] = func;
+ this.classes[className] = func;
};
-kukit.er.EventRegistry.prototype.existsBinder = function(classname) {
- var func = this.classes[classname];
+kukit.er.EventRegistry.prototype.existsBinder = function(className) {
+ var func = this.classes[className];
return (typeof(func) != 'undefined');
};
-kukit.er.EventRegistry.prototype.getBinder = function(classname) {
- var func = this.classes[classname];
+kukit.er.EventRegistry.prototype.getBinder = function(className) {
+ var func = this.classes[className];
if (! func) {
// not found
- ;;; kukit.E = 'Error : undefined event setup type ' + classname;
+;;; kukit.E = 'Error : undefined event setup type [' + className + '].';
throw kukit.E;
}
return func;
@@ -79,121 +81,134 @@
/* events (methods) registration helpers (not to be called directly) */
-kukit.er.EventRegistry.prototype._register = function(namespace, eventname, klass,
- bindmethodname, defaultactionmethodname, itername) {
- if (typeof(defaultactionmethodname) == 'undefined') {
- ;;; kukit.E = 'some arguments are not passed when calling EventRegistry.register';
+kukit.er.EventRegistry.prototype._register =
+ function(namespace, eventName, klass,
+ bindMethodName, defaultActionMethodName, iterName) {
+ if (typeof(defaultActionMethodName) == 'undefined') {
+;;; kukit.E = 'Missing arguments when calling [EventRegistry.register].';
throw kukit.E;
}
// Find out the class name. (Not specified now.)
- var classname = klass.prototype.__classname__;
- if (typeof(classname) == 'undefined') {
- // Create a classname, and register it too.
- classname = '' + kukit.er.eventClassCounter;
+ var className = klass.prototype.__className__;
+ if (typeof(className) == 'undefined') {
+ // Create a className, and register it too.
+ className = '' + kukit.er.eventClassCounter;
kukit.er.eventClassCounter += 1;
- this.registerBinder(classname, klass);
- klass.prototype.__classname__ = classname;
+ this.registerBinder(className, klass);
+ klass.prototype.__className__ = className;
}
- if (!eventname) {
- ;;; kukit.E = 'eventname argument cannot be empty when registering an event (EventRegistry.register)';
+ if (!eventName) {
+;;; kukit.E = '[eventName] argument cannot be empty when registering';
+;;; kukit.E += ' an event with [EventRegistry.register].';
throw kukit.E;
}
- var key = this._getKey(namespace, eventname);
+ var key = this._getKey(namespace, eventName);
var entry = this.content[key];
if (typeof(entry) != 'undefined') {
if (key[0] == '-') {
key = key.substring(1);
}
- ;;; kukit.E = 'In EventRegistry.register double registration of key "' + key + '"';
- throw kukit.E;
- }
- // check bindmethodname and defaultactionmethodname
- if (bindmethodname && ! klass.prototype[bindmethodname]) {
- ;;; kukit.E = 'In EventRegistry.register bind method "' + bindmethodname;
- ;;; kukit.E += '" is undefined for event "' + eventname + '" namespace "' + namespace + '"';
- throw kukit.E;
- }
- if (defaultactionmethodname && ! klass.prototype[defaultactionmethodname]) {
- ;;; kukit.E = 'In EventRegistry.register default action method "' + defaultactionmethodname;
- ;;; kukit.E += '" is undefined for event "' + eventname + '" namespace "' + namespace + '"';
+;;; kukit.E = 'Attempt to register key [' + key;
+;;; kukit.E += '] twice when registering';
+;;; kukit.E += ' an event with [EventRegistry.register].';
+ throw kukit.E;
+ }
+ // check bindMethodName and defaultActionMethodName
+ if (bindMethodName && ! klass.prototype[bindMethodName]) {
+;;; kukit.E = 'In EventRegistry.register bind method [' + bindMethodName;
+;;; kukit.E += '] is undefined for event [' + eventName;
+;;; kukit.E += '] namespace [' + namespace + '].';
+ throw kukit.E;
+ }
+ if (defaultActionMethodName && ! klass.prototype[defaultActionMethodName]) {
+;;; kukit.E = 'In EventRegistry.register default action method [';
+;;; kukit.E += defaultActionMethodName + '] is undefined for event [';
+;;; kukit.E += eventName + '] namespace [' + namespace + '].';
throw kukit.E;
}
// check the iterator.
- if (! kukit.er.getBindIterator(itername)) {
- ;;; kukit.E = 'In EventRegistry.register unknown bind iterator "' + itername + '"';
+ if (! kukit.er.getBindIterator(iterName)) {
+;;; kukit.E = 'In EventRegistry.register unknown bind iterator [';
+;;; kukit.E += iterName + '].';
throw kukit.E;
}
// register it
this.content[key] = {
- 'classname': classname,
- 'bindmethodname': bindmethodname,
- 'defaultactionmethodname': defaultactionmethodname,
- 'itername': itername
+ 'className': className,
+ 'bindMethodName': bindMethodName,
+ 'defaultActionMethodName': defaultActionMethodName,
+ 'iterName': iterName
};
};
-/* events (methods) binding "ForAll" registration */
+/* events (methods) binding [ForAll] registration */
-kukit.er.EventRegistry.prototype._registerEventSet = function(namespace, names, itername, bindmethodname) {
+kukit.er.EventRegistry.prototype._registerEventSet =
+ function(namespace, names, iterName, bindMethodName) {
// At this name the values should be checked already. so this should
// be called _after_ _register.
- this.eventsets.push({
+ this.eventSets.push({
'namespace': namespace,
'names': names,
- 'itername': itername,
- 'bindmethodname': bindmethodname
+ 'iterName': iterName,
+ 'bindMethodName': bindMethodName
});
};
/* there are the actual registration methods, to be called from plugins */
-kukit.er.EventRegistry.prototype.register = function(namespace, eventname, klass,
- bindmethodname, defaultactionmethodname) {
- this._register(namespace, eventname, klass, bindmethodname, defaultactionmethodname, 'each_legacy');
- this._registerEventSet(namespace, [eventname], 'each_legacy', bindmethodname);
-};
-
-kukit.er.EventRegistry.prototype.registerForAllEvents = function(namespace, eventnames, klass,
- bindmethodname, defaultactionmethodname, itername) {
- if (typeof(eventnames) == 'string') {
- eventnames = [eventnames];
- }
- for (var i=0; i 1) {
- ;;; kukit.E = 'In EventRegistry.register namespace cannot contain -';
+;;; kukit.E = 'In [EventRegistry.register], [namespace] cannot have';
+;;; kukit.E += 'dashes.';
throw kukit.E;
}
- return namespace + '-' + eventname;
+ return namespace + '-' + eventName;
};
-kukit.er.EventRegistry.prototype.exists = function(namespace, eventname) {
- var key = this._getKey(namespace, eventname);
+kukit.er.EventRegistry.prototype.exists = function(namespace, eventName) {
+ var key = this._getKey(namespace, eventName);
var entry = this.content[key];
return (typeof(entry) != 'undefined');
};
-kukit.er.EventRegistry.prototype.get = function(namespace, eventname) {
- var key = this._getKey(namespace, eventname);
+kukit.er.EventRegistry.prototype.get = function(namespace, eventName) {
+ var key = this._getKey(namespace, eventName);
var entry = this.content[key];
if (typeof(entry) == 'undefined') {
- if (key.substr(0, 1) == '-') {
- ;;; key = key.substring(1);
- ;;; kukit.E = 'Error : undefined global event key ';
- ;;; kukit.E += key + ' (or maybe namespace is missing?)';
- throw kukit.E;
- } else {
- ;;; kukit.E = 'Error : undefined event key ' + key;
- throw kukit.E;
- }
+;;; if (key.substr(0, 1) == '-') {
+;;; key = key.substring(1);
+;;; kukit.E = 'Error : undefined global event key ';
+;;; kukit.E += key + ' (or maybe namespace is missing ?).';
+;;; } else {
+;;; kukit.E = 'Error : undefined event key [' + key + '].';
+;;; }
+ throw kukit.E;
}
return entry;
};
@@ -204,11 +219,14 @@
/* XXX deprecated methods, to be removed asap */
kukit.er.eventRegistry = {};
-kukit.er.eventRegistry.register = function(namespace, eventname, klass,
- bindmethodname, defaultactionmethodname) {
- kukit.logWarning('Deprecated kukit.er.eventRegistry.register, use kukit.eventsGlobalRegistry.register instead! (' + namespace + '-' + eventname + ')');
- kukit.eventsGlobalRegistry.register(namespace, eventname, klass,
- bindmethodname, defaultactionmethodname);
+kukit.er.eventRegistry.register = function(namespace, eventName, klass,
+ bindMethodName, defaultActionMethodName) {
+;;; var msg = 'Deprecated kukit.er.eventRegistry.register,';
+;;; msg += ' use kukit.eventsGlobalRegistry.register instead ! [';
+;;; msg += namespace + '-' + eventName + '].';
+;;; kukit.logWarning(msg);
+ kukit.eventsGlobalRegistry.register(namespace, eventName, klass,
+ bindMethodName, defaultActionMethodName);
};
/* Event class decoration
@@ -223,13 +241,13 @@
* continuation event.
* Parameters will be the ones specified in the call +
* those defined in the rule will be added too. (Parameters can
-* be accessed with the "pass" kss parameter provider.)
+* be accessed with the [pass] kss parameter provider.)
*
* Call examples:
*
* trigger an event bound to a given state instance, same node
*
-* binderinstance.__continue_event__('doit', oper.node, {'extravalue': '5'});
+* binderInstance.__continueEvent__('doit', oper.node, {'extravalue': '5'});
*
* with kss rule:
*
@@ -248,7 +266,7 @@
* trigger an event bound to a given state instance, and the document
* (different from current scope)
*
-* binderinstance.__continue_event__('doit', null, {'extravalue': '5'});
+* binderInstance.__continueEvent__('doit', null, {'extravalue': '5'});
*
* with kss rule:
*
@@ -266,7 +284,7 @@
*
* trigger an event on all the nodes + document bound to a given state instance
*
-* binderinstance.__continue_event_allnodes__('doit', {'extravalue': '5'});
+* binderInstance.__continueEvent_allNodes__('doit', {'extravalue': '5'});
*
* with kss rule:
*
@@ -279,7 +297,8 @@
* so we create a new oper below
*/
-kukit.er.EventBinder__continue_event__ = function(name, node, defaultparms) {
+kukit.er.EventBinder__continueEvent__ =
+ function(name, node, defaultParameters) {
// Trigger a continuation event bound to a given state instance, given node
// (or on document, if node = null)
//
@@ -287,40 +306,48 @@
oper.node = node;
if (node) {
// if we found the binding, just use that
- var info = kukit.engine.binderInfoRegistry.getBinderInfoById(this.__binder_id__);
- var newoper = info.bound.getBoundOperForNode(name, node);
- if (newoper) {
- oper = newoper;
+ var info = kukit.engine.binderInfoRegistry.getBinderInfoById(
+ this.__binderId__);
+ var newOper = info.bound.getBoundOperForNode(name, node);
+ if (newOper) {
+ oper = newOper;
}
} else {
- oper.eventrule = kukit.engine.documentRules.getMergedRule('document', name, this);
+ oper.eventRule = kukit.engine.documentRules.getMergedRule(
+ 'document', name, this);
}
// Look up the behaviour rule, if any.
- var behav_eventrule = kukit.engine.documentRules.getMergedRule('behaviour', name, this);
- if (behav_eventrule) {
- if (! oper.eventrule) {
+ var behav_eventRule = kukit.engine.documentRules.getMergedRule(
+ 'behaviour', name, this);
+ if (behav_eventRule) {
+ if (! oper.eventRule) {
// There was no node matching for the rule, use behaviour rule
// this allows to set up parametrized actions in general.
- oper.eventrule = behav_eventrule;
+ oper.eventRule = behav_eventRule;
} else {
- // XXX this case should go away, as we should check this already from binding time
+ // XXX this case should go away, as we should check
+ // this already from binding time
// and signal the appropriate error.
- // Also note that behaviour roles will only be allowed for "non-binding" events.
- ;;; kukit.logError('Behaviour rule for continuation event "' + name + '" will be ignored, because we found an explicit rule.');
+ // Also note that behaviour roles will only be allowed
+ // for "non-binding" events.
+;;; var msg = 'Behaviour rule for continuation event [' + name;
+;;; msg += '] will be ignored, because we found an explicit rule.';
+;;; kukit.logError(msg);
}
}
- // If parameters are specified in the call, use them.
- if (typeof(defaultparms) != 'undefined') {
- oper.defaultparms = defaultparms;
+ // If parms are specified in the call, use them.
+ if (typeof(defaultParameters) != 'undefined') {
+ oper.defaultParameters = defaultParameters;
} else {
- oper.defaultparms = {};
+ oper.defaultParameters = {};
}
- // (if eventrule is null here, we can yet have the default method, so go on.)
- this._EventBinder_triggerevent(name, oper);
- ;;; kukit.logDebug('Continuation event "' + name + '" executed on same node.');
+ // if eventRule is null here, we can yet have the default method, so go on.
+ this._EventBinder_triggerEvent(name, oper);
+;;; kukit.logDebug('Continuation event [' + name + '] executed on same node.');
};
-kukit.er.EventBinder__continue_event_allnodes__ = function(name, defaultparms) {
+kukit.er.EventBinder__continueEvent_allNodes__ =
+ function(name, defaultParameters) {
// Trigger an event bound to a given state instance, on all nodes.
// (or on document, if node = null)
// if no other nodes execute.
@@ -328,20 +355,21 @@
// Normal rules. If any of those match, execute them too
// each on the node that it selects - not on the original node.
var oper = new kukit.op.Oper();
- var info = kukit.engine.binderInfoRegistry.getBinderInfoById(this.__binder_id__);
+ var info = kukit.engine.binderInfoRegistry.getBinderInfoById(
+ this.__binderId__);
var opers = info.bound.getBoundOpers(name);
for (var i=0; i-]-" ';
+;;; kukit.E += 'must not have different [namespace and] ';
+;;; kukit.E += 'name than the KSS selector at the top of the ';
+;;; kukit.E += 'rule.';
block.emitError(kukit.E);
}
}
// Create the event rule. (one action only)
- var eventRule = new kukit.rd.EventRule(parser.kssSelector, block.evt_parms, block.actions);
+ var eventRule = new kukit.rd.EventRule(parser.kssSelector,
+ block.eventParameters, block.actions);
// Store the rule
this.eventRules.push(eventRule);
};
@@ -108,7 +114,7 @@
});
kukit.kssp.Block.prototype.process = function() {
//this.parms = {};
- this.evt_parms = {};
+ this.eventParameters = {};
this.evt_name = null; // we don't know at this point
this.evt_namespace = null; // we don't know at this point
this.actions = new kukit.rd.ActionSet();
@@ -158,70 +164,98 @@
// default-error:
//
var splitkey = key.split('-');
- ;;; if (splitkey.length < 2 || splitkey.length > 4) {
- ;;; this.emitError('kss param key must be like xxx-yyy or nnn-xxx-yyy or evt-xxx-yyy or evt-nnn-xxx-yyy"' + key + '"');
- ;;; }
+;;; if (splitkey.length < 2 || splitkey.length > 4) {
+;;; kukit.E = 'Wrong rule key : "' + key + '". ';
+;;; kukit.E += 'KSS rule key must be "-" or ';
+;;; kukit.E += '"--" or ';
+;;; kukit.E += '"evt--" or ';
+;;; kukit.E += '"evt---".';
+;;; this.emitError(kukit.E);
+;;; }
var name = splitkey[0];
if (name == 'evt') {
- // evt--:
- // evt---:
- ;;; if (splitkey.length < 3) {
- ;;; this.emitError('kss param key must be like xxx-yyy or nnn-xxx-yyy or evt-xxx-yyy or evt-nnn-xxx-yyy"' + key + '"');
- ;;; }
+ // evt--:
+ // evt---:
+;;; if (splitkey.length < 3) {
+;;; kukit.E = 'Wrong rule key : "' + key + '". ';
+;;; kukit.E += 'KSS rule key must be "-"';
+;;; kukit.E += ' or "--" or ';
+;;; kukit.E += '"evt--" or ';
+;;; kukit.E += '"evt---".';
+;;; this.emitError(kukit.E);
+;;; }
var enamespace;
var ename;
var ekey;
if (splitkey.length == 3) {
- // evt--:
+ // evt--:
ename = splitkey[1];
ekey = splitkey[2];
} else {
- // evt---:
+ // evt---:
enamespace = splitkey[1];
ename = splitkey[2];
ekey = splitkey[3];
}
if (this.evt_name == null) {
- // This is the first evt- parameter, so we set it up
+ // This is the first evt- rule, so we set it up
// so that we can check it stays the same within the block.
this.evt_name = ename;
this.evt_namespace = enamespace;
- ;;; } else {
- ;;; if (ename != this.evt_name || enamespace != this.evt_namespace) {
- ;;; // Do not allow deviation from the previous event names.
- ;;; kukit.E = 'kss param key evt-[-]-yyy must not have different ';
- ;;; kukit.E += '[namespace and] name inside the same rule,"' + key + '", it must be "';
- ;;; kukit.E += this.evt_namespace + '-' + this.evt_name + '"';
- ;;; this.emitError(kukit.E);
- ;;; }
- ;;; }
- ;;; if (value.isMethod != false) {
- ;;; this.emitError('evt-[nnn-]xxx-yyy: parameter producers are not allowed as value, key "' + key + '"');
+;;; } else {
+;;; if (ename != this.evt_name || enamespace != this.evt_namespace) {
+;;; // Do not allow deviation from the previous event names.
+;;; kukit.E = 'Wrong key [' + key + '] : ';
+;;; kukit.E += 'evt-[-]- ';
+;;; kukit.E += 'keys cannot have different [namespace and] ';
+;;; kukit.E += 'event name than in the event selector, ';
+;;; kukit.E += 'it should have been [' + this.evt_namespace;
+;;; kukit.E += '-' + this.evt_name + '].';
+;;; this.emitError(kukit.E);
+;;; }
+;;; }
+;;; if (value.isMethod != false) {
+;;; kukit.E = 'Wrong value for key [' + key + '] : ';
+;;; kukit.E += 'value providers are not ';
+;;; kukit.E += 'allowed as value for ';
+;;; kukit.E += 'evt-[-]- keys.';
+;;; this.emitError(kukit.E);
}
// set it
- this.evt_parms[ekey] = value.txt;
+ this.eventParameters[ekey] = value.txt;
} else if (name == 'action') {
// action-server:
// action-client:
// action-client: -
// action-cancel:
// action-cancel: -
- ;;; if (splitkey.length != 2) {
- ;;; this.emitError('action-xxx must not have more "-" in it, key "' + key + '"');
- ;;; }
- ;;; if (value.isMethod != false) {
- ;;; this.emitError('action-xxx: parameter producers are not allowed as value, key "' + key + '"');
- ;;; }
+;;; if (splitkey.length != 2) {
+;;; kukit.E = 'Wrong key [' + key + '] : ';
+;;; kukit.E += 'action- keys can have only one dash.';
+;;; this.emitError(kukit.E);
+;;; }
+;;; if (value.isMethod != false) {
+;;; kukit.E = 'Wrong value for key [' + key + '] : ';
+;;; kukit.E += 'value providers are not ';
+;;; kukit.E += 'allowed for action- keys.';
+;;; this.emitError(kukit.E);
+;;; }
var atab = {'server': 'S', 'client': 'C', 'cancel': 'X'};
var actionType = atab[splitkey[1]];
- ;;; if (! actionType) {
- ;;; this.emitError('action-xxx: key must be action-server or action-client or action-cancel, key "' + key + '"');
- ;;; }
- ;;; // force value to be or -
- ;;; var splitvalue = value.txt.split('-');
- ;;; if (splitvalue.length > 2) {
- ;;; this.emitError('action-xxx: value must be or -, key "' + key + '"');
- ;;; }
+;;; if (! actionType) {
+;;; kukit.E = 'Wrong key [' + key + '] : ';
+;;; kukit.E += 'qualifier in action- keys must be ';
+;;; kukit.E += '"server" or "client" or "cancel".';
+;;; this.emitError(kukit.E);
+;;; }
+;;; // force value to be or -
+;;; var splitvalue = value.txt.split('-');
+;;; if (splitvalue.length > 2) {
+;;; kukit.E = 'Wrong value for key [' + key + '] : ';
+;;; kukit.E += 'value must be or ';
+;;; kukit.E += '- for action- keys.';
+;;; this.emitError(kukit.E);
+;;; }
// set it
var action = this.actions.getOrCreateAction(value.txt);
if (actionType != 'X' || action.type == null) {
@@ -257,9 +291,12 @@
case 'error': {
// -error:
// default-error:
- ;;; if (value.isMethod != false) {
- ;;; this.emitError('xxx-error: parameter producers are not allowed as value, key "' + key + '"');
- ;;; }
+;;; if (value.isMethod != false) {
+;;; kukit.E = 'Wrong value for key [' + key + '] : ';
+;;; kukit.E += 'value providers are not ';
+;;; kukit.E += 'allowed for -error keys.';
+;;; this.emitError(kukit.E);
+;;; }
action.setError(value.txt);
// also create the action for the error itself.
var err_action = this.actions.getOrCreateAction(value.txt);
@@ -269,12 +306,13 @@
// -:
// default-:
//
- // value may be either txt or method parms, and they get stored with the wrapper.
+ // value may be either txt or method parms,
+ // and they get stored with the wrapper.
action.parms[akey] = value;
//
- // Check the syntax of the value at this point. This will also set
- // the paramproviders on the value (from check).
- // check the syntax of the declaration
+ // Check the syntax of the value at this point.
+ // This will also set the value providers on the value
+ // (from check).
//
// Figure out which registry to use.
var registry = ppRegistries[akey];
@@ -284,11 +322,11 @@
}
//
try {
- // Check also sets the parameter provider on the value.
+ // Check also sets the value provider on the value.
value.check(registry);
} catch(e) {
- ;;; kukit.E = new kukit.err.tk.ParsingError('Error in value: ' + e, this.src.makeMarker(this.startpos));
- throw kukit.E;
+;;; kukit.E = 'Error in value : ' + e + '.';
+ this.emitError(kukit.E);
}
} break;
}
@@ -316,7 +354,8 @@
if (this.ifToken(cursor, kukit.kssp.String)) {
// The previous txt must be all whitespace.
if (txt) {
- ;;; kukit.E = 'Excess characters before the string in property value';
+;;; kukit.E = 'Wrong value : unallowed characters [' + txt + ']';
+;;; kukit.E += ' before a string.';
this.emitError(kukit.E);
}
// the next one must be a string.
@@ -325,16 +364,17 @@
} else if (this.ifToken(cursor, kukit.kssp.MethodArgs)) {
// see if not empty and has no spaces in it
if (! txt || txt.indexOf(' ') != -1) {
- ;;; kukit.E = 'Method property value must have a one-word method name';
+;;; kukit.E = 'Wrong value : method name [' + txt + '] cannot ';
+;;; kukit.E += 'have spaces.';
this.emitError(kukit.E);
}
- // the next one must be the params
+ // the next one must be the rules
this.expectToken(cursor, kukit.kssp.MethodArgs);
this.value = new this.valueClass(txt, cursor.token.args);
} else {
// not a string or method: check if we allowed multiword.
if (! this.multiword_allowed && txt.indexOf(' ') != -1) {
- ;;; kukit.E = 'Property value must be one word';
+;;; kukit.E = 'Wrong value : [' + txt + '] cannot have spaces.';
this.emitError(kukit.E);
}
this.produceTxt(txt);
@@ -344,7 +384,8 @@
this.digestTxt(cursor, kukit.tk.Fraction, kukit.kssp.Comment);
// we have to be at the end and have no text after
if (cursor.next < this.result.length || cursor.txt) {
- ;;; kukit.E = 'Excess characters after the property value';
+;;; kukit.E = 'Wrong value : unallowed characters after ';
+;;; kukit.E += 'the property.';
this.emitError(kukit.E);
}
}
@@ -360,7 +401,7 @@
/*
* class PropValueInMethod
*
-* PropValue in method cannot contain method-style vars.
+* PropValue in method cannot have method-style vars.
*/
kukit.kssp.PropValueInMethod = kukit.tk.mkParser('propvalue', {
";": 'this.emitAndReturn()',
@@ -370,10 +411,11 @@
",": 'this.emitAndReturn()',
"'": 'new kukit.kssp.String(this.src, kukit.kssp.quote)',
'"': 'new kukit.kssp.String2(this.src, kukit.kssp.dquote)',
- "\/\*": 'new kukit.kssp.Comment(this.src, kukit.kssp.commentbegin)' //,
+ "\/\*": 'new kukit.kssp.Comment(this.src, kukit.kssp.commentbegin)'
});
kukit.kssp.PropValueInMethod.prototype.multiword_allowed = false;
-kukit.kssp.PropValueInMethod.prototype.process = kukit.kssp.PropValue.prototype.process;
+kukit.kssp.PropValueInMethod.prototype.process =
+ kukit.kssp.PropValue.prototype.process;
kukit.kssp.PropValueInMethod.prototype.produceTxt = function(txt) {
// txt parms are returned unwrapped
this.txt = txt;
@@ -392,10 +434,12 @@
"\r": 'this.emitAndReturn()',
"\/\*": 'this.emitAndReturn()',
":": 'this.emitAndReturn()',
- "(": 'this.emitAndReturn(new kukit.kssp.MethodArgs(this.src, kukit.kssp.openparent))'
+ "(": 'this.emitAndReturn(new kukit.kssp.MethodArgs(this.src,' +
+ 'kukit.kssp.openparent))'
});
kukit.kssp.PropValueInPseudo.prototype.multiword_allowed = false;
-kukit.kssp.PropValueInPseudo.prototype.process = kukit.kssp.PropValue.prototype.process;
+kukit.kssp.PropValueInPseudo.prototype.process =
+ kukit.kssp.PropValue.prototype.process;
kukit.kssp.PropValueInPseudo.prototype.valueClass = kukit.rd.KssPseudoValue;
kukit.kssp.PropValueInPseudo.prototype.produceTxt = function(txt) {
// txt parms are returned embedded
@@ -436,7 +480,7 @@
var src = this.src;
var length = src.text.length;
if (length < src.pos + 1) {
- ;;; kukit.E = 'Missing character after backslash';
+;;; kukit.E = 'Missing character after backslash.';
this.emitError(kukit.E);
} else {
this.result.push(new kukit.tk.Fraction(src, src.pos+1));
@@ -475,7 +519,9 @@
} else {
// Just a value, must be one word then.
if (value.indexOf(' ') != -1) {
- ;;; kukit.E = 'Argument value must be one word or a string';
+;;; kukit.E = 'Wrong method argument [' + value;
+;;; kukit.E += '] : value cannot have spaces (if needed,';
+;;; kukit.E += ' quote it as a string).';
this.emitError(kukit.E);
}
}
@@ -491,13 +537,14 @@
* class KssSelector
*
* embedded parser to parse the selector
-* kss event selector: (has spaces in it)
+* KSS event selector: (has spaces in it)
* selector:name(id)
-* kss method selector: (has no spaces in it)
+* KSS method selector: (has no spaces in it)
* document:name(id) or behaviour:name(id)
*/
kukit.kssp.KssSelector = kukit.tk.mkParser('kssselector', {
- ":": '[new kukit.kssp.colon(this.src), new kukit.kssp.PropValueInPseudo(this.src)]',
+ ":": '[new kukit.kssp.colon(this.src), new ' +
+ 'kukit.kssp.PropValueInPseudo(this.src)]',
"{": 'this.emitAndReturn()',
"\/\*": 'new kukit.kssp.Comment(this.src, kukit.kssp.commentbegin)'
});
@@ -516,8 +563,9 @@
if (token.txt.match(/^[\r\n\t ]*$/) != null) {
tokenindex -= 1;
} else {
- // Error.
- ;;; kukit.E = 'Kss event selector must end with an event qualifier :event or :event(id)';
+;;; kukit.E = 'Wrong event selector : missing event ';
+;;; kukit.E += 'qualifier : ';
+;;; kukit.E += 'or :().';
this.emitError(kukit.E);
}
} break;
@@ -530,12 +578,16 @@
}
}
// Now we found the token that must be .
- tokenindex -= 2
+ tokenindex -= 2;
if (tokenindex < 0
- || this.result[tokenindex+2].symbol != kukit.kssp.PropValueInPseudo.prototype.symbol
- || this.result[tokenindex+1].symbol != kukit.kssp.colon.prototype.symbol
- || this.result[tokenindex].symbol != kukit.tk.Fraction.prototype.symbol) {
- ;;; kukit.E = 'Kss event selector must end with an event qualifier :event or :event(id)';
+ || (this.result[tokenindex+2].symbol !=
+ kukit.kssp.PropValueInPseudo.prototype.symbol)
+ || (this.result[tokenindex+1].symbol !=
+ kukit.kssp.colon.prototype.symbol)
+ || (this.result[tokenindex].symbol !=
+ kukit.tk.Fraction.prototype.symbol)) {
+;;; kukit.E = 'Wrong event selector : missing event qualifier ';
+;;; kukit.E += ': or :().';
this.emitError(kukit.E);
}
// See that the last fraction does not end with space.
@@ -544,19 +596,21 @@
var pseudotoken = this.result[tokenindex+2];
var txt = lasttoken.txt;
if (txt.match(/[\r\n\t ]$/) != null) {
- ;;; kukit.E = 'In kss event selector no space can be before the colon';
+;;; kukit.E = 'Wrong event selector :';
+;;; kukit.E += ' space before the colon.';
this.emitError(kukit.E);
}
- if (! pseudotoken.value.methodname) {
- ;;; kukit.E = 'Kss event selector must have a one-word name after the colon';
+ if (! pseudotoken.value.methodName) {
+;;; kukit.E = 'Wrong event selector :';
+;;; kukit.E += ' event name cannot have spaces.';
this.emitError(kukit.E);
}
if (pseudotoken.value.args.length > 1) {
- ;;; kukit.E = 'Kss pseudo value must not have more then one parameters';
+;;; kukit.E = 'Wrong event selector :';
+;;; kukit.E += ':() can have only one parameter.';
this.emitError(kukit.E);
}
css = this.src.text.substring(this.startpos, commatoken.startpos);
- //print ('>>' + css + ':' + pseudotoken.value.methodname);
// Decide if we have an event or a method selector.
// We have a method selector if a single word "document" or "behaviour".
var singleword = css.replace(/[\r\n\t ]/g, ' ');
@@ -573,27 +627,30 @@
if (pseudotoken.value.args.length == 1) {
id = pseudotoken.value.args[0];
}
- var name = pseudotoken.value.methodname;
+ var name = pseudotoken.value.methodName;
var splitname = name.split('-');
var namespace = null;
if (splitname.length > 2) {
- ;;; kukit.E = 'Kss event selector must be name or namespace-name but no more dashes, "' + name + '"';
+;;; kukit.E = 'Wrong event selector [' + name + '] : ';
+;;; kukit.E += 'qualifier should be : or ';
+;;; kukit.E += ':-.';
this.emitError(kukit.E);
} else if (splitname.length == 2) {
name = splitname[1];
namespace = splitname[0];
}
// Protect the error for better logging
- ;;; try {
- this.kssSelector = new kukit.rd.KssSelector(isEvent, css, name, namespace, id);
- ;;; } catch(e) {
- ;;; if (e.name == 'KssSelectorError') {
- ;;; // Log the message
- ;;; this.emitError(e.toString());
- ;;; } else {
- ;;; throw e;
- ;;; }
- ;;; }
+;;; try {
+ this.kssSelector = new kukit.rd.KssSelector(isEvent, css, name,
+ namespace, id);
+;;; } catch(e) {
+;;; if (e.name == 'KssSelectorError') {
+;;; // Log the message
+;;; this.emitError(e.toString());
+;;; } else {
+;;; throw e;
+;;; }
+;;; }
this.txt = '';
this.result = [];
};
@@ -606,6 +663,7 @@
kukit.kssp.KssRuleProcessor = function(href) {
this.href = href;
this.loaded = false;
+ this.rules = [];
};
kukit.kssp.KssRuleProcessor.prototype.load = function() {
@@ -618,20 +676,35 @@
};
kukit.kssp.KssRuleProcessor.prototype.parse = function() {
- //Build a parser and parse the text into it
- var src = new kukit.tk.Cursor(this.txt);
- var parser = new kukit.kssp.Document(src, null, true);
- // Store event rules in the common list
- for (var i=0; i
-* Florian Schulze
-* Bal?zs Re?
+* Copyright (c) 2005-2007
+* Authors: KSS Project Contributors (see doc/CREDITS.txt)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
@@ -33,10 +30,9 @@
// register processor for type kss
this._ruleProcessorClasses['kss'] = kukit.kssp.KssRuleProcessor;
this._ruleProcessors = new Array();
- this.rules = new Array();
this.bindScheduler = new kukit.ut.SerializeScheduler();
// State vars storage. This can be used from kss via a method.
- this.statevars = {};
+ this.stateVariables = {};
// instantiate request manager
this.requestManager = new kukit.rm.RequestManager();
this.binderInfoRegistry = new kukit.er.BinderInfoRegistry();
@@ -94,12 +90,47 @@
if((nodes[i].type == 'text/css') || (nodes[i].type == 'text/kss')) {
res_type = 'kss';
}
- results[results.length] = new kukit.RuleSheetLink(nodes[i].href, res_type);
+ var newRuleLink = new kukit.RuleSheetLink(nodes[i].href, res_type);
+ results[results.length] = newRuleLink;
}
}
return results;
};
+kukit.Engine.prototype.createRuleProcessor = function(rulelink) {
+ var ruleProcessorClass = this._ruleProcessorClasses[rulelink.res_type];
+ if (ruleProcessorClass) {
+;;; var msg = "Start loading and processing " + rulelink.href;
+;;; msg = msg + " of type " + rulelink.res_type;
+;;; kukit.log(msg);
+ var ruleprocessor = new ruleProcessorClass(rulelink.href);
+ this._ruleProcessors[this._ruleProcessors.length] = ruleprocessor;
+ return ruleprocessor;
+;;; } else {
+;;; var msg = "Ignore rulesheet " + rulelink.href;
+;;; msg = msg + " of type " + rulelink.res_type;
+;;; kukit.log(msg);
+ }
+ return null;
+};
+
+
+kukit.Engine.prototype.getRules = function() {
+ var rules = new Array();
+ var ruleProcessors = this._ruleProcessors
+ for (var j=0; j
-* Florian Schulze
-* Bal?zs Re?
+* Copyright (c) 2005-2007
+* Authors: KSS Project Contributors (see doc/CREDITS.txt)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
@@ -87,7 +84,7 @@
kukit.rm.TimerQueue = function(callback) {
this.callback = callback;
this.queue = new kukit.ut.SortedQueue(this._sentSort);
- this.nr = 0;
+ this.count = 0;
};
kukit.rm.TimerQueue.prototype._sentSort = function(a, b) {
@@ -100,7 +97,7 @@
kukit.rm.TimerQueue.prototype.push = function(item) {
// push a given slot
this.queue.push(item);
- this.nr += 1;
+ this.count += 1;
};
kukit.rm.TimerQueue.prototype.pop = function(item) {
@@ -111,7 +108,7 @@
return false;
} else {
item.handled = true;
- this.nr -= 1;
+ this.count -= 1;
return true;
}
};
@@ -129,7 +126,7 @@
} else {
// call the callback for this element
item.handled = true;
- this.nr -= 1;
+ this.count -= 1;
this.callback(item);
}
}
@@ -161,11 +158,11 @@
name = null;
}
this.name = name;
- var namestr = '';
+ var nameString = '';
if (name != null) {
- namestr = '[' + name + '] ';
+ nameString = '[' + name + '] ';
}
- this.namestr = namestr;
+ this.nameString = nameString;
if (typeof(maxNr) != 'undefined' && maxNr != null) {
this.maxNr = maxNr;
}
@@ -188,11 +185,15 @@
kukit.rm.RequestManager.prototype.maxNr = 4;
;;; kukit.rm.RequestManager.prototype.getInfo = function() {
-;;; return '(RQ: ' + this.sentNr + ' OUT, ' + this.waitingQueue.size() + ' WAI)';
+;;; var msg = '(RQ: ' + this.sentNr + ' OUT, ' + this.waitingQueue.size();
+;;; msg += ' WAI)';
+;;; return msg;
;;; };
;;; kukit.rm.RequestManager.prototype.log = function(txt) {
-;;; kukit.logDebug('RequestManager ' + this.namestr + txt + ' ' + this.getInfo());
+;;; var msg = 'RequestManager ' + this.nameString + txt + ' ';
+;;; msg += this.getInfo() + '.';
+;;; kukit.logDebug(msg);
;;; };
kukit.rm.RequestManager.prototype.setSpinnerState = function(newState) {
@@ -228,7 +229,7 @@
kukit.rm.RequestManager.prototype.pushSentRequest = function(item, now) {
this.sentNr += 1;
- ;;; this.log('Notify server ' + item.url + ', rid=' + item.rid);
+;;; this.log('notifies server ' + item.url + ', rid=' + item.rid);
// Set the spinner state
this.setSpinnerState(true);
// Set the timeout
@@ -253,7 +254,7 @@
//var now = (new Date()).valueOf();
//this.log('Next timeout check in: ' + (nextWake - now));
} else {
- ;;; this.log('Timeout checking suspended until the next requests');
+;;; this.log('suspends checking timeout until the next requests');
// Set the spinner state
this.setSpinnerState(false);
}
@@ -284,7 +285,9 @@
if (waiting != null) {
// see if we can send another request in place of the received one
// request is waiting, send it.
- ;;; this.log('Dequeue server notification at ' + waiting.url + ', rid=' + waiting.rid);
+;;; var msg = 'dequeues server notification at [' + waiting.url;
+;;; msg += '], rid [' + waiting.rid + '].';
+;;; this.log(msg);
this.pushSentRequest(waiting, now);
} else {
// this.log("Request queue empty.");
@@ -298,24 +301,27 @@
kukit.rm.RequestManager.prototype.receiveItem = function(item, now) {
// calls result processing
var success = this.receivedResult(item, now);
- ;;; if (success) {
- ;;; this.log('Received result with rid=' + item.rid);
- ;;; } else {
- ;;; this.log('Received timed out result rid=' + item.rid + ', to be ignored');
- ;;; }
+;;; if (success) {
+;;; this.log('received result with rid [' + item.rid + ']');
+;;; } else {
+;;; var msg = 'received timed out result rid [' + item.rid;
+;;; msg += '], to be ignored';
+;;; this.log(msg);
+;;; }
return success;
};
kukit.rm.RequestManager.prototype.timeoutItem = function(item) {
/* Time out this item. */
- ;;; this.log('Timed out request rid=' + item.rid);
+;;; this.log('timed out request rid [' + item.rid + ']');
// Call the timeout hook on the item
item.callTimeoutHook();
};
/* request manager notification API */
-kukit.rm.RequestManager.prototype.notifyServer = function(sendHook, url, timeoutHook, timeout, now) {
+kukit.rm.RequestManager.prototype.notifyServer =
+ function(sendHook, url, timeoutHook, timeout, now) {
// url is only for the logging
// sendHook is the function that actually sends out the request.
// sendHook will be called with one parameter: the 'item' array.
@@ -325,13 +331,15 @@
// may go on or must be broken. If the return value is false, the
// results must NOT be processed: this means that we have already
// timed out the request by that time.
- // timeoutHook: can specify the timeouthook for this request. Setting it to null
+ // timeoutHook: can specify the timeouthook for this request.
+ // Setting it to null
// disables it. This will be called with the 'item' as a parameter as well.
if (typeof(timeout) == 'undefined') {
// Default value of timeout
timeout = this.sendingTimeout;
}
- var item = new kukit.rm.RequestItem(sendHook, url, timeoutHook, timeout, now);
+ var item = new kukit.rm.RequestItem(sendHook, url, timeoutHook, timeout,
+ now);
// Start timing the item immediately
this.timerQueue.push(item);
if (! this.isSentRequestQueueFull()) {
@@ -339,7 +347,9 @@
this.pushSentRequest(item, now);
} else {
this.pushWaitingRequest(item, now);
- ;;; this.log('Queue server notification at ' + item.url + ', rid=' + item.rid);
+;;; var msg = 'queues server notification at [' + item.url;
+;;; msg += '], rid [' + item.rid + ']';
+;;; this.log(msg);
}
};
Modified: kukit/kukit.js/trunk/kukit/resourcedata.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/resourcedata.js (original)
+++ kukit/kukit.js/trunk/kukit/resourcedata.js Thu Aug 16 22:32:22 2007
@@ -1,9 +1,6 @@
/*
-* Copyright (c) 2005-2006
-* Authors:
-* Godefroid Chapelle
-* Florian Schulze
-* Bal?zs Re?
+* Copyright (c) 2005-2007
+* Authors: KSS Project Contributors (see doc/CREDITS.txt)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
@@ -47,38 +44,45 @@
if (! name) {
throw 'KssSelector must have name';
}
- ;;; if (name.indexOf('@') != -1) {
- ;;; throw new kukit.err.rd.KssSelectorError('Kss selector name must not contain @: "' + name + '"');
- ;;; }
- ;;; if (id && id.indexOf('@') != -1) {
- ;;; throw new kukit.err.rd.KssSelectorError('Kss selector id must not contain @: "' + id + '"');
- ;;; }
- ;;; if (namespace && namespace.indexOf('@') != -1) {
- ;;; throw new kukit.err.rd.KssSelectorError('Kss selector namespace must not contain @: "' + namespace + '"');
- ;;; }
- ;;; if (! isEvent) {
- ;;; // method rule
- ;;; if (css != 'document' && css != 'behaviour') {
- ;;; throw new kukit.err.rd.KssSelectorError('KssSpecialSelector "' + name + '" must have one of the allowed names');
- ;;; }
- ;;; }
+;;; if (name.indexOf('@') != -1) {
+;;; var msg = 'Kss selector name must not contain @: [' + name + '].';
+;;; throw new kukit.err.rd.KssSelectorError(msg);
+;;; }
+;;; if (id && id.indexOf('@') != -1) {
+;;; var msg = 'Kss selector id must not contain @: [' + id + '].';
+;;; throw new kukit.err.rd.KssSelectorError(msg);
+;;; }
+;;; if (namespace && namespace.indexOf('@') != -1) {
+;;; var msg = 'Kss selector namespace must not contain @: [' + namespace;
+;;; msg = msg + '].';
+;;; throw new kukit.err.rd.KssSelectorError(msg);
+;;; }
+;;; if (! isEvent) {
+;;; // method rule
+;;; if (css != 'document' && css != 'behaviour') {
+;;; var msg = 'KssSpecialSelector [' + name;
+;;; msg = msg + '] must have one of the allowed names';
+;;; throw new kukit.err.rd.KssSelectorError(msg);
+;;; }
+;;; }
this.css = css;
this.name = name;
this.namespace = namespace;
- this.classname = null;
+ this.className = null;
this.id = id;
};
kukit.rd.KssSelector.prototype.setIdAndClass = function() {
// Sets up id and class on the selector, based on registration info
- this.classname = kukit.eventsGlobalRegistry.get(this.namespace, this.name).classname;
+ this.className = kukit.eventsGlobalRegistry.get(
+ this.namespace, this.name).className;
if (this.id == null) {
// singleton for class
- this.id = kukit.rd.makeId(this.namespace, this.classname);
+ this.id = kukit.rd.makeId(this.namespace, this.className);
}
// Also set the merge id. The rules with the same merge
// id should be merged on the same node.
- this.mergeid = kukit.rd.makeMergeId(this.id, this.namespace, this.name);
+ this.mergeId = kukit.rd.makeMergeId(this.id, this.namespace, this.name);
};
/*
@@ -98,50 +102,61 @@
// key: value;
this.txt = txt;
};
+
kukit.rd.KssTextValue.prototype.isMethod = false;
+
kukit.rd.KssTextValue.prototype.check = function(registry) {
// use the IdentityPP provider.
this.pprovider = new (registry.get(''))();
};
-kukit.rd.KssTextValue.prototype.evaluate = function(parms, key, node, defaultparms) {
- // For normal string parameters, this would return the string itself.
+
+kukit.rd.KssTextValue.prototype.evaluate =
+ function(parms, key, node, defaultParameters) {
+
+ // For normal string parms, this would return the string itself.
// In other execution contexts (like kssSelector, for example) this can
// do something else.
- parms[key] = this.pprovider.eval([this.txt], node, defaultparms);
+ parms[key] = this.pprovider.eval([this.txt], node, defaultParameters);
};
/*
* class KssTextValue
*/
-kukit.rd.KssMethodValue = function(methodname, args) {
+kukit.rd.KssMethodValue = function(methodName, args) {
// A method parameter in the format
- // key: methodname(v1, v2, ... vn);
- this.methodname = methodname;
+ // key: methodName(v1, v2, ... vn);
+ this.methodName = methodName;
this.args = args;
};
+
kukit.rd.KssMethodValue.prototype.isMethod = true;
+
kukit.rd.KssMethodValue.prototype.check = function(registry) {
// Check syntax
- var f = registry.get(this.methodname);
+ var f = registry.get(this.methodName);
this.pprovider = new f();
- ;;; this.pprovider.check(this.args);
+;;; this.pprovider.check(this.args);
};
-kukit.rd.KssMethodValue.prototype.evaluate = function(parms, key, node, defaultparms) {
+kukit.rd.KssMethodValue.prototype.evaluate =
+ function(parms, key, node, defaultParameters) {
+
// Evaluate into parms.
- parms[key] = this.pprovider.eval(this.args, node, defaultparms);
+ parms[key] = this.pprovider.eval(this.args, node, defaultParameters);
};
/*
* class KssPseudoValue
*/
-kukit.rd.KssPseudoValue = function(methodname, args) {
+kukit.rd.KssPseudoValue = function(methodName, args) {
// A method parameter in the format
- // methodname(v1)
- this.methodname = methodname;
+ // methodName(v1)
+ this.methodName = methodName;
this.args = args;
};
+
kukit.rd.KssPseudoValue.prototype.isMethod = true;
+
kukit.rd.KssPseudoValue.prototype.check = function() {
};
@@ -150,73 +165,83 @@
/*
* class EventRule
*/
-kukit.rd.EventRule = function(kss_selector, parms, actions) {
+kukit.rd.EventRule = function(kssSelector, parms, actions) {
if (typeof(parms) == 'undefined') {
// called for merging clone
- this.kss_selector = kss_selector;
+ this.kssSelector = kssSelector;
} else {
- this.nr = kukit.rd.EventRuleNr;
- this.mergednr = null;
- kukit.rd.EventRuleNr = this.nr + 1;
- ;;; var namestr;
- ;;; if (kss_selector.namespace) {
- ;;; namestr = kss_selector.namespace + '-' + kss_selector.name;
- ;;; } else {
- ;;; namestr = kss_selector.name;
- ;;; }
- ;;; kukit.logDebug("EventRule #" + this.getNr() + ": " + kss_selector.css + ' EVENT=' + namestr);
- this.kss_selector = kss_selector;
+ this.index = kukit.rd.EventRuleNr;
+ this.mergedIndex = null;
+ kukit.rd.EventRuleNr = this.index + 1;
+;;; var namestr;
+;;; if (kssSelector.namespace) {
+;;; namestr = kssSelector.namespace + '-' + kssSelector.name;
+;;; } else {
+;;; namestr = kssSelector.name;
+;;; }
+;;; var msg = 'EventRule #' + this.getIndex() + ': ';
+;;; msg = msg + kssSelector.css + ' EVENT=' + namestr;
+;;; kukit.logDebug(msg);
+ this.kssSelector = kssSelector;
this.parms = parms;
this.actions = actions;
}
};
-kukit.rd.EventRule.prototype.getNr = function() {
- if (this.mergednr) {
- return this.mergednr;
+kukit.rd.EventRule.prototype.getIndex = function() {
+ if (this.mergedIndex) {
+ return this.mergedIndex;
} else {
- return this.nr;
+ return this.index;
}
};
-kukit.rd.EventRule.prototype.mergeForSelectedNodes = function(ruletable, phase, in_nodes) {
- // Select all nodes within the in_nodes for phase==2. (or undefined on initial node, phase==1)
+kukit.rd.EventRule.prototype.mergeForSelectedNodes =
+ function(ruletable, phase, inNodes) {
+
+ // Select all nodes within the inNodes for phase==2.
+ // (or undefined on initial node, phase==1)
// Merge itself to the selected nodes.
- if (this.kss_selector.isEventSelector) {
- var nodes = kukit.dom.cssQuery(this.kss_selector.css, in_nodes);
+ if (this.kssSelector.isEventSelector) {
+ var nodes = kukit.dom.cssQuery(this.kssSelector.css, inNodes);
var counter = 0;
for (var y=0; y < nodes.length; y++)
{
var node = nodes[y];
// XXX never rebind to any node again!
- // this compensates that cssQuery is returning results out of the subtree
+ // this compensates that cssQuery is returning
+ // results out of the subtree
if (typeof(node._kukitmark) == 'undefined') {
ruletable.add(node, this);
counter += 1;
}
}
- ;;; if (counter > 0) {
- ;;; kukit.logDebug('EventRule #' + this.getNr() + ' mergeid ' + this.kss_selector.mergeid + ' selected ' + counter + ' nodes');
- ;;; }
- } else if (typeof(in_nodes) == 'undefined') {
+;;; if (counter > 0) {
+;;; var msg = 'EventRule [#' + this.getIndex();
+;;; msg = msg + '-' + this.kssSelector.mergeId;
+;;; msg = msg + '] selected ' + counter + ' nodes.';
+;;; kukit.logDebug(msg);
+;;; }
+ } else if (typeof(inNodes) == 'undefined') {
// Method selector. They only need to be handled on the initial
- // pageload, when the in_nodes parameter is ommitted.
+ // pageload, when the inNodes parameter is ommitted.
kukit.engine.documentRules.add(this);
}
};
kukit.rd.EventRule.prototype.getBinderInfo = function() {
// Gets the event instance for the rule.
- return kukit.engine.binderInfoRegistry.getOrCreateBinderInfo(this.kss_selector.id, this.kss_selector.classname,
- this.kss_selector.namespace);
+ return kukit.engine.binderInfoRegistry.getOrCreateBinderInfo(
+ this.kssSelector.id, this.kssSelector.className,
+ this.kssSelector.namespace);
};
/*
* bind(node) : calls binder hook on event instance.
* These hooks are tried in order, if succeeds it must return true:
*
-* __bind__(name, parms, func_to_bind, node, eventrule)
-* __bind___(parms, func_to_bind, node, eventrule)
+* __bind__(name, parms, func_to_bind, node, eventRule)
+* __bind___(parms, func_to_bind, node, eventRule)
*
* If none succeeds is an error.
*
@@ -225,13 +250,13 @@
kukit.rd.EventRule.prototype.bind = function(node) {
// Creation of the binding oper
var oper = new kukit.op.Oper();
- var binderinfo = this.getBinderInfo();
+ var binderInfo = this.getBinderInfo();
oper.node = node;
- oper.eventrule = this;
- oper.binderinstance = binderinfo.binderinstance;
+ oper.eventRule = this;
+ oper.binderInstance = binderInfo.binderInstance;
oper.parms = this.parms;
// mark on the instance as bound
- binderinfo.bindOper(oper);
+ binderInfo.bindOper(oper);
};
@@ -240,62 +265,65 @@
*/
kukit.rd.EventRule.prototype.isMerged = function() {
- return (this.mergednr != null);
+ return (this.mergedIndex != null);
};
kukit.rd.EventRule.prototype.cloneForMerge = function() {
// Do not touch ourselves, make a new copy for the merge.
- var merged = new kukit.rd.EventRule(this.kss_selector);
+ var merged = new kukit.rd.EventRule(this.kssSelector);
merged.actions = new kukit.rd.ActionSet();
merged.parms = {};
- merged.mergednr = 'X';
+ merged.mergedIndex = 'X';
merged.merge(this);
- merged.mergednr = this.getNr();
+ merged.mergedIndex = this.getIndex();
return merged;
};
kukit.rd.EventRule.prototype.merge = function(other) {
- ;;; if (! this.isMerged()) {
- ;;; throw "Cannot merge into a genuine event rule";
- ;;; }
- ;;; if (this.kss_selector.isEventSelector) {
- ;;; if (this.kss_selector.id != other.kss_selector.id) {
- ;;; throw "Differing kss selector ids in event rule merge";
- ;;; }
- ;;; if (this.kss_selector.classname != other.kss_selector.classname) {
- ;;; throw "Differing kss selector classes in event rule merge";
- ;;; }
- ;;; }
- ;;; if (this.kss_selector.name != other.kss_selector.name) {
- ;;; throw "Differing kss selector names in event rule merge";
- ;;; }
- this.mergednr = this.mergednr + ',' + other.getNr();
+;;; if (! this.isMerged()) {
+;;; throw 'Cannot merge into a genuine event rule';
+;;; }
+;;; if (this.kssSelector.isEventSelector) {
+;;; if (this.kssSelector.id != other.kssSelector.id) {
+;;; throw 'Differing kss selector ids in event rule merge';
+;;; }
+;;; if (this.kssSelector.className != other.kssSelector.className) {
+;;; throw 'Differing kss selector classes in event rule merge';
+;;; }
+;;; }
+;;; if (this.kssSelector.name != other.kssSelector.name) {
+;;; throw 'Differing kss selector names in event rule merge';
+;;; }
+ this.mergedIndex = this.mergedIndex + ',' + other.getIndex();
for (var key in other.parms) {
this.parms[key] = other.parms[key];
}
this.actions.merge(other.actions);
- ;;; if (this.mergednr.substr(0, 1) != 'X')
- ;;; // ignore initial clone-merge
- ;;; kukit.logDebug('Merged rule ' + this.mergednr + ' mergeid ' + this.kss_selector.mergeid);
+;;; if (this.mergedIndex.substr(0, 1) != 'X') {
+;;; // ignore initial clone-merge
+;;; var msg = 'Merged rule [' + this.mergedIndex;
+;;; msg = msg + '-' + this.kssSelector.mergeId + '].';
+;;; kukit.logDebug(msg);
+;;; }
};
-kukit.rd.EventRule.prototype.mergeIntoDict = function(dict, key, eventrule) {
+kukit.rd.EventRule.prototype.mergeIntoDict = function(dict, key, eventRule) {
// Merge into the given dictionary by given key.
// If possible, store the genuine rule first - if not,
// clone it and do a merge. Never destroy the genuine
// rules, clone first. This is for efficiency.
- var mergedrule = dict[key];
- if (typeof(mergedrule) == 'undefined') {
+ var mergedRule = dict[key];
+ if (typeof(mergedRule) == 'undefined') {
// there was no rule
- dict[key] = eventrule;
+ dict[key] = eventRule;
} else {
// we have to merge the rule
- if (! mergedrule.isMerged()) {
+ if (! mergedRule.isMerged()) {
// Make sure genuine instances are replaced
- mergedrule = mergedrule.cloneForMerge();
- dict[key] = mergedrule;
+ mergedRule = mergedRule.cloneForMerge();
+ dict[key] = mergedRule;
}
- mergedrule.merge(eventrule);
+ mergedRule.merge(eventRule);
}
};
@@ -322,8 +350,10 @@
// new action
action = new kukit.rd.Action();
this.content[key] = action;
- } else {
- ;;; kukit.E = new kukit.err.rd.RuleMergeError('Cannot action-delete unexisting action, "' + key + '"');
+ } else {
+;;; var msg = 'Cannot action-delete unexisting action, [';
+;;; msg = msg + key + '].';
+;;; kukit.E = new kukit.err.rd.RuleMergeError(msg);
throw kukit.E;
}
}
@@ -346,12 +376,12 @@
}
}
// Execute the default action in case of there is one but there were no
- // parameters so it was actually not entered as an action object
+ // parms so it was actually not entered as an action object
// otherwise, it would have been executed from action.execute already
if (typeof(this.content['default']) == 'undefined') {
// this is conditional: if there is no default method, it's skipped.
- var name = oper.eventrule.kss_selector.name;
- // Execution with no parameters. (XXX ?)
+ var name = oper.eventRule.kssSelector.name;
+ // Execution with no parms. (XXX ?)
oper = oper.clone({'parms': {}});
oper.executeDefaultAction(name, true);
}
@@ -377,9 +407,9 @@
kukit.rd.ActionSet.prototype.deleteAction = function(name) {
var action = this.content[name];
- ;;; if (typeof(action) == 'undefined') {
- ;;; throw('Action "' + name + '" does not exist and cannot be deleted.');
- ;;; }
+;;; if (typeof(action) == 'undefined') {
+;;; throw('Action [' + name + '] does not exist and cannot be deleted.');
+;;; }
delete this.content[name];
};
@@ -405,38 +435,57 @@
};
kukit.rd.Action.prototype.setName = function(name) {
- ;;; if (this.name != null && this.name != name) {
- ;;; throw new kukit.err.rd.RuleMergeError('Error overriding action name "' + this.name + '" to "' + name + '" (Unmatching action names at merge?)');
- ;;; }
+;;; if (this.name != null && this.name != name) {
+;;; var msg = 'Error overriding action name [' + this.name;
+;;; msg = msg + '] to [' + name + '] (Unmatching action names at merge?)';
+;;; throw new kukit.err.rd.RuleMergeError(msg);
+;;; }
this.name = name;
if (name == 'default') {
- ;;; if (this.type != null && this.type != 'D') {
- ;;; throw new kukit.err.rd.RuleMergeError('Error setting action to default on action "' + this.name + '", current type "' + this.type + '"');
- ;;; }
+;;; if (this.type != null && this.type != 'D') {
+;;; var msg = 'Error setting action to default on action [' + this.name;
+;;; msg = msg + '], current type [' + this.type + '].';
+;;; throw new kukit.err.rd.RuleMergeError(msg);
+;;; }
this.setType('D');
}
};
kukit.rd.Action.prototype.setType = function(type) {
- // Possible types:
- // S = server
- // C = client
- // E = error / client
- // D = default (unsettable)
- // X = cancel action
- ;;; if ((type != 'S' && type != 'C' && type != 'E' && type != 'X') || (this.type != null && this.type != type)) {
- ;;; throw new kukit.err.rd.RuleMergeError('Error setting action type on action "' + this.name + '" from "' + this.type + '" to "' + type + '" (Attempt to merge client, server or error actions?)');
- ;;; }
- ;;; if (this.error != null && this.type != 'S') {
- ;;; throw new kukit.err.rd.RuleMergeError('Error setting action error handler on action "' + this.name + '", this is only allowed on server actions.');
- ;;; }
+ // Allowed types:
+ //
+ // S = server
+ // C = client
+ // E = error / client
+ // D = default (unsettable)
+ // X = cancel action
+;;; var checkType = function(type) {
+;;; var isNotServer = type != 'S';
+;;; var isNotClient = type != 'C';
+;;; var isNotError = type != 'E';
+;;; var isNotCancel = type != 'X';
+;;; return isNotServer && isNotClient && isNotError && isNotCancel;
+;;; };
+;;; if (checkType(type) || (this.type != null && this.type != type)) {
+;;; var msg = 'Error setting action type on action [' + this.name;
+;;; msg = msg + '] from [' + this.type + '] to [' + type;
+;;; msg = msg + '] (Attempt to merge client, server or error actions ?)';
+;;; throw new kukit.err.rd.RuleMergeError(msg);
+;;; }
+;;; if (this.error != null && this.type != 'S') {
+;;; var msg = 'Error setting action error handler on action [' + this.name;
+;;; msg = msg + '], this is only allowed on server actions.';
+;;; throw new kukit.err.rd.RuleMergeError(msg);
+;;; }
this.type = type;
};
kukit.rd.Action.prototype.setError = function(error) {
- ;;; if (this.type != null && this.type != 'S') {
- ;;; throw new kukit.err.rd.RuleMergeError('Error setting action error handler on action "' + this.name + '", this is only allowed on server actions.');
- ;;; }
+;;; if (this.type != null && this.type != 'S') {
+;;; var msg = 'Error setting action error handler on action [' + this.name;
+;;; msg = msg + '], this is only allowed on server actions.';
+;;; throw new kukit.err.rd.RuleMergeError(msg);
+;;; }
this.error = error;
};
@@ -458,32 +507,34 @@
};
kukit.rd.Action.prototype.makeActionOper = function(oper) {
- // Fill the completed action parameters, based on the node
- // The kssXxx parameters, reserved for the action, are
+ // Fill the completed action parms, based on the node
+ // The kssXxx parms, reserved for the action, are
// handled as appropriate.
// A cloned oper is returned.
var parms = {};
- var aparms = {};
- // Make sure we have defaultparms on oper
- if (typeof(oper.defaultparms) == 'undefined') {
- oper.defaultparms = {};
+ var kssParms = {};
+ // Make sure we have defaultParameters on oper
+ if (typeof(oper.defaultParameters) == 'undefined') {
+ oper.defaultParameters = {};
}
for (var key in this.parms) {
var kssvalue = this.parms[key];
if (key.match(/^kss/)) {
- // kssXxx parameters are separated to aparms.
- kssvalue.evaluate(aparms, key, oper.node, oper.defaultparms);
+ // kssXxx parms are separated to kssParms.
+ kssvalue.evaluate(kssParms, key, oper.node,
+ oper.defaultParameters);
} else {
- // evaluate the method parameters into parms
- kssvalue.evaluate(parms, key, oper.node, oper.defaultparms);
+ // evaluate the method parms into parms
+ kssvalue.evaluate(parms, key, oper.node,
+ oper.defaultParameters);
}
}
- var aoper = oper.clone({
+ var anOper = oper.clone({
'parms': parms,
- 'aparms': aparms,
+ 'kssParms': kssParms,
'action': this
});
- return aoper;
+ return anOper;
};
kukit.rd.Action.prototype.execute = function(oper) {
@@ -491,7 +542,7 @@
switch (this.type) {
case 'D': {
// Default action.
- var name = oper.eventrule.kss_selector.name;
+ var name = oper.eventRule.kssSelector.name;
oper.executeDefaultAction(name);
} break;
case 'S': {
@@ -566,7 +617,7 @@
* important. The event class must be the same with merge
* rules (within the id).
*
-* To summarize the procedure, each eventrule is added with
+* To summarize the procedure, each eventRule is added with
* all the nodes that are selected by it. Nothing is executed,
* only merges are done at this time. Finally, all binds are
* done in the second path.
@@ -583,16 +634,17 @@
this.nodes = {};
};
-kukit.rd.RuleTable.prototype.add = function(node, eventrule) {
+kukit.rd.RuleTable.prototype.add = function(node, eventRule) {
// look up node
- var nodehash = kukit.rd.hashnode(node);
+ var nodehash = kukit.rd.hashNode(node);
var nodeval = this.nodes[nodehash];
if (typeof(nodeval) == 'undefined') {
nodeval = {'node': node, 'val': {}};
this.nodes[nodehash] = nodeval;
}
// Merge into the dict
- eventrule.mergeIntoDict(nodeval.val, eventrule.kss_selector.mergeid, eventrule);
+ eventRule.mergeIntoDict(
+ nodeval.val, eventRule.kssSelector.mergeId, eventRule);
};
kukit.rd.RuleTable.prototype.bindall = function(phase) {
@@ -603,24 +655,24 @@
// XXX Mark the node, disabling rebinding in a second round
nodeval.node._kukitmark = phase;
for (var id in nodeval.val) {
- var eventrule = nodeval.val[id];
- eventrule.bind(nodeval.node);
+ var eventRule = nodeval.val[id];
+ eventRule.bind(nodeval.node);
}
counter += 1;
}
- ;;; kukit.logDebug('Binding to ' + counter + ' nodes in grand total');
+;;; kukit.logDebug(counter + ' nodes bound in grand total.');
// Execute the load actions in a deferred manner
var loadactions = this.loadScheduler;
if (! loadactions.empty()) {
- ;;; kukit.logDebug('Start executing delayed load actions');
- var nr = loadactions.executeAll();
- ;;; kukit.logDebug('Executed ' + nr + ' load actions');
+;;; kukit.logDebug('Delayed load actions execution starts.');
+ var count = loadactions.executeAll();
+;;; kukit.logDebug(count + ' load actions executed.');
}
};
kukit.rd.uid = 0;
-kukit.rd.hashnode = function(node) {
+kukit.rd.hashNode = function(node) {
// It is, generally, not possible to use a node as a key.
// However we try to set this right.
// We generate an uniqueID on the node. This does not work
@@ -652,44 +704,46 @@
this.content['behaviour'] = {};
};
-kukit.rd.MethodTable.prototype.add = function(eventrule) {
+kukit.rd.MethodTable.prototype.add = function(eventRule) {
// Get the entry by the type which is now at css
- var category = eventrule.kss_selector.css;
+ var category = eventRule.kssSelector.css;
var dict = this.content[category];
- ;;; if (typeof(dict) == 'undefined') {
- ;;; throw 'Unknown method rule category "' + category + '"';
- ;;; }
+;;; if (typeof(dict) == 'undefined') {
+;;; throw 'Unknown method rule category [' + category + '].';
+;;; }
// Merge into the corresponding category
- eventrule.mergeIntoDict(dict, eventrule.kss_selector.mergeid, eventrule);
+ eventRule.mergeIntoDict(dict, eventRule.kssSelector.mergeId, eventRule);
};
-kukit.rd.MethodTable.prototype.getMergedRule = function(category, name, binderinstance) {
+kukit.rd.MethodTable.prototype.getMergedRule =
+ function(category, name, binderInstance) {
+
// Returns the rule for a given event instance,
// Get the entry by category (= document or behaviour)
var dict = this.content[category];
- ;;; if (typeof(dict) == 'undefined') {
- ;;; throw 'Unknown method rule category "' + category + '"';
- ;;; }
+;;; if (typeof(dict) == 'undefined') {
+;;; throw 'Unknown method rule category [' + category + '].';
+;;; }
// look up the rule
- var namespace = binderinstance.__event_namespace__;
- var id = binderinstance.__binder_id__;
- var mergeid = kukit.rd.makeMergeId(id, namespace, name);
- var mergedrule = dict[mergeid];
- if (typeof(mergedrule) == 'undefined') {
+ var namespace = binderInstance.__eventNamespace__;
+ var id = binderInstance.__binderId__;
+ var mergeId = kukit.rd.makeMergeId(id, namespace, name);
+ var mergedRule = dict[mergeId];
+ if (typeof(mergedRule) == 'undefined') {
// no error, just return null.
- mergedrule = null;
+ mergedRule = null;
}
- return mergedrule;
+ return mergedRule;
};
kukit.rd.MethodTable.prototype.bindall = function() {
// bind document events
- var documentrules = this.content['document'];
+ var documentRules = this.content['document'];
var counter = 0;
- for (var mergeid in documentrules) {
+ for (var mergeId in documentRules) {
// bind to null as a node
- documentrules[mergeid].bind(null);
+ documentRules[mergeId].bind(null);
counter += 1;
}
- ;;; kukit.logDebug('Binding ' + counter + ' special rules in grand total');
+;;; kukit.logDebug(counter + ' special rules bound in grand total.');
};
Modified: kukit/kukit.js/trunk/kukit/selectorreg.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/selectorreg.js (original)
+++ kukit/kukit.js/trunk/kukit/selectorreg.js Thu Aug 16 22:32:22 2007
@@ -1,6 +1,6 @@
/*
-* Copyright (c) 2005-2006
-# Authors: KSS Project Contributors (see docs/CREDITS.txt)
+* Copyright (c) 2005-2007
+* Authors: KSS Project Contributors (see doc/CREDITS.txt)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
@@ -21,29 +21,25 @@
// Registry of the pprovider functions for selecting
-kukit.sr.pproviderSelRegistry = new kukit.pr.ParamProviderRegistry();
+kukit.sr.pproviderSelRegistry = new kukit.pr.ValueProviderRegistry();
// this will provide an arbitrary selector, and is designed to
// be used with the makeAnyPP factory function.
kukit.sr.AnyPP = function() {};
kukit.sr.AnyPP.prototype = {
- /*
- ;;; */
check: function(args) {
// check does not need to be used here actually.
- if (args.length != 1) {
- throw 'internal error, xxxselector() needs 1 argument';
- }
+;;; if (args.length != 1) {
+;;; throw 'internal error, xxxselector() needs 1 argument';
+;;; }
},
- /*
- */
- eval: function(args, node, defaultparms) {
+ eval: function(args, node, defaultParameters) {
var f = kukit.selectorTypesGlobalRegistry.get(this.selector_type);
// We don't have orignode if we evaluate from here, consequently
// the orignode parameter cannot be used from selectors. We pass
// node just to be sure...
- return f(args[0], node, defaultparms, node);
+ return f(args[0], node, defaultParameters, node);
}
};
@@ -52,7 +48,7 @@
kukit.sr.makeAnyPP = function(selector_type) {
var pp = function () {};
pp.prototype.eval = kukit.sr.AnyPP.prototype.eval;
- ;;; pp.prototype.check = kukit.sr.AnyPP.prototype.check;
+;;; pp.prototype.check = kukit.sr.AnyPP.prototype.check;
pp.prototype.selector_type = selector_type;
return pp;
};
@@ -60,20 +56,16 @@
// this can be used to pass a node programmatically
kukit.sr.PassnodePP = function() {};
kukit.sr.PassnodePP.prototype = {
- /*
- ;;; */
check: function(args) {
- if (args.length != 1) {
- throw 'passnode selector method needs 1 argument';
- }
+;;; if (args.length != 1) {
+;;; throw 'passnode selector method needs 1 argument';
+;;; }
},
- /*
- */
- eval: function(args, node, defaultparms) {
- var value = defaultparms[args[0]];
+ eval: function(args, node, defaultParameters) {
+ var value = defaultParameters[args[0]];
if (typeof(value) == 'undefined') {
// notfound arguments will get null
- ;;; kukit.E = 'Nonexistent default parm "'+ key +'"';
+;;; kukit.E = 'Nonexistent default parm "'+ key +'"';
throw kukit.E;
}
nodes = [value];
@@ -103,11 +95,11 @@
if (typeof(func) == 'undefined') {
throw 'Func is mandatory.';
}
- ;;; if (this.mapping[name]) {
- ;;; // Do not allow redefinition
- ;;; kukit.logError('Error : redefinition attempt of selector ' + name);
- ;;; return;
- ;;; }
+;;; if (this.mapping[name]) {
+;;; // Do not allow redefinition
+;;; kukit.logError('Error : redefinition attempt of selector ' + name);
+;;; return;
+;;; }
this.mapping[name] = func;
// Also register the selector param provider
var pp = kukit.sr.makeAnyPP(name);
@@ -121,9 +113,9 @@
name = this.defaultSelectorType;
}
var result = this.mapping[name];
- ;;; if (typeof(result) == 'undefined') {
- ;;; throw 'Unknown selector type "' + name + '"';
- ;;; }
+;;; if (typeof(result) == 'undefined') {
+;;; throw 'Unknown selector type "' + name + '"';
+;;; }
return result;
};
Modified: kukit/kukit.js/trunk/kukit/serveraction.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/serveraction.js (original)
+++ kukit/kukit.js/trunk/kukit/serveraction.js Thu Aug 16 22:32:22 2007
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2005-2007
-* Authors: KSS Project Contributors (see docs/CREDITS.txt)
+* Authors: KSS Project Contributors (see doc/CREDITS.txt)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
@@ -20,7 +20,7 @@
kukit.sa = {};
kukit.sa.ServerAction = function(name, oper) {
- this.url = oper.aparms.kssUrl;
+ this.url = oper.kssParms.kssUrl;
if (typeof(this.url) == 'undefined') {
this.url = name;
}
@@ -49,7 +49,7 @@
}
};
-// Backparms can be used on command execution.
+// Backparameters can be used on command execution.
kukit.sa.ServerAction.prototype.notifyServer = function() {
var self = this;
var sendHook = function(queueItem) {
@@ -77,13 +77,13 @@
for (var key in this.oper.parms) {
query.appendElem(key, this.oper.parms[key]);
}
- // also add the parameters that result from submitting an entire form.
+ // also add the parms that result from submitting an entire form.
// This is, unlike the normal parms, is a list. Keys and values are
// added at the end of the query, without mangling names.
- var formsubmit = this.oper.aparms.kssSubmitForm;
- if (formsubmit) {
- for (var i=0; i= this.result.length) {
- ;;; kukit.E = 'Expected [' + symbol + ']';
+;;; kukit.E = 'Missing token : [' + symbol + '].';
this.emitError(kukit.E);
} else if (this.result[i].symbol != symbol) {
- ;;; kukit.E = 'Expected [' + symbol + '], found [' + this.result[i].symbol + ']';
+;;; kukit.E = 'Unexpected token : [' + this.result[i].symbol;
+;;; kukit.E += '] found, [' + symbol + '] was expected.';
this.emitError(kukit.E);
}
} else {
if (i >= this.result.length) {
- ;;; kukit.E = 'Expected token';
+;;; kukit.E = 'Missing token.';
this.emitError(kukit.E);
}
}
@@ -125,22 +125,26 @@
cursor.next += 1;
};
-kukit.tk._ParserBase.prototype.ifToken = function(cursor, token1, token2, token3, token4) {
+kukit.tk._ParserBase.prototype.ifToken =
+ function(cursor, token1, token2, token3, token4) {
var i = cursor.next;
- return (! (i >= this.result.length || this.result[i].symbol != token1.prototype.symbol
- && (!token2 || this.result[i].symbol != token2.prototype.symbol
- && (!token3 || this.result[i].symbol != token3.prototype.symbol
- && (!token4 || this.result[i].symbol != token4.prototype.symbol)))));
+ return (! (i >= this.result.length ||
+ this.result[i].symbol != token1.prototype.symbol
+ && (!token2 || this.result[i].symbol != token2.prototype.symbol
+ && (!token3 || this.result[i].symbol != token3.prototype.symbol
+ && (!token4 || this.result[i].symbol != token4.prototype.symbol)))));
};
-kukit.tk._ParserBase.prototype.digestTxt = function(cursor, token1, token2, token3, token4) {
+kukit.tk._ParserBase.prototype.digestTxt =
+ function(cursor, token1, token2, token3, token4) {
// digests the txt from the tokens, ignores given token
// plus whitespace removal
this.digestExactTxt(cursor, token1, token2, token3, token4);
cursor.txt = this.dewhitespaceAndTrim(cursor.txt);
};
-kukit.tk._ParserBase.prototype.digestExactTxt = function(cursor, token1, token2, token3, token4) {
+kukit.tk._ParserBase.prototype.digestExactTxt =
+ function(cursor, token1, token2, token3, token4) {
// digests the txt from the tokens, ignores given token
// exact value: no whitespace removal
var result = '';
@@ -193,7 +197,9 @@
this.src = src;
this.startpos = src.pos;
if (src.text.substr(src.pos, txt.length) != txt) {
- ;;; kukit.E = 'Expected "' + txt + '", found "' + src.text.substr(src.pos, txt.length) + '"';
+;;; kukit.E = 'Unexpected token : [';
+;;; kukit.E += src.text.substr(src.pos, txt.length) + '] found,';
+;;; kukit.E += ' [' + txt + '] was expected.';
this.emitError(kukit.E);
} else {
src.pos += txt.length;
Modified: kukit/kukit.js/trunk/kukit/utils.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/utils.js (original)
+++ kukit/kukit.js/trunk/kukit/utils.js Thu Aug 16 22:32:22 2007
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2005-2007
-* Authors: KSS Project Contributors (see docs/CREDITS.txt)
+* Authors: KSS Project Contributors (see doc/CREDITS.txt)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
@@ -52,15 +52,18 @@
// Browser identification. We need these switches only at the moment.
try {
- kukit.HAVE_SAFARI = navigator.vendor && navigator.vendor.indexOf('Apple') != -1;
+ kukit.HAVE_SAFARI = navigator.vendor &&
+ navigator.vendor.indexOf('Apple') != -1;
kukit.HAVE_IE = eval("_SARISSA_IS_IE");
} catch (e) {}
;;; // Activation of extra logging panel: if necessary
;;; // this allows to start the logging panel from the browser with
-;;; // javascript:kukit.showlog();
-;;; kukit.showlog = function() {
-;;; kukit.logWarning('Logging is on the console: request to show logging pane ignored');
+;;; // javascript:kukit.showLog();
+;;; kukit.showLog = function() {
+;;; var msg = 'Logging is on the console: request to show logging pane';
+;;; msg += ' ignored.';
+;;; kukit.logWarning(msg);
;;; };
// We want a way of knowing if Firebug is available :
@@ -73,7 +76,16 @@
kukit.hasFirebug = false;
;;; // check whether the logging stuff of Firebug is available
-;;; if (typeof kukit.log == 'undefined' && typeof console != 'undefined' && typeof console.log != 'undefined' && typeof console.debug != 'undefined' && typeof console.error != 'undefined' && typeof console.warn != 'undefined') {
+;;; kukit.hasFirebug = function() {
+;;; var result = typeof kukit.log == 'undefined';
+;;; result = result && typeof console != 'undefined';
+;;; result = result && typeof console.log != 'undefined';
+;;; result = result && typeof console.debug != 'undefined';
+;;; result = result && typeof console.error != 'undefined';
+;;; result = result && typeof console.warn != 'undefined';
+;;; return result;
+;;; }
+;;; if (kukit.hasFirebug()) {
;;; kukit.log = console.log;
;;; kukit.logDebug = console.debug;
;;; kukit.logFatal = console.error;
@@ -83,23 +95,36 @@
;;; }
;;; // check whether the logging stuff of MochiKit is available
-;;; if (typeof kukit.log == 'undefined' && typeof MochiKit != 'undefined' && typeof MochiKit.Logging != 'undefined' && typeof MochiKit.Logging.log != 'undefined') {
+;;; kukit.hasMochiKit = function() {
+;;; var result = typeof kukit.log == 'undefined';
+;;; result = result && typeof MochiKit != 'undefined';
+;;; result = result && typeof MochiKit.Logging != 'undefined';
+;;; result = result && typeof MochiKit.Logging.log != 'undefined';
+;;; return result;
+;;; }
+;;; if (kukit.hasMochiKit()) {
;;; kukit.log = MochiKit.Logging.log;
;;; kukit.logError = MochiKit.Logging.logError;
;;; kukit.logDebug = MochiKit.Logging.logDebug;
;;; kukit.logFatal = MochiKit.Logging.logFatal;
;;; kukit.logWarning = MochiKit.Logging.logWarning;
;;; // make convenience url
-;;; // javascript:kukit.showlog();
+;;; // javascript:kukit.showLog();
;;; // instead of the need to say
;;; // javascript:void(createLoggingPane(true));
-;;; kukit.showlog = function() {
+;;; kukit.showLog = function() {
;;; createLoggingPane(true);
;;; };
;;; }
;;; // check whether the logging stuff of Safari is available
-;;; if (typeof kukit.log == 'undefined' && typeof console != 'undefined' && typeof console.log != 'undefined') {
+;;; kukit.hasSafari = function() {
+;;; var result = typeof kukit.log == 'undefined';
+;;; result = result && typeof console != 'undefined';
+;;; result = result && typeof console.log != 'undefined';
+;;; return result;
+;;; }
+;;; if (kukit.hasSafari()) {
;;; kukit.log = function(str) { console.log('INFO: '+str); };
;;; kukit.logError = function(str) { console.log('ERROR: '+str); };
;;; kukit.logDebug = function(str) { console.log('DEBUG: '+str); };
@@ -117,7 +142,7 @@
;;; }
// log a startup message
-;;; kukit.log('Initializing kss');
+;;; kukit.log('Loading KSS engine.');
/* utilities */
@@ -159,10 +184,12 @@
* class SortedQueue
*/
kukit.ut.SortedQueue = function (comparefunc) {
- // comparefunc(left, right) determines the order by returning -1 if left should
- // occur before right, +1 if left should occur after right or
- // 0 if left and right have no preference as to order.
- // If comparefunc is not specified or is undefined, the default order specified by < used.
+ // comparefunc(left, right) determines the order by returning
+ // -1 if left should occur before right,
+ // +1 if left should occur after right or
+ // 0 if left and right have no preference as to order.
+ // If comparefunc is not specified or is undefined,
+ // the default order specified by < used.
if (comparefunc) {
this.comparefunc = comparefunc;
}
@@ -186,7 +213,8 @@
kukit.ut.SortedQueue.prototype.push = function(obj) {
// Find the position of the object.
var i = 0;
- while (i < this.elements.length && this.comparefunc(this.elements[i], obj) == -1) {
+ var length = this.elements.length;
+ while (i < length && this.comparefunc(this.elements[i], obj) == -1) {
i ++;
}
// and insert it there
@@ -222,7 +250,8 @@
kukit.ut.evalBool = function(value, errname) {
if (value == 'true' || value == 'True' || value == '1') {
value = true;
- } else if (value == 'false' || value == 'False' || value == '0' || value == '') {
+ } else if (value == 'false' || value == 'False' || value == '0'
+ || value == '') {
value = false;
;;; } else {
;;; throw 'Bad boolean value "' + value + '" ' + errname;
@@ -274,7 +303,8 @@
kukit.ut.TimerCounter.prototype.start = function() {
if (this.timer) {
- ;;; kukit.E = 'Timer already started.';
+;;; kukit.E = 'Timer already started.';
+
throw kukit.E;
}
var self = this;
@@ -389,16 +419,18 @@
if (! item) {
break;
}
- ;;; kukit.log('Starting ' + item.remark);
- ;;; var ts_start = (new Date()).valueOf();
+;;; kukit.log(item.remark + ' starts.');
+;;; var ts_start = (new Date()).valueOf();
try {
item.func();
} catch(e) {
this.lock = false;
throw e;
}
- ;;; var ts_end = (new Date()).valueOf();
- ;;; kukit.log('Finished ' + item.remark + ' in ' + (ts_end - ts_start) + ' ms');
+;;; var ts_end = (new Date()).valueOf();
+;;; var msg = item.remark + ' finished in ';
+;;; msg += (ts_end - ts_start) + ' ms.';
+;;; kukit.log(msg);
}
this.lock = false;
}
From gotcha at codespeak.net Fri Aug 17 04:17:56 2007
From: gotcha at codespeak.net (gotcha at codespeak.net)
Date: Fri, 17 Aug 2007 04:17:56 +0200 (CEST)
Subject: [KSS-checkins] r45759 - kukit/kukit.js/trunk/kukit
Message-ID: <20070817021756.82D898176@code0.codespeak.net>
Author: gotcha
Date: Fri Aug 17 04:17:54 2007
New Revision: 45759
Modified:
kukit/kukit.js/trunk/kukit/forms.js
Log:
fixed currentForm
Modified: kukit/kukit.js/trunk/kukit/forms.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/forms.js (original)
+++ kukit/kukit.js/trunk/kukit/forms.js Fri Aug 17 04:17:54 2007
@@ -331,7 +331,7 @@
;;; }
},
eval: function(args, node) {
- var locator = new kukit.fo.NamedFormLocator(node);
+ var locator = new kukit.fo.CurrentFormLocator(node);
var collector = new kukit.ut.TupleCollector();
return kukit.fo.getAllFormVars(locator, collector);
}
From gotcha at codespeak.net Fri Aug 17 05:29:35 2007
From: gotcha at codespeak.net (gotcha at codespeak.net)
Date: Fri, 17 Aug 2007 05:29:35 +0200 (CEST)
Subject: [KSS-checkins] r45760 -
kukit/kss.core/trunk/kss/core/plugins/effects/browser
Message-ID: <20070817032935.ED8A1817D@code0.codespeak.net>
Author: gotcha
Date: Fri Aug 17 05:29:34 2007
New Revision: 45760
Modified:
kukit/kss.core/trunk/kss/core/plugins/effects/browser/plugin.js
Log:
evolve to new API
Modified: kukit/kss.core/trunk/kss/core/plugins/effects/browser/plugin.js
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/effects/browser/plugin.js (original)
+++ kukit/kss.core/trunk/kss/core/plugins/effects/browser/plugin.js Fri Aug 17 05:29:34 2007
@@ -9,7 +9,7 @@
if (kukit.HASEFFECTS && typeof(Effect.Transitions) != "undefined") {
kukit.actionsGlobalRegistry.register("effect", function (oper) {
- oper.completeParms([], {'type': 'fade'}, 'scriptaculous effect');
+ oper.evaluateParameters([], {'type': 'fade'}, 'scriptaculous effect');
var node = oper.node;
if (oper.parms.type == 'fade') {
new Effect.Fade(node);
From reebalazs at codespeak.net Fri Aug 17 08:34:43 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 08:34:43 +0200 (CEST)
Subject: [KSS-checkins] r45761 - kukit/kukit.js/trunk/kukit
Message-ID: <20070817063443.B5E228188@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 08:34:42 2007
New Revision: 45761
Modified:
kukit/kukit.js/trunk/kukit/eventreg.js
Log:
Add proper BBB for the deprecated lowercase iterator names in last parameters of kukit.eventsGlobalRegistry.registerForAllEvents
Modified: kukit/kukit.js/trunk/kukit/eventreg.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/eventreg.js (original)
+++ kukit/kukit.js/trunk/kukit/eventreg.js Fri Aug 17 08:34:42 2007
@@ -733,6 +733,20 @@
//
kukit.er.getBindIterator = function(iterName) {
+ // attempt to find canonical version of string
+ // and shout if it does not match.
+ // String must start uppercase.
+ var canonical = iterName.substring(0, 1).toUpperCase() +
+ iterName.substring(1);
+ if (iterName != canonical) {
+ // BBB 2007.12.31, this will turn into an exception.
+;;; var msg = 'Deprecated the lowercase iterator names in last ';
+;;; msg += 'parameters of ';
+;;; msg += 'kukit.eventsGlobalRegistry.registerForAllEvents, use [';
+;;; msg += canonical + '] instead of [' + iterName + '] (2007-12-31)';
+;;; kukit.logWarning(msg);
+ iterName = canonical;
+ }
return kukit.er.OperRegistry.prototype['_iterate' + iterName];
};
From reebalazs at codespeak.net Fri Aug 17 08:37:21 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 08:37:21 +0200 (CEST)
Subject: [KSS-checkins] r45762 - kukit/kukit.js/trunk/kukit
Message-ID: <20070817063721.079E78188@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 08:37:21 2007
New Revision: 45762
Modified:
kukit/kukit.js/trunk/kukit/oper.js
Log:
Fix message that it starts with ^Deprecated as in a uniform way.
Modified: kukit/kukit.js/trunk/kukit/oper.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/oper.js (original)
+++ kukit/kukit.js/trunk/kukit/oper.js Fri Aug 17 08:37:21 2007
@@ -325,7 +325,7 @@
kukit.op.Oper.prototype.completeParms =
function(mandatory, defaults, errname, allow_excess) {
-;;; var msg = '[Oper.completeParms] is deprecated,';
+;;; var msg = 'Deprecated [Oper.completeParms],';
;;; msg += 'use [Oper.evaluateParameters] instead !';
;;; kukit.logWarning(msg);
this.evaluateParameters(mandatory, defaults, errname, allow_excess);
From reebalazs at codespeak.net Fri Aug 17 08:48:51 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 08:48:51 +0200 (CEST)
Subject: [KSS-checkins] r45763 - in kukit/kukit.js/trunk: . doc
Message-ID: <20070817064851.B5E418188@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 08:48:51 2007
New Revision: 45763
Added:
kukit/kukit.js/trunk/doc/HISTORY.txt
- copied unchanged from r45760, kukit/kukit.js/trunk/HISTORY.txt
kukit/kukit.js/trunk/doc/README.txt
- copied unchanged from r45760, kukit/kukit.js/trunk/README.txt
Removed:
kukit/kukit.js/trunk/HISTORY.txt
kukit/kukit.js/trunk/README.txt
Log:
Move docs to doc
Deleted: /kukit/kukit.js/trunk/HISTORY.txt
==============================================================================
--- /kukit/kukit.js/trunk/HISTORY.txt Fri Aug 17 08:48:51 2007
+++ (empty file)
@@ -1,23 +0,0 @@
-Changelog for kukit.js
-
- (name of developer listed in brackets)
-
-kukit.js 1.0 - UNRELEASED
-
- - Move ;;; markers to first columns.
- [gotcha]
-
- - Fix credits.
- [gotcha]
-
- - Fix identifiers to have coherent styling (CamelCase).
- [gotcha]
-
- - Some refactoring to allow Firekiss plugin.
- [gotcha]
-
- - Fit code on 80 columns.
- [gotcha]
-
- - Cleaned up error messages.
- [gotcha]
Deleted: /kukit/kukit.js/trunk/README.txt
==============================================================================
--- /kukit/kukit.js/trunk/README.txt Fri Aug 17 08:48:51 2007
+++ (empty file)
@@ -1,18 +0,0 @@
-=====
-kukit
-=====
-
-More documentation...
----------------------
-
-General information
-
- o Authors: see doc/CREDITS.txt
-
- o License: see doc/LICENSE.txt
-
-License
--------
-
-Unless otherwise stated, kukit is released under the GNU GPL version 2
-license. See doc/LICENSE.txt for the license text.
From reebalazs at codespeak.net Fri Aug 17 08:50:19 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 08:50:19 +0200 (CEST)
Subject: [KSS-checkins] r45764 - kukit/kss.core/trunk/docs
Message-ID: <20070817065019.5F0CF8188@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 08:50:18 2007
New Revision: 45764
Modified:
kukit/kss.core/trunk/docs/HISTORY.txt
Log:
Change history
Modified: kukit/kss.core/trunk/docs/HISTORY.txt
==============================================================================
--- kukit/kss.core/trunk/docs/HISTORY.txt (original)
+++ kukit/kss.core/trunk/docs/HISTORY.txt Fri Aug 17 08:50:18 2007
@@ -6,6 +6,9 @@
- ...
+ - Refactored js code.
+ [gotcha]
+
kss.core - 1.2-rc2 Released 2007-07-27
- Prepare for release.
From reebalazs at codespeak.net Fri Aug 17 08:51:13 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 08:51:13 +0200 (CEST)
Subject: [KSS-checkins] r45765 - kukit/kukit.js/tag/1.2-final
Message-ID: <20070817065113.4077F8188@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 08:51:12 2007
New Revision: 45765
Added:
kukit/kukit.js/tag/1.2-final/
- copied from r45764, kukit/kukit.js/trunk/
Log:
Tag for release
From reebalazs at codespeak.net Fri Aug 17 08:55:21 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 08:55:21 +0200 (CEST)
Subject: [KSS-checkins] r45766 - in kukit/kukit.js/tag/1.2-final: . doc
Message-ID: <20070817065521.2B4ED8188@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 08:55:20 2007
New Revision: 45766
Modified:
kukit/kukit.js/tag/1.2-final/doc/HISTORY.txt
kukit/kukit.js/tag/1.2-final/version.txt
Log:
Setting release
Modified: kukit/kukit.js/tag/1.2-final/doc/HISTORY.txt
==============================================================================
--- kukit/kukit.js/tag/1.2-final/doc/HISTORY.txt (original)
+++ kukit/kukit.js/tag/1.2-final/doc/HISTORY.txt Fri Aug 17 08:55:20 2007
@@ -2,7 +2,9 @@
(name of developer listed in brackets)
-kukit.js 1.0 - UNRELEASED
+kukit.js - 1.2 Unreleased
+
+kukit.js - 1.2-final Released 2007-08-17
- Move ;;; markers to first columns.
[gotcha]
Modified: kukit/kukit.js/tag/1.2-final/version.txt
==============================================================================
--- kukit/kukit.js/tag/1.2-final/version.txt (original)
+++ kukit/kukit.js/tag/1.2-final/version.txt Fri Aug 17 08:55:20 2007
@@ -1 +1 @@
-1.2dev unreleased
+1.2-final Released 2007-08-17
From reebalazs at codespeak.net Fri Aug 17 08:56:39 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 08:56:39 +0200 (CEST)
Subject: [KSS-checkins] r45767 - kukit/kukit.js/trunk/doc
Message-ID: <20070817065639.2D75180CB@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 08:56:38 2007
New Revision: 45767
Modified:
kukit/kukit.js/trunk/doc/HISTORY.txt
Log:
Adjust history
Modified: kukit/kukit.js/trunk/doc/HISTORY.txt
==============================================================================
--- kukit/kukit.js/trunk/doc/HISTORY.txt (original)
+++ kukit/kukit.js/trunk/doc/HISTORY.txt Fri Aug 17 08:56:38 2007
@@ -2,7 +2,11 @@
(name of developer listed in brackets)
-kukit.js 1.0 - UNRELEASED
+kukit.js - 1.2 Unreleased
+
+ - ...
+
+kukit.js - 1.2-final Released 2007-08-17
- Move ;;; markers to first columns.
[gotcha]
From reebalazs at codespeak.net Fri Aug 17 08:57:11 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 08:57:11 +0200 (CEST)
Subject: [KSS-checkins] r45768 - kukit/kukit.js/tag/1.2-final/doc
Message-ID: <20070817065711.82CDA8176@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 08:57:10 2007
New Revision: 45768
Modified:
kukit/kukit.js/tag/1.2-final/doc/HISTORY.txt
Log:
Adjust history
Modified: kukit/kukit.js/tag/1.2-final/doc/HISTORY.txt
==============================================================================
--- kukit/kukit.js/tag/1.2-final/doc/HISTORY.txt (original)
+++ kukit/kukit.js/tag/1.2-final/doc/HISTORY.txt Fri Aug 17 08:57:10 2007
@@ -2,8 +2,6 @@
(name of developer listed in brackets)
-kukit.js - 1.2 Unreleased
-
kukit.js - 1.2-final Released 2007-08-17
- Move ;;; markers to first columns.
From reebalazs at codespeak.net Fri Aug 17 08:58:42 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 08:58:42 +0200 (CEST)
Subject: [KSS-checkins] r45769 - kukit/kss.concatresource/tag/1.2-final
Message-ID: <20070817065842.BCA998183@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 08:58:42 2007
New Revision: 45769
Added:
kukit/kss.concatresource/tag/1.2-final/
- copied from r45768, kukit/kss.concatresource/trunk/
Log:
Tag for release
From reebalazs at codespeak.net Fri Aug 17 09:04:39 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:04:39 +0200 (CEST)
Subject: [KSS-checkins] r45770 - in kukit/kss.concatresource/tag/1.2-final:
. docs kss/concatresource
Message-ID: <20070817070439.8F55A8183@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:04:38 2007
New Revision: 45770
Removed:
kukit/kss.concatresource/tag/1.2-final/setup.cfg
Modified:
kukit/kss.concatresource/tag/1.2-final/docs/HISTORY.txt
kukit/kss.concatresource/tag/1.2-final/kss/concatresource/version.txt
kukit/kss.concatresource/tag/1.2-final/setup.py
Log:
Setting release
Modified: kukit/kss.concatresource/tag/1.2-final/docs/HISTORY.txt
==============================================================================
--- kukit/kss.concatresource/tag/1.2-final/docs/HISTORY.txt (original)
+++ kukit/kss.concatresource/tag/1.2-final/docs/HISTORY.txt Fri Aug 17 09:04:38 2007
@@ -6,6 +6,12 @@
- ...
+kss.concatresource - 1.2-final Released 2007-08-17
+
+ - Change ;;; rendering in devel mode
+ for better indentation
+ [gotcha]
+
kss.concatresource - 1.2-rc2 Released 2007-07-27
- Prepare for release
Modified: kukit/kss.concatresource/tag/1.2-final/kss/concatresource/version.txt
==============================================================================
--- kukit/kss.concatresource/tag/1.2-final/kss/concatresource/version.txt (original)
+++ kukit/kss.concatresource/tag/1.2-final/kss/concatresource/version.txt Fri Aug 17 09:04:38 2007
@@ -1 +1 @@
-1.2dev Unreleased
+1.2-final Released 2007-08-17
Deleted: /kukit/kss.concatresource/tag/1.2-final/setup.cfg
==============================================================================
--- /kukit/kss.concatresource/tag/1.2-final/setup.cfg Fri Aug 17 09:04:38 2007
+++ (empty file)
@@ -1,3 +0,0 @@
-[egg_info]
-tag_build = dev
-tag_svn_revision = true
Modified: kukit/kss.concatresource/tag/1.2-final/setup.py
==============================================================================
--- kukit/kss.concatresource/tag/1.2-final/setup.py (original)
+++ kukit/kss.concatresource/tag/1.2-final/setup.py Fri Aug 17 09:04:38 2007
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
-version = '1.2'
+version = '1.2-final'
setup(name='concatresource',
version=version,
@@ -30,6 +30,5 @@
# -*- Entry points: -*-
""",
dependency_links=[
- 'https://codespeak.net/svn/kukit/kss.concatresource/trunk#egg=kss.concatresource-dev',
],
)
From reebalazs at codespeak.net Fri Aug 17 09:05:41 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:05:41 +0200 (CEST)
Subject: [KSS-checkins] r45771 - kukit/kss.concatresource/trunk/docs
Message-ID: <20070817070541.835F18183@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:05:41 2007
New Revision: 45771
Modified:
kukit/kss.concatresource/trunk/docs/HISTORY.txt
Log:
Adjust history
Modified: kukit/kss.concatresource/trunk/docs/HISTORY.txt
==============================================================================
--- kukit/kss.concatresource/trunk/docs/HISTORY.txt (original)
+++ kukit/kss.concatresource/trunk/docs/HISTORY.txt Fri Aug 17 09:05:41 2007
@@ -6,6 +6,12 @@
- ...
+kss.concatresource - 1.2-final Released 2007-08-17
+
+ - Change ;;; rendering in devel mode
+ for better indentation
+ [gotcha]
+
kss.concatresource - 1.2-rc2 Released 2007-07-27
- Prepare for release
From reebalazs at codespeak.net Fri Aug 17 09:06:50 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:06:50 +0200 (CEST)
Subject: [KSS-checkins] r45772 - kukit/kukit.js/trunk/doc
Message-ID: <20070817070650.8721B8183@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:06:50 2007
New Revision: 45772
Modified:
kukit/kukit.js/trunk/doc/HISTORY.txt
Log:
Adjust history
Modified: kukit/kukit.js/trunk/doc/HISTORY.txt
==============================================================================
--- kukit/kukit.js/trunk/doc/HISTORY.txt (original)
+++ kukit/kukit.js/trunk/doc/HISTORY.txt Fri Aug 17 09:06:50 2007
@@ -2,7 +2,7 @@
(name of developer listed in brackets)
-kukit.js - 1.2 Unreleased
+kukit.js - 1.2dev Unreleased
- ...
From reebalazs at codespeak.net Fri Aug 17 09:07:23 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:07:23 +0200 (CEST)
Subject: [KSS-checkins] r45773 - kukit/kss.core/trunk/docs
Message-ID: <20070817070723.76D4F8183@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:07:22 2007
New Revision: 45773
Modified:
kukit/kss.core/trunk/docs/HISTORY.txt
Log:
Set history
Modified: kukit/kss.core/trunk/docs/HISTORY.txt
==============================================================================
--- kukit/kss.core/trunk/docs/HISTORY.txt (original)
+++ kukit/kss.core/trunk/docs/HISTORY.txt Fri Aug 17 09:07:22 2007
@@ -2,7 +2,7 @@
(name of developer listed in brackets)
-kss.core - 1.2 Unreleased
+kss.core - 1.2dev Unreleased
- ...
From reebalazs at codespeak.net Fri Aug 17 09:07:52 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:07:52 +0200 (CEST)
Subject: [KSS-checkins] r45774 - kukit/kss.core/tag/2.1-final
Message-ID: <20070817070752.6ED0B8188@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:07:51 2007
New Revision: 45774
Added:
kukit/kss.core/tag/2.1-final/
- copied from r45773, kukit/kss.core/trunk/
Log:
Tagging release
From reebalazs at codespeak.net Fri Aug 17 09:08:27 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:08:27 +0200 (CEST)
Subject: [KSS-checkins] r45775 - kukit/kss.core/tag/2.1-final
Message-ID: <20070817070827.6B5D48183@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:08:27 2007
New Revision: 45775
Removed:
kukit/kss.core/tag/2.1-final/
Log:
Tagging release
From reebalazs at codespeak.net Fri Aug 17 09:08:34 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:08:34 +0200 (CEST)
Subject: [KSS-checkins] r45776 - kukit/kss.core/tag/1.2-final
Message-ID: <20070817070834.A14A58183@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:08:34 2007
New Revision: 45776
Added:
kukit/kss.core/tag/1.2-final/
- copied from r45775, kukit/kss.core/trunk/
Log:
Tagging release
From reebalazs at codespeak.net Fri Aug 17 09:12:56 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:12:56 +0200 (CEST)
Subject: [KSS-checkins] r45777 - in kukit/kss.core/tag/1.2-final: . docs
kss/core kss/core/pluginregistry
Message-ID: <20070817071256.2208F8068@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:12:55 2007
New Revision: 45777
Removed:
kukit/kss.core/tag/1.2-final/setup.cfg
Modified:
kukit/kss.core/tag/1.2-final/docs/HISTORY.txt
kukit/kss.core/tag/1.2-final/kss/core/ (props changed)
kukit/kss.core/tag/1.2-final/kss/core/EXTERNALS.TXT
kukit/kss.core/tag/1.2-final/kss/core/pluginregistry/ (props changed)
kukit/kss.core/tag/1.2-final/kss/core/pluginregistry/EXTERNALS.TXT
kukit/kss.core/tag/1.2-final/kss/core/version.txt
kukit/kss.core/tag/1.2-final/setup.py
Log:
Set release
Modified: kukit/kss.core/tag/1.2-final/docs/HISTORY.txt
==============================================================================
--- kukit/kss.core/tag/1.2-final/docs/HISTORY.txt (original)
+++ kukit/kss.core/tag/1.2-final/docs/HISTORY.txt Fri Aug 17 09:12:55 2007
@@ -2,9 +2,7 @@
(name of developer listed in brackets)
-kss.core - 1.2dev Unreleased
-
- - ...
+kss.core - 1.2-final Released 2007-08-17
- Refactored js code.
[gotcha]
Modified: kukit/kss.core/tag/1.2-final/kss/core/EXTERNALS.TXT
==============================================================================
--- kukit/kss.core/tag/1.2-final/kss/core/EXTERNALS.TXT (original)
+++ kukit/kss.core/tag/1.2-final/kss/core/EXTERNALS.TXT Fri Aug 17 09:12:55 2007
@@ -5,4 +5,4 @@
# You can update your working dir by:
# svn propset svn:externals -F EXTERNALS.TXT .
#
-kukit http://codespeak.net/svn/kukit/kukit.js/trunk
+kukit http://codespeak.net/svn/kukit/kukit.js/tag/1.2-final
Modified: kukit/kss.core/tag/1.2-final/kss/core/pluginregistry/EXTERNALS.TXT
==============================================================================
--- kukit/kss.core/tag/1.2-final/kss/core/pluginregistry/EXTERNALS.TXT (original)
+++ kukit/kss.core/tag/1.2-final/kss/core/pluginregistry/EXTERNALS.TXT Fri Aug 17 09:12:55 2007
@@ -7,4 +7,4 @@
#
# concatresource is now included like as batteries
-_concatresource https://codespeak.net/svn/kukit/kss.concatresource/trunk/kss/concatresource
+_concatresource https://codespeak.net/svn/kukit/kss.concatresource/tag/1.2-final/kss/concatresource
Modified: kukit/kss.core/tag/1.2-final/kss/core/version.txt
==============================================================================
--- kukit/kss.core/tag/1.2-final/kss/core/version.txt (original)
+++ kukit/kss.core/tag/1.2-final/kss/core/version.txt Fri Aug 17 09:12:55 2007
@@ -1 +1 @@
-1.2dev unreleased
+1.2-final Released 2007-08-17
Deleted: /kukit/kss.core/tag/1.2-final/setup.cfg
==============================================================================
--- /kukit/kss.core/tag/1.2-final/setup.cfg Fri Aug 17 09:12:55 2007
+++ (empty file)
@@ -1,3 +0,0 @@
-[egg_info]
-tag_build = dev
-tag_svn_revision = true
Modified: kukit/kss.core/tag/1.2-final/setup.py
==============================================================================
--- kukit/kss.core/tag/1.2-final/setup.py (original)
+++ kukit/kss.core/tag/1.2-final/setup.py Fri Aug 17 09:12:55 2007
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
import sys, os
-version = '1.2'
+version = '1.2-final'
setup(name='kss.core',
version=version,
From reebalazs at codespeak.net Fri Aug 17 09:14:44 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:14:44 +0200 (CEST)
Subject: [KSS-checkins] r45778 - kukit/kss.core/trunk/docs
Message-ID: <20070817071444.840D9817D@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:14:44 2007
New Revision: 45778
Modified:
kukit/kss.core/trunk/docs/HISTORY.txt
Log:
Adjust history
Modified: kukit/kss.core/trunk/docs/HISTORY.txt
==============================================================================
--- kukit/kss.core/trunk/docs/HISTORY.txt (original)
+++ kukit/kss.core/trunk/docs/HISTORY.txt Fri Aug 17 09:14:44 2007
@@ -6,6 +6,8 @@
- ...
+kss.core - 1.2-final Released 2007-08-17
+
- Refactored js code.
[gotcha]
From reebalazs at codespeak.net Fri Aug 17 09:15:03 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:15:03 +0200 (CEST)
Subject: [KSS-checkins] r45779 - kukit/kss.demo/tag/1.2-final
Message-ID: <20070817071503.06C1D8188@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:15:03 2007
New Revision: 45779
Added:
kukit/kss.demo/tag/1.2-final/
- copied from r45778, kukit/kss.demo/trunk/
Log:
Tagging release
From reebalazs at codespeak.net Fri Aug 17 09:21:43 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:21:43 +0200 (CEST)
Subject: [KSS-checkins] r45781 - kukit/kss.demo/tag/1.2-final/kss/demo
Message-ID: <20070817072143.A572A818B@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:21:43 2007
New Revision: 45781
Modified:
kukit/kss.demo/tag/1.2-final/kss/demo/ (props changed)
kukit/kss.demo/tag/1.2-final/kss/demo/EXTERNALS.TXT
Log:
Setting release
Modified: kukit/kss.demo/tag/1.2-final/kss/demo/EXTERNALS.TXT
==============================================================================
--- kukit/kss.demo/tag/1.2-final/kss/demo/EXTERNALS.TXT (original)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/EXTERNALS.TXT Fri Aug 17 09:21:43 2007
@@ -5,4 +5,4 @@
# You can update your working dir by:
# svn propset svn:externals -F EXTERNALS.TXT .
#
-configfeature http://codespeak.net/svn/z3/jsonserver/branch/merge/configfeature
+##configfeature http://codespeak.net/svn/z3/jsonserver/branch/merge/configfeature
From reebalazs at codespeak.net Fri Aug 17 09:24:56 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:24:56 +0200 (CEST)
Subject: [KSS-checkins] r45782 - in kukit/kss.demo/tag/1.2-final: . docs
kss/demo kss/demo/configfeature kss/demo/configfeature/tests
Message-ID: <20070817072456.07FCC818B@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:24:56 2007
New Revision: 45782
Added:
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/README
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/__init__.py
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/configure.zcml
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/directives.py
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/fiveconfig.py
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/fiveconfig.zcml
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/meta.py
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/meta.zcml
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/metacore.zcml
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/__init__.py
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/__parent__.py
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/configtest.py
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/test_directive.py
kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/test_fiveconfig.py
Removed:
kukit/kss.demo/tag/1.2-final/setup.cfg
Modified:
kukit/kss.demo/tag/1.2-final/docs/HISTORY.txt
kukit/kss.demo/tag/1.2-final/kss/demo/version.txt
kukit/kss.demo/tag/1.2-final/setup.py
Log:
Setting release
Modified: kukit/kss.demo/tag/1.2-final/docs/HISTORY.txt
==============================================================================
--- kukit/kss.demo/tag/1.2-final/docs/HISTORY.txt (original)
+++ kukit/kss.demo/tag/1.2-final/docs/HISTORY.txt Fri Aug 17 09:24:56 2007
@@ -2,9 +2,10 @@
(name of developer listed in brackets)
-kss.demo - 1.2dev Unreleased
+kss.demo - 1.2-final Released 2007-08-17
- - ...
+ - Prepare for release
+ [ree]
kss.demo - 1.2-rc2 Released 2007-07-27
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/README
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/README Fri Aug 17 09:24:56 2007
@@ -0,0 +1,35 @@
+
+Objectives
+----------
+
+The goal of the program is to enable defining a feature based on
+configuration values set from python code. The directive imports
+a python object and uses an attribute of it as a boolean value
+to declare a feature or not.
+
+
+
+
+
+Instance can be used as a module itself (in which case a module level
+attribute can be looked up) or a class instance (in this case an attribute
+of the instance will be used). If there is no such attribute on the instance,
+a dictionary key access will be attempted, allowing dictionaries to be used.
+
+The given attribute is used as a boolean value. It must exist, or else
+an error is raised.
+
+The featured fiveconfig.zcml serves both as an example and also can be
+used to identify which version of five is in effect. The configuration
+can be used both by zope configuration (by using the features), or
+from python code, by directly importing the module that forms the base
+for the feature setup.
+
+The negate attribute is only necessary to overcome the lack of negation
+feature in zcml:condition.
+
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/__init__.py
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/__init__.py Fri Aug 17 09:24:56 2007
@@ -0,0 +1,3 @@
+'''\
+Product init
+'''
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/configure.zcml
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/configure.zcml Fri Aug 17 09:24:56 2007
@@ -0,0 +1,4 @@
+
+
+
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/directives.py
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/directives.py Fri Aug 17 09:24:56 2007
@@ -0,0 +1,34 @@
+from zope.interface import Interface
+from zope.configuration.fields import GlobalObject, Bool
+from zope.schema import ASCII
+from zope.app.publisher.browser.metadirectives import IBasicResourceInformation
+
+class IConfigFeature(IBasicResourceInformation):
+ """
+ Defines a feature based on a python configuration
+ """
+
+ feature = ASCII(
+ title = u"Feature",
+ description = u"Name of the feature to define",
+ required = True,
+ )
+
+ instance = GlobalObject(
+ title = u'Object instance',
+ description = u'Dotted name of the object that holds the attribute.',
+ required = True,
+ )
+
+ attribute = ASCII(
+ title = u"Attribute",
+ description = u"Attribute name within the object.",
+ required = True,
+ )
+
+ negate = Bool(
+ title = u'Negate',
+ description = u'If to negate the boolean value, default False',
+ default = False,
+ required = False,
+ )
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/fiveconfig.py
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/fiveconfig.py Fri Aug 17 09:24:56 2007
@@ -0,0 +1,73 @@
+'''\
+Compatibility configuration switches
+
+This is a transitional solution to attack the problem
+of quickly changing Zope3 and Five APIs.
+
+Import checks are done centrally from here.
+The point is that compatibility imports should fail here,
+if anything goes wrong. Components should only check
+the switches set from here.
+
+Corresponding configuration features are also set up
+from the compat.zcml file. The idea is that all switches
+are accessible both from python and zcml.
+
+
+Supported versions:
+-------------------
+
+Zope 2.9, 2.10
+Zope 3.2, 3.3
+
+Compatibility matrix
+--------------------
+
+The following table shows which Five version can and should be used
+with which Zope 2 and Zope 3 versions.
+
+. Zope 2.8 Zope 2.9 Zope 2.10
+. Zope X3 3.0 Zope 3.2 Zope 3.3
+Five 1.0 included
+Five 1.2 X
+Five 1.3 included
+Five 1.4 X
+Five trunk included
+
+'''
+
+__all__ = ('__compat__', )
+
+class DictLike(object):
+ pass
+
+__compat__ = DictLike()
+
+try:
+ import zope.component.interface
+ import zope.component.location
+ __compat__.zope_pre_3_3 = False
+except ImportError:
+ # The only supported pre_3_3 version is 3.2
+ import zope.app.component.interface
+ import zope.app.location
+ __compat__.zope_pre_3_3 = True
+
+try:
+ import Products.Five
+except ImportError:
+ __compat__.five = False
+else:
+ __compat__.five = True
+ try:
+ # Zope 2.8 / Five 1.0.2
+ from Products.Five.resource import Resource
+ __compat__.five_pre_1_3 = True
+ except ImportError:
+ # Zope 2.9 / Five 1.3
+ from Products.Five.browser.resource import Resource
+ __compat__.five_pre_1_3 = False
+
+# Unsupported versions.
+if __compat__.five and __compat__.five_pre_1_3:
+ raise Exception, 'Zope 2.8 or prior versions (Five 1.2 or prior versions) are unsupported, please upgrade!'
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/fiveconfig.zcml
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/fiveconfig.zcml Fri Aug 17 09:24:56 2007
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/meta.py
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/meta.py Fri Aug 17 09:24:56 2007
@@ -0,0 +1,99 @@
+
+from zope.configuration.exceptions import ConfigurationError
+
+def configfeature(_context, feature, instance, attribute, negate=False):
+ """Imports a python object and uses an attribute of it as a boolean value
+ to declare a feature or not.
+
+ Usage
+ -----
+
+ We can have an object with attributes,
+
+ >>> class dictlike(object):
+ ... pass
+ >>> conf1 = dictlike()
+ >>> conf1.this = True
+ >>> conf1.that = False
+
+ and its attributes can defined a feature if they evaluate to True.
+ The feature will not be defined if the value evaluates to False.
+
+ >>> from zope.configuration.config import ConfigurationContext
+ >>> c = ConfigurationContext()
+ >>> configfeature(c, 'f1', conf1, 'this')
+ >>> c.hasFeature('f1')
+ True
+ >>> configfeature(c, 'f2', conf1, 'that')
+ >>> c.hasFeature('f2')
+ False
+
+ The boolean value can be negated, this allows it
+ to overcome the shortage of negating possibilit of zcml:condition.
+
+ >>> configfeature(c, 'f3', conf1, 'this', True)
+ >>> c.hasFeature('f3')
+ False
+ >>> configfeature(c, 'f4', conf1, 'that', True)
+ >>> c.hasFeature('f4')
+ True
+
+ Instead of an object with attributes, a dictionary can also be used:
+
+ >>> dconf = {}
+ >>> dconf['this'] = True
+ >>> dconf['that'] = False
+
+ >>> configfeature(c, 'f5', dconf, 'this')
+ >>> c.hasFeature('f5')
+ True
+ >>> configfeature(c, 'f6', dconf, 'that')
+ >>> c.hasFeature('f6')
+ False
+
+
+ Error handling
+ --------------
+
+ If there is an unexistent attribute, an error is reported.
+
+ >>> configfeature(c, 'f7', conf1, 'nosuch') #doctest: +ELLIPSIS
+ Traceback (most recent call last):
+ ...
+ ConfigurationError: Object ... does not have attribute or key "nosuch"
+
+ >>> configfeature(c, 'f8', dconf, 'nosuch') #doctest: +ELLIPSIS
+ Traceback (most recent call last):
+ ...
+ ConfigurationError: Object ... does not have attribute or key "nosuch"
+
+
+ Finally, like with the "provides" directive normally:
+ Spaces are not allowed in feature names (this is reserved for providing
+ many features with a single directive in the futute).
+
+ >>> configfeature(c, 'two words', conf1, 'this')
+ Traceback (most recent call last):
+ ...
+ ValueError: Only one feature name allowed
+
+ """
+
+ try:
+ value = getattr(instance, attribute)
+ except AttributeError:
+ # also try as dictionary value
+ try:
+ value = instance[attribute]
+ except (TypeError, ValueError, KeyError):
+ raise ConfigurationError, 'Object %s does not have attribute or key "%s"' % (instance, attribute)
+
+ value = bool(value)
+ if negate:
+ value = not value
+
+ if len(feature.split()) > 1:
+ raise ValueError("Only one feature name allowed")
+
+ if value:
+ _context.provideFeature(feature)
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/meta.zcml
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/meta.zcml Fri Aug 17 09:24:56 2007
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/metacore.zcml
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/metacore.zcml Fri Aug 17 09:24:56 2007
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/__init__.py
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/__init__.py Fri Aug 17 09:24:56 2007
@@ -0,0 +1,4 @@
+'''\
+Module init
+'''
+
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/__parent__.py
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/__parent__.py Fri Aug 17 09:24:56 2007
@@ -0,0 +1,9 @@
+import sys
+
+def __parent__(modulename, level=1):
+ 'Figure out parent module'
+ for i in range(level):
+ if not isinstance(modulename, basestring):
+ modulename = modulename.__name__
+ modulename = sys.modules['.'.join(modulename.split('.')[:-1])]
+ return modulename
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/configtest.py
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/configtest.py Fri Aug 17 09:24:56 2007
@@ -0,0 +1,18 @@
+
+# module level
+conf1 = True
+conf2 = False
+
+class dictlike(object):
+ pass
+
+# an object
+cobj = dictlike()
+cobj.conf3 = True
+cobj.conf4 = False
+
+# a dict
+dobj = {}
+dobj['conf5'] = True
+dobj['conf6'] = False
+
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/test_directive.py
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/test_directive.py Fri Aug 17 09:24:56 2007
@@ -0,0 +1,228 @@
+
+import sys
+import unittest
+from zope.testing.doctestunit import DocTestSuite
+from __parent__ import __parent__
+configfeature = __parent__(__name__, 2)
+
+def test_module_level():
+ """
+ Module level access.
+
+ >>> import zope.configuration.tests
+ >>> import zope.configuration.xmlconfig
+ >>> context = zope.configuration.xmlconfig.file('metacore.zcml', configfeature)
+
+ >>> import tempfile
+ >>> fn = tempfile.mktemp('.zcml')
+ >>> zcml = open(fn, 'w')
+ >>> zcml.write('''
+ ...
+ ...
+ ...
+ ...
+ ...
+ ... ''')
+ >>> zcml.close()
+
+ >>> context = zope.configuration.xmlconfig.file(fn, configfeature.tests, context)
+
+ >>> context.hasFeature('conf1')
+ True
+ >>> context.hasFeature('conf2')
+ False
+ >>> context.hasFeature('conf2n')
+ True
+
+ """
+
+
+def test_objectlevel():
+ """
+ Object level access.
+
+ >>> import zope.configuration.tests
+ >>> import zope.configuration.xmlconfig
+ >>> context = zope.configuration.xmlconfig.file('metacore.zcml', configfeature)
+
+ >>> import tempfile
+ >>> fn = tempfile.mktemp('.zcml')
+ >>> zcml = open(fn, 'w')
+ >>> zcml.write('''
+ ...
+ ...
+ ...
+ ...
+ ...
+ ... ''')
+ >>> zcml.close()
+
+ >>> context = zope.configuration.xmlconfig.file(fn, configfeature.tests, context)
+
+ >>> context.hasFeature('conf3')
+ True
+ >>> context.hasFeature('conf4')
+ False
+ >>> context.hasFeature('conf4n')
+ True
+
+ """
+
+
+def test_dict_level():
+ """
+ Dictionary level access.
+
+ >>> import zope.configuration.tests
+ >>> import zope.configuration.xmlconfig
+ >>> context = zope.configuration.xmlconfig.file('metacore.zcml', configfeature)
+
+ >>> import tempfile
+ >>> fn = tempfile.mktemp('.zcml')
+ >>> zcml = open(fn, 'w')
+ >>> zcml.write('''
+ ...
+ ...
+ ...
+ ...
+ ...
+ ... ''')
+ >>> zcml.close()
+
+ >>> context = zope.configuration.xmlconfig.file(fn, configfeature.tests, context)
+
+ >>> context.hasFeature('conf5')
+ True
+ >>> context.hasFeature('conf6')
+ False
+ >>> context.hasFeature('conf6n')
+ True
+
+ """
+
+
+def test_errors():
+ """
+ Testing errors.
+
+ >>> import zope.configuration.tests
+ >>> import zope.configuration.xmlconfig
+ >>> context = zope.configuration.xmlconfig.file('metacore.zcml', configfeature)
+
+ No such instance: raises an error.
+
+ >>> import tempfile
+ >>> fn = tempfile.mktemp('.zcml')
+ >>> zcml = open(fn, 'w')
+ >>> zcml.write('''
+ ...
+ ...
+ ...
+ ... ''')
+ >>> zcml.close()
+
+ >>> context = zope.configuration.xmlconfig.file(fn, configfeature.tests, context) #doctest: +ELLIPSIS
+ Traceback (most recent call last):
+ ...
+ ZopeXMLConfigurationError: ...
+ ConfigurationError: ...
+
+ No such attribute: an error too
+
+ >>> fn = tempfile.mktemp('.zcml')
+ >>> zcml = open(fn, 'w')
+ >>> zcml.write('''
+ ...
+ ...
+ ...
+ ... ''')
+ >>> zcml.close()
+
+ >>> context = zope.configuration.xmlconfig.file(fn, configfeature.tests, context) #doctest: +ELLIPSIS
+ Traceback (most recent call last):
+ ...
+ ZopeXMLConfigurationError: ...
+ ConfigurationError: Object ... does not have attribute or key "nosuch"
+
+ No such key: an error too
+
+ >>> fn = tempfile.mktemp('.zcml')
+ >>> zcml = open(fn, 'w')
+ >>> zcml.write('''
+ ...
+ ...
+ ...
+ ... ''')
+ >>> zcml.close()
+
+ >>> context = zope.configuration.xmlconfig.file(fn, configfeature.tests, context) #doctest: +ELLIPSIS
+ Traceback (most recent call last):
+ ...
+ ZopeXMLConfigurationError: ...
+ ConfigurationError: Object ... does not have attribute or key "nosuch"
+
+ """
+
+
+def test_suite():
+ return unittest.TestSuite((
+ DocTestSuite(configfeature.__name__ + '.meta'),
+ DocTestSuite(),
+ ))
Added: kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/test_fiveconfig.py
==============================================================================
--- (empty file)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/configfeature/tests/test_fiveconfig.py Fri Aug 17 09:24:56 2007
@@ -0,0 +1,27 @@
+
+import sys
+import unittest
+from zope.testing.doctestunit import DocTestSuite
+from __parent__ import __parent__
+configfeature = __parent__(__name__, 2)
+
+def test_fiveconfig():
+ """
+ The fiveconfig.zcml file declares various Five compatibility features.
+ We only test that the configuration file can be run.
+
+ >>> import zope.configuration.tests
+ >>> import zope.configuration.xmlconfig
+ >>> context = zope.configuration.xmlconfig.file('metacore.zcml', configfeature)
+ >>> context = zope.configuration.xmlconfig.file('fiveconfig.zcml', configfeature, context)
+
+ >>> context.hasFeature('compat_five') or context.hasFeature('compat_not_five')
+ True
+
+ """
+
+
+def test_suite():
+ return unittest.TestSuite((
+ DocTestSuite(),
+ ))
Modified: kukit/kss.demo/tag/1.2-final/kss/demo/version.txt
==============================================================================
--- kukit/kss.demo/tag/1.2-final/kss/demo/version.txt (original)
+++ kukit/kss.demo/tag/1.2-final/kss/demo/version.txt Fri Aug 17 09:24:56 2007
@@ -1 +1 @@
-1.2dev Unreleased
+1.2-final Released 2007-08-17
Deleted: /kukit/kss.demo/tag/1.2-final/setup.cfg
==============================================================================
--- /kukit/kss.demo/tag/1.2-final/setup.cfg Fri Aug 17 09:24:56 2007
+++ (empty file)
@@ -1,3 +0,0 @@
-[egg_info]
-tag_build = dev
-tag_svn_revision = true
Modified: kukit/kss.demo/tag/1.2-final/setup.py
==============================================================================
--- kukit/kss.demo/tag/1.2-final/setup.py (original)
+++ kukit/kss.demo/tag/1.2-final/setup.py Fri Aug 17 09:24:56 2007
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
import sys, os
-version = '1.2'
+version = '1.2-final'
setup(name='kss.demo',
version=version,
@@ -26,12 +26,11 @@
zip_safe=False,
install_requires=[
# -*- Extra requirements: -*-
- 'kss.core>=dev',
+ 'kss.core>=1.2-final',
],
entry_points="""
# -*- Entry points: -*-
""",
dependency_links=[
- 'https://codespeak.net/svn/kukit/kss.core/trunk#egg=kss.core-dev',
],
)
From reebalazs at codespeak.net Fri Aug 17 09:25:58 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:25:58 +0200 (CEST)
Subject: [KSS-checkins] r45783 - kukit/kss.demo/trunk/docs
Message-ID: <20070817072558.9A038818B@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:25:58 2007
New Revision: 45783
Modified:
kukit/kss.demo/trunk/docs/HISTORY.txt
Log:
Adjust history
Modified: kukit/kss.demo/trunk/docs/HISTORY.txt
==============================================================================
--- kukit/kss.demo/trunk/docs/HISTORY.txt (original)
+++ kukit/kss.demo/trunk/docs/HISTORY.txt Fri Aug 17 09:25:58 2007
@@ -6,6 +6,11 @@
- ...
+kss.demo - 1.2-final Released 2007-08-17
+
+ - Prepare for release
+ [ree]
+
kss.demo - 1.2-rc2 Released 2007-07-27
- Made the test for multi selects work better
From reebalazs at codespeak.net Fri Aug 17 09:45:45 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:45:45 +0200 (CEST)
Subject: [KSS-checkins] r45787 - in kukit/kukit.js/tag: 1.2 1.2-final
Message-ID: <20070817074545.96AF38192@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:45:44 2007
New Revision: 45787
Added:
kukit/kukit.js/tag/1.2/
- copied from r45786, kukit/kukit.js/tag/1.2-final/
Removed:
kukit/kukit.js/tag/1.2-final/
Log:
Setting release
From reebalazs at codespeak.net Fri Aug 17 09:48:21 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:48:21 +0200 (CEST)
Subject: [KSS-checkins] r45788 - in kukit/kukit.js/tag/1.2: . doc
Message-ID: <20070817074821.2CAD9817D@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:48:20 2007
New Revision: 45788
Modified:
kukit/kukit.js/tag/1.2/doc/HISTORY.txt
kukit/kukit.js/tag/1.2/version.txt
Log:
Setting release
Modified: kukit/kukit.js/tag/1.2/doc/HISTORY.txt
==============================================================================
--- kukit/kukit.js/tag/1.2/doc/HISTORY.txt (original)
+++ kukit/kukit.js/tag/1.2/doc/HISTORY.txt Fri Aug 17 09:48:20 2007
@@ -2,7 +2,7 @@
(name of developer listed in brackets)
-kukit.js - 1.2-final Released 2007-08-17
+kukit.js - 1.2 Released 2007-08-17
- Move ;;; markers to first columns.
[gotcha]
Modified: kukit/kukit.js/tag/1.2/version.txt
==============================================================================
--- kukit/kukit.js/tag/1.2/version.txt (original)
+++ kukit/kukit.js/tag/1.2/version.txt Fri Aug 17 09:48:20 2007
@@ -1 +1 @@
-1.2-final Released 2007-08-17
+1.2 Released 2007-08-17
From reebalazs at codespeak.net Fri Aug 17 09:50:42 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:50:42 +0200 (CEST)
Subject: [KSS-checkins] r45789 - kukit/kukit.js/trunk/doc
Message-ID: <20070817075042.E04828183@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:50:42 2007
New Revision: 45789
Modified:
kukit/kukit.js/trunk/doc/HISTORY.txt
Log:
Adjust history
Modified: kukit/kukit.js/trunk/doc/HISTORY.txt
==============================================================================
--- kukit/kukit.js/trunk/doc/HISTORY.txt (original)
+++ kukit/kukit.js/trunk/doc/HISTORY.txt Fri Aug 17 09:50:42 2007
@@ -6,7 +6,7 @@
- ...
-kukit.js - 1.2-final Released 2007-08-17
+kukit.js - 1.2 Released 2007-08-17
- Move ;;; markers to first columns.
[gotcha]
From reebalazs at codespeak.net Fri Aug 17 09:51:27 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:51:27 +0200 (CEST)
Subject: [KSS-checkins] r45790 - in kukit/kss.concatresource/tag: 1.2
1.2-final
Message-ID: <20070817075127.4C1928183@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:51:26 2007
New Revision: 45790
Added:
kukit/kss.concatresource/tag/1.2/
- copied from r45789, kukit/kss.concatresource/tag/1.2-final/
Removed:
kukit/kss.concatresource/tag/1.2-final/
Log:
Setting release
From reebalazs at codespeak.net Fri Aug 17 09:53:04 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:53:04 +0200 (CEST)
Subject: [KSS-checkins] r45791 - in kukit/kss.concatresource/tag/1.2: . docs
kss/concatresource
Message-ID: <20070817075304.EFCCC817D@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:53:04 2007
New Revision: 45791
Modified:
kukit/kss.concatresource/tag/1.2/docs/HISTORY.txt
kukit/kss.concatresource/tag/1.2/kss/concatresource/version.txt
kukit/kss.concatresource/tag/1.2/setup.py
Log:
Setting release
Modified: kukit/kss.concatresource/tag/1.2/docs/HISTORY.txt
==============================================================================
--- kukit/kss.concatresource/tag/1.2/docs/HISTORY.txt (original)
+++ kukit/kss.concatresource/tag/1.2/docs/HISTORY.txt Fri Aug 17 09:53:04 2007
@@ -6,7 +6,7 @@
- ...
-kss.concatresource - 1.2-final Released 2007-08-17
+kss.concatresource - 1.2 Released 2007-08-17
- Change ;;; rendering in devel mode
for better indentation
Modified: kukit/kss.concatresource/tag/1.2/kss/concatresource/version.txt
==============================================================================
--- kukit/kss.concatresource/tag/1.2/kss/concatresource/version.txt (original)
+++ kukit/kss.concatresource/tag/1.2/kss/concatresource/version.txt Fri Aug 17 09:53:04 2007
@@ -1 +1 @@
-1.2-final Released 2007-08-17
+1.2 Released 2007-08-17
Modified: kukit/kss.concatresource/tag/1.2/setup.py
==============================================================================
--- kukit/kss.concatresource/tag/1.2/setup.py (original)
+++ kukit/kss.concatresource/tag/1.2/setup.py Fri Aug 17 09:53:04 2007
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
-version = '1.2-final'
+version = '1.2'
setup(name='concatresource',
version=version,
From reebalazs at codespeak.net Fri Aug 17 09:53:32 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:53:32 +0200 (CEST)
Subject: [KSS-checkins] r45792 - kukit/kss.concatresource/trunk/docs
Message-ID: <20070817075332.E8A0F8183@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:53:32 2007
New Revision: 45792
Modified:
kukit/kss.concatresource/trunk/docs/HISTORY.txt
Log:
Adjust history
Modified: kukit/kss.concatresource/trunk/docs/HISTORY.txt
==============================================================================
--- kukit/kss.concatresource/trunk/docs/HISTORY.txt (original)
+++ kukit/kss.concatresource/trunk/docs/HISTORY.txt Fri Aug 17 09:53:32 2007
@@ -6,7 +6,7 @@
- ...
-kss.concatresource - 1.2-final Released 2007-08-17
+kss.concatresource - 1.2 Released 2007-08-17
- Change ;;; rendering in devel mode
for better indentation
From reebalazs at codespeak.net Fri Aug 17 09:54:04 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:54:04 +0200 (CEST)
Subject: [KSS-checkins] r45793 - in kukit/kss.core/tag: 1.2 1.2-final
Message-ID: <20070817075404.92001817D@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:54:03 2007
New Revision: 45793
Added:
kukit/kss.core/tag/1.2/
- copied from r45792, kukit/kss.core/tag/1.2-final/
Removed:
kukit/kss.core/tag/1.2-final/
Log:
Setting release
From reebalazs at codespeak.net Fri Aug 17 09:57:06 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:57:06 +0200 (CEST)
Subject: [KSS-checkins] r45795 - in kukit/kss.core/tag/1.2: . docs kss/core
kss/core/pluginregistry
Message-ID: <20070817075706.D0CEB818C@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:57:06 2007
New Revision: 45795
Modified:
kukit/kss.core/tag/1.2/docs/HISTORY.txt
kukit/kss.core/tag/1.2/kss/core/ (props changed)
kukit/kss.core/tag/1.2/kss/core/EXTERNALS.TXT
kukit/kss.core/tag/1.2/kss/core/pluginregistry/ (props changed)
kukit/kss.core/tag/1.2/kss/core/pluginregistry/EXTERNALS.TXT
kukit/kss.core/tag/1.2/kss/core/version.txt
kukit/kss.core/tag/1.2/setup.py
Log:
Setting release
Modified: kukit/kss.core/tag/1.2/docs/HISTORY.txt
==============================================================================
--- kukit/kss.core/tag/1.2/docs/HISTORY.txt (original)
+++ kukit/kss.core/tag/1.2/docs/HISTORY.txt Fri Aug 17 09:57:06 2007
@@ -2,7 +2,7 @@
(name of developer listed in brackets)
-kss.core - 1.2-final Released 2007-08-17
+kss.core - 1.2 Released 2007-08-17
- Refactored js code.
[gotcha]
Modified: kukit/kss.core/tag/1.2/kss/core/EXTERNALS.TXT
==============================================================================
--- kukit/kss.core/tag/1.2/kss/core/EXTERNALS.TXT (original)
+++ kukit/kss.core/tag/1.2/kss/core/EXTERNALS.TXT Fri Aug 17 09:57:06 2007
@@ -5,4 +5,4 @@
# You can update your working dir by:
# svn propset svn:externals -F EXTERNALS.TXT .
#
-kukit http://codespeak.net/svn/kukit/kukit.js/tag/1.2-final
+kukit http://codespeak.net/svn/kukit/kukit.js/tag/1.2
Modified: kukit/kss.core/tag/1.2/kss/core/pluginregistry/EXTERNALS.TXT
==============================================================================
--- kukit/kss.core/tag/1.2/kss/core/pluginregistry/EXTERNALS.TXT (original)
+++ kukit/kss.core/tag/1.2/kss/core/pluginregistry/EXTERNALS.TXT Fri Aug 17 09:57:06 2007
@@ -7,4 +7,4 @@
#
# concatresource is now included like as batteries
-_concatresource https://codespeak.net/svn/kukit/kss.concatresource/tag/1.2-final/kss/concatresource
+_concatresource https://codespeak.net/svn/kukit/kss.concatresource/tag/1.2/kss/concatresource
Modified: kukit/kss.core/tag/1.2/kss/core/version.txt
==============================================================================
--- kukit/kss.core/tag/1.2/kss/core/version.txt (original)
+++ kukit/kss.core/tag/1.2/kss/core/version.txt Fri Aug 17 09:57:06 2007
@@ -1 +1 @@
-1.2-final Released 2007-08-17
+1.2 Released 2007-08-17
Modified: kukit/kss.core/tag/1.2/setup.py
==============================================================================
--- kukit/kss.core/tag/1.2/setup.py (original)
+++ kukit/kss.core/tag/1.2/setup.py Fri Aug 17 09:57:06 2007
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
import sys, os
-version = '1.2-final'
+version = '1.2'
setup(name='kss.core',
version=version,
From reebalazs at codespeak.net Fri Aug 17 09:58:35 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:58:35 +0200 (CEST)
Subject: [KSS-checkins] r45796 - kukit/kss.core/trunk/docs
Message-ID: <20070817075835.ACF458192@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:58:35 2007
New Revision: 45796
Modified:
kukit/kss.core/trunk/docs/HISTORY.txt
Log:
Adjust history
Modified: kukit/kss.core/trunk/docs/HISTORY.txt
==============================================================================
--- kukit/kss.core/trunk/docs/HISTORY.txt (original)
+++ kukit/kss.core/trunk/docs/HISTORY.txt Fri Aug 17 09:58:35 2007
@@ -6,7 +6,7 @@
- ...
-kss.core - 1.2-final Released 2007-08-17
+kss.core - 1.2 Released 2007-08-17
- Refactored js code.
[gotcha]
From reebalazs at codespeak.net Fri Aug 17 09:59:09 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 09:59:09 +0200 (CEST)
Subject: [KSS-checkins] r45798 - in kukit/kss.demo/tag: 1.2 1.2-final
Message-ID: <20070817075909.9F9538196@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 09:59:09 2007
New Revision: 45798
Added:
kukit/kss.demo/tag/1.2/
- copied from r45797, kukit/kss.demo/tag/1.2-final/
Removed:
kukit/kss.demo/tag/1.2-final/
Log:
Setting release
From reebalazs at codespeak.net Fri Aug 17 10:04:15 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 10:04:15 +0200 (CEST)
Subject: [KSS-checkins] r45800 - in kukit/kss.demo/tag/1.2: . docs kss/demo
Message-ID: <20070817080415.7D25C8191@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 10:04:14 2007
New Revision: 45800
Modified:
kukit/kss.demo/tag/1.2/docs/HISTORY.txt
kukit/kss.demo/tag/1.2/kss/demo/version.txt
kukit/kss.demo/tag/1.2/setup.py
Log:
Setting release
Modified: kukit/kss.demo/tag/1.2/docs/HISTORY.txt
==============================================================================
--- kukit/kss.demo/tag/1.2/docs/HISTORY.txt (original)
+++ kukit/kss.demo/tag/1.2/docs/HISTORY.txt Fri Aug 17 10:04:14 2007
@@ -2,7 +2,7 @@
(name of developer listed in brackets)
-kss.demo - 1.2-final Released 2007-08-17
+kss.demo - 1.2 Released 2007-08-17
- Prepare for release
[ree]
Modified: kukit/kss.demo/tag/1.2/kss/demo/version.txt
==============================================================================
--- kukit/kss.demo/tag/1.2/kss/demo/version.txt (original)
+++ kukit/kss.demo/tag/1.2/kss/demo/version.txt Fri Aug 17 10:04:14 2007
@@ -1 +1 @@
-1.2-final Released 2007-08-17
+1.2 Released 2007-08-17
Modified: kukit/kss.demo/tag/1.2/setup.py
==============================================================================
--- kukit/kss.demo/tag/1.2/setup.py (original)
+++ kukit/kss.demo/tag/1.2/setup.py Fri Aug 17 10:04:14 2007
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
import sys, os
-version = '1.2-final'
+version = '1.2'
setup(name='kss.demo',
version=version,
@@ -26,7 +26,7 @@
zip_safe=False,
install_requires=[
# -*- Extra requirements: -*-
- 'kss.core>=1.2-final',
+ 'kss.core>=1.2',
],
entry_points="""
# -*- Entry points: -*-
From reebalazs at codespeak.net Fri Aug 17 10:05:07 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Fri, 17 Aug 2007 10:05:07 +0200 (CEST)
Subject: [KSS-checkins] r45801 - kukit/kss.demo/trunk/docs
Message-ID: <20070817080507.2D0D08194@code0.codespeak.net>
Author: reebalazs
Date: Fri Aug 17 10:05:06 2007
New Revision: 45801
Modified:
kukit/kss.demo/trunk/docs/HISTORY.txt
Log:
Adjust history
Modified: kukit/kss.demo/trunk/docs/HISTORY.txt
==============================================================================
--- kukit/kss.demo/trunk/docs/HISTORY.txt (original)
+++ kukit/kss.demo/trunk/docs/HISTORY.txt Fri Aug 17 10:05:06 2007
@@ -6,7 +6,7 @@
- ...
-kss.demo - 1.2-final Released 2007-08-17
+kss.demo - 1.2 Released 2007-08-17
- Prepare for release
[ree]
From reebalazs at codespeak.net Sun Aug 19 14:28:40 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Sun, 19 Aug 2007 14:28:40 +0200 (CEST)
Subject: [KSS-checkins] r45856 - kukit/kukit.js/branch/1.2
Message-ID: <20070819122840.9609481CC@code0.codespeak.net>
Author: reebalazs
Date: Sun Aug 19 14:28:38 2007
New Revision: 45856
Added:
kukit/kukit.js/branch/1.2/
- copied from r45855, kukit/kukit.js/trunk/
Log:
Create branch for version
From reebalazs at codespeak.net Sun Aug 19 14:29:27 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Sun, 19 Aug 2007 14:29:27 +0200 (CEST)
Subject: [KSS-checkins] r45857 - kukit/kss.concatresource/branch/1.2
Message-ID: <20070819122927.130C081CF@code0.codespeak.net>
Author: reebalazs
Date: Sun Aug 19 14:29:26 2007
New Revision: 45857
Added:
kukit/kss.concatresource/branch/1.2/
- copied from r45856, kukit/kss.concatresource/trunk/
Log:
Create branch for version
From reebalazs at codespeak.net Sun Aug 19 14:30:03 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Sun, 19 Aug 2007 14:30:03 +0200 (CEST)
Subject: [KSS-checkins] r45858 - kukit/kss.core/branch/1.2
Message-ID: <20070819123003.82AD281D0@code0.codespeak.net>
Author: reebalazs
Date: Sun Aug 19 14:30:03 2007
New Revision: 45858
Added:
kukit/kss.core/branch/1.2/
- copied from r45857, kukit/kss.core/trunk/
Log:
Create branch for version
From reebalazs at codespeak.net Sun Aug 19 14:30:21 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Sun, 19 Aug 2007 14:30:21 +0200 (CEST)
Subject: [KSS-checkins] r45859 - kukit/kss.demo/branch/1.2
Message-ID: <20070819123021.D8D3481D0@code0.codespeak.net>
Author: reebalazs
Date: Sun Aug 19 14:30:21 2007
New Revision: 45859
Added:
kukit/kss.demo/branch/1.2/
- copied from r45858, kukit/kss.demo/trunk/
Log:
Create branch for version
From reebalazs at codespeak.net Sun Aug 19 14:32:56 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Sun, 19 Aug 2007 14:32:56 +0200 (CEST)
Subject: [KSS-checkins] r45860 - kukit/kss.demo/branch/1.2
Message-ID: <20070819123256.C24E38064@code0.codespeak.net>
Author: reebalazs
Date: Sun Aug 19 14:32:52 2007
New Revision: 45860
Modified:
kukit/kss.demo/branch/1.2/setup.py
Log:
Set branch
Modified: kukit/kss.demo/branch/1.2/setup.py
==============================================================================
--- kukit/kss.demo/branch/1.2/setup.py (original)
+++ kukit/kss.demo/branch/1.2/setup.py Sun Aug 19 14:32:52 2007
@@ -32,6 +32,6 @@
# -*- Entry points: -*-
""",
dependency_links=[
- 'https://codespeak.net/svn/kukit/kss.core/trunk#egg=kss.core-dev',
+ 'https://codespeak.net/svn/kukit/kss.core/branch/1.2#egg=kss.core-dev',
],
)
From reebalazs at codespeak.net Sun Aug 19 14:34:38 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Sun, 19 Aug 2007 14:34:38 +0200 (CEST)
Subject: [KSS-checkins] r45861 - in kukit/kss.core/branch/1.2/kss/core: .
pluginregistry
Message-ID: <20070819123438.002C281B1@code0.codespeak.net>
Author: reebalazs
Date: Sun Aug 19 14:34:38 2007
New Revision: 45861
Modified:
kukit/kss.core/branch/1.2/kss/core/ (props changed)
kukit/kss.core/branch/1.2/kss/core/EXTERNALS.TXT
kukit/kss.core/branch/1.2/kss/core/pluginregistry/ (props changed)
kukit/kss.core/branch/1.2/kss/core/pluginregistry/EXTERNALS.TXT
Log:
Set branch
Modified: kukit/kss.core/branch/1.2/kss/core/EXTERNALS.TXT
==============================================================================
--- kukit/kss.core/branch/1.2/kss/core/EXTERNALS.TXT (original)
+++ kukit/kss.core/branch/1.2/kss/core/EXTERNALS.TXT Sun Aug 19 14:34:38 2007
@@ -5,4 +5,4 @@
# You can update your working dir by:
# svn propset svn:externals -F EXTERNALS.TXT .
#
-kukit http://codespeak.net/svn/kukit/kukit.js/trunk
+kukit http://codespeak.net/svn/kukit/kukit.js/branch/1.2
Modified: kukit/kss.core/branch/1.2/kss/core/pluginregistry/EXTERNALS.TXT
==============================================================================
--- kukit/kss.core/branch/1.2/kss/core/pluginregistry/EXTERNALS.TXT (original)
+++ kukit/kss.core/branch/1.2/kss/core/pluginregistry/EXTERNALS.TXT Sun Aug 19 14:34:38 2007
@@ -7,4 +7,4 @@
#
# concatresource is now included like as batteries
-_concatresource https://codespeak.net/svn/kukit/kss.concatresource/trunk/kss/concatresource
+_concatresource https://codespeak.net/svn/kukit/kss.concatresource/branch/1.2/kss/concatresource
From reebalazs at codespeak.net Sun Aug 19 14:37:36 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Sun, 19 Aug 2007 14:37:36 +0200 (CEST)
Subject: [KSS-checkins] r45862 - in kukit/kss.concatresource/trunk: . docs
kss/concatresource
Message-ID: <20070819123736.3463081B1@code0.codespeak.net>
Author: reebalazs
Date: Sun Aug 19 14:37:33 2007
New Revision: 45862
Modified:
kukit/kss.concatresource/trunk/docs/HISTORY.txt
kukit/kss.concatresource/trunk/kss/concatresource/version.txt
kukit/kss.concatresource/trunk/setup.py
Log:
Increase version on trunk
Modified: kukit/kss.concatresource/trunk/docs/HISTORY.txt
==============================================================================
--- kukit/kss.concatresource/trunk/docs/HISTORY.txt (original)
+++ kukit/kss.concatresource/trunk/docs/HISTORY.txt Sun Aug 19 14:37:33 2007
@@ -2,7 +2,7 @@
(name of developer listed in brackets)
-kss.concatresource - 1.2dev Unreleased
+kss.concatresource - 1.4dev Unreleased
- ...
Modified: kukit/kss.concatresource/trunk/kss/concatresource/version.txt
==============================================================================
--- kukit/kss.concatresource/trunk/kss/concatresource/version.txt (original)
+++ kukit/kss.concatresource/trunk/kss/concatresource/version.txt Sun Aug 19 14:37:33 2007
@@ -1 +1 @@
-1.2dev Unreleased
+1.4dev Unreleased
Modified: kukit/kss.concatresource/trunk/setup.py
==============================================================================
--- kukit/kss.concatresource/trunk/setup.py (original)
+++ kukit/kss.concatresource/trunk/setup.py Sun Aug 19 14:37:33 2007
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
-version = '1.2'
+version = '1.4'
setup(name='concatresource',
version=version,
@@ -30,6 +30,5 @@
# -*- Entry points: -*-
""",
dependency_links=[
- 'https://codespeak.net/svn/kukit/kss.concatresource/trunk#egg=kss.concatresource-dev',
],
)
From reebalazs at codespeak.net Sun Aug 19 14:39:12 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Sun, 19 Aug 2007 14:39:12 +0200 (CEST)
Subject: [KSS-checkins] r45863 - in kukit/kukit.js/trunk: . doc
Message-ID: <20070819123912.04E2781B1@code0.codespeak.net>
Author: reebalazs
Date: Sun Aug 19 14:39:11 2007
New Revision: 45863
Modified:
kukit/kukit.js/trunk/doc/HISTORY.txt
kukit/kukit.js/trunk/version.txt
Log:
Increase version on trunk
Modified: kukit/kukit.js/trunk/doc/HISTORY.txt
==============================================================================
--- kukit/kukit.js/trunk/doc/HISTORY.txt (original)
+++ kukit/kukit.js/trunk/doc/HISTORY.txt Sun Aug 19 14:39:11 2007
@@ -2,7 +2,7 @@
(name of developer listed in brackets)
-kukit.js - 1.2dev Unreleased
+kukit.js - 1.4dev Unreleased
- ...
Modified: kukit/kukit.js/trunk/version.txt
==============================================================================
--- kukit/kukit.js/trunk/version.txt (original)
+++ kukit/kukit.js/trunk/version.txt Sun Aug 19 14:39:11 2007
@@ -1 +1 @@
-1.2dev unreleased
+1.4dev unreleased
From reebalazs at codespeak.net Sun Aug 19 14:41:20 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Sun, 19 Aug 2007 14:41:20 +0200 (CEST)
Subject: [KSS-checkins] r45864 - in kukit/kss.core/trunk: . docs kss/core
Message-ID: <20070819124120.05DC381B1@code0.codespeak.net>
Author: reebalazs
Date: Sun Aug 19 14:41:20 2007
New Revision: 45864
Modified:
kukit/kss.core/trunk/docs/HISTORY.txt
kukit/kss.core/trunk/kss/core/version.txt
kukit/kss.core/trunk/setup.py
Log:
Increase version on trunk
Modified: kukit/kss.core/trunk/docs/HISTORY.txt
==============================================================================
--- kukit/kss.core/trunk/docs/HISTORY.txt (original)
+++ kukit/kss.core/trunk/docs/HISTORY.txt Sun Aug 19 14:41:20 2007
@@ -2,7 +2,7 @@
(name of developer listed in brackets)
-kss.core - 1.2dev Unreleased
+kss.core - 1.4dev Unreleased
- ...
Modified: kukit/kss.core/trunk/kss/core/version.txt
==============================================================================
--- kukit/kss.core/trunk/kss/core/version.txt (original)
+++ kukit/kss.core/trunk/kss/core/version.txt Sun Aug 19 14:41:20 2007
@@ -1 +1 @@
-1.2dev unreleased
+1.4dev unreleased
Modified: kukit/kss.core/trunk/setup.py
==============================================================================
--- kukit/kss.core/trunk/setup.py (original)
+++ kukit/kss.core/trunk/setup.py Sun Aug 19 14:41:20 2007
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
import sys, os
-version = '1.2'
+version = '1.4'
setup(name='kss.core',
version=version,
From reebalazs at codespeak.net Sun Aug 19 14:42:27 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Sun, 19 Aug 2007 14:42:27 +0200 (CEST)
Subject: [KSS-checkins] r45865 - in kukit/kss.demo/trunk: . docs kss/demo
Message-ID: <20070819124227.B16AD81B1@code0.codespeak.net>
Author: reebalazs
Date: Sun Aug 19 14:42:27 2007
New Revision: 45865
Modified:
kukit/kss.demo/trunk/docs/HISTORY.txt
kukit/kss.demo/trunk/kss/demo/version.txt
kukit/kss.demo/trunk/setup.py
Log:
Increase version on trunk
Modified: kukit/kss.demo/trunk/docs/HISTORY.txt
==============================================================================
--- kukit/kss.demo/trunk/docs/HISTORY.txt (original)
+++ kukit/kss.demo/trunk/docs/HISTORY.txt Sun Aug 19 14:42:27 2007
@@ -2,7 +2,7 @@
(name of developer listed in brackets)
-kss.demo - 1.2dev Unreleased
+kss.demo - 1.4dev Unreleased
- ...
Modified: kukit/kss.demo/trunk/kss/demo/version.txt
==============================================================================
--- kukit/kss.demo/trunk/kss/demo/version.txt (original)
+++ kukit/kss.demo/trunk/kss/demo/version.txt Sun Aug 19 14:42:27 2007
@@ -1 +1 @@
-1.2dev Unreleased
+1.4dev Unreleased
Modified: kukit/kss.demo/trunk/setup.py
==============================================================================
--- kukit/kss.demo/trunk/setup.py (original)
+++ kukit/kss.demo/trunk/setup.py Sun Aug 19 14:42:27 2007
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
import sys, os
-version = '1.2'
+version = '1.4'
setup(name='kss.demo',
version=version,
From reebalazs at codespeak.net Mon Aug 27 09:28:39 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Mon, 27 Aug 2007 09:28:39 +0200 (CEST)
Subject: [KSS-checkins] r46003 - kukit/kss.core/trunk/kss/core/plugins/core
Message-ID: <20070827072839.9968481E2@code0.codespeak.net>
Author: reebalazs
Date: Mon Aug 27 09:28:38 2007
New Revision: 46003
Modified:
kukit/kss.core/trunk/kss/core/plugins/core/commands.py
Log:
Small refactoring of parameter adding, use the helpers
Modified: kukit/kss.core/trunk/kss/core/plugins/core/commands.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/commands.py (original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/commands.py Mon Aug 27 09:28:38 2007
@@ -29,16 +29,14 @@
def replaceInnerHTML(self, selector, new_value, withKssSetup='True'):
""" see interfaces.py """
- new_value = HtmlParser(new_value)().encode('ascii', 'xmlcharrefreplace')
command = self.commands.addCommand('replaceInnerHTML', selector)
- data = command.addParam('html', new_value)
+ data = command.addHtmlParam('html', new_value)
data = command.addParam('withKssSetup', withKssSetup)
def replaceHTML(self, selector, new_value, withKssSetup='True'):
""" see interfaces.py """
- new_value = HtmlParser(new_value)().encode('ascii', 'xmlcharrefreplace')
command = self.commands.addCommand('replaceHTML', selector)
- data = command.addParam('html', new_value)
+ data = command.addHtmlParam('html', new_value)
data = command.addParam('withKssSetup', withKssSetup)
def setAttribute(self, selector, name, value):
@@ -55,30 +53,26 @@
def insertHTMLAfter(self, selector, new_value, withKssSetup='True'):
""" see interfaces.py """
- new_value = HtmlParser(new_value)().encode('ascii', 'xmlcharrefreplace')
command = self.commands.addCommand('insertHTMLAfter', selector)
- data = command.addParam('html', new_value)
+ data = command.addHtmlParam('html', new_value)
data = command.addParam('withKssSetup', withKssSetup)
def insertHTMLAsFirstChild(self, selector, new_value, withKssSetup='True'):
""" see interfaces.py """
- new_value = HtmlParser(new_value)().encode('ascii', 'xmlcharrefreplace')
command = self.commands.addCommand('insertHTMLAsFirstChild', selector)
- data = command.addParam('html', new_value)
+ data = command.addHtmlParam('html', new_value)
data = command.addParam('withKssSetup', withKssSetup)
def insertHTMLAsLastChild(self, selector, new_value, withKssSetup='True'):
""" see interfaces.py """
- new_value = HtmlParser(new_value)().encode('ascii', 'xmlcharrefreplace')
command = self.commands.addCommand('insertHTMLAsLastChild', selector)
- data = command.addParam('html', new_value)
+ data = command.addHtmlParam('html', new_value)
data = command.addParam('withKssSetup', withKssSetup)
def insertHTMLBefore(self, selector, new_value, withKssSetup='True'):
""" see interfaces.py """
- new_value = HtmlParser(new_value)().encode('ascii', 'xmlcharrefreplace')
command = self.commands.addCommand('insertHTMLBefore', selector)
- data = command.addParam('html', new_value)
+ data = command.addHtmlParam('html', new_value)
data = command.addParam('withKssSetup', withKssSetup)
def clearChildNodes(self, selector):
From gotcha at codespeak.net Mon Aug 27 11:59:36 2007
From: gotcha at codespeak.net (gotcha at codespeak.net)
Date: Mon, 27 Aug 2007 11:59:36 +0200 (CEST)
Subject: [KSS-checkins] r46013 - kukit/kss.demo/trunk/kss/demo/browser
Message-ID: <20070827095936.6C7D181F3@code0.codespeak.net>
Author: gotcha
Date: Mon Aug 27 11:59:35 2007
New Revision: 46013
Modified:
kukit/kss.demo/trunk/kss/demo/browser/header_macros.pt
Log:
Detabbing
Modified: kukit/kss.demo/trunk/kss/demo/browser/header_macros.pt
==============================================================================
--- kukit/kss.demo/trunk/kss/demo/browser/header_macros.pt (original)
+++ kukit/kss.demo/trunk/kss/demo/browser/header_macros.pt Mon Aug 27 11:59:35 2007
@@ -1,12 +1,12 @@
-
-
+
+
-
+
@@ -34,7 +34,7 @@
-
+
@@ -55,9 +55,9 @@
-
-
-
+
+
+
@@ -78,9 +78,9 @@
-
-
-
+
+
+
From gotcha at codespeak.net Mon Aug 27 12:29:43 2007
From: gotcha at codespeak.net (gotcha at codespeak.net)
Date: Mon, 27 Aug 2007 12:29:43 +0200 (CEST)
Subject: [KSS-checkins] r46014 -
kukit/kss.core/trunk/kss/core/pluginregistry/browser
Message-ID: <20070827102943.7371481F5@code0.codespeak.net>
Author: gotcha
Date: Mon Aug 27 12:29:42 2007
New Revision: 46014
Modified:
kukit/kss.core/trunk/kss/core/pluginregistry/browser/develui.pt
Log:
Use kukit version specified by devel-mode
Modified: kukit/kss.core/trunk/kss/core/pluginregistry/browser/develui.pt
==============================================================================
--- kukit/kss.core/trunk/kss/core/pluginregistry/browser/develui.pt (original)
+++ kukit/kss.core/trunk/kss/core/pluginregistry/browser/develui.pt Mon Aug 27 12:29:42 2007
@@ -36,9 +36,14 @@
src="++resource++MochiKit.js">
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- KSS ECMAScript Unit Tests
-
-
-
- This page is the entry to the ECMAScript Unit Tests.
-
This page is the entry to the ECMAScript Unit Tests.
Modified: kukit/kukit.js/trunk/tests/test_tokenizer.js
==============================================================================
--- kukit/kukit.js/trunk/tests/test_tokenizer.js (original)
+++ kukit/kukit.js/trunk/tests/test_tokenizer.js Mon Aug 27 13:27:26 2007
@@ -46,6 +46,8 @@
};
this.assertParsingError = function(pclass, src, tokenClass, eofOk, errtxt, errpos) {
+ if (! kukit.Engine.develMode) {
+ return; }
var exc = null;
try {
new pclass(src, tokenClass, eofOk);
@@ -78,6 +80,8 @@
};
this.testException = function() {
+ if (! kukit.Engine.develMode) {
+ return; }
var exc = null;
try {
throw new kukit.err.tk.ParsingError('Error happened');
@@ -95,6 +99,8 @@
};
this.testExceptionWithRowCol = function() {
+ if (! kukit.Engine.develMode) {
+ return; }
var exc = null;
var cursor = new kukit.tk.Cursor('1234\n1234\n1234\n1234\n');
var marker = cursor.makeMarker(13);
From gotcha at codespeak.net Mon Aug 27 14:50:44 2007
From: gotcha at codespeak.net (gotcha at codespeak.net)
Date: Mon, 27 Aug 2007 14:50:44 +0200 (CEST)
Subject: [KSS-checkins] r46020 - in kukit/kukit.js/trunk: kukit tests
Message-ID: <20070827125044.396FA8207@code0.codespeak.net>
Author: gotcha
Date: Mon Aug 27 14:50:42 2007
New Revision: 46020
Modified:
kukit/kukit.js/trunk/kukit/kssparser.js
kukit/kukit.js/trunk/kukit/tokenizer.js
kukit/kukit.js/trunk/tests/test_kssparser.js
Log:
Renamed PropValueInPseudo to EventValue ; cleaned up isToken
Modified: kukit/kukit.js/trunk/kukit/kssparser.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/kssparser.js (original)
+++ kukit/kukit.js/trunk/kukit/kssparser.js Mon Aug 27 14:50:42 2007
@@ -351,7 +351,7 @@
this.digestTxt(cursor, kukit.tk.Fraction, kukit.kssp.Comment);
this.txt = '';
var txt = cursor.txt;
- if (this.ifToken(cursor, kukit.kssp.String)) {
+ if (this.isToken(cursor, kukit.kssp.String)) {
// The previous txt must be all whitespace.
if (txt) {
;;; kukit.E = 'Wrong value : unallowed characters [' + txt + ']';
@@ -361,7 +361,7 @@
// the next one must be a string.
this.expectToken(cursor, kukit.kssp.String);
this.produceTxt(cursor.token.txt);
- } else if (this.ifToken(cursor, kukit.kssp.MethodArgs)) {
+ } else if (this.isToken(cursor, kukit.kssp.MethodArgs)) {
// see if not empty and has no spaces in it
if (! txt || txt.indexOf(' ') != -1) {
;;; kukit.E = 'Wrong value : method name [' + txt + '] cannot ';
@@ -422,11 +422,11 @@
};
/*
-* class PropValueInPseudo
+* class EventValue
*
* PropValue in pseudo must ba single word with no spaces around.
*/
-kukit.kssp.PropValueInPseudo = kukit.tk.mkParser('propvalue', {
+kukit.kssp.EventValue = kukit.tk.mkParser('propvalue', {
"{": 'this.emitAndReturn()',
" ": 'this.emitAndReturn()',
"\t": 'this.emitAndReturn()',
@@ -437,11 +437,11 @@
"(": 'this.emitAndReturn(new kukit.kssp.MethodArgs(this.src,' +
'kukit.kssp.openparent))'
});
-kukit.kssp.PropValueInPseudo.prototype.multiword_allowed = false;
-kukit.kssp.PropValueInPseudo.prototype.process =
+kukit.kssp.EventValue.prototype.multiword_allowed = false;
+kukit.kssp.EventValue.prototype.process =
kukit.kssp.PropValue.prototype.process;
-kukit.kssp.PropValueInPseudo.prototype.valueClass = kukit.rd.KssPseudoValue;
-kukit.kssp.PropValueInPseudo.prototype.produceTxt = function(txt) {
+kukit.kssp.EventValue.prototype.valueClass = kukit.rd.KssPseudoValue;
+kukit.kssp.EventValue.prototype.produceTxt = function(txt) {
// txt parms are returned embedded
this.value = new kukit.rd.KssPseudoValue(txt, []);
};
@@ -544,7 +544,7 @@
*/
kukit.kssp.KssSelector = kukit.tk.mkParser('kssselector', {
":": '[new kukit.kssp.colon(this.src), new ' +
- 'kukit.kssp.PropValueInPseudo(this.src)]',
+ 'kukit.kssp.EventValue(this.src)]',
"{": 'this.emitAndReturn()',
"\/\*": 'new kukit.kssp.Comment(this.src, kukit.kssp.commentbegin)'
});
@@ -581,7 +581,7 @@
tokenindex -= 2;
if (tokenindex < 0
|| (this.result[tokenindex+2].symbol !=
- kukit.kssp.PropValueInPseudo.prototype.symbol)
+ kukit.kssp.EventValue.prototype.symbol)
|| (this.result[tokenindex+1].symbol !=
kukit.kssp.colon.prototype.symbol)
|| (this.result[tokenindex].symbol !=
Modified: kukit/kukit.js/trunk/kukit/tokenizer.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/tokenizer.js (original)
+++ kukit/kukit.js/trunk/kukit/tokenizer.js Mon Aug 27 14:50:42 2007
@@ -125,14 +125,22 @@
cursor.next += 1;
};
-kukit.tk._ParserBase.prototype.ifToken =
+kukit.tk._ParserBase.prototype.resultIsNullOrNotToken =
+ function(token, currentValue) {
+ return (!token || currentValue.symbol != token.prototype.symbol);
+};
+
+kukit.tk._ParserBase.prototype.isToken =
function(cursor, token1, token2, token3, token4) {
var i = cursor.next;
- return (! (i >= this.result.length ||
- this.result[i].symbol != token1.prototype.symbol
- && (!token2 || this.result[i].symbol != token2.prototype.symbol
- && (!token3 || this.result[i].symbol != token3.prototype.symbol
- && (!token4 || this.result[i].symbol != token4.prototype.symbol)))));
+ var currentValue = this.result[i];
+ return !(
+ (i >= this.result.length) ||
+ (this.resultIsNullOrNotToken(token1, currentValue) &&
+ this.resultIsNullOrNotToken(token2, currentValue) &&
+ this.resultIsNullOrNotToken(token3, currentValue) &&
+ this.resultIsNullOrNotToken(token4, currentValue))
+ );
};
kukit.tk._ParserBase.prototype.digestTxt =
@@ -148,7 +156,7 @@
// digests the txt from the tokens, ignores given token
// exact value: no whitespace removal
var result = '';
- while (this.ifToken(cursor, token1, token2, token3, token4)) {
+ while (this.isToken(cursor, token1, token2, token3, token4)) {
result += this.result[cursor.next].txt;
cursor.next ++;
}
Modified: kukit/kukit.js/trunk/tests/test_kssparser.js
==============================================================================
--- kukit/kukit.js/trunk/tests/test_kssparser.js (original)
+++ kukit/kukit.js/trunk/tests/test_kssparser.js Mon Aug 27 14:50:42 2007
@@ -218,19 +218,19 @@
'Wrong value : unallowed characters after the property', 17);
};
- this.testPropValueInPseudo = function() {
+ this.testEventValue = function() {
// Parsing prop values in pseudo (no methods allowed)
var txt= "b";
var src = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.PropValueInPseudo(src, null, true);
+ var parser = new kukit.kssp.EventValue(src, null, true);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.value.methodName, 'b');
// multiword ok but does not finish
txt= "b c";
src = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.PropValueInPseudo(src, null, true);
+ parser = new kukit.kssp.EventValue(src, null, true);
this.assertEquals(parser.finished, true);
this.assertEquals(src.pos, 1);
this.assertEquals(parser.value.methodName, 'b');
@@ -238,7 +238,7 @@
// space ok but does not finish
txt= " b";
src = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.PropValueInPseudo(src, null, true);
+ parser = new kukit.kssp.EventValue(src, null, true);
this.assertEquals(parser.finished, true);
this.assertEquals(src.pos, 0);
this.assertEquals(parser.value.methodName, '');
@@ -246,7 +246,7 @@
// ok, does not finish
txt= "apples/* more comments and*/";
src = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.PropValueInPseudo(src, null, true);
+ parser = new kukit.kssp.EventValue(src, null, true);
this.assertEquals(parser.finished, true);
this.assertEquals(src.pos, 6);
this.assertEquals(parser.value.methodName, 'apples');
@@ -254,7 +254,7 @@
// params ok
txt= "click(x)";
src = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.PropValueInPseudo(src, null, true);
+ parser = new kukit.kssp.EventValue(src, null, true);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.value.methodName, 'click');
this.assertListEquals(parser.value.args, ['x']);
@@ -266,7 +266,7 @@
// not ok but we don't parse an error
//txt= "'drag'(x)";
//src = new kukit.tk.Cursor(txt);
- //this.assertParsingError(kukit.kssp.PropValueInPseudo, src, null, true,
+ //this.assertParsingError(kukit.kssp.EventValue, src, null, true,
// 'Excess characters after the property value', 16);
};
From jvloothuis at codespeak.net Mon Aug 27 15:35:11 2007
From: jvloothuis at codespeak.net (jvloothuis at codespeak.net)
Date: Mon, 27 Aug 2007 15:35:11 +0200 (CEST)
Subject: [KSS-checkins] r46024 - kukit/kss.base
Message-ID: <20070827133511.285C28206@code0.codespeak.net>
Author: jvloothuis
Date: Mon Aug 27 15:35:10 2007
New Revision: 46024
Added:
kukit/kss.base/
Log:
New package for merging the different Python packages
From jvloothuis at codespeak.net Mon Aug 27 15:35:19 2007
From: jvloothuis at codespeak.net (jvloothuis at codespeak.net)
Date: Mon, 27 Aug 2007 15:35:19 +0200 (CEST)
Subject: [KSS-checkins] r46025 - kukit/kss.base/trunk
Message-ID: <20070827133519.EE94581F6@code0.codespeak.net>
Author: jvloothuis
Date: Mon Aug 27 15:35:19 2007
New Revision: 46025
Added:
kukit/kss.base/trunk/
Log:
From reebalazs at codespeak.net Mon Aug 27 15:38:03 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Mon, 27 Aug 2007 15:38:03 +0200 (CEST)
Subject: [KSS-checkins] r46026 - in kukit/kukit.js/trunk: doc kukit
Message-ID: <20070827133803.10AE281FC@code0.codespeak.net>
Author: reebalazs
Date: Mon Aug 27 15:38:02 2007
New Revision: 46026
Modified:
kukit/kukit.js/trunk/doc/HISTORY.txt
kukit/kukit.js/trunk/kukit/commandprocessor.js
kukit/kukit.js/trunk/kukit/dom.js
kukit/kukit.js/trunk/kukit/plugin.js
Log:
Changed kukit payload to encode HTML content of CDATA (fixes base2)
Modified: kukit/kukit.js/trunk/doc/HISTORY.txt
==============================================================================
--- kukit/kukit.js/trunk/doc/HISTORY.txt (original)
+++ kukit/kukit.js/trunk/doc/HISTORY.txt Mon Aug 27 15:38:02 2007
@@ -6,6 +6,13 @@
- ...
+ - Changed kukit payload to encode HTML content of CDATA.
+ This was necessary because us a supposed bug in FF, that
+ prevented us to use base2 (xpath selection did not work
+ on inserted elements, due to namespace issues.)
+ Get rid of forceToDom, make sure all plugins accept html
+ parameters as strings.
+
kukit.js - 1.2 Released 2007-08-17
- Move ;;; markers to first columns.
Modified: kukit/kukit.js/trunk/kukit/commandprocessor.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/commandprocessor.js (original)
+++ kukit/kukit.js/trunk/kukit/commandprocessor.js Mon Aug 27 15:38:02 2007
@@ -79,14 +79,21 @@
var childCount = childNode.childNodes.length;
var result;
if (childCount == 0) {
- // We take this a string (although this could be dom)
result = '';
- } else if (childCount == 1 && childNode.firstChild.nodeType == 3) {
+ } else {
+ // (we do not interpret html inline content any more)
// we have a single text node
+ // OR
+ // we have a single CDATA node (HTML parameter CDATA-style)
+ ;;; var isTextNode = childNode.firstChild.nodeType == 3;
+ ;;; var isCData = childNode.firstChild.nodeType == 4;
+ ;;; if (! (childCount == 1 && (isTextNode || isCData))) {
+ ;;; kukit.E = 'Bad payload, expected a text or a CDATA node';
+ ;;; throw kukit.E;
+ ;;; }
+ // we consider this as html payload
+ // The result is always a string from here.
result = childNode.firstChild.nodeValue;
- } else {
- // dom
- result = childNode;
}
params[data] = result;
} else {
Modified: kukit/kukit.js/trunk/kukit/dom.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/dom.js (original)
+++ kukit/kukit.js/trunk/kukit/dom.js Mon Aug 27 15:38:02 2007
@@ -37,39 +37,16 @@
return toNode;
};
-kukit.dom.insertBefore = function(nodeFrom, parentNode, nodeTo) {
- var ownerDoc = nodeTo.nodeType == Node.DOCUMENT_NODE ?
- nodeTo : nodeTo.ownerDocument;
- var nodes = nodeFrom.childNodes;
- var result = new Array();
- if(ownerDoc.importNode && (!kukit.HAVE_IE)) {
- for(var i=0;i < nodes.length;i++) {
- var imported = ownerDoc.importNode(nodes[i], true);
- result[i] = parentNode.insertBefore(imported, nodeTo);
- }
- } else {
- for(var i=0;i < nodes.length;i++) {
- var cloned = nodes[i].cloneNode(true);
- result[i] = parentNode.insertBefore(cloned, nodeTo);
- }
+kukit.dom.insertBefore = function(nodes, parentNode, toNode) {
+ for(var i=0; itest_xmlentity
-//
-
-// ***BROKEN*** param
-//
-//
-
-// param
-//
-
-// This is a good solution since it does not do magic to
-// our html - BUT html is parsed as xml
-// so we currently preprocess it on the server
-// and remove html named entities from it.
-//
- var rootText = '
';
- rootText += param + '
';
- var doc = (new DOMParser()).parseFromString(rootText, "text/xml");
- var root = doc.getElementsByTagName('div')[0];
-
- // XXX Sarissa bug; html docs would not have a
- // working serialize, and so importNodes would fail on them.
- // XXX Fixed in: Revision 1.23 - Sun Jul 10 18:53:53 2005 UTC
- // use at least 0.9.6.1
-
- param = root;
- }
- // Need to do this or else IE fails miserably.
- // importNode acts strangely.
- // on FF, you can execute it several times but the next condition
- // always evaluated to False.
- // on IE, it is a big problem to execute this for the second time
- // but it needs to be executed once, thus the condition
- if (param.ownerDocument != document) {
- param = document.importNode(param, true);
+
+kukit.dom.parseHTMLNodes = function(txt){
+ var node = document.createElement('div');
+ node.innerHTML = txt;
+ var resultNodes = [];
+ for (var i=0; i 0) {
var parentNode = node.parentNode;
@@ -689,21 +681,18 @@
;;; oper.componentName = '[insertHTMLAfter] action';
oper.evaluateParameters(['html'], {'withKssSetup':true});
oper.evalBool('withKssSetup');
- oper.parms.html = kukit.dom.forceToDom(oper.parms.html);
- var content = oper.parms.html;
+ var content = kukit.dom.parseHTMLNodes(oper.parms.html);
var parentNode = oper.node.parentNode;
var toNode = kukit.dom.getNextSiblingTag(oper.node);
- var insertedNodes;
if (toNode == null) {
- insertedNodes = kukit.dom.appendChildren(content.childNodes,
- parentNode);
+ kukit.dom.appendChildren(content, parentNode);
} else {
- insertedNodes = kukit.dom.insertBefore(content, parentNode, toNode);
+ kukit.dom.insertBefore(content, parentNode, toNode);
}
-;;; kukit.logDebug(insertedNodes.length + ' nodes inserted.');
+;;; kukit.logDebug(content.length + ' nodes inserted.');
// update the events for the new nodes
if (oper.parms.withKssSetup) {
- kukit.engine.setupEvents(insertedNodes);
+ kukit.engine.setupEvents(content);
}
});
kukit.commandsGlobalRegistry.registerFromAction('insertHTMLAfter',
@@ -713,15 +702,14 @@
;;; oper.componentName = '[insertHTMLBefore] action';
oper.evaluateParameters(['html'], {'withKssSetup':true});
oper.evalBool('withKssSetup');
- oper.parms.html = kukit.dom.forceToDom(oper.parms.html);
- var content = oper.parms.html;
+ var content = kukit.dom.parseHTMLNodes(oper.parms.html);
var toNode = oper.node;
var parentNode = toNode.parentNode;
- var insertedNodes = kukit.dom.insertBefore(content, parentNode, toNode);
-;;; kukit.logDebug(insertedNodes.length + ' nodes inserted.');
+ kukit.dom.insertBefore(content, parentNode, toNode);
+;;; kukit.logDebug(content.length + ' nodes inserted.');
// update the events for the new nodes
if (oper.parms.withKssSetup) {
- kukit.engine.setupEvents(insertedNodes);
+ kukit.engine.setupEvents(content);
}
});
kukit.commandsGlobalRegistry.registerFromAction('insertHTMLBefore',
@@ -731,15 +719,12 @@
;;; oper.componentName = '[insertHTMLAsLastChild] action';
oper.evaluateParameters(['html'], {'withKssSetup':true});
oper.evalBool('withKssSetup');
- oper.parms.html = kukit.dom.forceToDom(oper.parms.html);
- var insertedNodes = kukit.dom.appendChildren(oper.parms.html,
- oper.node);
- insertedNodes = kukit.dom.appendChildren(oper.parms.html.childNodes,
- oper.node);
-;;; kukit.logDebug(insertedNodes.length + ' nodes inserted.');
+ var content = kukit.dom.parseHTMLNodes(oper.parms.html);
+ kukit.dom.appendChildren(content, oper.node);
+;;; kukit.logDebug(content.length + ' nodes inserted.');
// update the events for the new nodes
if (oper.parms.withKssSetup) {
- kukit.engine.setupEvents(insertedNodes);
+ kukit.engine.setupEvents(content);
}
});
kukit.commandsGlobalRegistry.registerFromAction('insertHTMLAsLastChild',
@@ -749,21 +734,18 @@
;;; oper.componentName = '[insertHTMLAsFirstChild] action';
oper.evaluateParameters(['html'], {'withKssSetup':true});
oper.evalBool('withKssSetup');
- oper.parms.html = kukit.dom.forceToDom(oper.parms.html);
- var content = oper.parms.html;
+ var content = kukit.dom.parseHTMLNodes(oper.parms.html);
var parentNode = oper.node;
var toNode = parentNode.firstChild;
- var insertedNodes;
if (toNode == null) {
- insertedNodes = kukit.dom.appendChildren(content.childNodes,
- parentNode);
+ kukit.dom.appendChildren(content, parentNode);
} else {
- insertedNodes = kukit.dom.insertBefore(content, parentNode, toNode);
+ kukit.dom.insertBefore(content, parentNode, toNode);
}
-;;; kukit.logDebug(insertedNodes.length + ' nodes inserted.');
+;;; kukit.logDebug(content.length + ' nodes inserted.');
// update the events for the new nodes
if (oper.parms.withKssSetup) {
- kukit.engine.setupEvents(insertedNodes);
+ kukit.engine.setupEvents(content);
}
});
kukit.commandsGlobalRegistry.registerFromAction('insertHTMLAsFirstChild',
From reebalazs at codespeak.net Mon Aug 27 15:41:21 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Mon, 27 Aug 2007 15:41:21 +0200 (CEST)
Subject: [KSS-checkins] r46027 - in kukit/kss.core/trunk: docs kss/core
Message-ID: <20070827134121.E6C0481FC@code0.codespeak.net>
Author: reebalazs
Date: Mon Aug 27 15:41:21 2007
New Revision: 46027
Modified:
kukit/kss.core/trunk/docs/HISTORY.txt
kukit/kss.core/trunk/kss/core/commands.py
Log:
Changed kukit payload to encode HTML content of CDATA (fixes base2)
Modified: kukit/kss.core/trunk/docs/HISTORY.txt
==============================================================================
--- kukit/kss.core/trunk/docs/HISTORY.txt (original)
+++ kukit/kss.core/trunk/docs/HISTORY.txt Mon Aug 27 15:41:21 2007
@@ -6,6 +6,13 @@
- ...
+ - Changed kukit payload to encode HTML content of CDATA.
+ This was necessary because us a supposed bug in FF, that
+ prevented us to use base2 (xpath selection did not work
+ on inserted elements, due to namespace issues.)
+ Get rid of forceToDom, make sure all plugins accept html
+ parameters as strings.
+
kss.core - 1.2 Released 2007-08-17
- Refactored js code.
Modified: kukit/kss.core/trunk/kss/core/commands.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/commands.py (original)
+++ kukit/kss.core/trunk/kss/core/commands.py Mon Aug 27 15:41:21 2007
@@ -127,7 +127,9 @@
def addHtmlParam(self, name, content=''):
'Add the param as an HTML content.'
content = HtmlParser(content)().encode('ascii', 'xmlcharrefreplace')
- self.addParam(name, content=content)
+ ##self.addParam(name, content=content)
+ # add html as cdata!
+ self.addCdataParam(name, content=content)
def addXmlParam(self, name, content=''):
'Add the param as XML content'
From reebalazs at codespeak.net Mon Aug 27 16:06:32 2007
From: reebalazs at codespeak.net (reebalazs at codespeak.net)
Date: Mon, 27 Aug 2007 16:06:32 +0200 (CEST)
Subject: [KSS-checkins] r46031 - kukit/kukit.js/trunk/kukit
Message-ID: <20070827140632.6CC8D81F6@code0.codespeak.net>
Author: reebalazs
Date: Mon Aug 27 16:06:31 2007
New Revision: 46031
Modified:
kukit/kukit.js/trunk/kukit/plugin.js
Log:
Fix bug in replaceInnerHTML. (Caused content not bound.)
Modified: kukit/kukit.js/trunk/kukit/plugin.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/plugin.js (original)
+++ kukit/kukit.js/trunk/kukit/plugin.js Mon Aug 27 16:06:31 2007
@@ -590,9 +590,12 @@
oper.evaluateParameters(['html'], {'withKssSetup': true});
oper.evalBool('withKssSetup');
var node = oper.node;
- var insertedNodes;
node.innerHTML = oper.parms.html;
- insertedNodes = node.childNodes;
+ var insertedNodes = [];
+ for (var i=0; i 0) {
var parentNode = node.parentNode;
var insertedNodes = [];
From jvloothuis at codespeak.net Mon Aug 27 16:29:45 2007
From: jvloothuis at codespeak.net (jvloothuis at codespeak.net)
Date: Mon, 27 Aug 2007 16:29:45 +0200 (CEST)
Subject: [KSS-checkins] r46033 - in kukit/kss.base/trunk: . kss kss/base
Message-ID: <20070827142945.77DA081E8@code0.codespeak.net>
Author: jvloothuis
Date: Mon Aug 27 16:29:42 2007
New Revision: 46033
Added:
kukit/kss.base/trunk/kss/
kukit/kss.base/trunk/kss/__init__.py
kukit/kss.base/trunk/kss/base/
kukit/kss.base/trunk/kss/base/README.txt
- copied, changed from r44899, kukit/kss.commands/trunk/kss/commands/README.txt
kukit/kss.base/trunk/kss/base/__init__.py
kukit/kss.base/trunk/kss/base/commands.py
- copied, changed from r44898, kukit/kss.commands/trunk/kss/commands/commands.py
kukit/kss.base/trunk/kss/base/commandset.py
- copied unchanged from r43316, kukit/kss.pluginregistry/trunk/kss/pluginregistry/commandset.py
kukit/kss.base/trunk/kss/base/corecommands.py
- copied, changed from r44898, kukit/kss.commands/trunk/kss/commands/corecommands.py
kukit/kss.base/trunk/kss/base/pluginregistry.txt
- copied, changed from r45138, kukit/kss.pluginregistry/trunk/kss/pluginregistry/README.txt
kukit/kss.base/trunk/kss/base/selectors.py
- copied unchanged from r44898, kukit/kss.commands/trunk/kss/commands/selectors.py
kukit/kss.base/trunk/kss/base/selectors.txt
- copied, changed from r44898, kukit/kss.commands/trunk/kss/commands/selectors.txt
kukit/kss.base/trunk/kss/base/tests.py
- copied, changed from r44898, kukit/kss.commands/trunk/kss/commands/tests.py
kukit/kss.base/trunk/setup.py
Log:
Completed merge of kss.commands and kss.pluginregistry
Added: kukit/kss.base/trunk/kss/__init__.py
==============================================================================
--- (empty file)
+++ kukit/kss.base/trunk/kss/__init__.py Mon Aug 27 16:29:42 2007
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+ __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+ from pkgutil import extend_path
+ __path__ = extend_path(__path__, __name__)
Copied: kukit/kss.base/trunk/kss/base/README.txt (from r44899, kukit/kss.commands/trunk/kss/commands/README.txt)
==============================================================================
--- kukit/kss.commands/trunk/kss/commands/README.txt (original)
+++ kukit/kss.base/trunk/kss/base/README.txt Mon Aug 27 16:29:42 2007
@@ -11,7 +11,7 @@
for create the KSS response. We will now take a look at an example to see it
in action.
- >>> from kss.commands import KSSCommands
+ >>> from kss.base import KSSCommands
The constructor takes no arguments.
@@ -21,7 +21,7 @@
also need to create a selector. In this case we will use the CSS selector.
For more information about selectors look at the selector documentation.
- >>> from kss.commands.selectors import CSS
+ >>> from kss.base.selectors import CSS
>>> commands.add('replaceHTML', CSS('#someid'), html='some value')
Now we have added a command. The first argument is the name of the action
@@ -99,7 +99,7 @@
We will now take a look at the base class for all commandsets.
- >>> from kss.commands import KSSCommandSet
+ >>> from kss.base.commands import KSSCommandSet
>>> commands = KSSCommands()
>>> commandset = KSSCommandSet(commands)
@@ -120,7 +120,7 @@
First we will need to create our command set.
- >>> from kss.commands import KSSCoreCommands
+ >>> from kss.base.corecommands import KSSCoreCommands
>>> commands = KSSCommands()
>>> core = KSSCoreCommands(commands)
@@ -140,7 +140,7 @@
We will now demonstrate this in the next example. First we need to load the
registry.
- >>> from kss.pluginregistry import command_set_registry
+ >>> from kss.base.registry import command_set_registry
Now we can register our command set. For more information about the registry look at the documentation of kss.pluginregistry.
Added: kukit/kss.base/trunk/kss/base/__init__.py
==============================================================================
--- (empty file)
+++ kukit/kss.base/trunk/kss/base/__init__.py Mon Aug 27 16:29:42 2007
@@ -0,0 +1,9 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+ __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+ from pkgutil import extend_path
+ __path__ = extend_path(__path__, __name__)
+
+
+from kss.base.commands import KSSCommands
Copied: kukit/kss.base/trunk/kss/base/commands.py (from r44898, kukit/kss.commands/trunk/kss/commands/commands.py)
==============================================================================
--- kukit/kss.commands/trunk/kss/commands/commands.py (original)
+++ kukit/kss.base/trunk/kss/base/commands.py Mon Aug 27 16:29:42 2007
@@ -1,6 +1,6 @@
from xml.sax.saxutils import quoteattr
from xml.parsers.expat import ParserCreate, ExpatError
-from kss.pluginregistry import command_set_registry
+from kss.base.registry import command_set_registry
kss_response_header = '''
'''
Copied: kukit/kss.base/trunk/kss/base/corecommands.py (from r44898, kukit/kss.commands/trunk/kss/commands/corecommands.py)
==============================================================================
--- kukit/kss.commands/trunk/kss/commands/corecommands.py (original)
+++ kukit/kss.base/trunk/kss/base/corecommands.py Mon Aug 27 16:29:42 2007
@@ -1,4 +1,4 @@
-from commands import KSSCommandSet
+from kss.base.commands import KSSCommandSet
class KSSCoreCommands(KSSCommandSet):
def replace_inner_html(self, selector, value):
Copied: kukit/kss.base/trunk/kss/base/pluginregistry.txt (from r45138, kukit/kss.pluginregistry/trunk/kss/pluginregistry/README.txt)
==============================================================================
--- kukit/kss.pluginregistry/trunk/kss/pluginregistry/README.txt (original)
+++ kukit/kss.base/trunk/kss/base/pluginregistry.txt Mon Aug 27 16:29:42 2007
@@ -14,7 +14,7 @@
Using the registry is pretty simple.
- >>> from kss.pluginregistry import command_set_registry
+ >>> from kss.base.registry import command_set_registry
First we will create a simple factory for our command set. Note that any
callable object will do. For more information on command sets look at the
Copied: kukit/kss.base/trunk/kss/base/selectors.txt (from r44898, kukit/kss.commands/trunk/kss/commands/selectors.txt)
==============================================================================
--- kukit/kss.commands/trunk/kss/commands/selectors.txt (original)
+++ kukit/kss.base/trunk/kss/base/selectors.txt Mon Aug 27 16:29:42 2007
@@ -7,7 +7,7 @@
A base class is provided for all selectors.
- >>> from kss.commands import Selector
+ >>> from kss.base.selectors import Selector
>>> selector = Selector('type', 'value')
The selector now has a type and value property.
@@ -24,7 +24,7 @@
In the core package you can find a few standard selectors. The most
basic selectors are the CSS and HTML id selectors.
- >>> from kss.commands.selectors import CSS, HTMLId
+ >>> from kss.base.selectors import CSS, HTMLId
They both need a value to operate on.
@@ -44,7 +44,7 @@
in that it selects the same node that was used to call the server
action. Also note that it does not accept any arguments.
- >>> from kss.commands.selectors import SameNode
+ >>> from kss.base.selectors import SameNode
>>> selector = SameNode()
>>> selector.type
'samenode'
@@ -55,7 +55,7 @@
query which only operates on nodes that are the parent (or
grandparents).
- >>> from kss.commands.selectors import ParentNode
+ >>> from kss.base.selectors import ParentNode
>>> selector = ParentNode('a')
>>> selector.type
'parentnode'
Copied: kukit/kss.base/trunk/kss/base/tests.py (from r44898, kukit/kss.commands/trunk/kss/commands/tests.py)
==============================================================================
--- kukit/kss.commands/trunk/kss/commands/tests.py (original)
+++ kukit/kss.base/trunk/kss/base/tests.py Mon Aug 27 16:29:42 2007
@@ -5,8 +5,9 @@
suite = unittest.TestSuite((
doctest.DocFileSuite(
'README.txt', 'selectors.txt',
- package='kss.commands',
- optionflags=doctest.ELLIPSIS,
+ 'pluginregistry.txt',
+ package='kss.base',
+ optionflags=doctest.ELLIPSIS|doctest.REPORT_ONLY_FIRST_FAILURE,
),
))
return suite
Added: kukit/kss.base/trunk/setup.py
==============================================================================
--- (empty file)
+++ kukit/kss.base/trunk/setup.py Mon Aug 27 16:29:42 2007
@@ -0,0 +1,34 @@
+from setuptools import setup, find_packages
+import sys, os
+
+version = '0.1'
+
+setup(name='kss.base',
+ version=version,
+ description="KSS (Kinetic Style Sheets) framework",
+ long_description="""\
+""",
+ # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+ classifiers=[
+ "Programming Language :: Python",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ ],
+ keywords='',
+ author='KSS Project',
+ author_email='kss-devel at codespeak.net',
+ url='http://kssproject.org',
+ license='LGPL',
+ packages=find_packages(exclude=['ez_setup']),
+ namespace_packages=['kss'],
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=[
+ 'setuptools',
+ ],
+ entry_points={
+ 'kss.commandset': [
+ 'core=kss.base.corecommands:KSSCoreCommands'
+ ],
+ },
+ test_suite='kss.base.tests.test_suite',
+)
From gotcha at codespeak.net Mon Aug 27 16:58:42 2007
From: gotcha at codespeak.net (gotcha at codespeak.net)
Date: Mon, 27 Aug 2007 16:58:42 +0200 (CEST)
Subject: [KSS-checkins] r46034 - kukit/kukit.js/branch/commas-in-selectors
Message-ID: <20070827145842.82F6D81E8@code0.codespeak.net>
Author: gotcha
Date: Mon Aug 27 16:58:41 2007
New Revision: 46034
Added:
kukit/kukit.js/branch/commas-in-selectors/
- copied from r46033, kukit/kukit.js/trunk/
Log:
Commas in selectors branch
From gotcha at codespeak.net Mon Aug 27 16:59:51 2007
From: gotcha at codespeak.net (gotcha at codespeak.net)
Date: Mon, 27 Aug 2007 16:59:51 +0200 (CEST)
Subject: [KSS-checkins] r46035 - in
kukit/kukit.js/branch/commas-in-selectors: kukit tests
Message-ID: <20070827145951.B30EC80CF@code0.codespeak.net>
Author: gotcha
Date: Mon Aug 27 16:59:51 2007
New Revision: 46035
Modified:
kukit/kukit.js/branch/commas-in-selectors/kukit/kssparser.js
kukit/kukit.js/branch/commas-in-selectors/kukit/tokenizer.js
kukit/kukit.js/branch/commas-in-selectors/tests/test_kssparser.js
Log:
Code to work on
Modified: kukit/kukit.js/branch/commas-in-selectors/kukit/kssparser.js
==============================================================================
--- kukit/kukit.js/branch/commas-in-selectors/kukit/kssparser.js (original)
+++ kukit/kukit.js/branch/commas-in-selectors/kukit/kssparser.js Mon Aug 27 16:59:51 2007
@@ -66,30 +66,33 @@
kukit.kssp.Document.prototype.addBlock = function(key, block) {
// Parse the part in an embedded parser
var src = new kukit.tk.Cursor(key + ' ');
- var parser = new kukit.kssp.KssSelector(src, null, true);
+ var parser = new kukit.kssp.KssSelectors(src, null, true);
// check the event name and namespace use in evt- rules
// equals the event name and namespace set in the KSS selector.
- if (block.evt_name != null) {
- // We have evt- parms in the rule.
- if (block.evt_name != parser.kssSelector.name
- || block.evt_namespace != parser.kssSelector.namespace) {
- // XXX this should be done in another way,
- //so that we can see where the error happened.
-;;; kukit.E = 'Wrong prefix : we have "' + block.evt_namespace;
-;;; kukit.E += '-' + block.evt_name + '" instead of "' + key;
-;;; kukit.E += '". KSS prefix ';
-;;; kukit.E += '"evt-[-]-" ';
-;;; kukit.E += 'must not have different [namespace and] ';
-;;; kukit.E += 'name than the KSS selector at the top of the ';
-;;; kukit.E += 'rule.';
- block.emitError(kukit.E);
- }
- }
+// if (block.evt_name != null) {
+// // We have evt- parms in the rule.
+// if (block.evt_name != parser.kssSelector.name
+// || block.evt_namespace != parser.kssSelector.namespace) {
+// // XXX this should be done in another way,
+// //so that we can see where the error happened.
+//;;; kukit.E = 'Wrong prefix : we have "' + block.evt_namespace;
+//;;; kukit.E += '-' + block.evt_name + '" instead of "' + key;
+//;;; kukit.E += '". KSS prefix ';
+//;;; kukit.E += '"evt-[-]-" ';
+//;;; kukit.E += 'must not have different [namespace and] ';
+//;;; kukit.E += 'name than the KSS selector at the top of the ';
+//;;; kukit.E += 'rule.';
+// block.emitError(kukit.E);
+// }
+// }
// Create the event rule. (one action only)
- var eventRule = new kukit.rd.EventRule(parser.kssSelector,
- block.eventParameters, block.actions);
- // Store the rule
- this.eventRules.push(eventRule);
+ for(var i=0; i selector:name(id)
+* KSS method selector: (has no spaces in it)
+* document:name(id) or behaviour:name(id)
+*/
+kukit.kssp.KssSelectors = kukit.tk.mkParser('kssselectors', {
+ ",": 'new kukit.kssp.comma(this.src)',
+ "{": 'this.emitAndReturn()',
+ "\/\*": 'new kukit.kssp.Comment(this.src, kukit.kssp.commentbegin)'
+ });
+kukit.kssp.KssSelectors.prototype.process = function() {
+ this.selectors = [];
+ var cursor = {'next': 1};
+
+ var parser = new kukit.kssp.KssSelector(this.result[0].txt, null, true);
+ this.selectors.push(parser);
+
+ while (cursor.next < this.result.length-1) {
+ this.digestTxt(cursor, kukit.kssp.Comment);
+ var kssSelectorTxt = cursor.txt;
+ this.expectToken(cursor, kukit.kssp.KssSelector);
+ this.selectors.push(cursor.token);
+ if (cursor.next == this.result.length-1) break;
+ this.expectToken(cursor, kukit.kssp.comma);
+ };
+ this.result = [];
+ this.txt = '';
+};
+
+/*
* class KssSelector
*
* embedded parser to parse the selector
@@ -552,16 +588,16 @@
var name;
var namespace = null;
var id = null;
- var tokenindex = this.result.length - 1;
+ var tokenIndex = this.result.length - 1;
// Find the method parms and calculate the end of css parms. (RL)
var cycle = true;
- while (cycle && tokenindex >= 0) {
- var token = this.result[tokenindex];
+ while (cycle && tokenIndex >= 0) {
+ var token = this.result[tokenIndex];
switch (token.symbol) {
case kukit.tk.Fraction.prototype.symbol: {
// if all spaces, go to previous one
if (token.txt.match(/^[\r\n\t ]*$/) != null) {
- tokenindex -= 1;
+ tokenIndex -= 1;
} else {
;;; kukit.E = 'Wrong event selector : missing event ';
;;; kukit.E += 'qualifier : ';
@@ -570,7 +606,7 @@
}
} break;
case kukit.kssp.Comment.prototype.symbol: {
- tokenindex -= 1;
+ tokenIndex -= 1;
} break;
default: {
cycle = false;
@@ -578,22 +614,22 @@
}
}
// Now we found the token that must be .
- tokenindex -= 2;
- if (tokenindex < 0
- || (this.result[tokenindex+2].symbol !=
+ tokenIndex -= 2;
+ if (tokenIndex < 0
+ || (this.result[tokenIndex+2].symbol !=
kukit.kssp.EventValue.prototype.symbol)
- || (this.result[tokenindex+1].symbol !=
+ || (this.result[tokenIndex+1].symbol !=
kukit.kssp.colon.prototype.symbol)
- || (this.result[tokenindex].symbol !=
+ || (this.result[tokenIndex].symbol !=
kukit.tk.Fraction.prototype.symbol)) {
;;; kukit.E = 'Wrong event selector : missing event qualifier ';
;;; kukit.E += ': or :().';
this.emitError(kukit.E);
}
// See that the last fraction does not end with space.
- var lasttoken = this.result[tokenindex];
- var commatoken = this.result[tokenindex+1];
- var pseudotoken = this.result[tokenindex+2];
+ var lasttoken = this.result[tokenIndex];
+ var commatoken = this.result[tokenIndex+1];
+ var pseudotoken = this.result[tokenIndex+2];
var txt = lasttoken.txt;
if (txt.match(/[\r\n\t ]$/) != null) {
;;; kukit.E = 'Wrong event selector :';
Modified: kukit/kukit.js/branch/commas-in-selectors/kukit/tokenizer.js
==============================================================================
--- kukit/kukit.js/branch/commas-in-selectors/kukit/tokenizer.js (original)
+++ kukit/kukit.js/branch/commas-in-selectors/kukit/tokenizer.js Mon Aug 27 16:59:51 2007
@@ -130,7 +130,7 @@
return (!token || currentValue.symbol != token.prototype.symbol);
};
-kukit.tk._ParserBase.prototype.isToken =
+kukit.tk._ParserBase.prototype.notInTokens =
function(cursor, token1, token2, token3, token4) {
var i = cursor.next;
var currentValue = this.result[i];
@@ -148,7 +148,7 @@
// digests the txt from the tokens, ignores given token
// plus whitespace removal
this.digestExactTxt(cursor, token1, token2, token3, token4);
- cursor.txt = this.dewhitespaceAndTrim(cursor.txt);
+ cursor.txt = this.removeWhitespacesAndTrim(cursor.txt);
};
kukit.tk._ParserBase.prototype.digestExactTxt =
@@ -156,7 +156,7 @@
// digests the txt from the tokens, ignores given token
// exact value: no whitespace removal
var result = '';
- while (this.isToken(cursor, token1, token2, token3, token4)) {
+ while (this.notInTokens(cursor, token1, token2, token3, token4)) {
result += this.result[cursor.next].txt;
cursor.next ++;
}
@@ -164,7 +164,7 @@
};
-kukit.tk._ParserBase.prototype.dewhitespace = function(txt) {
+kukit.tk._ParserBase.prototype.removeWhitespaces = function(txt) {
// removes ws but leaves leading and trailing one
if (txt != ' ') { //speedup only
txt = txt.replace(/[\r\n\t ]+/g, ' ');
@@ -172,8 +172,8 @@
return txt;
};
-kukit.tk._ParserBase.prototype.dewhitespaceAndTrim = function(txt) {
- txt = this.dewhitespace(txt);
+kukit.tk._ParserBase.prototype.removeWhitespacesAndTrim = function(txt) {
+ txt = this.removeWhitespaces(txt);
// XXX Strange thing is: following replace works from
// tests and the original demo, but with kukitportlet demo
// it breaks. Someone stinks!
Modified: kukit/kukit.js/branch/commas-in-selectors/tests/test_kssparser.js
==============================================================================
--- kukit/kukit.js/branch/commas-in-selectors/tests/test_kssparser.js (original)
+++ kukit/kukit.js/branch/commas-in-selectors/tests/test_kssparser.js Mon Aug 27 16:59:51 2007
@@ -651,7 +651,7 @@
+'#button_3:click {\n'
+'action-client: setStyle;\n'
+'setStyle-kssSelector: "#button_4";\n'
- +'setStyle-name: backgroundColor;\n'
+ +'setStyle-name: /* comment blabla */ backgroundColor;\n'
+'setStyle-value: #FFa0a0;\n'
+"}\n";
From jvloothuis at codespeak.net Mon Aug 27 17:08:38 2007
From: jvloothuis at codespeak.net (jvloothuis at codespeak.net)
Date: Mon, 27 Aug 2007 17:08:38 +0200 (CEST)
Subject: [KSS-checkins] r46036 - kukit/kss.base/trunk/kss/base
Message-ID: <20070827150838.F2B6C817F@code0.codespeak.net>
Author: jvloothuis
Date: Mon Aug 27 17:08:37 2007
New Revision: 46036
Added:
kukit/kss.base/trunk/kss/base/registry.py
Modified:
kukit/kss.base/trunk/kss/base/README.txt
kukit/kss.base/trunk/kss/base/commands.py
Log:
Changed the code to the new protocol
Modified: kukit/kss.base/trunk/kss/base/README.txt
==============================================================================
--- kukit/kss.base/trunk/kss/base/README.txt (original)
+++ kukit/kss.base/trunk/kss/base/README.txt Mon Aug 27 17:08:37 2007
@@ -126,7 +126,7 @@
Now we will look at the individual methods provided by the core commands.
- >>> core.replace_inner_html(CSS('div'), 'some