User:Sophiedp/global.js

/* Alert if global.js loads in chat */ if ( wgCanonicalSpecialPageName == 'Chat' ) { alert('Global.js is loaded in chat!'); }

/* MarkForDeletion */ if (!wgUserGroups.includes('sysop')) { importScriptPage('MediaWiki:MarkForDeletion/code.js', 'dev'); }

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

/* 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"; } }

/* 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. */

/* Imports */ //$(window).load(function {   importArticles({ type: "script", articles: [ 'u:dev:MediaWiki:CacheCheck/code.js', 'u:dev:MediaWiki:NoImageLightbox/code.js', 'u:dev:MediaWiki:Wikimarks/code.js', 'u:dev:MediaWiki:LastEdited/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' ]   }); //});