common/FileUtil.cpp | 9 +- common/Log.hpp | 2 configure.ac | 2 loleaflet/css/leaflet.css | 12 +- loleaflet/css/loleaflet.css | 4 loleaflet/css/toolbar.css | 6 - loleaflet/images/lc_backgroundcolor.svg | 1 loleaflet/images/lc_insertfootnote.svg | 1 loleaflet/js/toolbar.js | 134 ++++++++++++++++++++++++------- loleaflet/l10n/uno/de.json | 1 loleaflet/reference.html | 63 ++++++++++++-- loleaflet/src/control/Control.Menubar.js | 11 ++ loleaflet/src/control/Ruler.js | 1 loleaflet/src/map/Map.js | 21 ++++ loleaflet/src/map/handler/Map.WOPI.js | 31 ++++++- loleaflet/src/unocommands.js | 1 16 files changed, 246 insertions(+), 54 deletions(-)
New commits: commit c116947113345b16cf102a15d1ff731b59657ee5 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Wed Jun 12 09:57:55 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Wed Jun 12 09:57:55 2019 +0200 Release 6.2.4 diff --git a/configure.ac b/configure.ac index 08e282e2b..d18baf46c 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.63]) -AC_INIT([loolwsd], [6.2.3.2], [[email protected]]) +AC_INIT([loolwsd], [6.2.4.0], [[email protected]]) LT_INIT([shared, disable-static, dlopen]) AM_INIT_AUTOMAKE([1.10 subdir-objects tar-pax -Wno-portability]) commit 40fa4797c44134113faec0acc31c5396a5e6b7a2 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Wed Jun 12 09:53:01 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Wed Jun 12 09:53:01 2019 +0200 Fix toolbar to behave like in master * Rename changed toolbar id * Hide not remove background color button diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js index 9d28f9b4f..8320107ee 100644 --- a/loleaflet/js/toolbar.js +++ b/loleaflet/js/toolbar.js @@ -703,7 +703,7 @@ function createToolbar() { {id: 'localgraphic', text: _('Insert Local Image'), icon: 'insertgraphic'}, {id: 'remotegraphic', text: _UNO('.uno:InsertGraphic', '', true), icon: 'insertgraphic'}, ]}, - {type: 'button', id: 'specialcharacter', img: 'specialcharacter', hint: _UNO('.uno:InsertSymbol', '', true), uno: '.uno:InsertSymbol'} + {type: 'button', id: 'insertsymbol', img: 'specialcharacter', hint: _UNO('.uno:InsertSymbol', '', true), uno: '.uno:InsertSymbol'} ]; if (_useSimpleUI()) { @@ -1470,7 +1470,8 @@ function onDocLayerInit() { break; case 'text': - toolbarUp.remove('wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending', 'setborderstyle', 'conditionalformaticonset', 'backgroundcolor'); + toolbarUp.remove('wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending', 'setborderstyle', 'conditionalformaticonset'); + toolbarUp.hide('backgroundcolor'); if (!_useSimpleUI()) { statusbar.insert('left', [ {type: 'break', id: 'break1'}, commit b91b170492c1a96862bc480244281179b9d443e9 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Mon May 13 21:13:15 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Wed Jun 12 09:48:00 2019 +0200 Add API methods to hide/show ruler Change-Id: I4d14d9d68e7ebda56c80a1ad678a21c67ffd5ac2 (cherry picked from commit 5754d0593975fa63dfc3593ec5ff31117ea41a21) diff --git a/loleaflet/reference.html b/loleaflet/reference.html index 160f55a9e..31eb23610 100644 --- a/loleaflet/reference.html +++ b/loleaflet/reference.html @@ -3137,6 +3137,19 @@ WOPI host to editor Shows the menu bar. </td> </tr> + <td><code><b>Hide_Ruler</b></code></td> + <td></td> + <td> + Hides the horizontal document ruler (Writer only) + </td> + </tr> + <tr> + <td><code><b>Show_Ruler</b></code></td> + <td></td> + <td> + Shows the horizontal document ruler (Writer only) + </td> + </tr> </table> <h5><a name="toolbar-button-ids">Finding toolbar button IDs</a></h5> diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js index fa67eab81..a0bcfff74 100644 --- a/loleaflet/src/map/handler/Map.WOPI.js +++ b/loleaflet/src/map/handler/Map.WOPI.js @@ -234,6 +234,12 @@ L.Map.WOPI = L.Handler.extend({ else if (msg.MessageId === 'Hide_Menubar') { this._map.hideMenubar(); } + else if (msg.MessageId === 'Show_Ruler') { + this._map.showRuler(); + } + else if (msg.MessageId === 'Hide_Ruler') { + this._map.hideRuler(); + } else if (msg.MessageId === 'Set_Settings') { if (msg.Values) { var alwaysActive = msg.Values.AlwaysActive; commit 672084387e7c0b33268e834626be11c16a16e6ad Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Tue May 28 15:39:48 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Wed Jun 12 09:48:00 2019 +0200 Use LO branding colors for loading progress bar From https://wiki.documentfoundation.org/Marketing/Branding Change-Id: I7d3d5932ef67ae5c1a522d03e1d1a0a8960b0816 Reviewed-on: https://gerrit.libreoffice.org/73107 Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit 43f09f284ca9be50913a3799c0c98137a1fdf42c) diff --git a/loleaflet/css/leaflet.css b/loleaflet/css/leaflet.css index c9739b2e6..3b63321e5 100644 --- a/loleaflet/css/leaflet.css +++ b/loleaflet/css/leaflet.css @@ -731,14 +731,14 @@ input.clipboard { margin: 0 -1px; height: 100%; text-align: right; - background: #5c3dcc; + background: #18A303; border: 1px solid; - border-color: #4422bf #5435c4; + border-color: #106802; border-radius: 10px; - background-image: -webkit-linear-gradient(top, #745dc6, #6549cc 70%, #5c3dcc); - background-image: -moz-linear-gradient(top, #745dc6, #6549cc 70%, #5c3dcc); - background-image: -o-linear-gradient(top, #745dc6, #6549cc 70%, #5c3dcc); - background-image: linear-gradient(to bottom, #745dc6, #6549cc 70%, #5c3dcc); + background-image: -webkit-linear-gradient(top, #92E285, #43C330 70%, #18A303); + background-image: -moz-linear-gradient(top, #92E285, #43C330 70%, #18A303); + background-image: -o-linear-gradient(top, #92E285, #43C330 70%, #18A303); + background-image: linear-gradient(to bottom, #92E285, #43C330 70%, #18A303); -webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2); box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2); } commit a6ff20d3655162f3ffab80b216b8994b38a8bff0 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Thu May 23 14:52:11 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Wed Jun 12 09:47:56 2019 +0200 Add API method to remove elements from statusbar Change-Id: Ie45d67e642fdd72afb79391cce88c9e25f0b53b8 Reviewed-on: https://gerrit.libreoffice.org/72851 Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit 3f31de251edc2df7df9bf8a94e3e38852686a8b2) diff --git a/loleaflet/reference.html b/loleaflet/reference.html index 6381e3391..160f55a9e 100644 --- a/loleaflet/reference.html +++ b/loleaflet/reference.html @@ -3114,6 +3114,16 @@ WOPI host to editor </td> </tr> <tr> + <td><code><b>Remove_Statusbar_Element</b></code></td> + <td> + <code><nobr>id: <string></nobr></code> + </td> + <td> + Removes an element from the statusbar.<br/> + <code>id</code> is the element ID (see <a href="#statusbar-element-ids">Finding statusbar element IDs</a>). + </td> + </tr> + <tr> <td><code><b>Hide_Menubar</b></code></td> <td></td> <td> @@ -3131,7 +3141,12 @@ WOPI host to editor <h5><a name="toolbar-button-ids">Finding toolbar button IDs</a></h5> <p>Toolbar button IDs are defined in the <a href="https://opengrok.libreoffice.org/search?project=online&q=&defs=createToolbar">createToolbar</a> -function in <a href="https://opengrok.libreoffice.org/xref/online/loleaflet/js/toolbar.js">loleaflet/js/toolbar.js</a>. +function in <a href="https://opengrok.libreoffice.org/xref/online/loleaflet/src/control/Control.Toolbar.js">Control.Toolbar.js</a>. +Note that they usually don't change but there is no guarantee that they are stable.</p> + +<h5><a name="statusbar-element-ids">Finding statusbar element IDs</a></h5> +<p>Statusbar button IDs are defined in the <a href="https://opengrok.libreoffice.org/search?project=online&q=&defs=onDocLayerInit">onDocLayerInit</a> +function in <a href="https://opengrok.libreoffice.org/xref/online/loleaflet/src/control/Control.Toolbar.js">Control.Toolbar.js</a>. Note that they usually don't change but there is no guarantee that they are stable.</p> Editor to WOPI host diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js index 303732a14..fa67eab81 100644 --- a/loleaflet/src/map/handler/Map.WOPI.js +++ b/loleaflet/src/map/handler/Map.WOPI.js @@ -213,6 +213,21 @@ L.Map.WOPI = L.Handler.extend({ w2ui['toolbar-up'].remove(msg.Values.id); } } + if (msg.MessageId === 'Remove_Statusbar_Element') { + if (!msg.Values) { + console.error('Property "Values" not set'); + return; + } + if (!msg.Values.id) { + console.error('Property "Values.id" not set'); + return; + } + if (!w2ui['toolbar-down'].get(msg.Values.id)) { + console.error('Statusbar element with id "' + msg.Values.id + '" not found.'); + return; + } + w2ui['toolbar-down'].remove(msg.Values.id); + } else if (msg.MessageId === 'Show_Menubar') { this._map.showMenubar(); } commit 08c3acd65b7250ecd88d8dd70c16134b9142951d Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Wed May 22 08:31:59 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Wed Jun 12 09:29:01 2019 +0200 Log fatal errors also to stderr Change-Id: I5e6429ab007d13a2506c375923049b91c80ffba0 Reviewed-on: https://gerrit.libreoffice.org/72722 Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit b40cf51181ecf6d65f25238b84da0f98176fc249) diff --git a/common/Log.hpp b/common/Log.hpp index bf05fc7ce..d97afb073 100644 --- a/common/Log.hpp +++ b/common/Log.hpp @@ -15,6 +15,7 @@ #include <cstddef> #include <functional> +#include <iostream> #include <thread> #include <sstream> #include <string> @@ -322,6 +323,7 @@ namespace Log #define LOG_FTL(X) \ do \ { \ + std::cerr << X << std::endl; \ auto &log_ = Log::logger(); \ if (log_.fatal()) \ { \ commit 0d69c3af5fbe62e3ddebaec8c1e4c3a9b9ef7e6e Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Tue May 28 10:05:12 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Wed Jun 12 09:28:36 2019 +0200 Add dropdown to switch doc language to statusbar instead of just having a label displaying the current language. Change-Id: Ib3068e6001fc86cc129f7817300de4e8a991c8c6 Reviewed-on: https://gerrit.libreoffice.org/73086 Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit e4b39f6811fa4f060e200a20ba9a6936b4b1b7e2) diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js index d1f6d944d..9d28f9b4f 100644 --- a/loleaflet/js/toolbar.js +++ b/loleaflet/js/toolbar.js @@ -1438,8 +1438,7 @@ function onDocLayerInit() { {type: 'html', id: 'InsertMode', mobile: false, html: '<div id="InsertMode" class="loleaflet-font" title="'+_('Entering text mode')+ '" style="padding: 5px 5px;">  </div>' }, {type: 'break', id:'break4'}, - {type: 'html', id: 'LanguageStatus', mobile: false, - html: '<div id="LanguageStatus" class="loleaflet-font" title="'+_('Text Language')+ '" style="padding: 5px 5px;">  </div>' }, + {type: 'menu-radio', id: 'LanguageStatus', mobile: false}, {type: 'break', id:'break5'}, {type: 'html', id: 'StatusSelectionMode', mobile: false, html: '<div id="StatusSelectionMode" class="loleaflet-font" title="'+_('Selection Mode')+ '" style="padding: 5px 5px;">  </div>' }, @@ -1487,8 +1486,7 @@ function onDocLayerInit() { {type: 'html', id: 'StatusSelectionMode', mobile: false, html: '<div id="StatusSelectionMode" class="loleaflet-font" title="'+_('Selection Mode')+ '" style="padding: 5px 5px;">  </div>' }, {type: 'break', id:'break7', mobile:false}, - {type: 'html', id: 'LanguageStatus', mobile: false, - html: '<div id="LanguageStatus" class="loleaflet-font" title="'+_('Text Language')+ '" style="padding: 5px 5px;">  </div>' } + {type: 'menu-radio', id: 'LanguageStatus', mobile: false}, ]); } @@ -1513,10 +1511,7 @@ function onDocLayerInit() { html: '<div id="PageStatus" class="loleaflet-font" title="' + _('Number of Slides') + '" style="padding: 5px 5px;">  </div>' }, {type: 'break', id: 'break2', mobile: false}, - { - type: 'html', id: 'LanguageStatus', mobile: false, - html: '<div id="LanguageStatus" class="loleaflet-font" title="' + _('Text Language') + '" style="padding: 5px 5px;">  </div>' - } + {type: 'menu-radio', id: 'LanguageStatus', mobile: false} ]); } @@ -1664,7 +1659,7 @@ function onCommandStateChanged(e) { } } else if (commandName === '.uno:LanguageStatus') { - updateToolbarItem(statusbar, 'LanguageStatus', $('#LanguageStatus').html(_(state)).parent().html()); + statusbar.set('LanguageStatus', {text: _(state), selected: state}); } else if (commandName === '.uno:ModifiedStatus') { var modifiedStatus = e.state === 'true'; @@ -1758,6 +1753,41 @@ function onCommandStateChanged(e) { } } + +function onCommandValues(e) { + if (e.commandName === '.uno:LanguageStatus' && L.Util.isArray(e.commandValues)) { + var translated, neutral; + var constLang = '.uno:LanguageStatus?Language:string='; + var constDefault = 'Default_RESET_LANGUAGES'; + var constNone = 'Default_LANGUAGE_NONE'; + var resetLang = _('Reset to Default Language'); + var noneLang = _('None (Do not check spelling)'); + var languages = []; + e.commandValues.forEach(function (language) { + languages.push({ translated: _(language), neutral: language }); + }); + languages.sort(function (a, b) { + return a.translated < b.translated ? -1 : a.translated > b.translated ? 1 : 0; + }); + + var toolbaritems = []; + toolbaritems.push({ text: noneLang, + id: 'nonelanguage', + uno: constLang + constNone }); + + + for (var lang in languages) { + translated = languages[lang].translated; + neutral = languages[lang].neutral; + toolbaritems.push({ id: neutral, text: translated, uno: constLang + encodeURIComponent('Default_' + neutral) }); + } + + toolbaritems.push({ id: 'reset', text: resetLang, uno: constLang + constDefault }); + + w2ui['toolbar-down'].set('LanguageStatus', {items: toolbaritems}); + } +} + function updateCommandValues() { var data = []; // 1) For .uno:StyleApply @@ -2347,6 +2377,7 @@ function setupToolbar(e) { map.on('commandresult', onCommandResult); map.on('updateparts pagenumberchanged', onUpdateParts); map.on('commandstatechanged', onCommandStateChanged); + map.on('commandvalues', onCommandValues, this); } global.setupToolbar = setupToolbar; commit 3b0b22d8ab525777a514d6ca42bd84218413db1d Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Mon May 13 21:13:15 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Wed Jun 12 09:18:46 2019 +0200 Add "Show ruler" menu entry Also add some space between the ruler and the document frame Change-Id: I75a3e4668d03cf44b235082cd7d8c24672209262 Reviewed-on: https://gerrit.libreoffice.org/72339 Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit 0576a3cced4c27be940a831d6735ece533a2a47d) diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css index f53adfbbd..f345a3cdd 100644 --- a/loleaflet/css/loleaflet.css +++ b/loleaflet/css/loleaflet.css @@ -31,6 +31,10 @@ cursor: default; } +.hasruler { + padding-top: 16px; +} + .scroll-container .mCSB_scrollTools.mCSB_1_scrollbar { position: absolute; z-index: 1000; diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 4be82c6b4..28fa62156 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -61,6 +61,7 @@ L.Control.Menubar = L.Control.extend({ {name: _UNO('.uno:ZoomPlus', 'text'), id: 'zoomin', type: 'action'}, {name: _UNO('.uno:ZoomMinus', 'text'), id: 'zoomout', type: 'action'}, {name: _('Reset zoom'), id: 'zoomreset', type: 'action'}, + {name: _('Show Ruler'), id: 'showruler', type: 'action'}, {type: 'separator'}, {uno: '.uno:ControlCodes'} ] @@ -602,12 +603,12 @@ L.Control.Menubar = L.Control.extend({ var aItem = this; var type = $(aItem).data('type'); var id = $(aItem).data('id'); + var constChecked = 'lo-menu-item-checked'; if (self._map._permission === 'edit') { if (type === 'unocommand') { // enable all depending on stored commandStates var data, lang; var constUno = 'uno'; var constState = 'stateChangeHandler'; - var constChecked = 'lo-menu-item-checked'; var constLanguage = '.uno:LanguageStatus'; var constPageHeader = '.uno:InsertPageHeader'; var constPageFooter = '.uno:InsertPageFooter'; @@ -650,6 +651,12 @@ L.Control.Menubar = L.Control.extend({ if (index > 0) { self.options.allowedViewModeActions.splice(index, 1); } + } else if (id === 'showruler') { + if (self._map.isRulerVisible()) { + $(aItem).addClass(constChecked); + } else { + $(aItem).removeClass(constChecked); + } } else { $(aItem).removeClass('disabled'); } @@ -707,6 +714,8 @@ L.Control.Menubar = L.Control.extend({ this._map.setZoom(this._map.options.zoom); } else if (id === 'fullscreen') { L.toggleFullScreen(); + } else if (id === 'showruler') { + this._map.toggleRuler(); } else if (id === 'fullscreen-presentation' && this._map.getDocType() === 'presentation') { this._map.fire('fullscreen'); } else if (id === 'insertpage') { diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js index 95ec5143b..04a4c5a27 100644 --- a/loleaflet/src/control/Ruler.js +++ b/loleaflet/src/control/Ruler.js @@ -26,6 +26,7 @@ L.Control.Ruler = L.Control.extend({ map.on('docsize', this._updatePaintTimer, this); map.on('scrolloffset resize', this._fixOffset, this); map.on('updatepermission', this._changeInteractions, this); + $('#map').addClass('hasruler'); this._map = map; return this._initLayout(); diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index cac4a661d..6427f06ad 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -1330,6 +1330,27 @@ L.Map = L.Evented.extend({ this.showMenubar(); else this.hideMenubar(); + }, + + showRuler: function() { + $('.loleaflet-ruler').show(); + $('#map').addClass('hasruler'); + }, + + hideRuler: function() { + $('.loleaflet-ruler').hide(); + $('#map').removeClass('hasruler'); + }, + + toggleRuler: function() { + if (this.isRulerVisible()) + this.hideRuler(); + else + this.showRuler(); + }, + + isRulerVisible: function() { + return $('.loleaflet-ruler').is(':visible'); } }); commit ed6396020753c5a353e14fce4f7ab35e83077fd1 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Fri May 17 12:23:32 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Wed Jun 12 09:14:08 2019 +0200 Move zoom selection dropdown to statusbar No point having this in the toolbar when all zoom related functions are in the statusbar Change-Id: Ia1ea8f724956eb2c521c60fb2360eb243190a76c Reviewed-on: https://gerrit.libreoffice.org/72460 Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit 3c888d71d8846c375129d838d54795a443fb832f) diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js index 879da17c6..d1f6d944d 100644 --- a/loleaflet/js/toolbar.js +++ b/loleaflet/js/toolbar.js @@ -116,6 +116,9 @@ function onClick(e, id, item, subItem) { else if (id === 'zoomout' && map.getZoom() > map.getMinZoom()) { map.zoomOut(1); } + else if (item.scale) { + map.setZoom(item.scale); + } else if (id === 'zoomreset') { map.setZoom(map.options.zoom); } @@ -1050,7 +1053,21 @@ function initNormalToolbar(toolItems) { {type: 'break', id: 'prevnextbreak'}, {type: 'button', id: 'zoomreset', img: 'zoomreset', hint: _('Reset zoom')}, {type: 'button', id: 'zoomout', img: 'zoomout', hint: _UNO('.uno:ZoomMinus')}, - {type: 'html', id: 'zoomlevel', html: '<div id="zoomlevel" class="loleaflet-font">100%</div>', mobile: false}, + {type: 'menu-radio', id: 'zoom', text: '100%', + selected: 'zoom100', + mobile: false, + items: [ + { id: 'zoom50', text: '50%', scale: 6}, + { id: 'zoom60', text: '60%', scale: 7}, + { id: 'zoom70', text: '70%', scale: 8}, + { id: 'zoom85', text: '85%', scale: 9}, + { id: 'zoom100', text: '100%', scale: 10}, + { id: 'zoom120', text: '120%', scale: 11}, + { id: 'zoom150', text: '150%', scale: 12}, + { id: 'zoom175', text: '175%', scale: 13}, + { id: 'zoom200', text: '200%', scale: 14} + ] + }, {type: 'button', id: 'zoomin', img: 'zoomin', hint: _UNO('.uno:ZoomPlus')} ], onClick: function (e) { @@ -1442,6 +1459,13 @@ function onDocLayerInit() { ]); } + statusbar.set('zoom', { + items: [ + { id: 'zoom100', text: '100%', scale: 10}, + { id: 'zoom200', text: '200%', scale: 14} + ] + }); + // Remove irrelevant toolbars $('#presentation-toolbar').hide(); @@ -2124,9 +2148,7 @@ function updateUserListCount() { userlistItem.text = noUser; } - var zoomlevel = $('#zoomlevel').html(); w2ui['toolbar-down'].refresh(); - $('#zoomlevel').html(zoomlevel); } function escapeHtml(input) { @@ -2233,9 +2255,24 @@ function setupToolbar(e) { }); map.on('zoomend', function () { - var zoomRatio = map.getZoomScale(map.getZoom(), map.options.zoom); - var zoomPercent = Math.round(zoomRatio * 100); - $('#zoomlevel').html(zoomPercent + '%'); + var zoomPercent = 100; + var zoomSelected = null; + switch (map.getZoom()) { + case 6: zoomPercent = 50; zoomSelected = 'zoom50'; break; + case 7: zoomPercent = 60; zoomSelected = 'zoom60'; break; + case 8: zoomPercent = 70; zoomSelected = 'zoom70'; break; + case 9: zoomPercent = 85; zoomSelected = 'zoom85'; break; + case 10: zoomPercent = 100; zoomSelected = 'zoom100'; break; + case 11: zoomPercent = 120; zoomSelected = 'zoom120'; break; + case 12: zoomPercent = 150; zoomSelected = 'zoom150'; break; + case 13: zoomPercent = 175; zoomSelected = 'zoom175'; break; + case 14: zoomPercent = 200; zoomSelected = 'zoom200'; break; + default: + var zoomRatio = map.getZoomScale(map.getZoom(), map.options.zoom); + zoomPercent = Math.round(zoomRatio * 100) + '%'; + break; + } + w2ui['toolbar-down'].set('zoom', {text: zoomPercent, selected: zoomSelected}); }); map.on('celladdress', function (e) { commit 7aab45892f914b905aef736f9803128d4d4ed8c5 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Tue Jun 11 17:41:20 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Tue Jun 11 17:45:14 2019 +0200 Translate newly introduced string diff --git a/loleaflet/l10n/uno/de.json b/loleaflet/l10n/uno/de.json index 8c1b07296..cb31d44da 100644 --- a/loleaflet/l10n/uno/de.json +++ b/loleaflet/l10n/uno/de.json @@ -14,6 +14,7 @@ "A~rrange":"An~ordnung", "Back One":"Nach ~hinten", "Background Color":"Hintergrundfarbe", +"Highlight Color":"Farbe für Hervorhebungen", "Bold":"~Fett", "Bottom":"~Unten", "Center":"~Mittig", commit 07487f0fff6beed4de408309fd04392b9ea12780 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Tue Jun 11 17:38:56 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Tue Jun 11 17:45:14 2019 +0200 Fix tooltip label for 'Highlight color' Change-Id: Ic057423a68dcc2855d2ee8300a4232b3e6ba2a85 (cherry picked from commit 152511be0f5f296822c850479104eb2d9e69f1b0) diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js index 17f7b49e1..f192e3837 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:{text:{menu:_('Highlight Color'),},}, + BackColor:{global:{menu:_('Highlight Color'),},}, BackgroundColor:{global:{menu:_('Background Color'),},}, Bold:{global:{menu:_('Bold'),},}, BringToFront:{global:{menu:_('~Bring to Front'),},}, commit f68d5f4eb8deb0a8474a5bff26280d4cde57edca Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Wed May 22 16:39:49 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Tue Jun 11 17:45:14 2019 +0200 Disambiguate Highlight color vs background color Highlighting is character level while background color is paragraph/cell level. Use different uno commands/icons/texts for the two. Change-Id: I79264fcdcd968734b68278f69450a377d6607323 Reviewed-on: https://gerrit.libreoffice.org/72786 Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit 6167dc9c44b783cfac0062755a1f1fc73114b538) diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css index 72a4f3022..42564cc17 100644 --- a/loleaflet/css/toolbar.css +++ b/loleaflet/css/toolbar.css @@ -522,6 +522,7 @@ button.leaflet-control-search-next .w2ui-icon.accepttrackedchanges{ background: url('images/lc_accepttrackedchanges.svg') no-repeat center !important; } .w2ui-icon.alignblock{ background: url('images/lc_alignblock.svg') no-repeat center !important; } +.w2ui-icon.backgroundcolor{ background: url('images/lc_backgroundcolor.svg') no-repeat center !important; } .w2ui-icon.alignhorizontal{ background: url('images/lc_alignhorizontalcenter.svg') no-repeat center !important; } .w2ui-icon.alignleft{ background: url('images/lc_alignleft.svg') no-repeat center !important; } .w2ui-icon.alignright{ background: url('images/lc_alignright.svg') no-repeat center !important; } diff --git a/loleaflet/images/lc_backgroundcolor.svg b/loleaflet/images/lc_backgroundcolor.svg new file mode 100644 index 000000000..ebd7aac9d --- /dev/null +++ b/loleaflet/images/lc_backgroundcolor.svg @@ -0,0 +1 @@ +<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m11.307716 20.638247 9.438078-5.638247-5.708126-10.3752563-9.9336041 5.8220523z" fill="#fff" fill-rule="evenodd"/><ellipse cx="12" cy="19.725481" fill="none" rx="10" ry="2.274613"/><path d="m9 8h-5c-1 0-1 .217546-1 2.276478v5.723522c0 1 2 1 2 0v-6z" fill="#4d82b8" fill-rule="evenodd"/><g fill="none" stroke="#808080"><ellipse cx="4.962672" cy="16.187546" rx="1.752345" ry="1.741017" stroke-linecap="round" stroke-width=".95097" transform="matrix(.86821741 -.49618397 .50382625 .86380502 0 0)"/><path d="m12.488244 9.8063594v-5.2263907c0-2.8972803 5.493132-2.8080105 5.493132.1206297v4.9056967" stroke-linecap="round" stroke-width=".909468"/><path d="m5.1040639 10.446796 5.3390121 9.387521c.410089.65506 1.069393.906864 1.704955.572463l7.748423-4.541322c.589382-.407352.86271-1.172428.486324-1.842477l-5.34511-9.3982373z" stroke-width=".896453"/></g></svg> \ No newline at end of file diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js index df886be1e..879da17c6 100644 --- a/loleaflet/js/toolbar.js +++ b/loleaflet/js/toolbar.js @@ -184,6 +184,9 @@ function onClick(e, id, item, subItem) { else if (id === 'backcolor' && typeof e.color !== 'undefined') { onColorPick(id, e.color) } + else if (id === 'backgroundcolor' && typeof e.color !== 'undefined') { + onColorPick(id, e.color) + } else if (id === 'sum') { map.sendUnoCommand('.uno:AutoSum'); } @@ -585,15 +588,24 @@ function onColorPick(id, color) { command[fontcolor].value = color; var uno = '.uno:' + fontcolor; } + // "backcolor" can be used in Writer and Impress and translates to "Highlighting" while + // "backgroundcolor" can be used in Writer and Calc and translates to "Background color". else if (id === 'backcolor') { backcolor = {'text': 'BackColor', - 'spreadsheet': 'BackgroundColor', 'presentation': 'CharBackColor'}[map.getDocType()]; command[backcolor] = {}; command[backcolor].type = 'long'; command[backcolor].value = color; uno = '.uno:' + backcolor; } + else if (id === 'backgroundcolor') { + backcolor = {'text': 'BackgroundColor', + 'spreadsheet': 'BackgroundColor'}[map.getDocType()]; + command[backcolor] = {}; + command[backcolor].type = 'long'; + command[backcolor].value = color; + uno = '.uno:' + backcolor; + } map.sendUnoCommand(uno, command); map.focus(); } @@ -629,7 +641,8 @@ 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', hint: _UNO('.uno:BackgroundColor')}, + {type: 'color', id: 'backcolor', img: 'backcolor', hint: _UNO('.uno:BackColor')}, + {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}, {type: 'button', id: 'centerpara', img: 'alignhorizontal', hint: _UNO('.uno:CenterPara', '', true), uno: 'CenterPara', unosheet: 'AlignHorizontalCenter', disabled: true}, @@ -1395,7 +1408,7 @@ function onDocLayerInit() { switch (docType) { case 'spreadsheet': - toolbarUp.remove('inserttable', 'styles', 'justifypara', 'defaultbullet', 'defaultnumbering', 'break-numbering'); + toolbarUp.remove('inserttable', 'styles', 'justifypara', 'defaultbullet', 'defaultnumbering', 'break-numbering', 'backcolor'); if (!_useSimpleUI()) { statusbar.insert('left', [ {type: 'break', id:'break1'}, @@ -1434,7 +1447,7 @@ function onDocLayerInit() { break; case 'text': - toolbarUp.remove('wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending', 'setborderstyle', 'conditionalformaticonset'); + toolbarUp.remove('wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending', 'setborderstyle', 'conditionalformaticonset', 'backgroundcolor'); if (!_useSimpleUI()) { statusbar.insert('left', [ {type: 'break', id: 'break1'}, @@ -1467,7 +1480,7 @@ function onDocLayerInit() { if (!map['wopi'].HideExportOption) { presentationToolbar.show('presentation', 'presentationbreak'); } - toolbarUp.remove('insertannotation', 'wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending', 'setborderstyle', 'conditionalformaticonset'); + toolbarUp.remove('insertannotation', 'wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending', 'setborderstyle', 'conditionalformaticonset', 'backgroundcolor'); if (!_useSimpleUI()) { statusbar.insert('left', [ {type: 'break', id: 'break1'}, @@ -1489,7 +1502,7 @@ function onDocLayerInit() { break; case 'drawing': - toolbarUp.remove('insertannotation', 'wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending', 'setborderstyle', 'conditionalformaticonset'); + toolbarUp.remove('insertannotation', 'wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending', 'setborderstyle', 'conditionalformaticonset', 'backgroundcolor'); // Remove irrelevant toolbars $('#formulabar').hide(); diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js index f9471a62c..17f7b49e1 100644 --- a/loleaflet/src/unocommands.js +++ b/loleaflet/src/unocommands.js @@ -7,6 +7,7 @@ var unoCommandsArray = { ArrangeFrameMenu:{text:{menu:_('Arrange'),},}, ArrangeMenu:{global:{menu:_('A~rrange'),},presentation:{menu:_('~Arrange'),},}, AutoFormatMenu:{text:{menu:_('AutoCorr~ect'),},}, + BackColor:{text:{menu:_('Highlight Color'),},}, BackgroundColor:{global:{menu:_('Background Color'),},}, Bold:{global:{menu:_('Bold'),},}, BringToFront:{global:{menu:_('~Bring to Front'),},}, commit a881e72b5cddf0652faf1d69b6f3b2b9c22cf74a Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Thu May 23 10:19:25 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Tue Jun 11 17:45:10 2019 +0200 Limit font name box to 150px Otherwise this will get as big as the longest font name. Seems this was intendend to be like this, but was broken at some point. Change-Id: I2db29834f7fd9c53efa5ba9da4e6f7f292a2eb08 Reviewed-on: https://gerrit.libreoffice.org/72816 Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit e3bc157c0df9dc45413c77b54607064fc3b42b00) diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css index d81e042aa..72a4f3022 100644 --- a/loleaflet/css/toolbar.css +++ b/loleaflet/css/toolbar.css @@ -235,8 +235,8 @@ button.leaflet-control-search-next .styles-select { width: 180px; } -.fonts-select { - width: 150px; +#tb_toolbar-up_item_fonts .select2-container{ + width: 150px !important; } .fontsizes-select { width: 55px !important; commit 9e159818ad5b8a11a6ebcb74a4a83a91552fbb93 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Thu May 23 11:28:37 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Tue Jun 11 17:22:48 2019 +0200 1GB should be enough for development Change-Id: I7567f99c4cf54a25084e25b44887b7906bbc7b06 Reviewed-on: https://gerrit.libreoffice.org/72827 Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit 6e87ebc91ec0ef47125ec18b39ebff8d91c0997d) diff --git a/common/FileUtil.cpp b/common/FileUtil.cpp index 0ba6256d0..6a18dcb3b 100644 --- a/common/FileUtil.cpp +++ b/common/FileUtil.cpp @@ -246,8 +246,13 @@ namespace FileUtil return hookResult; #endif - // we should be able to run just OK with 5GB - constexpr int64_t ENOUGH_SPACE = int64_t(5)*1024*1024*1024; + // we should be able to run just OK with 5GB for production or 1GB for development +#if ENABLE_DEBUG + const int64_t gb(1); +#else + const int64_t gb(5); +#endif + constexpr int64_t ENOUGH_SPACE = gb*1024*1024*1024; #ifdef __linux struct statfs sfs; commit 5bfb6be37e09c5d1e9c7c6e67b73a82311033ce6 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Tue Jun 11 17:18:33 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Tue Jun 11 17:18:33 2019 +0200 Remove insert footnote entry in Writer as it is in current master diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css index daef2d11c..d81e042aa 100644 --- a/loleaflet/css/toolbar.css +++ b/loleaflet/css/toolbar.css @@ -556,7 +556,6 @@ button.leaflet-control-search-next .w2ui-icon.saveas{ background: url('images/lc_saveas.svg') no-repeat center !important; } .w2ui-icon.savemodified{ background: url('images/savemodified_large.svg') no-repeat center !important; } .w2ui-icon.strikeout{ background: url('images/lc_strikeout.svg') no-repeat center !important; } -.w2ui-icon.insertfootnote{ background: url('images/lc_insertfootnote.svg') no-repeat center !important; } .w2ui-icon.underline{ background: url('images/lc_underline.svg') no-repeat center !important; } .w2ui-icon.undo{ background: url('images/lc_undo.svg') no-repeat center !important; } .w2ui-icon.zoomin{ background: url('images/plus.svg') no-repeat center !important; } diff --git a/loleaflet/images/lc_insertfootnote.svg b/loleaflet/images/lc_insertfootnote.svg deleted file mode 100644 index fb87e5561..000000000 --- a/loleaflet/images/lc_insertfootnote.svg +++ /dev/null @@ -1 +0,0 @@ -<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m5 3v18h13v-4.892578c-.157532.018023-.317687.020854-.474609-.019531-.01639-.00417-.032669-.008672-.048829-.013672-.266932-.083795-.579671-.239065-.80664-.5625l-.47461-.646485c-.305358-.41509-.245328-.994252.138672-1.33789l1.666016-1.488282v-9.039062z" fill="#fff"/><path d="m5 2c-.554 0-1 .446-1 1v18c0 .554.446 1 1 1h13 .972656v-6.355469l-.066406.064453c-.02003.01975-.04088.038651-.0625.056641-.206896.170095-.516862.304399-.84375.341797v4.892578h-13v-18h13v9.039062l1-.894531v-8.144531c0-.554-.446-1-1-1z" fill="#808080"/><path d="m19.972751 22v-8.720406l-1.763785 1.712613c-.14766.121396-.292243.163885-.433751.127466-.135355-.04249-.230718-.103185-.286092-.182094l-.489123-.664643 3.662167-3.272936h1.337833v11 1h-2.027249z" fill="#4d82b8"/></svg> \ No newline at end of file diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js index c139de869..df886be1e 100644 --- a/loleaflet/js/toolbar.js +++ b/loleaflet/js/toolbar.js @@ -628,8 +628,6 @@ function createToolbar() { {type: 'button', id: 'underline', img: 'underline', hint: _UNO('.uno:Underline'), uno: 'Underline', disabled: true}, {type: 'button', id: 'strikeout', img: 'strikeout', hint: _UNO('.uno:Strikeout'), uno: 'Strikeout', disabled: true}, {type: 'break', id: 'breakformatting'}, - {type: 'button', id: 'insertfootnote', img: 'insertfootnote', hint: _UNO('.uno:InsertFootnote'), uno: 'InsertFootnote', mobile: false}, - {type: 'break' , mobile:false}, {type: 'text-color', id: 'fontcolor', hint: _UNO('.uno:FontColor')}, {type: 'color', id: 'backcolor', hint: _UNO('.uno:BackgroundColor')}, {type: 'break', id: 'breakcolor'}, @@ -1397,7 +1395,7 @@ function onDocLayerInit() { switch (docType) { case 'spreadsheet': - toolbarUp.remove('inserttable', 'styles', 'justifypara', 'defaultbullet', 'defaultnumbering', 'break-numbering', 'insertfootnote'); + toolbarUp.remove('inserttable', 'styles', 'justifypara', 'defaultbullet', 'defaultnumbering', 'break-numbering'); if (!_useSimpleUI()) { statusbar.insert('left', [ {type: 'break', id:'break1'}, @@ -1469,7 +1467,7 @@ function onDocLayerInit() { if (!map['wopi'].HideExportOption) { presentationToolbar.show('presentation', 'presentationbreak'); } - toolbarUp.remove('insertannotation', 'wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending', 'setborderstyle', 'conditionalformaticonset', 'insertfootnote'); + toolbarUp.remove('insertannotation', 'wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending', 'setborderstyle', 'conditionalformaticonset'); if (!_useSimpleUI()) { statusbar.insert('left', [ {type: 'break', id: 'break1'}, @@ -1491,7 +1489,7 @@ function onDocLayerInit() { break; case 'drawing': - toolbarUp.remove('insertannotation', 'wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending', 'setborderstyle', 'conditionalformaticonset', 'insertfootnote'); + toolbarUp.remove('insertannotation', 'wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending', 'setborderstyle', 'conditionalformaticonset'); // Remove irrelevant toolbars $('#formulabar').hide(); commit c461e15cc2b308d0a5e44a0cd54db2440aed352c Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Wed May 22 15:29:33 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Tue Jun 11 17:07:12 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 <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit 62850138fe73e609f73ee5142f8a406b78ea9aa5) diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js index 57dddcf5d..c139de869 100644 --- a/loleaflet/js/toolbar.js +++ b/loleaflet/js/toolbar.js @@ -618,21 +618,21 @@ function createToolbar() { {type: 'button', id: 'undo', img: 'undo', hint: _UNO('.uno:Undo'), uno: 'Undo', disabled: true, mobile: false}, {type: 'button', id: 'redo', img: 'redo', hint: _UNO('.uno:Redo'), uno: 'Redo', disabled: true, mobile: false}, {type: 'button', id: 'repair', img: 'repair', hint: _('Document repair'), disabled: true, mobile: false}, - {type: 'break', mobile: false}, + {type: 'break', id: 'breakundo', mobile: false}, {type: 'html', id: 'styles', html: '<select class="styles-select"></select>', mobile: false}, {type: 'html', id: 'fonts', html: '<select class="fonts-select"></select>', mobile: false}, {type: 'html', id: 'fontsizes', html: '<select class="fontsizes-select"></select>', mobile: false}, - {type: 'break', mobile: false}, + {type: 'break', id: 'breakstyles', mobile: false}, {type: 'button', id: 'bold', img: 'bold', hint: _UNO('.uno:Bold'), uno: 'Bold', disabled: true}, {type: 'button', id: 'italic', img: 'italic', hint: _UNO('.uno:Italic'), uno: 'Italic', disabled: true}, {type: 'button', id: 'underline', img: 'underline', hint: _UNO('.uno:Underline'), uno: 'Underline', disabled: true}, {type: 'button', id: 'strikeout', img: 'strikeout', hint: _UNO('.uno:Strikeout'), uno: 'Strikeout', disabled: true}, - {type: 'break', id: 'formatbreak'}, + {type: 'break', id: 'breakformatting'}, {type: 'button', id: 'insertfootnote', img: 'insertfootnote', hint: _UNO('.uno:InsertFootnote'), uno: 'InsertFootnote', mobile: false}, {type: 'break' , mobile:false}, {type: 'text-color', id: 'fontcolor', hint: _UNO('.uno:FontColor')}, {type: 'color', id: 'backcolor', hint: _UNO('.uno:BackgroundColor')}, - {type: 'break'}, + {type: 'break', id: 'breakcolor'}, {type: 'button', id: 'leftpara', img: 'alignleft', hint: _UNO('.uno:LeftPara', '', true), uno: 'LeftPara', unosheet: 'AlignLeft', disabled: true}, {type: 'button', id: 'centerpara', img: 'alignhorizontal', hint: _UNO('.uno:CenterPara', '', true), uno: 'CenterPara', unosheet: 'AlignHorizontalCenter', disabled: true}, {type: 'button', id: 'rightpara', img: 'alignright', hint: _UNO('.uno:RightPara', '', true), uno: 'RightPara', unosheet: 'AlignRight', disabled: true}, commit 1ba0c6e6f195e22252399a1f49fdd1a280eb7fd9 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Wed May 22 09:29:15 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Tue Jun 11 17:00:45 2019 +0200 Add postmessage method to remove toolbar buttons Change-Id: I6ff2ee3008cf1915c18c2d971ffe1f9de1d926ae Reviewed-on: https://gerrit.libreoffice.org/72727 Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit cc6c3607b54a5dcfe08b9c248ef14ea97893be30) diff --git a/loleaflet/reference.html b/loleaflet/reference.html index 19a030f4d..6381e3391 100644 --- a/loleaflet/reference.html +++ b/loleaflet/reference.html @@ -3104,6 +3104,16 @@ WOPI host to editor </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 0d97ee680..303732a14 100644 --- a/loleaflet/src/map/handler/Map.WOPI.js +++ b/loleaflet/src/map/handler/Map.WOPI.js @@ -188,7 +188,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; @@ -207,8 +207,10 @@ L.Map.WOPI = L.Handler.extend({ } if (msg.MessageId === 'Show_Button') { w2ui['toolbar-up'].show(msg.Values.id); - } else { + } else if (msg.MessageId === 'Hide_Button') { w2ui['toolbar-up'].hide(msg.Values.id); + } else { + w2ui['toolbar-up'].remove(msg.Values.id); } } else if (msg.MessageId === 'Show_Menubar') { commit 77769bcd03b1cec0acaa34c474ccf96cdfa6188f Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Wed May 22 13:12:39 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Tue Jun 11 16:59:27 2019 +0200 Insert_Button: Add parameter to specify a uno command Change-Id: Ibdb1ad1b25df38c12ab71386a5ab8fb92d3076d0 Reviewed-on: https://gerrit.libreoffice.org/72758 Reviewed-by: Jan Holesovsky <[email protected]> Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit 575eb438711fd9527d53d95abb1e4439313df46e) diff --git a/loleaflet/reference.html b/loleaflet/reference.html index e94e7a716..19a030f4d 100644 --- a/loleaflet/reference.html +++ b/loleaflet/reference.html @@ -3051,12 +3051,14 @@ WOPI host to editor <nobr>mobile: <boolean></nobr><br/> <nobr>label: <string></nobr><br/> <nobr>insertBefore: <string></nobr><br/> + <nobr>unoCommand: <string></nobr><br/> </code></td> <td> - Inserts the button to the left of the top toolbar. Only thing - that it does is response to click events based on which hosts - can act accordingly. It responds - with <code>Clicked_Button</code> post message event.<br/> + Inserts a button to the top toolbar. + + It responds with <code>Clicked_Button</code> post message event + on which hosts can react accordingly + (except when the <code>unoCommand</code> property is set).<br/> <code>id</code> parameter is a unique id of the toolbar button. It is recommended to prefix such ids given here with some host namespace so that it doesn't conflict with existing @@ -3076,6 +3078,9 @@ WOPI host to editor <code>insertBefore</code> Specify the position where the button should be inserted. <code>insertBefore</code> is the button ID (see <a href="#toolbar-button-ids">Finding toolbar button IDs</a>). + <code>unoCommand</code> UNO Command to be executed on button click + (<a href="https://wiki.documentfoundation.org/Development/DispatchCommands">Reference</a>). When this property + is set, no 'Clicked_Button' response is sent. The button click will be handled by LibreOffice. </td> </tr> <tr> diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js index 654b2a51c..0d97ee680 100644 --- a/loleaflet/src/map/handler/Map.WOPI.js +++ b/loleaflet/src/map/handler/Map.WOPI.js @@ -163,10 +163,12 @@ L.Map.WOPI = L.Handler.extend({ w2ui['toolbar-up'].insert(insertBefore, [ { type: 'button', + uno: msg.Values.unoCommand, id: msg.Values.id, img: msg.Values.id, hint: _(msg.Values.hint), /* "Try" to localize ! */ - postmessage: true /* Notify the host back when button is clicked */ + /* Notify the host back when button is clicked (only when unoCommand is not set) */ + postmessage: !msg.Values.hasOwnProperty('unoCommand') } ]); if (msg.Values.mobile) commit b47f2a2e707979eaf3e3ca2195607e82bb70eb19 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Fri May 17 09:11:30 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Tue Jun 11 16:59:03 2019 +0200 Improve formatting: Add some linebreaks Change-Id: I1e7fde64d84690cf8cb3e16d4ddd0baba3917151 Reviewed-on: https://gerrit.libreoffice.org/72447 Reviewed-by: Samuel Mehrbrodt <[email protected]> Tested-by: Samuel Mehrbrodt <[email protected]> (cherry picked from commit 433f66ca8be87c18e08d1e5f91193b79c3a62d4b) diff --git a/loleaflet/reference.html b/loleaflet/reference.html index 25c431151..e94e7a716 100644 --- a/loleaflet/reference.html +++ b/loleaflet/reference.html @@ -3046,11 +3046,11 @@ WOPI host to editor <td><code><b>Insert_Button</b></code></td> <td><code> <nobr>id: <string></nobr><br/> - <nobr>imgurl: <string></nobr> - <nobr>hint: <string></nobr> - <nobr>mobile: <boolean></nobr> - <nobr>label: <string></nobr> - <nobr>insertBefore: <string></nobr> + <nobr>imgurl: <string></nobr><br/> + <nobr>hint: <string></nobr><br/> + <nobr>mobile: <boolean></nobr><br/> + <nobr>label: <string></nobr><br/> + <nobr>insertBefore: <string></nobr><br/> </code></td> <td> Inserts the button to the left of the top toolbar. Only thing _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
