Changes

Jump to: navigation, search

Labs/Jetpack/JEP/33

235 bytes added, 22:16, 4 December 2009
JEP 33 - Window
== JEP 16 - SlideBar ==
* Champion: Edward Lee Daniel Buchner <edilee at daniel@mozilla dot .com>* Status: ImplementingConcept
* Type: API Track
* Created: 17 June 2 Dec 2009* Reference Implementation: jetpack.future.importaddElement("slideBar"'window')
* [[Labs/Jetpack/JEPs|JEP Index]]
=== Introduction and Rationale ===
SlideBar Window for Jetpack is a reinvention of crucial API enhancement that allows developers using the old sidebar feature of browsers. They allow quick access Jetpack extension development platform to a wide range of extend both temporary functional and permanent information at the side presentational capabilities of your browser windowtheir JetpacksWhen Window abilities are the gateway to a SlideBar feature is selectedlarge, its contents will uncharted mass of applications that can be revealed from behind developed in concert with the current web pageother useful tools provided by Jetpack.
=== Proposal ===
Add A new SlideBar featuresWindow instantiation:<code>jetpack.slideBar.appendaddElement('window', {options})</code>
Where <tt>options</tt> is a property hash:
* <tt>icon</tt> <i>uri</i> - icon to show in the SlideBarTitle section of the window
* <tt>html</tt> <i>text/xml</i> - html content for the feature
* <tt>url</tt> <i>uri</i> - url to load content for the feature
* <tt>width</tt> <i>num</i> - initial width of the content area and selected slide sizeWindow (320 - standard smartphone width resolution)* <tt>persistheight</tt> <i>boolnum</i> - default slide behavior when being selectedinitial height of the Window (480 - standard smartphone height resolution)* <tt>autoReloadpersist</tt> <i>bool</i> - automatically reload content on selectwill the Window stay open when a user closes the browser instance?* <tt>onClickonFocus</tt> <i>func</i> - callback event triggered when the icon Window is clickedfocused* <tt>onSelectonBlur</tt> <i>func</i> - callback event triggered when the feature is selectedWindow losses focus* <tt>onReady</tt> <i>func</i> - callback event triggered when the feature Window's content is loadedand ready for manipulation.
The callbacks All events are passed a the following property hash:
* <tt>icon</tt> - node representing the icon in the SlideBar
** <tt>icon.reloaddefault()</tt> - reload icon to original icon
* <tt>contentDocument</tt> - document element of the content area
** <tt>contentDocument.reload()position</tt> - reload content to original url/htmlan object that includes the Window's position on the screen: {x: 400, y: 500}* <tt>close()location</tt> - slide close the SlideBar* <tt>notify()<URL of the window, http://tt> - slide open (if necessary) and animate icon in the SlideBar* <tt>slide(num, { persistchrome: <i>bool</i> })</tt> - slide to the provided size and optionally persist the SlideBar
=== Example ===
Show mozilla.com in the SlideBar a Window and change the icon background color of the document when clicked. 
<pre class="brush:js;toolbar:false;">
jetpack.slideBar.appendaddElement({'window', url: "http://www.mozilla.com/", width: 300, onClick onFocus: function(slidewindow) { slide window.contentDocument.documentElement.iconstyle.src background = "chrome'#ffffff'; }, onBlur://branding/content/icon48function(){ window.contentDocument.documentElement.style.png"background = '#ff0000'; }
});
</pre>
1,273
edits

Navigation menu