User:452/global.js

/* Custom "NewPhotosModule" */ if ($('#WikiaRail').length) { //only on pages where the rail is present $('head').append('\n#gallery- { height:452px; overflow-y:auto; }\n#NewPhotosModule .wikia-gallery-item { padding:1em !important; height:auto !important; }\n#NewPhotosModule .thumb { height:auto !important; }\n#NewPhotosModule .gallery-image-wrapper { top:0 !important; }\n '); $('#WikiaRail').bind('DOMNodeInserted', function(event) { //fires after lazy-loading takes place.   if (typeof window.$temp == "undefined") { console.log("1");      window.$temp = $(' '); // this line, and the line below it, originate from http://dev.wikia.com/wiki/AjaxRC/code.js <3      if ($('.ChatModule') && !$("#NewPhotosModule").length) { // Only add it once console.log("2");        $('.ChatModule').after(" New Photos ");        $temp.load("/Special:NewFiles/13" + " #gallery-", function  { console.log("3"); if (!$("#NewPhotosModule #gallery-").length) { $("#NewPhotosModule").append($('#gallery-', $temp)); }       });      }    }  });  //end of DOMNodeInserted block } /* End of custom "NewPhotosModule" */

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");