MediaWiki talk:Wdsearch-autodesc.js: Difference between revisions

Content deleted Content added
Line 123:
If any claim with preferred rank is present, then claims with normal rank should be hidden as well. <span style="font-family:Segoe Script">[[User:Petr Matas|Petr Matas]]</span> 23:06, 27 December 2016 (UTC)
 
{{editprotected|answered=yes}}
: [[Special:Diff/756970705|Diff/756970705]] should do the trick. Can anyone apply it and test it, please? <span style="font-family:Segoe Script">[[User:Petr Matas|Petr Matas]]</span> 00:16, 28 December 2016 (UTC)
:: {{ping|Petr Matas}} I spotted two things which I think are bugs in the filterClaims function. The first is the $.each syntax - the first parameter to the callback function is the array index, not the value. The second is the use of $.grep in a loop. According to the [http://api.jquery.com/jquery.grep/ docs], this function alters the existing array. It would work fine on the first iteration if there are any preferred statements, but as the original values array is altered, on the second iteration $.grep would be working with an empty array (it has no preferred statements, and any normal or deprecated statements were removed in the first iteration). I've fixed both of these bugs in [[Special:Diff/756970705/757143441|this diff]], but I haven't tested the code yet. Could you look over my changes and see if they look ok? Best — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr.&nbsp;Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪&nbsp;talk&nbsp;♪]]</sup> 01:23, 29 December 2016 (UTC)
Line 129:
:::: {{ping|Petr Matas}} Ah yes, you're quite right. Sorry about that. We should probably go with the version that is better supported, in that case. I've restored $.grep in your version - does the [https://en.wikipedia.org/wiki/Special:ComparePages?page1=&rev1=757138647&page2=&rev2=757176210&action=&diffonly=&unhide= diff] look ok to you now? — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr.&nbsp;Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪&nbsp;talk&nbsp;♪]]</sup> 06:29, 29 December 2016 (UTC)
::::: {{ping|Mr. Stradivarius}} Yes, it does. I am keeping my fingers crossed. ;-) <span style="font-family:Segoe Script">[[User:Petr Matas|Petr Matas]]</span> 06:41, 29 December 2016 (UTC)
:::::: {{ping|Petr Matas}} Ok, I have put the change up live. Let me know if you notice any strange behaviour. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr.&nbsp;Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪&nbsp;talk&nbsp;♪]]</sup> 07:45, 29 December 2016 (UTC)
 
== Language selection bugfix ==