MediaWiki:ChatUserPageButton.js

//ChatUserPageButton- Count of Howard //3-10-16 - Initial revision if (mw.config.get("wgCanonicalSpecialPageName") !== "Chat") { return; } $.each(['show', 'hide'], function (i, ev) {    var el = $.fn[ev];    $.fn[ev] = function  {      this.trigger(ev);      el.apply(this, arguments);      return el;    };  }); $('#UserStatsMenu').on('show', function {   var username = $("#UserStatsMenu .info ul").children(".username").text.replace(/ /g,"_");    var address = mw.config.get('wgServer') + mw.config.get('wgArticlePath').replace( "$1", "User:" + username);    //Adapted from ChatBlockButton - Ozuzanna    mw.util.addCSS('.UserStatsMenu .actions ul li.userpage .icon { background-position: -552px 0px}');    var userPageButton = $('.talk-page').clone.addClass('userpage').removeClass('talk-page');    $(this).children('.actions').children('.regular-actions').prepend( userPageButton );   $(".userpage a").attr("target", "_blank");    $(".userpage a").attr("href", address);    $('.userpage .label').text('User Page');  }); }) (this.jQuery, this.mediaWiki);
 * (function($, mw) {