If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Improve widget doc further

RESOLVED FIXED in 1.0b1

Status

Add-on SDK
Documentation
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: adw, Assigned: adw)

Tracking

unspecified
1.0b1

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [cherry-pick-1.0b1])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

7 years ago
Created attachment 495287 [details] [diff] [review]
patch

This patch makes these changes:

* label is a required option, not an optional option, so brackets
  should not be used
* documents widget instance properties (none currently are), including
  properties and methods inherited from Loader and EventEmitter
* adds a section on widget events
* misc wording improvements
Attachment #495287 - Flags: review?(myk)
(Assignee)

Comment 1

7 years ago
Oh, it also corrects some other inaccuracies:

* currently contentScript and contentScriptFile are said to be arrays,
  but they can also be strings
* the formatting of `allow` is incorrect and makes it seem like its
  `script` property is actually a property of the options object
  passed to the Widget ctor

... so technically this should block beta 1.
(Assignee)

Comment 2

7 years ago
Created attachment 495289 [details] [diff] [review]
patch 2

Actually contentURL in the options object is a string, not a "URL", and the contentURL property of Widget instances is a URL object, not a string.
Attachment #495287 - Attachment is obsolete: true
Attachment #495289 - Flags: review?(myk)
Attachment #495287 - Flags: review?(myk)
Comment on attachment 495289 [details] [diff] [review]
patch 2

>-  @prop [onClick] {callback}
>-    An optional function to be called when the widget is clicked. It is called
>-    as `onClick(widget)`, where `widget` is the `Widget` instance.
>+  @prop [onClick] {function}
>+    An optional "click" event listener.  See Events above.

It's too bad the docs use fragments to refer to pages, since that makes it hard to refer to anchors (such as "Events" in this text, which would ideally link to the Events section of this page).

Anyway, this looks great, r=myk!
Attachment #495289 - Flags: review?(myk) → review+
Blocks: 611250
(Assignee)

Comment 4

7 years ago
https://github.com/mozilla/addon-sdk/commit/0f1286c69f1546d31ca7435e8ce26b7e9f4267f0

https://github.com/mozilla/addon-sdk/commit/63960956dd59e6dd2851db982cb3ad1cfa18223e
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: -- → 0.10
(Assignee)

Comment 5

7 years ago
(In reply to comment #3)
> It's too bad the docs use fragments to refer to pages, since that makes it hard
> to refer to anchors (such as "Events" in this text, which would ideally link to
> the Events section of this page).

Yeah, this has come up several times before.  We should make each page of the docs a proper page.
Whiteboard: [cherry-pick-needed]
https://github.com/mozilla/addon-sdk/commit/69182feb6bf144f9adedfb21ef3d37648b573317
https://github.com/mozilla/addon-sdk/commit/0dad5174e34252907d053167cf206b72aae000ec
Whiteboard: [cherry-pick-needed] → [cherry-pick-1.0b1]
Target Milestone: 0.10 → 1.0b1
You need to log in before you can comment on or make changes to this bug.