MediaWiki:Common.js: Unterschied zwischen den Versionen
Aus The Alchenomicon Wiki
Gk (Diskussion | Beiträge) Die Seite wurde neu angelegt: „→Strip namespace prefixes from category listings: document.querySelectorAll('.mw-category a').forEach(function(a) { var text = a.textContent; var colon = text.indexOf(':'); if (colon !== -1) { a.textContent = text.substring(colon + 1); } });“ |
Gk (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
| Zeile 1: | Zeile 1: | ||
mw.hook('wikipage.content').add(function() { | |||
document.querySelectorAll('.mw-category a').forEach(function(a) { | document.querySelectorAll('.mw-category a').forEach(function(a) { | ||
var text = a.textContent; | |||
var colon = text.indexOf(':'); | |||
if (colon !== -1) { | |||
a.textContent = text.substring(colon + 1); | |||
} | } | ||
}); | |||
}); | }); | ||