Commit Graph

19 Commits

Author SHA1 Message Date
Nolan Lawson 0022286b46
fix: first stab at i18n, extract English strings, add French (#1904)
* first attempt

* progress

* working

* working

* test timeago

* rm

* get timeago working

* reduce size

* fix whitespace

* more intl stuff

* more effort

* more work

* more progress

* more work

* more intl

* set lang=LOCALE

* flatten

* more work

* add ltr/rtl

* more work

* add comments

* yet more work

* still more work

* more work

* fix tests

* more test and string fixes

* fix test

* fix test

* fix test

* fix some more strings, add test

* fix snackbar

* fix }

* fix typo

* fix english

* measure perf

* start on french

* more work on french

* more french

* more french

* finish french

* fix some missing translations

* update readme

* fix test
2020-11-29 14:13:27 -08:00
Nolan Lawson 870fa0e93c
feat: add "i" as shortcut to open media (#1890)
fixes #1883
2020-11-14 14:13:38 -08:00
Nolan Lawson ea4c1ad819
fix: return focus to sensitive media button (#1535)
* fix: return focus to sensitive media button

fixes #1517

* additional fix for media sensitive focus

* fix audio/video name in aria-label of button

* fix hotkeys
2019-09-24 22:31:56 -07:00
Nolan Lawson 88ab0b929c
fix: improve style of "large inline" media (#1428) 2019-08-24 10:43:50 -07:00
Nolan Lawson 8c6a701d6f
fix: ensure "disable blurhash" setting is honored (#1422)
* fix: ensure "disable blurhash" setting is honored

fixes #1421

* remove play button for audio/video
2019-08-22 09:09:21 -07:00
Nolan Lawson dd625b80a0
fix: remove unused nCols computation (#1420) 2019-08-21 23:26:16 -07:00
sgenoud ada6b9f699 fix: Fix the blurhash alignment and general style (#1418)
* Fix the blurhash alignment issue

* Fix the video blurhash style
2019-08-21 22:31:14 -07:00
Nolan Lawson daa1978945
fix: tweak position of sensitive media button in blurhash mode (#1390) 2019-08-17 14:36:07 -07:00
Nolan Lawson aca1067568
fix: tweak colors for blurhash sensitive media button/text (#1389) 2019-08-17 14:33:57 -07:00
Sorin Davidoi 77bb784efd feat(media): Blurhash (#1381)
* chore(npm): Install blurhash

* feat(media): Show blurhash

* fix(media/blurhash): Better sensitive video handling

* feat(media): Preference for using blurhash

* chore(utils/blurhash): Add performance marks

* fix(utils/blurhash): Performance marks

* fix(utils/blurhash): Use correct dimension

* refactor(utils/blurhash): Use constant for number of pixels

* refactor(media): Simplify logic for displaying blurhash

* chore(tests/spec): Attempt to adjust sensitivity tests for blurhash

* chore(tests/spec): Update sensitivity tests for blurhash

* chore(tests/spec): Check for sensitive

* fix(media/blurhash): Handle videos

* fix: Video handling

* fix: Videos

* minor refactoring, fix Svelte warning

* fix: Large inline images and videos

* feat(settings): Rename blurhash setting

* refactor: Use toBlob, block media rendering until blurhash ready

* refactor: Move computations to Web Worker

* fix(workers/blurhash): More error handling

* feat(workers/blurhash): Use quick-lru for caching

* fix: Don't create Context2D needlessly

* fix(workers/blurhash): Increase cache size to 100

* fix(workers/blurhash): Don't resolve promise twice

* fix(utils/decode-image): Ignore data URLs

Throws exception which prevents the image from loading.
2019-08-17 10:54:45 -07:00
Nolan Lawson 00945a3608
chore: update standard to v13 (#1370) 2019-08-03 13:49:37 -07:00
Nolan Lawson 7fd6cdc22c
fix: fix event propagation for click delegates (#1317)
fixes #1316
2019-07-07 17:32:50 -07:00
Nolan Lawson 880bc7a38a
perf: use a separate icons.svg file (#1067)
* perf: use a separate icons.svg file

This splits icons into inline and non-inline. The inline ones are high
priority; the rest go in an icons.svg file.

* create SvgIcon.html

* determine inlined svgs at build time
2019-03-02 19:02:06 -08:00
Nolan Lawson 547ee14f88
refactor: use ids instead of attrs for delegate/shortcut/focus (#1035)
* refactor: use ids instead of attrs for delegate/shortcut/focus

fixes #1034

* console log on error

* fix test
2019-02-23 12:32:00 -08:00
Nolan Lawson c9ca605cfe
fix: fix keyboard shortcuts for pinned toots (#1033)
* fix: fix keyboard shortcuts for pinned toots

fixes #908

* fix test
2019-02-23 09:47:36 -08:00
Stephane Zermatten c2bd2f306a feat: Add support for keyboard shortcuts (#870)
* Add support for keyboard shortcuts.

This change introduces a Shortcut component for defining global
keyboard shortcuts from whichever component makes more sense.

This change also adds an initial set of navigation shortcuts:
- Backspace to leave a modal dialog or to go back
- g t to go to the federated timeline
- g f to go to the favorite page
- g h to go to the home page
- g n to go to the notification page
- g c to go to the community page
- s to go to the search page

These shortcuts are loaded asynchronously from _layout.html

In modal dialogs, shortcuts are also modal, to avoid strange or
overly complex behavior. This is implemented by grouping
shortcuts into scopes, and activating a separate 'modal' scope
when entering a modal dialog, so a separate set of shortcuts can
be enabled in modal dialog. Modal dialogs can be exited by
pressing 'Backspace'.

* Navigate up/down lists using keyboard shortcuts.

This change introduces keyboard shortcuts for navigating in lists and
virtual lists. j or arrow up selects the next element, k or arrow down,
the previous element. Selecting an element scrolls the list up and down,
as necessary.

This change also allows directing keyboard shortcuts to the active
element and defines the following shortcuts, for the active status:
- f to favorite or unfavorite it
- b to boost or unboost it
- r to reply to it
- o to open its thread
- x to toggle the display of a CW
- y to toggle the display of sensitive medias

This works by defining a keyboard shortcut scope for each list element.
A new component, ScrollListShortcuts, keeps track of the active element,
based on list or virtual list elements and redirects shortcuts to the
active element's scope. ScrollListShortcuts keeps the active element in
the current realm of the store, so the active element is restored when
going back to the list.

* Typing h or ? displays the list of available keyboard shortcuts.

This change introduces a new modal dialog that documents the list of
available shortcuts.
2019-01-13 10:03:29 -08:00
Nolan Lawson 5e089ba27d
fix: fix sensitive content warning on mobile (#794) 2018-12-13 00:39:38 -08:00
sgenoud 30705da19d fix: Change the size of sensitive media box (#784)
It is now slightly bigger than what images in a box would look
like.

fixes #771
2018-12-12 23:44:29 -08:00
Nolan Lawson 4bd181d3cc
fix: update Sapper to latest (#775)
* fix: update to latest sapper

fixes #416

* fix error and debug pages

* requestIdleCallback makes column switching feel way nicer than double rAF

* add export feature

* add better csp info

* workaround for sapper sub-page issue

* clarify in readme about exporting

* fix now config

* switch from rIC to triple raf

* style-loader is no longer used

* update theming guide
2018-12-11 07:31:48 -08:00