Filters Module
More information is available for extending themes with filters.
Filters Functions & Variables
The Filters Module features the following functions:
$.fn.blockstrap.filters.accounts
(blockstrap, data)$.fn.blockstrap.filters.avatars
(blockstrap, data)$.fn.blockstrap.filters.balances
(blockstrap, data)$.fn.blockstrap.filters.bootstrap
(blockstrap, data)$.fn.blockstrap.filters.contacts
(blockstrap, data)$.fn.blockstrap.filters.get
(blockstrap, data)$.fn.blockstrap.filters.got
(blockstrap, data)$.fn.blockstrap.filters.last
(blockstrap, data)$.fn.blockstrap.filters.plugin
(blockstrap, data)$.fn.blockstrap.filters.setup
(blockstrap, data)$.fn.blockstrap.filters.total
(blockstrap, data)$.fn.blockstrap.filters.txs
(blockstrap, data)
filters.accounts
(blockstrap, data) - back to top
This filter will return an array of the current accounts and will also convert each account balance to a float.
filters.avatars
(blockstrap, data) - back to top
This filter will return an image with the avatar
CSS class using data.option('your_photo')
.
The data
object can be used to set a default image if your_photo
is not stored locally within the options.
filters.balances
(blockstrap, data) - back to top
This filter will return an array of objects containg the transaction counts and balances of each account.
filters.bootstrap
(blockstrap, data) - back to top
This filter will return rendered HTML content using data.type
as a snippet ID and the entire data
object as the data.
More information can be seen in bootstrap assets
.
filters.contacts
(blockstrap, data) - back to top
This filter will return an array of the current contacts.
filters.get
(blockstrap, data) - back to top
This filter uses data.find
to return the value defined by data.collection
and data.key
.
filters.got
(blockstrap, data) - back to top
This filter uses data.find
to return a boolean based upon having value defined by data.collection
and data.key
.
filters.last
(blockstrap, data) - back to top
This filter returns a text string containing information pertaining to when the last transaction made by any accounts took place. The following data
atrributes can be used to modify the results as follows:
data.html
(used as the HTML template to be rendered by Mustache)data.alternative
(the text to be shown if there are no transactions)data.type
(this must currently be set totx
in order for the filter to function)
filters.plugin
(blockstrap, data) - back to top
This filter will return the results from the relevant plugin unless the plugin required plugin function cannot be found, in which case it will return the data
. Data attributes required include:
- data.name
- data.call
- data.data
The results would derive from $.fn.blockstrap.plugins[data.name][data.call](data.data)
.
filters.setup
(blockstrap, data) - back to top
This filter will return the results from $.fn.blockstrap.core.filter(blockstrap_setup_steps[data.step])
.
It is used in conjunction with the ever-so complicated core.setup
function, which allows for a step-by-step process.
filters.total
(blockstrap, data) - back to top
This filter will return the results from accounts.total(rate, prefix)
.
The default value for rate is usd
and the default value for prefix is US$
. These can be overriden using data.rate
and data.prefix
.
filters.txs
(blockstrap, data) - back to top
This filter will return a rendered HTMl list of transactions for the defined account ID (data.id
) and the length can be set via data.limit
- defaulting to 7.
- Related Articles
- Back to Modules
- Accounts
- API
- Buttons
- Contacts
- Blockchains
- Data
- Filters
- Forms
- Security
- Styles
- Templates
- Table of Contents