Jump to content

User:Tim@/common.js

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Tim@ (talk | contribs) at 15:31, 8 March 2021. The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
function clean(){
	if (location.href.indexOf("#nojs") > 0) {
		return;
	}
	document.querySelectorAll('[style]').forEach(function (e){
		if (e.className.indexOf('ace_') > -1) {
			return;
		}
		if (e.className === 'table-no') {
			e.style.backgroundColor='#400000';
			return;
		}
		if (e.className === 'table-yes') {
			e.style.backgroundColor='#004000';
			return;
		}
		e.removeAttribute('style');
	});
}
clean();