-
Notifications
You must be signed in to change notification settings - Fork 0
Nui.sign_petition
maxcal edited this page May 30, 2011
·
3 revisions
Nui.sign_petition is a helper function used on Petition pages.
It copies the users name from the form inputs to the end of the petition text.
It is a bit frail since it relies on the dom structure created by the P3 controllers.
It uses the Psuedo-Classical inheritance model. It is included in nui.frontend.js
It is called @ document ready. The initialization function checks for body.letter
before any action is taken.
nui.sign_petition.initialize();
Binds the fields and checks for values.
-
form_fields
- literal object which contains the fields to be checked. -
get_fields
- function which checks the fields and adds the values toform_fields
-
update_body
- function which callsget_fields
and then appends the _user signature to the petition letter.