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 #547

Closed
Jaifroid opened this issue Jul 26, 2019 · 6 comments
Closed

Add support for opening details sections in jQuery mode #547

Jaifroid opened this issue Jul 26, 2019 · 6 comments
Assignees
Milestone

Comments

@Jaifroid
Copy link
Member

This is the issue corresponding to #546. The issue is that in jQuery mode, in browsers that support the summary-details tags, details sections in recent ZIMs remain closed (because jQuery mode cannot run JS-in-the-ZIM). See the PR for more info.

@mossroy
Copy link
Contributor

mossroy commented Aug 17, 2019

With a user point of view, I tend to agree with you. But I'm not in favor of doing this in kiwix-js.
We should report that on mwoffliner, instead of adding some ZIM-specific code.

It seems to me that there would be different proposals :

  • revert the logic of showing/hiding the details tags, so that they all have the open attribute in the HTML string, and then use javascript (inside the ZIM file) to close some of them if necessary (currently, it's the contrary : the tags are closed in the HTML string, and opened with javascript). It would give the same result (when javascript is enabled). But everything would be open by default when javascript is not enabled, which seems better for us in jQuery mode (at least on large screens)
  • remove the logic that closes the details tags when the screen is small, so that everything is open by default, whatever the screen size. It would not be consistent with online versions of wikipedia, but might be discussed
  • add an option for the user to choose if he prefers to have details open or closed. This could probably be implemented (in the future) through the JS API : Introduce the ZIM JS API openzim/mwoffliner#596

@Jaifroid
Copy link
Member Author

Jaifroid commented Aug 17, 2019

I agree it's best to deal with this in the ZIM in the medium term. But the issue as I see it is:

  1. We currently have a workaround for opening sections that works for ZIMs without details-summary tags, so it would only be an addition/revision of our current workaround;
  2. Right now there are ZIMs being produced (August 2019) that (I think?) are unusable with Kiwix JS because our current workaround no longer works. [I need to test this statement to be sure it's true!] EDIT: experience is inconsistent, see post below.

So, while I am happy to report an issue on mwoffliner, my preference would be at least to make the new ZIMs usable until such time as the problem is fixed in mowoffliner. However, I completely understand your perspective. Let me corroborate 2. above and report back.

@Jaifroid
Copy link
Member Author

Jaifroid commented Aug 18, 2019

So I've now checked this against the very recent wikipedia_en_history_maxi_2019-08.zim. The ZIMs are usable in jQuery mode in all browsers, but there is an issue in browsers that support the details-summary tag syntax. In browsers that do not support the syntax, all sections are open by default. In browsers that do support the syntax, all h3, h4 sections are open, but oddly h2 sections are closed (by default). They can be opened by clicking on them. Most crucially, the References / Notes sections are closed, so clicking on a footnote fails to go to it. The average user will therefore think the ZIM has failed in some way. See screenshots below. So, oddly, there is a better user experience (in jQuery mode) for browsers that do not support details-summary tags (Edge 44 and Internet Explorer) than in browsers that do. I should add that h2 sections are closed on both big and small screens.

image

image

@Jaifroid
Copy link
Member Author

I have made this comment on mwoffliner. If our issue turns out not to be related to that issue, I'll promote it to a separate issue, but it seemed to be related.

@mossroy mossroy modified the milestones: v2.7, v2.8 Mar 29, 2020
@mossroy mossroy modified the milestones: v2.8, v2.9 Jul 11, 2020
@Jaifroid Jaifroid modified the milestones: v3.0, v3.1 Oct 3, 2020
@Jaifroid Jaifroid modified the milestones: v3.1, v3.2 Dec 6, 2020
@mossroy mossroy modified the milestones: v3.2, Backlog Aug 22, 2021
abdnh added a commit to abdnh/anki-zim-reader that referenced this issue Sep 27, 2022
We may want to reduce the default size of the pop-up once we implement
automatic expanding of <details> sections regardless of the iframe size.
Relevant: kiwix/kiwix-js#547
@kelson42
Copy link
Collaborator

kelson42 commented Jan 9, 2023

@Jaifroid Do we really want to implement this feature in frozen JQuery mode?

@Jaifroid
Copy link
Member Author

Jaifroid commented Jan 9, 2023

Considering my PR wasn't accepted, and I don't have another solution, I agree this should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants