Commit graph

68 commits

Author SHA1 Message Date
Bruno Windels
f8f1d49c56 polyfill String.matchAll for IE11
See https://github.com/babel/babel/issues/10816
Don't really understand how or why this works, but it did
2021-05-31 13:04:03 +02:00
Johannes Marbach
452a0e7bda Merge branch 'master' into feature/librejs 2021-04-28 20:22:20 +02:00
Johannes Marbach
37bb078547 Add license comments to make GNU LibreJS accept Hydrogen's JS
This adds proper license comments to all _internal_ JS scripts in the /target
build. This way the code self-identifies as Apache-2.0 which prevents LibreJS
from blocking it.

Closes: #209

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2021-03-27 14:19:58 +01:00
Johannes Marbach
14ed5fd1e8 Manually adapt UI when keyboard shows or hides on mobile Safari
Mobile Safari seems to be the only browser that does *not* resize the
viewport when the keyboard shows and hides. Instead the window is moved
to make room for the keyboard which moves content at the top off screen.

This uses the VisualViewport API to manually resize the `SessionView`
in response to keyboard display events. Additionally, if a DOM element
exists that has the `bottom-aligned-scroll` CSS class, its scroll
position is retained. Currently this only applies to the `Timeline`.

Note that the VisualViewport API was only introduced with iOS 13.
According to [statista.com], versions below 13 made up for 19% of
all iOS users in summer 2020, with the share continuing to fall off.
As a result, this seems like an acceptable workaround.

Fixes: #181

[statista.com]: https://www.statista.com/statistics/565270/apple-devices-ios-version-share-worldwide/

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2021-03-26 08:29:33 +01:00
Bruno Windels
2a0045bed7 support override main css file 2021-03-25 18:54:10 +01:00
Bruno Windels
cd615265f8 support overriding imports for customizations 2021-03-25 18:08:47 +01:00
Bruno Windels
165532be30 add badge icon to notifs 2021-03-25 00:12:57 +01:00
Bruno Windels
178790d816 symlink service worker for local dev, so its scope captures whole app
also rename service worker (as it is not a template anymore)
2021-03-23 18:20:23 +01:00
Bruno Windels
a8ca82ca4d support running the service worker during local development 2021-03-23 18:20:23 +01:00
Bruno Windels
f92f3b2c21 copy push config in build script 2021-03-23 18:20:23 +01:00
Bruno Windels
4477073d6d add platform method to offer saving a buffer handle 2020-11-10 17:24:30 +01:00
Bruno Windels
22a88d06b4 fix build 2020-10-26 15:56:06 +01:00
Bruno Windels
03351d2e1f extract platform class to put all platform specific code in 2020-10-26 15:44:11 +01:00
Bruno Windels
101c7015f2 move service worker code in bundle, and support closing sessions 2020-10-16 12:49:42 +02:00
Bruno Windels
3aa1992a3f WIP of messaging to sw 2020-10-15 19:12:16 +02:00
Bruno Windels
a94b099819 cache legacy js on request 2020-10-15 16:18:09 +02:00
Bruno Windels
0f71564d65 also make changes in index.html and sw.js trigger an update 2020-10-15 15:58:29 +02:00
Bruno Windels
eaaf18fb82 set icon on iOS 2020-10-15 11:17:33 +02:00
Bruno Windels
47a43869e6 fix grid layout in IE 11
this brings back index addressing rather than x y in the grid vm,
as we need to have a css class for every position for IE 11,
as we can't use css variables and autoprefixer can
translate grid-areas
2020-10-08 14:17:43 +02:00
Bruno Windels
423a463cd6 disable css variables transformation as it breaks the grid layout f/ now 2020-10-07 18:00:26 +02:00
Bruno Windels
e70f0d3e89 fix regeneratorRuntime being loaded too late 2020-10-06 12:56:20 +02:00
Bruno Windels
8dc2816d6e keep hashed files in cache as long as they don't change 2020-10-02 19:54:24 +02:00
Bruno Windels
dff8ddb532 remove logging 2020-10-02 09:34:12 +02:00
Bruno Windels
38a30bcc49 targetDir doesn't need to be global anymore 2020-10-02 09:33:57 +02:00
Bruno Windels
441bfa4890 also write unhashed assets from asset map 2020-10-02 09:33:48 +02:00
Bruno Windels
4a19c8d575 move asset writing into AssetMap as well 2020-10-02 09:33:07 +02:00
Bruno Windels
07b6458f19 track assets centrally in build script 2020-10-01 19:21:27 +02:00
Bruno Windels
6d003f9565 don't include corejs promise polyfill anymore 2020-09-28 15:28:22 +02:00
Bruno Windels
ae2f9c6332 extract manifest out of build script and have both (non)-maskable icons
also make PWA standalone instead of fullscreen as that doesn't seem
to play well with the onscreen keyboard on mobile
2020-09-24 11:15:15 +02:00
Bruno Windels
ab01c903a6 turns out that rollup-plugin-cleanup doesn't like line 259 in aes-js
so don't remove comments for now in the legacy build
2020-09-17 09:36:37 +02:00
Bruno Windels
77a21c08eb add legacy extras, so deps only needed for legacy are not in main bundle 2020-09-16 18:31:17 +02:00
Bruno Windels
c91290fac2 set theme color as well for pwa 2020-09-14 17:10:52 +02:00
Bruno Windels
9212a1313e add new icon 2020-09-14 17:08:51 +02:00
Bruno Windels
b8ce97e739 remove duplicate code in build script 2020-09-11 10:44:08 +02:00
Bruno Windels
af36c71a59 load worker in main and pass paths so it works both on compiled and non-compiled 2020-09-10 18:41:23 +02:00
Bruno Windels
fdbc5f3c1d WIP worker work 2020-09-10 13:00:11 +02:00
Bruno Windels
18a8f291dc make build script work on windows 2020-09-09 10:32:05 +01:00
Bruno Windels
e8efd52223 Merge branch 'master' into bwindels/e2ee 2020-08-27 20:04:49 +02:00
Bruno Windels
d51d43abfe use xxhashjs instead which will also work on windows 2020-08-27 20:02:20 +02:00
Bruno Windels
92fdbe15df pass olm paths to main fn
so build can adjust the file paths,
and we can prevent olm from loading by not passing them
2020-08-27 13:24:04 +02:00
Bruno Windels
6813fd2264 upgrade from rollup v1 to v2
so we can use ?. optional chaining
2020-08-19 11:27:35 +02:00
Bruno Windels
520dac7cec dont use mjs extension for ES modules, some (most) servers serve them with the wrong mimetype 2020-08-18 12:16:51 +02:00
Bruno Windels
a094abf4da remove comments in js bundles, saves ~100kb 2020-08-18 11:47:20 +02:00
Bruno Windels
c73d6bb3cb serve modern browsers a more compact ES6 bundle 2020-08-18 11:42:13 +02:00
Bruno Windels
3c4805b267 also content-hash the webapp manifest 2020-08-14 11:06:39 +02:00
Bruno Windels
0104e14e0b map urls in theme css bundles to their content-hashed counterparts 2020-08-14 10:45:14 +02:00
Bruno Windels
044360afaa add content hashes to build assets 2020-08-13 18:59:31 +02:00
Bruno Windels
e1a5c362dc add theme assets to offline definition 2020-08-12 16:40:28 +02:00
Bruno Windels
fc8d2efaf2 build theme css bundles 2020-08-12 16:39:35 +02:00
Bruno Windels
c3dc01283d copy theme assets
anything that is not a css file, which will be bundled
woff(2) files are treated specially since we only need WOFF
for legacy (IE11) and only WOFF2 for any modern browser.
2020-08-12 16:37:55 +02:00