Merge "FeedItem: Use full URL with protocol for <id>/<guid> in Atom/RSS feeds"
[lhc/web/wiklou.git] / maintenance / jsduck / eg-iframe.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>MediaWiki Code Example</title>
6 <script src="modules/src/startup.js"></script>
7 <script>
8 function startUp() {
9 mw.config = new mw.Map();
10 }
11 </script>
12 <script src="modules/lib/jquery/jquery.js"></script>
13 <script src="modules/src/mediawiki/mediawiki.js"></script>
14 <style>
15 .mw-jsduck-log {
16 position: relative;
17 min-height: 3em;
18 margin-top: 2em;
19 background: #f7f7f7;
20 border: 1px solid #e4e4e4;
21 }
22
23 .mw-jsduck-log::after {
24 position: absolute;
25 bottom: 100%;
26 right: -1px;
27 padding: 0.5em;
28 background: #fff;
29 border: 1px solid #e4e4e4;
30 border-bottom: 0;
31 border-radius: 0.5em 0.5em 0 0;
32 font: normal 0.5em sans-serif;
33 content: 'console';
34 }
35
36 .mw-jsduck-log-line {
37 padding: 0.2em 0.5em;
38 white-space: pre-wrap;
39 }
40
41 .mw-jsduck-log-line:nth-child(odd) {
42 background: #fff;
43 }
44 </style>
45 </head>
46 <body>
47 <script>
48 /**
49 * Basic log console for the example iframe in documentation pages.
50 */
51 var log = ( function () {
52 var pre;
53 return function () {
54 var str, i, len, line;
55 if ( !pre ) {
56 pre = document.createElement( 'pre' );
57 pre.className = 'mw-jsduck-log';
58 document.body.appendChild( pre );
59 }
60 str = [];
61 for ( i = 0, len = arguments.length; i < len; i++ ) {
62 str.push( String( arguments[ i ] ) );
63 }
64 line = document.createElement( 'div' );
65 line.className = 'mw-jsduck-log-line';
66 line.appendChild(
67 document.createTextNode( str.join( ' , ' ) + '\n' )
68 );
69 pre.appendChild( line );
70 };
71 }() );
72
73 if ( window.mw ) {
74 mw.log = log;
75 }
76
77 window.onerror = function ( error, filePath, linerNr ) {
78 log( filePath + ':' + linerNr );
79 };
80
81 /**
82 * Method called by jsduck to execute the example code.
83 */
84 function loadInlineExample( code, options, callback ) {
85 try {
86 eval( code );
87 callback && callback( true );
88 } catch ( e ) {
89 log( 'Uncaught ' + e );
90 callback && callback( false, e );
91 throw e;
92 }
93 }
94 </script>
95 </body>
96 </html>