User:Withersoul 235/global.js

// Note to self /* For wiki-specific codes in Global JS page, use the following code: if (mw.config.get("wgServer") == "https:// .wikia.com") { // code };

Do noot forgetti */

// AjaxRC Configuration window.ajaxSpecialPages = ["Recentchanges", "Recentchangeslinked", "WikiActivity", "Watchlist", "Log", "Contributions", "NewPages", "Images", "Following"]; window.ajaxPages = ["Blog:Recent posts"]; window.ajaxRefresh = 30000; window.AjaxRCRefreshText = 'Auto-refresh'; window.AjaxRCRefreshHoverText = 'Automatically refresh the page'; window.ajaxIndicator = 'https://vignette.wikia.nocookie.net/dev/images/b/ba/Snake_throbber_dark-bg.gif/revision/latest?cb=20140519203615';

// Change text of "Rename" button to "Change title" on all wikis

$('#ca-move').text("Change title");

// RailWAM Configuration

window.railWAM = { //logPage: "Project:WAM Log" A lot of admins seem to get pissed about me    // logging to the wiki's WAM pages, so eh, screw this };

// Imports

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxRC/code.js',        'u:dev:MediaWiki:AjaxUndo/code.js',        'u:dev:MediaWiki:AntiSoundcloud/code.js',        //'u:dev:MediaWiki:BlankBlogBugfix/code.js', Bug got patched        //'u:dev:MediaWiki:BlogLink/code.js', No longer works        //'u:dev:MediaWiki:CapsFirst/code.js', Doesn't work        //'u:dev:MediaWiki:CodeblockLineNumbers/code.js', Broken        'u:dev:MediaWiki:CodeQuickLinks/code.js',        //'u:dev:MediaWiki:DiscussionsFeed.js', Doesn't work        //'u:dev:MediaWiki:DiscussionsRailModule/code.js',        //'u:dev:MediaWiki:DiscussionsViewer/code.js',        'u:dev:MediaWiki:DedicatedTalkButton.js',        'u:dev:MediaWiki:EditBio/code.js',        'u:dev:FavoriteWikisPersistTab/code.js',        //'u:dev:MediaWiki:GlobalChatJS.js', Doesn't work        'u:dev:MediaWiki:GlobalEditcount/code.js', //'u:dev:MediaWiki:IsTyping/code.js', Belongs a bit further on this page 'u:dev:LastEdited/code.js', //'u:dev:MediaWiki:LightBlock/code.js', See IsTyping 'u:dev:MediaWiki:MastheadRightsBadge.js', 'u:dev:MediaWiki:NewImages.js', //'u:dev:Novasis14/code.js', "u:dev:PageCreator/code2.js", //'u:dev:MediaWiki:PageMakerPro/code.js', //'u:dev:MediaWiki:PiniginsUserInfo/code.js', 'u:dev:PortableCSSPad/code.js', 'u:dev:MediaWiki:QuickLogs/code.js', //'u:dev:MediaWiki:QuickAccessToCSSAndJS/code.js', No longer works //'u:dev:QuickCreateMessageWallGreeting/code.js', No longer works //'u:dev:QuickCreateUserPage/code.js', No longer works 'u:dev:Quick_Management/code.js', // "u:dev:MediaWiki:QuickModTools/loader.js", See IsTyping 'u:dev:MediaWiki:RailWAM/code.js', 'u:dev:MediaWiki:RandomPageShortcut/code.js', //'u:dev:MediaWiki:RecentChangesModule/code.js', // Doesn't work in current state, needs rewrite //'u:dev:MediaWiki:ReplyList/code.js', //'u:dev:MediaWiki:OldFilePages/code.js', Seems to work no longer //'u:dev:MediaWiki:SearchJS/code.js', Dev Wiki only 'u:dev:MediaWiki:ShowUserGroups.js', //'u:dev:MediaWiki:SpellCheckModule/code.js', I never use this //'u:dev:MediaWiki:ToggleTestMode/code.js', //"u:dev:MediaWiki:WikiPlus/code.js", 'u:dev:MediaWiki:UnhideUserMasthead/code.js', //"u:dev:UserActivityTab/code.js", //'u:dev:MediaWiki:VSTFReport.js', 'u:dev:MediaWiki:WorkingMoreUsersCount.js' //'u:dev:MediaWiki:WHAM/code.2.js' ] });

// Make Visual Editor links load the regular editor instead

if ($.getUrlVar('veaction') == 'edit') { location.replace(document.URL.replace('veaction','action')); } // Don't save a page when enter is pressed in the summary box // Credit to User:Ciencia Al Poder. Taken from OneTwoThreeFall's Global JS.

if ($.inArray(mw.config.get('wgAction'), ['edit', 'submit']) !== -1) { $('#wpSummary').keypress(function (event) {       if (event.which === 13) {            return false;        }    }); } /* Reveals a user's personal JS / CSS on their masthead (currently not in use) */

/* // Shows global codes on Community Central

if (mw.config.get('wgCityId') === '177') { (function {   var $header = $('#WikiaUserPagesHeader');    if ($header.exists) {        var title = 'User:' + $header.find('#UserProfileMasthead h1').text + '/global.js';        $header.find('.tabs-container .tabs').append( $('', { 'data-id': 'global.js' }).append(               $('', { href: mw.util.getUrl(title), title: title, text: 'Global JS' })           )        );    } });

(function {   var $header = $('#WikiaUserPagesHeader');    if ($header.exists) {        var title = 'User:' + $header.find('#UserProfileMasthead h1').text + '/global.css';        $header.find('.tabs-container .tabs').append( $('', { 'data-id': 'global.js' }).append(               $('', { href: mw.util.getUrl(title), title: title, text: 'Global CSS' })           )        );    } }); } else { // Shows wiki-specific JS / CSS on all other wikis (function {   var $header = $('#WikiaUserPagesHeader');    if ($header.exists) {        var title = 'User:' + $header.find('#UserProfileMasthead h1').text + '/common.js';        $header.find('.tabs-container .tabs').append( $('', { 'data-id': 'common.js' }).append(               $('', { href: mw.util.getUrl(title), title: title, text: 'JS' })           )        );    } });

(function {   var $header = $('#WikiaUserPagesHeader');    if ($header.exists) {        var title = 'User:' + $header.find('#UserProfileMasthead h1').text + '/common.css';        $header.find('.tabs-container .tabs').append( $('', { 'data-id': 'common.css' }).append(               $('', { href: mw.util.getUrl(title), title: title, text: 'CSS' })           )        );    } });

(function {   var $header = $('#WikiaUserPagesHeader');    if ($header.exists) {        var title = 'User:' + $header.find('#UserProfileMasthead h1').text + '/wikia.js';        $header.find('.tabs-container .tabs').append( $('', { 'data-id': 'wikia.js' }).append(               $('', { href: mw.util.getUrl(title), title: title, text: 'Wikia JS' })           )        );    } });

(function {   var $header = $('#WikiaUserPagesHeader');    if ($header.exists) {        var title = 'User:' + $header.find('#UserProfileMasthead h1').text + '/wikia.css';        $header.find('.tabs-container .tabs').append( $('', { 'data-id': 'wikia.css' }).append(               $('', { href: mw.util.getUrl(title), title: title, text: 'Wikia CSS' })           )        );    } }); }

// Personalized version of RestoreContribsButton.

/* Temporarily not in use. $(function {   $('.wds-community-header__wiki-buttons').remove; var config = mw.config.get([ 'wgPageName' ]);   $('.wds-community-header__top-container').append( '' + ' ' + ' '+ '<path d="M14.943 13h-3.61v3.61z"/></g> ' + ' Contribute <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" class="wds-icon wds-icon-tiny wds-dropdown__toggle-chevron" id="wds-icons-dropdown-tiny"><path d="M6 9l4-5H2" fill-rule="evenodd"> ' + '<div class="wds-is-not-scrollable wds-dropdown__content">' + '<ul class="wds-list wds-is-linked">' + '<li><a href="/wiki/' + config.wgPageName + '?action=edit">Edit this page</a></li>' + '<li><a href="/wiki/Special:CreatePage">Add a Page</a></li>' + '<li><a href="/wiki/Special:WikiaVideoAdd">Add a Video</a></li>' + '<li><a href="/wiki/Special:Upload">Add an Image</a></li>' + '<li><a href="/wiki/Special:WikiActivity">Wiki Activity</a></li>' + '<li><a href="/wiki/Special:AdminDashboard" class="sysop-only">Admin Dashboard</a></li>' + '<li><a href="/wiki/MediaWiki:Common.css?action=edit" class="sysop-only">Edit wiki CSS</a></li>' + '<li><a href="/wiki/MediaWiki:Common.js?action=edit" class="sysop-only">Edit wiki JS</a></li>' + '<li><a href="/wiki/MediaWiki:Wikia.js?action=edit" class="sysop-only">Edit Oasis-only JS</a></li>' + '<li><a href="/wiki/MediaWiki:ImportJS?action=edit" class="sysop-only">Import JS addons</a></li>' + '<li><a href="/wiki/MediaWiki:Wiki-navigation?action=edit" class="sysop-only">Edit wiki navigation</a></li>' + '<li><a href="/wiki/' + config.wgPageName + '?action=purge">Reload page</a></li>' + '<li><a href="/wiki/' + config.wgPageName + '?action=watch">Add page to watchlist</a></li>' + '<li><a href="/wiki/' + config.wgPageName + '?action=unwatch">Remove page from watchlist</a></li>' + '</ul>  ');    if(wgUserGroups.indexOf('sysop') > -1 || wgUserGroups.indexOf('staff') > -1 || wgUserGroups.indexOf('helper') > -1) {        return 0;    } else {        $('a.sysop-only').remove;    } });



/*******************************************************************************
 * START GLOBAL CHAT ADDONS |||||||||||||||||||||||||||||||||

// Configurations

var chatags = { images: true, videos: true }; chatTimestamps24Hour = true;

// Contain imports in variable // Doesn't work. RIP

/*var addons = [ 'u:dev:MediaWiki:ChatOptions/code.js', 'u:dev:MediaWiki:ChatSendButton.js', 'u:dev:MediaWiki:IsTyping/code.js', 'u:dev:MediaWiki:ChatTags/code.js', 'u:dev:MediaWiki:HideChatRail/code.js', 'u:dev:MediaWiki:CapsFirst/code.js', 'u:dev:MediaWiki:ChatUserPageButton.js', 'u:dev:MediaWiki:MessageBlocker/code.js', 'u:dev:MediaWiki:ChatNotifications/code.js', 'u:dev:MediaWiki:ChatTimestamps/code.js', 'u:dev:MediaWiki:GiveChatMod/code.js', 'u:dev:MediaWiki:FasterBanModule/code.js', 'u:dev:MediaWiki:FixAdminKick/code.js', 'u:dev:MediaWiki:QuickModTools/loader.js', 'u:dev:MediaWiki:!mods/code.js', 'u:dev:MediaWiki:!kick/code.js', 'u:dev:MediaWiki:!ban/code.js', 'u:dev:MediaWiki:EmoticonsWindow/code.js', 'u:dev:MediaWiki:Tabinsert.js', 'u:dev:MediaWiki:MobileChat.js', ];*/

// Import addons

if (mw.config.get('wgCanonicalSpecialPageName') === "Chat") { // Small test for debugging console.log("Test"); // Import scripts importArticles({    type: 'script',     articles: /*addons*/ [    'u:dev:MediaWiki:ChatOptions/code.js',    'u:dev:MediaWiki:ChatSendButton.js',    'u:dev:MediaWiki:IsTyping/code.js',    'u:dev:MediaWiki:ChatTags/code.js',    'u:dev:MediaWiki:HideChatRail/code.js',    'u:dev:MediaWiki:CapsFirst/code.js',    'u:dev:MediaWiki:ChatUserPageButton.js',    'u:dev:MediaWiki:MessageBlocker/code.js',    'u:dev:MediaWiki:ExtendedPrivateMessaging/code.js',    'u:dev:MediaWiki:ChatNotifications/code.js',    'u:dev:MediaWiki:ChatTimestamps/code.js',    'u:dev:MediaWiki:GiveChatMod/code.js',    'u:dev:MediaWiki:FasterBanModule/code.js',    'u:dev:MediaWiki:FixAdminKick/code.js',    'u:dev:MediaWiki:QuickModTools/loader.js',    'u:dev:MediaWiki:!mods/code.js',    'u:dev:MediaWiki:!kick/code.js',    'u:dev:MediaWiki:!ban/code.js',    'u:dev:MediaWiki:EmoticonsWindow/code.js',    'u:dev:MediaWiki:Tabinsert.js', 'u:dev:MediaWiki:MobileChat.js' ]});}

/*******************************************************************************
 * END GLOBAL CHAT ADDONS ||||||||||||||||||||||||||||||||