[KSS-checkins] r51200 - in kukit: kss.core/trunk/kss/core/plugins/core/demo kss.core/trunk/kss/core/plugins/core/demo/binderids kss.zope/trunk/kss/core kss.zope/trunk/kss/zope kss.zope/trunk/kss/zope/browser kss.zope/trunk/kss/zope/plugins/core kss.zope/trunk/kss/zope/plugins/effects

jvloothuis at codespeak.net jvloothuis at codespeak.net
Sat Feb 2 12:06:52 CET 2008


Author: jvloothuis
Date: Sat Feb  2 12:06:51 2008
New Revision: 51200

Added:
   kukit/kss.zope/trunk/kss/zope/baseconfigure.py
   kukit/kss.zope/trunk/kss/zope/browser/kss_javascript.pt
Modified:
   kukit/kss.core/trunk/kss/core/plugins/core/demo/binderids/config.py
   kukit/kss.core/trunk/kss/core/plugins/core/demo/config.py
   kukit/kss.zope/trunk/kss/core/configure.zcml
   kukit/kss.zope/trunk/kss/zope/browser/configure.zcml
   kukit/kss.zope/trunk/kss/zope/configure.zcml
   kukit/kss.zope/trunk/kss/zope/plugins/core/config.py
   kukit/kss.zope/trunk/kss/zope/plugins/effects/configure.zcml
Log:

