Closed Bug 578238 Opened 15 years ago Closed 15 years ago

notifications API for creating Growl-style notifications

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: myk, Assigned: adw)

Details

Attachments

(1 file, 1 obsolete file)

The experimental prototype included a notifications API for creating Growl-style notifications on Windows, Mac OS X, and Linux, with Growl displaying the notifications on Mac OS X and toast-style notifications being used on Windows and Linux. The API was based on an existing XPCOM API, if I remember correctly, and that underlying API may handle the case of Mac OS X systems on which Growl is not installed, although I don't remember what happens in that case. Growl-style notifications are available in some Linux desktops as well these days (f.e. Ubuntu 9.10 and presumably 10.4, although I haven't tested the newer release). Such notifications have proven pretty useful and become fairly popular. A common use case for a Firefox addon (judging by the number of addons on AMO that do this) is to inform a user when a download has completed. The SDK should include a notifications API as one of its core APIs.
Attached patch patch (obsolete) — Splinter Review
I had started on this patch awhile ago. I was bored, and this is such low-hanging fruit, that I finished it off. I hope you don't mind Irakli. The interface is pretty simple, and it's described in the included doc.
Attachment #460819 - Flags: review?(myk)
Yeah I know it was very simple :) Absolutely not I'm sure there will be enough stuff to do for everyone :)
(In reply to comment #2) > Absolutely not I'm sure there will be enough stuff to do for everyone :) https://wiki.mozilla.org/Labs/Jetpack/Projects
Comment on attachment 460819 [details] [diff] [review] patch >diff --git a/packages/jetpack-core/docs/notifications.md b/packages/jetpack-core/docs/notifications.md >+The `notifications` module allows you display transient [toaster]()- or >+[Growl]()-style messages to the user. Nit: you display -> you to display >+ @prop [imageURL] {string} >+ The URL of an icon to display inside the message. It may be a remote URL, >+ a data URI, or a URL returned by the `self` module. Nit: it seems like "iconURL" would be a bit more descriptive of the function of this property. >+This one displays an icon that's stored in the add-on's `data` directory. (See the `self` module documentation for more information.) Nit: it'd be good for readability to wrap this line at 80 columns. >diff --git a/packages/jetpack-core/tests/test-notifications.js b/packages/jetpack-core/tests/test-notifications.js >+ loader.findSandboxForModule("notifications").globalScope. >+ setAlertService(mockAlertServ); Nit: can't this just set the global property directly? I.e.: loader.findSandboxForModule("notifications").globalScope.gAlertServ = mockAlertServ;
Attachment #460819 - Flags: review?(myk) → review+
Attached patch patch v2Splinter Review
Thanks for the quick review! (In reply to comment #4) > Nit: it seems like "iconURL" would be a bit more descriptive of the function of > this property. Good call. > Nit: can't this just set the global property directly? I.e.: > > loader.findSandboxForModule("notifications").globalScope.gAlertServ = > mockAlertServ; Yeah, I did that initially but then thought a function would be a more proper interface. Probably over-thinking it, so I changed it back as you suggested.
Assignee: rFobic → adw
Attachment #460819 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: 0.8 → 0.7
The Add-on SDK is no longer a Mozilla Labs experiment and has become a big enough project to warrant its own Bugzilla product, so the "Add-on SDK" product has been created for it, and I am moving its bugs to that product. To filter bugmail related to this change, filter on the word "looptid".
Component: Jetpack SDK → General
Product: Mozilla Labs → Add-on SDK
QA Contact: jetpack-sdk → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: