Author: jvloothuis
Date: Sun Feb 18 09:53:15 2007
New Revision: 39149
Modified:
kukit/kss.core/trunk/kss/core/plugins/core/commands.py
kukit/kss.core/trunk/kss/core/plugins/core/configure.zcml
kukit/kss.core/trunk/kss/core/plugins/core/interfaces.py
Log:
Added a new command to the core plugin set which can toggle a css class
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 Sun Feb 18
09:53:15 2007
@@ -120,6 +120,11 @@
for key, value in kw.iteritems():
command.addParam(key, value)
+ def toggleClass(self, selector, classname):
+ """ see interfaces.py """
+ command = self.commands.addCommand('toggleClass', selector)
+ data = command.addParam('classname', classname)
+
# XXX Deprecated ones
def moveChildrenTo(self, selector, id):
Modified: kukit/kss.core/trunk/kss/core/plugins/core/configure.zcml
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/configure.zcml (original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/configure.zcml Sun Feb 18
09:53:15 2007
@@ -240,6 +240,12 @@
/>
<kss:action
+ name="toggleClass"
+ command_factory="selector"
+ params_mandatory="classname"
+ />
+
+ <kss:action
name="setStateVar"
command_factory="global"
params_mandatory="varname value"
Modified: kukit/kss.core/trunk/kss/core/plugins/core/interfaces.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/interfaces.py (original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/interfaces.py Sun Feb 18
09:53:15 2007
@@ -76,3 +76,9 @@
def triggerEvent(name, **kw):
"""Trigger an event on the client """
# TODO: explain a bit better what this does
+
+ def toggleClass(selector, classname):
+ """Add/remove a class to/from a node.
+
+ If the class is present it will be removed. Else the class will be
+ added. """
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins