Merge "MessagesGom_deva: Correct syntax in namespace alias"
[lhc/web/wiklou.git] / resources / src / mediawiki / page / startup.js
1 ( function ( mw, $ ) {
2
3 mw.page = {};
4
5 $( function () {
6 mw.util.init();
7
8 /**
9 * Fired when wiki content is being added to the DOM
10 *
11 * It is encouraged to fire it before the main DOM is changed (when $content
12 * is still detached). However, this order is not defined either way, so you
13 * should only rely on $content itself.
14 *
15 * This includes the ready event on a page load (including post-edit loads)
16 * and when content has been previewed with LivePreview.
17 *
18 * @event wikipage_content
19 * @member mw.hook
20 * @param {jQuery} $content The most appropriate element containing the content,
21 * such as #mw-content-text (regular content root) or #wikiPreview (live preview
22 * root)
23 */
24 mw.hook( 'wikipage.content' ).fire( $( '#mw-content-text' ) );
25
26 var $diff = $( 'table.diff[data-mw="interface"]' );
27 if ( $diff.length ) {
28 /**
29 * Fired when the diff is added to a page containing a diff
30 *
31 * Similar to the {@link mw.hook#event-wikipage_content wikipage.content hook}
32 * $diff may still be detached when the hook is fired.
33 *
34 * @event wikipage_diff
35 * @member mw.hook
36 * @param {jQuery} $diff The root element of the MediaWiki diff (`table.diff`).
37 */
38 mw.hook( 'wikipage.diff' ).fire( $diff.eq( 0 ) );
39 }
40 } );
41
42 }( mediaWiki, jQuery ) );