Changes

MediaWiki:Common.js

47 bytes added, 00:54, 16 November 2023
Fixing mistake with replace function in previous edit
Array.from(document.getElementsByClassName('currency-included')).forEach(function (element) {
if (!element.innerHTML.match(/Gem|Gold|Defender Medal/i)) return
const phrases currencyRegex = element.innerHTML.match(/(Gem|Gold|Defender Medal)s? (\d.*?)\b|(\d.*?) (Gem|Gold|Defender Medal)s?/gi const phrases = element.innerHTML.match(currencyRegex)
phrases.forEach(function (phrase){
const currency = phrase.match(/Gem|Gold|Defender Medal/i).toString()
element.innerHTML = element.innerHTML.replace(phrasecurrencyRegex, currencyIcons[currency] + " $2$3")
})
})
WikiDefender, bureaucrat, administrator
618
edits