User:WooperIsBest/common.js/archive

/* * Script: MorePageActions * Author: WooperIsBest * * A simple script that creates certain actions next to the "edit" button. * Current actions: * What Links Here * Logs * Purge * Additional Information: * You can customize the button's CSS with your personal CSS. The ID for each is listed on the dev wiki.

'use strict'; var ddm = document.getElementsByClassName('wds-dropdown__content wds-is-not-scrollable wds-is-right-aligned'); //gets dropdown menu(s)
 * (function (window, $, mw) {

var currentPage = window.location.pathname; //gets URL var slicedURL = currentPage.slice(6); //remove /wiki/ from URL

/*$( 'What Links Here' ).appendTo(ddm[1]); //what links here $( 'Logs').appendTo(ddm[1]); //logs $( 'Purge</ul>').appendTo(ddm[1]); //purge $( '<a id="ca-subpages" href="/wiki/Special:PrefixIndex/' + slicedURL + '">View Subpages</a></li>' ).appendTo(ddm[1]); //what links here */   $( '' ).attr('href', 'https://' + window.location.hostname + '/User:' +  mw.config.get('wgUserName') + '/MorePageActionsConfig').appendTo(ddm[1]); //window.alert(window.location.hostname + '/User:' + mw.config.get('wgUserName') + '/MorePageActionsConfig'); //"Output" thing }(this, this.jQuery, this.mediaWiki));