Let mw.util.addCSS also return a CSSStyleSheet in IE8
[lhc/web/wiklou.git] / resources / mediawiki / mediawiki.util.js
index 4334a9f..cfc717f 100644 (file)
                 *     e.g. { action: 'edit' }. Optional.
                 * @return {string} Location for a page with name of `str` or boolean false on error.
                 */
-               wikiGetlink: function ( str, params ) {
+               getUrl: function ( str, params ) {
                        var url = mw.config.get( 'wgArticlePath' ).replace( '$1',
                                util.wikiUrlencode( typeof str === 'string' ? str : mw.config.get( 'wgPageName' ) ) );
                        if ( params && !$.isEmptyObject( params ) ) {
                 */
                addCSS: function ( text ) {
                        var s = mw.loader.addStyleTag( text );
-                       return s.sheet || s;
+                       return s.sheet || s.styleSheet || s;
                },
 
                /**
                }
        };
 
+       /**
+        * @method wikiGetlink
+        * @inheritdoc #getUrl
+        * @deprecated since 1.23 Use #getUrl instead.
+        */
+       mw.log.deprecate( util, 'wikiGetlink', util.getUrl, 'Use mw.util.getUrl instead.' );
+
        mw.util = util;
 
 }( mediaWiki, jQuery ) );