User:Yair rand/orangelinks.js
Note: You may have to bypass your browser’s cache to see the changes. In addition, after saving a sitewide CSS file such as MediaWiki:Common.css, it will take 5-10 minutes before the changes take effect, even if you clear your cache.
- Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh);
- Konqueror and Chrome: click Reload or press F5;
- Opera: clear the cache in Tools → Preferences;
- Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.
- This script lacks a documentation subpage. Please create it.
- Useful links: root page • root page’s subpages • links • redirects • your own
// The idea for this script was taken from [[User:Hippietrail/ajaxtranslinks.js]].
wgNamespaceNumber || addOnloadHook(function(){
var r = [], v = [], f = $("#bodyContent a[href*=\"#\"]:not(.new,[href^=\"#\"],[href*=\":\"],#languageLinks a)")
f.each(function(){
var b = decodeURI(this.href.split("/wiki/")[1]).replace(/\./g, '%').replace(/_/g,' ').split("#");
v.push(b);
$.inArray(b[0],r) == -1 && r.push(b[0])
})
r.length && JsMwApi()({action:'query',prop:'revisions',rvprop:'content',titles:r.splice(0,$.inArray("sysop",wgUserGroups) == -1?50:500).join("|")},function(p){
var j = p.query.pages;
f.each(function(g){
for(var i in j){
if(j[i].title == v[g][0] && j[i].revisions[0]['*'].indexOf("=="+v[g][1]+"==") == -1){
this.className = 'partlynew'
}
}
})
})
})