User:Ursuul/AnalyticsToolbar.js

(function {    var config = mw.config.get([ 'wgUserGroups', 'wgFormattedNamespaces' ]);   if ( !/sysop|staff|content-team-member|helper|wiki-manager/.test(config.wgUserGroups.join) || window.AnalyticsLinkLoaded ) {       return;    }    window.AnalyticsLinkLoaded = true;    var analytics = config.wgFormattedNamespaces[-1] + ':Analytics';

mw.hook('dev.fetch').add(function(fetch) {       fetch('admindashboard-control-analytics-label|analytics_dashboard', function(msg) { $('').append(               $('', { 'href': mw.util.getUrl(analytics), 'title': msg('analytics_dashboard'), 'text': msg('admindashboard-control-analytics-label'), 'id': 'custom-analyticslink' })           ).insertAfter('.toolbar .mytools + li'); });   });

importArticle({       type: 'script',        article: 'u:dev:Fetch.js'    }); });