Commit graph

1154 commits

Author SHA1 Message Date
Newbyte e112e9c2d2 Use submit event for login trigger
Signed-off-by: Newbyte <newbie13xd@gmail.com>
2020-11-05 11:21:04 +01:00
Newbyte 3ab70861cc Add form to element list
Signed-off-by: Newbyte <newbie13xd@gmail.com>
2020-11-05 11:21:04 +01:00
Bruno Windels 0003ddebb5 also fix grid layout 2020-11-03 09:12:11 +01:00
Bruno Windels 9131cf00a3 load images when they becomes partly into view 2020-11-02 14:49:59 +01:00
Bruno Windels 72fdce4a86 fix broken layout after changing to grid 2020-11-02 14:15:24 +01:00
Bruno Windels a3ec01385b
Merge pull request #178 from vector-im/bwindels/lightbox
Lightbox for picture messages
2020-11-02 11:23:10 +00:00
Bruno Windels f1b557f995 add comment 2020-11-02 11:29:22 +01:00
Bruno Windels fd28b39e23 fix spacing between spinner and loading text in lightbox 2020-11-02 11:29:09 +01:00
Bruno Windels 7e9e937742 IE11 doesn't calculate padding percentages based on parent width in grid
so do progressive fallback. This won't scale the height of the
image tile height, but it will still scale the thumbnail
on narrow viewports, leaving a blank space underneath the image.
2020-11-02 11:16:35 +01:00
Bruno Windels fbbdaf7dfa expose IE11 flag in JS as well 2020-11-02 11:16:19 +01:00
Bruno Windels 57da68fb1e padding for lightbox 2020-10-31 00:25:51 +01:00
Bruno Windels 4d08e415bd fallback for IE11 2020-10-31 00:25:42 +01:00
Bruno Windels 8507a3eb16 prevent jumps when image loads by adding a spacer 2020-10-31 00:25:05 +01:00
Bruno Windels 5aa2c7dc5c dom changes for timeline image view 2020-10-30 22:52:54 +01:00
Bruno Windels 5a31bc5f2b basic focus trapping of lightbox 2020-10-30 22:52:32 +01:00
Bruno Windels 708893022a use justify/align-self rather than auto margins, works better in IE11 2020-10-30 22:52:08 +01:00
Bruno Windels a21765757d don't use position: absolute for scaling images in the timeline
as it bleeds through the lightbox on IE11, and is a bad idea anyway
2020-10-30 22:51:57 +01:00
Bruno Windels 581dc95c53 allow adding custom event handlers to a template view
so you don't have to remove them yourself
2020-10-30 22:48:56 +01:00
Bruno Windels c847cfb200 WIP: Esc key on lightbox 2020-10-30 19:59:42 +01:00
Bruno Windels 597a57eae3 too much whitespace 2020-10-30 19:59:21 +01:00
Bruno Windels c9147e6b9a implement first draft of image lightbox 2020-10-30 15:20:11 +01:00
Bruno Windels 137264edcb implement subscribing to a single event 2020-10-30 15:19:51 +01:00
Bruno Windels 7d81306a49 return BufferHandles from the media repository
BufferHandles are platform specific handles to a buffer. On web,
they have a .blob and .url property.
2020-10-30 15:18:27 +01:00
Bruno Windels 0691f34650 detect abort error by name here too 2020-10-30 09:55:03 +01:00
Bruno Windels 3008367307 detect AbortError properly, name is a string 2020-10-30 09:54:38 +01:00
Bruno Windels 68a0dd30ca add lightbox navigation and basic view & view model 2020-10-29 11:12:32 +01:00
Bruno Windels fe6e4464fd pass all viewmodel options to tile view models 2020-10-29 11:10:34 +01:00
Bruno Windels d7ccdd3304 switch main layout from flexbox to grid so we can overlay a lightbox 2020-10-29 11:10:34 +01:00
Bruno Windels 862a0ba56b show image decryption error 2020-10-29 10:29:08 +01:00
Bruno Windels d1e78a735a show error in label for now 2020-10-29 10:18:05 +01:00
Bruno Windels 0405af0116 disable click-to-zoom on image
so we can release before the lightbox ix ready
2020-10-29 10:17:19 +01:00
Bruno Windels b69464b87d improve picture styling 2020-10-27 16:47:22 +01:00
Bruno Windels d55f38a9e9 don't reimplement removing an item from the list 2020-10-27 16:26:45 +01:00
Bruno Windels 97c3a4b8f3 store error when loading encrypted images 2020-10-27 16:21:08 +01:00
Bruno Windels e7ff6decbf remove unneeded quotes 2020-10-27 16:20:41 +01:00
Bruno Windels c9efee77f2 if shape is update and item should be different view, recreate the tile 2020-10-27 16:20:04 +01:00
Bruno Windels 77dca5dd55 add update parameter when replacing tile 2020-10-27 16:19:36 +01:00
Bruno Windels 932542bea0 some more cleanup 2020-10-27 14:35:47 +01:00
Bruno Windels fcc4c21ad2 filter mime types for blob urls 2020-10-27 14:35:33 +01:00
Bruno Windels ade01f6cf7 space 2020-10-27 13:51:40 +01:00
Bruno Windels 2ebce8eb7b set responseType after calling open 2020-10-27 13:50:09 +01:00
Bruno Windels a61d7fc68a jwk key support for aesjs 2020-10-27 13:21:12 +01:00
Bruno Windels a3aa25449b make it work with xhr 2020-10-26 17:37:32 +01:00
Bruno Windels ee1e62207c apply platform changes to decrypting images 2020-10-26 17:18:17 +01:00
Bruno Windels 3ed5ea8b0b Merge branch 'master' into bwindels/decrypt-images 2020-10-26 17:08:29 +01:00
Bruno Windels 98be9a8f4d fix legacy spinner 2020-10-26 16:44:12 +01:00
Bruno Windels 1a518cdd28 more refactor fixes 2020-10-26 16:31:30 +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 46fd769dda (re)move old (compile-time) platform code 2020-10-26 10:34:35 +01:00
Bruno Windels 06e4dea590 move ui and dom under platform/web 2020-10-26 10:28:11 +01:00
Bruno Windels 2e0d1363c7 fix 2020-10-26 10:16:23 +01:00
Bruno Windels a6224135e3 extract blob url code to platform (WIP) 2020-10-26 10:14:46 +01:00
Bruno Windels 4fd71279cf don't disable cache for media repository downloads 2020-10-26 09:58:39 +01:00
Bruno Windels cbd48aa528 only load main image when clicking thumbnail 2020-10-26 09:49:42 +01:00
Bruno Windels 6a468a0883 decrypt attachment code 2020-10-23 17:45:15 +02:00
Bruno Windels 3a6268f0c1 basic PoC of image decryption working
needs looooaaads of cleanup still
2020-10-23 17:25:11 +02:00
Bruno Windels f214c53fa9 add @internal and other comments to Session 2020-10-23 12:59:40 +02:00
Bruno Windels 62c8d6574c fix index.html not being restored from cache when offline on #hash url 2020-10-23 12:58:45 +02:00
Bruno Windels df8eed14aa expose whether we already have a 4s key,to show the 4s setup in settings
it's a tri-state of null/false/true with null meaning we need to
go online first to know as only then we try to setup session backup
2020-10-23 12:57:47 +02:00
Bruno Windels df72e829bf setup session backup as part of start method, so we know we're online
also don't upload OTKs in case of existing account until
catchup sync has happened
2020-10-23 12:22:52 +02:00
Bruno Windels f1aef6c034 render should return nodes otherwise the mapView binding doesn't work
this broke e2ee messages appearing when decrypted
2020-10-21 12:10:42 +02:00
Bruno Windels 7459985e00 show storage usage in settings 2020-10-20 17:50:43 +02:00
Bruno Windels 545a2e481a prevent cached thumbnails from being opaque responses
fixes https://github.com/vector-im/hydrogen-web/issues/169
2020-10-20 17:28:42 +02:00
Bruno Windels a7a922680d request persisted storage when logging in/restoring a session 2020-10-20 17:02:34 +02:00
Bruno Windels 2b93d50396 dont crash when value is undefined 2020-10-20 16:51:51 +02:00
Bruno Windels 4dd303e558 remove unused code 2020-10-20 15:29:36 +02:00
Bruno Windels 1e1b254678 adjust prop names 2020-10-20 15:26:22 +02:00
Bruno Windels 601bdbb25d make session backup banner dismissable 2020-10-20 14:42:17 +02:00
Bruno Windels 446d30469b improve wording and cleanup 2020-10-20 12:12:07 +02:00
Bruno Windels 98d7ffe87c add button to set up field 2020-10-20 12:11:58 +02:00
Bruno Windels 16e0f515dc make text not sprawl across screen on large monitors 2020-10-20 12:10:56 +02:00
Bruno Windels 6f09bd97b6 move setting view models in own dir / file 2020-10-20 12:10:41 +02:00
Bruno Windels 6f82d81f39 better session backup ui 2020-10-19 18:29:13 +02:00
Bruno Windels d3b7d176b8 extract SettingsView into own file
also fix some copyright attributions
2020-10-19 14:55:01 +02:00
Bruno Windels 1fe3f646dc further style settings page 2020-10-19 14:53:05 +02:00
Bruno Windels d8f8342a10 make middle panel responsive styling + hide back b. + header css generic 2020-10-19 14:52:18 +02:00
Bruno Windels 1e599be142 Merge branch 'master' into bwindels/settings-screen 2020-10-19 13:45:17 +02:00
Bruno Windels 6bf8e976cb don't assign timelineVM before loaded, so prop doesn't return it
... if the binding happens to be evaluating (which it was during mount)

