User:Woganhemlock/wikia.js

// Change "A Wikia contributor" to IP address importScriptPage('MediaWiki:Common.js/ipAnon.js', 'admintools'); // END Change "A Wikia contributor" to IP address

if(wgPageName=='Special:Log') { addOnloadHook(function {   addPortletLink('p-cactions','javascript:speciallogRegexFilter','Filter','p-logfilter','Regex filter the results on this page');  }); }

var filter='Image\:'; function speciallogRegexFilter { filter = prompt('Please enter a regular expression for this search',filter); if(filter==null) filter = '.*' var pattern = new RegExp(filter,''); var li=document.getElementById('bodyContent').getElementsByTagName('ul')[0].getElementsByTagName('li'); var links=[]; for(var i=0;i<li.length;i++) { litxt = getText(li[i]); (litxt.search(pattern)!=-1) ? li[i].style.display='block' : li[i].style.display='none' } }

function getText(obj) { if (obj.nodeType == 3) return obj.nodeValue; var txt = new Array; var i=0; while(obj.childNodes[i]) { txt[txt.length] = getText(obj.childNodes[i]); i++; } return txt.join(''); }