Commit graph

14473 commits

Author SHA1 Message Date
Tor Lillqvist
761ea64851 tdf#141217: Fix several keyboard shortcut problems on iOS
On Apple devices shortcuts like Copy, Paste, etc use the Cmd key
(also known as the ⌘ key), not the Ctrl key. We shouldn't check
KeyboardEvent.ctrlKey but e.metaKey. Introduce a function _isCtrlKey
that checks the proper property depending on platform.

That Cmd-V still doesn't work for plan text put on the pasteboard by
another app needs to be fixed in core.

Change-Id: I4e8a05afaed0bde193d00a7ded52fcebf3536b5f
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-03-25 11:01:25 +02:00
Gökay Şatır
f1aef821bd Scrollbar: Fix flickering.
Scroll bar animation was flickering after mouse leaves its area.

Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: Ie4d96d98dee806e6b02c8c8a23dd4eaccabbf7b0
2021-03-25 10:34:03 +03:00
Pranam Lashkari
cd1f4f6e95 leaflet: removed Obsolete property fullscreen
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Idb7742730294e6891e2971be8e63914c4985603b
2021-03-24 18:23:08 +05:30
Dennis Francis
58e207631c fix: avoid view jump after pinch zoom animation
Fix description:

The view jump is because after the zoom animation has ended, the map
center is set to the pinch center and not the last frame's center. The
patch computes the last frame's center and uses that to set the map
view's center. This only fixes the view jump and not the flicker after
the animation which is an independent issue.

Caveat:
Since we show only one discontinuous frame at the "final allowable zoom"
at the end of the zoom animation, there will be perceived view jump at
the end of the animation itself. This apparent if the user pays
attention to the contents of the document at the corners of the view
before and after the is pinch stopped. This jump is more pronounced if
the pinch zoom factor is much different from the "final-zoom".
Note: The final zoom is determined from the final pinch zoom as
var finalZoom = this._map._limitZoom(zoomDelta > 0 ? Math.ceil(this._zoom) : Math.floor(this._zoom));
--
A possible solution for this problem is to render a few frames at the
end of the animation that are closer to the "final zoom" from the where
the pinch left off.
--

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I0a6989248970aeb60acc451d9b0bc7a08a0dbf06
(cherry picked from commit 5b2daac61edb78150ad9700ce11fab8bdfb7dd27)
2021-03-24 11:49:06 +05:30
Gökay Şatır
1390411757 Socket.js: Refresh the page after a server restart.
Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: I81eec6d40368768ca1a53d57bfe0eb6136464b90
2021-03-23 20:46:19 +03:00
Pranam Lashkari
d0f8e5f74b leaflet: set German bold shortcut to ctrl+shift+f
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I97ff4d95250aad326b7d48635ab425045959ca5d
2021-03-23 13:41:05 +01:00
Tor Lillqvist
a51df73a95 Tweak ODF types in Info.plist, making ODF documents openable from Google Drive
Move the ODF entries for the ODF file types from the
UTExportedTypeDeclarations section to the UTImportedTypeDeclarations
section in the Info.plist. This, for some unclear reason, is necessary
to make ODF documents not appear greyed out for folders provided by
the Google Drive file provider extension. Sadly the documentation of
exact semantics of the Info.plist file leaves much to be desired.

This fixes https://github.com/CollaboraOnline/online/issues/1509

Change-Id: I7ff35cf9f6c717d1579adc7a4d7350f78d7bee8e
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-03-23 13:08:35 +02:00
Gökay Şatır
5f9d4216d3 ScrollSection.ts: Enable fade out.
When user moves cursor out of the scroll bar area or at the end of a
scrolling event, scroll bar will slowly disappear.

Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: Ic1c993869bdee3be342330c847b6d89e66784f69
2021-03-23 12:20:14 +03:00
Gökay Şatır
7c1cbeb385 CanvasSectionContainer: Add animation feature.
User can set stopping events, duration or they can directly stop, reset
the animation.

In order to use stoppingFunctionList, canvas element should get events.
Currently, CanvasTileLayer is calling callbacks of
CanvasSectionContainer.

So if one needs to use stoppingFunctionList, they should update _mirrorEventsFromSourceToCanvasSectionContainer
function and use "element.dispatchEvent" feature. We need this because
of leaflet.

