User:452/global.js

function toggleCSS { $('link[href*="oasis/site"]').attr( "disabled",function(idx, oldAttr){return !oldAttr;}); $(window).trigger('resize'); } function toggleUserCSS { $("link[rel='stylesheet'][href*='"+wgUserName+"'][href$='/user']").attr("disabled",function(idx,oldAttr){return!oldAttr;}); $(window).trigger('resize'); }

if (!$("#toggleCSS").length) $("#WikiaBarWrapper .toolbar .tools").append("Toggle CSSToggle User CSS");

if (wgCanonicalNamespace == "Special") $(".WikiaArticle ul:not(.countLI)").each(function{ if ($(">li", this).size != 50 && $(">li", this).size > 15) $(this).addClass("countLI").prepend("Displaying "+$(">li", this).size+"");  });

if ($(".WikiaPageHeaderDiffHistory").length) { /* change the "edit" link of a diff page to edit the current version, as there is already an edit link for both diffs */ oldhref = $(".wikia-button[data-id=edit]").attr("href"); var newhref = oldhref.split("&oldid=")[0]; $(".wikia-button[data-id=edit]").attr("href", newhref); } if (!$("#ca-diff").length && $("a[data-id='history']").closest("ul")) { //adapted from NullEditButton script $("a[data-id='history']").closest("ul").prepend($('').find("a").attr({ href: wgServer+"/"+wgPageName+"?diff=cur", accesskey: "0", id: "ca-diff", title: mw.config.get('wgPageName') }).text("Last diff")) } console.log("global.js loaded");