-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config: add scripts for Wiktionary's show/hide toggles #1665
Conversation
@zhuowei Thank you for your PR, I will review it. |
Instead of importing a custom gadget from Wiktionary, I think you should import the standard module |
I checked: Hungarian Wiktionary on Desktop shows the box fully expanded by default; tapping it closes it - the opposite of English Wiktionary. On mobile, it always shows the box expanded without any way to collapse it: https://hu.m.wiktionary.org/wiki/világ%C3%ADtótorony Kiwix does the same as mobile currently, and always shows the box expanded: https://library.kiwix.org/wiktionary_hu_all_nopic_2022-09/A/világ%C3%ADtótorony I did look into adding a CSS override that would force the infobox open on English Wiktionary, but I'd rather get the show/hide toggle working if possible. |
True, due to the low number of languages per article, I decided not to collapse them by default. But this is just a matter of configuration: adding the
Oh yeah, maybe I should advocate for the standard module to work on mobile first…
Does Kiwix use the mobile or desktop/default versions of modules (where this matters)? If the desktop/default one, importing |
@zhuowei I still don’t have tested, but two remarks already:
|
cc9b4a7
to
f96e2ac
Compare
Codecov ReportBase: 68.92% // Head: 68.92% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #1665 +/- ##
=======================================
Coverage 68.92% 68.92%
=======================================
Files 26 26
Lines 2394 2394
Branches 467 467
=======================================
Hits 1650 1650
Misses 580 580
Partials 164 164 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
7630037
to
5e53d52
Compare
5e53d52
to
f0c2286
Compare
f0c2286
to
d2abf57
Compare
This fixes #1033.
The
ext.gadget.VisibilityToggles
andext.gadget.defaultVisibilityToggles
only seem to exist on Wiktionary: when I tested with English Wiktionary, they fixed the toggles. When I tested with English Wikipedia, the scripts returnedmw.loader.state({ "ext.gadget.defaultVisibilityToggles": "missing" });
I can't find any good way to determine whether a wiki uses toggles: https://phabricator.wikimedia.org/T161278 seems to suggest that the API doesn't surface gadgets in
modulescripts
?@ MananJethwani found that it's not possible to scrape them from
RLPAGEMODULES
either, at least through the API: https://www.mediawiki.org/wiki/Topic:W2g7t4u4whlmkqhoIs there a way to add these for Wiktionary only, maybe via Wiktionary's Zimfarm config instead? Or maybe pull the wiki's homepage via the regular, non-API endpoint and check for gadget scripts?