Commit graph

5555 commits

Author SHA1 Message Date
Andras Timar
84259a9eb6 loleaflet: updated translations
Change-Id: I99f6fab9d8a22d13aac237ecaea3acfa5d630c4d
Reviewed-on: https://gerrit.libreoffice.org/36720
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2017-04-20 10:59:36 +02:00
Pranav Kant
ee683c106c loleaflet: Fix incorrect variable usage in this loop
Change-Id: I586ad59874b901d31b6e138a74577ecf3e1920c3
2017-04-20 12:43:39 +05:30
Pranav Kant
702bcdcf8d Surely, it is supposed to be update, not upate
Change-Id: I5d576ec0ae6976cb915b1c458546bbf82bf9fe8f
2017-04-20 12:43:39 +05:30
Ashod Nakashian
876e409835 wsd: unittest for correctly saving in presence of passive clients
Passive clients that don't load the document can
be disruptive as they are not useful for saving
the document, so we need to ignore them and
use reliable sessions.

Change-Id: I162ec00823ba5af776fcb55f6d58149f2a56d7bb
Reviewed-on: https://gerrit.libreoffice.org/36712
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-20 06:44:47 +02:00
Ashod Nakashian
2a0253b76b wsd: stop the DocBroker when saving session is last
When a session is disconnecting and we use it to save
(because the other sessions are not viable for saving),
then we need to correctly detect if by the time
saving is done there are no other sessions left.

Otherwise, we end up thinking there are other sessions
when the others had been disconnected during saving.

Change-Id: I55687376f5237a495ae163b53f51ee1d2414d770
Reviewed-on: https://gerrit.libreoffice.org/36711
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-20 06:44:36 +02:00
Ashod Nakashian
f326a058d4 wsd: rely only on loaded sessions for saving
If a session is not loaded, it might never
do so. We should skip them when deciding
whether to save using a disconnecting
session or rely on another.

This is to avoid failing to save when
the remaining sessions never really load
the document at all, and are therefore useless.

Change-Id: I4e7127e12960a31e9f66e835bb63fb2347390711
Reviewed-on: https://gerrit.libreoffice.org/36710
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-20 06:33:17 +02:00
Ashod Nakashian
bc03237316 wsd: fix verbose test output
Change-Id: I089c31555a90c99c89745529c6df6552fd0bd7f9
Reviewed-on: https://gerrit.libreoffice.org/36709
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-20 06:26:40 +02:00
Henry Castro
b142e0ba48 loleaflet: add option no menu when insert new annotation
Change-Id: I0950c743f9443f85674fb087c44c8fe942bcc322
2017-04-19 21:11:28 -04:00
Aron Budea
33a562515b Show font/highlight color on toolbar in IE 11 as well
.repeat is not supported.

Change-Id: I4f9d75f851f73e4cc626ca6f0a13aa1877308e70
Reviewed-on: https://gerrit.libreoffice.org/36553
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2017-04-20 02:27:24 +02:00
Henry Castro
30f8254e88 loleaflet: remove unnecessary spreadsheet context menu items
It is replaced by interactive client side annotations

Change-Id: Ib21926bea1cf125c82b9254c536d70ec94d95f91
2017-04-19 20:20:15 -04:00
Adolfo Jayme Barrientos
566c3adee9 Update Spanish translation (styles, synched from core)
Change-Id: I0262fb34860d23d149cc1127982160815d1d831e
2017-04-19 16:16:08 -05:00
Henry Castro
516fb8ae9c loleaflet: extend document size to scroll annotations
Change-Id: I9581818628c365587a4a115b9d3f0b457b8a6905
2017-04-19 15:00:06 -04:00
Katarina Behrens
6416fe9d1b Check if npm is installed and detect buggy version
shrinkpack won't work with npm versions between <3.9.0, 3.10.3>,
for details, see https://github.com/JamieMason/shrinkpack/issues/45

Change-Id: I65e1413f2ba24cc81736c12924afb20ca50004be
Reviewed-on: https://gerrit.libreoffice.org/36640
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-04-19 16:19:58 +02:00
Pranav Kant
78fd7f6ffd loleaflet: Select change tracking comments; hidden overlay
Make this overlay interactive, but we don't want to color this overlay
since LO core already colors redlines in tiles for us.

Change-Id: I46077f5b6a28cdd492325b8ab3014fb25ecd94ec
2017-04-19 19:39:55 +05:30
Pranav Kant
4a8caa40e8 loleaflet: Select and deselect comment upon mouse click
Make comment overlays clickable and when clicked select the
corresponding annotation. Also deselect when clicked where there is no
comment overlay.

Change-Id: Id9236862eec86b7508978ad8fe803455e03adbe2
2017-04-19 19:13:25 +05:30
Pranav Kant
0fb2c19014 loleaflet: Animate child elements together with their parent
Create the new L.PosAnimation object everytime you want to animate, not
just use the same everytime which has the limitation that animation
doesn't happen simultaneously.

Change-Id: If5f63702afe0fee7f44c8cf4605179d68de289e8
2017-04-19 18:10:00 +05:30
Pranav Kant
b864b562cf Revert "loleaflet: Remove box-shadow from comments"
This reverts commit 86be5a24a5.

Change-Id: I272b9a88e29a8ab77e93dfc36c6e3aec9c91a1a6
2017-04-19 15:22:18 +05:30
Jan Holesovsky
47ca32beb5 We never call setNoDelay() with false.
Change-Id: I865027300559b185222f21faa48ccd32100bd02d
2017-04-19 11:07:55 +02:00
Michael Meeks
f72b7d2ba1 Don't set the buffer size to zero.
This slows things down terribly, particularly the setting on the websocket
made tiles appearing one by one. Let's keep the possibility to zero the buffer
sizes for debugging, but hide that behind an env. variable (and in debug
builds only anyway).

Change-Id: Ie4d2cdb3c0ec3c50f1a2b4f9941a462ac4f2d196
2017-04-19 10:58:18 +02:00
Aditya Dewan
41ed318de8 tdf#106449 admin:adding user list for each document
Change-Id: Ia5c382f469a80464d0435e1e2e4de3daaba8a690
Reviewed-on: https://gerrit.libreoffice.org/36275
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-04-19 08:17:11 +02:00
Ashod Nakashian
175f4d995f loleaflet: no need to tell the user when doc is unloading
This is rare and should take a few short seconds
to save and then we can load as normal.

Since the client auto-reconnects anyway, no
need to tell the user to try again.

Change-Id: I51a7ad207edec3203933a1808288870e69699952
Reviewed-on: https://gerrit.libreoffice.org/36655
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-19 07:21:44 +02:00
Ashod Nakashian
9b3a22aafe wsd: save document upon server shutdown
The server correctly saves all documents
and waits to upload them before exiting.

Change-Id: I04dc9ce588bc0fa39a9deb298d0a5efa61a03f1a
Reviewed-on: https://gerrit.libreoffice.org/36654
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-19 07:04:26 +02:00
Marco Viscido
0bb650e7c4 keep expired document and query them to get the historical content
A Document has its own snapshots set.
A snapshot is a string representation of a JSON object.
AdminModel keeps also the expired document objects.
Query each document object in order to get their own history.
Admin accepts an "history" command then returns a json object.
An administrator checks the history by dashboard.

Change-Id: I73c87eff334cdb5a4a58043b2b66f18a56240b3a
Reviewed-on: https://gerrit.libreoffice.org/35926
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-04-19 04:08:38 +02:00
Henry Castro
c21221d514 loleaflet: animate pan if animate: true specified
Change-Id: I1d6b70d33d7459984da1541e3cd80e722268ce13
2017-04-18 16:39:34 -04:00
Jan Holesovsky
324499b0d9 Safer place for the tile cache cleanup.
When calling the cleanup from DocumentBroker::destroyIfLastEditor(), it might
be (theoretically) too early; so let's do it safer - as the last thing when
shutting down the DocumentBroker::pollThread().

