Labs/Jetpack/Reboot/JEP/102

From MozillaWiki
< Labs‎ | Jetpack‎ | Reboot‎ | JEP
Revision as of 23:19, 5 February 2010 by Aza (talk | contribs)
Jump to navigation Jump to search

JEP 102 - Single UI Element

  • Champion: Aza Raskin & Daniel Buchner - aza@mozilla.com, daniel@mozilla.com
  • Status: Accepted/In-Queue
  • Bug Ticket:
  • Type: API


Proposal

20100205-pc8ufm5fsqu9tq92gmg2nrrgms.png

/**
Creates a new simple feature, whose properties are that it has a small 32x32
pixel display, as well as a larger display (that defaults to some size).
@constructor
@param options {object}
  @prop smallView {uri|html|xml}
        This is the small view of the feature.
        uri: A link to the URL of either an icon, or a webpage
        html: A html string that will be shown in the small view
        xml: E4X version of the above
  @prop [detailView] {uri|html|xml}
        See above descriptions.
  @prop [alwaysDisplayed=true] {bool}
        Used for things that only appear under certain conditions
**/
feature = new require("visual-feature").Feature(options);

/**
Event handlers
@method
@param eventName {string}
       All of the standard events: click, mouseover, mouseout, mousedown, 
       mouseup, keydown, keyup
@param callback {function}
**/
feature.bind( eventName, callback )

/**
Remove event handlers. Without any arguments, all bound events are removed.
You can also unbind custom events registered with bind. If the type is
provided, all bound events of that type are removed. If the function that was
passed to bind is provided as the second argument, only that specific event
handler is removed.
@method
@param eventName {string}
@param callback {function}
**/
feature.unbind( eventName, callback )

/**
@prop [smallView] {canvas|window}
      If there was a image passed into the constructor this will bea canvas
      you can draw on. It updates the displayed icon in real time. If there
      was a page, then this is a window element.
@prop [detailView] {window}
      A pointer to the detailed view. Changing the width/height of this window
      changes the detail view's total width and height.
**/
feature.property
  • How hard is it to implement? Hard.

Key Issues

  • What are the conditions that we should impose on add-ons being included in this UI element


Dependencies & Requirements

  • Are there any Firefox platform bugs blocking it?
  • Does other Jetpack platform code need to be modified or added?
  • Does its implementation affect any other projects or code?

Internal Methods

  • What methods, mechanisms, or resources does this provide internally within the Jetpack platform code.


API Methods

  • What are the pretty API wrapped methods externally exposed to Jetpack developers?