[Libreoffice-commits] online.git: 2 commits - loleaflet/reference.html loleaflet/src
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu May 23 07:24:43 UTC 2019
loleaflet/reference.html | 10 ++++++++++
loleaflet/src/control/Control.Toolbar.js | 8 ++++----
loleaflet/src/map/handler/Map.WOPI.js | 6 ++++--
3 files changed, 18 insertions(+), 6 deletions(-)
New commits:
commit 62850138fe73e609f73ee5142f8a406b78ea9aa5
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Wed May 22 15:29:33 2019 +0200
Commit: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Thu May 23 09:24:36 2019 +0200
Toolbar: Add IDs to breaks
Some of the breaks already had IDs, but not all.
This is useful to specify the button position via Insert_Button.
Change-Id: I97b0d3d0481f7f2edcdb2c0bbc617cd9ede32871
Reviewed-on: https://gerrit.libreoffice.org/72785
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js
index 17cf8381a..7161f800f 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -686,7 +686,7 @@ function initNormalToolbar() {
{type: 'button', id: 'redo', img: 'redo', hint: _UNO('.uno:Redo'), uno: 'Redo', disabled: true, mobile: false},
{type: 'button', id: 'formatpaintbrush', img: 'copyformat', hint: _UNO('.uno:FormatPaintbrush'), uno: 'FormatPaintbrush', mobile: false},
{type: 'button', id: 'reset', img: 'deleteformat', hint: _UNO('.uno:ResetAttributes', 'text'), uno: 'ResetAttributes', mobile: false},
- {type: 'break', mobile: false},
+ {type: 'break', id: 'breakundo', mobile: false},
{type: 'menu-radio', id: 'zoom', text: '100%',
selected: 'zoom100',
mobile: false, tablet: false,
@@ -739,15 +739,15 @@ function initNormalToolbar() {
}});
}
}, mobile: false},
- {type: 'break', mobile: false, tablet: false },
+ {type: 'break', id: 'breakstyles', mobile: false, tablet: false },
{type: 'button', id: 'bold', img: 'bold', hint: _UNO('.uno:Bold'), uno: 'Bold'},
{type: 'button', id: 'italic', img: 'italic', hint: _UNO('.uno:Italic'), uno: 'Italic'},
{type: 'button', id: 'underline', img: 'underline', hint: _UNO('.uno:Underline'), uno: 'Underline'},
{type: 'button', id: 'strikeout', img: 'strikeout', hint: _UNO('.uno:Strikeout'), uno: 'Strikeout'},
- {type: 'break'},
+ {type: 'break', id: 'breakformatting'},
{type: 'text-color', id: 'fontcolor', img: 'textcolor', hint: _UNO('.uno:FontColor')},
{type: 'color', id: 'backcolor', img: 'backcolor', hint: _UNO('.uno:BackgroundColor')},
- {type: 'break' , mobile:false},
+ {type: 'break' , id: 'breakcolor', mobile:false},
{type: 'button', id: 'leftpara', img: 'alignleft', hint: _UNO('.uno:LeftPara', '', true), uno: 'LeftPara', hidden: true, unosheet: 'AlignLeft', disabled: true},
{type: 'button', id: 'centerpara', img: 'alignhorizontal', hint: _UNO('.uno:CenterPara', '', true), uno: 'CenterPara', hidden: true, unosheet: 'AlignHorizontalCenter', disabled: true},
{type: 'button', id: 'rightpara', img: 'alignright', hint: _UNO('.uno:RightPara', '', true), uno: 'RightPara', hidden: true, unosheet: 'AlignRight', disabled: true},
commit cc6c3607b54a5dcfe08b9c248ef14ea97893be30
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Wed May 22 09:29:15 2019 +0200
Commit: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Thu May 23 09:24:23 2019 +0200
Add postmessage method to remove toolbar buttons
Change-Id: I6ff2ee3008cf1915c18c2d971ffe1f9de1d926ae
Reviewed-on: https://gerrit.libreoffice.org/72727
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/loleaflet/reference.html b/loleaflet/reference.html
index ab45ad510..767293068 100644
--- a/loleaflet/reference.html
+++ b/loleaflet/reference.html
@@ -3150,6 +3150,16 @@ Editor to WOPI host
</td>
</tr>
<tr>
+ <td><code><b>Remove_Button</b></code></td>
+ <td>
+ <code><nobr>id: <string></nobr></code>
+ </td>
+ <td>
+ Removes a button from the toolbar.<br/>
+ <code>id</code> is the button ID (see <a href="#toolbar-button-ids">Finding toolbar button IDs</a>).
+ </td>
+ </tr>
+ <tr>
<td><code><b>Hide_Menubar</b></code></td>
<td></td>
<td>
diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js
index 5367450e7..4a267529e 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -206,7 +206,7 @@ L.Map.WOPI = L.Handler.extend({
}
}
}
- if (msg.MessageId === 'Show_Button' || msg.MessageId === 'Hide_Button') {
+ if (msg.MessageId === 'Show_Button' || msg.MessageId === 'Hide_Button' || msg.MessageId === 'Remove_Button') {
if (!msg.Values) {
console.error('Property "Values" not set');
return;
@@ -225,8 +225,10 @@ L.Map.WOPI = L.Handler.extend({
}
if (msg.MessageId === 'Show_Button') {
w2ui['editbar'].show(msg.Values.id);
- } else {
+ } else if (msg.MessageId === 'Hide_Button') {
w2ui['editbar'].hide(msg.Values.id);
+ } else {
+ w2ui['editbar'].remove(msg.Values.id);
}
}
else if (msg.MessageId === 'Show_Menubar') {
More information about the Libreoffice-commits
mailing list