User:Ifaigios/global.js

importScriptURI("http://dev.wikia.com/index.php?title=SkinSwitchButton/beta.js&action=raw&ctype=text/javascript");

WikiaEnableNewCreatepage = false; WikiaDisableDynamicLinkCreatePagePopup = true;

// Patching in changes to table sorting and alt rows function changeTS { window['ts_alternate'] = function (table) { var tableBodies = table.getElementsByTagName("tbody"); for (var i = 0; i < tableBodies.length; i++) { var tableRows = tableBodies[i].getElementsByTagName("tr"); for (var j = 0; j < tableRows.length; j++) { var oldClasses = tableRows[j].className.split(" "); var newClassName = ""; for (var k = 0; k < oldClasses.length; k++) { if (oldClasses[k] != "" && oldClasses[k] != "alt") newClassName += oldClasses[k] + " "; } tableRows[j].className = newClassName + (j%2 == 0?"alt":""); } } } } addOnloadHook(changeTS);

// Turn off useravatar log spam in RecentChanges function noRCUA { $("ul.special>li:contains('User avatar log')").hide; } addOnloadHook(noRCUA);

// Make it so that when adding a new image you can not click "Upload" until you choose a license 1st function requireImageLicense { if (wgPageName == "Special:Upload" && getParamValue("wpDestFile") == null) { $("[name=wpUpload]").not("#wpUpload").attr("disabled","true"); $("#wpLicense").change(function { if ($("#wpLicense").val) { $("[name=wpUpload]").removeAttr("disabled"); } else { $("[name=wpUpload]").attr("disabled","true"); } }); } } addOnloadHook(requireImageLicense);

// ShowHide2 function importScriptPage('ShowHide2/code.js', 'dev');

importScriptPage('ShowHide/code.js', 'dev');

// Duplicate images list - Courtesy of "Pcj" of WoWWiki. importScriptPage('DupImageList/code.js', 'dev');