Labs/Jetpack/JEP/21: Difference between revisions

Jump to navigation Jump to search
(Created page with '== JEP 21 - jetpack.toolbar == * Champion: David Dahl <ddahl at mozilla dot com> * Status: Planning * Type: API Track * Created: 27 July 2009 * Reference Implementation: jetpack…')
 
Line 16: Line 16:
Create an easy way to get a handle on the navigation toolbar, the bookmarks toolbar. Provide an elegant API to add, modify and remove items for each bar, as well as hiding and showing the toolbars.  
Create an easy way to get a handle on the navigation toolbar, the bookmarks toolbar. Provide an elegant API to add, modify and remove items for each bar, as well as hiding and showing the toolbars.  


<code>jetpack.toolbar.navigation</code>
<pre>jetpack.toolbar.navigation() // returns an abstracted "jetpacky" nav bar object
bookmarks bar object


<code>jetpack.toolbar.bookmarks</code>
jetpack.toolbar.navigation.children() // gets the child objects in an array-like object


<code>jetpack.toolbar.navigation.children</code>
jetpack.toolbar.bookmarks.children() // ditto


<code>jetpack.toolbar.bookmarks.children</code>
var obj = {title: "my button", onclick: function(){}, ... }


<code>jetpack.toolbar.navigation.append(obj, [before_idx]) / .remove(idx)</code>
jetpack.toolbar.navigation.append(obj, [before_idx]) / .remove(idx)


<code>jetpack.toolbar.bookmarks.append(obj, [before_idx]) / .remove(idx)</code>
var obj = {title: "GrouchoMarx.com", url:"http://grouchomarx.com/", ... }


<code>jetpack.toolbar.append</code>
jetpack.toolbar.bookmarks.append(obj, [before_idx]) / .remove(idx)
 
var toolbar = jetpack.toolbar.create({id:'groucho-toolbar', name: 'GrouchoToolbar', children: [...]})
 
jetpack.toolbar.append


...
...
564

edits

Navigation menu