Fix typo in comment
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.util.js
index 78634f6..b7bbc66 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;
                 * The content wrapper of the skin (e.g. `.mw-body`).
                 *
                 * Populated on document ready by #init. To use this property,
-                * wait for `$.ready` and be sure to have a module depedendency on
+                * wait for `$.ready` and be sure to have a module dependency on
                 * `mediawiki.util` and `mediawiki.page.startup` which will ensure
                 * your document ready handler fires after #init.
                 *
                 * (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'
                        block = allowBlock ? '(?:\\/(?:12[0-8]|1[01][0-9]|[1-9]?\\d))?' : '';
                        RE_IPV6_ADD =
                                '(?:' + // starts with "::" (including "::")
-                               ':(?::|(?::' + '[0-9A-Fa-f]{1,4}' + '){1,7})' +
-                               '|' + // ends with "::" (except "::")
-                               '[0-9A-Fa-f]{1,4}' + '(?::' + '[0-9A-Fa-f]{1,4}' + '){0,6}::' +
-                               '|' + // contains no "::"
-                               '[0-9A-Fa-f]{1,4}' + '(?::' + '[0-9A-Fa-f]{1,4}' + '){7}' +
+                                       ':(?::|(?::' +
+                                               '[0-9A-Fa-f]{1,4}' +
+                                       '){1,7})' +
+                                       '|' + // ends with "::" (except "::")
+                                       '[0-9A-Fa-f]{1,4}' +
+                                       '(?::' +
+                                               '[0-9A-Fa-f]{1,4}' +
+                                       '){0,6}::' +
+                                       '|' + // contains no "::"
+                                       '[0-9A-Fa-f]{1,4}' +
+                                       '(?::' +
+                                               '[0-9A-Fa-f]{1,4}' +
+                                       '){7}' +
                                ')';
 
                        if ( new RegExp( '^' + RE_IPV6_ADD + block + '$' ).test( address ) ) {
                        }
 
                        // contains one "::" in the middle (single '::' check below)
-                       RE_IPV6_ADD = '[0-9A-Fa-f]{1,4}' + '(?:::?' + '[0-9A-Fa-f]{1,4}' + '){1,6}';
+                       RE_IPV6_ADD =
+                               '[0-9A-Fa-f]{1,4}' +
+                               '(?:::?' +
+                                       '[0-9A-Fa-f]{1,4}' +
+                               '){1,6}';
 
                        return (
                                new RegExp( '^' + RE_IPV6_ADD + block + '$' ).test( address ) &&
        }, 'Use mw.notify instead.' );
 
        mw.util = util;
+       module.exports = util;
 
 }( mediaWiki, jQuery ) );