hoodie-accountbar
v0.4.0
Published
A Polymer element providing an accountbar to manage user account actions in Hoodie.
Downloads
19
Maintainers
Readme
| | | | | | --- | --- | --- | --- |
hoodie-accountbar
A Polymer element providing an accountbar to manage user account actions in Hoodie.
This element is still a work in progress. Code for all of the functionality is present, but not all of it is working correctly yet, as is described in the open issues on GitHub.
Online docs & demo are at http://timblack1.github.io/hoodie-accountbar/.
Installation
$ bower install --save hoodie-accountbar
Usage
Import hoodie-accountbar into the <head>
of your Polymer element or elements.html
file:
<head>
<link rel="import" href="../../hoodie-accountbar/hoodie-accountbar.html">
</head>
Place the element where you would like it to appear in the context of your app:
<hoodie-accountbar></hoodie-accountbar>
Use Hoodie in your code:
<script>
(function() {
Polymer({
attached:function(){
this.async(function(){
this.hoodie = document.querySelector('hoodie-accountbar').hoodie;
var thiz = this;
// Get selected_colors from a user preference
this.hoodie.store.find('preferences', 'selected-colors')
.then(function(selected_colors){
thiz.selected_colors = selected_colors.colors;
});
});
}
});
});
</script>
Development
Run the following commands to set up a development environment to improve hoodie-accountbar:
$ npm install -g polyserve && npm install && bower install
$ npm start
Navigate to http://localhost:3000/components/hoodie-accountbar/ to see the component's docs and demo.
Integration tests
You can run the integration tests in one of two ways:
From the command line: Run
npm test
.In your browser: Run
npm start
and navigate to http://localhost:8080/components/hoodie-accountbar/test/index.html.