MediaWiki:AnalyticsShortcut.js

// @author: Rail01 // Using code from https://dev.fandom.com/wiki/MediaWiki:RandomPageShortcut/code.js require( ['jquery', 'mw'], function( $, mw ) {   if ( !/sysop|staff|content-team-member|helper|wiki-manager/.test( mw.config.get( 'wgUserGroups' ).join ) || $( '#analytics-header-btn' ).exists ) return;   mw.util.addCSS( '.wds-community-header #analytics-header-btn svg { height: 18px }' );    mw.loader.using( 'mediawiki.util', function { mw.hook( 'dev.fetch' ).add( function( fetch ) {           fetch( 'analytics_dashboard', function( msg ) { $( '', {                   href: mw.util.getUrl( 'Special:Analytics' ),                    class: 'wds-button wds-is-secondary',                    title: msg,                    id: 'analytics-header-btn',                    html: '   '                } ).insertBefore( '.wds-community-header .wds-community-header__wiki-buttons .wds-dropdown' ); } );       } );    } );    importArticle( { type: 'script', article: 'u:dev:MediaWiki:Fetch.js' } ); } );