follow-up from bwindels/fix-crash-switch-rooms-too-fast
2020-10-19 13:39:19 +02:00
Bruno Windels f07b4a6554
Merge pull request #167 from vector-im/bwindels/fix-redirects
Fix back button not working when changing rooms
2020-10-19 11:01:07 +00:00
Bruno Windels cdcdc07c06 fix a crash when switching rooms before the messages have loaded
as we were not disposing the timeline view model
(but still not leaking though)
2020-10-19 12:57:21 +02:00
Bruno Windels 8357260133 fix an applying an url also pushing a copy of the url back on history
it should replace instead, as it is a redirect
2020-10-19 12:55:42 +02:00
Bruno Windels fb273782bf use handleEvent in History so we don't have to bind 2020-10-19 12:55:10 +02:00
Bruno Windels 3e34ccb7e1 rename, I think, last occurrence of brawl to hydrogen 👋 2020-10-19 12:52:57 +02:00
Bruno Windels db102e63d2 Merge branch 'master' into bwindels/settings-screen 2020-10-19 10:13:41 +02:00
Bruno Windels 90910dae15 render multiline messages with br's 2020-10-19 10:00:32 +02:00
Bruno Windels 4828e141c9 add br tag to html template 2020-10-19 10:00:18 +02:00
Bruno Windels efe6956a79 support render method and value in StaticView 2020-10-19 09:59:56 +02:00
Bruno Windels 974f77a71d WIP 2020-10-16 18:06:20 +02:00
Bruno Windels 90435a8fb7 semicolons, add them 2020-10-16 15:48:49 +02:00
Bruno Windels e599d8b6fa also clear 2020-10-16 15:47:13 +02:00
Bruno Windels 74e6d018f4 ensure url creation does not race on the current path of the navigation 2020-10-16 15:46:06 +02:00
Bruno Windels 0ca926d427 claim clients immediately from service worker 2020-10-16 14:52:34 +02:00
Bruno Windels 743cdd0bea safari is tooo fast and skips it when it shouldn't
also, I've never had the registration fail, seems very unlikely
2020-10-16 13:26:19 +02:00
Bruno Windels c125335ef0 undo debug squibels 2020-10-16 13:03:16 +02:00
Bruno Windels 5a30855227 rename urlRouter option in view models to urlCreator 2020-10-16 13:02:21 +02:00
Bruno Windels 0d622164df close session db in other tabs when opening 2020-10-16 12:50:37 +02:00
Bruno Windels fc61729cb3 support closing session in other clients in service worker 2020-10-16 12:50:19 +02:00
Bruno Windels 101c7015f2 move service worker code in bundle, and support closing sessions 2020-10-16 12:49:42 +02:00
Bruno Windels 788bce7904 reduce navigation boilerplate
this makes the url router adjust the url when the navigation path is
changed, instead of doing urlRouter.applyUrl() and
urlRouter.history.pushUrl().

