Difference between revisions of "MediaWiki:Access.js"

From Wikibase Personal data
Jump to navigation Jump to search
Line 1: Line 1:
 
mw.notify( 'Access!' );
 
mw.notify( 'Access!' );
 +
mw.notify( 'This is a notification.' ); // Send a plaintext notification
 +
mw.notify( mw.message( 'some-message' ) ); // Use an i18n message to send a notification
 +
mw.notify( $( '<span>This is an <u>HTML</u> notification.</span>' ) ); // Send an HTML notification with a jQuery instance (a DOM node also works)
 +
 +
mw.notify( 'Test', { title: 'Title!' } ); // Give the notification a title
 +
mw.notify( 'Test', { autoHide: false } ); // Don't automatically hide the notification
 +
mw.notify( 'Test', { tag: 'foobar' } ); // Send a notification tagged with a tag
 +
mw.notify( 'Test 2', { tag: 'foobar' } ); // This one will replace the previous 'foobar' notification.

Revision as of 23:14, 29 March 2019

mw.notify( 'Access!' );
mw.notify( 'This is a notification.' ); // Send a plaintext notification
mw.notify( mw.message( 'some-message' ) ); // Use an i18n message to send a notification
mw.notify( $( '<span>This is an <u>HTML</u> notification.</span>' ) ); // Send an HTML notification with a jQuery instance (a DOM node also works)

mw.notify( 'Test', { title: 'Title!' } ); // Give the notification a title
mw.notify( 'Test', { autoHide: false } ); // Don't automatically hide the notification
mw.notify( 'Test', { tag: 'foobar' } ); // Send a notification tagged with a tag
mw.notify( 'Test 2', { tag: 'foobar' } ); // This one will replace the previous 'foobar' notification.