On Tue, Aug 28, 2012 at 1:44 AM, Erik Moeller erik@wikimedia.org wrote:
Daniel Friesen, a volunteer, is currently working on improving this system further into a more general notification message front-end. [2] This change has not been merged yet. You can find a video of the system in action here:
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.
I agree that this pattern isn't always appropriate, but it's nice to have it available.
Erik