1,273
edits
Changes
→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 ===
=== Proposal ===
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.
* <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
=== 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>