MediaWiki:Common.js: Difference between revisions
EnWikiAdmin (talk | contribs) No edit summary |
EnWikiAdmin (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
document.addEventListener("DOMContentLoaded", function() { | document.addEventListener("DOMContentLoaded", function() { | ||
const footnotes = document.querySelectorAll("sup.reference a"); | |||
footnotes.forEach(( | footnotes.forEach((footnote, index) => { | ||
// Replace the entire text with alphabetic labels | |||
const letter = String.fromCharCode(97 + index); // 'a' for 0, 'b' for 1, etc. | const letter = String.fromCharCode(97 + index); // 'a' for 0, 'b' for 1, etc. | ||
footnote.textContent = `[${letter}]`; | |||
}); | }); | ||
}); | }); |
Revision as of 07:57, 5 November 2024
/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener("DOMContentLoaded", function() {
const footnotes = document.querySelectorAll("sup.reference a");
footnotes.forEach((footnote, index) => {
// Replace the entire text with alphabetic labels
const letter = String.fromCharCode(97 + index); // 'a' for 0, 'b' for 1, etc.
footnote.textContent = `[${letter}]`;
});
});