User:Alinowe/common.js

console.log("common...") mw.loader.load("//fa.wikipedia.org/w/index.php?title=MediaWiki:Tofawiki.js&action=raw&ctype=text/javascript");

var keywords = /( (poet|spiritual|computer|programmer|musician|composer|guitarist|bassist|jazz|conductor|sound|music|record|painter|philosopher|singer|writer|author|hacktivist|hacker|iran|linguist|novelist|director|filmmaker|mathematician|historian|biologist|neuro))|nobel /ig;

console.log("Deaths...");

if (/Deaths_in/ig.test(document.location.pathname)) {

var lis = document.body.querySelector('#mw-content-text').querySelectorAll('li');

for (var i in lis) { var li = lis[i];

if (!keywords.test(li.innerHTML)) { try { li.style.backgroundColor = '#add'; li.style.display = 'none'; } catch (e) {} } else { li.innerHTML = li.innerHTML.replace(keywords, function(keyword) {				return ' ' + keyword.trim + ' ';			}) }

}

}