MediaWiki talk:Gadget-morebits.js
![]() | Before modifying or proposing changes to this script, please note: Modifications made to this gadget script are likely to be unintentionally overwritten, as the script is automatically synchronized with an off-wiki code repository. Please notify Twinkle's maintainers of any changes you propose or make to this script. |
![]() | This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Could a friendly admin please copy the contents of User:This, that and the other/temp/MediaWiki:Gadget-morebits.js to this page? I am currently in the process of testing this gadget script. — This, that, and the other (talk) 08:09, 16 May 2011 (UTC)
- Friendly admin gladly complies. Amalthea 10:10, 16 May 2011 (UTC)
IndexOf x $.inArray
It is requested that an edit be made to the interface page at MediaWiki:Gadget-morebits.js. (edit · history · last · links)
This template must be followed by a complete and specific description of the request, that is, specify what text should be removed and a verbatim copy of the text that should replace it. "Please change X" is not acceptable and will be rejected; the request must be of the form "please change X to Y".
The edit may be made by any interface administrator. Remember to change the |
Wouldn't be better to change
mw.config.get( 'wgUserGroups' ).indexOf( group ) !== -1
to
$.inArray(group, mw.config.get( 'wgUserGroups' ))
to ensure cross-browser support? Helder 13:55, 18 May 2011 (UTC)
- I have no idea. But as there is no opposition I have made the change for you. — Martin (MSGJ · talk) 10:14, 19 May 2011 (UTC)
- Fair enough. Personally, I think it's a performance decrease, and doesn't really improve legibility. But, that aside, any changes to this page are likely to get unintentionally overwritten, unless Twinkle maintainers get a heads-up at WT:TW. — This, that, and the other (talk) 10:40, 19 May 2011 (UTC)
- Helder's point was mainly browser compatibility, I think: IE8 doesn't support JS 1.6 and thus doesn't know Array.indexOf.
Don't know how many other problems morebits has in IE8 (and older), of course. Amalthea 11:03, 19 May 2011 (UTC)- Indeed. IE8 shows "undefined" if I put "javascript:alert(['foo'].indexOf)" in the adress bar while Firefox displays "function indexOf() {[native code]}". Helder 18:06, 25 May 2011 (UTC)
- Helder's point was mainly browser compatibility, I think: IE8 doesn't support JS 1.6 and thus doesn't know Array.indexOf.
- Fair enough. Personally, I think it's a performance decrease, and doesn't really improve legibility. But, that aside, any changes to this page are likely to get unintentionally overwritten, unless Twinkle maintainers get a heads-up at WT:TW. — This, that, and the other (talk) 10:40, 19 May 2011 (UTC)
This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Actually, that change broke stuff. Could an admin please revert it? Thanks, — This, that, and the other (talk) 10:57, 19 May 2011 (UTC)
- Done. Amalthea 11:03, 19 May 2011 (UTC)
- inArray also returns the index, comparing the return value with -1 should have worked. Amalthea 11:06, 19 May 2011 (UTC)
- My bad. I forgot to add the "!== -1" part to the code above. This should work:
- inArray also returns the index, comparing the return value with -1 should have worked. Amalthea 11:06, 19 May 2011 (UTC)
$.inArray(group, mw.config.get( 'wgUserGroups' )) !== -1;