MediaWiki:TallyLink/code.js

/** * TallyLink.js * @file Changes edit tally link address to Special:Editcount or custom link * @author Count of Howard  * @license Apache-2.0 * @external "jQuery" */

/*jslint browser */ /*global mw, jQuery, window */

jQuery(document).ready(function {    "use strict";

var $conf = mw.config.get([       "wgArticlePath",        "skin"    ]);

if (       jQuery.inArray($conf.skin, ["oasis", "wikia"]) === -1 ||        !jQuery("#WikiaUserPagesHeader").exists    ) { return; }

var $userName = jQuery(".UserProfileMasthead .masthead-info h1").text; var $newAddress = window.customTallyLink || "Special:Editcount/User:" + $userName;

jQuery(".UserProfileMasthead .contributions-details a") .attr("href", $conf.wgArticlePath.replace("$1", $newAddress));

});