Hi User:Jackmcbarn I see this gadget is loaded by default on the mobile experience but I do not see it being used anywhere.
Given top loaded styles are problematic for slow connections, can I ask that you fix this gadget to work on mobile or disable it on mobile for the time being (remove the mobile target)?
For anyone else reading this, here's the conversation we had on IRC:
<jdlrobson> jackmcbarn: i see it now yup i didnt realise that's what it did- that said do you know why it's top loading CSS given they are just radio buttons?
<jackmcbarn> i wasn't aware it was top loading any css
* jackmcbarn looks
<jackmcbarn> i can't see any css it's loading anywhere at all. where do you see it at?
<jdlrobson> yeh that's what legoktm was suggesting
<jdlrobson> i suspect there's some kind of bug in the stack..
Looks like this is now fixed. For some reason, thanks to a mysterious ping from @Liridon:, I only just got this notification so thank you for looking into it! Jdlrobson (talk) 17:42, 20 July 2017 (UTC)[reply]
Would it be possible to modify the template to allow for the organization of the clickable buttons in columns when there are above a certain number of images? Since the template accommodates up to 40 images, it is unwieldy to have a vertical list of 40, since that just takes up space. An example of this phenomenon is in my sandbox. Continuing this discussion from Template talk:Switcher. Pinging @PrimeHunter and Jackmcbarn:Ergo Sum00:15, 24 November 2019 (UTC)[reply]
Hi Krinkle - apologies for the unsolicited ping, I understand you're the maintainer of the switcher gadget.
Would it be possible to make a change to the gadget which would permit custom styles being put on the <label> elements? Over here we've been discussing using it in a template, but by default the switcher radio buttons fly off to the other side, which isn't very helpful. Essentially, what I want to do is plonk the radio buttons on top of the templates - which I can do by setting them to display inline - but of course, there's no way to do that in the current gadget code.
No worries if it's not possible for any reason, I know this is a bit of an edge case - it'd just be useful here
@Onceinawhile: When I wrote this, I intentionally didn't allow suppressing "show all". When a user doesn't have JavaScript or has the switcher gadget disabled, they're effectively permanently in "show all" mode. My worry was that by allowing hiding that mode from most users, the templates that did so would quickly end up with really ugly or stretched out pages in that case. Do you think it's worth letting it be hidden anyway? It wouldn't be difficult to add that if there were a reason for it. Jackmcbarn (talk) 21:53, 12 August 2020 (UTC)[reply]
Hi Jackmcbarn, thanks very much for your answer here, and for creating this valuable gadget in the first place. If I understand you correctly, you are saying that because some readers will only ever see the showall mode, it is healthy for editors to be conscious of this - and permanent showall button ensures that.
It was Zero0000 who asked me about this originally, so I will defer to him as to value of optionality here.
Jackmcbarn, thanks for that explanation. I'm not tech-savvy enough to know, how many users still don't have JavaScript, and is there no way to program the gadget so that it doesn't need JavaScript? I've wanted to suppress the show all button in the past myself, so there is very much demand for this feature, but your reasoning makes sense if we're not yet ready to throw out support for those without JavaScript. {{u|Sdkb}}talk00:21, 13 August 2020 (UTC)[reply]
Hi @Jackmcbarn:, thanks for the explanation. My knowledge of javascript is very primitive so maybe this suggestion is nonsense. An option which applied the javascript object.style.display="none" attribute to the showall line would not be effective for users with javascript off and would just make a little space for others. Not perfect, but something. Is there a better way to have the suppression of showall a javascript action so that it is only effective when javascript is on? Cheers. Zerotalk02:33, 13 August 2020 (UTC)[reply]
@Zero0000: From a purely technical perspective, I can absolutely easily do that. My concern is that by doing so, editors would forget that the "show all" view still exists for some viewers and so would inadvertently make decisions that significantly harm the quality of it. Jackmcbarn (talk) 06:12, 13 August 2020 (UTC)[reply]
Thanks for your reply, @Izno: I was taught to use "both" for exactly two items and "all" for more than two but haven't been able to find an authroritative source addressing this specifically, though Dual_(grammatical_number) states
“
The majority of modern Indo-European languages, including modern English, have lost the dual number through their development. Its function has mostly been replaced by the simple plural. They may however show residual traces of the dual, for example in the English distinctions: both vs. all, either vs. any, neither vs. none, and so on. A commonly used sentence to exemplify dual in English is "Both go to the same school." where both refers to two specific people who had already been determined in the conversation.
Cmglee, I changed your request to use {{StringDiff}}. However, your proposed change won't work, it would just move the radio button+label to the right.
Hi @Alexis Jazz: Thank you very much for looking into this. I'm unfamiliar with Mediawiki software so cannot comment on what the correct approach is but am happy to beta-test it. https://commons.wikimedia.beta.wmflabs.org/wiki/Template:Switcher has adequate space between each radio button and its label, though there is much larger vertical separation between rows than on Template:Switcher/doc#Example: Firefox's Inspector shows that the wmflabs version has each label in a separate div where the original template has just label elements. Cheers, cmɢʟee⎆τaʟκ16:05, 22 August 2023 (UTC)[reply]
@Number 57, have you tested the alternatives sufficiently? Consensus isn't just a question of why something needs changing but what needs to change, and I do not see above that there's a consensus on what needs to change. @Alexis Jazz said "that doesn't work" (and I trust Alexis on the point), provided a different suggestion but not a specific location to insert it in. I would have run with that suggestion if they had, or if there were actual agreement on the choice of change. Izno (talk) 23:23, 8 September 2023 (UTC)[reply]
No (and you know I haven't as I've made it clear that I don't know how to resolve this). The issue was that you appeared to be requiring a consensus for the change, when none is needed. It merely needs someone to have come up with a solution that works. If the solution above didn't work, you could have declined the edit request because it didn't work (or was unclear it would work) rather than saying the problem was a lack of consensus for the change. Also, no need to ping me as I have this on my watchlist. Cheers, Number5723:29, 8 September 2023 (UTC)[reply]
Izno, I just realized the condition could be simpler: (now with context and just to be safe mw.loader)
The condition is only to prevent the CSS from being added multiple times. It wouldn't really hurt if the CSS would be re-added for each switcher but it'd be sloppy. — Alexis Jazz (talk or ping me) 03:11, 9 September 2023 (UTC)[reply]
Nardog, thanks for the info! Indeed, that appears to work as well. According to https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.util addCSS may "call the mw.loader.addStyleTag method directly", so addStyleTag is a subset of addCSS it's complicated, addStyleTag returns an element and accepts a second argument to define the next node while addCSS calls addStyleTag and returns the stylesheet instead of the element. Either way, we're not using whatever is returned so it makes no difference for this. Loading mediawiki.util isn't a big deal as it is (almost?) universally loaded anyway, but using addStyleTag the code could indeed be shortened:
Hello, this .js exists in the English and Catalan versions, but not in the Occitan one. As a bureaucrat of the OC wikipedia, I am not allowed to create it. Any idea on who could do this for us?
Thanks in advance. Best regards. — J. F. B. (me´n parlar) 17:15, 3 January 2024 (UTC)[reply]
Thank you for looking into this. Upon further testing on the non-first labels, I fixed a bug I accidentally introduced.
I originally used DevTools on the CSS of those 2 pages to add inline-block to the first label. I tested the result looks good on {Windows,Linux,Android} {Chrome,Firefox}. The bug is slightly different on Firefox Windows, but is also fixed. Android looks unchanged. I then tested a random sample of 10 pages from Special:WhatLinksHere/Template:Location_map, rejection-sampling out anything without radio buttons. The CSS editing worked.
I would appreciate testing from a registered editor with the access level to edit JavaScript (or userscripts). Someone can also propose another solution as I am unfamiliar with JQuery and my goal is just fixing the display of that article. 142.113.140.146 (talk) 19:08, 1 August 2024 (UTC)[reply]