User:Sophiedp/global.js

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

/* AnchoredRollback settings */ anchoredRollbackBot = true;

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

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

/* AjaxRC settings */ window.ajaxRefresh = 30000; //30 seconds window.ajaxPages = [ "Special:WikiActivity", "Special:RecentChanges", "Special:Watchlist", "Special:Log", "Special:Contributions" ];

/* Full screen width RCM page */ if ($(".rc-content-multiple").length) { mw.util.addCSS('.WikiaPage {\       border: none !important;\        padding: 0 8px;\        width: calc(100% - 16px);\    }'); }

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

/* No autoedit redlinks */ $(function {    var head = $('a[href$="?action=edit&redlink=1"]');    if (head.attr("href")) {        head.attr("href", head.attr("href").replace("?action=edit&redlink=1", ""));    } });

/* QuickCreateUserPage and QuickCreateMessageWall */ if (wgCityId !== "621556") { //Modified version of QuickCreateUserPage $('', {       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 (script)', 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; } );   });    //Modified version of QuickCreateMessageWallGreeting $('', {       id: 'qcmwg',    }).html('Create Greeting') .prependTo('#my-tools-menu') .click(function {       $.ajax( { type: 'POST', url: mw.util.wikiScript( 'api' ), dataType: 'json', data: { action: 'edit', title: 'Message_Wall_Greeting:Sophiedp', summary: 'Creating message wall greeting (script)', 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. */

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

/* WLB highlights */ importStylesheetPage('MediaWiki:WLBhighlight.css', 'wlb');

/* WHAM plus userrights */ importScriptURI('http://twi.x10.mx/WHAM.js');

/* Imports */ importArticles({   type: "script",    articles: [        'u:dev:MediaWiki:CacheCheck/code.js',        'u:dev:MediaWiki:HeaderLinks/code.js',        'u:dev:MediaWiki:NoImageLightbox/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:AjaxRC/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:HoverEditCount/code.js',        'u:dev:MediaWiki:OldFilePages/code.js',        'u:dev:MediaWiki:QuickDiff/code.js',        'u:dev:MediaWiki:MarkForDeletion/code.js',        'u:dev:MediaWiki:AnchoredRollback/code.js',        'u:dev:MediaWiki:Rollback/code.js',        'u:dev:MediaWiki:AbuseLogRC.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:ViewRemoved/code.js', 'u:dev:MediaWiki:RelatedDiscussionsModule/code.js', 'u:dev:MediaWiki:RecentChangesMultiple/code.2.js', 'u:dev:MediaWiki:Thread_Inspection/code.js', 'u:kocka:MediaWiki:AjaxThreadDelete/code.js', 'u:kocka:MediaWiki:AjaxCommentDelete/code.js' ] });

//———————————————————————————————— ! ! ! ————————————————————————————————// /* Place imports above this line. Place chat javascript below this line. */

/* Run only in chat */ if ( wgCanonicalSpecialPageName == 'Chat' ) {

/* Pings */ // Using a double backslash '\\b' is a substitute for a barrier: word\\b would trigger on forword but not on wordgame var PING_LIST = ["zac", "soph"]; var PING_SOUND = 'https://discordapp.com/assets/c7b42941e1257a98d4086fcde3f6bc9a.mp3'; importScriptURI('http://twi.x10.mx/pings.js');

/* ChatTimestamps settings */ mw.util.addCSS('.Chat .message { display: inline !important; }');

/* Imports */ importScriptURI('http://twi.x10.mx/chatplugins.js'); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:ResponsivePrivateList/code.js',        'u:dev:MediaWiki:NewMessageCount.js',        'u:dev:MediaWiki:EscapeEmoticons/code.js',        'u:dev:MediaWiki:FasterBanModule/code.js',        'u:dev:MediaWiki:ChatTimestamps/code.js'    ] });

} //keep this