Gerrit Patch Uploader has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/129887

Change subject: Add mw.log.deprecate to mw.util.jsMessage
......................................................................

Add mw.log.deprecate to mw.util.jsMessage

Duplicate code to wikibits.js to prevent deprecate message on loading.

Change-Id: Ib41d52456825526c5217743302e80a2de2bbe8d8
---
M resources/src/mediawiki/mediawiki.util.js
M skins/common/wikibits.js
2 files changed, 30 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/87/129887/1

diff --git a/resources/src/mediawiki/mediawiki.util.js 
b/resources/src/mediawiki/mediawiki.util.js
index 15b075c..cca320b 100644
--- a/resources/src/mediawiki/mediawiki.util.js
+++ b/resources/src/mediawiki/mediawiki.util.js
@@ -332,26 +332,6 @@
                },
 
                /**
-                * Add a little box at the top of the screen to inform the user 
of
-                * something, replacing any previous message.
-                * Calling with no arguments, with an empty string or null will 
hide the message
-                *
-                * @param {Mixed} message The DOM-element, jQuery object or 
HTML-string to be put inside the message box.
-                * to allow CSS/JS to hide different boxes. null = no class 
used.
-                * @deprecated since 1.20 Use mw#notify
-                */
-               jsMessage: function ( message ) {
-                       if ( !arguments.length || message === '' || message === 
null ) {
-                               return true;
-                       }
-                       if ( typeof message !== 'object' ) {
-                               message = $.parseHTML( message );
-                       }
-                       mw.notify( message, { autoHide: true, tag: 'legacy' } );
-                       return true;
-               },
-
-               /**
                 * Validate a string as representing a valid e-mail address
                 * according to HTML5 specification. Please note the 
specification
                 * does not validate a domain with one character.
@@ -510,6 +490,26 @@
         */
        mw.log.deprecate( util, 'tooltipAccessKeyRegexp', 
/\[(ctrl-)?(option-)?(alt-)?(shift-)?(esc-)?(.)\]$/, 'Use jquery.accessKeyLabel 
instead.' );
 
+       /**
+        * Add a little box at the top of the screen to inform the user of
+        * something, replacing any previous message.
+        * Calling with no arguments, with an empty string or null will hide 
the message
+        *
+        * @param {Mixed} message The DOM-element, jQuery object or HTML-string 
to be put inside the message box.
+        * to allow CSS/JS to hide different boxes. null = no class used.
+        * @deprecated since 1.20 Use mw#notify
+        */
+       mw.log.deprecate( util, 'jsMessage', function ( message ) {
+               if ( !arguments.length || message === '' || message === null ) {
+                       return true;
+               }
+               if ( typeof message !== 'object' ) {
+                       message = $.parseHTML( message );
+               }
+               mw.notify( message, { autoHide: true, tag: 'legacy' } );
+               return true;
+       }, 'Use mw.notify instead.' );
+
        mw.util = util;
 
 }( mediaWiki, jQuery ) );
diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js
index a7ff2da..8d80ccb 100644
--- a/skins/common/wikibits.js
+++ b/skins/common/wikibits.js
@@ -153,7 +153,16 @@
  * @deprecated since 1.17 Use mediawiki.notify instead
  * @param {string|HTMLElement} message To be put inside the message box
  */
-mw.log.deprecate( win, 'jsMsg', mw.util.jsMessage, 'Use mediawiki.notify 
instead.' );
+mw.log.deprecate( win, 'jsMsg', function ( message ) {
+       if ( !arguments.length || message === '' || message === null ) {
+               return true;
+       }
+       if ( typeof message !== 'object' ) {
+               message = $.parseHTML( message );
+       }
+       mw.notify( message, { autoHide: true, tag: 'legacy' } );
+       return true;
+}, 'Use mediawiki.notify instead.' );
 
 /**
  * Misc. utilities

-- 
To view, visit https://gerrit.wikimedia.org/r/129887
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib41d52456825526c5217743302e80a2de2bbe8d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <[email protected]>
Gerrit-Reviewer: Gerrit Patch Uploader <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to