User:Pcj/global.js

function importScriptPage (page, server) { var url = '/index.php?title=' + encodeURIComponent(page.replace(/ /g,'_')).replace('%2F','/').replace('%3A',':') + '&action=raw&ctype=text/javascript'; if (typeof server == "string") url = (server.indexOf('://') == -1)?'http://' + server + '.wikia.com' + url:server + url; return importScriptURI(url); } ajaxPages = ["Special:RecentChanges","Special:Watchlist","Special:Log","Special:Contributions"]; importScriptPage('AjaxRC/code.js', 'dev');

function fixBlogLinks { rclist = ($("#mw-rc-subentries-0").length)?$("#bodyContent > div > table:contains('Blog comment')"):$("#bodyContent ul.special li:contains('Blog comment')"); if (wgPageName == "Special:RecentChanges") rclist.each(function (i) { lnk = $(this).find("a:contains('hist')").attr("href"); if (typeof(lnk) != "undefined") { rawID = lnk.replace(/.*curid=(.*?)&.*/,"$1"); $(this).find("a:contains('User blog:')").attr("href","/wiki/User_blog:" + lnk.replace(/.*User_blog_comment:(.*?\/.*?)\/.*/,"$1") + "?showall=1#comm-" + rawID); } }); } function fbl { fixBlogLinks; $("#bodyContent").bind("ajaxPageLoad",fixBlogLinks); } addOnloadHook(fbl);