/*This script display automated item descriptions in search results on Wikidata.org.
DEV WARNING: The code hosted here also runs OUTSIDE of mediawiki scopes on toollabs.Thus if you need something from the MediaWiki context, wrap your code in a checkfor the wd_auto_desc.mediawiki boolean.
USERS:
Add this to https://www.wikidata.org/wiki/Special:MyPage/common.js:
mw.loader.load("//en.wikipedia.org/w/index.php?title=MediaWiki:Wdsearch-autodesc.js&action=raw&ctype=text/javascript");
On Wikidata, to always show the automatic description, even if there is a manual one, add the following line to your common.js page:
wd_auto_desc_wd_always_show = true ;
// PROGRAMMER ACCESS// Get a single item label
wd_auto_desc.labelItem ("Q123", function (label)) ;
// Get a description
wd_auto_desc.loadItem ("Q123",) ;
// ON WIKIDATA :
To load, but not run automatically, set
var prevent_wd_auto_desc = 1 ;
BEFORE including the script
var wd_auto_desc = ;
wd_auto_desc.init ;
var wd_auto_desc_wd = ;
if (typeof mw !