Index: trunk/phase3/resources/Resources.php |
— | — | @@ -647,6 +647,7 @@ |
648 | 648 | 'jquery.checkboxShiftClick', |
649 | 649 | 'jquery.makeCollapsible', |
650 | 650 | 'jquery.placeholder', |
| 651 | + 'mediawiki.util', |
651 | 652 | ), |
652 | 653 | ), |
653 | 654 | 'mediawiki.page.startup' => array( |
Index: trunk/phase3/resources/mediawiki/mediawiki.util.js |
— | — | @@ -6,18 +6,12 @@ |
7 | 7 | // Local cache and alias |
8 | 8 | var util = mw.util = { |
9 | 9 | |
10 | | - /* Initialisation */ |
11 | 10 | /** |
12 | | - * @var boolean Wether or not already initialised |
| 11 | + * Initialisation |
| 12 | + * (don't call before document ready) |
13 | 13 | */ |
14 | | - 'initialised' : false, |
15 | 14 | 'init' : function() { |
16 | | - if ( this.initialised === false ) { |
17 | | - this.initialised = true; |
18 | 15 | |
19 | | - // Following the initialisation after the DOM is ready |
20 | | - $(document).ready( function() { |
21 | | - |
22 | 16 | /* Set up $.messageBox */ |
23 | 17 | $.messageBoxNew( { |
24 | 18 | 'id': 'mw-js-message', |
— | — | @@ -99,11 +93,6 @@ |
100 | 94 | $tocToggleLink.click(); |
101 | 95 | } |
102 | 96 | } |
103 | | - } ); |
104 | | - |
105 | | - return true; |
106 | | - } |
107 | | - return false; |
108 | 97 | }, |
109 | 98 | |
110 | 99 | /* Main body */ |
— | — | @@ -596,6 +585,4 @@ |
597 | 586 | |
598 | 587 | }; |
599 | 588 | |
600 | | - util.init(); |
601 | | - |
602 | 589 | } )( jQuery ); |
Index: trunk/phase3/resources/mediawiki.page/mediawiki.page.ready.js |
— | — | @@ -1,5 +1,8 @@ |
2 | 2 | jQuery( document ).ready( function( $ ) { |
3 | 3 | |
| 4 | + /* Initialize utilities (messageBoxNew, profile, tooltip access keys, TOC etc.) */ |
| 5 | + mw.util.init(); |
| 6 | + |
4 | 7 | /* Emulate placeholder if not supported by browser */ |
5 | 8 | if ( !( 'placeholder' in document.createElement( 'input' ) ) ) { |
6 | 9 | $( 'input[placeholder]' ).placeholder(); |