Skip to content
timlegrand edited this page Jun 17, 2014 · 4 revisions

The new api has two methods only.

StandaLock.add(Object: config)

This method adds a new Standalock configuration to the jobs queue. This method is chainable.

StandaLock.render()

This method renders all the queued jobs.

The config object accepts the following attributes:

  • String: anchor: the CSS selector for the anchor where the StandaLock canvas will be rendered (e.g. '#mylockhere');
  • String: message: A message that will be printed to the user prior to the StandaLock;
  • Object: data (optional): An associative array (key/value hash) containing the encrypted user's data;
  • Function: decrypt (optional): A function that is used to decrypt the user's data. This attributes is mandatory if the dataobject was provided;
  • String: decryptUrl (optional): An url of a remote script that encapsulates the decryption algorithm. This attributes is mandatory if the data object was provided with no decrypt function. Please note that if both the decryptfunction and the decryptUrl are provided, only the decryptUrl will be used;
  • String: template: An HTML template that will be showed after the unlock process has succeded. In order to print out the decrypted value form the provided data attribute, use the {{key}} syntax inside the template;
  • String: outputAnchor (optional): the CSS selector for the anchor where the decrypted data will be printed (e.g. '#myphonehere').

Clone this wiki locally