5 <title>MediaWiki Code Example
</title>
8 * Basic log console for the example iframe in documentation pages.
10 var log
= ( function () {
13 var str
, i
, len
, line
;
15 pre
= document
.createElement( 'pre' );
16 pre
.className
= 'mw-jsduck-log';
17 ( document
.body
|| document
.documentElement
).appendChild( pre
);
20 for ( i
= 0, len
= arguments
.length
; i
< len
; i
++ ) {
21 str
.push( String( arguments
[ i
] ) );
23 line
= document
.createElement( 'div' );
24 line
.className
= 'mw-jsduck-log-line';
26 document
.createTextNode( str
.join( ' , ' ) + '\n' )
28 pre
.appendChild( line
);
32 window
.onerror = function ( error
, filePath
, linerNr
) {
33 log( error
+ '\n' + filePath
+ ':' + linerNr
);
38 var mwPerformance
= { mark: function () {} };
41 mw
.config
= new mw
.Map();
44 <script src=
"modules/lib/jquery/jquery.js"></script>
45 <script src=
"modules/lib/phpjs-sha1/sha1.js"></script>
46 <script src=
"modules/src/mediawiki/mediawiki.js"></script>
47 <script src=
"modules/src/mediawiki/mediawiki.errorLogger.js"></script>
48 <script src=
"modules/src/mediawiki/mediawiki.startUp.js"></script>
49 <script src=
"modules/lib/oojs/oojs.jquery.js"></script>
50 <script src=
"modules/lib/oojs-ui/oojs-ui.js"></script>
51 <script src=
"modules/lib/oojs-ui/oojs-ui-mediawiki.js"></script>
55 font-family: sans-serif;
63 border:
1px solid #e4e4e4;
66 .mw-jsduck-log::after {
72 border:
1px solid #e4e4e4;
74 border-radius:
0.5em
0.5em
0 0;
75 font: normal
0.5em sans-serif;
81 white-space: pre-wrap;
84 .mw-jsduck-log-line:nth-child(odd) {
88 <link rel=
"stylesheet" href=
"modules/lib/oojs-ui/oojs-ui-local.css">
89 <link rel=
"stylesheet" href=
"modules/lib/oojs-ui/oojs-ui-mediawiki-noimages.css">
98 * Method called by jsduck to execute the example code.
100 function loadInlineExample( code
, options
, callback
) {
103 callback
&& callback( true );
105 log( 'Uncaught ' + e
);
106 callback
&& callback( false, e
);