I didn't change "_mirrorEventsFromSourceToCanvasSectionContainer"
function because it would have to be tested with different browsers. But
i tested the dispatchEvent feature in order to test
stoppingFunctionList.

Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: Ifb335d433af4656294223fa6c16378819abbb950
2021-03-23 12:20:14 +03:00
Ashod Nakashian
1fd0f7302b wsd: http: make writeData const
Change-Id: I43b7abd737836873300b2195b6bb8b703cc3ec64
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
601b1cbd8b wsd: http: use std::move where efficient
Change-Id: Ic99ce8fd3508b496d544ac9a1459853f985165b7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
0c9283a7ae wsd: http: set date and server/agent as early as possible
Change-Id: I2856d7502f63e04138e2d615347f343280690b42
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
b3f8657550 wsd: use http::Response to parse client websocket upgrade
Change-Id: I9e869fa22c7696f7ee903770579abe5f4e03d4fc
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
725a3070c3 wsd: tolerate missing FinishedCallback in http::Response
And explain the use of linear search in header().

Change-Id: If6c39bffa738861d0c86684f9560ed6e4a6970e1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
69436ed0f3 wsd: const correctness
Change-Id: I14118245e77d796ad494d5e576d2e2c593f6d742
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
f494c27024 wsd: correct User-Agent usage in http headers
User-Agent is designed for client-side use only,
in http requests. For servers, the Server header
is designed to announce the server name and version.

This tries to normalize the use and documents
the proper intent and usage.

Change-Id: I42d68d65611cab64c45adf03fe74f9466798b093
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
4bda1ff1d1 wsd: http: use writeData to serialize http::Request
Change-Id: Ib67f92c34d42d7cdb922cbfc47222040a6deb603
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
40b1aa1077 wsd: add member to Socket to flush safely
In many cases we write directly to the socket
outgoing buffer directly. The only way to flush
this buffer to the socket is to use send(),
which is artificial if we don't have any more
data to pass to send().

This makes it possible to safely call flush()
and, if there is buffered data, we flush it
to the socket.

Change-Id: I025e7ba5d1898e72dd0001547e104642608ab20a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
de0358198c wsd: http: better serialization into the socket buffer directly
This adds writeData() member to write into the output
buffer of the socket directly, instead of serializing
into a string and then copying it over to the buffer.

Change-Id: I42aaa23e96a6120c738bc0bb36bc01f4ed5e70c5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
38f2707881 wsd: test: http: improve HttpRequestTests
Change-Id: Ideaf8f1cad492fda6eab57bcefefac861a05e28a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
5749d7457d wsd: http: improve StatusLine
And update unit-tests.

Change-Id: I29bcb8232c77d3c0c1fe316854417726671765f1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
1f978d9b50 wsd: cleanup Poco headers
Change-Id: I1eec2301576fc2f1cde40389b1f858f80b1204c0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
b13b1e85ce wsd: http: log the hostname in warning
Change-Id: I3aa5e134002aafe2e0090e87f9e275130983450f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
58d9bcd685 wsd: http: map Status Codes to Reason Phrases
Change-Id: I96c953950a865fe35a17540889e4cc75c84870b1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
42f7796e68 wsd: prevent poco from inserting line breaks in hex bytes
An anti-feature, Poco's HexBinaryEncoder inserts
gratuitous line breaks (0x0A) every 32 bytes,
which is neither expected nor necessary.
No idea what use line breaks could have in a
hex encoder (unless it assumes it's only
possible use is to dump data for investigation).

We hadn't observed this because we generate
random hex strings of 8 to 16 bytes long.
But having used it for random URLs that
are up to 1024 bytes long, I started getting
invalid URLs.

