loleaflet/reference.html              |    4 ++++
 loleaflet/src/core/Socket.js          |    6 ++++++
 loleaflet/src/map/handler/Map.WOPI.js |    1 +
 3 files changed, 11 insertions(+)

New commits:
commit fa64bbf4be6b3ff5b1361effd22acf8f454e4780
Author:     Ashod Nakashian <ashod.nakash...@collabora.co.uk>
AuthorDate: Sun Jun 16 14:16:06 2019 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Jun 17 13:29:34 2019 +0200

    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.ti...@collabora.com>
    Tested-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/loleaflet/reference.html b/loleaflet/reference.html
index dc8e69480..41ae4ebe1 100644
--- a/loleaflet/reference.html
+++ b/loleaflet/reference.html
@@ -2938,9 +2938,13 @@ WOPI host to editor
                <td><code><b>Action_SaveAs</b></code></td>
                <td><code>
                    <nobr>Filename: &lt;String&gt;</nobr>
+                   <nobr>Notify: &lt;boolean&gt;</nobr>
                </code></td>
                <td>Creates copy of the document with given Filename.<br/>
                <code>Filename</code> is the requested filename for the new 
file.<br/>
+               <code>Notify</code> when present and set to true notifies the
+               host when document is saved. See <code>Action_Save_Resp</code>
+               for details.
                </td>
        </tr>
        <tr>
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 78d8a00d7..51f16af98 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -713,6 +713,12 @@ L.Socket = L.Class.extend({
                                this._map.options.wopiSrc = 
encodeURIComponent(docUrl);
                                this._map.loadDocument();
                                this._map.sendInitUNOCommands();
+
+                               // Issue the save response to be consistent 
with normal save.
+                               var postMessageObj = {
+                                       success: true
+                               };
+                               this._map.fire('postMessage', {msgId: 
'Action_Save_Resp', args: postMessageObj});
                        }
                        // var name = command.name; - ignored, we get the new 
name via the wopi's BaseFileName
                }
diff --git a/loleaflet/src/map/handler/Map.WOPI.js 
b/loleaflet/src/map/handler/Map.WOPI.js
index 31a4c059f..8f470fbed 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -314,6 +314,7 @@ L.Map.WOPI = L.Handler.extend({
                else if (msg.MessageId === 'Action_SaveAs') {
                        if (msg.Values) {
                                if (msg.Values.Filename !== null && 
msg.Values.Filename !== undefined) {
+                                       this._notifySave = msg.Values['Notify'];
                                        this._map.showBusy(_('Creating 
copy...'), false);
                                        this._map.saveAs(msg.Values.Filename);
                                }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to