2 mw
.hook( 'wikipage.content' ).add( function ( $content
) {
3 var $sortable
, $collapsible
;
5 $collapsible
= $content
.find( '.mw-collapsible' );
6 if ( $collapsible
.length
) {
7 // Preloaded by Skin::getDefaultModules()
8 mw
.loader
.using( 'jquery.makeCollapsible', function () {
9 $collapsible
.makeCollapsible();
13 $sortable
= $content
.find( 'table.sortable' );
14 if ( $sortable
.length
) {
15 // Preloaded by Skin::getDefaultModules()
16 mw
.loader
.using( 'jquery.tablesorter', function () {
17 $sortable
.tablesorter();
21 // Run jquery.checkboxShiftClick
22 $content
.find( 'input[type="checkbox"]:not(.noshiftselect)' ).checkboxShiftClick();
25 // Things outside the wikipage content
29 // Add accesskey hints to the tooltips
30 $( '[accesskey]' ).updateTooltipAccessKeys();
32 $nodes
= $( '.catlinks[data-mw="interface"]' );
33 if ( $nodes
.length
) {
35 * Fired when categories are being added to the DOM
37 * It is encouraged to fire it before the main DOM is changed (when $content
38 * is still detached). However, this order is not defined either way, so you
39 * should only rely on $content itself.
41 * This includes the ready event on a page load (including post-edit loads)
42 * and when content has been previewed with LivePreview.
44 * @event wikipage_categories
46 * @param {jQuery} $content The most appropriate element containing the content,
49 mw
.hook( 'wikipage.categories' ).fire( $nodes
);
52 $( '#t-print a' ).on( 'click', function ( e
) {