loleaflet/js/toolbar.js | 2 - loleaflet/src/map/handler/Map.WOPI.js | 46 +++++++++++++++++----------------- loleaflet/src/unocommands.js | 4 +- 3 files changed, 26 insertions(+), 26 deletions(-)
New commits: commit 378197ef4abef3aa24ff0739f782427d1fcec3d4 Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> AuthorDate: Thu Jul 18 17:41:12 2019 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> CommitDate: Thu Jul 18 17:41:12 2019 +0200 Alow to modify UI before WOPIPostmessageReady Manually ported from 35905035a627c8e46c665cb625792f242f2a53ff diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js index b8b5f1e2c..63b973e49 100644 --- a/loleaflet/src/map/handler/Map.WOPI.js +++ b/loleaflet/src/map/handler/Map.WOPI.js @@ -124,27 +124,7 @@ L.Map.WOPI = L.Handler.extend({ }, _postMessageListener: function(e) { - if (!window.WOPIPostmessageReady) { - return; - } - var msg = JSON.parse(e.data); - if (msg.MessageId === 'Host_PostmessageReady') { - // We already have a listener for this in loleaflet.html, so ignore it here - return; - } - - // allow closing documents before they are completely loaded - if (msg.MessageId === 'Close_Session') { - this._map._socket.sendMessage('closedocument'); - return; - } - - // For all other messages, warn if trying to interact before we are completely loaded - if (!this._appLoaded) { - console.error('LibreOffice Online not loaded yet. Listen for App_LoadingStatus (Document_Loaded) event before using PostMessage API. Ignoring post message \'' + msg.MessageId + '\'.'); - return; - } if (msg.MessageId === 'Insert_Button') { if (msg.Values) { @@ -239,7 +219,28 @@ L.Map.WOPI = L.Handler.extend({ else if (msg.MessageId === 'Hide_Ruler') { this._map.hideRuler(); } - else if (msg.MessageId === 'Set_Settings') { + + if (!window.WOPIPostmessageReady) { + return; + } + if (msg.MessageId === 'Host_PostmessageReady') { + // We already have a listener for this in loleaflet.html, so ignore it here + return; + } + + // allow closing documents before they are completely loaded + if (msg.MessageId === 'Close_Session') { + this._map._socket.sendMessage('closedocument'); + return; + } + + // For all other messages, warn if trying to interact before we are completely loaded + if (!this._appLoaded) { + console.error('LibreOffice Online not loaded yet. Listen for App_LoadingStatus (Document_Loaded) event before using PostMessage API. Ignoring post message \'' + msg.MessageId + '\'.'); + return; + } + + if (msg.MessageId === 'Set_Settings') { if (msg.Values) { var alwaysActive = msg.Values.AlwaysActive; this._map.options.alwaysActive = !!alwaysActive; commit c482a47920ea978ba21231c98f68c4021dcd2d27 Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> AuthorDate: Thu Jul 18 17:04:23 2019 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> CommitDate: Thu Jul 18 17:04:23 2019 +0200 Fix "BackColor" tooltip diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js index 2090b00fa..dab0b5d4d 100644 --- a/loleaflet/js/toolbar.js +++ b/loleaflet/js/toolbar.js @@ -647,7 +647,7 @@ function createToolbar() { {type: 'button', id: 'strikeout', img: 'strikeout', hint: _UNO('.uno:Strikeout'), uno: 'Strikeout', disabled: true}, {type: 'break', id: 'breakformatting'}, {type: 'text-color', id: 'fontcolor', hint: _UNO('.uno:FontColor')}, - {type: 'color', id: 'backcolor', img: 'backcolor', hint: _UNO('.uno:BackColor')}, + {type: 'color', id: 'backcolor', img: 'backcolor', hint: _UNO('.uno:BackColor', 'text')}, {type: 'color', id: 'backgroundcolor', img: 'backgroundcolor', hint: _UNO('.uno:BackgroundColor')}, {type: 'break', id: 'breakcolor'}, {type: 'button', id: 'leftpara', img: 'alignleft', hint: _UNO('.uno:LeftPara', '', true), uno: 'LeftPara', unosheet: 'AlignLeft', disabled: true}, diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js index f192e3837..4c6197690 100644 --- a/loleaflet/src/unocommands.js +++ b/loleaflet/src/unocommands.js @@ -7,7 +7,7 @@ var unoCommandsArray = { ArrangeFrameMenu:{text:{menu:_('Arrange'),},}, ArrangeMenu:{global:{menu:_('A~rrange'),},presentation:{menu:_('~Arrange'),},}, AutoFormatMenu:{text:{menu:_('AutoCorr~ect'),},}, - BackColor:{global:{menu:_('Highlight Color'),},}, + BackColor:{text:{menu:_('Highlight Color'),},}, BackgroundColor:{global:{menu:_('Background Color'),},}, Bold:{global:{menu:_('Bold'),},}, BringToFront:{global:{menu:_('~Bring to Front'),},}, @@ -98,7 +98,7 @@ var unoCommandsArray = { InsertDateField:{text:{menu:_('~Date'),},}, InsertEndnote:{text:{menu:_('~Endnote'),},}, InsertField:{text:{menu:_('~More Fields...'),},}, - InsertFootnote:{text:{context:_('Insert Footnote'),menu:_('~Footnote'),},}, + InsertFootnote:{text:{menu:_('~Footnote'),},}, InsertGraphic:{global:{context:_('Insert Image...'),menu:_('~Image...'),},}, InsertHardHyphen:{global:{menu:_('Non-br~eaking hyphen'),},}, InsertHeaderFooterMenu:{text:{menu:_('He~ader and Footer'),},}, commit 5a5371c353d9df3a915aa2f7dc19c1e9d456141f Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> AuthorDate: Wed Nov 28 16:41:20 2018 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> CommitDate: Thu Jul 18 16:00:48 2019 +0200 resizeToolbar is undefined But it inserting buttons seems to work fine even without that call, so just remove it. Change-Id: I831b171c57feed82e1ca778ba5a16a382f1786ee (cherry picked from commit 46f318c3584b810cc1b366c3510c8871b4eca886) diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js index b67cf9a9d..b8b5f1e2c 100644 --- a/loleaflet/src/map/handler/Map.WOPI.js +++ b/loleaflet/src/map/handler/Map.WOPI.js @@ -3,7 +3,7 @@ * L.WOPI contains WOPI related logic */ -/* global $ w2ui toolbarUpMobileItems resizeToolbar _ */ +/* global $ w2ui toolbarUpMobileItems _ */ L.Map.WOPI = L.Handler.extend({ // If the CheckFileInfo call fails on server side, we won't have any PostMessageOrigin. // So use '*' because we still needs to send 'close' message to the parent frame which @@ -179,7 +179,6 @@ L.Map.WOPI = L.Handler.extend({ var idx = toolbarUpMobileItems.indexOf(insertBefore); toolbarUpMobileItems.splice(idx, 0, msg.Values.id); } - resizeToolbar(); } else if (this._map._permission === 'readonly') { // Just add a menu entry for it _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits