User:Ilikecomputers/cosmos.js: Difference between revisions

no edit summary
(remove debug console log)
No edit summary
Line 5:
// ** This is a bullet point after a quote <-- this will have double bullet points
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');
})
}
})
}
document.styleSheets[0].insertRule(".nodoublebullet::marker {content: ''}");
})
document.styleSheets[0].insertRule(".nodoublebullet::marker {content: ''}");
//combines the function of the toggle spoiler and spoiler hover gadgets
 
//hover over spoilers to reveal them, they'll disappear after the cursor leaves the box
//combines the function of the toggle spoiler and spoiler hover gadgets
//hoverclick overon spoilers to permanently reveal them, they'llthen disappearclick afteron thethem cursoragain leavesto thehide boxthem
//also fixes hyperlinks in spoilers visible by default in the cosmos skin
//click on spoilers to permanently reveal them, then click on them again to hide them
document.querySelectorAll('.spoilera').forEach(function (e) {if (e.parentNode.classList.contains('spoiler')) e.style.color = 'white'});
document.querySelectorAll('.spoiler').forEach(function (e) {
e.classList.remove('spoilerhidden'); //this fidgety hack removes the !important colour rule added by the spoilerhidden class
e.style.color = 'white';
e.addEventListener('mouseover', function () {
e.style.color = 'black';
e.childNodes.forEach(function (f) {
});
if (f.nodeName === 'A') {
e.addEventListener('mouseout', function () {
e f.style.color = 'whitergb(6, 69, 173)';
})
});
e.addEventListener('click', function () {
if (e.classListstyle.contains(color = 'spoilerRevealedblack')) {;
});
e.classList.remove('spoilerRevealed');
e.addEventListener('mouseout', function () {
} else {
e.classListstyle.add(color = 'spoilerRevealedwhite');
e.childNodes.forEach(function (f) {
}
if (f.nodeName === 'A') {
})
e f.style.color = 'blackwhite';
})
}
document.styleSheets[0].insertRule(".spoilerRevealed {color: black !important}");
});
document.styleSheets[0].insertRule(".spoiler {cursor: pointer}");
})
e.addEventListener('click', function () {
if (e.classList.contains('spoilerRevealed')) {
e.classList.remove('spoilerRevealed');
} else {
e.classList.add('spoilerRevealed');
}
})
})
document.styleSheets[0].insertRule(".spoilerRevealed {color: black !important}");
document.styleSheets[0].insertRule(".spoiler {cursor: pointer}");