Most of these can easily be accessed from the menu bar. Lets keep
only most commonly used and simple toolbar items here.
Change-Id: If9ad379c6491b907a980e0ef5b4a46a60266fafe
We can now directly use sm-simple.css from node_modules in its
pristine form and then use custom css rules to override to make
it look like LO menu bar instead of directly making changes in
sm-simple.css
Change-Id: I0773ca27fdf549d5c7df0bc781dfc019225d7cb6
We assume that id of the toolbar item is lowercase(unocommand),
so lets keep it consistent too for alignment buttons.
This also makes alignment buttons toggle except for spreadsheet
where alignment of cell text happens via a different uno command,
HorizontalAlignment.
Change-Id: Ibacf06bd99435cd24b27c7870173a2519b167af1
Reviewed-on: https://gerrit.libreoffice.org/32774
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
Automatically initialize formatButtons internal object to
preclude the possibility of one forgetting to enter the id of the
button in formatButtons object.
Fix 'id' of default numbering/bullet button after which it is
correctly showing the state now.
Change-Id: I57247e1b0e6d462153a47d31a883ceb04ecff74b
Reviewed-on: https://gerrit.libreoffice.org/32101
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
It is insertannotation, not just annotation
Change-Id: I1bc01e87da963d0e07d670ffec261e33b45062d2
Reviewed-on: https://gerrit.libreoffice.org/32096
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
If we get a true/false, assume its enabled.
Change-Id: I364c7cd611481757b674877ed44ac6ee0f6b0e58
Reviewed-on: https://gerrit.libreoffice.org/32089
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
loleaflet_logging defaults to true with compiled with
--enable-debug otherwise false.
Browser will print additional debug info when this property is
set to true.
Change-Id: Id9fabf134bd8d19fa1a09ca8c0987df46d4f1a4c
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
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>
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>
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
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
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>
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
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
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.)
.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
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
- 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
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
Use browserify for admin console scripts too.
Modularize needed files such as l10n strings for console.
Use npm for managing bootstrap as dependency of admin console.
Don't include each third party script in a separate <script> tag,
rather have one single main.js file require'ing these different
scripts. Then `browserify' on main.js which bundles everything
into a single bundle.js containing all of the dependencies.
Also add these 3rd party scripts such as jquery, jquery-ui,
select2 etc. using npm, rather than manually downloading their
files from the internet. This should ease the process of managing
these front-end dependencies; upgrade process should be very easy
now.
OnInsertFile is triggered on onchange event, but this event is
not triggered if same image is choosen again from file chooser
dialog. Reset the value everytime so that onchange event is
always triggered.
Change-Id: I1efb76122b3a9437622754d28d0c55d4adbf32e8
Remove direct usage of editlock; instead change loleaflet
permission from view to edit when editlock message is received.
By default, map would be in 'view' mode and only get to 'edit'
when server asks it to switch to.
Use a new event 'doclayerinit' for actions that are directly
dependent on intialization of doclayer.
Change-Id: Iaceb95ad85721ddcd675c75cfeb1504ab2759ad4