Index: trunk/phase3/tests/qunit/index.html |
— | — | @@ -16,17 +16,20 @@ |
17 | 17 | <script src="../../resources/jquery/jquery.js"></script> |
18 | 18 | <script src="../../resources/mediawiki/mediawiki.js"></script> |
19 | 19 | |
20 | | - <!-- MW: mediawiki.user|mediawiki.util --> |
| 20 | + <!-- MW: mediawiki.page.startup --> |
| 21 | + <script src="../../resources/mediawiki.page/mediawiki.page.startup.js"></script> |
| 22 | + <script src="../../resources/jquery/jquery.client.js"></script> |
| 23 | + |
| 24 | + <!-- MW: mediawiki.user|mediawiki.util|mediawiki.page.ready --> |
21 | 25 | <script src="../../resources/mediawiki/mediawiki.user.js"></script> |
22 | | - <script src="../../resources/jquery/jquery.checkboxShiftClick.js"></script> |
23 | | - <script src="../../resources/jquery/jquery.client.js"></script> |
24 | 26 | <script src="../../resources/jquery/jquery.cookie.js"></script> |
| 27 | + <script src="../../resources/mediawiki/mediawiki.util.js"></script> |
25 | 28 | <script src="../../resources/jquery/jquery.messageBox.js"></script> |
| 29 | + <script src="../../resources/jquery/jquery.mwPrototypes.js"></script> |
| 30 | + <script src="../../resources/mediawiki.page/mediawiki.page.ready.js"></script> |
| 31 | + <script src="../../resources/jquery/jquery.checkboxShiftClick.js"></script> |
26 | 32 | <script src="../../resources/jquery/jquery.makeCollapsible.js"></script> |
27 | | - <script src="../../resources/jquery/jquery.mwPrototypes.js"></script> |
28 | 33 | <script src="../../resources/jquery/jquery.placeholder.js"></script> |
29 | | - <script src="../../resources/jquery/jquery.tablesorter.js"></script> |
30 | | - <script src="../../resources/mediawiki/mediawiki.util.js"></script> |
31 | 34 | |
32 | 35 | <!-- MW: user.options --> |
33 | 36 | <script> |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2359,7 +2359,12 @@ |
2360 | 2360 | $wgUseAjax, $wgAjaxWatch, $wgEnableMWSuggest; |
2361 | 2361 | |
2362 | 2362 | // Add base resources |
2363 | | - $this->addModules( array( 'mediawiki.user', 'mediawiki.util', 'mediawiki.action.view.tablesorting' ) ); |
| 2363 | + $this->addModules( array( |
| 2364 | + 'mediawiki.user', |
| 2365 | + 'mediawiki.util', |
| 2366 | + 'mediawiki.page.startup', |
| 2367 | + 'mediawiki.page.ready', |
| 2368 | + ) ); |
2364 | 2369 | if ( $wgIncludeLegacyJavaScript ){ |
2365 | 2370 | $this->addModules( 'mediawiki.legacy.wikibits' ); |
2366 | 2371 | } |
Index: trunk/phase3/resources/jquery/jquery.client.js |
— | — | @@ -202,14 +202,4 @@ |
203 | 203 | return true; |
204 | 204 | } |
205 | 205 | }; |
206 | | - |
207 | | - $( document ).ready( function() { |
208 | | - var profile = $.client.profile(); |
209 | | - $( 'html' ) |
210 | | - .addClass( 'client-' + profile.name ) |
211 | | - .addClass( 'client-' + profile.name + '-' + profile.versionBase ) |
212 | | - .addClass( 'client-' + profile.layout ) |
213 | | - .addClass( 'client-' + profile.platform ); |
214 | | - } ); |
215 | | - |
216 | 206 | } )( jQuery ); |
Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.view.tablesorting.js |
— | — | @@ -1,9 +0,0 @@ |
2 | | -// Lazy load jquery.tablesorter |
3 | | - |
4 | | -( function( $ ) { |
5 | | - if ( $( 'table.sortable' ).length ) { |
6 | | - mw.loader.using( 'jquery.tablesorter', function() { |
7 | | - $( 'table.sortable' ).tablesorter(); |
8 | | - } ); |
9 | | - } |
10 | | -} )( jQuery ); |
\ No newline at end of file |
Index: trunk/phase3/resources/Resources.php |
— | — | @@ -448,16 +448,28 @@ |
449 | 449 | 'jquery.cookie', |
450 | 450 | ), |
451 | 451 | ), |
| 452 | + 'mediawiki.page.startup' => array( |
| 453 | + 'scripts' => 'resources/mediawiki.page/mediawiki.page.startup.js', |
| 454 | + 'dependencies' => array( |
| 455 | + 'jquery.client', |
| 456 | + ), |
| 457 | + 'position' => 'top', |
| 458 | + ), |
| 459 | + 'mediawiki.page.ready' => array( |
| 460 | + 'scripts' => 'resources/mediawiki.page/mediawiki.page.ready.js', |
| 461 | + 'dependencies' => array( |
| 462 | + 'jquery.checkboxShiftClick', |
| 463 | + 'jquery.makeCollapsible', |
| 464 | + 'jquery.placeholder', |
| 465 | + ), |
| 466 | + ), |
452 | 467 | 'mediawiki.util' => array( |
453 | 468 | 'scripts' => 'resources/mediawiki/mediawiki.util.js', |
454 | 469 | 'dependencies' => array( |
455 | | - 'jquery.checkboxShiftClick', |
456 | 470 | 'jquery.client', |
457 | 471 | 'jquery.cookie', |
458 | 472 | 'jquery.messageBox', |
459 | | - 'jquery.makeCollapsible', |
460 | 473 | 'jquery.mwPrototypes', |
461 | | - 'jquery.placeholder', |
462 | 474 | ), |
463 | 475 | ), |
464 | 476 | 'mediawiki.libs.jpegmeta' => array( |
— | — | @@ -482,9 +494,6 @@ |
483 | 495 | 'scripts' => 'resources/mediawiki.action/mediawiki.action.view.metadata.js', |
484 | 496 | 'messages' => array( 'metadata-expand', 'metadata-collapse' ), |
485 | 497 | ), |
486 | | - 'mediawiki.action.view.tablesorting' => array( |
487 | | - 'scripts' => 'resources/mediawiki.action/mediawiki.action.view.tablesorting.js', |
488 | | - ), |
489 | 498 | 'mediawiki.action.watch.ajax' => array( |
490 | 499 | 'scripts' => 'resources/mediawiki.action/mediawiki.action.watch.ajax.js', |
491 | 500 | 'messages' => array( |
Index: trunk/phase3/resources/mediawiki/mediawiki.util.js |
— | — | @@ -57,14 +57,6 @@ |
58 | 58 | mw.util.tooltipAccessKeyPrefix = 'alt-shift-'; |
59 | 59 | } |
60 | 60 | |
61 | | - /* Enable CheckboxShiftClick */ |
62 | | - $( 'input[type=checkbox]:not(.noshiftselect)' ).checkboxShiftClick(); |
63 | | - |
64 | | - /* Emulate placeholder if not supported by browser */ |
65 | | - if ( !( 'placeholder' in document.createElement( 'input' ) ) ) { |
66 | | - $( 'input[placeholder]' ).placeholder(); |
67 | | - } |
68 | | - |
69 | 61 | /* Fill $content var */ |
70 | 62 | if ( $( '#bodyContent' ).length ) { |
71 | 63 | // Vector, Monobook, Chick etc. |
— | — | @@ -86,9 +78,6 @@ |
87 | 79 | mw.util.$content = $( '#content' ); |
88 | 80 | } |
89 | 81 | |
90 | | - /* Enable makeCollapse */ |
91 | | - $( '.mw-collapsible' ).makeCollapsible(); |
92 | | - |
93 | 82 | /* Table of Contents toggle */ |
94 | 83 | var $tocContainer = $( '#toc' ), |
95 | 84 | $tocTitle = $( '#toctitle' ), |
Index: trunk/phase3/resources/mediawiki.page/mediawiki.page.startup.js |
— | — | @@ -0,0 +1,13 @@ |
| 2 | +( function( $ ) { |
| 3 | + |
| 4 | + /* Client profile classes for <html> */ |
| 5 | + |
| 6 | + var prof = $.client.profile(); |
| 7 | + $( 'html' ).addClass( |
| 8 | + 'client-' + prof.name |
| 9 | + + ' client-' + prof.name + '-' + prof.versionBase |
| 10 | + + ' client-' + prof.layout |
| 11 | + + ' client-' + prof.platform |
| 12 | + ); |
| 13 | + |
| 14 | +} )( jQuery ); |
Property changes on: trunk/phase3/resources/mediawiki.page/mediawiki.page.startup.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 15 | + native |
Index: trunk/phase3/resources/mediawiki.page/mediawiki.page.ready.js |
— | — | @@ -0,0 +1,21 @@ |
| 2 | +jQuery( document ).ready( function( $ ) { |
| 3 | + |
| 4 | + /* Emulate placeholder if not supported by browser */ |
| 5 | + if ( !( 'placeholder' in document.createElement( 'input' ) ) ) { |
| 6 | + $( 'input[placeholder]' ).placeholder(); |
| 7 | + } |
| 8 | + |
| 9 | + /* Enable makeCollapse */ |
| 10 | + $( '.mw-collapsible' ).makeCollapsible(); |
| 11 | + |
| 12 | + /* Lazy load jquery.tablesorter */ |
| 13 | + if ( $( 'table.sortable' ).length ) { |
| 14 | + mw.loader.using( 'jquery.tablesorter', function() { |
| 15 | + $( 'table.sortable' ).tablesorter(); |
| 16 | + }); |
| 17 | + } |
| 18 | + |
| 19 | + /* Enable CheckboxShiftClick */ |
| 20 | + $( 'input[type=checkbox]:not(.noshiftselect)' ).checkboxShiftClick(); |
| 21 | + |
| 22 | +} ); |
Property changes on: trunk/phase3/resources/mediawiki.page/mediawiki.page.ready.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 23 | + native |