Skip to content

Nui.sign_petition

maxcal edited this page May 30, 2011 · 3 revisions

Abstract

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.

Public methods

nui.sign_petition.initialize();

Binds the fields and checks for values.

Private

  • form_fields - literal object which contains the fields to be checked.
  • get_fields - function which checks the fields and adds the values to form_fields
  • update_body - function which calls get_fields and then appends the _user signature to the petition letter.
Clone this wiki locally