MS Edge seems to be very problematic when one tries to load the
pdf blob into the print iframe and issue a print command to it.
Lets fallback to print prompt as we have in firefox
Change-Id: I97fc394d0053030231c524efb6bf808d32a9aa07
Removing this._printIframe may still cause leakage here as
this._printIframe is overwritten everytime user issues a print
command.
Change-Id: I06f45604940380b809bc262f07b9b6a8aa7d9a87
Top level make would now build loleaflet too if necessary.
Respect value of ENABLE_DEBUG and if present add debug-info to
generated js bundles too.
Add new rule, clean-local in loleaflet.
Change-Id: I3a9b727824f2877fc72719a8bfdeebed5448cb7d
This always takes ~2 seconds irrespective of whether node_modules
needs updating or not. Lets add appropriate dependencies and save
these precious 2 seconds.
Change-Id: Ided4ff334316c16521e5ea7a69d15736a1cc170f
Use events, 'hidebusy', 'showbusy' to interact with toolbar.
In some cases, it may happen that w2ui usage in loleaflet happens
before browser loads w2ui.js (as it is in <script> tag after the
one which loads loleaflet).
Change-Id: I9b1b249ede72ed01f97cf31fd3f93780312530bc
No point in building things that are already built, create
different jake tasks, enclose whole of the build process in a
single jake task - 'build' which would call other various tasks
depending on whether they needs building.
Change-Id: I4b26834440ef638d697aa0793d2ced1e2c49784a
Compression is most expensive in terms of time; if we detect
early that there are no changes between oldSrc and newSrc, lets
return early and skip the compression.
Change-Id: Id3d7c1d4bf89a33819907ff735e01629581627a3
Start searching as you type
Press enter to search forward
Shift + enter to search backwards
Esc to get back to editing
Change-Id: Id366069aea9eb0e96e8d73fa4b57f972b0ce78e5
Use a new protocol message, 'resetidle' to inform Admin clients
whenever a user has done anything in a document view. This is a
message that Admin clients need to subscribe to.
Also add the current idle time for each document to the 'documents'
message.
To reduce protocol chatter, the idle time is updated at most once per
10 s.
Change-Id: I418e82b05048a3628f21dcd240ccd974b3a01356
Reviewed-on: https://gerrit.libreoffice.org/31653
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
When the connection is slow and tiles are received after a good
amount of lag in between them, one tile load can prune tiles (of
earlier zoom level) for which we have not yet received the tile
response from the server - so there's nothing we have yet to
overlap these tiles completely, leading to grey-ish patches when zooming
in or out.
Pruning these tiles later ensures that we do not remove any tiles
of earlier zoom levels until all the tiles have been loaded.
Change-Id: Ibb03f0c6bf2031741f0b8a4584c1821539587e88
Due to a bug in w2ui library, w2overlay doesn't popup when it is
near the edge of the screen (reproduceable only when no. of users
are greater than 3). Lets disable zoom controls in case of
spreadsheets so that userlist is not near the edge of the screen,
and hence pops up.
Change-Id: I6f2647d124484235afe6c92da18be38ed8e2b9ce
Reviewed-on: https://gerrit.libreoffice.org/31621
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Set a timer in loleaflet 15 minutes before access token expiry
date (access_token_ttl value) to prompt the user to save and
refresh the session.
Change-Id: I98c3e47c9b7031e29e002f653d488747b9c17df8
Reviewed-on: https://gerrit.libreoffice.org/31381
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
This patch fixes the following bug:
Create blank sheet:
enter "." ie. just a period into A1
enter a "." into A2
now switch virtual desktop away and back again.
hit enter in A2
now switch virtual desktop away and back again.
You should have a blinking edit cursor in A2 - but the focus in A3.
Change-Id: Icda0123f35ecda04559fec859b6bbe6ff3ac33e8
Reviewed-on: https://gerrit.libreoffice.org/31541
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
This patch fixes two problems for spreadsheets:
- one pixel alignment offset btw grid and column header
- a one pixel horizontal auto-scrolling issue
Change-Id: Ifd6a3b47863d345656d0dcf3fba2d253c43ba9b1
Reviewed-on: https://gerrit.libreoffice.org/31542
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
... as we handle it already during 'keydown' by sending keyboard
event to core which changes the slide for us.
Change-Id: Id61584ffa0ec5ff3aca098e3dcade664c306c6c3
Reviewed-on: https://gerrit.libreoffice.org/31475
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
We regressed on chrome with
47699cd908 as 'textInput' event
clubbed with 'keypress' event started emitting double-spaces.
Tweak the hack to keep IME working on chrome while not regressing
when it is not enabled.
Change-Id: I0901724bf2db1794078fef3eb7283663b6f6a13b
Reviewed-on: https://gerrit.libreoffice.org/31469
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
When IME is enabled and user presses the space button, firefox
sends 'compositionend' event with data = ' '. However, chrome
instead fires 'textInput'
event. Lets listen for 'textInput' event too and treat it like
'compositionend' event when data = ' '.
Change-Id: Icbebdf2e89f608f790e6ce68c49f474364e7d5ab
Parse the compositionend event's string, convert each into a char
code and pass them individually to server.
Change-Id: If79d538ccaebaa29749a5ca48a1f6ed5e0689ed5
Have a new event 'warn' which doesn't change the document
permission but just show the user dialog with some message.
Change-Id: I455168e4f7315acdcccfb31fc8c70b86bbc6caad
The new behavior is to warn the user when we try to save to
storage and set all the sessions of
the opened document to readonly, if storage server has no disk
space left. In case of WOPI, this is intimated by HTTP response code 413 -
request entity too large.
If save operation to storage failed due to reasons other than
413, just warn the user and let it continue editing the document.
We can add more reasons of failure and act accordingly in future.
Change-Id: I4b046fc38bbc0d752c89d90acb5991a958b76670
Amazingly, this (my third attempt) seems to work.
Add a boolean 'forAllClients' parameter to the loleafget getPreview()
function, and pass it as true in the location where a new preview of
an edited slide is requested.
Add a parameter 'broadcast' to the 'tile' (request) message. Set to
'yes' in the above case. When subscribing to a such tile rendering,
subscribe all sessions of the document.
While at it, drop the default values for the parameters of the
TileDesc constructor. I dislike default values...
Change-Id: Idb438f11c953d791fafe4c890e0497d8dfbaa733
Reviewed-on: https://gerrit.libreoffice.org/29591
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
Users aren't bothered with connection errors when inactive.
Instead, when they try to re-activate, the connection is
re-established, and only if that is not possible does
the user see the disconnection notice. Otherwise,
the connection is re-established semi-transparently
(the is a small "connecting" status shown at the bottom).
Change-Id: If4735cc1593c6e29c65d3c9686a8f2861365c583
Reviewed-on: https://gerrit.libreoffice.org/31026
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This leads to emission of 'docsize' event somewhere down the line
which leads inconsistencies while navigating the document.
Change-Id: Iffabac66153e7b32c9b2af041282ef82b813bef3
'status' message can well be sent after document has already been
loaded. Eg: when the doc size is changed. We don't want this code
to execute in all such cases.
Change-Id: Ia69ab70edddda1a4e27618101eaff35bd0e5eb65
This also introduced a regression where upon reconnection of the
document, tiles were not updated. This was because calling
setView leads to calling 'canceltiles' down the line which would
cancel the the 'tilecombine' request for fetching all tiles
leading to stale tiles in the UI
Change-Id: Ib0f583c92802195384ea10f328c0ba2eafc82ffd
Additionally, change the variable name for presentation-toolbar
to avoid any future confusion.
Also, put the code hiding the save button in onRefresh event so that
save button doesn't show up in the UI as soon as we get the wopi
properties object from the server.
Change-Id: Ib168010c509f55a69aae9752e11321d319f59e99
Post App_LoadingStatus with 'Status' field as Frame_Ready when
we are ready to show the UI.
Post Document_Loaded when document is completely loaded after
which loleaflet is ready to respond to more document specific
queries through post message API.
Change-Id: I60a4e9b75e115c748fcee8d449bc8c2d4ffa34a9
When we add more server controls (restart, f.e.)
we will need to move this to a separate page.
Also, we need to prompt the admin for reason,
which we can broadcast to all users when the server
goes down.
Change-Id: Ide92e58b5b64a5107b6556aef6b1a88191d5d21b
Reviewed-on: https://gerrit.libreoffice.org/30832
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Accessing the parent iframe, atleast on my local box, where
parent frame and loleaflet frame have different origin, is not
allowed by browser security policy.
Change-Id: Ia3a356fa1d8a81f38bbc27d256471302be8b6729
WOPI hosts can now send above mentioned messages to loleaflet so
that loleaflet does stuff accordingly.
Change-Id: I50e10a62c5b629bd12f7d9ce51bcd13cb13cdd8a
Add more WOPI extensions for this - HidePrintOption,
HideSaveOption, HideExportOption. Setting HideExportOption to
'true' in WOPI CheckFileInfo response would hide the 'Download
as' option from the File menu.
Change-Id: Ia2259ee9525cc6c4331a52e2221af4df188eab07
This implements a new feature 'OwnerTermination' for WOPI based
hosts. WOPI hosts now have to enable this feature by mentioning
'EnableOwnerTermination' as 'true' in their CheckFileInfo
response. If the OwnerId of the file matches that of the UserId
of the session, this session would be able to terminate all other
sessions currently editing the same document.
The reason for this kind of document termination is sent to all
sessions in a new application-level 'close:' message. This new message is
similar to the CLOSE frame of WebSocket protocol which doesn't
seem to work across all browsers as of now. Eg: Chrome -
https://bugs.chromium.org/p/chromium/issues/detail?id=426798
After receiving this 'close: ' message, loleaflet acts
accordingly and tells the WOPI host why the websocket was closed
via post message API.
Change-Id: I997aa2e7805157ed599a3946a877fd32477cee1b
Abstract all the WOPI related logic in a map handler which is
enabled only if map.options.wopi is set during map
initialization.
Change-Id: I54c5d6eecf33f88e4fd4d2b5ac9e8cf9dd001966
This fixes regression to the hackish fix done
in b26f2f2738 -
loleaflet: prevent the zoomlevel from changing on connect/disconnect
Change-Id: I09c899546d0d8bfbe4c274b0774fd30008cbcfa5
Reviewed-on: https://gerrit.libreoffice.org/30400
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
When a client connects or disconnects ViewInfo message is sent.
The handler for this updates the number of users via addView
and removeView. Unfortunately when the toolbar control is
updated, it resets the zoomlevel to 100% (the initial value).
This is an ugly hack to change it back to the correct
value, since nothing really visually changes. It certainly
could be improved by only correcting the toolbar.
Change-Id: I37294da2d9d1bc84e8cb3b7f634aadcfd80d6497
Reviewed-on: https://gerrit.libreoffice.org/30218
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
- show outgoing and incoming network messages with some
highlighting in Javascript console (default in tile
debug mode)
- add optional automatic typing
- add layer controls for overlays and automatic typing
- differentiate rectangle borders (newer is more opaque)
- fixes:
- fix function call at cancelled tiles
- hide all attribution control when disabling debug mode
permission= parameter in URL is still supported, but overridden
by UserCanWrite parameter.
Also, introduce a new protocol message, perm: which dictates
loleaflet about the permission rather than the other way around
(only in case of WOPI)
It is to be noted that by default loolwsd assumes very
restrictive permissions, so not providing UserCanWrite in WOPI
implementation by a WOPI host would lead to opening of only
readonly session.
Change-Id: I2013c1661fd491c79bb367a41e1a7036fa03f984
Use the previously unused UnauthorizedRequestException for this, and
throw a such in StorageBase::create() when the WOPI host doesn't match
any of those configured.
In a developer debug build, without access to any real WOPI
functionality, you can test by setting the FAKE_UNAUTHORIZED
environment variable and attempting to edit a plain local file:
URI. That will cause such an exception to be thrown in that function.
Catch that UnauthorizedRequestException in
ClientRequestHandler::handleGetRequest(), and send an 'error:
cmd=internal kind=unauthorized' message to the client. Handle that in
loleaflet in the same place where the 'error: cmd=internal
kild=diskfull' message is handled, and in the same fashion, giving up
on the document.
Actually, using exceptions for relatively non-exceptional situations
like this is lame and makes understanding the code harder, but that is
just my personal preference...
FIXME: By the time StorageBase::create() gets called we have already
sent three 'statusindicator:' messages ('find', 'connect', and
'ready') to the client. We should ideally do the checks we do in
StorageBase::create() much earlier.
Also consider that ClientRequestHandler::handleClientRequest() has
code that catches UnauthorizedRequestException and
BadRequestException, and tries to set the HTTP response in those
cases. I am not sure if that functionality has ever been exercised,
though. Currently, we upgrade the HTTP connection to WebSocket early,
and only after that we check whether the WOPI host is authorized
etc. By that time it is too late to return an HTTP response to the
user. If that even is what we ideally should do? If not, then we
probably should drop the code that constructs HTTP responses and
attempts to send them.
Also, if I, as a test, force an HTTPResponse::HTTP_BAD_REQUEST to be
sent before the HTTP connection is upgraded to WebSocket, loleaflet
throws up the generic "Well, this is embarrassing" dialog anyway. At
least in Firefox on Linux. (Instead of the browser showing some own
dialog, which I was half-expecting to happen.)
- show total number of the rendered tiles of the document, also
the difference between the previous number in the client
- show cached tiles in transparent yellow color (in debug build)
- send ping messages after every invalidation message instead of
keypressing
- fix memory leak: remove unused leaflet rectangle overlays on the
tiles
.uno:TrackedChangeAuthors doesn't give correct colors for
documents other than writer, lets use our old algorithm for color
assignment for these documents.
Change-Id: If865788154a80da2637aad84183a0e947bb4b7e8
No need to fire it if nothing happens. Just confuses a reader of the
code.
I don't really understand JavsScript events etc, so if I have
misunderstood something, feel free to revert.
Set the mode to viewonly after the error so that user can still
see the tiles downloaded from the server, but cannot interact
anymore before server administrator fixes the disk space.
Change-Id: If03f4fabe93458672a631c020d09dcebecbb955c
From
/lool/ws/docurl
to
/lool/docurl/ws
The main purpose behind changing this and other related urls is
to help in load-balancing. The first two parts of the URL can now
be used in a hash-based load-balancing algorithm which decides which
slave gets to serve the requests. Requests such as insertfile,
downloadas need to end up in the same slave in which document was opened.
/lool/docurl/ i.e first two parts of the URL are constant for all
the requests that should be served by a single slave.
Change-Id: Ibc605ca1251957b8b32b376cf19b78f6178fadfa
- show best, average, worst, last times of
- server ping round trip
- times between key press and invalidation message
- tile based and total tile update latencies
- show data of the last five invalidation:
- tilecombine messages, if they exist
- otherwise the invalidation message
- border of the last five invalidation rectangles
- visual fixes:
- more transparent red color for better text typing
- small letters over tiles with transparent background
- black attribution text instead of gray + bottomleft position
- show invalidated rectangles with fading effect
- show last tilecombine message and cancelled tile count
- show received/requested tile updates
- fix popup handling
- custom popup style (transparent, big numbers)
- clean up
This code throws sometimes. Rather than investigating what makes
it actually throw, lets kill it because we don't want any
editlock functionality anyways now.
Change-Id: I8a484ba9e3a658ca739122bb6d2d0c92c4180ff5
Otherwise if you edit a different part of the document and somebody else
selects a shape, you get an unexpected, annoying jump.
Change-Id: I161a27c8a69e0873de0ebe3a020e2868cbe0afca
... so that one can use the factored-out rule, build-l10n, to
install these translation .json files in dist/ and start using
them, without having to do 'make dist' first and then extract the
package.
Change-Id: Ie2814a9f2596246b487799968f3027aa48475e7b
The behavior has changed to include .pot files in git as well in
7839aecac6
So, don't try to delete these .pot files now
Change-Id: I6f5d015596ff1f2d98adca426b1458f66bc7d4b4
Reviewed-on: https://gerrit.libreoffice.org/29130
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Location was changed in 6c69b63be5
in an effort to modularize everything including these l10n
strings.
Change-Id: I4d7538a6e6d1370a45326bc163a496cf7c681259
Extending the document URL with debug=1 option will switch
- visible tile boundaries
- update numbers over tiles
and invalidated tiles will be blue during waiting for an update.
Editlock buttons have already been removed; most of this code is
unreachable/useless anyways.
Don't listen to editlock messages anymore, and always set the map
permission to edit unless specified.
Change-Id: I2ee672e72beaa48a7c6cd0bbd1c548ff10a251d1