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