Change-Id: Idc5e34b36d524c8f87a3a0fc99c87244e9784abf
2017-04-18 12:13:04 +02:00
Ashod Nakashian
9c14446c88 wsd: re-enable a couple more tests that are stable
Change-Id: I01bc96ce7bde7cac10d0b4d023b0d5dd774ed058
Reviewed-on: https://gerrit.libreoffice.org/36602
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-17 07:12:16 +02:00
Ashod Nakashian
6023fdc3c7 wsd: take DocBrokers lock before broadcasting diskfull
Change-Id: I4f7cccb1112c17091d1039441af4c84d5d13d059
Reviewed-on: https://gerrit.libreoffice.org/36601
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-17 07:09:22 +02:00
Ashod Nakashian
0feea0e80e wsd: include cleanup in test
Change-Id: Ie54aabc74e8980f3131a66f3610c1dcdd9f668ff
Reviewed-on: https://gerrit.libreoffice.org/36600
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-17 07:08:58 +02:00
Ashod Nakashian
651e462ef0 wsd: logs
Change-Id: I43f8e3732c6948c8214b21a506cb2e5ba56bd2ad
Reviewed-on: https://gerrit.libreoffice.org/36599
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-17 07:07:25 +02:00
Ashod Nakashian
624380089e loleaflet: don't send setclientpart when the server sets part
Client now sends setclientpart only when it wants to change
the current part number, but not when it is updating
the current part when it receives setpart from the server.

When switching parts (either by the keyboard or mouse)
LoKit sends a notification of the current part and
invalidates tiles. As a reaction to that the client
cancels its tiles and requests new tiles for the
new part. In addition, it sends setclientpart
back with the new part number.

This works fine, except when the client switches
between parts quickly (as when randomly pressing
page-up and page-down quickly in impress), by
the time LoKit receives the second request the
client would have reacted to switching the first
by sending setclientpart for the first. This
will result in a resonance back and forth ad
infinitum (or when the client goes inactive).

The client shouldn't echo back the part number
which the LoKit has told it (it should only send it
to explicitly set it itself). But the server should
be smart enough to remove duplicate setpart
notifications from the client queue. This reduces
the chances of an ocillation like that to happen.

Change-Id: Ia8a1bb25e427ab910129340ce599e3743983463b
Reviewed-on: https://gerrit.libreoffice.org/36598
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-17 07:06:02 +02:00
Ashod Nakashian
9234dc4dc2 wsd: drop duplicate setpart before sending to clients
When switching parts (either by the keyboard or mouse)
LoKit sends a notification of the current part and
invalidates tiles. As a reaction to that the client
cancels its tiles and requests new tiles for the
new part.

Since the response to setpart is a large number
of tile cancellation and new requests, the
cost of setpart is significant (esp. with large
number of clients). To avoid that, we de-duplicate
setpart entries from the client queues so there
would be only at most one setpart (the last)
queued to be sent to the client. This minimizes
the unnecessary noise when the part changes
faster than the server and/or network can
keep up.

Change-Id: I87578004203acc63d43e6d398ca04e37f766d9ba
Reviewed-on: https://gerrit.libreoffice.org/36597
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-17 07:04:22 +02:00
Ashod Nakashian
5479788e52 loleaflet: reconnect when load fails due to unloading
Retry up to 10 times with a delay of 1 second in between.

Also, show the user a message (after first reconnection
fails) that the document is unloading to try again
(but of course we auto-retry anyway).

Change-Id: I616d7643f146a6d5b7ccda7bb2aa567e3a9efe47
Reviewed-on: https://gerrit.libreoffice.org/36596
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-17 07:03:41 +02:00
Ashod Nakashian
28d15220e6 loleaflet: don't reference uninitialized docLayer
Change-Id: I0ea169474f17aa541f678c7474a6903b85129101
Reviewed-on: https://gerrit.libreoffice.org/36595
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-17 07:02:41 +02:00
Ashod Nakashian
5e3fc10eee loleaflet: log socket activity
Change-Id: I763ac09fcd5eef700b331b4d8016db3d30e1ef9a
Reviewed-on: https://gerrit.libreoffice.org/36594
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-17 06:50:25 +02:00
Ashod Nakashian
1262378301 wsd: send document unloading error as WS message
Without an explicit WS message, the client
does not get this message and the handler
is not invoked at all.

Change-Id: I71e210a9958965cff35dd4d0f1d99985429b82f4
Reviewed-on: https://gerrit.libreoffice.org/36593
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-17 06:49:23 +02:00
Katarina Behrens
8927eaf057 Strip trailing '/' from LO_PATH, if there's any
symlink() with path/with/trailing/slash/ and thus creating chroot
fails with ENOENT in totally opaque way

