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 Wikipedia preview function #595

Merged
merged 56 commits into from
May 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
60dc859
Add Wikipedia preview function
Jaifroid Apr 30, 2024
5939bdc
Follow dirEntry redirects
Jaifroid May 1, 2024
9a3e9c6
Fix size and positioning of balloon
Jaifroid May 2, 2024
0a7470f
Add comments and start arrow work
Jaifroid May 3, 2024
b2bb0a0
Add more intelligent and generic filters
Jaifroid May 3, 2024
f86d715
More styling and fill the box
Jaifroid May 3, 2024
67514bf
Some cleanup
Jaifroid May 3, 2024
59f8a0d
More cleanup and increase timeouts
Jaifroid May 3, 2024
21de29a
Rate-limit hover
Jaifroid May 3, 2024
be46b16
Only display with wikimedia ZIM types
Jaifroid May 3, 2024
5da7ccd
Change span to div
Jaifroid May 3, 2024
c30f2b7
Prevent div from disappearing if it is hovered
Jaifroid May 6, 2024
3297744
Fix dark styles for tooltips
Jaifroid May 7, 2024
2f54eb8
Get absolute ZIM url for images
Jaifroid May 7, 2024
b129c44
Added arrow, but positioning is off
Jaifroid May 7, 2024
1563c33
Fixed positioning of arrow
Jaifroid May 7, 2024
db3b0d5
Add UI option to disable
Jaifroid May 7, 2024
55d6c2d
Do not resolve empty balloon
Jaifroid May 7, 2024
e2ee7a5
Minimal support for Restricted mode in some brosers
Jaifroid May 7, 2024
cf524ec
Update index.html
Jaifroid May 7, 2024
b75b9d2
No image in Restricted mode
Jaifroid May 7, 2024
6bc69d3
Correctly encode image URL
Jaifroid May 8, 2024
d950557
Add transition style
Jaifroid May 8, 2024
a93297e
Make transition feel snappier
Jaifroid May 8, 2024
905070a
Tidy code into uiUtil.js
Jaifroid May 8, 2024
4bcbbba
More tidying
Jaifroid May 8, 2024
f426dfb
Add touch support
Jaifroid May 8, 2024
88ce411
Refine timeouts and positioning
Jaifroid May 8, 2024
52f49ac
Use more standard syntax
Jaifroid May 8, 2024
f91ee21
Deal with focus event (keyboard)
Jaifroid May 8, 2024
03fc760
Auto-dismiss popup after 5s
Jaifroid May 8, 2024
89f0772
Do not show context menu and process focus
Jaifroid May 9, 2024
01643d4
Prevent exception
Jaifroid May 9, 2024
1e546f9
Fixes for restricted screen size
Jaifroid May 9, 2024
1f6dd6a
Add loading and fix triangle positioning
Jaifroid May 10, 2024
9e56634
Add way to dismiss popover
Jaifroid May 10, 2024
5fbcb77
Try to fix UWP touch evocation
Jaifroid May 10, 2024
8a7eda5
A working solution, but too much space
Jaifroid May 10, 2024
9efd6ee
Better location and styling of icons
Jaifroid May 11, 2024
0a49676
Add click events
Jaifroid May 11, 2024
f66b355
Adjust icon size and spacing
Jaifroid May 11, 2024
9e60824
Finesse clickthrough timings
Jaifroid May 11, 2024
e56b310
Support UWP
Jaifroid May 11, 2024
31ff361
Prevent infinite timout loop
Jaifroid May 11, 2024
7187266
Prevent breaking UI with anchors in jQuery mode
Jaifroid May 11, 2024
ba1df5f
Try to fix event attachment issues
Jaifroid May 12, 2024
66266dd
Some finessing
Jaifroid May 12, 2024
12ff944
Try pointerdown
Jaifroid May 12, 2024
34ae4e0
Workaround for Firefox Android
Jaifroid May 12, 2024
d4e5383
Oops
Jaifroid May 12, 2024
8cf220e
Avoid double loading
Jaifroid May 12, 2024
18e4cb0
Try using capture phase
Jaifroid May 12, 2024
826797e
Clean up styling
Jaifroid May 12, 2024
073f3ae
Remove redundant (hopefully)
Jaifroid May 12, 2024
338c373
Update listed Firefox support
Jaifroid May 12, 2024
bc26d2f
Comment out debug statements
Jaifroid May 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up styling
Jaifroid committed May 12, 2024
commit 826797e7dd54b084f97b8720f68b75d54659092f
24 changes: 20 additions & 4 deletions www/js/lib/uiUtil.js
Original file line number Diff line number Diff line change
@@ -1542,9 +1542,25 @@ function attachKiwixPopoverCss (doc, dark) {
max-width: 40%;
height: auto;
}

#popcloseicon {
padding-top: 1px;
padding-right: 2px;
font-size: 20px;
font-family: sans-serif;
}

#popcloseicon:hover {
cursor: pointer;
}

#popbreakouticon {
height: 18px;
margin-right: 18px;
}

#popcloseicon:hover {
cursor: default;
#popbreakouticon:hover {
cursor: pointer;
}`,
// The id of the style element for easy manipulation
'kiwixtooltipstylesheet'
@@ -1649,8 +1665,8 @@ function attachKiwixPopoverDiv (ev, link, articleBaseUrl, dark) {
var backgroundColour = dark ? '#222' : '#ebf4fb';
div.innerHTML = `<div style="position: relative; overflow: hidden; height: ${divHeight}px;">
<div style="background: ${backgroundColour} !important; opacity: 70%; position: absolute; top: 0; right: 0; display: flex; align-items: center; padding: 0;">
<img id="popbreakouticon" style="height: 18px; margin-right: 18px;" src="${breakoutIconFile}" />
<span id="popcloseicon" style="padding-top: 1px; padding-right: 2px; font-size: 20px; font-family: sans-serif;">X</span>
<img id="popbreakouticon" src="${breakoutIconFile}" />
<span id="popcloseicon">X</span>
</div>
<div style="padding-top: 3px">${html}</div>
</div>`;