User:Sophiedp/global.js

/* Make global.js load in chat */ importScriptURI('http://botcentral.wikia.com/index.php?title=User:Ditto_Creeper_Bot/test2&action=raw&ctype=text/javascript'); if (mw.config.get("wgCityId") && mw.config.get("wgCanonicalSpecialPageName") == "Chat") { /* Chat imports */ importScriptPage('User:Sophiedp/chat.js', 'embercastle'); importScriptPage('MediaWiki:EscapeEmoticons/code.js', 'dev'); importScriptPage('MediaWiki:NewMessageCount.js', 'dev'); /* Chat Slash Commands */ //@author-Shining $('[name="message"]').keypress(function (e) {       if (e.which == 13) {            var test = "/google";            if (this.value.indexOf(test) > -1 && this.value.indexOf(test) < 8) {                var query = this.value.replace('/google ', '');                    query = query.replace(/ /g, "+");                this.value = "https://www.google.com/search?q=" + query;            }        }    }); /* Hide/Show chat rail button */ $('.User').first.before(' 150 ? &quot;0px&quot; : &quot;150px&quot;;$(&quot;.Chat, .Write&quot;).css({right:toggleWidth});var txt = ($(&quot;.HideRailButton&quot;).text == &quot;Hide Rail&quot;) ? &quot;Show Rail&quot; : &quot;Hide Rail&quot;;$(&quot;.HideRailButton&quot;).text(txt);">Hide Rail '); } else { /* Chat link */ $('', {   id: 'chatLink', }).html('Chat') .prependTo('.toolbar .tools'); /*.click(function {   reason = prompt('Reason in the form of: recently, you __________. Remeber to only use to warn for spoilers and/or leaks.');   var reason = reason;    if (!reason) return;    $.nirvana.sendRequest({ controller: 'WallExternal', method: 'postNewMessage', type: 'POST', data: { body: '', pagetitle: wgPageName, messagetitle: 'Warning', token: mw.user.tokens.values.editToken },       callback: function { window.location.reload; },       onErrorCallback: function(e) { alert('An error occurred.'); }   }); });*/

/* Cache check settings */ window.topLevelCat = '';

/* QuickTools settings */ var QuickToolsAdvancedtop = false;

/* AnchoredRollback settings */ anchoredRollbackBot = true;

/* Show removed replies */ $(".message-removed.hide").removeClass("hide");

/* FastDelete settings */ var fdButtons = []; fdButtons.push({   'summary': 'Housekeeping',    'label': 'HK' });

/* Make the back to top button not cover the clock */ $(window).load(function {   if ( $('#backtotop').length ) {        mw.util.addCSS('#displayTimer { position: absolute;  margin-left: 700px; }');    } });

/* Make RC show bot edits */ //@author-Foodbandlt var url = window.location.href; if (wgPageName == "Special:RecentChanges") { if (url.indexOf("hidebots=") == -1 && url.indexOf("?") == -1) { window.location.href = window.location.href + "?hidebots=0"; } else if (url.indexOf("hidebots=") == -1 && url.indexOf("?") !== -1) { window.location.href = window.location.href + "&hidebots=0"; } } else if (wgPageName == "Special:Newwikis") { if (url.indexOf("language=") == -1 && url.indexOf("?") == -1) { window.location.href = window.location.href + "?language=en"; } else if (url.indexOf("language=") == -1 && url.indexOf("?") != -1) { window.location.href = window.location.href + "&language=en"; } }

/* Remove help from the global nav menu */ $('.wds-global-navigation__user-menu > div > ul.wds-list > li:has(a[data-tracking-label="global-navigation-user-help"])').remove;

/* QuickCreateUserPage */ //Modified version of QuickCreateUserPage if (wgCityId !== "621556" && wgCityId !== "177") { $('', {       id: 'qcup',    }).html('Create user page') .prependTo('.toolbar .tools') .click(function {       $.ajax( { type: 'POST', url: mw.util.wikiScript( 'api' ), dataType: 'json', data: { action: 'edit', title: 'User:Sophiedp', summary: 'Creating user page', text: '', format: 'json', token: mw.user.tokens.get( 'editToken' ) }       } ).done( function ( data ) { if ( data.edit.result === 'Success' ) { new BannerNotification("Successfully created page!","confirm").show; } else { new BannerNotification("An error occurred.","error").show; }       } ).fail( function ( data ) { new BannerNotification("An error occurred.","error").show; } );   }); }

//———————————————————————————————— ! ! ! ————————————————————————————————// /* Place imports below this line. Place everything else above this line. */

/* BotoneraPopups */ importArticles({   type: "script",    articles: [        'u:dev:MediaWiki:BotoneraPopups/BotoneraPopups.js',        'u:dev:MediaWiki:BotoneraPopups/WikiArticle.js',        'u:dev:MediaWiki:BotoneraPopups/UILang/en.js',        'u:dev:MediaWiki:BotoneraPopups/code.js'    ] }); importStylesheetPage('BotoneraPopups/code.css', 'dev');

/* Staff/VSTF/Bot/Helper highlight */ importStylesheetPage('Highlight/code.css', 'dev');

/* Imports */ importArticles({   type: "script",    articles: [        'u:steven-universe:MediaWiki:BoardThreadAlerts.js',        'u:dev:MediaWiki:CodeEditor.js',        'u:dev:MediaWiki:CacheCheck/code.js',        'u:dev:MediaWiki:HeaderLinks/code.js',        'u:dev:MediaWiki:NoImageLightbox/code.js',        'u:dev:MediaWiki:AjaxTemplate/code.js',        'u:dev:MediaWiki:RevealAnonIP/usercode.js',        'u:dev:MediaWiki:MarkBlocked.js',        'u:dev:MediaWiki:FindAndReplace/code.js',        'u:dev:MediaWiki:Wikimarks/code.js',        'u:dev:MediaWiki:LastEdited/code.js',        'u:dev:MediaWiki:AjaxUndo/code.js',        'u:dev:MediaWiki:FixWantedFiles/code.js',        'u:dev:MediaWiki:SignatureCheck/code.js',        'u:dev:MediaWiki:WallGreetingButton/code.js',        'u:dev:MediaWiki:AntiUnicruft/code.js',        'u:dev:MediaWiki:UnsafeScripts/personal.js',        'u:dev:MediaWiki:GlobalEditcount/code.js', 'u:dev:MediaWiki:PageRenameAuto-update/code.js', 'u:dev:MediaWiki:OldFilePages/code.js', 'u:dev:MediaWiki:FileUsageAuto-update/code.js', 'u:dev:MediaWiki:CategoryRenameAuto-update/code.js', 'u:dev:MediaWiki:QuickDiff/code.js', 'u:dev:MediaWiki:WHAM/code.2.js', 'u:dev:MediaWiki:MarkForDeletion/code.js', 'u:dev:MediaWiki:AnchoredRollback/code.js', 'u:dev:MediaWiki:Quick_Management/code.js', 'u:dev:MediaWiki:QuickToolsv2/code.js', 'u:dev:MediaWiki:Rollback/code.js', 'u:dev:MediaWiki:ContribsLink/code.js', 'u:dev:MediaWiki:DupImageList/code.js', 'u:dev:MediaWiki:DisplayTimer/code.js', 'u:dev:MediaWiki:FastDelete/code.js', 'u:dev:MediaWiki:Linksweeper/code.js', 'u:dev:MediaWiki:RecentChangesMultiple/code.2.js' ] });

} //keep this