MediaWiki:EditcountTab.js

/** * Name:       EditcountTab * Version:    v1.0 * Author:     KockaAdmiralac <1405223@gmail.com> * Description: Adds a tab to user profile pages linking to their *             edit count. */ (function {   if (window.EditcountTab || !$('#WikiaUserPagesHeader').exists) {        return;    }    mw.loader.using([ 'mediawiki.api', 'mediawiki.util' ]).then(function { return new mw.Api.get({           action: 'query',            meta: 'allmessages',            ammessages: 'editcount',            amlang: mw.config.get('wgUserLanguage')        }); }).then(function(d) { var text = d.query.allmessages[0]['*']; $('#WikiaUserPagesHeader .tabs-container .tabs').append(           $('', { 'data-id': 'editcount', id: 'editcount-tab' }).append( $('', {                   href: mw.util.getUrl('Special:Editcount/' + $('#UserProfileMasthead h1').text),                    title: text,                    text: text                }) )       );    }); });