Labs/Jetpack/API: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 37: Line 37:
* <code>create({id: string, name: string, content: element})</code>. Creates a sidebar with a given name.
* <code>create({id: string, name: string, content: element})</code>. Creates a sidebar with a given name.
** <code>id</code>: the identifier by which you can refer to the sidebar later in your code.
** <code>id</code>: the identifier by which you can refer to the sidebar later in your code.
** <code>name</code> will be the text that appears in the View>Sidebar menu.
** <code>name</code>: will be the text that appears in the View>Sidebar menu.
** <code>content</code> is a DOM element. You can supply one using the <code>$</code> function, which works just like the jQuery selector. For example, $("#sidebar-content").
** <code>content</code>: is a DOM element. You can supply one using the <code>$</code> function, which works just like the jQuery selector. For example, $("#sidebar-content").
 
'''UI.Statusbars'''
Allows addition of icons to the status bar.
 
** <code>create({id: string, callback: func})</code>
** <code>id</code>: the identifier by which you can refer to the status bar later.
** <code>callback</code>: A function that details what to do upon creation of the status bar.
 
Example:
  Jetpack.UI.Statusbars.create({
    id: "sb-panel",
    callback: function(aPanel){
      aPanel.create({
        id: "amo-link",
        name: "AMO Link",
        icon: "icon.png",
        isLink: true,
        url: "http://addons.mozilla.org"
      });
      }
  });




577

edits