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

Commit

Permalink
Bug 619707 - The SDK's navigation bar shouldn't hide addon-kit packag…
Browse files Browse the repository at this point in the history
…es under Internals docs; r=myk
  • Loading branch information
Will Bamberg committed Jan 27, 2011
1 parent d72f29b commit 708f4c7
Show file tree
Hide file tree
Showing 59 changed files with 1,003 additions and 673 deletions.
9 changes: 8 additions & 1 deletion packages/addon-kit/README.md
@@ -1 +1,8 @@
This package provides a set of high-level APIs for add-ons to use.
The addon-kit package provides high-level APIs for add-on developers.
Most of the needs of most add-on developers should be served by the modules
found here. Modules in this packages don't require any special privileges to
run.

The modules in the addon-kit package are relatively stable. We intend to add
new APIs here and extend existing ones, but will avoid making incompatible
changes to them unless absolutely necessary.
3 changes: 2 additions & 1 deletion packages/addon-kit/docs/context-menu.md
Expand Up @@ -236,7 +236,8 @@ For conciseness, these examples create their content scripts as strings and use
the `contentScript` property. In your own add-ons, you will probably want to
create your content scripts in separate files and pass their URLs using the
`contentScriptFile` property. See
[Working with Content Scripts](#guide/web-content) for more information.
[Working with Content Scripts](#guide/addon-development/web-content) for more
information.

First, don't forget to import the module:

Expand Down
17 changes: 7 additions & 10 deletions packages/addon-kit/docs/notifications.md
@@ -1,17 +1,14 @@
<!-- contributed by Drew Willcoxon [adw@mozilla.com] -->

The `notifications` module allows you to display transient, [toaster][]-style
The `notifications` module allows you to display transient,
[toaster](http://en.wikipedia.org/wiki/Toast_%28computing%29)-style
desktop messages to the user.

This API supports desktop notifications on Windows, OS X using [Growl][], and
Linux using libnotify. If the user's system does not support desktop
notifications or if its notifications service is not running, then notifications
made with this API are logged to Firefox's error console and, if the user
launched Firefox from the command line, the terminal.

[toaster]: http://en.wikipedia.org/wiki/Toast_%28computing%29
[Growl]: http://growl.info/

This API supports desktop notifications on Windows, OS X using
[Growl](http://growl.info/), and Linux using libnotify. If the user's system
does not support desktop notifications or if its notifications service is not
running, then notifications made with this API are logged to Firefox's error
console and, if the user launched Firefox from the command line, the terminal.

Examples
--------
Expand Down
21 changes: 10 additions & 11 deletions packages/addon-kit/docs/page-mod.md
Expand Up @@ -23,7 +23,7 @@ Like all modules that interact with web content, page-mod uses content
scripts that execute in the content process and defines a messaging API to
communicate between the content scripts and the main add-on script. For more
details on content scripting see the tutorial on [interacting with web
content](#guide/web-content).
content](#guide/addon-development/web-content).

To create a PageMod the add-on developer supplies:

Expand Down Expand Up @@ -167,10 +167,11 @@ Creates a PageMod.
Options for the PageMod, with the following keys:
@prop include {string,array}
A match pattern string or an array of match pattern strings. These define
the pages to which the PageMod applies. See the [match-pattern] module for
the pages to which the PageMod applies. See the
[match-pattern](#module/api-utils/match-pattern) module for
a description of match pattern syntax.
At least one match pattern must be supplied.
[match-pattern]: #module/api-utils/match-pattern

@prop [contentScriptFile] {string,array}
The local file URLs of content scripts to load. Content scripts specified
by this option are loaded *before* those specified by the `contentScript`
Expand All @@ -188,20 +189,18 @@ Creates a PageMod.
A function to call when the PageMod attaches content scripts to
a matching page. The function will be called with one argument, a `worker`
object which the add-on script can use to communicate with the content scripts
attached to the page in question. See "[Communicating with content
scripts](#pagemod-content-scripts)" for more details.
attached to the page in question.

</api>

<api name="include">
@property {List}
A [List] of match pattern strings. These define the pages to which the page mod
applies. See the [match-pattern] module for a description of match patterns.
Rules can be added to the list by calling its `add` method and removed by
calling its `remove` method.
A [list](#module/api-utils/list) of match pattern strings. These define the
pages to which the page mod applies. See the
[match-pattern](#module/api-utils/match-pattern) module for a description of
match patterns. Rules can be added to the list by calling its `add` method and
removed by calling its `remove` method.

[List]: https://jetpack.mozillalabs.com/sdk/latest/docs/#module/api-utils/list
[match-pattern]: #module/api-utils/match-pattern
</api>

<api name="destroy">
Expand Down
14 changes: 8 additions & 6 deletions packages/addon-kit/docs/page-worker.md
Expand Up @@ -14,12 +14,13 @@ Page workers have associated content scripts, which are JavaScript scripts that
have access to the content loaded into the pages. You can specify scripts to
load for a page worker, and you communicate with those scripts over an
asynchronous JSON pipe. For more information on content scripts, see
[Working with Content Scripts](#guide/web-content).
[Working with Content Scripts](#guide/addon-development/web-content).

Events
------

Page workers emit the following types of [events](#guide/events):
Page workers emit the following types of
[events](#guide/addon-development/events):

### message ###

Expand All @@ -41,7 +42,8 @@ For conciseness, these examples create their content scripts as strings and use
the `contentScript` property. In your own add-ons, you will probably want to
create your content scripts in separate files and pass their URLs using the
`contentScriptFile` property. See
[Working with Content Scripts](#guide/web-content) for more information.
[Working with Content Scripts](#guide/addon-development/web-content) for more
information.

### Print all header titles from a Wikipedia article ###

Expand Down Expand Up @@ -93,8 +95,8 @@ loaded until its `destroy` method is called or the add-on is unloaded.
A local file URL or an array of local file URLs of content scripts to load.
Content scripts specified by this option are loaded *before* those specified
by the `contentScript` option. See
[Working with Content Scripts](#guide/web-content) for help on setting this
property.
[Working with Content Scripts](#guide/addon-development/web-content) for
help on setting this property.
@prop [contentScript] {string,array}
A string or an array of strings containing the texts of content scripts to
load. Content scripts specified by this option are loaded *after* those
Expand Down Expand Up @@ -155,7 +157,7 @@ The message to send. Must be JSON-able.
<api name="on">
@method
Registers an event listener with the page worker. See
[Working with Events](#guide/events) for help with events.
[Working with Events](#guide/addon-development/events) for help with events.
@param type {string}
The type of event to listen for.
@param listener {function}
Expand Down
15 changes: 8 additions & 7 deletions packages/addon-kit/docs/panel.md
Expand Up @@ -24,15 +24,16 @@ chrome elements, i.e. parts of the host application interface, and content
elements, i.e. parts of a web page in an application tab.

Panels have associated content scripts, which are JavaScript scripts that have
access to the content loaded into the panels. An add-on can specify one or more
content scripts to load for a panel, and the add-on can communicate with those
scripts via an asynchronous message passing API. See
[Working with Content Scripts](#guide/web-content) for more information.
access to the content loaded into the panels. An add-on can specify one or
more content scripts to load for a panel, and the add-on can communicate with
those scripts via an asynchronous message passing API. See
[Working with Content Scripts](#guide/addon-development/web-content) for more
information.

Events
------

Panels emit the following types of [events](#guide/events).
Panels emit the following types of [events](#guide/addon-development/events).

### message ###

Expand All @@ -59,8 +60,8 @@ Create and show a simple panel with content from the `data/` directory:

panel.show();

The tutorial section on [web content](#guide/web-content) has a more complex
example using panels.
The tutorial section on [web content](#guide/addon-development/web-content) has
a more complex example using panels.

<api name="Panel">
@class
Expand Down
19 changes: 10 additions & 9 deletions packages/addon-kit/docs/widget.md
Expand Up @@ -53,11 +53,11 @@ handled by [content scripts]. So, for example, to be notified when your
widget's content has loaded, you can make a small script that calls back to the
widget when it finishes loading.

[content scripts]: #guide/web-content
[content scripts]: #guide/addon-development/web-content

## Events ##

Widgets emit the following types of [events](#guide/events).
Widgets emit the following types of [events](#guide/addon-development/events).

### click ###

Expand All @@ -82,7 +82,8 @@ For conciseness, these examples create their content scripts as strings and use
the `contentScript` property. In your own add-ons, you will probably want to
create your content scripts in separate files and pass their URLs using the
`contentScriptFile` property. See
[Working with Content Scripts](#guide/web-content) for more information.
[Working with Content Scripts](#guide/addon-development/web-content) for more
information.

const widgets = require("widget");

Expand Down Expand Up @@ -181,8 +182,8 @@ Represents a widget object.

@prop [contentURL] {string}
An optional string URL to content to load into the widget. This can be
[local content](#guide/web-content) or remote content, an image or web
content. Widgets must have either the `content` property or the
[local content](#guide/addon-development/web-content) or remote content, an
image or web content. Widgets must have either the `content` property or the
`contentURL` property set.

@prop [panel] {Panel}
Expand Down Expand Up @@ -279,10 +280,10 @@ Represents a widget object.
<api name="contentURL">
@property {string}
The URL of content to load into the widget. This can be
[local content](#guide/web-content) or remote content, an image or web
content. Setting it updates the widget's appearance immediately. However,
if the widget was created using `content`, then this property is meaningless,
and setting it has no effect.
[local content](#guide/addon-development/web-content) or remote content, an
image or web content. Setting it updates the widget's appearance
immediately. However, if the widget was created using `content`, then this
property is meaningless, and setting it has no effect.
</api>

<api name="panel">
Expand Down
2 changes: 1 addition & 1 deletion packages/api-utils/docs/e10s.md
Expand Up @@ -33,7 +33,7 @@ chrome process, and the `addon` argument passed to it is an instance of
`ChromeProcess` and `AddonProcess` instances come in pairs, and represent
opposite sides of an inter-process communication mechanism.

[Out-of-Process Add-ons]: #guide/e10s
[Out-of-Process Add-ons]: #guide/module-development/e10s

## Events ##

Expand Down
6 changes: 2 additions & 4 deletions packages/api-utils/docs/memory.md
@@ -1,5 +1,3 @@
The `memory` module provides a concrete default implementation for the SDK's
`memory` global. For documentation on the `memory` global, see the [Globals]
appendix.

[Globals]: #guide/globals
`memory` global. For documentation on the `memory` global, see the
[Globals](#guide/module-development/globals) reference.
5 changes: 2 additions & 3 deletions packages/api-utils/docs/plain-text-console.md
Expand Up @@ -2,7 +2,6 @@ The `plain-text-console` module provides a minimalist implementation
of the `console` global, which simply logs all messages to
standard output.

For documentation on the `console` global, see the [Globals]
appendix.
For documentation on the `console` global, see the
[Globals](#guide/addon-development/globals) reference.

[Globals]: #guide/globals
8 changes: 4 additions & 4 deletions packages/api-utils/docs/securable-module.md
@@ -1,7 +1,8 @@
The `securable-module` module allows for the recursive loading
and sandboxing of [CommonJS Modules] (formerly called
SecurableModules). This allows, for instance, the creation of "mini
platforms" that manage the sandboxed evaluation of code.
and sandboxing of
[CommonJS Modules](http://wiki.commonjs.org/wiki/Modules/1.0)
(formerly called SecurableModules). This allows, for instance,
the creation of "mini platforms" that manage the sandboxed evaluation of code.

## Loader Objects ##

Expand Down Expand Up @@ -90,4 +91,3 @@ the following keys:
</tr>
</table>

[CommonJS Modules]: http://wiki.commonjs.org/wiki/Modules/1.0
9 changes: 5 additions & 4 deletions packages/api-utils/docs/self.md
@@ -1,6 +1,7 @@
The `self` module provides access to data that is bundled with the add-on
as a whole. It also provides the "add-on ID", a value which is unique for each
add-on.
as a whole. It also provides access to the
[Program ID](#guide/addon-development/program-id), a value which is unique for
each add-on.

<api name="id">
@property {string}
Expand All @@ -14,8 +15,8 @@ Eventually, this ID will be unspoofable (see
</api>

<span class="aside">
The [Package Specification](#guide/package-spec) section explains the
`package.json` file.
The [Package Specification](#guide/addon-development/package-spec) section
explains the `package.json` file.
</span>

<api name="data">
Expand Down
9 changes: 3 additions & 6 deletions packages/api-utils/docs/traceback.md
Expand Up @@ -3,7 +3,7 @@


The `traceback` module contains functionality similar to
Python's [traceback] module.
Python's [traceback](http://docs.python.org/library/traceback.html) module.

## JSON Traceback Objects ##

Expand Down Expand Up @@ -39,9 +39,8 @@ element thus represents a stack frame and has the following keys:
exception where exception is an `nsIException`.
</api>

See [nsIException] for more information.

[nsIException]: https://developer.mozilla.org/en/NsIException
See [nsIException](https://developer.mozilla.org/en/NsIException) for more
information.

<api name="get">
@function
Expand All @@ -61,5 +60,3 @@ stack at the point this function is called is used.
@param [tbOrException] {object}
</api>


[traceback]: http://docs.python.org/library/traceback.html
43 changes: 20 additions & 23 deletions packages/api-utils/docs/traits.md
Expand Up @@ -7,39 +7,36 @@ constructs an instance of `Trait`.
Traits
------

[Traits] are a simple composition mechanism for structuring object-oriented
programs. Traits are similar to [interfaces], except that they often define
only a part of an object's data and behavior and are intended to be used in
conjunction with other traits to completely define the object.
[Traits](http://en.wikipedia.org/wiki/Trait_%28computer_science%29) are a
simple composition mechanism for structuring object-oriented programs. Traits
are similar to
[interfaces](http://en.wikipedia.org/wiki/Interface_%28object-oriented_programming%29),
except that they often define only a part of an object's data and behavior and
are intended to be used in conjunction with other traits to completely define
the object.

Traits are also considered to be a more robust alternative to [mixins]
because, name conflicts have to be resolved explicitly by composer & because
trait composition is order-independent (hence more declarative).
Traits are also considered to be a more robust alternative to
[mixins](http://en.wikipedia.org/wiki/Mixins) because, name conflicts have to
be resolved explicitly by composer & because trait composition is
order-independent (hence more declarative).


There are some other implementations of traits in JavaScript & some ideas /
APIs are borrowed from them:

- [traitsjs]
- [joose]
- [traitsjs](http://www.traitsjs.org/)
- [joose](http://code.google.com/p/joose-js/)

Object-capability security model
--------------------------------

Implementation uses an [object-capability security model] to allow protection
of private APIs. At the same private APIs can be shared between among trait
composition parties. To put it simply: All the properties whose names start
with `"_"` are considered to be **private**, and are unaccessible from anywhere
except other **public** methods / accessors of the instance that had been
defined during composition.


[object-capability security model]:http://en.wikipedia.org/wiki/Object-capability_model
[traitsjs]:http://www.traitsjs.org/
[joose]:http://code.google.com/p/joose-js/
[Traits]:http://en.wikipedia.org/wiki/Trait_%28computer_science%29
[interfaces]:http://en.wikipedia.org/wiki/Interface_%28object-oriented_programming%29
[mixins]:http://en.wikipedia.org/wiki/Mixins
Implementation uses an
[object-capability security model](http://en.wikipedia.org/wiki/Object-capability_model)
to allow protection of private APIs. At the same private APIs can be shared
between among trait composition parties. To put it simply: All the properties
whose names start with `"_"` are considered to be **private**, and are
unaccessible from anywhere except other **public** methods / accessors of the
instance that had been defined during composition.

<api name="Trait">
@class
Expand Down
3 changes: 2 additions & 1 deletion packages/test-harness/README.md
@@ -1,6 +1,7 @@
<span class="aside">
For more information on testing in the Add-on SDK, see the
[Packaging](#guide/packaging) tutorial.
[Reusable Modules](#guide/addon-development/implementing-reusable-module)
tutorial.
</span>

This package contains a program that finds and runs tests. It is
Expand Down
3 changes: 2 additions & 1 deletion packages/test-harness/docs/run-tests.md
@@ -1,6 +1,7 @@
<span class="aside">
For more information on testing in the Add-on SDK, see the
[Packaging](#guide/packaging) tutorial.
[Reusable Modules](#guide/addon-development/implementing-reusable-module)
tutorial.
</span>

This module contains the package's main program, which does a
Expand Down

0 comments on commit 708f4c7

Please sign in to comment.