This history field and applyUrl method on URLRouter are now private,
as the URLRouter should only be used to generate urls you want to
put in an <a href="..."></a>, anything else should use navigator.push()
2020-10-16 12:46:14 +02:00
Bruno Windels ddf7d01760 WIP working 2020-10-15 21:35:10 +02:00
Bruno Windels 3aa1992a3f WIP of messaging to sw 2020-10-15 19:12:16 +02:00
Bruno Windels 6b15e7e3ba remove extra newline 2020-10-15 15:58:59 +02:00
Bruno Windels 5fcf8022a1 store the url on every change, as PWAs don't trigger beforeunload ...
... when (force) closed
2020-10-14 15:30:40 +02:00
Bruno Windels 3d8dfc9635 also show grid layout in mobile layout, just in case of restoring url 2020-10-14 15:29:51 +02:00
Bruno Windels 7c2fc516bb restore last url if not providing a specific one on startup 2020-10-14 15:10:32 +02:00
Bruno Windels 19e774ce01 don't assume grid button is a button, just in case 2020-10-14 14:54:56 +02:00
Bruno Windels 4f46854362 add close session button 2020-10-14 14:54:46 +02:00
Bruno Windels d96f8adcc7 fix back button in room header not working 2020-10-14 14:53:52 +02:00
Bruno Windels cf99f55f3d fix typo making the room list not shown on the mobile layout 2020-10-14 14:20:53 +02:00
Bruno Windels fd1df595c8 remove leftover logging 2020-10-14 14:06:11 +02:00
Bruno Windels 8122d76e73 Merge branch 'master' into bwindels/url-routing 2020-10-14 12:45:49 +02:00
Bruno Windels b00db1af3e only keep 20 outbound olm sessions in memory at once to prevent OOM 2020-10-14 12:44:27 +02:00
Bruno Windels 07701117cd reduce megolm sync cache size to 1 session
as this is kept around for every e2ee room, and we only have
limited olm memory
2020-10-14 12:43:35 +02:00
Bruno Windels 6ad7be8726 fix leaking left panel view model after closing session 2020-10-14 11:34:34 +02:00
Bruno Windels de83d7740b replace custom error view with staticview 2020-10-14 11:26:39 +02:00
Bruno Windels fa8bec0b56 fix room view model being leaked when closing session 2020-10-14 11:26:10 +02:00
Bruno Windels b29b776e9f fix olm session cache being leaked when closing session 2020-10-14 11:25:49 +02:00
Bruno Windels 789a41c671 fix styling for session info entries 2020-10-14 10:34:25 +02:00
Bruno Windels 692fa808e4 make utility buttons also useable for links 2020-10-14 10:34:11 +02:00
Bruno Windels 7e477b3c8d rename button.styled to .button-action so it can also be used for links 2020-10-14 10:33:48 +02:00
Bruno Windels 5fe479e8a9 fix styling for room list items 2020-10-14 10:20:20 +02:00
Bruno Windels 3d327b0875 also open the initial room in the room list 2020-10-14 10:20:00 +02:00
Bruno Windels 2333a959a2 actually apply the /session/<id> url after login! 2020-10-13 17:10:28 +02:00
Bruno Windels ab354e9f38 update prop type 2020-10-13 15:19:54 +02:00
Bruno Windels afbfb0c82c anticipate non-found rooms 2020-10-13 15:18:13 +02:00
Bruno Windels 081820d8fb also update view when going to an not-found room 2020-10-13 15:14:07 +02:00
Bruno Windels a14795e3f8 unused 2020-10-13 15:05:11 +02:00
Bruno Windels d1d675ed7a make navigation observables already return new value before they emit 2020-10-13 14:54:57 +02:00
Bruno Windels 7f3e0f237b also do redirect after initial navigation 2020-10-13 14:43:45 +02:00
Bruno Windels 1780f334ea more tests 2020-10-13 13:13:47 +02:00
Bruno Windels d9c8a6339e support empty strings for rooms segment 2020-10-13 13:13:35 +02:00
Bruno Windels 7b13e45e19 fix creating the rooms segment 2020-10-13 13:13:15 +02:00
Bruno Windels a360d0a2b9 also unset room vm if moving away from room 2020-10-13 13:12:49 +02:00
Bruno Windels 379d65edf1 also create new vm when coming for grid if transfering vm fails 2020-10-13 13:12:30 +02:00
Bruno Windels 77a58041eb clean-up room grid initialization with vm transfering
also handle duplicate rooms, and add unit tests for grid vm
2020-10-13 13:11:19 +02:00
Bruno Windels c8dd7b42e7 encountered this very unlikely race while testing, so prevent it 2020-10-13 13:10:35 +02:00
Bruno Windels db5c98a706 support reassigning to null from untrack 2020-10-13 13:10:27 +02:00
Bruno Windels 4e8e9eae26 first round of fixes 2020-10-12 18:31:55 +02:00
Bruno Windels 14d2dcbc60 remove dead code 2020-10-12 17:49:41 +02:00
Bruno Windels b2d6b7014b first draft of url navigation for grid 2020-10-12 17:49:06 +02:00
Bruno Windels 6c2c29a7da WIP 2020-10-09 19:43:11 +02:00
Bruno Windels 83ac3eccc5 apply url changes to view gallery 2020-10-09 17:04:25 +02:00
Bruno Windels 56e51fc2aa idea comment 2020-10-09 17:04:17 +02:00
Bruno Windels 927e8134d3 use url navigation in root view model
also track all view models as it is
important everything is properly disposed now
2020-10-09 17:03:38 +02:00
Bruno Windels 33627edcb3 use url to go back in login view 2020-10-09 17:03:24 +02:00
Bruno Windels 35e85c55e0 use urls instead of callbacks to navigate in session picker 2020-10-09 17:03:13 +02:00
Bruno Windels 7b86b483ed confirm before clearing 2020-10-09 17:02:19 +02:00
Bruno Windels 3ab68ef438 throw when something tracked is not disposable, fail early 2020-10-09 17:01:54 +02:00
Bruno Windels 1289f065d6 implement root view as template view 2020-10-09 17:01:39 +02:00
Bruno Windels 0f8f558889 dispose session container from view model 2020-10-09 17:01:22 +02:00