User:Ilikecomputers/cosmos.js: Difference between revisions
no edit summary
No edit summary |
No edit summary |
||
Line 6:
document.querySelectorAll('table').forEach(function (e) {
if (e.nextElementSibling && e.nextElementSibling.nodeName === 'UL') {
var sibling = e.nextElementSibling;
if (sibling.childNodes[0].childNodes[0].nodeName === 'UL') {
sibling.childNodes[0].classList.add('nodoublebullet');
}
}
function changeLinksColor(showLink, element) {
document.querySelectorAll('.spoiler').forEach(function (e) {▼
e.classList.remove('spoilerhidden'); //this fidgety hack removes the !important colour rule added by the spoilerhidden class▼
e.addEventListener('mouseover', function () {▼
▲ e.childNodes.forEach(function (f) {
}
▲ f.style.color = 'rgb(6, 69, 173)';
▲
▲ });
changeLinksColor(true, e);
e.addEventListener('mouseout', function () {▼
}
})
▲ if (e.classList.contains('spoilerRevealed')) {
if
▲ e.classList.add('spoilerRevealed');
e.classList.add('spoilerRevealed');
▲ }
}
})
document.styleSheets[0].insertRule(".spoilerRevealed {color: black !important}");▼
▲
|