/*
* JavaScript backwards-compatibility alternatives and other convenience functions
+ *
+ * @deprecated since 1.26 Dated collection of miscellaneous utilities. Methods are
+ * either trivially inline, obsolete, or have a better place elsewhere.
*/
-( function ( $ ) {
-
- $.extend( {
+( function ( $, mw ) {
+ $.each( {
trimLeft: function ( str ) {
return str === null ? '' : str.toString().replace( /^\s+/, '' );
},
ucFirst: function ( str ) {
return str.charAt( 0 ).toUpperCase() + str.slice( 1 );
},
- escapeRE: function ( str ) {
- return str.replace( /([\\{}()|.?*+\-\^$\[\]])/g, '\\$1' );
- },
isDomElement: function ( el ) {
return !!el && !!el.nodeType;
},
return true;
}
// the for-loop could potentially contain prototypes
- // to avoid that we check it's length first
+ // to avoid that we check its length first
if ( v.length === 0 ) {
return true;
}
}
return true;
}
+ }, function ( key, value ) {
+ mw.log.deprecate( $, key, value );
} );
-}( jQuery ) );
+ mw.log.deprecate( $, 'escapeRE', function ( str ) {
+ return str.replace( /([\\{}()|.?*+\-\^$\[\]])/g, '\\$1' );
+ }, 'Use mediawiki.RegExp instead.' );
+
+} )( jQuery, mediaWiki );