MediaWiki:SoloArtistChallenge.js
Appearance
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
$(function() {
var user = document.querySelector('[title="Your user page \[.\]').innerText;
var anchorsWithTitles = document.querySelectorAll('a[title]');
anchorsWithTitles.forEach(function(anchor) {
// Only continue if this is an anchor tag for a solo artist challenge mob
if (!anchor.previousSibling || !anchor.previousSibling.style || anchor.previousSibling.style.fontSize !== '21px') return;
// If this is a solo artist <a>
var mob = anchor.title;
var mobId = anchor.title.replace(/ /g, '-');
var mobBeatList = document.getElementById(mobId);
if (!mobBeatList) return;
var userBeatMob = (mobBeatList.innerText +',').includes(user + ',');
//console.log(mob, mobId, mobBeatList.innerText, user, userBeatMob)
if (!userBeatMob) return;
document.querySelector('[title="'+ mob + '"]').previousSibling.innerText = 'X';
});
});