Merge "API: Add show=unread to ApiQueryWatchlist"
[mediawiki.git] / resources / src / mediawiki.page / mediawiki.page.ready.js
blobccddb3e152d381a6a106da378b871bbc77eeac16
1 ( function ( mw, $ ) {
2         var supportsPlaceholder = 'placeholder' in document.createElement( 'input' );
4         mw.hook( 'wikipage.content' ).add( function ( $content ) {
5                 var $sortableTables;
7                 // Run jquery.placeholder polyfill if placeholder is not supported
8                 if ( !supportsPlaceholder ) {
9                         $content.find( 'input[placeholder]' ).placeholder();
10                 }
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();
20                         } );
21                 }
23                 // Run jquery.checkboxShiftClick
24                 $content.find( 'input[type="checkbox"]:not(.noshiftselect)' ).checkboxShiftClick();
25         } );
27         // Things outside the wikipage content
28         $( function () {
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();
33                 }
35                 // Add accesskey hints to the tooltips
36                 mw.util.updateTooltipAccessKeys();
38         } );
40 }( mediaWiki, jQuery ) );