Labs/Jetpack/JEP/33: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 19: Line 19:
<code>jetpack.addElement('window', {options})</code>
<code>jetpack.addElement('window', {options})</code>


Where <tt>options</tt> is a property hash:
Where <tt>options</tt> is an object:
 
Properties
* <tt>icon</tt> <i>uri</i> - icon to show in the title bar section of the window
* <tt>icon</tt> <i>uri</i> - icon to show in the title bar section of the window
* <tt>html</tt> <i>text/xml</i> - html content for the feature
* <tt>html</tt> <i>text/xml</i> - html content for the feature
Line 26: Line 28:
* <tt>height</tt> <i>num</i> - initial height of the Window (480 - standard smartphone height resolution)
* <tt>height</tt> <i>num</i> - initial height of the Window (480 - standard smartphone height resolution)
* <tt>persist</tt> <i>bool</i> - specifies whether or not a Window stay open when a user closes the browser instanc
* <tt>persist</tt> <i>bool</i> - specifies whether or not a Window stay open when a user closes the browser instanc
* <tt>allowMaximize</tt> <i>bool</i> - specifies whether or not a Window will have the ability to maximize
* <tt>allowResize</tt> <i>bool</i> - specifies whether or not a user can resize a window
Events
* <tt>onFocus</tt> <i>func</i> - event triggered when the Window is focused
* <tt>onFocus</tt> <i>func</i> - event triggered when the Window is focused
* <tt>onBlur</tt> <i>func</i> - event triggered when the Window losses focus
* <tt>onBlur</tt> <i>func</i> - event triggered when the Window losses focus
* <tt>onReady</tt> <i>func</i> - event triggered when the Window's content is loaded and ready for manipulation
* <tt>onReady</tt> <i>func</i> - event triggered when the Window's content is loaded and ready for manipulation
* <tt>onMinimize</tt> <i>func</i> - event triggered when the Window is minimized to the task bar
* <tt>onMaximize</tt> <i>func</i> - event triggered when the Window is maximized
* <tt>onRestore</tt> <i>func</i> - event triggered when the Window is restored from the task bar


All events are passed the following property hash:
  All events are passed the following property hash:
* <tt>icon</tt> - a pointer to the icon used in the Window title bar.
  * <tt>icon</tt> - a pointer to the icon used in the Window title bar.
** <tt>icon.default()</tt> - reload icon to original icon
  ** <tt>icon.default()</tt> - reload icon to original icon
* <tt>contentDocument</tt> - document element of the content area
  * <tt>contentDocument</tt> - document element of the content area
* <tt>position</tt> - an object that includes the Window's position on the screen: {x: 400, y: 500}
  * <tt>position</tt> - an object that includes the Window's position on the screen: {x: 400, y: 500}
* <tt>location</tt> - the URL of the window, http://, chrome://
  * <tt>location</tt> - the URL of the window, http://, chrome://


=== Example ===
=== Example ===
1,273

edits

Navigation menu