Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.view.tablesorting.js |
— | — | @@ -0,0 +1,9 @@ |
| 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/mediawiki.util/mediawiki.util.js |
— | — | @@ -57,9 +57,6 @@ |
58 | 58 | /* Enable CheckboxShiftClick */ |
59 | 59 | $( 'input[type=checkbox]:not(.noshiftselect)' ).checkboxShiftClick(); |
60 | 60 | |
61 | | - /* Enable Tablesorting */ |
62 | | - $( 'table.sortable' ).tablesorter(); |
63 | | - |
64 | 61 | /* Emulate placeholder if not supported by browser */ |
65 | 62 | if ( !( 'placeholder' in document.createElement( 'input' ) ) ) { |
66 | 63 | $( 'input[placeholder]' ).placeholder(); |
Index: trunk/phase3/resources/Resources.php |
— | — | @@ -439,6 +439,9 @@ |
440 | 440 | 'scripts' => 'resources/mediawiki.action/mediawiki.action.view.metadata.js', |
441 | 441 | 'messages' => array( 'metadata-expand', 'metadata-collapse' ), |
442 | 442 | ), |
| 443 | + 'mediawiki.action.view.tablesorting' => array( |
| 444 | + 'scripts' => 'resources/mediawiki.action/mediawiki.action.view.tablesorting.js', |
| 445 | + ), |
443 | 446 | 'mediawiki.action.watch.ajax' => array( |
444 | 447 | 'scripts' => 'resources/mediawiki.action/mediawiki.action.watch.ajax.js', |
445 | 448 | 'dependencies' => 'mediawiki.util', |