Commit graph

484 commits

Author SHA1 Message Date
Pranav Kant
1cb75cbcb8 wsd: Save wrapper over .uno:Save
Document broker needs to know when the save request is sent and when the
save finished. It uses these parameters to avoid shutting down document,
in the document broker main polling loop, if save is already going on.
But direct .uno:Save commands issued from
loleaflet precludes document broker to keep track of it - in this case a
.uno:Save command issued from loleaflet followed by closing the
session will prevent saving the document to storage, if document is huge
enough and LO core takes a bit of time to save it. A save wrapper
command, 'save', ensures that document broker is aware of all such save
requests (_saveRequestTime member variable) and doesn't close the
document until we completely save it (to storage and other cleanups).

Change-Id: I5ec73d45adff23b2e7543e93dfd0624a5e5af46d
2017-05-15 11:41:52 +05:30
Marco Cecchetti
024e786e85 calc: added an address input field
Change-Id: Ic030724e392693847a195b5e53866b40ebad7435
Reviewed-on: https://gerrit.libreoffice.org/37359
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-11 17:55:23 +02:00
Ashod Nakashian
954a37a06c Configurable timeouts
Timeouts to dimming the doc in the browser
are now configurable from WSD and is relayed
to loleflet as expected.

Out of focus timeout is now 60 seconds.

Change-Id: I8452e30976f6a81b0c3bb3ba5774daa244c1640c
Reviewed-on: https://gerrit.libreoffice.org/37489
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-11 08:01:30 +02:00
Pranav Kant
e032cb72fa tdf#106447: Support checked items in menubar
Bin the internal command state recorder to Menubar and use the global
state recorder available in the map.

Change-Id: I32e81700e38c2d544b2d874e6a30fbe58e8d43bd
2017-05-03 21:21:28 +05:30
Pranav Kant
ffaf424103 loleaflet: Store state change handlers in new stateChangeHandler class
... instead of having this logic in our toolbar. All the elements like
menubar or toolbar can then use the map store to see the value of last
state change event for any particular uno command. We will be using it
when menubar starts using this store.

The frivolous logic in toolbar of reading the value of last uno command
should be removed. We don't expect loleaflet to change the permission
dynamically after loading the document anymore. But for now, just change
it accordingly and defer the task of removing it when we refactor
loleaflet codebase to trim our permission model (remove the 'view'
mode).

Change-Id: I1be54a62e96179b7db3f61470a92e3ddc745f52d
2017-05-03 21:21:22 +05:30
Pranav Kant
163e04af0b Make admin l10n work again
The localization.json file contains path like 'l10n/lang.json' which
means path relative the html file being accessed. This works when we
access .../loleaflet.html but not so when we access .../admin/admin.html because
then it tries to access .../admin/l10n/lang.json while it should look for
this file one directory up. One could think to change the paths in
localization.json file to something like '/loleaflet/dist/l10n/lang.json' so
that same path is accessed always for loleaflet UI as well as admin, but
it has repercussions that we access l10n data always using 'dist' prefix
and not using git hash, so browser caching the l10n data across multiple
versions.

Ideal would be to split the admin localization completely from the
loleaflet-ui localization. No point in fetching whole of the loleaflet
localizations strings when we are only accessing the admin console. This
would also solve problem mentioned previously.

For now, just split the admin localization file only while still
allowing admin console to fetch the same l10n files.

Change-Id: I0824fb05b9b4123b58d6fd8edafb374ee7128229
2017-05-02 19:52:47 +05:30
Pranav Kant
5858f4e856 Don't eat new lines
Change-Id: Idaa1af9a0bc12d9967d3807ebca95ec1ca755ae3
2017-04-27 11:09:55 +05:30
Pranav Kant
56c49af98a loleaflet: Bin client side cell annotation marker
No need as core renders its in-tile annotation marker now, if comment
indicator setting is on in the document.

Change-Id: I213827fc089790398e02b0fd9cba464ab62b0d8d
2017-04-27 10:40:47 +05:30
Pranav Kant
759b0945d4 loleaflet: Don't allow inserting breaks anywhere
overflow-break property is enough for us which still allows inserting
line breaks arbitrarily anywhere but only if there is no otherwise
acceptable break points in the line.

Change-Id: I8ea94daba258b00caa259c97597cf1206a89fa64
2017-04-25 19:40:30 +05:30
Pranav Kant
2d55476b20 loleaflet: Don't overflow long names, align author names properly
Change-Id: I0d833291fc996ecb4007bcb58b588967afa6ea58
2017-04-25 14:48:23 +05:30
Pranav Kant
0c53975f18 loleaflet: New comment size/width
Change-Id: Ief2d9c942dffab7a98dc5a7de2208e511f45df78
2017-04-25 13:32:51 +05:30
Pranav Kant
2b38191e3b loleaflet: Wrap both comments and redlines
Change-Id: Iee0c61340cc78b93a2d3d23157bab715c3e7411e
2017-04-24 20:31:06 +05:30
Pranav Kant
ca482f0065 loleaflet: Fix width of the redlines too
... otherwise with very long comments, they keep increasing their width
which looks ugly.

Change-Id: I5cd67258b251a9d522716433d5e190cd29fef078
2017-04-24 20:31:06 +05:30
Pranav Kant
c88f1156b2 loleaflet: Increase the annotation height a bit more
Change-Id: Ibd04cfe3e17354244a31177edca23467e0f8e9c8
2017-04-24 20:31:06 +05:30
Pranav Kant
ecdb7e2645 loleaflet: Enable vertical scroll on annotations
Change-Id: I6ff7a29bd22f57b4d9bbdbb824619030cf5f2e43
2017-04-24 20:31:06 +05:30
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
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
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
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
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
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
Jan Holesovsky
7b7c73f8be Align the Accept / Reject buttons with the kebab menu.
And few other improvemnts inluding:

* use svg instead of png for the menu
* add title (caption) for the Accept / Reject change.

Change-Id: Ic7e781d7e93d319f766b387a8eddfa70c1920760
2017-04-12 17:43:49 +02:00
Pranav Kant
b7eafb1e4a Move CSP to response headers from meta tag in html
Some older browsers don't have meta tag support for CSP. Lets put all of
the CSP in response headers to be compatible with oldies.

Change-Id: I7f0d7c294e492b3c69ebea6fbd820d6558b9c3b3
2017-04-12 19:24:51 +05:30
Pranav Kant
63631dff24 security: CSP: add frame-src 'self'
We need to be able to create iframes sometimes with same origin as ours,
eg: when loading the 'loading' page during slideshow or downloading the
file (in different formats). The 'blob:' is only used for printing
purposes.

Change-Id: I93666ee45e707997969e151af5142efeeca0d177
2017-04-09 23:32:06 +05:30
Pranav Kant
54d0ff9c21 Stop using inline event handlers wherever possible
Unfortunately, our dependencies (various plugins etc.) still make heavy
use of inline event handlers, so not possible get rid of all of them in
our bundled js. This is the reason we still have to use 'unsafe-inline'
in our CSP.

Change-Id: I519dec0834606ab3c56e090c882a93160ddcb52c
2017-04-07 13:46:04 +05:30
Pranav Kant
0f2c6d8e06 Bin unused function
Change-Id: I57bc98cd382081e776e1ed58da095a404834b431
2017-04-07 13:46:04 +05:30
Pranav Kant
328df11a68 Bin this unused inline style
Change-Id: Ib4ae0cde13acea0e04526cda925f3d4528bb6605
2017-04-07 13:46:04 +05:30
Pranav Kant
03341192ca loleaflet: Add Content Security Policy
Change-Id: I450e0c9fb24d114af35ba9c503d3940ab30a4f4e
2017-04-07 13:46:04 +05:30
Pranav Kant
f90ad6e743 Revert "Add change tracking toolbar buttons"
This reverts commit 0c5efd80ad.

Change tracking options are already available in the menubar, lets bin
them from the toolbar

Change-Id: Ie340957eb1e615429a54be9cb0639db146e6d7a1
2017-04-04 23:02:00 +05:30
Andras Timar
878eef6cb4 loleaflet: Add Upper Sorbian and Lower Sorbian UI languages
Change-Id: I4ad5acbdf6746df03ddf233b986f20d200331794
2017-04-04 16:46:05 +02:00
Pranav Kant
4b7904036a loleaflet: Annotate readonly users in userlist
Change-Id: Ia000a06baf9f88830dd30c4c4a4297eb10192fd6
2017-03-31 12:22:39 +05:30
Pranav Kant
5bb6e203c5 loleaflet: Accept, Reject redlines buttons in main annotation win.
Change-Id: I16b931c07485eb98fdac00d1dc968a4c9251a02a
2017-03-23 17:34:35 +05:30
Pranav Kant
064b2508a7 loleaflet: Slide sorter for draw documents
Change-Id: I4ad11236c0186561b5c7df1a3c634e54f8576c8c
2017-03-20 13:59:52 +05:30
Pranav Kant
f57e412403 loleaflet: Tell WOPI host if document was ever modified by user
Change-Id: Ic99136168716d7a01d1388c4f5e1107ef9e64616
2017-03-17 15:42:10 +05:30
Dewan
92ad94f259 display lokit and loolwsd version in admin panel
Change-Id: Ia5b89373bfd7e921597b73d5a84963268244b748
Reviewed-on: https://gerrit.libreoffice.org/35199
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-03-17 07:53:06 +00:00
Aron Budea
4a99210f97 loleaflet: Don't clear ids in unoCmdToToolbarId(...)
Since 4030795584 spreadsheets
start with Undo/Redo/Doc. Repair buttons enabled, because
of this.

Change-Id: I20a22f483324289435825c3514894389176f57f3
Reviewed-on: https://gerrit.libreoffice.org/35056
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-03-15 05:18:23 +00:00
Henry Castro
bd911ff9d5 loleaflet: rework Impress annotations
LO Impress does not have an anchor position of the annotation object

Change-Id: Ifaa08bb3f62f442f3ee58242e835b6377901a592
2017-03-09 23:01:33 -04:00
Pranav Kant
148e0f6832 loleaflet: Make caption text bold
Change-Id: I2dbfcf8e341703ba931466e00c269a4a5814c7f9
2017-03-09 17:41:15 +05:30
Pranav Kant
ab7fc23021 loleaflet: Bin comment on change tracking option in toolbar
... as one can now easily comment on the change using the new popped up
sidebar object that gets added to DOM when a new redline is added.

Change-Id: Icb048672b0b3fe2a0490b64e05539095ffcb3715
2017-03-09 17:12:37 +05:30
Pranav Kant
7c84478840 loleaflet: Allow accepting/rejecting a change from sidebar object
Change-Id: I309b33c4569bc74c69200298566734e16d08b305
2017-03-09 17:11:01 +05:30
Pranav Kant
0c5efd80ad Add change tracking toolbar buttons
Change-Id: Ie2b77ce5828de1062d94d0fca35852f7f5e15dbc
2017-03-08 17:55:23 +05:30
Henry Castro
9f9e090039 loleaflet: make annotation color consistent with the toolbar
Change-Id: I7b153f01844f5be2c55d1760b75206d2ca96a01d
2017-03-07 21:35:50 -04:00
Henry Castro
dc24fdea67 loleaflet: change annotation appearance
Change-Id: I9c27b0576b686ac5b8a92bda8ab7960a1b400777
2017-03-01 17:54:45 -04:00
Henry Castro
b4704ffdc3 loleaflet: fix insert annotation in the toolbar 2017-02-27 16:17:17 -04:00
Henry Castro
91666d7cd3 loleaflet: insert Calc comments 2017-02-25 18:18:24 -04:00
Pranav Kant
8fa0bb54bd loleaflet: fix readonly UI for spreadsheets
There is still one known problem - for some reason, when a spreasheet is
opened in readonly mode, the ViewRowColumnHeader request sent to server
has height=0 leading to server sending no rows information back to client.
Though the problem gets resolved when one scrolls the spreadsheet
window, but something to fix.

Change-Id: I2aefafd1a93c1bc5a9ad8581edb83018ec9a3f07
2017-02-17 22:16:58 +05:30
Pranav Kant
c3f9ebb888 loleaflet: Fix readonly UI for impress
Change-Id: I1434cad4f471a3f13c989d67b95b967345598148
2017-02-17 20:53:54 +05:30
Pranav Kant
e4ed4c1ad2 loleaflet: Vanish UI in readonly mode
Some of the related code was accidently commited in
8ebff4399c74a42463e1ec7578e6f5a028826682

Change-Id: Ia58e31bea7352541a89ae3f1b57c611acbe27e21
2017-02-17 20:09:10 +05:30
Pranav Kant
f75ccb414b loleafet: Revert accidently committed code
... from 8ebff4399c74a42463e1ec7578e6f5a028826682

Change-Id: I004ca52ba79b0a0e7c79c08a354f8d3179bf1daa
2017-02-17 20:09:10 +05:30
Pranav Kant
625a909902 loleaflet: Kill manual browser checking code; user our Browser class
Change-Id: Ia75e1f1bf79647c2eb6562fed8c549b3e272a953
2017-02-17 17:56:03 +05:30