User:JustLeafy/global.js

//__NOWYSIWYG__ /* Imports */ importArticles({   type: 'script',    articles: [        'u:dev:AjaxDelete/code.js',        'u:dev:AjaxUndo/code.js',        'u:dev:BlogLink/code.js',        'u:dev:CommentPreview/code.js',        'u:dev:ConsistentModules/code.js',        'u:dev:ConsistentNotifications.js',        'u:dev:EditBio/code.js',        'u:dev:EditConflictAlert/code.js',        'u:dev:FANSUN/code.js',        'u:dev:FindAndReplace/code.js',        'u:dev:HistoryKey.js',        'u:dev:GalleryCaptions/code.js',        'u:dev:ManageReferences/code.js',        'u:dev:MediaWiki:MassEdit/code.js',        'u:dev:MassRename/code.js',        'u:dev:MediaWiki:FANSUN.js',        'u:dev:MediaWiki:ModernLightbox.js',        'u:dev:ModernProfile/EditButton.js',        'u:dev:Nuke/code.js',        'u:dev:PurgeButton/code.js',        'u:dev:QQX/code.js',        'u:dev:RandomPageShortcut/code.js',        'u:dev:RedirectManagement/code.js', 'u:dev:RevealAnonIP/code.js', 'u:dev:SandboxTab/code.js', 'u:dev:SeeMoreActivityButton/code.js', 'u:dev:Sine/code.js', 'u:dev:UserActivityTab/code.js', 'u:dev:View Source/code.js', 'u:dev:VSTFReport.js', 'u:dev:WallGreetingButton/code.js' ] });

//SandboxLink /* Add a menu item to profile menu with link to user contributions in modernized UI */ $(function {    var $userContribs = $('')        .attr('id', 'MySandbox')        .append( $('') .attr('href', '/wiki/User:' + wgUserName + '/Sandbox') .addClass('wds-global-navigation__dropdown-link') .text('My Sandbox') );               //Add menu item, after Message Wall link, if it exists    $('.wds-global-navigation__user-menu li').has('a[data-tracking-label="account.message-wall"]')        .after($userContribs);    //Add menu item, after My Talk link, if it exists    $('.wds-global-navigation__user-menu li').has('a[data-tracking-label="account.talk"]')        .after($userContribs); });

//RemoveBlueOutline /* It basically removes unnecessary blue outlines except when tabbing */ function handleFirstTab(e) { if (e.keyCode === 9) { // the "I am a keyboard user" key document.body.classList.add('user-is-tabbing'); window.removeEventListener('keydown', handleFirstTab); } }

window.addEventListener('keydown', handleFirstTab);