kiwix-js
kiwix-js copied to clipboard
Backport popover code from Kiwix PWA
Fixes #719. This backports the new feature from the PWA.
So far, I have ported the mouseover and the focus events, together with the popover code. Focus event provides keyboard support (tabbing into a link).
To do:
- [x] Add touch support (long press)
- [x] Add pointerdown fallback for browsers that don't support touchstart (e.g. Safari on macOS, and Edge legacy)
- [x] Fix hover over popover in Safari for macOS
- [x] Disable the contextmenu event if popovers are enabled
- [x] Enable for Safe mode (without image support, as in the PWA)
- [x] Add the option to disable popover preview in the UI, with translations
- [x] Fix support for dark modes
- [x] Move as many inline styles as possible to stylesheet
- [x] Suppress popover loading if user has clicked the link
- [x] Add e2e test for presence of popover on tab into link (Ray Charles ZIM)
- [x] Make the breakout icon open a new window
- [x] Fix clicking on a link inside the popover
- [x] ~~Add popover support to new windows~~ Open a new issue to add popover support to new tabs/windows: #1253
- [x] Clean up code hangovers from the PWA that are not needed here
- [ ] Final testing