User:Whytheonlyone/displaymessage.js

function displayMessage( message, className ){ if ( !arguments.length || message === '' || message === null ) { $( '#display-message' ).empty.hide; return true; // Emptying and hiding message is intended behaviour, return true } else { // We special-case skin structures provided by the software. Skins that // choose to abandon or significantly modify our formatting can just define // an mw-js-message div to start with. var $messageDiv = $( '#display-message' ); if ( !$messageDiv.length ) { $messageDiv = $( ' ' ); if ( mw.util.$content.length ) { mw.util.$content.prepend( $messageDiv ); } else { return false; }		}		if ( className ) { $messageDiv.prop( 'class', 'display-message-' + className ); }		if ( typeof message === 'object' ) { $messageDiv.empty; $messageDiv.append( message ); } else { $messageDiv.html( message ); }		$messageDiv.slideDown; return true; } }