MediaWiki:Common.js: Unterschied zwischen den Versionen
Aus ISMS-Ratgeber WiKi
Zur Navigation springenZur Suche springen
Dirk (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „→Das folgende JavaScript wird für alle Benutzer geladen.: $(function() { if ($('#recentchanges-table').length) { $.getJSON(mw.util.wikiScript('api'), { action: 'query', list: 'recentchanges', rcprop: 'title|comment', rclimit: 10, format: 'json' }, function(data) { var table = '<table class="wikitable"><tr><th>Titel</th><th>Zusammenfassung</th></tr>'; $.each(data.query.recentchanges, function(i, rc)…“) |
Dirk (Diskussion | Beiträge) KKeine Bearbeitungszusammenfassung |
||
Zeile 1: | Zeile 1: | ||
/* Das folgende JavaScript wird für alle Benutzer geladen. */ | /* Das folgende JavaScript wird für alle Benutzer geladen. */ | ||
// Top 10 zuletzt geänderte Seiten: | |||
$(function() { | $(function() { | ||
if ($('# | if ($('#recentpages-table').length) { | ||
$.getJSON(mw.util.wikiScript('api'), { | $.getJSON(mw.util.wikiScript('api'), { | ||
action: 'query', | action: 'query', | ||
Zeile 8: | Zeile 9: | ||
rcprop: 'title|comment', | rcprop: 'title|comment', | ||
rclimit: 10, | rclimit: 10, | ||
rcshow: 'new', // Nur neue Seiten | |||
rcnamespace: 0, // Nur Hauptnamensraum (Inhaltsseiten) | |||
format: 'json' | format: 'json' | ||
}, function(data) { | }, function(data) { | ||
Zeile 15: | Zeile 18: | ||
}); | }); | ||
table += '</table>'; | table += '</table>'; | ||
$('# | $('#recentpages-table').html(table); | ||
}); | }); | ||
} | } | ||
}); | }); |
Version vom 12. Mai 2025, 17:47 Uhr
/* Das folgende JavaScript wird für alle Benutzer geladen. */ // Top 10 zuletzt geänderte Seiten: $(function() { if ($('#recentpages-table').length) { $.getJSON(mw.util.wikiScript('api'), { action: 'query', list: 'recentchanges', rcprop: 'title|comment', rclimit: 10, rcshow: 'new', // Nur neue Seiten rcnamespace: 0, // Nur Hauptnamensraum (Inhaltsseiten) format: 'json' }, function(data) { var table = '<table class="wikitable"><tr><th>Titel</th><th>Zusammenfassung</th></tr>'; $.each(data.query.recentchanges, function(i, rc) { table += '<tr><td>' + mw.html.escape(rc.title) + '</td><td>' + mw.html.escape(rc.comment || '') + '</td></tr>'; }); table += '</table>'; $('#recentpages-table').html(table); }); } });