Labs/Jetpack/Reboot/JEP/102: Difference between revisions
Jump to navigation
Jump to search
(→Key Issues: added note) |
|||
Line 83: | Line 83: | ||
* What methods, mechanisms, or resources does this provide internally within the Jetpack platform code. | * What methods, mechanisms, or resources does this provide internally within the Jetpack platform code. | ||
=== Use Cases === | |||
* Create a email notifier that shows you a small view that has the latest count/sparkline of emails yet to be read, and when you click on it it shows the detailed information about those unread messages. | |||
* A Stumble Upon-style interface, where the small view allows you to upvote/downvote a page, and when a triangle is clicked shows a detailed view of ratings of this page. | |||
* A clock, which has no detail view. | |||
=== API Methods === | === API Methods === | ||
* What are the pretty API wrapped methods externally exposed to Jetpack developers? | * What are the pretty API wrapped methods externally exposed to Jetpack developers? |
Revision as of 21:59, 11 February 2010
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
/** 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.
Notes
- Do we really need all of those events?
- onClick automatically opens the detail page. (Then how to override that)
- Dependence: ContentFrame, Panel
- feature.remove()
Key Issues
- What are the conditions that we should impose on add-ons being included in this UI element.
- The code new require("visual-feature").Feature(options) is actually wrong due to the way the new operator works, which would, this code, regard require as a constructor. The correct code would be new (require("visual-feature")).Feature(options).
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.
Use Cases
- Create a email notifier that shows you a small view that has the latest count/sparkline of emails yet to be read, and when you click on it it shows the detailed information about those unread messages.
- A Stumble Upon-style interface, where the small view allows you to upvote/downvote a page, and when a triangle is clicked shows a detailed view of ratings of this page.
- A clock, which has no detail view.
API Methods
- What are the pretty API wrapped methods externally exposed to Jetpack developers?