Author: gotcha
Date: Wed Feb 28 16:05:38 2007
New Revision: 39586
Modified:
kukit/kukit.js/trunk/kukit/dom.js
Log:
change kssattr namespace for bettre readability of templates
Modified: kukit/kukit.js/trunk/kukit/dom.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/dom.js (original)
+++ kukit/kukit.js/trunk/kukit/dom.js Wed Feb 28 16:05:38 2007
@@ -213,20 +213,20 @@
};
-/* Kukit attributes: a workaround to provide attributes
+/* KSS attributes: a workaround to provide attributes
in our own namespace.
- Since namespaced attributes (kukit:name="value") are not allowed
+ Since namespaced attributes (kss:name="value") are not allowed
even in transitional XHTML, we must provide a way to
- substitute them. This is achieved by putting kukit-name-value
+ substitute them. This is achieved by putting kssattr-name-value
identifiers in the class attribute, separated by spaces.
We only read these attributes, writing happens
- always in the kukit namespace.
+ always in the kss namespace.
XXX at the moment, deletion can be achieved with setting with
a value ''. This is consistent with DOM behaviour as we seem to
be getting '' for nonexistent values anyway.
*/
-kukit.dom.namespace = 'kukit';
+kukit.dom.kssAttrNamespace = 'kssattr';
kukit.dom.getKssClassAttribute = function(node, attrname) {
// Gets a given kss attribute from the class
@@ -237,7 +237,7 @@
for (var i=0; i<splitclass.length; i++) {
var elem = splitclass[i];
var splitelem = elem.split('-', 3);
- if (splitelem.length == 3 && splitelem[0] == kukit.dom.namespace
+ if (splitelem.length == 3 && splitelem[0] ==
kukit.dom.kssAttrNamespace
&& splitelem[1] == attrname) {
// Found it. (The last one will be valid, in case of
duplication)
var index = splitelem[0].length + splitelem[1].length + 2;
@@ -252,7 +252,7 @@
kukit.dom.getKssAttribute = function(node, attrname) {
// Gets a given kss attribute
// first from the namespace, then from the class
- var result = kukit.dom.getAttribute(node, kukit.dom.namespace + ':' +
attrname);
+ var result = kukit.dom.getAttribute(node, kukit.dom.kssAttrNamespace + ':'
+ attrname);
// XXX if this was '' it is the same as notfound, so it shadows the class
attribute!
// This means setting an attribute to '' is the same as deleting it - at
the moment
if (! result) {
@@ -263,7 +263,7 @@
kukit.dom.setKssAttribute = function(node, attrname, value) {
// Sets a given kss attribute on the namespace
- kukit.dom.setAttribute(node, kukit.dom.namespace + ':' + attrname, value);
+ kukit.dom.setAttribute(node, kukit.dom.kssAttrNamespace + ':' + attrname,
value);
};
/* Recursive getting of node attributes
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins