Jump to content

User:PAC2/GenderDiversity.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
mw.loader.using('mediawiki.util', function () { 

if (mw.config.get('wgNamespaceNumber') == 0) {

var curServer = mwConfigV.wgServerName;

var gendercount = 
"https://observablehq.com/@pac02/explore-gender-diversity-in-a-single-wikipedia-article?wikipedia="  +  curServer +"&article=" + encodeURIComponent(mw.config.get( 'wgPageName' )) ;

var bodyElm = document.getElementsByClassName("mw-body-header");

if(bodyElm.length != 0) {
		$(bodyElm[0]).append(gendercount);
	} 

} 

});