User:Staffan15/global.js

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") + "#comm-" + rawID); } }); } function fbl { fixBlogLinks; $("#bodyContent").bind("ajaxPageLoad",fixBlogLinks); } addOnloadHook(fbl);

// if(!window.SkinSwitchLoad  ) { addOnloadHook( addSkinSwitchButtons ); } var SkinSwitchLoad = true; // prevent duplication

function addSkinSwitchButtons { $(' Monobook').appendTo('#page_controls'); $(' Monaco').appendTo('#page_controls'); $(' Monaco (wiki default)').appendTo('#page_controls'); $(' Dev Cookie').appendTo('#page_controls'); $(' <a id="ca-skins" href="/index.php?title='+encodeURIComponent(wgPageName)+'&useskin=wikia" rel="nofollow">Oasis</a></li>').appendTo('#page_controls'); $('<a href="/index.php?title='+encodeURIComponent(wgPageName)+'&useskin=monaco&usetheme=sapphire">monaco</a></li>').appendTo('#p-cactions > .pBody > ul'); $('<a href="/index.php?title='+encodeURIComponent(wgPageName)+'&useskin=monaco&usetheme=custom">monaco default</a></li>').appendTo('#p-cactions > .pBody > ul'); $('<a href="http://c.wikia.com/wiki/Special:DevCookie">devcookie</a></li>').appendTo('#p-cactions > .pBody > ul'); $('<a href="/index.php?title='+encodeURIComponent(wgPageName)+'&useskin=wikia">oasis</a></li>').appendTo('#p-cactions > .pBody > ul'); if (wgNamespaceNumber == 2) { $('<a rel="nofollow" href="/wiki/Special:Editcount/'+encodeURIComponent(wgTitle)+'">Editcount</a></li>').appendTo('#link_box > tr > td > ul'); $('<a rel="alternate" href="/wiki/Special:Editcount/'+encodeURIComponent(wgTitle)+'">Editcount</a></li>').appendTo('#p-tb > .pBody > ul'); } SkinSwitchLoad = false; /* if (encodeURIComponent(wgNamespaceNumber) == 0 || encodeURIComponent(wgNamespaceNumber) == 1 || encodeURIComponent(wgNamespaceNumber) == 4 || encodeURIComponent(wgNamespaceNumber) == 5) { if (encodeURIComponent(wgCanonicalNamespace) != "Project") { $('<a href="/wiki/Project:'+encodeURIComponent(wgPageName)+'" class="">3 tabs test</a></li>').appendTo('#page_tabs'); } else { $('<a href="/wiki/Project:'+encodeURIComponent(wgPageName)+'" class="selected">3 tabs test</a></li>').appendTo('#page_tabs'); document.getElementById("ca-nstab-project").setAttribute("class", ""); } } } //

dil = new Array; function findDupImages(gf) { output = ""; url = "/api.php?action=query&generator=allimages&prop=duplicatefiles&gailimit=500&format=json"; if (gf) url += "&gaifrom=" + gf; $.getJSON(url,function (data) { if (data.query) { pages = data.query.pages; for (pageID in pages) { dils = ","+dil.join; if (dils.indexOf(","+pages[pageID].title) == -1 && pages[pageID].title.indexOf("File::") == -1 && pages[pageID].duplicatefiles) { output += " <a href='/" + pages[pageID].title + "'>"+pages[pageID].title+"</a> \n<ul>\n"; for (x=0;x<pages[pageID].duplicatefiles.length;x++) { output += "<a href='/File:" + pages[pageID].duplicatefiles[x].name + "'>File:"+pages[pageID].duplicatefiles[x].name+"</a></li>\n"; dil.push("File:"+pages[pageID].duplicatefiles[x].name.replace(/_/g," ")); } output += "</ul>\n\n" } } $("#mw-dupimages").append(output); if (data["query-continue"]) setTimeout("findDupImages('"+data["query-continue"].allimages.gaifrom+"');",5000); } }); } $(function { if ($("#mw-dupimages").length) findDupImages; });