Changes

MediaWiki:Common.js

809 bytes added, 16:43, 7 November 2023
Adding new class names for XP keyword for Ascension XP and Defender Pass XP
element.innerHTML = element.innerHTML.replace(/gold(\d.+)|(\d.+)gold/gi, '<a href="/wiki/Gold" class="image"><img alt="Gold Icon.png" src="/images/2/26/Gold_Icon.png" width="18"></a> $1$2')
element.innerHTML = element.innerHTML.replace(/defender medals?(\d.+)|(\d.+)defender medals?/gi, '<a href="/wiki/Defender_Medals" class="image"><img alt="Defender Medal Icon.png" src="/images/a/a7/Defender_Medal_Icon.png" width="18"></a> $1$2')
})
 
/* Replaces the XP keyword with the Ascension XP icon in elements which include Ascension XP numbers */
Array.from(document.getElementsByClassName('ascension-xp')).forEach(function (element) {
element.innerHTML = element.innerHTML.replace(/xp?(\d.+)|(\d.+)xp?/gi, '<a href="/wiki/Experience" class="image"><img alt="Ascension XP Icon.png" src="/images/c/cf/Ascension_XP_Icon.png" width="18"></a> $1$2')
})
 
/* Replaces the XP keyword with the Defender Pass XP icon in elements which include Defender Pass XP numbers */
Array.from(document.getElementsByClassName('pass-xp')).forEach(function (element) {
element.innerHTML = element.innerHTML.replace(/xp?(\d.+)|(\d.+)xp?/gi, '<a class="image"><img alt="Defender Pass XP Icon.png" src="/images/2/23/Defender_Pass_XP_Icon.png" width="18"></a> $1$2')
})
WikiDefender, bureaucrat, administrator
618
edits