MediaWiki:ModernProfile/EditButton.js

$(function {   if(mw.config.get("wgNamespaceNumber") == 2 & $(".UserProfileActionButton").length & $(".masthead-info hgroup").length) {        var actions = mw.config.get("wgWikiaPageActions");        var curAction;        $('.UserProfileActionButton').remove;        if(actions) {            importArticle({type: 'style', article: 'u:dev:MediaWiki:ModernProfile/EditButtons.css'});            var button = ' ';            curAction = actions.filter(function(action){return action.id === "page:Edit"})[0];            if(curAction) button += '  '+curAction.caption+' '; else return; button += '  '; curAction = actions.filter(function(action){return action.id === "page:History"})[0]; if(curAction) button += ''+curAction.caption+''; curAction = actions.filter(function(action){return action.id === "page:Move"})[0]; if(curAction) button += ''+curAction.caption+'</a></li>'; curAction = actions.filter(function(action){return action.id === "page:Protect"})[0]; if(curAction) button += '<a id="ca-protect" href="'+curAction.href+'" data-tracking="ca-protect-dropdown">'+curAction.caption+'</a></li>'; curAction = actions.filter(function(action){return action.id === "page:Delete"})[0]; if(curAction) button += '<a id="ca-delete" href="'+curAction.href+'" data-tracking="ca-delete-dropdown">'+curAction.caption+'</a></li>'; button += '</ul>  '; $(button).appendTo(".masthead-info hgroup").css({float: "right"}); }   } });