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