User:RMakise/global.js

// File page linking // Based on code from User:Rappy 4187 function z { $('#WikiaArticle, .LatestPhotosModule, #article-comments').unbind('click.lightbox');

var a = $("a"); for(var t = 0; t < a.length; ++t) { var b = a[t]; var c = b.href.substring(b.href.indexOf('images/') + 12) .replace("/revision/latest", "").replace(/\?cb=\d+/g, ""); var img = b.getElementsByTagName('img'); if(img[0] != null) { if (b.href.indexOf('wikia.nocookie.net') != -1) { var link = wgServer + '/wiki/File:' + c;       b.setAttribute('href',link); }   }  } } z;

// Toolbar links function x { $('Upload').insertAfter('ul.tools > li:first-child'); $('File list').insertAfter('#CT1'); $('JS').insertAfter('#CT2'); $('Forums').insertAfter('#CT3'); }); x;