User "DieBuche" changed the status of MediaWiki.r81500.

Old Status: new
New Status: ok

User "DieBuche" also posted a comment on MediaWiki.r81500.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/81500#c16694
Commit summary:

Making a start with $.jsMessage. A more flexible way for messages. Supports 
grouping them and making the replacing of previous messages into option (the 
current jsMsg() function always replaces older messages. Time has shown that 
there is need for the ability to show older messages as well and grouping to 
avoid different scripts from erasing or clearing eachother's output (current 
Commons and a few other wikis have created similar functions to enable keeping 
previous messages)
* See also bug 26888. Not resolving the bug yet, this plugins needs a little 
more testing and should then be called from within mw.util.jsMessage with some 
wiki specific things.

Examples:

// Show a simple message in the default group
$.jsMessage( {
message: 'Hello',
target: 'mw-js-message'
} );

// Add a new message this time stating the defaults
$.jsMessage( {
message: 'World',
group: 'default',
replace: false,
target: 'mw-js-message'
} );

// Post a new message, replacing the previous ones
$.jsMessage( {
message: 'New',
group: 'default',
replace: true,
target: 'mw-js-message'
} );

// Add a messages in a new group (groups separated by a line)
$.jsMessage( {
message: 'A new group',
group: 'something',
target: 'mw-js-message'
} );

// Clear the default group
// See code comments for more info
$.jsMessage( {
message: '',
replace: true,
target: 'mw-js-message'
} );

// Clear the 'something'-group
// Since this leaves no visible groups, the main box will hide (slideUp) right 
after
$.jsMessage( {
message: '',
group: 'something',
replace: true,
target: 'mw-js-message'
} );

If testing goes well, mw.util.jsMsg(message, className, replace) will call
$.jsMessage( { message: message, group: className, replace: replace, target: 
$.jsMessage(ge' );
So it's more a backend plugin, not used directly by core modules.
But this way extensions or third party sites can easily re-use this plugin 
and/or create multiple message boxes
on one page, by calling $.jsMessageNew and giving an id and location for it on 
the page.

Comment:

IMO jsMessageNew could use a better name, but that's not worth a new rev.

_______________________________________________
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to