User:SuperSajuuk/global.js

// // START: jQuery code snippets //

// MediaWiki config array. var c = mw.config.get( [      'wgPageName',       'wgServer',       'wgCanonicalSpecialPageName',       'wgTitle',       'wgAction',       'wgCanonicalNamespace',       'wgNamespaceNumber',       'wgUserGroups',       'wgSiteName',       'skin' ]);

(function (window, $, mw) {	"use strict";

// Are we on a special page? if(c.wgCanonicalSpecialPageName === 'Contributions') { var change = wgTitle.split("/"); var title = change[1]; } else { var title = wgTitle; }

// Add edit link to WLH pages // Taken from http://community.wikia.com/wiki/User:Shockstorm/global.js?oldid=1283852 // jQuery version by UltimateSupreme (http://dev.wikia.com/wiki/User:UltimateSupreme) if (c.wgCanonicalSpecialPageName === 'Whatlinkshere' && c.wgSiteName !== "Elder Scrolls") { $("#mw-whatlinkshere-list").find("li").each(function {                      "use strict";                      var $this = $(this),                      $link = ' (edit)  &lrm; ';                      $this.find(".mw-whatlinkshere-tools").before($link);               }); }

// Adds some links in the header toolbar (not forum threads). if(c.wgNamespaceNumber !== 1201) { $(".WikiaMenuElement li").last.after(' WhatLinksHere Subpage List'); }

// Remove the Create/Edit button from WhatLinksHere because it's pointless... var wlh = title.search("WhatLinksHere"); if(wlh > -1) { $(".WikiaPageHeader .wikia-button").hide; }

// Fix position of the editor buttons if(c.wgNamespaceNumber !== 3 && c.wgNamespaceNumber !== 1200 && c.wgNamespaceNumber !== 1201 && $('nav.wikia-menu-button:nth-child(2)').length) { importScriptPage('RelocateEditDiscussionButtons/code.js', 'dev'); }

// Remove share buttons. $("div#PageShareContainer").remove; // Remove the WikiaTop Ads. $("div.WikiaTopAds").remove;

// Add link to Special:Editcount on Userpages. $("div.WikiaUserPagesHeader > div.tabs-container > ul.tabs li").last.after('Editcount');

// Adds quick links for important special pages // TO-DO: Make it a dropdown menu. $("nav.activity-nav li.watchlist").after(' Wanted Pages Special Pages</a></li>');

// Adds link to EditWatchlist/raw on tools menu $(".tools-menu li.overflow").first.before("<a href='/wiki/Special:EditWatchlist/raw' data-name='watchlist'>Watchlist</a></li>");

// Places an "Edit this Page" quicklink on normal talkpages and User Talkpages (not my own). if(c.wgNamespaceNumber === 3 && c.wgPageName !== "User_talk:SuperSajuuk") { $("div.UserProfileActionButton nav.wikia-menu-button").before('<a class="wikia-button" href="/wiki/'+mw.html.escape(wgPageName)+'?action=edit" data-id="editprofile"><img class="sprite edit-pencil" height="16" src="data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D" width="22"> Edit Talkpage	</a>	'); }

// Null Edit button // Conditionally load purge button if page cannot be edited if ($("#ca-edit").length || $("a[data-id='editprofile']").length) { importScriptPage('NullEditButton/code.js', 'dev'); } else { importScriptPage('PurgeButton/code.js', 'dev'); }       // Remove various unneeded footer links. $("footer.global-footer nav ul li:contains('About')").remove; $("footer.global-footer nav ul li:contains('Careers')").remove; $("footer.global-footer nav ul li:contains('Advertise')").remove; $("footer.global-footer nav ul li:contains('API')").remove; // Make CC link open in new tab by default. $("footer.global-footer nav ul li a:contains('Community Central')").attr("target","_blank");

// Back to Top everywhere. $("footer.global-footer nav ul li").first.before("<a href='#top'>Back to Top</a></li>"); // Add quick links to AccountNavigation. $("#AccountNavigation li").last.after('<a href="http://community.wikia.com/wiki/User:SuperSajuuk/global.js" target="_blank">Global JS</a></li><a href="http://community.wikia.com/wiki/User:SuperSajuuk/global.css" target="_blank">Global CSS</a></li>'); }(window, jQuery, mediaWiki));

// // END: jQuery code snippets //

// // START: Pre-Script Loading //

// // START: UserTags Configuration //

// The tags themselves. window.UserTagsJS = { modules: { newuser: { days: 14, edits: 25 },       mwGroups: ['bureaucrat', 'sysop', 'rollback', 'chatmoderator', 'custodian', 'patroller', 'wikiastars', 'inactive', 'newuser', 'bot', 'voldev', 'bot-global'], metafilter: { 'chatmoderator': ['sysop','bureaucrat'], 'rollback': ['sysop','bureaucrat'], 'bot': ['bot-global'] } }, tags: { bureaucrat: { u: 'Crat', link: 'Project:Bureaucrats', order:1 }, sysop: { u: 'Sysop', link: 'Project:Sysop', order:2 }, rollback: { link: 'Project:Rollback', order:3 }, chatmoderator: { u: 'Chat Mod', link: 'Project:Chat', order:4 }, wikiastars: { order:5 }, coder: { u: 'Coder', title: 'This user is a coder', order:6 }, bot: { u: 'Bot', title: 'This account is used for mass editing', order:7 }, translator: { u: 'Translator', title: 'This user can translate languages', order:8 }, inactive: { title: 'This user does not visit the wiki often', order:9 }, voldev: { u: 'Vol Dev', title: 'This user helps Wikia with system coding' }, 'bot-global': { u: 'Global Bot', title: 'This bot is used for Wikia-wide editing tasks' }, awesome: { u: 'Awesome Person', title: 'This user is undeniably awesome in all ways possible.' } }, };

// UserTags Built-In Modules. UserTagsJS.modules.inactive = { inactive: 30, zeroIsInactive: true }; UserTagsJS.modules.autoconfirmed = true;

// UserTags User Filter UserTagsJS.modules.userfilter = { 'SuperSajuuk': ['inactive'] };

// UserTags Custom Tags UserTagsJS.modules.custom = { 'Flightmare': ['coder'], 'UltimateSupreme': ['coder'], 'SuperSajuuk': ['awesome'] };

// // END: UserTags Configuration //

// AjaxRC window.ajaxPages = ["Special:WikiActivity","Special:Log","Special:RecentChanges"]; window.ajaxIndicator = 'http://images2.wikia.nocookie.net/__cb20100609110347/software/images/a/a9/Indicator.gif'; window.AjaxRCRefreshText = 'Auto Refresh'; window.AjaxRCRefreshHoverText = 'Silently refreshes the contents of this page every 60 seconds without requiring a full reload';

// // END: Pre-Script Loading //

// // START: Conditional Script Loader //

// NOTE: This section is for scripts that should // NOT load on particular wiki's, but should load // elsewhere. Use wgSiteName to determine non // loading sites. This should be used for wiki's // where Common.js already loads these scripts and // causes duplicate loading to occur.

// Don't load these scripts on TES Mods Wiki. if(c.wgSiteName !== "The Elder Scrolls Mods Wiki") { importScriptPage('MediaWiki:Gadget-AcountNav.js', 'naruto'); importScriptPage('CacheCheck/code.js', 'dev'); }

// // END: Conditional Script Loader //

// // START: All Scripts Loader //

// This is for scripts that will be enabled everywhere regardless of Common.js. // Userspace scripts will be loaded first. importArticles({      type: "script",       articles: [              "u:c:User:SuperSajuuk/FileModule.js", // Imports a File Module script (copied from 452's global js)              "w:c:dev:UnsafeScripts/code.js", // Needed for some stuff, load it first.              "w:c:dev:TabKeyInserter/code.js",              "w:c:dev:ChatOptions/code.js",              "w:c:dev:PortableCSSPad/code.js",              "w:c:dev:UserTags/code.js",              "w:c:dev:AjaxUndo/code.js",              "w:c:dev:User:UltimateSupreme/AjaxRollback.js",              "w:c:dev:FileUsageAuto-update/code.js",              "w:c:dev:AjaxRC/code.js",              "w:c:dev:PurgeBlogs/code.js",              "w:c:dev:NoImageLightbox/code.js",              "w:c:dev:QQX/code.js"	] });

// // END: All Scripts Loader //