Commit graph

114 commits

Author SHA1 Message Date
Alexandru Vlăduţu
c4adca9978 tdf#129979: loleaflet send postMessage on cancel for password protected files
Change-Id: Ied484ee8cce185c707d16c5181ca9246f69bdea2
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86679
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-01-16 17:27:08 +01:00
Ashod Nakashian
8f312862ca leaflet: fire Doc_ModifiedStatus with modified state of the document
When .uno:ModifiedStatus is received, now Doc_ModifiedStatus
is fired to inform the client of the modified state of the document.

This is useful in case the integration needs to prompt the user to save
before closing the document (which they can catch with the onunload or
onbeforeunload events in the browser, as well as with our
UI_Close when the default handler is disabled).

Includes working sample and documentation.

Change-Id: Ief30483e2f078b0aa9f3c006a1ecb4093375174c
Reviewed-on: https://gerrit.libreoffice.org/74891
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-09-03 01:53:12 -04:00
Ashod Nakashian
3dcc68e6f1 Pass Extended Data in Action_Save from the client to the WOPI host
Clients often need to communicate with their wopi hosts when
invoking Action_Save to provide more context when storing the
document in question. Action_Save now support passing arbitrary
string as ExtendedData entry that can be used by client to
pass any context or otherwise flags to the WOPI host, which
will receive it via the X-LOOL-WOPI-ExtendedData custom header.

See reference.html for more details.

Change-Id: I1814d1f3d984a553ffa60cec13d23b014ba59eb3
Reviewed-on: https://gerrit.libreoffice.org/74135
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-09-03 01:53:12 -04:00
Ashod Nakashian
5ff0a42b94 leaflet: Support notifying the client on Action_SaveAs completion
Clients expect a consistent notification API for Action_Save
and Action_SaveAs. Unfortunately, Action_SaveAs didn't
support notifying the client as Action_Save does.

Now, when Notify is set to true in the Action_SaveAs
message, the client will be notified with Action_Save_Resp.

Change-Id: Ib8eb946c3bc642cfd46124e1190e931c21f88de0
Reviewed-on: https://gerrit.libreoffice.org/74134
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-09-03 01:53:12 -04:00
Ashod Nakashian
df6cc01c32 leaflet: support disabling default action
Clients often need to handle certain commands themselves.
This is especially true for Action_Save and Action_Close.

A new postMessage command, Disable_Default_UIAction, is
now available to support disabling/enabling the default
action for certain commands (as of this patch, only
Action_Save and Action_Close are supported).

The actions in question issue a notification and,
when the default handler is disabled, the client
is expected to handle the notification for which
they disabled the default handler and act as necessary.

See reference.html for more details.

Change-Id: Ia6ce4e2d7578f79cc2069097e0b968e6c4aeabd1
Reviewed-on: https://gerrit.libreoffice.org/74136
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-09-03 01:53:12 -04:00
Ashod Nakashian
0852f62f56 leaflet: support Action_Close
This allows for clients to issue a document
close programmatically, which is useful when they
have custom buttons or commands, or external
events/triggers, that might result in cleanly
closing the document.

A demo of how to use it is included in framed.doc.html.

Change-Id: Ib889bb01bbcaaa91fd0f341c989aeb1a6fceec28
Reviewed-on: https://gerrit.libreoffice.org/74131
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-09-03 01:53:12 -04:00
Szymon Kłos
7b86174eb8 Add API to remove menu items
Reviewed-on: https://gerrit.libreoffice.org/74128
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 16ba97e7ae4a06932bdd63dbf32dd9e09b6b227e)
Reviewed-on: https://gerrit.libreoffice.org/75228
(cherry picked from commit 5105f3b95117c88d91a882fb4fef5356b5e45e68)

Change-Id: I59f2e3e1ed467f58bcd56db945e0d4807c1cff6e
2019-09-03 01:53:12 -04:00
Samuel Mehrbrodt
11f5154432 Add postMessage methods to show/hide toolbar buttons
(cherry picked from commit c0d0ad7368)

