1 ( function ( mw , $ ) {
2 var supportsPlaceholder = 'placeholder' in document.createElement( 'input' );
4 mw.hook( 'wikipage.content' ).add( function ( $content ) {
7 // Run jquery.placeholder polyfill if placeholder is not supported
8 if ( !supportsPlaceholder ) {
9 $content.find( 'input[placeholder]' ).placeholder();
12 // Run jquery.makeCollapsible
13 $content.find( '.mw-collapsible' ).makeCollapsible();
15 // Lazy load jquery.tablesorter
16 $sortableTables = $content.find( 'table.sortable' );
17 if ( $sortableTables.length ) {
18 mw.loader.using( 'jquery.tablesorter', function () {
19 $sortableTables.tablesorter();
23 // Run jquery.checkboxShiftClick
24 $content.find( 'input[type="checkbox"]:not(.noshiftselect)' ).checkboxShiftClick();
27 // Things outside the wikipage content
30 if ( !supportsPlaceholder ) {
31 // Exclude content to avoid hitting it twice for the (first) wikipage content
32 $( 'input[placeholder]' ).not( '#mw-content-text input' ).placeholder();
35 // Add accesskey hints to the tooltips
36 mw.util.updateTooltipAccessKeys();
40 }( mediaWiki, jQuery ) );