User:AdorableDarling/global.js

/* Imports from Wikia Developers Wiki */ importArticles({ type:"script", articles: [   'u:dev:MediaWiki:AjaxBatchDelete/code.2.js',   'u:dev:MediaWiki:AjaxDelete/code.js',   'u:dev:MediaWiki:AjaxDiff/code.js',   'u:dev:MediaWiki:AjaxRename/code.js',   'u:dev:MediaWiki:AjaxRC/code.js',   'u:dev:MediaWiki:AjaxThreadDelete/code.js',   'u:dev:MediaWiki:BackToThread/code.js',   'u:dev:MediaWiki:BackToTopButton/code.js',   'u:dev:MediaWiki:ChatModHover/code.js',   'u:dev:MediaWiki:DupImageList/code.js',   'u:dev:MediaWiki:FloatingTableHeader/code.js',   'u:dev:MediaWiki:MassCategorization/code.js',   'u:dev:MediaWiki:MassRename/code.js',   'u:dev:MediaWiki:MultiUpload/code.js',   'u:dev:MediaWiki:NullEditButton/code.js',   'u:dev:MediaWiki:PortableCSSPad/code.js',   'u:dev:MediaWiki:PrivateMessageAlert/code.js',   'u:dev:MediaWiki:PurgeBlogs/code.js',   'u:dev:MediaWiki:QuickIW/code.js',   'u:dev:MediaWiki:RecentChangesModule/code.js', 'u:dev:MediaWiki:RedirectManagement/code.js', 'u:dev:MediaWiki:RevealAnonIP/code.js', 'u:dev:MediaWiki:SearchSuggest/code.js', 'u:dev:MediaWiki:Standard_Edit_Summary/code.js', 'u:dev:MediaWiki:ThreadConfirm/code.js', 'u:dev:MediaWiki:ViewRemoved/code.js', 'u:dev:MediaWiki:View_Source/code.js', 'u:dev:MediaWiki:WHAM/code.2.js' ] }); window.ajaxPages = ["Special:WikiActivity", "Special:RecentChanges","Special:Watchlist","Special:Log","Special:Contributions/AdorableDarling", "Special:Images"]; importArticles({ type:"style", articles: [ 'w:c:dev:Highlight/code.css' ] }); /* Floating table header from Wikia Developers Wiki - slightly edited to make table headers float without having to use floatheader class */ $("table").each(function { $(this).wrap(" "); var originalHeaderRow = $("tr:first", this) originalHeaderRow.before(originalHeaderRow.clone); var clonedHeaderRow = $("tr:first", this) clonedHeaderRow.addClass("tableFloatingHeader"); clonedHeaderRow.css("position", "absolute"); clonedHeaderRow.css("top", "0px"); clonedHeaderRow.css("left", $(this).css("margin-left")); clonedHeaderRow.css("visibility", "hidden"); originalHeaderRow.addClass("tableFloatingHeaderOriginal"); }); UpdateTableHeaders; $(window).scroll(UpdateTableHeaders).resize(UpdateTableHeaders); $('.divTableWithFloatingHeader table.sortable thead tr:last-child th').click( function { $('.divTableWithFloatingHeader table.sortable thead tr:first-child th').eq( $(this).index ).click; }); function UpdateTableHeaders {	$("div.divTableWithFloatingHeader").each(function { var originalHeaderRow = $(".tableFloatingHeaderOriginal", this); var floatingHeaderRow = $(".tableFloatingHeader", this); var offset = $(this).offset; var scrollTop = $(window).scrollTop; var globalNavOffset = $('#globalNavigation').height; if ((scrollTop > offset.top - globalNavOffset) && (scrollTop + globalNavOffset < offset.top + $(this).height)) { floatingHeaderRow.css("visibility", "visible"); floatingHeaderRow.css("top", Math.min(scrollTop - offset.top + globalNavOffset, $(this).height - floatingHeaderRow.height) + "px"); // Copy cell widths from original header $("th", floatingHeaderRow).each(function(index) {				var cellWidth = $("th", originalHeaderRow).eq(index).css('width');				$(this).css('width', cellWidth);			}); // Copy row width from whole table floatingHeaderRow.css("width", $(this).css("width")); } else { floatingHeaderRow.css("visibility", "hidden"); floatingHeaderRow.css("top", "0px"); }	}); } /* Monchoman45's chat hacks */ importScriptPage('User:Monchoman45/ChatHacks.js','c'); /* Account navigation */ $("#AccountNavigation ul li:first").after($('My contributions')) $("#AccountNavigation ul li:nth-last-child(2)").css({'display':'none'}); /* Tools menu */ $(".WikiaBarWrapper .tools-menu li").addClass("color1"); $("#my-tools-menu").append('Multi-upload'); $("#my-tools-menu").append('Mass-categorization'); $("#my-tools-menu").append('Mass-rename</li>'); $("#my-tools-menu").append('<a href="/wiki/MediaWiki:Wikia.css">Cascading Style Sheets</a></li>'); $("#my-tools-menu").append('<a href="/wiki/MediaWiki:Wikia.js">JavaScript</a></li>');