* bug 30710
Also makes it easier to do unit testing, this way the module can be included and the test can initialize it if and when it wants to.
'jquery.checkboxShiftClick',
'jquery.makeCollapsible',
'jquery.placeholder',
+ 'mediawiki.util',
),
),
'mediawiki.page.startup' => array(
jQuery( document ).ready( function( $ ) {
+ /* Initialize utilities (messageBoxNew, profile, tooltip access keys, TOC etc.) */
+ mw.util.init();
+
/* Emulate placeholder if not supported by browser */
if ( !( 'placeholder' in document.createElement( 'input' ) ) ) {
$( 'input[placeholder]' ).placeholder();
// Local cache and alias
var util = mw.util = {
- /* Initialisation */
/**
- * @var boolean Wether or not already initialised
+ * Initialisation
+ * (don't call before document ready)
*/
- 'initialised' : false,
'init' : function() {
- if ( this.initialised === false ) {
- this.initialised = true;
-
- // Following the initialisation after the DOM is ready
- $(document).ready( function() {
/* Set up $.messageBox */
$.messageBoxNew( {
$tocToggleLink.click();
}
}
- } );
-
- return true;
- }
- return false;
},
/* Main body */
};
- util.init();
-
} )( jQuery );