On Mon, Aug 13, 2012 at 10:18 AM, Daniel Friesen
<lists(a)nadir-seen-fire.com> wrote:
So I spent a night implementing a fully featured
notification bubble system.
Something that should work for watchlists, VisualEditor, and perhaps some
other things like LQT, and perhaps anything we want to start making more
dynamic. Same goes for anyone with a good Gadget idea that could use better
notifications.
Thanks for your work on this, Daniel. As an update, this has now been
merged and deployed to all wikis (it's part of 1.20wmf11).
It's easy to play with - in e.g. Chrome, open the dev tools on any
Wikipedia page (F12), and then enter on the console:
mw.notify( 'The Wikipedia Signpost app is out!' );
This creates a notification with no parameters/options. Running it
repeatedly will stack the notifications.
As a second parameter, you can specify several options:
autoHide: true/false - should the notification time out after 5
seconds - if not, click to hide
title: if specified, shown in bold text above the notification itself
tag: if specified, a message with the same tag will replace the most
recently displayed message with this tag
e.g.
mw.notify( 'The Wikipedia Signpost app is out!', { autoHide: false,
title: 'Mobile updates', tag: 'mobile' } );
This example shows a notification that has to be clicked to be hidden,
and that's tagged, so any other 'mobile' notifications will replace
it.
Is the system documented somewhere already so gadget/script authors
can start using it?
Erik
--
Erik Möller
VP of Engineering and Product Development, Wikimedia Foundation
Support Free Knowledge:
https://wikimediafoundation.org/wiki/Donate