jMaki Revolver Widget
A few months ago I created the revolver as a weekend project to provide an alternative way of providing top level navigation on your web size. I thought I would share this with everyone as a jMaki widget.
How to use it with jMaki
In Netbeans
- Install the jMaki Netbeans plugin.
- Download the jMaki Revolver widget library.
- In Netbeans select
Tools->Palette->Add jMaki Libraryfrom the menu and choose the jmaki-revolver-x.x.zip file you downloaded. A new palette named "jMaki Extras" will appear. - From the jMaki Extras palette drag the widget into the page.
- Deploy the application.
In the page you will see the following:
<a:widget name="jmaki.revolver"
value="[
{title : 'Amsterdam',
imgSrc : 'http://farm1.static.flickr.com/67/227194339_551e710acb_m.jpg',
href : 'http://www.flickr.com/photos/44399047@N00/sets/72157594254916360/'
},
{title : 'Paris',
imgSrc : 'http://farm1.static.flickr.com/129/319228860_23770c66d3_m.jpg',
href : 'http://www.flickr.com/photos/44399047@N00/sets/72157594414671044/'
},
{title : 'Seoul',
imgSrc : 'http://farm1.static.flickr.com/106/294268722_662da2ef5a_m.jpg',
href : 'http://www.flickr.com/photos/44399047@N00/sets/72157594370026444/'
}
]"/>
Use the jMaki customizer (context click->jMaki) to customize the revolver or modify the /resources/jmaki/revolver/component.css.
For Eclipse or Stand Alone Applications
- Install the jMaki Eclipse plugin.
- Download the jMaki Revolver widget library.
- Unzip th jmaki-revolver-x.x.zip file you downloaded and copy the contents of the resources of zip file into the resources directory of your web application..
- Add the widget to your page.
<a:widget name="jmaki.revolver"
value="[
{title : 'Amsterdam',
imgSrc : 'http://farm1.static.flickr.com/67/227194339_551e710acb_m.jpg',
href : 'http://www.flickr.com/photos/44399047@N00/sets/72157594254916360/'
},
{title : 'Paris',
imgSrc : 'http://farm1.static.flickr.com/129/319228860_23770c66d3_m.jpg',
href : 'http://www.flickr.com/photos/44399047@N00/sets/72157594414671044/'
},
{title : 'Seoul',
imgSrc : 'http://farm1.static.flickr.com/106/294268722_662da2ef5a_m.jpg',
href : 'http://www.flickr.com/photos/44399047@N00/sets/72157594370026444/'
}
]"/>
Find out more about the customizable properties that may be passed in as the args attribute from the docs/index.html file inside the jMaki Revolver widget library.
Non jMaki Usage
You will need to provide the template text, CSS, and JavaScript.
- Download the jMaki Revolver widget library.
- Unzip th jmaki-revolver-x.x.zip file you downloaded and copy the contents of the
jmaki/revolverdirectory to your web application. - Add links to the script and css.
<script type="text/javascript" src="component.js"></script> <link rel="stylesheet" type="text/css" href="component.css"></link>
- Add the template where you want the revolver to appear.
<!-- Revolver Template --!> <div id="jmaki-revolver" class="revolver" > <div id="jmaki-revolver-content-pane" class="revolverContent"></div> </div> <div id="jmaki-revolver-title-pane" class="revolverTitle"></div>>
- Add the JavaScript initialization code.
<script> window.onload = function() { var wargs = {uuid : 'jmaki-revolver'}; wargs.value = [ {title : 'Amsterdam', imgSrc : 'http://farm1.static.flickr.com/67/227194339_551e710acb_m.jpg', href : 'http://www.flickr.com/photos/44399047@N00/sets/72157594254916360/' }, {title : 'Paris', imgSrc : 'http://farm1.static.flickr.com/129/319228860_23770c66d3_m.jpg', href : 'http://www.flickr.com/photos/44399047@N00/sets/72157594414671044/' }, {title : 'Seoul', imgSrc : 'http://farm1.static.flickr.com/106/294268722_662da2ef5a_m.jpg', href : 'http://www.flickr.com/photos/44399047@N00/sets/72157594370026444/' } ]; var revolver = new jmaki.widgets.jmaki.revolver.Widget(wargs); } </script>
Find out more about the customizable properties from the docs/index.html file inside the jMaki Revolver widget library.
This example shows the benefits of using a framework like jMaki to reduce the need of the steps you see with the non-jMaki usage.
Enjoy the widget. If you have any requests, comments or issues, please feel free to ask them here.
- Login or register to post comments
- Printer-friendly version
- gmurray71's blog
- 1376 reads