Another reason to hasten the removal of Poco,
especially when we have our hex converter
anyway (not that it would matter if we didn't).

Change-Id: Ib674e8ed607db1effef476f1f3478da76c4f6464
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
97aa9a06e5 wsd: Util::toLower helper
Change-Id: Ibdf9c8e1becdaeac358fa53906593652e05ede72
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
d15528ea91 wsd: http: improved whitebox http tests
Change-Id: I42cd2f6f8ea08923c9f0facab7a51f84bff7f524
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
da07625352 wsd: http: parse the http header only
Previously, we were parsing the Status Line
and the header, both together. This of course
doesn't work when we had removed the Status
Line already. This wasn't an issue in parsing
responses from servers, but doesn't work when
parsing requests from clients (i.e. in a server).

Also, it's simpler.

Tests extended accordingly.

Change-Id: Id1c9a6385080c86b6072130fa8a169a699c42462
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
f7d5428f3c wsd: test: better http tests
Change-Id: I9cb6b91790951dcb20ccd6f3f4746d66aed5b72b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
b6314a6165 wsd: http: tolerate the absence of a reason phrase
Here we are more tolerant with regards to the
minimum Status Line length, since a Reason
Phrase is informative and might be omitted.

While technically it should be provided, per
the RFC, we shouldn't break when it's missing.

Change-Id: Ic702db61e5bf4272e18f09d127405033277e5943
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Jan Holesovsky
b6fb89c181 Revert "Action_Paste postMessage to work around the pasting mechanism."
This was not necessary in the end; and a bad idea in general probably,
so given that has never appeared in a release yet, let's revert it.

This reverts commit 5999a5b7cc.

Signed-off-by: Jan Holesovsky <kendy@collabora.com>
Change-Id: I5ee98ea85324f584db7de702a8d98ff9a6780027
2021-03-22 13:30:51 +01:00
Rash419
92f6f1ef85 loleaflet:prevent changing focus in sheet rename dialog when double click
Signed-off-by: Rash419 <rasheshpadia419@gmail.com>
Change-Id: I83b24045aa88eb0cc61ece1ca76fc0d677eb6a38
2021-03-22 17:28:10 +05:30
Tor Lillqvist
7f8eabdaaa Avoid duplicate events when ending tab stop drag in the iOS app
We don't need to have both a panend event (as generated by Hammer.js)
and a mouseup event cause the _endTabstopDrag function to be called
when ending a touch drag of a tabstop, especially as for the mouseup
event the result was that the tabstop jumped oddly from where you have
dragged it.

Also other simplifications of events used in the iOS app case. Likely
even further simplifications would be possible.

This does not perhaps fix what
https://github.com/CollaboraOnline/online/issues/732 specifically
mentions, but at least for me it makes moving tabstops in the iOS app
work much more reliably.

Change-Id: I14ff5baeb775f0017368c0c53300df39ab0ab6e6
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-03-22 10:28:51 +02:00
Szymon Kłos
75237836a0 ie11: fix pasting in vex and other ui inputs
it was not possible to paste or copy to/from
the insert hyperlink dialog or search field.
Fixes this problem also in other browsers

Change-Id: Id4cef6681a53e451eeb1f7d9e6d3b9c26b49d66f
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-22 09:27:06 +01:00
Dennis Francis
4f4de1258c we already update cursor on doclayer's zoomend callback
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ic23d772efa1beac31a920257ef08e597fdc668d4
(cherry picked from commit 9ff97f11b1682ff125870f89b6874fefaf1fc6f2)
2021-03-22 11:30:38 +05:30
Dennis Francis
8344165604 fix misleading name : isVisible() -> isDomAttached()
... and avoid functionality breakage.
This is important as we now need a real 'isVisible' state encoded as
private member 'visible' and this cannot no more be reused as "is cursor
DOM attached?"

So maintain another state variable 'domAttached' and introduce and use
its getter for all previous isVisible() calls.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ic952611c9bdc138414bd3361e3e166122b2842b8
(cherry picked from commit fd92f4f802744ccb22e3cb98f2e7409bf4970561)
2021-03-22 11:30:38 +05:30
Dennis Francis
5fd706cb80 fix: part of cursor shows up outside view area
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I8b2676b3b576609dce4f6edcb891f5ba85eeac97
(cherry picked from commit e92c7cf925ee4bcbf07dd355899722b51c3f0779)
2021-03-22 11:30:38 +05:30
Dennis Francis
bc4949dde8 fix: Other user's caret indicator shown even if it should be off-screen
Fix description:

Update the 'visible' flag if cursor has gone out of view. Also Sync the
visibility of the cursor with its header.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: If71736d1b042be12474dc4162a8a2db0d30613b7
(cherry picked from commit ce9f750a05bf3fdcf7771e72400dd57168eb5fb9)
2021-03-22 11:30:38 +05:30
Dennis Francis
0247bd4948 fix: don't crash if view message don't exist
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I409c6e63aed864d30a802fb64a352352b172a12a
(cherry picked from commit 17bc92f8210c80660582aba1b014ba3bdb6fc110)
2021-03-22 11:30:38 +05:30
Dennis Francis
beca044440 fix crash when user with selection leaves
Fix description:

Only try to update the view selection drawing if map still has a record
for that view.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I59c389f9034c4481ea1cc4d07bf46b36e52db40d
(cherry picked from commit 1f482119062a9bfc9fb865c6faa59033126d5cea)
2021-03-22 11:30:38 +05:30
Dennis Francis
8939abf3a3 fix: cell selector of another user not always shown
Problem description:

* Open a spreadsheet, then switch to another sheet,
* Open the same spreadsheet with another view (view B),
* Wtih view B, switch to the other sheet where view A is, and click on a
  different cell.
* View A's cell selector should be shown on the cell view B clicked away
  from in the last step, but it isn't.

Fix description:

The "view" messages (view-cursor and view-selections at least) need to
be replayed after a sheet switch to update(add or remove in this case)
the overlays.  Also make sure when view cell cursors are removed from
overlay renderer, they are removed from the doc-layer cache too.

This also restores d11bea88f862eddb1e9ecf65dbaf0fd23fa89881 to let
joining user's cursor be visible on already existing views.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ib97cf1ef7014d0cecb444823c9ff0abc6b2c8f3a
(cherry picked from commit 1dad869e7748addb82736d553434508a3fcb7f6c)
2021-03-22 11:30:38 +05:30
Szymon Kłos
0ebca74c45 Fix document container sizing problems
this will position correctly canvas espacially with groups
in Calc both on desktop and tablets. Simplify the code.
Also fix incorrect size of the canvas on tablets:
if we update 'left' property of the container, recalculate size

Change-Id: I9000839370ff8bc136094517b80bdf350a0db467
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-19 16:48:33 +01:00
Szymon Kłos
db6d3b68ae Send init uno command always on load
Before it was sent for mobile and tablet only after
entering the edit mode what caused to not showing
the rows/cols in calc on tablet in readonly mode

Change-Id: Iefbdbe66c543faa56228a6ec8eed4b84fe417c4a
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-19 16:48:33 +01:00
Szymon Kłos
01c72e6e45 Avoid null usage
- when in readonly mode on tablet

Change-Id: I38e6d08e5463c18719bed0df15b414490b295ae5
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-19 16:48:33 +01:00
Szymon Kłos
fd3180e013 ie11: position correctly tunelled child windows
position: fixed in IE11 doesn't work as in other browsers
so calculate absolute position instead of relative

Change-Id: I1ed07a26ba924273e527694e7d982f3814752400
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-19 16:42:36 +01:00
Szymon Kłos
9f04584ee3 ie11: can't use css vars
IE11 doesn't support custom css vars so we values
were not read. use standard properties instead.

Change-Id: I3d1ccd74cc54a048e30431d162b5b80a49b5e06f
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-19 16:42:36 +01:00
Szymon Kłos
c77e59d992 ie11: Number contants polyfill
Change-Id: I4802eb1c4875a9aa169017f0f3154dc3603fbf15
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-19 16:42:36 +01:00
Szymon Kłos
e1bdd0aa0a ie11: jsdialog: icon view without flex support
Change-Id: I6c646749e71ac9b6c8e771de200a5e9cd8fca3ff
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-19 16:42:36 +01:00
Szymon Kłos
c06ddc33dc ie11: do not use Array.includes
IE11 doesn't support Array.includes but we can't add
polyfill to the prototype because then we will break
all code which iterates over arrays (it will iterate
also over added method...) so add member function here

Change-Id: I122204b3621a76f5678088e3fda6f44de611f5a4
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-19 16:42:36 +01:00
Szymon Kłos
cd3e52d81c ie11: check reference before usage
Change-Id: I50e50bf9cf8d0296956af6d237b502cc7869c251
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-19 16:42:36 +01:00