[Checkins] SVN: Sandbox/pcardune/z3c.formextjs/ Add z3c.formextjs
package to my sandbox. I realised too late that
Paul Carduner
paulcarduner at gmail.com
Sun Apr 20 19:40:34 EDT 2008
Log message for revision 85515:
Add z3c.formextjs package to my sandbox. I realised too late that
this wasn't appropriate for the z3c.formjs package, and should really
live separately.
Changed:
A Sandbox/pcardune/z3c.formextjs/
A Sandbox/pcardune/z3c.formextjs/AUTHOR.txt
A Sandbox/pcardune/z3c.formextjs/CHANGES.txt
A Sandbox/pcardune/z3c.formextjs/LICENSE.txt
A Sandbox/pcardune/z3c.formextjs/README.txt
A Sandbox/pcardune/z3c.formextjs/TODO.txt
A Sandbox/pcardune/z3c.formextjs/bootstrap.py
A Sandbox/pcardune/z3c.formextjs/buildout.cfg
A Sandbox/pcardune/z3c.formextjs/setup.py
A Sandbox/pcardune/z3c.formextjs/src/
A Sandbox/pcardune/z3c.formextjs/src/z3c/
A Sandbox/pcardune/z3c.formextjs/src/z3c/__init__.py
A Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/
A Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/__init__.py
A Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/
A Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/__init__.py
A Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/configure.zcml
A Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-viewlet-manager.pyt
A Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-viewlet.pyt
A Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-widgets-viewlet.pyt
A Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/text_input.pt
A Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/configure.zcml
A Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/div-form.pt
A Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/extjs-form.zcml
A Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/interfaces.py
-=-
Added: Sandbox/pcardune/z3c.formextjs/AUTHOR.txt
===================================================================
--- Sandbox/pcardune/z3c.formextjs/AUTHOR.txt (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/AUTHOR.txt 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,2 @@
+Paul Carduner (paulcarduner <at> gmail.com)
+
Property changes on: Sandbox/pcardune/z3c.formextjs/AUTHOR.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/CHANGES.txt
===================================================================
--- Sandbox/pcardune/z3c.formextjs/CHANGES.txt (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/CHANGES.txt 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,8 @@
+=======
+CHANGES
+=======
+
+Version 0.1.0 (unreleased)
+--------------------------
+
+- ...
Property changes on: Sandbox/pcardune/z3c.formextjs/CHANGES.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/LICENSE.txt
===================================================================
--- Sandbox/pcardune/z3c.formextjs/LICENSE.txt (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/LICENSE.txt 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,54 @@
+Zope Public License (ZPL) Version 2.1
+-------------------------------------
+
+A copyright notice accompanies this license document that
+identifies the copyright holders.
+
+This license has been certified as open source. It has also
+been designated as GPL compatible by the Free Software
+Foundation (FSF).
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the
+following conditions are met:
+
+1. Redistributions in source code must retain the
+ accompanying copyright notice, this list of conditions,
+ and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the accompanying
+ copyright notice, this list of conditions, and the
+ following disclaimer in the documentation and/or other
+ materials provided with the distribution.
+
+3. Names of the copyright holders must not be used to
+ endorse or promote products derived from this software
+ without prior written permission from the copyright
+ holders.
+
+4. The right to distribute this software or to use it for
+ any purpose does not give you the right to use
+ Servicemarks (sm) or Trademarks (tm) of the copyright
+ holders. Use of them is covered by separate agreement
+ with the copyright holders.
+
+5. If any files are modified, you must cause the modified
+ files to carry prominent notices stating that you changed
+ the files and the date of any change.
+
+Disclaimer
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''
+ AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+ NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ NO EVENT SHALL THE COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ DAMAGE.
Property changes on: Sandbox/pcardune/z3c.formextjs/LICENSE.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/README.txt
===================================================================
--- Sandbox/pcardune/z3c.formextjs/README.txt (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/README.txt 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,2 @@
+This package provides widgets and macros for generating javascript
+which then generates forms on the client side using the ExtJS library.
\ No newline at end of file
Property changes on: Sandbox/pcardune/z3c.formextjs/README.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/TODO.txt
===================================================================
--- Sandbox/pcardune/z3c.formextjs/TODO.txt (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/TODO.txt 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,4 @@
+====
+TODO
+====
+
Property changes on: Sandbox/pcardune/z3c.formextjs/TODO.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/bootstrap.py
===================================================================
--- Sandbox/pcardune/z3c.formextjs/bootstrap.py (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/bootstrap.py 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id$
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+ez = {}
+exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+ ).read() in ez
+ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+import pkg_resources
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+if sys.platform == 'win32':
+ cmd = '"%s"' % cmd # work around spawn lamosity on windows
+
+ws = pkg_resources.working_set
+assert os.spawnle(
+ os.P_WAIT, sys.executable, sys.executable,
+ '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)
Property changes on: Sandbox/pcardune/z3c.formextjs/bootstrap.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/buildout.cfg
===================================================================
--- Sandbox/pcardune/z3c.formextjs/buildout.cfg (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/buildout.cfg 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,12 @@
+[buildout]
+develop = .
+parts = test coverage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = z3c.formextjs [test]
+
+[coverage]
+recipe = zc.recipe.egg
+eggs = z3c.coverage
+
Property changes on: Sandbox/pcardune/z3c.formextjs/buildout.cfg
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/setup.py
===================================================================
--- Sandbox/pcardune/z3c.formextjs/setup.py (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/setup.py 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,86 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Setup
+
+$Id$
+"""
+import os
+import xml.sax.saxutils
+from setuptools import setup, find_packages
+
+def read(*rnames):
+ text = open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+ return xml.sax.saxutils.escape(text)
+
+chapters = '\n'.join(
+ [read('src', 'z3c', 'formjs', name)
+ for name in ('README.txt',
+ 'jsaction.txt',
+ 'jsvalidator.txt',
+ 'jsevent.txt')])
+
+setup (
+ name='z3c.formextjs',
+ version='0.1.0dev',
+ author = "Paul Carduner and the Zope Community",
+ author_email = "zope3-dev at zope.org",
+ description = "ExtJS integration into ``z3c.form``",
+ long_description=(
+ read('README.txt')
+ + '\n\n' +
+ 'Detailed Documentation\n'
+ '**********************\n'
+ + '\n' + chapters
+ + '\n\n' +
+ read('CHANGES.txt')
+ + '\n\n' +
+ read('TODO.txt')
+ ),
+ license = "ZPL 2.1",
+ keywords = "zope3 form javascript extjs",
+ classifiers = [
+ 'Development Status :: 3 - Alpha',
+ 'Environment :: Web Environment',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: Zope Public License',
+ 'Programming Language :: Python',
+ 'Natural Language :: English',
+ 'Operating System :: OS Independent',
+ 'Topic :: Internet :: WWW/HTTP',
+ 'Framework :: Zope3'],
+ url = 'http://svn.zope.org/z3c.formextjs',
+ packages = find_packages('src'),
+ include_package_data = True,
+ package_dir = {'':'src'},
+ namespace_packages = ['z3c'],
+ extras_require = dict(
+ test = ['zope.testing', 'zope.app.testing', 'z3c.coverage'],
+ ),
+ install_requires = [
+ 'jquery.layer',
+ 'setuptools',
+ 'z3c.form',
+ 'z3c.formui',
+ 'z3c.traverser',
+ 'zope.app.pagetemplate',
+ 'zope.component',
+ 'zope.interface',
+ 'zope.location',
+ 'zope.publisher',
+ 'zope.schema',
+ 'zope.traversing',
+ ],
+ dependency_links = ['http://download.zope.org/distribution'],
+ zip_safe = False,
+ )
Property changes on: Sandbox/pcardune/z3c.formextjs/setup.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/src/z3c/__init__.py
===================================================================
--- Sandbox/pcardune/z3c.formextjs/src/z3c/__init__.py (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/src/z3c/__init__.py 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,7 @@
+try:
+ # Declare this a namespace package if pkg_resources is available.
+ import pkg_resources
+ pkg_resources.declare_namespace('z3c')
+except ImportError:
+ pass
+
Property changes on: Sandbox/pcardune/z3c.formextjs/src/z3c/__init__.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/__init__.py
===================================================================
--- Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/__init__.py (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/__init__.py 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1 @@
+#extjs integration package.
Property changes on: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/__init__.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/__init__.py
===================================================================
--- Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/__init__.py (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/__init__.py 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,88 @@
+#extjs widgets
+import os.path, sys
+from zope.viewlet.interfaces import IViewletManager
+from zope.viewlet.viewlet import ViewletBase
+from zope.viewlet.manager import WeightOrderedViewletManager
+from zope.documenttemplate.untrusted import UntrustedHTML
+
+
+def package_home(gdict):
+ filename = gdict["__file__"]
+ return os.path.dirname(filename)
+
+class PythonTemplateFile(object):
+
+ def __init__(self, filename, _prefix=None):
+ path = self.get_path_from_prefix(_prefix)
+ self.filename = os.path.join(path, filename)
+ if not os.path.isfile(self.filename):
+ raise ValueError("No such file", self.filename)
+
+ def get_path_from_prefix(self, _prefix):
+ if isinstance(_prefix, str):
+ path = _prefix
+ else:
+ if _prefix is None:
+ _prefix = sys._getframe(2).f_globals
+ path = package_home(_prefix)
+ return path
+
+ def __call__(self, context, **kwargs):
+ inFile = open(self.filename, 'rb')
+ scope = {'r':'', 'context':context}
+ scope.update(kwargs)
+ exec inFile in scope
+ return scope['r']
+
+
+def escape(s):
+ s = str(s).replace('\n','\\n').replace("'","\\'")
+ return s
+
+
+class IJSFormViewletManager(IViewletManager):
+ """js form viewlet manager for rendering form generating javascript."""
+
+
+class ExtJSFormViewletManager(WeightOrderedViewletManager):
+
+ template = PythonTemplateFile('form-viewlet-manager.pyt')
+
+ def render(self):
+ return self.template(self)
+
+
+class FormAwareViewlet(ViewletBase):
+
+ def update(self):
+ self.form = self.__parent__
+
+ def hash(self, name):
+ return str(hash(name)).replace('-','_')
+
+
+class ExtJSFormViewlet(FormAwareViewlet):
+ """Viewlet for js form declaration."""
+
+ template = PythonTemplateFile('form-viewlet.pyt')
+
+ def render(self):
+ return self.template(self)
+
+
+class ExtJSWidgetsViewlet(FormAwareViewlet):
+ """Viewlet that hook in all the widgets."""
+
+ template = PythonTemplateFile('form-widgets-viewlet.pyt')
+
+ def render(self):
+ return self.template(self, **globals())
+
+
+class ExtJSButtonsViewlet(FormAwareViewlet):
+ """Viewlet that add JS hooks for displaying buttons."""
+
+ template = PythonTemplateFile('form-buttons-viewlet.pyt')
+
+ def render(self):
+ return self.template(self, **globals())
Property changes on: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/__init__.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/configure.zcml
===================================================================
--- Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/configure.zcml (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/configure.zcml 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,41 @@
+<configure
+ xmlns="http://namespaces.zope.org/browser"
+ xmlns:z3c="http://namespaces.zope.org/z3c"
+ i18n_domain="z3c.formjs">
+
+ <viewletManager
+ name="z3c.formjs.ext.JSFormViewletManager"
+ provides=".IJSFormViewletManager"
+ class=".ExtJSFormViewletManager"
+ layer="z3c.formjs.extjs.interfaces.IExtJSFormLayer"
+ permission="zope.Public"
+ />
+
+ <viewlet
+ name="z3c.formjs.ext.ExtJSFormViewlet"
+ for="*"
+ manager=".IJSFormViewletManager"
+ class=".ExtJSFormViewlet"
+ permission="zope.Public"
+ layer="z3c.formjs.extjs.interfaces.IExtJSFormLayer"
+ weight="1"
+ />
+
+ <viewlet
+ name="z3c.formjs.ext.ExtJSWidgetsViewlet"
+ for="*"
+ manager=".IJSFormViewletManager"
+ class=".ExtJSWidgetsViewlet"
+ permission="zope.Public"
+ layer="z3c.formjs.extjs.interfaces.IExtJSFormLayer"
+ weight="2"
+ />
+
+ <z3c:widgetTemplate
+ mode="input"
+ widget="z3c.form.interfaces.ITextWidget"
+ layer="z3c.formjs.extjs.interfaces.IExtJSFormLayer"
+ template="text_input.pt"
+ />
+
+</configure>
Property changes on: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/configure.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-viewlet-manager.pyt
===================================================================
--- Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-viewlet-manager.pyt (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-viewlet-manager.pyt 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,12 @@
+r += '''
+<script type="text/javascript">
+ Ext.onReady(function(){
+'''
+
+for viewlet in context.viewlets:
+ r += viewlet.render()
+
+r += '''
+ });
+</script>
+'''
Property changes on: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-viewlet-manager.pyt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-viewlet.pyt
===================================================================
--- Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-viewlet.pyt (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-viewlet.pyt 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,17 @@
+from string import Template
+r+="""
+var ${formVar} = new Ext.Panel({
+ renderTo: '${formId}',
+ width: '500px',
+ frame: true,
+ layout: 'form',
+ title: '${formLabel}',
+ html: 'My HTML content',
+});
+"""
+
+r = Template(r).substitute({
+ 'formId':context.form.id,
+ 'formLabel':context.form.label,
+ 'formVar':'form'+context.hash(context.form.id),
+ })
Property changes on: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-viewlet.pyt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-widgets-viewlet.pyt
===================================================================
--- Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-widgets-viewlet.pyt (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-widgets-viewlet.pyt 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,22 @@
+from string import Template
+
+formVar = 'form%s' % context.hash(context.form.id)
+for widget in context.form.widgets.values():
+ w = """
+ var ${widgetVar} = ${formVar}.add(new Ext.form.TextField({
+ fieldLabel: '${widgetLabel}',
+ value: '${widgetValue}',
+ width: '300px',
+ }));
+ """
+
+ r += Template(w).substitute(dict(
+ widgetVar = 'widget%s' % context.hash(widget.id),
+ formVar = formVar,
+ widgetLabel = widget.label,
+ widgetValue = escape(widget.value),
+ ))
+
+r += """
+%(formVar)s.doLayout();
+""" % dict(formVar=formVar)
Property changes on: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/form-widgets-viewlet.pyt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/text_input.pt
===================================================================
--- Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/text_input.pt (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/text_input.pt 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,33 @@
+<tal:var define="unused resource_library:ext-all" />
+<input type="text" id="" name="" class="" title="" lang="" disabled=""
+ readonly="" alt="" tabindex="" accesskey="" size="" maxlength=""
+ tal:attributes="id view/id;
+ name view/name;
+ class view/klass;
+ style view/style;
+ title view/title;
+ lang view/lang;
+ onclick view/onclick;
+ ondblclick view/ondblclick;
+ onmousedown view/onmousedown;
+ onmouseup view/onmouseup;
+ onmouseover view/onmouseover;
+ onmousemove view/onmousemove;
+ onmouseout view/onmouseout;
+ onkeypress view/onkeypress;
+ onkeydown view/onkeydown;
+ onkeyup view/onkeyup;
+ value view/value;
+ disabled view/disabled;
+ tabindex view/tabindex;
+ onfocus view/onfocus;
+ onblur view/onblur;
+ onchange view/onchange;
+ readonly view/readonly;
+ alt view/alt;
+ accesskey view/accesskey;
+ onselect view/onselect;
+ size view/size;
+ maxlength view/maxlength"
+ tal:condition="nothing"/>
+<div tal:attributes="id view/id" />
\ No newline at end of file
Property changes on: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/browser/text_input.pt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/configure.zcml
===================================================================
--- Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/configure.zcml (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/configure.zcml 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="z3c.formjs">
+
+ <include file="extjs-form.zcml"/>
+ <include package=".browser" />
+
+</configure>
Property changes on: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/configure.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/div-form.pt
===================================================================
--- Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/div-form.pt (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/div-form.pt 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,117 @@
+<h1>EXTJS SKIN</h1>
+<div id="test"></div>
+<div tal:attributes="id view/id"></div>
+<tal:var tal:define="unused resource_library:ext-all" />
+<div tal:replace="structure provider:z3c.formjs.ext.JSFormViewletManager"></div>
+
+<form tal:condition="nothing" action="." method="post" enctype="multipart/form-data" class="blahblahblah"
+ metal:define-macro="form"
+ tal:attributes="method view/method;
+ enctype view/enctype;
+ acceptCharset view/acceptCharset;
+ accept view/accept;
+ action view/action;
+ name view/name;
+ id view/id">
+ <metal:block define-macro="subform">
+ <div class="viewspace" metal:define-slot="viewspace">
+ <metal:block define-slot="label">
+ <h1 metal:define-macro="label"
+ tal:condition="view/label|nothing"
+ tal:content="view/label">
+ Form Label
+ </h1>
+ </metal:block>
+ <metal:block define-slot="info">
+ <div class="required-info"
+ metal:define-macro="required-info">
+ <span class="required">*</span>
+ – required
+ </div>
+ </metal:block>
+ <metal:block define-slot="header">
+ <div class="status"
+ tal:condition="view/status"
+ metal:define-macro="header">
+ <div class="summary"
+ i18n:translate=""
+ tal:content="view/status">
+ Form status summary
+ </div>
+ <ul class="errors"
+ tal:condition="view/widgets/errors"
+ metal:define-macro="errors">
+ <li tal:repeat="error view/widgets/errors">
+ <tal:block condition="error/widget">
+ <span tal:replace="error/widget/label" />:
+ </tal:block>
+ <span tal:replace="structure error/render">Error Type</span>
+ </li>
+ </ul>
+ </div>
+ </metal:block>
+ <div metal:define-slot="extra-info" tal:replace="nothing">
+ </div>
+ <div metal:define-slot="main">
+ <metal:block define-macro="widget-rows">
+ <tal:block repeat="widget view/widgets/values">
+ <div id="" class="row"
+ tal:attributes="id string:${widget/id}-row"
+ tal:condition="python:widget.mode != 'hidden'">
+ <metal:block define-macro="widget-row">
+ <div class="label">
+ <label tal:attributes="for widget/id">
+ <span i18n:translate=""
+ tal:content="widget/label">label</span>
+ <span class="required"
+ tal:condition="widget/required">*</span>
+ </label>
+ </div>
+ <div class="widget" tal:content="structure widget/render">
+ <input type="text" size="24" value="" />
+ </div>
+ <div class="error"
+ tal:condition="widget/error">
+ <span tal:replace="structure widget/error/render">error</span>
+ </div>
+ </metal:block>
+ </div>
+ <input type="hidden" value=""
+ tal:condition="python:widget.mode == 'hidden'"
+ tal:replace="structure widget/render" />
+ </tal:block>
+ </metal:block>
+ <metal:block define-macro="groups">
+ <fieldset tal:condition="view/groups|nothing"
+ tal:repeat="view view/groups">
+ <legend tal:condition="view/label"
+ tal:content="view/label">Label</legend>
+ <metal:block define-slot="group-header">
+ <div class="status"
+ tal:condition="view/widgets/errors">
+ <div metal:use-macro="template/macros/errors" />
+ </div>
+ </metal:block>
+ <metal:block define-slot="group-rows">
+ <div metal:use-macro="template/macros/widget-rows" />
+ </metal:block>
+ </fieldset>
+ </metal:block>
+ </div>
+ <metal:block define-slot="above-buttons">
+ </metal:block>
+ </div>
+ <metal:block define-slot="buttons">
+ <div metal:define-macro="buttons">
+ <div class="buttons"
+ metal:define-slot="bottom-buttons">
+ <input tal:repeat="action view/actions/values"
+ tal:replace="structure action/render"
+ />
+ </div>
+ </div>
+ </metal:block>
+ <metal:block define-slot="bottom">
+ </metal:block>
+ </metal:block>
+</form>
Property changes on: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/div-form.pt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/extjs-form.zcml
===================================================================
--- Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/extjs-form.zcml (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/extjs-form.zcml 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,110 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ xmlns:z3c="http://namespaces.zope.org/z3c">
+
+ <interface
+ interface=".interfaces.IExtJSFormLayer"
+ type="zope.publisher.interfaces.browser.IBrowserSkinType"
+ />
+
+ <!-- form macros -->
+ <z3c:macro
+ name="form"
+ template="div-form.pt"
+ layer=".interfaces.IExtJSFormLayer"
+ />
+ <z3c:macro
+ name="subform"
+ template="div-form.pt"
+ layer=".interfaces.IExtJSFormLayer"
+ />
+ <!--z3c:macro
+ name="subform-display"
+ template="div-form-display.pt"
+ layer=".interfaces.IExtJSFormLayer"
+ /-->
+ <z3c:macro
+ name="form-label"
+ macro="label"
+ template="div-form.pt"
+ layer=".interfaces.IExtJSFormLayer"
+ />
+ <z3c:macro
+ name="form-required-info"
+ macro="required-info"
+ template="div-form.pt"
+ layer=".interfaces.IExtJSFormLayer"
+ />
+ <z3c:macro
+ name="form-header"
+ macro="header"
+ template="div-form.pt"
+ layer=".interfaces.IExtJSFormLayer"
+ />
+ <z3c:macro
+ name="form-errors"
+ macro="errors"
+ template="div-form.pt"
+ layer=".interfaces.IExtJSFormLayer"
+ />
+ <z3c:macro
+ name="widget-rows"
+ macro="widget-rows"
+ template="div-form.pt"
+ layer=".interfaces.IExtJSFormLayer"
+ />
+ <z3c:macro
+ name="widget-row"
+ macro="widget-row"
+ template="div-form.pt"
+ layer=".interfaces.IExtJSFormLayer"
+ />
+ <z3c:macro
+ name="form-groups"
+ macro="groups"
+ template="div-form.pt"
+ layer=".interfaces.IExtJSFormLayer"
+ />
+ <z3c:macro
+ name="form-buttons"
+ macro="buttons"
+ template="div-form.pt"
+ layer=".interfaces.IExtJSFormLayer"
+ />
+
+ <!-- IContentTemplate -->
+ <z3c:template
+ template="div-form.pt"
+ for="z3c.form.interfaces.IInputForm"
+ layer=".interfaces.IExtJSFormLayer"
+ />
+ <!--z3c:template
+ template="div-form-display.pt"
+ for="z3c.form.interfaces.IDisplayForm"
+ layer=".interfaces.IExtJSFormLayer"
+ /-->
+
+ <!-- named IContentTemplate -->
+ <!--z3c:template
+ name="display"
+ template="div-form-display.pt"
+ for="z3c.form.interfaces.IForm"
+ layer=".interfaces.IExtJSFormLayer"
+ /-->
+ <!--z3c:template
+ name="subform"
+ template="subform.pt"
+ for="z3c.form.interfaces.IForm"
+ layer=".interfaces.IExtJSFormLayer"
+ /-->
+
+ <!-- named ILayoutTemplate -->
+ <!--z3c:layout
+ name="subform"
+ template="subform-layout.pt"
+ for="z3c.form.interfaces.IForm"
+ layer=".interfaces.IExtJSFormLayer"
+ /-->
+
+</configure>
Property changes on: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/extjs-form.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/interfaces.py
===================================================================
--- Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/interfaces.py (rev 0)
+++ Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/interfaces.py 2008-04-20 23:40:33 UTC (rev 85515)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Form UI Interfaces
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.viewlet.interfaces import IViewletManager
+
+class IExtJSFormLayer(IBrowserRequest):
+ """A layer that supports forms created using extjs."""
+
+class ICSS(IViewletManager):
+ """CSS viewlet manager."""
Property changes on: Sandbox/pcardune/z3c.formextjs/src/z3c/formextjs/interfaces.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
More information about the Checkins
mailing list