Page MenuHomePhabricator

Add a gadget to Wikidata so that behind every linked Q also the Q itself is shown
Open, Needs TriagePublic

Description

Can someone create and add a gadget to Wikidata so that behind every linked Q on items also the Q number itself is shown, as well as behind the Property link the P number, and also for Lexemes.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

For a very basic version, you could add the following to your common.js:

mw.hook('wikibase.entityPage.entityView.rendered').add(function () {
$(".wikibase-entityview-main a").each(function(){ var a=this.href; var m=a.match(/[\/:]([PQL][0-9]+(#[SF][0-9]+)?)$/); if (m && m[1]) { $(this).after(" <small>("+m[1]+")</small>"); } });
});

It'll only work on page load, I can't make it work for new or edited statements until T250070 is fixed.