Buttons Module

Buttons Functions & Variables

The Buttons Module features the following functions:


buttons.access(button, e) - back to top

This function opens a modal window containing a QR code with the address for the corresponding account_id, and also provides a selection of actions that can then be performed on the account.

- back to top


buttons.cancel(button, mobile, menu, elements) - back to top

This function is used internally to close sidebars and navigation upon page transitions.

- back to top


buttons.create_account(button, e) - back to top

This function is used to activate the creation of a new account.

It uses the data-form attribute of the clicked button to find the form.

Each form-group container within the form is then checked and used towards the compounding encryption.

The minimum required inputs include:

Without these, it will not be able to call the required $.fn.blockstrap.accounts.new function.

- back to top


buttons.create_contact(button, e) - back to top

This function is used to activate the creation of a new contact.

It uses the data-form attribute of the clicked button to find the form.

Each form-group container within the form is then checked and used towards the contact creation.

The minimum required inputs include:

Without these, it will not be able to call the required $.fn.blockstrap.contacts.new function.

- back to top


buttons.create_credentials(button, e) - back to top

This function opens the login-credentials-modal if available.

- back to top


buttons.edit(button, e) - back to top

This function opens a modal window containing a form that allows you to edit contact details.

- back to top


buttons.edit_object(button, e) - back to top

This function is used in conjunction with buttons.edit to perform the saving of edited information.

- back to top


buttons.import(button, e) - back to top

This function opens a modal window that provides instructions on importing device data.

- back to top


buttons.login(button, e) - back to top

This function provides login functionality that utilizes internally stored your_username and your_password options to confirm if the user should be allowed further access.

- back to top


buttons.logout(button, e) - back to top

This function will logout the current user.

- back to top


buttons.more_security(button, e) - back to top

This function toggles hidden content display within the account creation modal window.

- back to top


buttons.page(button, e) - back to top

This function is used to providing animated page transitions within the default theme.

- back to top


buttons.print(button, e) - back to top

This function is used to open a print-friendly window.

- back to top


buttons.process(slug, content, filtered_data, button, effect, direction, reverse_direxction, mobile, menu, elements) - back to top

This function is used in conjunction with buttons.page to handle the injection of new content when switching pages.

- back to top


buttons.refresh(button, e) - back to top

This function is used to refresh specific content on the page using the following button attributes:

Currently, the only accepted collection is accounts.

The corresponding key is used as an account_id in order to update the details via an API call and then refresh the page content.

- back to top


buttons.remove(button, e) - back to top

This function is used to open a modal window the contains a form with the relevant information needed to perform $.fn.blockstrap.accounts.remove.

The following button data attributes are required:

The data-collection and data-key are used to defined which item should be removed from localStorage, whilst the data-confirm defines whether a confirmation modal should appear first. Upon successfuly removal, the data-element will be used as an ID reference to findthe appropriate element within the DOM to remove.

- back to top


buttons.reset(button, e) - back to top

This function opens a confirmation modal asking if you want to reset your device, confirming which will then remove all Blockstrap related information from localStorage.

- back to top


buttons.send_money(button, e) - back to top

This function is used prior to $.fn.blockstrap.accounts.prepare as a way to collect the required information. It uses the following button data attributes:

From which it then seeks the following inputs:

- back to top


buttons.set_credentials(button, e) - back to top

This function opens a modal window with a form that allows you to set your user credentials.

It requires the following button data attributes:

It uses the data-form value to first define which form to then look for the three required fields.

- back to top


buttons.setup(button, e) - back to top

This function is a complete nightmare, and yet it is also central to the process and used for the most important task at hand, setting-up your device for the first time. It's a little like buttons.create_account in its requirements for minimum input values (derived from data-form).

However, it also allows you to define setup steps. Setup can consist of as many steps as added to the required steps.js dependency. In themes/default/js/dependencies/steps.js there are two steps, at which point the following button data attributes also become important:

The data-steps should confirm the total number of setup steps whereas the `data-step should confirm the current step.

- back to top


buttons.submit_import(button, e) - back to top

This function is used in conjunction with buttons.import.

It searches the DOM for form#import-device-data #import-data expectings its value to be a JSON string, where it will then attempt to add the relevant records to localStorage. Once parsed, the JSON object looks for the following fields:

- back to top


buttons.submit_payment(button, e) - back to top

This function is used to process information prior to sending a payment and uses the following button data attributes:

The data-form-id is used to define which form within the DOM to use to find the validating information proving ownwership of the account, where as the data-account-id is used to define which account to send the payment from, and the other three fields then define what to send to where.

The critical functions is must parse include:

- back to top


buttons.submit_verification(button, e) - back to top

This function is used in conjunction with $.fn.blockstrap.accounts.verify to ensure that the current user has ownership of the relevant account. It requires the following button data attributes:

The data-form-id is used to define which form within the DOM to use to find the validating information proving ownwership of the account, where as the data-account-id is used to define which account needs verifying.

- back to top


buttons.toggle(button, e) - back to top

This function is used to toggle UI elements within the ocntact creation modal window between an input form with a user icon floating to the right to a select box filled with current contacts and the ability to switch back to the manual input. If no contacts have yet been created and the button is clicked, a new modal window will open informing the user that they do not yet have any contacts.

- back to top


  1. Related Articles
  2. Back to Modules
  3. Accounts
  4. API
  5. Buttons
  6. Contacts
  7. Blockchains
  8. Data
  9. Filters
  10. Forms
  11. Security
  12. Styles
  13. Templates
  14. Table of Contents