Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
back out changeset d1b2b899440d, the first of two commits for bug 598…
Browse files Browse the repository at this point in the history
…980, because it generates test failures per bug 604801 that are 0.9 release blockers
  • Loading branch information
mykmelez committed Oct 18, 2010
1 parent d092d37 commit 3adde1e
Show file tree
Hide file tree
Showing 4 changed files with 253 additions and 236 deletions.
33 changes: 14 additions & 19 deletions packages/addon-kit/docs/windows.md
Expand Up @@ -53,7 +53,7 @@ The set of open browser windows
**Example**

var windows = require("windows");
for each (var window in windows.browserWindows) {
for each (window in windows.browserWindows) {
console.log(window.title);
}

Expand All @@ -71,7 +71,7 @@ An object containing configurable options for how this window will be opened,
as well as a callback for being notified when the window has fully opened.

If the only option being used is `url`, then a bare string URL can be passed to
`openWindow` instead of specifying it as a property of the `options` object.
`open` instead of specifying it as a property of the `options` object.

@prop url {string}
String URL to be opened in the new window.
Expand All @@ -82,13 +82,6 @@ A callback function that is called when the window has opened. This does not
mean that the URL content has loaded, only that the window itself is fully
functional and its properties can be accessed. This is an optional property.

@prop [onClose] {function}
A callback function that is called when the window will be called.
This is an optional property.

@prop [onReady] {function}
A callback function that is called when the URL content has loaded. This is an
optional property.
</api>

**Example**
Expand All @@ -111,13 +104,20 @@ Events of browserWindows
------------------------

Events representing common actions and state changes for windows.

These properties are `collections`. Listeners can be registered by
passing the callback to the properties' `add` method, and can be removed
by passing the callback function to the properties' `remove` method.

Listeners are passed the `window` object that triggered the event.

<api name="open">
<api name="onOpen">
@property {collection}
Called when a new window is opened.
</api>

<api name="close">
<api name="onClose">
@property {collection}
Called when a window is closed.
</api>

Expand All @@ -126,13 +126,13 @@ Called when a window is closed.
var windows = require("windows").browserWindows;

// listen for window openings via property assignment
windows.on('open', function(window) {
windows.onOpen.add(function(window) {
myOpenWindows.push(window);
});

// modify the DOM of the page when ready,
// by adding listener to the event collection.
windows.on('close', function(window) {
windows.onClose.add(function(window) {
console.log("A window was closed.");
});

Expand All @@ -156,11 +156,6 @@ has all the properties and methods of the `tabs` module.
This property is read-only.
</api>

<api name="focus">
@method
Makes window active
</api>

<api name="close">
@method
Close the window.
Expand All @@ -180,7 +175,7 @@ A function to be called when the window finishes its closing process.
" tabs.");

// Print the title of all browser windows
for each (var window in windows) {
for (var window in windows) {
console.log(window.title);
}

Expand Down

0 comments on commit 3adde1e

Please sign in to comment.