mw.util: Add a deprecation message to escapeId()
authorBartosz Dziewoński <matma.rex@gmail.com>
Wed, 9 Aug 2017 19:07:10 +0000 (21:07 +0200)
committerEjegg <ejegg@ejegg.com>
Wed, 9 Aug 2017 22:51:47 +0000 (22:51 +0000)
Bug: T172493
Change-Id: Ie1468a4c1b56ca79b5f978a8bba80e98d8871f51

resources/src/mediawiki/mediawiki.util.js

index d0ec585..0e423be 100644 (file)
                 */
                rawurlencode: rawurlencode,
 
-               /**
-                * Encode the string like Sanitizer::escapeId() in PHP
-                * @deprecated since 1.30 use escapeIdForAttribute() or escapeIdForLink()
-                *
-                * @param {string} str String to be encoded.
-                * @return {string} Encoded string
-                */
-               escapeId: function ( str ) {
-                       return escapeIdInternal( str, 'legacy' );
-               },
-
                /**
                 * Encode string into HTML id compatible form suitable for use in HTML
                 * Analog to PHP Sanitizer::escapeIdForAttribute()
                return true;
        }, 'Use mw.notify instead.' );
 
+       /**
+        * Encode the string like Sanitizer::escapeId() in PHP
+        *
+        * @method escapeId
+        * @deprecated since 1.30 use escapeIdForAttribute() or escapeIdForLink()
+        * @param {string} str String to be encoded.
+        * @return {string} Encoded string
+        */
+       mw.log.deprecate( util, 'escapeId', function ( str ) {
+               return escapeIdInternal( str, 'legacy' );
+       }, 'Use mw.util.escapeIdForAttribute or mw.util.escapeIdForLink instead.' );
+
        /**
         * Initialisation of mw.util.$content
         */