Author: jvloothuis
Date: Sun Nov 11 15:15:05 2007
New Revision: 48568
Modified:
kukit/kss.base/trunk/kss/base/corecommands.py
kukit/kss.base/trunk/kss/base/corecommands.txt
Log:
Added withKssSetup for the HTML replacement commands. This can be used
for faster operation at the cost of reduced functionality.
Modified: kukit/kss.base/trunk/kss/base/corecommands.py
==============================================================================
--- kukit/kss.base/trunk/kss/base/corecommands.py (original)
+++ kukit/kss.base/trunk/kss/base/corecommands.py Sun Nov 11 15:15:05 2007
@@ -22,13 +22,20 @@
def focus(self, selector):
self.commands.add('focus', selector)
- def replaceInnerHTML(self, selector, value):
+ def replaceInnerHTML(self, selector, value, withKssSetup=True):
"""Replace the contents of a node (selector) with the new `value`"""
- self.commands.add('replaceInnerHTML', selector, html=value)
-
- def replaceHTML(self, selector, value):
- self.commands.add('replaceHTML', selector, html=value)
-
+ extra_args = {}
+ if not withKssSetup:
+ extra_args['withKssSetup'] = 'False'
+ self.commands.add('replaceInnerHTML', selector, html=value,
+ **extra_args)
+
+ def replaceHTML(self, selector, value, withKssSetup=True):
+ extra_args = {}
+ if not withKssSetup:
+ extra_args['withKssSetup'] = 'False'
+ self.commands.add('replaceHTML', selector, html=value,
+ **extra_args)
def insertHTMLBefore(self, selector, value):
self.commands.add('insertHTMLBefore', selector, html=value)
Modified: kukit/kss.base/trunk/kss/base/corecommands.txt
==============================================================================
--- kukit/kss.base/trunk/kss/base/corecommands.txt (original)
+++ kukit/kss.base/trunk/kss/base/corecommands.txt Sun Nov 11 15:15:05 2007
@@ -97,6 +97,15 @@
>>> print commands
replaceInnerHTML(css('div'), html='some html')
+You can also avoid KSS event setup. Use this only if you really need
+the speedup because KSS will not be applied to these new nodes.
+
+ >>> core.replaceInnerHTML(css('div'), 'some html', withKssSetup=False)
+ >>> print commands
+ replaceInnerHTML(css('div'), html='some html')
+ replaceInnerHTML(css('div'), html='some html', withKssSetup='False')
+
+
Replace HTML
------------
@@ -105,6 +114,13 @@
>>> print commands
replaceHTML(css('div'), html='some html')
+You can also pass withKssSetup here (see replace inner HTML).
+
+ >>> core.replaceHTML(css('div'), 'some html', withKssSetup=False)
+ >>> print commands
+ replaceHTML(css('div'), html='some html')
+ replaceHTML(css('div'), html='some html', withKssSetup='False')
+
--------------
HTML insertion
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins