kit/ChildSession.cpp | 2 +- loleaflet/src/control/Control.Toolbar.js | 6 +++--- loleaflet/src/core/Socket.js | 30 +++++++++++++++++++++++------- 3 files changed, 27 insertions(+), 11 deletions(-)
New commits: commit 16be50d7579a4a6c73b20a31938ba1750e8352de Author: Szymon Kłos <[email protected]> AuthorDate: Tue Jul 28 12:45:01 2020 +0200 Commit: Szymon Kłos <[email protected]> CommitDate: Tue Jul 28 14:51:10 2020 +0200 Send Action_Save_Resp when notification was requested on save as Change-Id: Iafe06873fcd8c25e93eb9daa2eea187827e3ac47 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99593 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 38a5b699f..dc0e9ec3d 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -2113,7 +2113,7 @@ bool ChildSession::saveAs(const char* /*buffer*/, int /*length*/, const StringVe if (success) sendTextFrame("saveas: url=" + encodedURL + " filename=" + encodedWopiFilename); else - sendTextFrameAndLogError("error: cmd=storage kind=savefailed"); + sendTextFrameAndLogError("error: cmd=saveas kind=savefailed"); return true; } diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 7955429e7..9f382a020 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -522,7 +522,19 @@ L.Socket = L.Class.extend({ return; } - else if (textMsg.startsWith('error:') && command.errorCmd === 'storage') { + else if (textMsg.startsWith('error:') + && (command.errorCmd === 'storage' || command.errorCmd === 'saveas')) { + + if (command.errorCmd === 'saveas') { + this._map.fire('postMessage', { + msgId: 'Action_Save_Resp', + args: { + success: false, + result: command.errorKind + } + }); + } + this._map.hideBusy(); var storageError; if (command.errorKind === 'savediskfull') { @@ -596,16 +608,16 @@ L.Socket = L.Class.extend({ } // Skip empty errors (and allow for suppressing errors by making them blank). - if (storageError != '') { + if (storageError && storageError != '') { // Parse the storage url as link var tmpLink = document.createElement('a'); tmpLink.href = this._map.options.doc; // Insert the storage server address to be more friendly storageError = storageError.replace('%storageserver', tmpLink.host); this._map.fire('warn', {msg: storageError}); - } - return; + return; + } } else if (textMsg.startsWith('error:') && command.errorCmd === 'internal') { this._map.hideBusy(); @@ -625,9 +637,6 @@ L.Socket = L.Class.extend({ return; } - else if (textMsg.startsWith('error:') && command.errorCmd === 'saveas') { - this._map.hideBusy(); - } else if (textMsg.startsWith('error:') && command.errorCmd === 'load') { this._map.hideBusy(); this.close(); @@ -768,6 +777,13 @@ L.Socket = L.Class.extend({ NewName: command.filename } }); + } else if (textMsg.startsWith('saveas:')) { + this._map.fire('postMessage', { + msgId: 'Action_Save_Resp', + args: { + success: true + } + }); } } // var name = command.name; - ignored, we get the new name via the wopi's BaseFileName commit e9384302d1ca4758580c4c68f57fedf802989f15 Author: Szymon Kłos <[email protected]> AuthorDate: Tue Jul 28 10:08:37 2020 +0200 Commit: Szymon Kłos <[email protected]> CommitDate: Tue Jul 28 14:50:58 2020 +0200 Use more reliable approach to show close button Sometimes using Chrome browser close button is not shown after calling show(): replace it with css modification which seems to be more reliable. Also don't show close button on mobile devices where we have hamburger menu. Change-Id: Id354374f18e24fcbdd9afb3894c40cccfe2811ea Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99594 Tested-by: Jenkins CollaboraOffice <[email protected]> Tested-by: Jenkins Reviewed-by: Szymon Kłos <[email protected]> diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 82ebaa736..8e4aaf6af 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -1056,12 +1056,12 @@ function setupToolbar(e) { map.on('commandresult', onCommandResult); map.on('updateparts pagenumberchanged', onUpdateParts); - if (map.options.wopi && L.Params.closeButtonEnabled) { - $('#closebuttonwrapper').show(); + if (map.options.wopi && L.Params.closeButtonEnabled && !window.mode.isMobile()) { + $('#closebuttonwrapper').css('display', 'block'); } else if (!L.Params.closeButtonEnabled) { $('#closebuttonwrapper').hide(); } else if (L.Params.closeButtonEnabled && !window.mode.isMobile()) { - $('#closebuttonwrapper').show(); + $('#closebuttonwrapper').css('display', 'block'); } $('#closebutton').click(function() { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
