diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
commit | 63601400e476c6cf43d985f3e7b9864681695ed4 (patch) | |
tree | f7846203a952e38aaf66989d0a4702779f549962 /skins/common/wikibits.js | |
parent | 8ff01378c9e0207f9169b81966a51def645b6a51 (diff) |
Update to MediaWiki 1.20.2
this update includes:
* adjusted Arch Linux skin
* updated FluxBBAuthPlugin
* patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'skins/common/wikibits.js')
-rw-r--r-- | skins/common/wikibits.js | 56 |
1 files changed, 6 insertions, 50 deletions
diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index 8f47499c..cae08af9 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -1,7 +1,7 @@ /** * MediaWiki legacy wikibits */ -(function(){ +( function ( mw ) { window.clientPC = navigator.userAgent.toLowerCase(); // Get client info window.is_gecko = /gecko/.test( clientPC ) && @@ -515,55 +515,11 @@ window.redirectToFragment = function( fragment ) { * Add a cute little box at the top of the screen to inform the user of * something, replacing any preexisting message. * - * @param message String -or- Dom Object HTML to be put inside the right div - * @param className String Used in adding a class; should be different for each - * call to allow CSS/JS to hide different boxes. null = no class used. - * @return Boolean True on success, false on failure + * @deprecated since 1.17 Use the 'mediawiki.notify' module instead. + * @param {String|HTMLElement} message To be put inside the message box. */ -window.jsMsg = function( message, className ) { - if ( !document.getElementById ) { - return false; - } - // 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 = document.getElementById( 'mw-js-message' ); - if ( !messageDiv ) { - messageDiv = document.createElement( 'div' ); - if ( document.getElementById( 'column-content' ) - && document.getElementById( 'content' ) ) { - // MonoBook, presumably - document.getElementById( 'content' ).insertBefore( - messageDiv, - document.getElementById( 'content' ).firstChild - ); - } else if ( document.getElementById( 'content' ) - && document.getElementById( 'article' ) ) { - // Non-Monobook but still recognizable (old-style) - document.getElementById( 'article').insertBefore( - messageDiv, - document.getElementById( 'article' ).firstChild - ); - } else { - return false; - } - } - - messageDiv.setAttribute( 'id', 'mw-js-message' ); - messageDiv.style.display = 'block'; - if( className ) { - messageDiv.setAttribute( 'class', 'mw-js-message-' + className ); - } - - if ( typeof message === 'object' ) { - while ( messageDiv.hasChildNodes() ) { // Remove old content - messageDiv.removeChild( messageDiv.firstChild ); - } - messageDiv.appendChild( message ); // Append new content - } else { - messageDiv.innerHTML = message; - } - return true; +window.jsMsg = function () { + return mw.util.jsMessage.apply( mw.util, arguments ); }; /** @@ -663,4 +619,4 @@ if ( ie6_bugs ) { importScriptURI( mw.config.get( 'stylepath' ) + '/common/IEFixes.js' ); } -})(); +}( mediaWiki ) ); |