Archived
This project has been archived by its maintainers, and is no longer receiving any updates.
This package contains a collection of JQuery-based widgets.
* Rest Editor Widget
Detailed Documentation
**********************
==================
Rest Editor Widget
==================
The jquery.resteditorre package provides a javascript which can render a
toolbar above a testarea widget. This toolbar offers buttons which can be used
for apply reStructuredText formatters to the text in the textarea.
We can't demonstrate this here because it's all done in javascript. The
reStructuredText editor textarea looks exactly how a normal z3c.form textarea
looks. Btw. any textarea can use this package, there is no need for using the
implemented RESTEditorWidget. But anyway such a textarea widget looks like:
>>> import zope.schema
>>> from z3c.form import widget
>>> from z3c.form import testing
>>> from jquery.widget.resteditor.browser import RESTEditorFieldWidget
We have to define a text field and a test request for instantiate the widget:
>>> text = zope.schema.Text(
... title=u'Text',
... description=u'Text field'
... )
>>> widget = RESTEditorFieldWidget(text, testing.TestRequest())
>>> widget
<RESTEditorWidget ''>
Before we can render the widget, we need to register a template This template
is normaly registered by the z3c.form framework. Let's do it here since we not
use a real site setup.
>>> from zope.configuration import xmlconfig
>>> import zope.component
>>> import z3c.form
>>> xmlconfig.XMLConfig('meta.zcml', zope.component)()
>>> xmlconfig.XMLConfig('meta.zcml', z3c.form)()
>>> xmlconfig.XMLConfig('configure.zcml', z3c.form)()
Now we can render the widget:
>>> widget.update()
>>> print widget.render()
<textarea id="" name="" class="restEditorWidget"></textarea>
As you can see the reStructuredText editor widget uses a css class called
``restEditorWidget``. this class can be used for apply a JQuery xpath rule
and load the JQuery method restEditor.
This can be done like:
$('.restEditorWidget').restEditor();
Of corse you can do this inside a global JQuery dom onload event handler call.
If so, you can use something like this:
$(document).ready(function() {
$('.restEditorWidget').restEditor();
});
Note, there is also a sample located at http://www.z3c.org/samples
* Rest Editor Widget
Detailed Documentation
**********************
==================
Rest Editor Widget
==================
The jquery.resteditorre package provides a javascript which can render a
toolbar above a testarea widget. This toolbar offers buttons which can be used
for apply reStructuredText formatters to the text in the textarea.
We can't demonstrate this here because it's all done in javascript. The
reStructuredText editor textarea looks exactly how a normal z3c.form textarea
looks. Btw. any textarea can use this package, there is no need for using the
implemented RESTEditorWidget. But anyway such a textarea widget looks like:
>>> import zope.schema
>>> from z3c.form import widget
>>> from z3c.form import testing
>>> from jquery.widget.resteditor.browser import RESTEditorFieldWidget
We have to define a text field and a test request for instantiate the widget:
>>> text = zope.schema.Text(
... title=u'Text',
... description=u'Text field'
... )
>>> widget = RESTEditorFieldWidget(text, testing.TestRequest())
>>> widget
<RESTEditorWidget ''>
Before we can render the widget, we need to register a template This template
is normaly registered by the z3c.form framework. Let's do it here since we not
use a real site setup.
>>> from zope.configuration import xmlconfig
>>> import zope.component
>>> import z3c.form
>>> xmlconfig.XMLConfig('meta.zcml', zope.component)()
>>> xmlconfig.XMLConfig('meta.zcml', z3c.form)()
>>> xmlconfig.XMLConfig('configure.zcml', z3c.form)()
Now we can render the widget:
>>> widget.update()
>>> print widget.render()
<textarea id="" name="" class="restEditorWidget"></textarea>
As you can see the reStructuredText editor widget uses a css class called
``restEditorWidget``. this class can be used for apply a JQuery xpath rule
and load the JQuery method restEditor.
This can be done like:
$('.restEditorWidget').restEditor();
Of corse you can do this inside a global JQuery dom onload event handler call.
If so, you can use something like this:
$(document).ready(function() {
$('.restEditorWidget').restEditor();
});
Note, there is also a sample located at http://www.z3c.org/samples
Release files for jquery.widget 0.1.0c1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jquery.widget-0.1.0c1.tar.gz | 141.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jquery.widget-0.1.0c1-py2.4.egg | Legacy Egg format | - | - | Details |
Total release size: 406.7 kB
Release files / jquery.widget-0.1.0c1.tar.gz
| Download URL | jquery.widget-0.1.0c1.tar.gz |
|---|---|
| Size | 141.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b95f80eec0bebfaa2b3d614289d1c973efd8ddd0dbe3b38153490a79049a7baa
|
|
BLAKE2b-256 checksum How to use checksums |
2daf6cd4bf94854ad8cc5c87eaaa9d6bb99c385e8f817b81f0238d75ab663976
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / jquery.widget-0.1.0c1-py2.4.egg
| Download URL | jquery.widget-0.1.0c1-py2.4.egg |
|---|---|
| Size | 265.0 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
ae58353f6212ad8271208c35441d72f0b52fc79fb064a617f13cd3d33e131d8c
|
|
BLAKE2b-256 checksum How to use checksums |
31d019eb5558ea3ffb01c7287b36719b59e4da48ec2336fcea568082f4f93b12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |