Commit graph

61 commits

Author SHA1 Message Date
Paul Esch-Laurent
2fbe2df086 fix: <img> aspect ratio w/ height: auto
Complement with `max-width: 100%` with a `height: auto` to preserve `<img>` aspect ratios, particularly when it's not wrapped in a block parent e.g. `<p>` or `<figure>` most commonly.

Related: https://www.smashingmagazine.com/2020/03/setting-height-width-images-important-again/
2024-07-08 17:13:20 -07:00
Wojtek
a46e702536
Add navigation to last/first page 2024-06-28 20:19:38 -07:00
Ztec
07f6d397d4 Fix Playback speed indicator precision
The original idea was to have two digit precision at all time
in order to ensure the length of the string is always the same.
This prevents the UI button to move when pressed.
I completely missed the first press as the precision was not right
upon first click.
2024-06-13 20:13:07 -07:00
Ztec
93bc9ce24d add seek and speed controls to media player
When listening to podcast, it is usual to want to speed up the playback.
https://github.com/miniflux/v2/pull/2521 was addressing the need globally, this PR
allow to address it for just the current open enclosure media. (no save) Some Browser
already include this control directly, but firefox does not (directly anyway).

Also, it is often useful to be able to skip chunk of a podcast, to skip commercials
for example, or get back a bit because we couldn't hear the last part. I added rudimentary
seek controls with the usual +/-10 and 30 seconds chuck size. This is pretty handy when podcast
are very long and using the seek bar is way too tricky to just skip 30s.

As always, I'm French and could only provide English and French translation for the few
text I added in the locale/translations files. Any help is welcome.

Tested mostly on Firefox (121.0) and quickly on Vivaldi(6.5.3206.53), chrome based.

Fixes: #1845 #1846
2024-04-26 13:44:26 -07:00
Michael Kuhn
35edd8ea92 Fix clicking unread counter
When clicking the unread counter, the following exception occurs:
```
Uncaught TypeError: Cannot read properties of null (reading 'getAttribute')
```

This is due to `onClickMainMenuListItem` not working correctly for the
unread counter `span`s, which return `null` when using `querySelector`.
2024-04-09 20:36:42 -07:00
jvoisin
ed20771194 Enable trusted-types
This commit adds a policy, and make use of it in the Content-Security-Policy.

I've tested it the best I could, both on a modern browser supporting
trusted-types (Chrome) and on one that doesn't (firefox).

Thanks to @lweichselbaum for giving me a hand to wrap this up!
2024-03-20 17:50:37 -07:00
jvoisin
beb8c80787 Replace a bunch of let with const
According to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const

> Many style guides (including MDN's) recommend using const over let whenever a
variable is not reassigned in its scope. This makes the intent clear that a
variable's type (or value, in the case of a primitive) can never change.
2024-03-20 17:36:01 -07:00
Matt Behrens
1ea3953271
Add keyboard shortcuts for scrolling to top/bottom of the item list 2024-03-19 19:30:38 -07:00
Romain de Laage
00dabc1d3c feat: Media player: Conrol playback speed
fix  #1845
2024-03-17 11:53:30 -07:00
Frédéric Guillot
0f17dfc7d6 Fix regressions introduced by PR #2476
'Toast' messages are broken and v hotkey opens in the same tab

Commit d25c032171
2024-03-15 20:55:32 -07:00
Frédéric Guillot
7c80d6b86d Fix download button loading label 2024-03-15 20:40:14 -07:00
Frédéric Guillot
7a307f8e74 Fix regression: Add to Home Screen button is unreadable
Regression introduced in commit ea58bac548
2024-03-14 17:37:50 -07:00
jvoisin
7310e13499 More trusted-types compatibility 2024-03-14 17:10:40 -07:00
Frédéric Guillot
ca919c2ff8 Fix JavaScript error on the login page 2024-03-13 21:47:23 -07:00
jvoisin
e0ee28c013 More progress towards trusted-types
Create a new function `addIcon` and use it to add icons, instead of
operating on raw html.
2024-03-13 19:35:20 -07:00
jvoisin
d25c032171 Simplify bootstrap.js
- Don't use lambdas to return a function, use directly the function instead.
- Remove a hack for "Chrome 67 and earlier" since it was released in 2018.
2024-03-13 18:26:27 -07:00
mcnesium
ee3486af66 align min-width with the other min-width values 2024-03-12 18:58:30 -07:00
Frédéric Guillot
d3a85b049b jsminifier: set JavaScript version 2024-03-11 19:02:52 -07:00
jvoisin
9c8a7dfffe Make use of HashFromBytes everywhere
It feels a bit silly to have a function and to not make use of it.
2024-03-11 15:22:22 -07:00
jvoisin
74e4032ffc Small refactor of app.js
- replace a lot of `let` with `const`
- inline some `querySelectorAll` calls
- reduce the scope of some variables
- use some ternaries where it makes sense
- inline one-line functions
2024-03-11 15:18:57 -07:00
jvoisin
fd1fee852c Simplify DomHelper.getVisibleElements
Use a `filter` instead of a loop with an index.
2024-03-11 15:03:00 -07:00
Frédéric Guillot
c51a3270da GitHub Actions: Add basic ESLinter checks 2024-03-10 20:57:27 -07:00
Frédéric Guillot
45fa641d26 Fix JavaScript linter path in GitHub Actions 2024-03-10 20:37:18 -07:00
jvoisin
fd8f25916b First steps towards trusted-types support
Refactor away some trival usages of `.innerHTML`. Unfortunately, there is no way to
enabled trusted-types in report-only mode via `<meta>` tags, see
https://github.com/w3c/webappsec-csp/issues/277
2024-03-10 20:14:30 -07:00
jvoisin
826e4d654f Replace DomHelper.findParent with .closest
See https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
2024-03-10 20:06:54 -07:00
jvoisin
d9d17f0d69 Use a Set instead of an array in a KeyboardHandler's member
The variable `triggers` is only used to check if in contains a particular
value. Given that the number of keyboard shortcuts is starting to be
significant, let's future-proof the performances and use a `Set` instead of an
`Array` instead.
2024-03-10 19:41:13 -07:00
Frédéric Guillot
abdd5876a1 Move search form to a dedicated page 2024-03-01 16:56:15 -08:00
Robert Lützner
facf38955c Add 'Enter' key as a hotkey to open selected item
There are a few things that need to be done, to make this work.

First, we need to register `Enter` as another hotkey that opens the
selected item.

However, by default the `KeyboardHandler` will override all default
actions. That might make sense for any other key, but for the `Enter`
key, we want to keep the default behavior (i.e. follow a selected link
or press a button). So for this single key event, we do not call
`preventDefault()`.

I see this as unproblematic for the following reasons.

1. With the changes from #2348, when we're in a list of items (articles,
   categories, feeds), there is no link selected. This is what made the
   `Enter` key work _implicitly_ in the past. With nothing selected, the
   `Enter` key will do nothing by default.
2. If we have **any** link selected (including when we are in a view
   with a list of selectable items), we'll get the default action of
   `Enter` (i.e. follow a link), which is exactly what we had before.

Lastly, we need to update the list of keyboard shortcuts displayed when
pressing `?`.

This fixes #2366.
2024-02-21 20:02:58 -08:00
Frédéric Guillot
59311deb57 Fix logo misalignment when using languages that are more verbose than English 2024-02-19 15:10:35 -08:00
krvpb024
5c97771e61 fix macOS VoiceOver didn't announce details and summary expand 2024-02-14 20:11:23 -08:00
knrdl
ccb9eed573 fix wrong label on save
when saving an entry the label was reset on complete
so the desired done label was never shown
2024-02-11 12:49:08 -08:00
krvpb024
2221fd408d fix the page-button hover style not show 2024-02-09 19:37:10 -08:00
Tân Î-sîn
ea58bac548
Replace link has button role with button tag
# Change HTML tag to button

Replace the link tag with an HTML button to prevent some screen readers from having confusing announcements. By using the HTML button, users can use the Enter and Space keys to activate actions by default, instead of implementing them in JavaScript.

# Differentiate links and buttons visually

When activating the link element, the user may expect the web page to navigate to the URL and the page will refresh; when activating the button element, the user may expect the web page to still be on the same page, so that their current state, such as: input value, won't disappear.

Links and buttons should have different styles visually, so that users can't expect what will happen when they activate a link or a button.

I added the underline to the links, because that is the common pattern. Buttons have border and background color in a common pattern. But I think that will change the current layout drastically. So I added the focus, hover and active classes to the buttons instead.
2024-02-09 17:09:30 -08:00
krvpb024
0f85c0511a remove item focus outline overlapped on current style 2024-02-09 16:54:29 -08:00
krvpb024
27749a2877 change focus target on items when using keyboard navigation 2024-02-09 16:54:29 -08:00
krvpb024
6eac968083 add keyboard shortcut and aria attribute to menu button 2024-02-07 21:56:24 -08:00
Frédéric Guillot
9336891e67 Restore menu toggle when clicking on the logo
The caret icon is too small on smartphone to expand/collapse the menu
2024-02-05 21:18:06 -08:00
krvpb024
bf54222be7 hide menu button in desktop layout instead of icon 2024-02-04 21:36:31 -08:00
krvpb024
8367413e84 change links that could perform actions to buttons 2024-02-04 10:47:30 -08:00
krvpb024
531e80f580 fix entry page layout has changed 2024-02-04 10:47:30 -08:00
krvpb024
890a34e1bd remove code for debug and comment 2024-02-04 10:47:30 -08:00
krvpb024
7413e383a8 fix search and star function 2024-02-04 10:47:30 -08:00
krvpb024
6c78a1d635 improve feed, entry, category a11y 2024-02-04 10:47:30 -08:00
krvpb024
6413c9f9f7 add nav landmark to settings and feed menu 2024-02-04 10:47:30 -08:00
krvpb024
61f52d971a fix h1 font-size 2024-02-04 10:47:30 -08:00
krvpb024
fa7508e28d change search summary icon 2024-02-04 10:47:30 -08:00
krvpb024
84576f2c29 fix menu responsive layout 2024-02-04 10:47:30 -08:00
krvpb024
da11416b39 change layout structure by moving header 2024-02-04 10:47:30 -08:00
krvpb024
6a9a590c7f add search landmark and disclosure pattern to menu 2024-02-04 10:47:30 -08:00
krvpb024
f23e6a3352 add skip to content link 2024-02-04 10:47:30 -08:00