5 <title>MediaWiki Code Example
</title>
6 <script src=
"modules/startup.js"></script>
9 mw.config = new mw.Map();
12 <script src=
"modules/jquery/jquery.js"></script>
13 <script src=
"modules/mediawiki/mediawiki.js"></script>
20 border:
1px solid #e4e4e4;
23 .mw-jsduck-log::after {
29 border:
1px solid #e4e4e4;
31 border-radius:
0.5em
0.5em
0 0;
32 font: normal
0.5em sans-serif;
38 white-space: pre-wrap;
41 .mw-jsduck-log-line:nth-child(odd) {
49 * Basic log console for the example iframe in documentation pages.
53 mw.log = function () {
54 var str, i, len, line;
56 pre = document.createElement( 'pre' );
57 pre.className = 'mw-jsduck-log';
58 document.body.appendChild( pre );
61 for ( i =
0, len = arguments.length; i < len; i++ ) {
62 str.push( String( arguments[ i ] ) );
64 line = document.createElement( 'div' );
65 line.className = 'mw-jsduck-log-line';
67 document.createTextNode( str.join( ' , ' ) + '\n' )
69 pre.appendChild( line );
74 * Method called by jsduck to execute the example code.
76 function loadInlineExample( code, options, callback ) {
79 callback && callback( true );
81 mw.log( 'Uncaught exception: ' + e );
82 callback && callback( false, e );