MediaWiki talk:Wdsearch-autodesc.js: Difference between revisions
Content deleted Content added
m WP:SIGNT |
SPage (WMF) (talk | contribs) →usage is unclear: new section |
||
Line 53:
[[User:Sjoerddebruin|<font face="Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif" color="#325186">'''Sjoerd de Bruin'''</font>]] [[User talk:Sjoerddebruin|<font face="Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif" color="#325186"><small>(talk)</small></font>]] 20:18, 8 January 2015 (UTC)
:[[File:Yes check.svg|20px|link=]] '''Done'''<!-- Template:EP --> Thanks for the update! — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 20:33, 8 January 2015 (UTC)
== usage is unclear ==
I think this is amazing, but it needs better explanation. Is there some page that explains it?
1. It appears to only does something on https://www.wikidata.org, right? So the comment should say "To add this to your common.js page on wikidata.org:"
Also in the code
<source lang=php>
if (typeof mw !== 'undefined' && typeof prevent_wd_auto_desc === 'undefined' ) { // On Wikidata
$(document).ready( function() {
if ( mw.config.get('wgSiteName') != 'Wikidata' ) return ;
...
</source>
The comment <source lang=php inline> // On Wikidata</source> is on the wrong line, it should be after the test for <code>wgSiteName</code>.
2. Why is the script hosted on {{SERVERNAME}} when it only works on wikidata.org?
3. It looks like this script started out matching [https://bitbucket.org/magnusmanske/autodesc/src/HEAD/www/js/short_autodesc.js?at=master Magnus Manske's AutoDesc] code, but there's no mention of this in comments except the vague "The code hosted here also runs OUTSIDE of mediawiki scopes". Also the JavaScript on-wiki has drifted from the JS in that project.
4. It's unclear what it does on Wikidata. How do I know it's working? Even if I set <code>wd_auto_desc_wd_always_show = true;</code> in my common.js on Wikidata before this script, I never see its generated wikidata auto-description. I can invoke <code>loadItem()</code> by hand by pasting the following into the browser's developer tools JavaScript console:<source lang=javascript>
wd_auto_desc.loadItem ( "Q2045965" , { callback: function ( q , html , opt ) {
console.log( "AutoDesc for " + q + " item=" + html );
} } ) ;
</source>
and then it displays teh AutoDesc awesomeness:
: "AutoDesc for Q2045965 item=Indian author and autobiographer (*1940); Padma Shri and Sahitya Akademi Award; spouse of Surinder Singh ♀"
I'm not sure where this description is supposed to appear on the Wikidata page [[d:Q2045965]].
Thanks for any elucidation, and maybe someone with rights can add comments to the script clarifying these. -- [[User:SPage (WMF)|SPage (WMF)]] ([[User talk:SPage (WMF)|talk]]) 21:01, 20 August 2015 (UTC)
|