[KSS-checkins] r45137 - kukit/kss.scriptaculous/trunk/kss/scriptaculous

jvloothuis at codespeak.net jvloothuis at codespeak.net
Mon Jul 16 20:55:57 CEST 2007


Author: jvloothuis
Date: Mon Jul 16 20:55:56 2007
New Revision: 45137

Modified:
   kukit/kss.scriptaculous/trunk/kss/scriptaculous/README.txt
   kukit/kss.scriptaculous/trunk/kss/scriptaculous/__init__.py
   kukit/kss.scriptaculous/trunk/kss/scriptaculous/commands.py
Log:
Improved the tests and documentation


Modified: kukit/kss.scriptaculous/trunk/kss/scriptaculous/README.txt
==============================================================================
--- kukit/kss.scriptaculous/trunk/kss/scriptaculous/README.txt	(original)
+++ kukit/kss.scriptaculous/trunk/kss/scriptaculous/README.txt	Mon Jul 16 20:55:56 2007
@@ -9,14 +9,26 @@
 Server side usage
 =================
 
+We will first need to register our command set with the system. This
+will normally be setup in a different way depending on your framework.
+
+  >>> from kss.scriptaculous.commands import KSSScriptaculousCommands
+  >>> from kss.pluginregistry import command_set_registry
+  >>> command_set_registry.register('scriptaculous', KSSScriptaculousCommands)
+
+Now we can load the plugin using the normal API.
+
   >>> from kss.commands import KSSCommands
   >>> from kss.commands.selectors import CSS
   >>> commands = KSSCommands()
-  >>> scriptaculous = commands.get('effects')
+  >>> scriptaculous = commands.get('scriptaculous')
 
 Effects
 -------
 
+One of the more notable features of the Scriptaculous plugin is its
+support for effects.
+
   >>> scriptaculous.effect(CSS('node'), 'fade')
   >>> print commands
   effect(css('node'), type='fade')
@@ -25,3 +37,13 @@
   >>> print commands
   effect(css('node'), type='fade')
   effect(css('node'), delay='0.1', type='fade')
+
+
+Helpers
+=======
+
+We also provide a helper to generate the proper script tags.
+
+  >>> from kss.scriptaculous.helpers import scriptaculous_javascripts
+  >>> scriptaculous_javascripts()
+  '...prototype.js...effects.js...plugin.js...'

Modified: kukit/kss.scriptaculous/trunk/kss/scriptaculous/__init__.py
==============================================================================
--- kukit/kss.scriptaculous/trunk/kss/scriptaculous/__init__.py	(original)
+++ kukit/kss.scriptaculous/trunk/kss/scriptaculous/__init__.py	Mon Jul 16 20:55:56 2007
@@ -7,7 +7,6 @@
 
 
 import os
-from paste.urlparser import StaticURLParser
 from kss.pylons.middleware import StaticJavascriptPlugin
 
 javascript_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),

Modified: kukit/kss.scriptaculous/trunk/kss/scriptaculous/commands.py
==============================================================================
--- kukit/kss.scriptaculous/trunk/kss/scriptaculous/commands.py	(original)
+++ kukit/kss.scriptaculous/trunk/kss/scriptaculous/commands.py	Mon Jul 16 20:55:56 2007
@@ -2,6 +2,23 @@
 
 class KSSScriptaculousCommands(KSSCommandSet):
     def effect(self, selector, type, queue=None, scope=None, delay=None):
+        '''Start an effect of the specified type.
+
+        The type argument must be on of the following:
+        
+        - fade
+        - appear
+        - blinddown
+        - blindup
+
+        When you want to chain effects you need to put them in a
+        queue. You do this by giving the queue argument with `front`
+        or `end`.
+
+        If you need multiple effects at the same time you can use the
+        scope to place effects in their own parallel chain.
+
+        You can also delay effect execution by passing in a delay (in seconds).'''
         if scope and not queue:
             queue = 'end'
         if queue is not None and queue not in ('front', 'end'):


More information about the Kukit-checkins mailing list