User:Transapient/pronouns.js

//code originally from https://en.wikipedia.org/w/index.php?title=User:Wumbolo/pronouns.js //moved the location of the pronouns from the body of the userpage to its title (function($, mw) {   'use strict';

var wgPageName = mw.config.get('wgPageName'); var wgUserName = mw.config.get('wgUserName'); var wgNamespaceNumber = mw.config.get('wgNamespaceNumber'); var wgPageNameSlashPos = wgPageName.indexOf("/");

if (wgNamespaceNumber === 2 || wgNamespaceNumber === 3) { $.getJSON(               mw.util.wikiScript('api'), {                    action: "expandtemplates",                    format: "json",                    text: "",                    prop: "wikitext"                }            ).done(function(data) {                $('#firstHeading').append(' (' + data.expandtemplates.wikitext + ') ');            }) .fail(function(data) {               return;            }); } })(jQuery, mediaWiki);