MediaWiki talk:Wdsearch.js

See screenshot at right. See more info via Magnus and Gerard.

On en.wikipedia, add the following lines to your common.js page:
 * USAGE:

On other Wikipedias, add these lines, instead:

Please update Venetian translation. Thanks!
Please update Venetian translation. Thanks! --Fierodelveneto (talk) 08:20, 25 June 2020 (UTC)
 * hello, sorry if I ping you. Could you add this translation? We would really need it. Thank you very much and I apologize again. --Fierodelveneto (talk) 11:26, 2 July 2020 (UTC)
 * Set the request answered to n since I cannot update this page. It is a Javascript page which means it needs an interface administrator. If someone does not come to fix it in the next week or so, post there at the linked place. --Izno (talk) 14:09, 2 July 2020 (UTC)
 * ✅ 'vec' added. — xaosflux  Talk 16:06, 2 July 2020 (UTC)

Turkish translation
Thanks. -- ToprakM &thinsp;✉ 11:28, 22 July 2020 (UTC)
 * ✅ this has been added. —  xaosflux  Talk 13:43, 22 July 2020 (UTC)

Edit request: code fix
[ This change] fixed some JavaScript errors, but is not efficient as it examinates the attributes of all elements of the page…

(Actually, that code should not even be working, because the  part got included in the looked up ID value…)

I would recommend to undo the above linked change, and instead apply the following code, which makes use of :

Ping Jon (WMF).

Od1n (talk) 20:08, 25 October 2023 (UTC)
 * As far as I know, selectors are matched from right to left, so to make the it really efficient, we should force matching from left to right. And that could even overcome the escaping problem in a natural way:  (assuming that   always exists and always contains a single  —I’m just making assumptions because the code is really hard to read with one-character variable names and no documentation comments). —Tacsipacsi (talk) 16:32, 26 October 2023 (UTC)
 * ✅ using Tacsipacsi's code. And yes, it was totally broken before - I spent a long time debugging before realizing that. * Pppery * it has begun... 22:44, 27 October 2023 (UTC)
 * After a quick look at the code, I think it would really need an overhaul…:
 * Agree with Tacsipacsi, the one-letter variables make the code difficult to understand, and are hard to search for.
 * There are other occurrences of unescaped IDs (search for ), which may – or may not – also need to be escaped.
 * I also had a look at the API requests, and they seem to be suboptimal. See File:Wdsearch - API requests.png.
 * About the "desc injection" feature that we have repaired here, I think it would be better to remove it actually, as it adds a lot of noise. Compare File:Wdsearch - Without desc injection.png (previous, broken code) with File:Wdsearch - With desc injection.png (new, fixed code). Note it was broken for 3 years and nobody complained about it…
 * Note that on frwiki, this gadget is imported and enabled by default, for all users.
 * Od1n (talk) 17:22, 29 October 2023 (UTC)
 * Another approach to consider is to only do desc injection if the Wikidata item doesn't have a manual description. But then I'm not a user of this script, so my opinion doesn't really count. For the other unescaped IDs - if they needed to be escaped then Jon (WMF) would have escaped them already, so I don't think any further action is needed there. On the other issues, it's unlikely someone will actually take up your opportunity to rewrite this code, but if you have a specific edit needing an Iadmin to handle then feel free to reactivate edit interface-protected and I or someone else will handle it. * Pppery * it has begun...  17:33, 29 October 2023 (UTC)