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-core.js"></script>
51 <script src=
"modules/lib/oojs-ui/oojs-ui-widgets.js"></script>
52 <script src=
"modules/lib/oojs-ui/oojs-ui-toolbars.js"></script>
53 <script src=
"modules/lib/oojs-ui/oojs-ui-windows.js"></script>
54 <script src=
"modules/lib/oojs-ui/oojs-ui-mediawiki.js"></script>
58 font-family: sans-serif;
66 border:
1px solid #e4e4e4;
69 .mw-jsduck-log::after {
75 border:
1px solid #e4e4e4;
77 border-radius:
0.5em
0.5em
0 0;
78 font: normal
0.5em sans-serif;
84 white-space: pre-wrap;
87 .mw-jsduck-log-line:nth-child(odd) {
91 <link rel=
"stylesheet" href=
"modules/src/oojs-ui/oojs-ui-local.css">
92 <link rel=
"stylesheet" href=
"modules/lib/oojs-ui/oojs-ui-core-mediawiki.css">
93 <link rel=
"stylesheet" href=
"modules/lib/oojs-ui/oojs-ui-widgets-mediawiki.css">
94 <link rel=
"stylesheet" href=
"modules/lib/oojs-ui/oojs-ui-toolbars-mediawiki.css">
95 <link rel=
"stylesheet" href=
"modules/lib/oojs-ui/oojs-ui-windows-mediawiki.css">
104 * Method called by jsduck to execute the example code.
106 function loadInlineExample( code
, options
, callback
) {
109 callback
&& callback( true );
111 log( 'Uncaught ' + e
);
112 callback
&& callback( false, e
);