MediaWiki:Common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Alarya (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Alarya (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
| Zeile 22: | Zeile 22: | ||
console.log("hier auch"); | console.log("hier auch"); | ||
sortables_init(); | |||
// sort the first sortable table; change [0] to sort other tables. | |||
tab = document.getElementsByTagName("table")[0]; | |||
// sort by the first column; change [0] to sort by other columns. | |||
hdr = tab.getElementsByTagName("th")[0]; | |||
// get the sort button link | |||
lnk = hdr.getElementsByTagName("a")[0]; | |||
ts_resortTable(lnk); | |||
Version vom 17. Februar 2025, 07:42 Uhr
/* Das folgende JavaScript wird für alle Benutzer geladen. */
switch (mw.config.get('wgPageName')) {
case 'Hauptseite':
// JS here will be applied to "page name"
alert("Hier");
break;
case 'some other page':
// JS here will be applied to "some other page"
break;
}
const seitenname = mw.config.get('wgPageName');
if(seitenname.startsWith("Annalen:")) {
alert(seitenname);
}
$(window).on('load', function() {
console.log('All assets are loaded')
})
window.addEventListener('load', function() {
console.log("alles geladen")
})
console.log("hier auch");
sortables_init();
// sort the first sortable table; change [0] to sort other tables.
tab = document.getElementsByTagName("table")[0];
// sort by the first column; change [0] to sort by other columns.
hdr = tab.getElementsByTagName("th")[0];
// get the sort button link
lnk = hdr.getElementsByTagName("a")[0];
ts_resortTable(lnk);