Changes needed to make Grok work


Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/binderids/config.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/demo/binderids/config.py	(original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo/binderids/config.py	Sat Feb  2 12:06:51 2008
@@ -1,22 +1,25 @@
-
 from kss.base.plugin import Plugin
-from kss.demo.resource import (
-    KSSDemo,
-    KSSSeleniumTestDirectory,
-    )
 
-class CoreDemos(Plugin):
+try:
+    from kss.demo.resource import (
+        KSSDemo,
+        KSSSeleniumTestDirectory,
+        )
+except ImportError:
+    demos = False
 
-    zope_demos = (
-        # List your demos here. 
-        # (Second parameter can be a subcategory within the demo if needed.)
-        KSSDemo('', 'Core syntax', 'binderids.html', 'Binder ids'),
+class CoreDemos(Plugin):
+    if demos:
+        zope_demos = (
+            # List your demos here. 
+            # (Second parameter can be a subcategory within the demo if needed.)
+            KSSDemo('', 'Core syntax', 'binderids.html', 'Binder ids'),
 
-        )
+            )
 
-    # directories are relative from the location of this .py file
-    zope_selenium_testsuites = (
-        # if you only have one test directory, you
-        # need not change anything here.
-        KSSSeleniumTestDirectory('selenium_tests'),
-        )
+        # directories are relative from the location of this .py file
+        zope_selenium_testsuites = (
+            # if you only have one test directory, you
+            # need not change anything here.
+            KSSSeleniumTestDirectory('selenium_tests'),
+            )

Modified: kukit/kss.core/trunk/kss/core/plugins/core/demo/config.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/plugins/core/demo/config.py	(original)
+++ kukit/kss.core/trunk/kss/core/plugins/core/demo/config.py	Sat Feb  2 12:06:51 2008
@@ -1,36 +1,38 @@
-
 from kss.base.plugin import Plugin
-from kss.demo.resource import (
-    KSSDemo,
-    KSSSeleniumTestDirectory,
-    )
+try:
+    from kss.demo.resource import (
+        KSSDemo,
+        KSSSeleniumTestDirectory,
+        )
+except ImportError:
+    demos = False
 
 class CoreDemos(Plugin):
+    if demos:
+        zope_demos = (
+            KSSDemo('', '', "basic_commands.html", "Change tag content"),
+            KSSDemo('', '', "two_selects.html", "Two selects"),
+            KSSDemo('', '', "autoupdate.html", "Auto update"),
+            KSSDemo('', '', "inline_edit.html", "Inline edit"),
+            KSSDemo('', '', "cancel_submit.html", "Cancel Submit Click"),
+            KSSDemo('', '', "tree.html", "Tree"),
+            KSSDemo('', '', "more_selectors.html", "More complex selectors"),
+            KSSDemo('', '', "two_select_revisited.html", "Master-slave selects revisited"),
+            KSSDemo('', '', "form_submit.html", "Form submit"),
+            KSSDemo('', '', "error_handling.html", "Error handling"),
+            KSSDemo('', '', "preventdefault.html", "Preventdefault (a.k.a. Safari workarounds)"),
+            KSSDemo('', '', "html_inserts.html", "HTML insertions (Change tag content returns)"),
+            KSSDemo('', '', "client-server-protocol", "Client server protocol"),
+            KSSDemo('', 'Selectors', 'selectors.html', 'Parent node selector'),
+            KSSDemo('', 'Core events', "kss_evt_preventbubbling.html", "Prevent bubbling KSS event parameter"),
+            KSSDemo('', 'Core events', "kss_keyevents.html", "Key events"),
+            KSSDemo('', 'Commands/Actions', "ca_focus.html", "Focus"),
+            KSSDemo('', 'Commands/Actions', "actions.html", "Toggle case action"),
+            # XXX this should go to the other plugin wuth all its stuff
+            KSSDemo('Effects', '', "effects.html", "Effects"),
+            )
 
-    zope_demos = (
-        KSSDemo('', '', "basic_commands.html", "Change tag content"),
-        KSSDemo('', '', "two_selects.html", "Two selects"),
-        KSSDemo('', '', "autoupdate.html", "Auto update"),
-        KSSDemo('', '', "inline_edit.html", "Inline edit"),
-        KSSDemo('', '', "cancel_submit.html", "Cancel Submit Click"),
-        KSSDemo('', '', "tree.html", "Tree"),
-        KSSDemo('', '', "more_selectors.html", "More complex selectors"),
-        KSSDemo('', '', "two_select_revisited.html", "Master-slave selects revisited"),
-        KSSDemo('', '', "form_submit.html", "Form submit"),
-        KSSDemo('', '', "error_handling.html", "Error handling"),
-        KSSDemo('', '', "preventdefault.html", "Preventdefault (a.k.a. Safari workarounds)"),
-        KSSDemo('', '', "html_inserts.html", "HTML insertions (Change tag content returns)"),
-        KSSDemo('', '', "client-server-protocol", "Client server protocol"),
-        KSSDemo('', 'Selectors', 'selectors.html', 'Parent node selector'),
-        KSSDemo('', 'Core events', "kss_evt_preventbubbling.html", "Prevent bubbling KSS event parameter"),
-        KSSDemo('', 'Core events', "kss_keyevents.html", "Key events"),
-        KSSDemo('', 'Commands/Actions', "ca_focus.html", "Focus"),
-        KSSDemo('', 'Commands/Actions', "actions.html", "Toggle case action"),
-        # XXX this should go to the other plugin wuth all its stuff
-        KSSDemo('Effects', '', "effects.html", "Effects"),
-        )
-
-    # directories are relative from the location of this .py file
-    zope_selenium_testsuites = (
-        KSSSeleniumTestDirectory('selenium_tests'),
-        )
+        # directories are relative from the location of this .py file
+        zope_selenium_testsuites = (
+            KSSSeleniumTestDirectory('selenium_tests'),
+            )

Modified: kukit/kss.zope/trunk/kss/core/configure.zcml
==============================================================================
--- kukit/kss.zope/trunk/kss/core/configure.zcml	(original)
+++ kukit/kss.zope/trunk/kss/core/configure.zcml	Sat Feb  2 12:06:51 2008
@@ -3,55 +3,57 @@
            xmlns:zcml="http://namespaces.zope.org/zcml"
            xmlns:five="http://namespaces.zope.org/five">
 
-    <!-- Javascript resources that are used by the core 
-         (Resources used by plugins are loaded from the component)
-    -->
-
-    <browser:resource
-        file="kukit_3rd_party/sarissa.js"
-        name="sarissa.js"
-        />
+  <!-- Javascript resources that are used by the core 
+       (Resources used by plugins are loaded from the component)
+  -->
+
+  <!-- <browser:resource -->
+  <!--     file="kukit_3rd_party/sarissa.js" -->
+  <!--     name="sarissa.js" -->
+  <!--     /> -->
   
-    <browser:resource
-        file="kukit_3rd_party/cssQuery.js"
-        name="cssQuery.js"
-        />
-
-    <browser:resource
-        file="kukit_3rd_party/cssQuery-compat.js"
-        name="cssQuery-compat.js"
-        />
-
-    <browser:resource
-        file="kukit_3rd_party/MochiKit.js"
-        name="MochiKit.js"
-        />
-
-    <browser:resourceDirectory
-        name="firebuglite"
-        directory="kukit_3rd_party/firebuglite"
-        />
-
-    <browser:resource
-        file="kukit_3rd_party/base2-dom-fp.js"
-        name="base2-dom-fp.js"
-        />
-
-
-    <!-- (non-kss) browser view -->
-    <browser:page
-	for="*"
-	name="kss_view"
-        permission="zope.Public"
-        class=".browserview.KSSBrowserView"
-        allowed_attributes="attach_error"
-        />
-    
-    <browser:page
-	for="*"
-	name="kss_javascript"
-        permission="zope.Public"
-        template="browser/kss_javascript.pt"
-        />
+  <!-- <browser:resource -->
+  <!--     file="kukit_3rd_party/cssQuery.js" -->
+  <!--     name="cssQuery.js" -->
+  <!--     /> -->
+
+  <!-- <browser:resource -->
+  <!--     file="kukit_3rd_party/cssQuery-compat.js" -->
+  <!--     name="cssQuery-compat.js" -->
+  <!--     /> -->
+
+  <!-- <browser:resource -->
+  <!--     file="kukit_3rd_party/MochiKit.js" -->
+  <!--     name="MochiKit.js" -->
+  <!--     /> -->
+
+  <!-- <browser:resourceDirectory -->
+  <!--     name="firebuglite" -->
+  <!--     directory="kukit_3rd_party/firebuglite" -->
+  <!--     /> -->
+
+  <!-- <browser:resource -->
+  <!--     file="kukit_3rd_party/base2-dom-fp.js" -->
+  <!--     name="base2-dom-fp.js" -->
+  <!--     /> -->
+
+
+  <!-- (non-kss) browser view -->
+  <!-- <browser:page -->
+  <!--     for="*" -->
+  <!--     name="kss_view" -->
+  <!--     permission="zope.Public" -->
+  <!--     class=".browserview.KSSBrowserView" -->
+  <!--     allowed_attributes="attach_error" -->
+  <!--     /> -->
+  
+  <!-- <browser:page -->
+  <!--     for="*" -->
+  <!--     name="kss_javascript" -->
+  <!--     permission="zope.Public" -->
+  <!--     template="browser/kss_javascript.pt" -->
+  <!--     /> -->
+
+  <include package="kss.zope" />
 
 </configure>

Added: kukit/kss.zope/trunk/kss/zope/baseconfigure.py
==============================================================================
--- (empty file)
+++ kukit/kss.zope/trunk/kss/zope/baseconfigure.py	Sat Feb  2 12:06:51 2008
@@ -0,0 +1,17 @@
+import kss.base
+from kss.base.plugin import file_below_module
+from zope.app.publisher.fileresource import File
+from zope.app.publisher.browser.fileresource import FileResource
+
+
+def third_party_js_resource(name, request):
+    path = file_below_module(kss.base, 'kukit/3rd_party/%s' % name)
+    return FileResource(File(path, name), request)
+
+def sarissa_resource(request):
+    return third_party_js_resource('sarissa.js', request)
+
+def base2_resource(request):
+    return third_party_js_resource('base2-dom-fp.js', request)
+
+

Modified: kukit/kss.zope/trunk/kss/zope/browser/configure.zcml
==============================================================================
--- kukit/kss.zope/trunk/kss/zope/browser/configure.zcml	(original)
+++ kukit/kss.zope/trunk/kss/zope/browser/configure.zcml	Sat Feb  2 12:06:51 2008
@@ -1,34 +1,32 @@
 <configure xmlns="http://namespaces.zope.org/zope"
-     xmlns:browser="http://namespaces.zope.org/browser"
-     >
-     
+           xmlns:browser="http://namespaces.zope.org/browser"
+           >
 
-    <!-- Register a view to compute development mode -->
-
-    <browser:page
-        for="*"
-        class=".develview.DevelView"
-        name="kss_devel_mode"
-        permission="zope.Public"
-        allowed_interface=".interfaces.IDevelView"
-        />
-
-    <browser:resource
-        name="kss_devel_ui.js"
-        file="develui.js"
-        permission="zope.Public"
-        />
-
-    <browser:resource
-        name="kss_devel_ui.css"
-        file="develui.css"
-        permission="zope.Public"
-        />
-
-    <browser:resource
-        name="kss_devel_ui.kss"
-        file="develui.kss"
-        permission="zope.Public"
-        />
+  <!-- Register a view to compute development mode -->
+  <browser:page
+      for="*"
+      class=".develview.DevelView"
+      name="kss_devel_mode"
+      permission="zope.Public"
+      allowed_interface=".interfaces.IDevelView"
+      />
+
+  <browser:resource
+      name="kss_devel_ui.js"
+      file="develui.js"
+      permission="zope.Public"
+      />
+
+  <browser:resource
+      name="kss_devel_ui.css"
+      file="develui.css"
+      permission="zope.Public"
+      />
+
+  <browser:resource
+      name="kss_devel_ui.kss"
+      file="develui.kss"
+      permission="zope.Public"
+      />
 
 </configure>

Added: kukit/kss.zope/trunk/kss/zope/browser/kss_javascript.pt
==============================================================================
--- (empty file)
+++ kukit/kss.zope/trunk/kss/zope/browser/kss_javascript.pt	Sat Feb  2 12:06:51 2008
@@ -0,0 +1,18 @@
+<script tal:attributes = "src context/++resource++sarissa.js" 
+        type="text/javascript" ></script> 
+<script tal:attributes="src context/++resource++base2-dom-fp.js" 
+        type="text/javascript" ></script> 
+
+<tal:block define="kss_devel_mode nocall:context/@@kss_devel_mode | nothing">
+
+  <script tal:condition="python: not kss_devel_mode or kss_devel_mode.isoff()" type="text/javascript"
+          tal:attributes="src context/++resource++kukit.js;"
+          src="++resource++kukit.js">
+  </script>
+
+  <script tal:condition="python: kss_devel_mode and kss_devel_mode.ison()" type="text/javascript"
+          tal:attributes="src context/++resource++kukit-devel.js;"
+          src="++resource++kukit-devel.js">
+  </script>
+
+</tal:block>

Modified: kukit/kss.zope/trunk/kss/zope/configure.zcml
==============================================================================
--- kukit/kss.zope/trunk/kss/zope/configure.zcml	(original)
+++ kukit/kss.zope/trunk/kss/zope/configure.zcml	Sat Feb  2 12:06:51 2008
@@ -1,6 +1,6 @@
 <configure xmlns="http://namespaces.zope.org/zope"
-           xmlns:kss="http://namespaces.zope.org/kss"
-           >
+           xmlns:browser="http://namespaces.zope.org/browser"
+           xmlns:kss="http://namespaces.zope.org/kss">
 
   <include package=".browser" />
   <include package=".concatresource" />
@@ -29,4 +29,26 @@
     lmt_check_period="5"
   />
 
+
+  <browser:page
+      for="*"
+      name="kss_javascript"
+      permission="zope.Public"
+      template="browser/kss_javascript.pt"
+      />
+
+
+  <!-- setup the resources from kss.base -->
+  <browser:resource
+      name="sarissa.js"
+      factory=".baseconfigure.sarissa_resource"
+      permission="zope.Public"
+      />
+
+  <browser:resource
+      name="base2-dom-fp.js"
+      factory=".baseconfigure.base2_resource"
+      permission="zope.Public"
+      />
+
 </configure>

Modified: kukit/kss.zope/trunk/kss/zope/plugins/core/config.py
==============================================================================
--- kukit/kss.zope/trunk/kss/zope/plugins/core/config.py	(original)
+++ kukit/kss.zope/trunk/kss/zope/plugins/core/config.py	Sat Feb  2 12:06:51 2008
@@ -1,9 +1,12 @@
-
 from kss.base.plugin import Plugin
-from kss.demo.resource import (
-    KSSDemo,
-    KSSSeleniumTestDirectory,
-)
+
+try:
+    from kss.demo.resource import (
+        KSSDemo,
+        KSSSeleniumTestDirectory,
+        )
+except ImportError:
+    demos = False # No kss.demo installed so just skip the demos
 
 class KSSCore(Plugin):
     '''The KSS core plugin has all the standard functionality'''
@@ -18,29 +21,30 @@
 
     # Zope specific stuff
 
-    zope_demos = (
-        KSSDemo('', '', "demos/basic_commands.html", "Change tag content"),
-        KSSDemo('', '', "demos/two_selects.html", "Two selects"),
-        KSSDemo('', '', "demos/autoupdate.html", "Auto update"),
-        KSSDemo('', '', "demos/inline_edit.html", "Inline edit"),
-        KSSDemo('', '', "demos/cancel_submit.html", "Cancel Submit Click"),
-        KSSDemo('', '', "demos/tree.html", "Tree"),
-        KSSDemo('', '', "demos/more_selectors.html", "More complex selectors"),
-        KSSDemo('', '', "demos/two_select_revisited.html", "Master-slave selects revisited"),
-        KSSDemo('', '', "demos/form_submit.html", "Form submit"),
-        KSSDemo('', '', "demos/effects.html", "Effects"),
-        KSSDemo('', '', "demos/error_handling.html", "Error handling"),
-        KSSDemo('', '', "demos/preventdefault.html", "Preventdefault (a.k.a. Safari workarounds)"),
-        KSSDemo('', '', "demos/html_inserts.html", "HTML insertions (Change tag content returns)"),
-        KSSDemo('', 'Parameter functions', 'demos/pf_forms.html', 'Forms'),
-        KSSDemo('', 'Selectors', 'demos/selectors.html', 'Parent node selector'),
-        KSSDemo('', 'Core syntax', "demos/kss_selector_param.html", "Kss selector parameters"),
-        KSSDemo('', 'Core syntax', "demos/kss_url_param.html", "Kss url parameters"),
-        KSSDemo('', 'Core events', "demos/kss_evt_preventbubbling.html", "Prevent bubbling KSS event parameter"),
-        KSSDemo('', 'Core events', "demos/kss_keyevents.html", "Key events"),
-        KSSDemo('', 'Commands/Actions', "demos/ca_focus.html", "Focus"),
-        KSSDemo('', 'Commands/Actions', "demos/actions.html", "Toggle case action"),
-        )
+    if demos:
+        zope_demos = (
+            KSSDemo('', '', "demos/basic_commands.html", "Change tag content"),
+            KSSDemo('', '', "demos/two_selects.html", "Two selects"),
+            KSSDemo('', '', "demos/autoupdate.html", "Auto update"),
+            KSSDemo('', '', "demos/inline_edit.html", "Inline edit"),
+            KSSDemo('', '', "demos/cancel_submit.html", "Cancel Submit Click"),
+            KSSDemo('', '', "demos/tree.html", "Tree"),
+            KSSDemo('', '', "demos/more_selectors.html", "More complex selectors"),
+            KSSDemo('', '', "demos/two_select_revisited.html", "Master-slave selects revisited"),
+            KSSDemo('', '', "demos/form_submit.html", "Form submit"),
+            KSSDemo('', '', "demos/effects.html", "Effects"),
+            KSSDemo('', '', "demos/error_handling.html", "Error handling"),
+            KSSDemo('', '', "demos/preventdefault.html", "Preventdefault (a.k.a. Safari workarounds)"),
+            KSSDemo('', '', "demos/html_inserts.html", "HTML insertions (Change tag content returns)"),
+            KSSDemo('', 'Parameter functions', 'demos/pf_forms.html', 'Forms'),
+            KSSDemo('', 'Selectors', 'demos/selectors.html', 'Parent node selector'),
+            KSSDemo('', 'Core syntax', "demos/kss_selector_param.html", "Kss selector parameters"),
+            KSSDemo('', 'Core syntax', "demos/kss_url_param.html", "Kss url parameters"),
+            KSSDemo('', 'Core events', "demos/kss_evt_preventbubbling.html", "Prevent bubbling KSS event parameter"),
+            KSSDemo('', 'Core events', "demos/kss_keyevents.html", "Key events"),
+            KSSDemo('', 'Commands/Actions', "demos/ca_focus.html", "Focus"),
+            KSSDemo('', 'Commands/Actions', "demos/actions.html", "Toggle case action"),
+            )
 
     # directories are relative from the location of this .py file
     selenium_tests = (

Modified: kukit/kss.zope/trunk/kss/zope/plugins/effects/configure.zcml
==============================================================================
--- kukit/kss.zope/trunk/kss/zope/plugins/effects/configure.zcml	(original)
+++ kukit/kss.zope/trunk/kss/zope/plugins/effects/configure.zcml	Sat Feb  2 12:06:51 2008
@@ -16,46 +16,4 @@
         name="effects.js"
         />
 
-    <!-- example plugin registration
-     
-    <kss:eventtype
-        name="myCustomEventType"
-        jsfile="browser/my_plugins.js"
-        />
-  
-    <kss:action
-        name="myCustomAction"
-        jsfile="browser/my_plugins.js"
-        command_factory="selector/global"
-        params_mandatory="param1 param2 ... paramN"
-        params_optional=""
-        />
-  
-    <kss:selectortype
-        name="myCustomSelectorType"
-        jsfile="browser/my_plugins.js"
-        />
-
-    -->
-
-    <!-- Event types -->
-
-    <!-- Client actions & commands -->
-    
-    <kss:action
-        name="effect"
-        jsfile="browser/plugin.js"
-        command_factory="selector"
-        params_mandatory="type"
-        />
-
-    <!-- Command sets -->
-
-    <kss:commandset
-         name="effects"
-         for="kss.core.interfaces.IKSSView"
-         class=".commands.ScriptaculousEffectsCommands"
-         provides=".interfaces.IScriptaculousEffectsCommands"
-         />
-
 </configure>


More information about the Kukit-checkins mailing list