Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
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.
/*To add this to ANY Wikipedia, addmw.loader.load("//en.wikipedia.org/w/index.php?title=User:Magnus Manske/autodesc.js&action=raw&ctype=text/javascript");to your common.js user page, or to your global.js page (for all Wikis):https://meta.wikimedia.org/wiki/Special:MyPage/global.jsTo enable it on Wikidata as well, addvar autodesc_on_wikidata = true ;BEFORE the mw.loader.load line.*/$(document).ready(function(){if(mw.config.get('wgNamespaceNumber')!=0)return;// Article namespace onlyif(mw.config.get('wgDBname')=='wikidatawiki'&&typeofautodesc_on_wikidata=='undefined')return;// Not on Wikidata, duh!varq=mw.config.get('wgWikibaseItemId');if(q===null&&mw.config.get('wgDBname')=='wikidatawiki')q=mw.config.get('wgTitle');if(typeofq=='undefined'||q===''||q===null)return;$.getJSON('https://tools.wmflabs.org/autodesc/?callback=?',{q:q,lang:mw.config.get('wgUserLanguage'),mode:'short',links:'wikipedia',format:'json'},function(d){$('#siteSub').show().append(': <div style="display:inline">'+d.result+' <small>[<a href="//www.wikidata.org/wiki/'+q+'">'+q+'</a>]</small></div>')})});