Change-Id: Ib5ecde5a53aa0aae2346e360423e72025edade3a
2019-09-03 01:53:12 -04:00
Samuel Mehrbrodt
15e2e91fc7 Add API methods to hide/show ruler
Change-Id: I4d14d9d68e7ebda56c80a1ad678a21c67ffd5ac2
Reviewed-on: https://gerrit.libreoffice.org/72265
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-07-16 09:11:21 +02:00
Jan Holesovsky
3c45a0abab Introduce Download_As postmessage & a CheckFileInfo entry to enables that.
The Download_As is emitted when the user chooses 'Print' or 'Show
slideshow' or 'Download As [some type'] and the integration indicates
via DownloadAsPostMessage in the CheckFileInfo that it wants to handle
the downloading of pdf for printing or svg for slideshows or experted
document.

This is particularly useful in situations when the integration cannot
rely on browser's support for downloading like in mobile apps that use
the Online in a WebView.

Change-Id: Iefdf214937c0c0dafd7462340a1c5e88df94e716
Reviewed-on: https://gerrit.libreoffice.org/73449
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-06-04 14:54:36 +02:00
Michael Meeks
54eaf51685 Document Grab_Focus.
Change-Id: Ic3deb0aeac9782250f50cb975cfb67712f032c2d
2019-06-04 09:15:38 +01:00
Samuel Mehrbrodt
3f31de251e Add API method to remove elements from statusbar
Change-Id: Ie45d67e642fdd72afb79391cce88c9e25f0b53b8
Reviewed-on: https://gerrit.libreoffice.org/72851
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-06-04 09:10:00 +02:00
Jan Holesovsky
51a63c0e76 Deprecate Views_Added and Views_Removed; implement Views_List instead.
This helps avoiding the situation when the state in the Online and in
the integration get out of sync.

The integration should always get the most current state via Views_List,
and if they want to implement eg. notification what view has joined or
has left, they should just compare the old and the new state.

Change-Id: I841f77419bf86a57f77e16f8c0bd08063f31f68a
Reviewed-on: https://gerrit.libreoffice.org/73103
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-05-28 19:58:16 +02:00
Samuel Mehrbrodt
cc6c3607b5 Add postmessage method to remove toolbar buttons
Change-Id: I6ff2ee3008cf1915c18c2d971ffe1f9de1d926ae
Reviewed-on: https://gerrit.libreoffice.org/72727
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-23 09:24:23 +02:00
Samuel Mehrbrodt
704a6e4cd7 Action_HideBusy: Move description to correct column
Change-Id: I12549e59553db5762227297a1ddc9762adb62232
Reviewed-on: https://gerrit.libreoffice.org/72760
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-22 15:55:48 +02:00
Samuel Mehrbrodt
575eb43871 Insert_Button: Add parameter to specify a uno command
Change-Id: Ibdb1ad1b25df38c12ab71386a5ab8fb92d3076d0
Reviewed-on: https://gerrit.libreoffice.org/72758
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-22 15:54:44 +02:00
Samuel Mehrbrodt
e23ea28621 Reference: Add heading markup to headings
Change-Id: I426a49a17488b88924845fefb549126844c962a2
Reviewed-on: https://gerrit.libreoffice.org/72448
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-20 09:59:34 +02:00
Samuel Mehrbrodt
433f66ca8b Improve formatting: Add some linebreaks
Change-Id: I1e7fde64d84690cf8cb3e16d4ddd0baba3917151
Reviewed-on: https://gerrit.libreoffice.org/72447
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-20 09:59:23 +02:00
Samuel Mehrbrodt
e45f7998dc Insert_Button: Add parameter to specify insert position
Change-Id: I362f4c67506c1e98c47d7bd55127ded63758c334
Reviewed-on: https://gerrit.libreoffice.org/72446
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-20 09:59:13 +02:00
Samuel Mehrbrodt
0010ca1fb7 Add API methods to hide/show menu bar
Change-Id: I6b0731dbeda29edb311b460e1356fc6b97b9cebe
Reviewed-on: https://gerrit.libreoffice.org/72239
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-14 08:19:30 +02:00
Szymon Kłos
e62cdfae82 Handle storage load errors
Pass information about storage loading failures
to the wopi host.

Change-Id: I8da3a80e47b15f246343dc8e4199d8f860e1fb8a
Reviewed-on: https://gerrit.libreoffice.org/71354
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
2019-05-06 14:01:26 +02:00
Szymon Kłos
a3cb69c1cf WOPI: added FollowUser_Changed notification
Change-Id: Ibd98bcd373b6df06b02f6cf265e99e74e6ba9ce2
2019-01-04 12:45:52 +01:00
Szymon Kłos
d68d6cda4a WOPI: Action_RemoveView
Change-Id: Ie8160b70b94c5cb9012560fde64e7e4e9eb079cf
2018-12-07 12:39:28 +01:00
Szymon Kłos
4ed5860229 Add possibility to remove session
Change-Id: I7967f4a9a0d4f707d424132b43cd3d99b0f4d93b
2018-12-07 12:39:28 +01:00
Szymon Kłos
427a81f88c loleaflet: Added IsCurrentView field to Get_Views_Resp
Change-Id: I678b65522dfc8760502b1f499a8bde1664c8d9bf
2018-12-07 12:39:27 +01:00
Szymon Kłos
13a1f556eb loleafleat: Added Action_FollowUser
Change-Id: Ic393388af4c1753c20e3e3d37043821b5a5b2a06
2018-12-07 12:39:27 +01:00
Szymon Kłos
b43e8b7412 loleaflet: Added ReadOnly field to Get_Views_Resp
Change-Id: I0fca677ba992b1715ba907e5d6a6763e41ef5371
2018-12-07 12:39:27 +01:00
Jan Holesovsky
51a3af0d7e ui: Click on the document icon issues a postMessage to create a new doc.
Change-Id: Ib0b9663bb33ea89b796e2f45b4985eabc9347700
2018-12-07 12:39:27 +01:00
Samuel Mehrbrodt
c0d0ad7368 Add postMessage methods to show/hide toolbar buttons
Change-Id: Ib5ecde5a53aa0aae2346e360423e72025edade3a
2018-11-29 09:34:37 +01:00
Andras Timar
e0af51791b typo: ration -> ratio
Change-Id: I1c3a57b4c2f4d5c8daf3faca497ccbfa7f79ef33
2018-10-18 15:24:38 +02:00
Tor Lillqvist
602923d1f8 Add CallPythonScript and CallPythonScript-Result
Change-Id: I95162cbf30a539be76a922a7b15f7db334b23d15
2018-04-03 16:35:16 +03:00
Tor Lillqvist
89c67b87e4 Add vnd.sun.star.script example
Change-Id: I4c8cc8606612afae0070a7db518d3db5d8269447
2018-04-03 16:25:17 +03:00
Pranav Kant
1fabfd9fe3 Version restore states
See documentation

Change-Id: Ica3cd3744643157c5a2c6c1e42e0858ad641da16
2018-02-08 12:30:46 +05:30
Pranav Kant
bc682b2331 Document these helpful function
Change-Id: I70b439223c107e88ca38acb7b0ed814af814a22a
2017-12-26 17:22:49 +05:30
Pranav Kant
993bda50aa Possibly leftover from incomplete merge conflict
Change-Id: I60dbb7a81db10a399ba98cd0c8589ca4a975bcec
2017-12-26 17:22:06 +05:30
Jan Holesovsky
7ff432a370 tdf#99744 SaveAs: Reimplementation of the PutRelativeFile going through Kit.
This is necessary so that changing of the file type works.

Includes a unit test.

Change-Id: Id01d44e555b6bac1002ff950de461fd330602f63
2017-10-26 11:11:38 +02:00
Aditya Dewan
c3711a4375 Extending WOPI implementaion to introduce 'Save As' feature
Change-Id: Ic4c80f4c4b54944143682c25a5878c1336787b27
Reviewed-on: https://gerrit.libreoffice.org/40946
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-08-17 19:25:44 +02:00
Pranav Kant
b36e79f173 Document custom button API
Change-Id: I67b29052ed9f140d82b8f93289fc9704892517c5
2017-06-20 18:56:30 +05:30
Pranav Kant
483f600f22 Its Host_PostmessageReady, not Host_PostMessageReady according to specs
https://wopi.readthedocs.io/en/latest/scenarios/postmessage.html

Change-Id: Id01b84417dbc8f9226cab05c08e0d566f0305534
2017-06-20 18:56:30 +05:30
Pranav Kant
05c12733a6 PostMessage API - allow showing/hiding custom progress bar
Change-Id: Ide9c83018938d1195b87153fe78e3924c2d49d4a
2017-06-07 13:28:57 +05:30
Pranav Kant
3867bbe56e Allow adding custom buttons to our toolbar from host; save result resp.
... with no functionality attached to it except notifying the WOPI host
that button was clicked. Host is supposed to do the action thereafter
itself.

Also, notify the host when a save succeeds or fails.

Change-Id: I0daa2690af2259233840ea7ab4326b9b80d5fa87
2017-06-07 13:19:12 +05:30
Pranav Kant
bc98231119 loleaflet: Store and hide readonly view cursors
Change-Id: Ib2bec3158275e77d883308e25f1984491309234f
2017-03-31 12:20:43 +05:30
Ashod Nakashian
5cac95e6a9 loleaflet: remove pagepartrectangles request and handling in loleaflet
Change-Id: Ib83e7c0ca05a7d7d1a3d30675ef3cf5804f5ac4c
2017-02-05 21:59:22 -05:00
Tor Lillqvist
8fe58df759 An updated preview of a slide should be broadcast to all document clients
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>
2016-11-21 07:07:18 +00:00
Pranav Kant
4d28338a10 More WOPI documentation
Change-Id: I0c04d2105ff6227f9f7b6eaa73a7efe6a94faecd
2016-11-16 19:56:33 +05:30
Pranav Kant
d8a202bf1c tdf#103641: Split App_LoadedStatus - Frame_Ready, Document_Loaded
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
2016-11-15 18:23:40 +05:30
Pranav Kant
d060b242e8 More documentation about post message API
Change-Id: I362e159c32d2ea93139be58ca647a2f4c5678dee
2016-11-10 22:37:38 +05:30
Pranav Kant
5219baaab0 tdf#103641: WOPI: Implement Action_Save, Action_Print, Action_Export
WOPI hosts can now send above mentioned messages to loleaflet so
that loleaflet does stuff accordingly.

Change-Id: I50e10a62c5b629bd12f7d9ce51bcd13cb13cdd8a
2016-11-10 22:03:17 +05:30
Pranav Kant
7f77618f38 Document PostMessage API in reference.html
Change-Id: Ibdd3fc060a99f3b6185362fa3143014710873079
2016-11-10 14:45:20 +05:30
Tor Lillqvist
c99379d67f The 'invalidatepreview' event handling seems to be unimplemented
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.
2016-10-06 15:43:41 +03:00