Jquery javascript library for TurboGears
Project description
Feature
jquery is a jquery javascript library wrapper and ajax helper for happy TurboGears web designers.
It contains 3 extra ajax widgets based on jquery.
addCallback / link_to_remote(target ,update, href, callback)
addPeriodBack / periodically_call_remote(update, href, interval)
addFormback / form_remote_tag(target, update, href)
Which are inspired from Ruby on Rails/pquery and give them the twisted syntax.
Available widgets
Jquery (basic jquery libray wrapper for Turbogears)
addCallback/link_to_remote
addPeriodBack/periodically_call_remote
addFormback/form_remote_tag
Install
Use setuptools to install:
$easy_install jquery
Usage
jquery
include in config/app.cfg:
tg.include_widgets = ['jquery.jquery']
jquery ajax
import in controllers.py:
from jquery import addCallback from jquery import addPeriodback from jquery import addFormback .... return dict(addCallback = addCallback, addPeriodback = addPeriodback)
in template:
[div id="timelink"][a href = "#"]get time[/a][/div] [div id="timediv"][/div] ${addCallback(target="timelink" ,update="timediv", href="/time")}
or:
[div id="timediv"][/div] ${addPeriodback(update="timediv", href="/time", interval="3000")}
or:
[form class="timelink" action="ajax" method="get" ] Field : [input type="text" name="field" /][br /] [input type="submit" /] [/form] [div id="timediv"][/div] ${addFormback(target="timelink", update="timediv", href="ajax")}
The addCallback/addPeriodback(link_to_remote/periodically_call_remote) could be placed anywhere in your template. Check http://docs.turbogears.org/1.0/RemoteLink for detail.
Reference
jquery 1.2.2 http://jquery.com
History
1.2.2:
update to jquery 1.2.2
1.1.2w2:
new twisted style ajax call
new addFormback/form_remote_tag call
passing ajax function no need extra ‘()’ at all.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file jquery-1.2.2.zip
.
File metadata
- Download URL: jquery-1.2.2.zip
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fc4b7a3a49e3ad3710bacb4fef1a27857a4d749379e3b0e81de9c9a9d8b293e |
|
MD5 | 99296bcc52d6e627383713fc0f922a61 |
|
BLAKE2b-256 | f77371ea43bf4e83472569ed70b3a5adf6a153fee27f79a9268dc0143f499516 |
File details
Details for the file jquery-1.2.2-py2.5.egg
.
File metadata
- Download URL: jquery-1.2.2-py2.5.egg
- Upload date:
- Size: 127.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a1e93b6ec4b8a5eb2021f1472430b0d7fa44035b3c514b3ce39dbe03e42e639 |
|
MD5 | 43c0512fc8536fc893d468c90b02a8df |
|
BLAKE2b-256 | 53125b4e1559af82503a204ae7991637def7837e044d36e12b1cea0cf236e24c |