User:Nicko756/global.js

AjaxRCRefreshText = 'Auto-refresh'; AjaxRCRefreshHoverText = 'Auto-refreshes the page.'; ajaxPages = ["Special:RecentChanges", "Special:WikiActivity"];

var qtUserPageTemplate = ''; var qtMessageWallGreetingTemplate = '';

var MultiUploadoption = { max: 50 };

var QuickToolsAdvancedtop = false;

massProtectDelay = 1000; importScriptPage('MassProtect/code.js', 'dev');

importArticles( {   type: 'script',    articles: [        "u:dev:ChatOptions/code.js",    ] } ); /* ChatPlugins */ var ChatPlugins = { release: { version: 1.1, branch: "Stable" }, models: { feature: function(id, name, access, script) { this.enabled = false; this.id = id; this.name = name; this.access = access; this.script = script; }, alert: function(text) { newInlineAlert = new models.InlineAlert; newInlineAlert.attributes.text = text; mainRoom.model.chats.add(newInlineAlert); }, command: function(command, script) { this.command = command; this.script = script; } }, features: {}, settings: { release: { version: 1.0, branch: "Stable" }, icons: { staffIcon: "http://img1.wikia.nocookie.net/__cb20140626173406/gamedezyner/images/6/60/StaffIcon.png", modIcon: "http://img1.wikia.nocookie.net/__cb20140626173343/gamedezyner/images/8/89/ModIcon.png" }, sounds: { pingSound: "https://notificationsounds.com/soundfiles/9461cce28ebe3e76fb4b931c35a169b0/file-sounds-1044-inquisitiveness.mp3" }, features: { pings: true } }, save: function { ChatPlugins.settings.features.pings = ChatPlugins.features.pings.enabled; api.functions.editPage("User:" + wgUserName + "/ChatPlugins.js", JSON.stringify(ChatPlugins.settings)); }, load: function { new ChatPlugins.models.alert("Welcome to Chat Plugins 1.0!"); pagecontents = api.functions.getPageContents("User:" + wgUserName + "/ChatPlugins.js"); if (pagecontents == "error") { new ChatPlugins.models.alert("There seems to be something wrong with your settings file, or it doesn't exist yet. Default settings have been saved."); ChatPlugins.save; } else { ChatPlugins.settings = JSON.parse(pagecontents); ChatPlugins.features.pings.enabled = ChatPlugins.settings.features.pings; ChatPlugins.features.pings.words = ChatPlugins.settings.pings; } pagecontents = api.functions.getPageContents("MediaWiki:ChatPluginsSettings.js"); if (pagecontents != "error") { wikicustom = JSON.parse(pagecontents); if (typeof(wikicustom.settings) != "object") { new ChatPlugins.models.alert("This wiki has a custom settings page, but it is broken."); } else { ChatPlugins.settings.icons = wikicustom.settings.icons; //Load Wiki-specific icons ChatPlugins.settings.sounds = wikicustom.settings.sounds; //Load Wiki-specific sounds new ChatPlugins.models.alert("This wiki has custom settings and they have been applied."); } } } }; // Call API function callAPI(data, method, callback) { data.format = 'json'; $.ajax({ data: data, dataType: 'json', url: wgScriptPath + '/api.php', type: method, success: function(response) { if (response.error) showError('API error: ' + response.error.info); else callback(response); }, error: function(xhr, error) { showError('AJAX error: ' + error); } }); } //Inline-mod tools function scrollToBottom { var chat = document.getElementById('Chat_' + mainRoom.roomId); chat.scrollTop = chat.scrollHeight; } ChatPlugins.features.modIcons = new ChatPlugins.models.feature(null, "Mod Icons", 0, function(chat) { var time = new Date; var hours = time.getHours; var minutes = time.getMinutes; var seconds = time.getSeconds; if ( hours < 10) hours = '0' + hours; if (minutes < 10) minutes = "0" + minutes; if (seconds < 10) seconds = "0" + seconds; mainRoom.viewDiscussion.chatUL.children.last.children(".message").attr('msg-source', chat.attributes.text); mainRoom.viewDiscussion.chatUL.children.last.children(".message").attr('msg-time', hours + ':' + minutes + ':' + seconds); var icon = ; mainRoom.viewDiscussion.chatUL.children.last.children('.message').hover( function { thistarget = this; username = $(thistarget).parent.attr("data-user"); timestamp = $(thistarget).attr('msg-time'); message = $(thistarget).attr('msg-source'); $(thistarget).append(' Quote '); $(thistarget).children('.inline-quote').click(function(e) { if ( e.shiftKey ) { $('.message textarea').val($('.message textarea').val + '[' + timestamp + '] ' + username + ": " + message.replace(/^\/me/, "* " + username) + '\n'); } else { $('.message textarea').val('[' + timestamp + '] ' + username + ": " + message.replace(/^\/me/, "* " + username) + '\n'); scrollToBottom; } $(".message textarea").focus; }); }, function { $(this).children('.inline-quote').remove; } ); } ); //Bind function to chat updates setTimeout(function { mainRoom.model.chats.bind('afteradd', ChatPlugins.features.modIcons.script, mainRoom.viewDiscussion); }, 15000);

importScriptPage('AutoEditDropdown/code.js', 'dev'); importScriptPage('ChatBlockButton/code.js', 'dev'); importScriptPage('DisplayClock/code.js', 'dev'); importScriptPage('MediaWiki:Rollback/code.js', 'dev'); importScriptPage('MediaWiki:Nuke/code.js', 'dev'); importScriptPage('MultipleFileDelete/code.js', 'dev'); importScriptPage('MultiUpload/code.js', 'dev'); importScriptPage('QuickTools/code.js', 'dev'); importScriptPage('QuickComments/advanced.js', 'dev'); importScriptPage('RevealAnonIP/code.js', 'dev'); importScriptPage('SkinSwitchButton/code.js', 'dev'); importScriptPage('ViewRemoved/code.js', 'dev'); importScriptPage('View_Source/code.js', 'dev');

WHAMDelay = 100; importScriptPage('WHAM/code.2.js', 'dev');

importArticles({   type: 'script',    articles: [        'u:callofduty:User:Madnessfan34537/redlinkfix.js',        'u:dev:AjaxBatchUndelete/code.js',        'u:dev:AjaxRC/code.js',        'u:dev:AjaxRedirect/code.js',        'u:dev:AjaxEmoticons/code.js',        'u:dev:AjaxPatrol/code.js',        'u:dev:AjaxUndo/code.js',        'u:dev:AnchoredRollback/code.js',        'u:dev:BackToTopButton/code.js',        'u:dev:CatNav/code.js',        'u:dev:CleanWantedFiles/code.js',        'u:dev:FasterBanModule/code.js',        'u:dev:HeaderLinks/code.js',        'u:dev:LastEdited/code.js',        'u:dev:ListFiles/code.js',        'u:dev:MassCategorization/code.js',        'u:dev:Message/code.js',        'u:dev:MiniComplete/code.js',        'u:dev:MonobookHighlight.js',        'u:dev:NullEditButton/code.js',        'u:dev:PageMakerPro/code.js',        'u:dev:PortableCSSPad/code.js',        'u:dev:QQX/code.js', 'u:dev:QuickCreateMessageWallGreeting/code.js', 'u:dev:QuickCreateUserPage/code.js', 'u:dev:QuickLogs/code.js', 'u:dev:Quick_Management/code.js', 'u:dev:QuickToolsv2/code.js', 'u:dev:RedirectManagement/code.js', 'u:dev:RelocateEditDiscussionButtons/code.js', 'u:dev:ReplyBottom/code.js', 'u:dev:SearchButtonV2/code.js', 'u:dev:SearchSuggest/code.js', 'u:dev:SpellCheckModule/code.js', 'u:dev:UserTalkNotifications/code.js', 'u:dev:WallGreetingButton/code.js', 'u:kocka:MediaWiki:AjaxCommentDelete/code.js', 'u:kocka:MediaWiki:AjaxThreadDelete/code.js', ] });

importArticles({   type: "script",    articles: [          "u:dev:CategoryRenameAuto-update/code.js",        "u:dev:DynamicImages/code.js",        "u:dev:MediaWiki:AjaxDelete/code.js",        "u:dev:PurgeBlogs/code.js",    ] });

importArticles({   type: 'script',    articles: [        'u:dev:Wikimarks/code.js'    ] });

/* Auto-categorizes images to Category:Images */ if (mw.config.get('wgCanonicalSpecialPageName') === 'MultipleUpload' || mw.config.get('wgCanonicalSpecialPageName') === 'Upload') { if (!$.getUrlVar('wpForReUpload') && !$('#wpUploadDescription').val) { jQuery(function ($) {           'use strict';            $('#wpUploadDescription').val('');        }); } }

/* Make Visual Editor links load the regular editor instead */ if ($.getUrlVar('veaction') == 'edit') location.replace(document.URL.replace('veaction','action')); /* PM Button */ if(wgCanonicalSpecialPageName == 'Chat') { function createGroupPM { var users = prompt('Enter comma seperated list of users to start a PM with',''); var users = users.split(','); mainRoom.openPrivateChat(users); } $('form#Write').append('PM'); }

/* Add powerusers checkbox to Special:ListUsers - Credit to User:452 */ if (wgCanonicalSpecialPageName == "ListUsers") $("fieldset.lu_fieldset tr:last-child").prepend('  Power Users ');

/* Makes edit count on user page link to Special:Editcount - Credit to User:452 */ if ($("#UserProfileMasthead").size) $("#UserProfileMasthead .tally em").wrap($("").attr("href", "/Special:Editcount/"+$("#UserProfileMasthead h1[itemprop=name]").html));

/* Add buttons to dropdown */ $(function { $('Edit count').insertBefore('.AccountNavigation .subnav li:first');  $('Contributions').insertBefore('.AccountNavigation .subnav li:first');  $('<a href="/wiki/Special:WikiActivity">Wiki Activity</a></li>').insertBefore('.AccountNavigation .subnav li:first'); });

/* Custom edit buttons */ if (wgAction == "edit" || wgAction == "publish") { if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://vignette2.wikia.nocookie.net/callofduty/images/e/e5/Center_button.png", "speedTip": "Center", "tagOpen": " ", "tagClose": " ", "sampleText": "" };       mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://vignette2.wikia.nocookie.net/callofduty/images/4/4d/Sup_button.png", "speedTip": "Sup", "tagOpen": " ", "tagClose": " ", "sampleText": "" };       mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://vignette3.wikia.nocookie.net/callofduty/images/9/9d/Sub_button.png", "speedTip": "Sub", "tagOpen": " ", "tagClose": " ", "sampleText": "" };       mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://vignette3.wikia.nocookie.net/callofduty/images/5/5c/Noinclude_button.png", "speedTip": "Noinclude", "tagOpen": " ", "tagClose": " ", "sampleText": "" };       mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://vignette1.wikia.nocookie.net/callofduty/images/8/85/Ref_button.png", "speedTip": "Ref", "tagOpen": " ", "sampleText": "" };       mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/c/c8/Button_redirect.png", "speedTip": "Redirect", "tagOpen": "#REDIRECT",           "tagClose": "", "sampleText": "PAGE" };       mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://vignette3.wikia.nocookie.net/central/images/4/4b/Button_nbsp.png", "speedTip": " ", "tagOpen": " ", "tagClose": "", "sampleText": "" };       mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://vignette3.wikia.nocookie.net/callofduty/images/7/70/Support_button.png", "speedTip": "Support", "tagOpen": "*", "tagClose": " " + "~", "sampleText": "" };       mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://vignette2.wikia.nocookie.net/callofduty/images/f/f5/Neutral_button.png", "speedTip": "Neutral", "tagOpen": "*", "tagClose": " " + "~", "sampleText": "" };       mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://vignette2.wikia.nocookie.net/callofduty/images/a/a3/Oppose_button.png", "speedTip": "Oppose", "tagOpen": "*", "tagClose": " " + "~", "sampleText": "" };       mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://vignette4.wikia.nocookie.net/central/images/5/55/Dash.png/revision/latest?cb=20160424012955", "speedTip": "Dash", "tagOpen": "-", "tagClose": "", "sampleText": "" };   } }