|
|
Zeile 1: |
Zeile 1: |
| /* Das folgende JavaScript wird für alle Benutzer geladen. */ | | /* Das folgende JavaScript wird für alle Benutzer geladen. */ |
|
| |
| $(function () {
| |
| if (document.getElementById('sk-subpagetoc')) {
| |
| page = mw.config.get( 'wgPageName' );
| |
| answer = new mw.Api().get( { action: "query", titles: [ page+"/R", page+"/Hauptseite" ] } ).done(
| |
| function ( result ) {
| |
| nonmissing = [];
| |
| pages = result.query.pages;
| |
| keys = Object.keys(pages);
| |
| for (i = 0; i<keys.length; i++) {
| |
| if (!('missing' in pages[keys[i]])) {
| |
| title = pages[keys[i]].title.substring(1+page.length);
| |
| nonmissing.push({title: title, url: pages[keys[i]].title} );
| |
| }
| |
| }
| |
| if (nonmissing.length) {
| |
| toc = document.getElementById('toc');
| |
| alert(toc.toSource());
| |
| document.getElementById('sk-subpagetoc').innerHTML = html;
| |
| }
| |
| }
| |
| );
| |
| }
| |
| }());
| |