blob: b2e2b9068772d9148d96e1caba4864338fb9c3b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/*!
* @file
* @ingroup SMW
*
* @licence GNU GPL v2+
* @author mwjames
*/
/*global jQuery, mediaWiki, smw */
/*jslint white: true */
( function( $, mw ) {
'use strict';
var config = mw.config.get( 'mermaid' );
mw.loader.using( [ 'mediawiki.api', 'ext.mermaid', 'ext.mermaid.theme.' + config.theme ] ).then( function () {
$( document ).ready( function() {
$( '.ext-mermaid' ).each( function() {
var that = $( this );
var id = 'ext-mermaid-' + ( new Date().getTime() );
var data = that.data( 'mermaid' );
that.find( '.mermaid-dots' ).hide();
that.append( '<div id=' + id + '> ' + data.content + ' </div>' );
mermaid.initialize( data.config );
mermaid.init( undefined, $( "#" + id ) );
} );
} );
} );
}( jQuery, mediaWiki ) );
|