Changes

Jump to: navigation, search

MediaWiki:Common.js

95 bytes added, 00:39, 16 November 2023
Attempt to make currency keyword function work when multiple different currencies are used together
Array.from(document.getElementsByClassName('currency-included')).forEach(function (element) {
if (!element.innerHTML.match(/Gem|Gold|Defender Medal/i)) return
const currency phrases = element.innerHTML.match(/Gem|Gold|Defender Medal/i).toString() element.innerHTML = element.innerHTML.replace(/(Gem|Gold|Defender Medal)s? (\d.*?)\b|(\d.*?) (Gem|Gold|Defender Medal)s?/gi) phrases.forEach(function (phrase){ const currency = phrase.match(/Gem|Gold|Defender Medal/i).toString() element.innerHTML = element.innerHTML.replace(phrase, currencyIcons[currency] + " $2$3") })
})
WikiDefender, bureaucrat, administrator
618
edits

Navigation menu