Change-Id: I5cd5213d8b6bfc50ea11cf8586b2a7b7f334631d
Reviewed-on: https://gerrit.libreoffice.org/36536
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-04-17 02:05:58 +02:00
Pranav Kant
86be5a24a5 loleaflet: Remove box-shadow from comments
This box-shadow interferes with direct comment children and breaks the
root-children comment block UI. Lets remove the shadow for now.

Change-Id: Idda659bcfca76093c148400b2ab311bc39861e84
2017-04-14 13:46:01 +05:30
Pranav Kant
3f397584aa loleaflet: Adjust parent,children when comment is added/removed
... in between comments.

Change-Id: I7b707d04adb045df43c66a29ccc9d2c3e702fca5
2017-04-14 13:45:16 +05:30
Pranav Kant
043ec94bef loleaflet: Same width for all comments, different from redline comments
Separate css classes for these different types of annotations.

Change-Id: I2013a05a2f7095956765661169670e0bb87bb372
2017-04-14 11:46:12 +05:30
Pranav Kant
3f4c678ab3 Combine root comments with their children comments
Change the layouting algorithm to check for comment relationship and set
the layout bounds accordingly.

Change-Id: I67cc32092d8cf2c1bbc0d677258387739bfc638e
2017-04-14 11:32:05 +05:30
Henry Castro
95d5941e9b loleaflet: update annotation position when performed zoom
Change-Id: I931081b2451d965ab669b428f8b258c3e39fb729
2017-04-13 20:58:52 -04:00
Andras Timar
976ce69183 loleaflet: ' Save ' -> 'Save'
Change-Id: I23b24aeda989652b04c1759810b1801b041e0a6b
2017-04-13 12:16:03 +02:00
Miklos Vajna
4269fbbaa4 wsd: remove unused using declarations in LOOLWSD
Change-Id: Id8a7f94cef0ab34fb7d789adff92b9c822af62c2
2017-04-13 10:31:24 +02:00
Ashod Nakashian
ed51fafece wsd: DocBroker is Alive if not flagged to stop
There is a race between creating and adding
a DocBroker into the DocBrokers container
and cleanupDocBrokers is invoked (on timer)
before it had a chance to start its poll
thread. This is exceedingly rare, but it
has happened.

We check that_stop==false flag when deciding
isAlive such that cleanDocBrokers will
not remove it before its thread had
a chance to run (which would happen
after adding it and creating the
ClientSession).

Also, no point in checking isAlive from
the polling thread itself (of course it is
alive).

Change-Id: If54fe2b5fce0697ee0e2f38f1662c71105e29347
Reviewed-on: https://gerrit.libreoffice.org/36500
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-13 05:54:16 +02:00
Henry Castro
1a580cc993 wsd: add mime type image/png
IE11 requires explicit content-type image/png

Change-Id: Ie0a886bc9b6af50be788456a93583176788c5315
2017-04-12 22:11:23 -04:00
Henry Castro
b0c889f2d2 loleaflet: animate the new position of selected annotation
Change-Id: I47af4ac3ec01b03797a03dfcc91ec84f0fd39bb5
2017-04-12 17:24:48 -04:00
Henry Castro
44482615ca loleaflet: update PosAnimation.js file
Change-Id: I38a2643e67d1d341b486c987eb73dc5e5608a7cb
2017-04-12 17:24:48 -04:00
Andras Timar
1aeaf41999 loleaflet: updated pot files
Change-Id: I0a589a07bb5658c7b9b749c7184fa09c2e1a49de
2017-04-12 22:35:09 +02:00
Andras Timar
baa07c0997 loleaflet: src/control/Control.ContextMenu.js contains translatable strings
Change-Id: I4010eb296a1771f0e8fbfa5078b4847193cfc188
Reviewed-on: https://gerrit.libreoffice.org/36491
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2017-04-12 22:26:43 +02:00
Jan Holesovsky
ba3b32aad1 Clean the cache even when the document was not modified.
And rename the option, to match better the existing tile cache setting.

Change-Id: Iea5c2c5628a403dd2dc3e2943cd858f40e2a2ebc
2017-04-12 20:04:30 +02:00