7 * Fired when wiki content is being added to the DOM
9 * It is encouraged to fire it before the main DOM is changed (when $content
10 * is still detached). However, this order is not defined either way, so you
11 * should only rely on $content itself.
13 * This includes the ready event on a page load (including post-edit loads)
14 * and when content has been previewed with LivePreview.
16 * @event wikipage_content
18 * @param {jQuery} $content The most appropriate element containing the content,
19 * such as #mw-content-text (regular content root) or #wikiPreview (live preview
22 mw
.hook( 'wikipage.content' ).fire( $( '#mw-content-text' ) );
24 $diff
= $( 'table.diff[data-mw="interface"]' );
27 * Fired when the diff is added to a page containing a diff
29 * Similar to the {@link mw.hook#event-wikipage_content wikipage.content hook}
30 * $diff may still be detached when the hook is fired.
32 * @event wikipage_diff
34 * @param {jQuery} $diff The root element of the MediaWiki diff (`table.diff`).
36 mw
.hook( 'wikipage.diff' ).fire( $diff
.eq( 0 ) );
40 }( mediaWiki
, jQuery
) );