Skip to content
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

Add support for opening details sections in jQuery mode #546

Closed
wants to merge 1 commit into from

Conversation

Jaifroid
Copy link
Member

@Jaifroid Jaifroid commented Jul 26, 2019

This is a simple PR to open all details sections in jQuery mode. It supports recent ZIMs that use the details-summary schema to open and close sections in a document. In browsers that support the details-summary elements, the sections remain closed because the piece of included JavaScript in the ZIM that opens them is not able to run in jQuery mode. This PR adds the open attribute to all unopened details elements, and does it by adding a simple query and test to our existing routine for opening all sections. The PR creates consistency of approach with previous ZIM types.

We can consider adding logic here to open all details sections only if the screen size is larger than mobile width. Personally I prefer to start with all sections open even in mobile, and as a user I would like an option to override automatic decisions taken by the browser that I would find annoying (!). Therefore, if we implement opening all sections only in desktop mode, I'd vote for adding a simple configuration option "Always open all sections in Wikimedia articles".

@Jaifroid Jaifroid added this to the v2.7 milestone Jul 26, 2019
@Jaifroid Jaifroid requested a review from mossroy July 26, 2019 13:27
@Jaifroid Jaifroid self-assigned this Jul 26, 2019
@Jaifroid
Copy link
Member Author

I've added an issue for this PR #547. An additional point is that it is impossible to jump to references / endnotes when the notes section is closed, therefore we are obliged at least to open that section.

@Jaifroid
Copy link
Member Author

Please note that this PR is simply a revision to our current workaround for opening sections. It adds support for newer ZIMs, and allows endnotes to work in jQuery mode (otherwise clicking on an endnote does nothing). ISTM that until the issue is resolved in mwoffliner (and I have reported it) we should keep the workaround up-to-date and not let it 'rot'.

Copy link
Contributor

@mossroy mossroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember the general rule : we should not try to workaround issues that are inside the ZIM files.
When these issues have a big impact, the ZIM files are removed from the download server.

We made an exception for a particular set of wikimedia ZIM files because they were not working at all on kiwix-js (you could not read anything), were working on every other Kiwix client (so they should not be removed from the download server), and the workaround did not seem too risky.

In this case, I don't think the impact is big enough to justify that.

Maintaining these workarounds (and their potential side-effects) can be painful.

@Jaifroid
Copy link
Member Author

OK, I understand. So I'll close this for now. I haven't had a response to my report about the issue, but I do see that the current feature (details-summary tags) is looking a bit broken. See openzim/mwoffliner#952 .

@Jaifroid Jaifroid closed this Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants