mediawiki.util: Add module export to support require()
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.util.js
index a8188db..67e2ebb 100644 (file)
                 * This function returns the styleSheet object for convience (due to cross-browsers
                 * difference as to where it is located).
                 *
-                *     var sheet = mw.util.addCSS( '.foobar { display: none; }' );
+                *     var sheet = util.addCSS( '.foobar { display: none; }' );
                 *     $( foo ).click( function () {
                 *         // Toggle the sheet on and off
                 *         sheet.disabled = !sheet.disabled;
                 * (e.g. `document.getElementById( 'foobar' )`) or a jQuery-selector
                 * (e.g. `'#foobar'`) for that item.
                 *
-                *     mw.util.addPortletLink(
+                *     util.addPortletLink(
                 *         'p-tb', 'https://www.mediawiki.org/',
                 *         'mediawiki.org', 't-mworg', 'Go to mediawiki.org', 'm', '#t-print'
                 *     );
                 *
-                *     var node = mw.util.addPortletLink(
+                *     var node = util.addPortletLink(
                 *         'p-tb',
                 *         new mw.Title( 'Special:Example' ).getUrl(),
                 *         'Example'
                        }
 
                        // Update tooltip for the access key after inserting into DOM
-                       // to get a localized access key label (bug 67946).
+                       // to get a localized access key label (T69946).
                        $link.updateTooltipAccessKeys();
 
                        return $item[ 0 ];
        }, 'Use mw.notify instead.' );
 
        mw.util = util;
+       module.exports = util;
 
 }( mediaWiki, jQuery ) );