[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/tile/CanvasTileLayer.js | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) New commits: commit 058835d0dcd71fc6aca066e7c6e9facedde83f61 Author: Michael Meeks AuthorDate: Wed Sep 16 16:58:57 2020 +0100 Commit: Jan Holesovsky CommitDate: Thu Sep 17 21:35:00 2020 +0200 tilecombine: should pass back oldwid to save bandwidth. Don't re-send un-changed tiles that we can detect easily. Also avoids some PNG compression / CPU overhead server-side. Change-Id: Ieca05680d9194e0bfc177b8db338010e5ffafe75 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102954 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js b/loleaflet/src/layer/tile/CanvasTileLayer.js index 435525793..15d813939 100644 --- a/loleaflet/src/layer/tile/CanvasTileLayer.js +++ b/loleaflet/src/layer/tile/CanvasTileLayer.js @@ -902,6 +902,7 @@ L.CanvasTileLayer = L.TileLayer.extend({ var tilePositionsX = ''; var tilePositionsY = ''; + var tileWids = ''; for (i = 0; i < queue.length; i++) { coords = queue[i]; @@ -946,6 +947,7 @@ L.CanvasTileLayer = L.TileLayer.extend({ } } + // FIXME console.debug('Crass code duplication here in _updateOnChangePart'); if (tilePositionsX !== '' && tilePositionsY !== '') { var message = 'tilecombine ' + 'nviewid=0 ' + @@ -954,8 +956,9 @@ L.CanvasTileLayer = L.TileLayer.extend({ 'height=' + this._tileHeightPx + ' ' + 'tileposx=' + tilePositionsX + ' ' + 'tileposy=' + tilePositionsY + ' ' + + 'wid=' + tileWids + ' ' + 'tilewidth=' + this._tileWidthTwips + ' ' + - 'tileheight=' + this._tileHeightTwips; + 'tileheight=' + this._tileHeightTwips; this._map._socket.sendMessage(message, ''); } @@ -1039,6 +1042,7 @@ L.CanvasTileLayer = L.TileLayer.extend({ // save tile in cache this._tiles[key] = { el: tile, + wid: 0, coords: coords, current: true }; @@ -1130,19 +1134,25 @@ L.CanvasTileLayer = L.TileLayer.extend({ rectQueue = rectangles[r]; var tilePositionsX = ''; var tilePositionsY = ''; + var tileWids = ''; for (i = 0; i < rectQueue.length; i++) { coords = rectQueue[i]; + key = this._tileCoordsToKey(coords); + twips = this._coordsToTwips(coords); - if (tilePositionsX !== '') { + if (tilePositionsX !== '') tilePositionsX += ','; - } tilePositionsX += twips.x; - if (tilePositionsY !== '') { + if (tilePositionsY !== '') tilePositionsY += ','; - } tilePositionsY += twips.y; + + tile = this._tiles[this._tileCoordsToKey(coords)]; + if (tileWids !== '') + tileWids += ','; + tileWids += tile && tile.wireId !== undefined ? tile.wireId : 0; } twips = this._coordsToTwips(coords); @@ -1153,6 +1163,7 @@ L.CanvasTileLayer = L.TileLayer.extend({ 'height=' + this._tileHeightPx + ' ' + 'tileposx=' + tilePositionsX + ' ' + 'tileposy=' + tilePositionsY + ' ' + + 'oldwid=' + tileWids + ' ' + 'tilewidth=' + this._tileWidthTwips + ' ' + 'tileheight=' + this._tileHeightTwips; this._map._socket.sendMessage(msg, ''); @@ -1363,6 +1374,7 @@ L.CanvasTileLayer = L.TileLayer.extend({ this._tiles[key]._invalid
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/tile/CalcTileLayer.js |6 -- loleaflet/src/layer/tile/CanvasTileLayer.js |1 + 2 files changed, 5 insertions(+), 2 deletions(-) New commits: commit a5f44dfad8fb90e90d3c67fac0dec23537c10dc8 Author: Michael Meeks AuthorDate: Tue Sep 15 19:53:16 2020 +0100 Commit: Jan Holesovsky CommitDate: Thu Sep 17 21:34:43 2020 +0200 calc grid: re-render the canvas when we get grid details. Change-Id: I3d1d1485e561d8c807daa0dfe0a9f2cb5651d31b Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102952 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js b/loleaflet/src/layer/tile/CanvasTileLayer.js index 4b0123ba2..b9700987c 100644 --- a/loleaflet/src/layer/tile/CanvasTileLayer.js +++ b/loleaflet/src/layer/tile/CanvasTileLayer.js @@ -375,6 +375,7 @@ L.CanvasTileLayer = L.TileLayer.extend({ } this._map.on('resize zoomend', this._painter.update, this._painter); this._map.on('splitposchanged', this._painter.update, this._painter); + this._map.on('sheetgeometrychanged', this._painter.update, this._painter); this._map.on('move', this._syncTilePanePos, this); this._map.on('viewrowcolumnheaders', this._updateRenderBackground, this); commit b70d9f6c1052ed5a86f309032ed818861027b676 Author: Michael Meeks AuthorDate: Tue Sep 15 11:02:54 2020 +0100 Commit: Jan Holesovsky CommitDate: Thu Sep 17 21:34:35 2020 +0200 calc grid: fix this interleaving. When the span starts in the middle of the view don't render backwards. Change-Id: Icc97fef88a65c0ca83167ddb72c03bece9a8e047 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102951 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index 439f0d8cd..ed7ab0d5d 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -1782,8 +1782,10 @@ L.SheetDimension = L.Class.extend({ (spanData.data.sizecore * (spanData.end - spanData.start + 1)); if (spanFirstCorePx < endPix && spanData.data.poscorepx > startPix) { - var firstCorePx = startPix + spanData.data.sizecore - - ((startPix - spanFirstCorePx) % spanData.data.sizecore); + var firstCorePx = Math.max( + spanFirstCorePx, + startPix + spanData.data.sizecore - + ((startPix - spanFirstCorePx) % spanData.data.sizecore)); var lastCorePx = Math.min(endPix, spanData.data.poscorepx); for (var pos = firstCorePx; pos <= lastCorePx; pos += spanData.data.sizecore) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Scroll.js |4 - loleaflet/src/layer/AnnotationManagerImpress.js | 67 loleaflet/src/layer/marker/Annotation.js|4 + loleaflet/src/layer/tile/CalcTileLayer.js |6 ++ loleaflet/src/layer/tile/ImpressTileLayer.js|8 ++ loleaflet/src/layer/tile/TileLayer.js |8 ++ loleaflet/src/layer/tile/WriterTileLayer.js | 10 +++ loleaflet/src/map/Map.js|4 - 8 files changed, 97 insertions(+), 14 deletions(-) New commits: commit 0e0d3b101246246593e391446ea8584617f822d3 Author: Tomaž Vajngerl AuthorDate: Mon Jul 20 07:59:27 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jul 21 18:34:57 2020 +0200 show connector to annotation when hitting the annotation marker This shows a connector from annotation to the annotation marker in the document, so it is possible to identify which marker is being used for which annotation. Also adds the alternative implementation to show the annotation next to the annotation marker. Change-Id: I8af191fcc8a5e8af827dee0b1ac8ae3d7a50a552 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99021 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl diff --git a/loleaflet/src/layer/AnnotationManagerImpress.js b/loleaflet/src/layer/AnnotationManagerImpress.js index bea853409..473adec06 100644 --- a/loleaflet/src/layer/AnnotationManagerImpress.js +++ b/loleaflet/src/layer/AnnotationManagerImpress.js @@ -10,10 +10,13 @@ L.AnnotationManagerImpress = L.AnnotationManagerBase.extend({ marginX: 40, marginY: 10, offset: 5, - extraSize: L.point(290, 0) + extraSize: L.point(290, 0), + popupOffset: 10, + showInline: false }, _initializeSpecific: function () { this._map.on('zoomend', this._onAnnotationZoom, this); + this._map.on('AnnotationSelect', this._onAnnotationSelect, this); this._map.on('AnnotationCancel', this.onAnnotationCancel, this); this._map.on('AnnotationClick', this.onAnnotationClick, this); this._map.on('AnnotationSave', this.onAnnotationSave, this); @@ -24,6 +27,8 @@ L.AnnotationManagerImpress = L.AnnotationManagerBase.extend({ this._topAnnotation = []; this._topAnnotation[this.getSelectedPart()] = 0; this._selectedAnnotation = undefined; + this._selectedForPopup = null; + this._selectionLine = L.polyline([], {color: 'darkblue', weight: 1.2}); this._draft = null; }, getPartHashes: function() { @@ -86,12 +91,17 @@ L.AnnotationManagerImpress = L.AnnotationManagerBase.extend({ } }, unselectAnnotations: function() { - this._selection = null; + this._selectedForPopup = null; + this._map.removeLayer(this._selectionLine); this.onAnnotationCancel(); }, _onAnnotationZoom: function () { this.onAnnotationCancel(); }, + _onAnnotationSelect: function (event) { + this._selectedForPopup = event.annotation; + this.onAnnotationCancel(); + }, onAnnotationCancel: function () { if (this._draft) { this._map.removeLayer(this._draft); @@ -239,11 +249,11 @@ L.AnnotationManagerImpress = L.AnnotationManagerBase.extend({ layoutAnnotations: function () { var topAnnotation; var annotations = this._annotations[this.getSelectedPartHash()]; - var topRight = this._map.latLngToLayerPoint(this._map.options.docBounds.getNorthEast()) - .add(L.point((this._selectedAnnotation ? 3 : 2) * this.options.marginX, this.options.marginY)); - var bounds, annotation; + var diffPoint = L.point((this._selectedAnnotation ? 3 : 2) * this.options.marginX, this.options.marginY); + var topRight = this._map.latLngToLayerPoint(this._map.options.docBounds.getNorthEast()).add(diffPoint); + var bounds = null; for (var index in annotations) { - annotation = annotations[index]; + var annotation = annotations[index]; if (!this._topAnnotation[this.getSelectedPart()]) { this._topAnnotation[this.getSelectedPart()] = 0; } @@ -262,19 +272,54 @@ L.AnnotationManagerImpress = L.AnnotationManagerBase.extend({ annotation.show(); bounds = annotation.getBounds(); bounds.extend(L.point(bounds.max.x, bounds.max.y + this.options.marginY)); - -
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/map/Clipboard.js | 59 + 1 file changed, 37 insertions(+), 22 deletions(-) New commits: commit 0133a73e0a72795d9d1f7ec906aa9be32195f032 Author: Szymon Kłos AuthorDate: Thu Jul 16 10:47:05 2020 +0200 Commit: Szymon Kłos CommitDate: Fri Jul 17 10:54:07 2020 +0200 clipboard: paste in dialog if open This fixes the issue where 'complex' content was copied and then when dialog was opened and user used Ctrl+V, internal paste into document was performed instead od pasting into dialog. Change-Id: I540a98484610916ff7c246f08a9772fbff40b3ec Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98877 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js index 918729601..53c62364e 100644 --- a/loleaflet/src/map/Clipboard.js +++ b/loleaflet/src/map/Clipboard.js @@ -336,7 +336,7 @@ L.Clipboard = L.Class.extend({ { // Home from home: short-circuit internally. console.log('short-circuit, internal paste'); - this._map._socket.sendMessage('uno .uno:Paste'); + this._doInternalPaste(this._map, usePasteKeyEvent); return; } commit b233aa2ad3f8b1a21c8623b6b62f4ae36004adb9 Author: Szymon Kłos AuthorDate: Thu Jul 16 10:29:39 2020 +0200 Commit: Szymon Kłos CommitDate: Fri Jul 17 10:53:54 2020 +0200 clipboard: when disabled use only internal commands When external copy/paste is disabled: - always use internal copy/paste - don't ask user to use keyboard shortcut (it's possible to paste from menu) - content of a system clipboard is not modified at all Change-Id: I5645ad68bbf9364124ae721ea0e889d877a4ed23 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98876 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js index c596cd95a..918729601 100644 --- a/loleaflet/src/map/Clipboard.js +++ b/loleaflet/src/map/Clipboard.js @@ -139,16 +139,6 @@ L.Clipboard = L.Class.extend({ )); }, - // put in the clipboard if copy is disabled - _getCopyDisabledHtml: function() { - var lang = 'en_US'; // FIXME: l10n - return this._substProductName(this._originWrapBody( - ' \n' + - '\n' + - ' \n', false - )); - }, - _getMetaOrigin: function (html) { var match = 'https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/tile/TileLayer.js | 10 +- loleaflet/src/map/Clipboard.js|2 +- 2 files changed, 6 insertions(+), 6 deletions(-) New commits: commit a7eab309a68944401ab1ad8869cfc3aed5d843f1 Author: Szymon Kłos AuthorDate: Mon Jul 13 10:28:54 2020 +0200 Commit: Szymon Kłos CommitDate: Mon Jul 13 11:22:40 2020 +0200 Don't show cell selection resize handles for desktop Change-Id: I6ac7518bd46308fffd692be576d368b5e5067fd6 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98619 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 3cd53c3cf..198b511f1 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -3079,11 +3079,11 @@ L.TileLayer = L.GridLayer.extend({ }, _onUpdateCellResizeMarkers: function () { - var singleCellOnDesktop = window.mode.isDesktop() - && !this._cellSelectionArea - && (this._cellCursor && !this._isEmptyRectangle(this._cellCursor)); + var selectionOnDesktop = window.mode.isDesktop() + && (this._cellSelectionArea + || (this._cellCursor && !this._isEmptyRectangle(this._cellCursor))); - if (!singleCellOnDesktop && + if (!selectionOnDesktop && (this._selections.getLayers().length !== 0 || (this._cellCursor && !this._isEmptyRectangle(this._cellCursor { if (this._isEmptyRectangle(this._cellSelectionArea) && this._isEmptyRectangle(this._cellCursor)) { return; @@ -3119,7 +3119,7 @@ L.TileLayer = L.GridLayer.extend({ } } } - else if (singleCellOnDesktop) { + else if (selectionOnDesktop) { cellRectangle = this._cellSelectionArea ? this._cellSelectionArea : this._cellCursor; if (this._cellAutoFillArea) { commit 073efadc16d1f27809b119c9b261fabce85d1cac Author: Szymon Kłos AuthorDate: Mon Jul 13 10:39:54 2020 +0200 Commit: Szymon Kłos CommitDate: Mon Jul 13 11:22:31 2020 +0200 When copy disabled use empty content in clipboard Don't use 'Stub HTML Message' title... Change-Id: I24953f1513fb5432e614958787b9d127ffa531a7 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98620 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js index 694019246..c596cd95a 100644 --- a/loleaflet/src/map/Clipboard.js +++ b/loleaflet/src/map/Clipboard.js @@ -145,7 +145,7 @@ L.Clipboard = L.Class.extend({ return this._substProductName(this._originWrapBody( ' \n' + '\n' + - ' \n', true + ' \n', false )); }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.ColumnHeader.js |4 ++-- loleaflet/src/control/Control.ContextMenu.js|2 +- loleaflet/src/control/Control.Header.js |2 +- loleaflet/src/control/Control.LokDialog.js |2 +- loleaflet/src/control/Control.Menubar.js| 16 loleaflet/src/control/Control.MobileTopBar.js |2 +- loleaflet/src/control/Control.MobileWizard.js |2 +- loleaflet/src/control/Control.NotebookbarBuilder.js |2 +- loleaflet/src/control/Control.PartsPreview.js |2 +- loleaflet/src/control/Control.PresentationBar.js|2 +- loleaflet/src/control/Control.RowHeader.js |4 ++-- loleaflet/src/control/Control.SearchBar.js |4 ++-- loleaflet/src/control/Control.Tabs.js |2 +- loleaflet/src/control/Control.Toolbar.js| 12 ++-- loleaflet/src/control/Parts.js |2 +- loleaflet/src/control/Permission.js | 19 +++ loleaflet/src/control/Ruler.js |4 ++-- loleaflet/src/control/Toolbar.js| 12 ++-- loleaflet/src/layer/marker/Annotation.js|4 ++-- loleaflet/src/layer/marker/TextInput.js |2 +- loleaflet/src/layer/tile/CanvasTileLayer.js |2 +- loleaflet/src/layer/tile/GridLayer.js |2 +- loleaflet/src/layer/tile/TileLayer.TableOverlay.js |2 +- loleaflet/src/layer/tile/TileLayer.js | 18 +- loleaflet/src/map/Map.js|4 ++-- loleaflet/src/map/handler/Map.Keyboard.js |4 ++-- loleaflet/src/map/handler/Map.Mouse.js |2 +- loleaflet/src/map/handler/Map.TouchGesture.js |4 ++-- loleaflet/src/map/handler/Map.WOPI.js |4 ++-- 29 files changed, 77 insertions(+), 66 deletions(-) New commits: commit 859c808029ab3152f8a9618ab459dfbc0f9b9ab3 Author: Tomaž Vajngerl AuthorDate: Sun Jul 12 12:44:09 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Sun Jul 12 19:14:27 2020 +0200 Add functions for getting edit or readonly permission, refactor Instead of always checking the map._permission value, use the isPermissionReadOnly and isPermissionEdit functions. Refactor the code to use those. Change-Id: I77ccd278b98a9318344c9b80c17be7cda09f00f8 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98592 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js index ea806593c..0bafd515a 100644 --- a/loleaflet/src/control/Control.ColumnHeader.js +++ b/loleaflet/src/control/Control.ColumnHeader.js @@ -102,7 +102,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({ var menuData = L.Control.JSDialogBuilder.getMenuStructureForMobileWizard(this._menuItem, true, ''); (new Hammer(this._canvas, {recognizers: [[Hammer.Press]]})) .on('press', L.bind(function () { - if (this._map._permission === 'edit') { + if (this._map.isPermissionEdit()) { window.contextMenuWizard = true; this._map.fire('mobilewizard', menuData); } @@ -449,7 +449,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({ this.mouseInit(canvas); if ($('.spreadsheet-header-columns').length > 0) { - $('.spreadsheet-header-columns').contextMenu(this._map._permission === 'edit'); + $('.spreadsheet-header-columns').contextMenu(this._map.isPermissionEdit()); } }, diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index 82bd501c5..c4449340e 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -113,7 +113,7 @@ L.Control.ContextMenu = L.Control.extend({ _onContextMenu: function(obj) { var map = this._map; - if (map._permission !== 'edit') { + if (!map.isPermissionEdit()) { return; } diff --git a/loleaflet/src/control/Control.Header.js b/loleaflet/src/control/Control.Header.js index 8dff63acc..bb0d4433f 100644 --- a/loleaflet/src/control/Control.Header.js +++ b/loleaflet/src/control/Control.Header.js @@ -269,7 +269,7 @@ L.Control.Header = L.Control.extend({ }, _onPan: function (event) { - if (event.pointerType !== 'touch' || this._map._permission !== 'edit') + if (event.pointerType !== 'touch' || !this._map.isPermissionEdit()) retur
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Menubar.js |3 --- 1 file changed, 3 deletions(-) New commits: commit ddbab299ab70a82eaffdca93fe8dfa99889abf8d Author: Tamás Zolnai AuthorDate: Fri Jul 3 14:55:01 2020 +0200 Commit: Tamás Zolnai CommitDate: Fri Jul 3 16:43:03 2020 +0200 mobile: remove Autofilter menu item. We can enable / disable autofiltering, but the autofilter buttons are non functional on mobile. Change-Id: I738a4565a8de1ec3c1f5ffe8b67c2edcacf7b324 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97866 Tested-by: Jenkins CollaboraOffice Tested-by: Jenkins Reviewed-by: Tamás Zolnai diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 7d143e627..960629f5d 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -624,8 +624,6 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:SortAscending'}, {uno: '.uno:SortDescending'}, {type: 'separator'}, - {uno: '.uno:DataFilterAutoFilter'}, - {type: 'separator'}, {name: _UNO('.uno:GroupOutlineMenu', 'spreadsheet'), id: 'groupoutlinemenu', type: 'menu', menu: [ {uno: '.uno:Group'}, {uno: '.uno:Ungroup'}, commit a3f341c8d0163fa4a06112a4248a59bd1521064e Author: Tamás Zolnai AuthorDate: Fri Jul 3 14:48:24 2020 +0200 Commit: Tamás Zolnai CommitDate: Fri Jul 3 16:42:55 2020 +0200 mobile: remove Sorting menu item. It would open a tunneled dialog which is not supported on mobile. Change-Id: I377adf5e5fbc2d52af52b373f9552c74cd9bd07a Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97865 Tested-by: Jenkins CollaboraOffice Tested-by: Jenkins Reviewed-by: Tamás Zolnai diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index be46644b9..7d143e627 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -621,7 +621,6 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:DeleteColumnbreak'}]} ]}, {name: _UNO('.uno:DataMenu', 'spreadsheet'), id: 'datamenu', type: 'menu', menu: [ - {uno: '.uno:DataSort'}, {uno: '.uno:SortAscending'}, {uno: '.uno:SortDescending'}, {type: 'separator'}, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/marker/Annotation.js | 45 +-- 1 file changed, 37 insertions(+), 8 deletions(-) New commits: commit 9db14f70a25b565ea1482ac5509e5842c2cbab91 Author: Tomaž Vajngerl AuthorDate: Mon Jun 29 14:38:16 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Jun 29 20:34:46 2020 +0200 Prevent crash when the annotation doesn't have the rectangle data Change-Id: I04bc18f976bd7b2541418dda38b4c7809754dd4f Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97411 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js index 8d80aec57..35d7565bc 100644 --- a/loleaflet/src/layer/marker/Annotation.js +++ b/loleaflet/src/layer/marker/Annotation.js @@ -465,15 +465,17 @@ L.Annotation = L.Layer.extend({ }); this._map.addLayer(this._annotationMarker); } - var stringTwips = this._data.rectangle.match(/\d+/g); - var topLeftTwips = new L.Point(parseInt(stringTwips[0]), parseInt(stringTwips[1])); - var offset = new L.Point(parseInt(stringTwips[2]), parseInt(stringTwips[3])); - var bottomRightTwips = topLeftTwips.add(offset); - var bounds = new L.LatLngBounds( - this._map._docLayer._twipsToLatLng(topLeftTwips, this._map.getZoom()), - this._map._docLayer._twipsToLatLng(bottomRightTwips, this._map.getZoom())); - this._annotationMarker.setLatLng(bounds.getSouthWest()); - this._annotationMarker.on('dragstart drag dragend', this._onMarkerDrag, this); + if (this._data.rectangle != null) { + var stringTwips = this._data.rectangle.match(/\d+/g); + var topLeftTwips = new L.Point(parseInt(stringTwips[0]), parseInt(stringTwips[1])); + var offset = new L.Point(parseInt(stringTwips[2]), parseInt(stringTwips[3])); + var bottomRightTwips = topLeftTwips.add(offset); + var bounds = new L.LatLngBounds( + this._map._docLayer._twipsToLatLng(topLeftTwips, this._map.getZoom()), + this._map._docLayer._twipsToLatLng(bottomRightTwips, this._map.getZoom())); + this._annotationMarker.setLatLng(bounds.getSouthWest()); + this._annotationMarker.on('dragstart drag dragend', this._onMarkerDrag, this); + } }, _onMarkerDrag: function(event) { if (this._annotationMarker == null) commit 8b133a76d3e6dd1cdd577328bdf3f377c9ed08ee Author: Tomaž Vajngerl AuthorDate: Mon Jun 29 14:30:32 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Jun 29 20:34:36 2020 +0200 Send the new position of the annotation when the marker is moved Change-Id: I5a81feb8308808e9221ed7f7f29ea7758d91c309 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97410 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js index 730396ab9..8d80aec57 100644 --- a/loleaflet/src/layer/marker/Annotation.js +++ b/loleaflet/src/layer/marker/Annotation.js @@ -473,6 +473,33 @@ L.Annotation = L.Layer.extend({ this._map._docLayer._twipsToLatLng(topLeftTwips, this._map.getZoom()), this._map._docLayer._twipsToLatLng(bottomRightTwips, this._map.getZoom())); this._annotationMarker.setLatLng(bounds.getSouthWest()); + this._annotationMarker.on('dragstart drag dragend', this._onMarkerDrag, this); + }, + _onMarkerDrag: function(event) { + if (this._annotationMarker == null) + return; + if (event.type === 'dragend') { + var rect = this._annotationMarker._icon.getBoundingClientRect(); + var pointTwip = this._map._docLayer._pixelsToTwips({x: rect.left, y: rect.top}); + this._sendAnnotationPositionChange(pointTwip); + } + }, + _sendAnnotationPositionChange: function(newPosition) { + var comment = { + Id: { + type: 'string', + value: this._data.id + }, + PositionX: { + type: 'int32', + value: newPosition.x + }, + PositionY: { + type: 'int32', + value: newPosition.y + } + }; + this._map.sendUnoCommand('.uno:EditAnnotation', comme
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/marker/Annotation.js |2 loleaflet/src/layer/tile/ImpressTileLayer.js | 86 ++- 2 files changed, 48 insertions(+), 40 deletions(-) New commits: commit 02e4f26bbb24c9891e01b55e0196b996e4de5a91 Author: Tomaž Vajngerl AuthorDate: Wed Jun 24 21:31:28 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Sun Jun 28 00:38:16 2020 +0200 move handling of comments/annotations into own functions This isn't a functional change, only making code more readable and easiert to search. Change-Id: I56c4b699782cfc997ae89b80add67c365e5b9009 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97334 Tested-by: Jenkins CollaboraOffice Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js index cc02e444d..b24ee5ccf 100644 --- a/loleaflet/src/layer/tile/ImpressTileLayer.js +++ b/loleaflet/src/layer/tile/ImpressTileLayer.js @@ -405,57 +405,65 @@ L.ImpressTileLayer = L.TileLayer.extend({ } if (values.comments) { - this.clearAnnotations(); - for (var index in values.comments) { - var comment = values.comments[index]; - if (!this._annotations[comment.parthash]) { - this._annotations[comment.parthash] = []; - } - this._annotations[comment.parthash].push(L.annotation(this._map.options.maxBounds.getSouthEast(), comment).addTo(this._map)); - } - if (!this._topAnnotation) { - this._topAnnotation = []; - } - this._topAnnotation[this._selectedPart] = 0; - if (this.hasAnnotations(this._selectedPart)) { - this._map._docLayer._updateMaxBounds(true); - } - this.layoutAnnotations(); + this._addCommentsFromCommandValues(values.comments); } else { L.TileLayer.prototype._onCommandValuesMsg.call(this, textMsg); } }, + _addCommentsFromCommandValues: function (comments) { + this.clearAnnotations(); + for (var index in comments) { + var comment = comments[index]; + if (!this._annotations[comment.parthash]) { + this._annotations[comment.parthash] = []; + } + this._annotations[comment.parthash].push(L.annotation(this._map.options.maxBounds.getSouthEast(), comment).addTo(this._map)); + } + if (!this._topAnnotation) { + this._topAnnotation = []; + } + this._topAnnotation[this._selectedPart] = 0; + if (this.hasAnnotations(this._selectedPart)) { + this._map._docLayer._updateMaxBounds(true); + } + this.layoutAnnotations(); + }, + _onMessage: function (textMsg, img) { if (textMsg.startsWith('comment:')) { - var obj = JSON.parse(textMsg.substring('comment:'.length + 1)); - if (obj.comment.action === 'Add') { - if (!this._annotations[obj.comment.parthash]) { - this._annotations[obj.comment.parthash] = []; - } - this._annotations[obj.comment.parthash].push(L.annotation(this._map.options.maxBounds.getSouthEast(), obj.comment).addTo(this._map)); - this._topAnnotation[this._selectedPart] = Math.min(this._topAnnotation[this._selectedPart], this._annotations[this._partHashes[this._selectedPart]].length - 1); - this.updateDocBounds(1, this.extraSize); - this.layoutAnnotations(); - } else if (obj.comment.action === 'Remove') { - this.removeAnnotation(obj.comment.id); - this._topAnnotation[this._selectedPart] = Math.min(this._topAnnotation[this._selectedPart], this._annotations[this._partHashes[this._selectedPart]].length - 1); - this.updateDocBounds(0); - this.layoutAnnotations(); - } else if (obj.comment.action === 'Modify') { - var modified = this.getAnnotation(obj.comment.id); - if (modified) { - modified._data = obj.comment; - modified.update(); -
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js|9 - loleaflet/src/control/Control.NotebookbarBuilder.js |4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) New commits: commit 668c25bff0c01bc7916cf9fe08ceb6945b13ff02 Author: Szymon Kłos AuthorDate: Fri Jun 19 12:50:24 2020 +0200 Commit: Szymon Kłos CommitDate: Fri Jun 19 14:48:06 2020 +0200 notebookbar: fix font size combobox Change-Id: I0542e6a6bb21e1ae3bf164ef774da2cef2bb5706 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96715 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js index 861b61ca5..be08a9948 100644 --- a/loleaflet/src/control/Control.NotebookbarBuilder.js +++ b/loleaflet/src/control/Control.NotebookbarBuilder.js @@ -138,7 +138,7 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ if (commandName === '.uno:CharFontName') { $('#fontnamecombobox').val(state).trigger('change'); } else if (commandName === '.uno:FontHeight') { - $('#fontsizecombobox').val(state).trigger('change'); + $('#fontsize').val(state).trigger('change'); } else if (commandName === '.uno:StyleApply') { $('#applystyle').val(state).trigger('change'); } @@ -157,7 +157,7 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ var state = items.getItemValue('.uno:CharFontName'); $(combobox).val(state).trigger('change'); } - else if (id === 'fontsizecombobox') { + else if (id === 'fontsize') { $(combobox).on('select2:select', function (e) { builder.map.applyFontSize(e.target.value); builder.map.focus(); commit 708c988aa760004c4e083b08df1f85cbd41bc9fd Author: Szymon Kłos AuthorDate: Fri Jun 19 14:12:14 2020 +0200 Commit: Szymon Kłos CommitDate: Fri Jun 19 14:47:54 2020 +0200 jsdialog: fix tabs switching Change-Id: I9303daadcfc0888386f72e74ff35a26ab8233949 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96731 Tested-by: Jenkins CollaboraOffice Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 09cb585d8..c18986d67 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -648,13 +648,12 @@ L.Control.JSDialogBuilder = L.Control.extend({ _createTabClick: function(builder, t, tabs, contentDivs, tabIds) { return function() { + $(tabs[t]).addClass('selected'); for (var i = 0; i < tabs.length; i++) { - if (tabs[i].number != t) + if (i !== t) { $(tabs[i]).removeClass('selected'); $(contentDivs[i]).hide(); - } else { - $(tabs[i]).addClass('selected'); } } $(contentDivs[t]).show(); @@ -702,10 +701,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ var fn = function(id) { return function() { builder._createTabClick(builder, id, tabs, contentDivs, tabIds)(); - builder.callback('tabcontrol', 'selecttab', tabsContainer, id, builder); + builder.callback('tabcontrol', 'selecttab', tabsContainer, data.tabs[id].id - 1, builder); }; }; - $(tabs[t]).click(fn(data.tabs[t].id - 1)); + $(tabs[t]).click(fn(t)); } } else { console.debug('Builder used outside of mobile wizard: please implement the click handler'); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Notebookbar.js | 20 ++-- loleaflet/src/control/Ruler.js |3 +++ 2 files changed, 21 insertions(+), 2 deletions(-) New commits: commit 91d2e967461f5bb4552c8332faa393ba97e59f11 Author: Szymon Kłos AuthorDate: Thu Jun 18 14:27:27 2020 +0200 Commit: Szymon Kłos CommitDate: Fri Jun 19 11:17:14 2020 +0200 Avoid usage of undefined when no margin set Change-Id: Ie922448e37e4414f054fa0404ea5787212c446dd Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96679 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js index 011b16488..e717d84e3 100644 --- a/loleaflet/src/control/Ruler.js +++ b/loleaflet/src/control/Ruler.js @@ -211,6 +211,9 @@ L.Control.Ruler = L.Control.extend({ var items = this._map['stateChangeHandler']; var state = items.getItemValue('.uno:LeftRightParaMargin'); + if (!state) + return; + this.options.firstLineIndent = parseFloat(state.firstline.replace(',', '.')); this.options.leftParagraphIndent = parseFloat(state.left.replace(',', '.')); this.options.rightParagraphIndent = parseFloat(state.right.replace(',', '.')); commit c24b034f33a4dd5aeaf5e91e1f5968b2d9cf13e5 Author: Szymon Kłos AuthorDate: Wed Jun 17 11:08:19 2020 +0200 Commit: Szymon Kłos CommitDate: Fri Jun 19 11:17:02 2020 +0200 notebookbar: scroll to last position on refresh Change-Id: Iec0d6938f43231c6808dc14ca69c98be6f44012c Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96680 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.Notebookbar.js b/loleaflet/src/control/Control.Notebookbar.js index 7b62e1123..b18dcf611 100644 --- a/loleaflet/src/control/Control.Notebookbar.js +++ b/loleaflet/src/control/Control.Notebookbar.js @@ -6,8 +6,11 @@ /* global $ */ L.Control.Notebookbar = L.Control.extend({ + _currentScrollPosition: 0, + onAdd: function (map) { this.map = map; + this._currentScrollPosition = 0; this.loadTab(this.getHomeTab()); @@ -31,6 +34,8 @@ L.Control.Notebookbar = L.Control.extend({ var container = L.DomUtil.create('div', 'notebookbar-scroll-wrapper', parent); builder.build(container, [tabJSON]); + + this.scrollToLastPositionIfNeeded(); }, setTabs: function(tabs) { @@ -81,8 +86,19 @@ L.Control.Notebookbar = L.Control.extend({ builder.build(shortcutsBar, this.getShortcutsBarData()); }, - // required, called by builder, not needed in this container - setCurrentScrollPosition: function() {}, + setCurrentScrollPosition: function() { + this._currentScrollPosition = $('.notebookbar-scroll-wrapper').scrollLeft(); + }, + + scrollToLastPositionIfNeeded: function() { + var rootContainer = $('.notebookbar-scroll-wrapper table').get(0); + + if (this._currentScrollPosition && $(rootContainer).outerWidth() > $(window).width()) { + $('.notebookbar-scroll-wrapper').animate({ scrollLeft: this._currentScrollPosition }, 0); + } else { + $(window).resize(); + } + }, createScrollButtons: function() { var parent = $('#toolbar-up').get(0); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 25 --- 1 file changed, 22 insertions(+), 3 deletions(-) New commits: commit 681321133afc7df9a58574f6823059e22a05db7b Author: Pranam Lashkari AuthorDate: Wed May 20 01:31:27 2020 +0530 Commit: Andras Timar CommitDate: Wed Jun 10 12:36:05 2020 +0200 leaflet: update values in spinners Spinners value will be updated when field value is updated via other controlls Change-Id: I4b561eff72f63aa235d32f25732084f69f81a59a Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94549 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 7045a77d3..101e3d3bb 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -120,8 +120,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ builder.map.on('commandstatechanged', function(e) { var value = e.state[builder._getFieldFromId(data.id)]; if (value) { - value = parseFloat(value.replace(',', '.')); - $(controls.spinfield).attr('value', value); + if (customCallback) + customCallback(); + else + builder.callback('spinfield', 'value', controls.container, this.value, builder); } }, this); commit 8db0ab5abf06487c8038678cc71860b941f79708 Author: Pranam Lashkari AuthorDate: Mon May 18 20:44:49 2020 +0530 Commit: Andras Timar CommitDate: Wed Jun 10 12:35:55 2020 +0200 leaflet: Strange behavior of Paragraph Spacing controls Change Paragraph Spacing/indent on the mobile wizard with uno buttons, paragraph Spacing spinners aren't updated Change-Id: I0a692790e406a078c5540fe538c15d18cae20af0 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94433 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 8c8426c9e..7045a77d3 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -118,9 +118,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ // It listens server state changes using GetControlState // to avoid unit conversion builder.map.on('commandstatechanged', function(e) { - var value = e.state[data.id]; + var value = e.state[builder._getFieldFromId(data.id)]; if (value) { - value = parseFloat(value); + value = parseFloat(value.replace(',', '.')); $(controls.spinfield).attr('value', value); } }, this); @@ -1164,6 +1164,23 @@ L.Control.JSDialogBuilder = L.Control.extend({ return null; }, + _getFieldFromId: function(id) { + switch (id) { + case 'aboveparaspacing': + return 'upper'; + case 'belowparaspacing': + return 'lower'; + case 'beforetextindent': + return 'left'; + case 'aftertextindent': + return 'right'; + case 'firstlineindent': + return 'firstline'; + default: + return id; + } + }, + _getTitleForControlWithId: function(id) { switch (id) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.FormulaBar.js |2 +- loleaflet/src/control/Control.StatusBar.js | 10 +- 2 files changed, 10 insertions(+), 2 deletions(-) New commits: commit 9f55b8f46eba1410f0be0f93f01278d0d345fc60 Author: Szymon Kłos AuthorDate: Mon May 11 12:31:48 2020 +0200 Commit: Szymon Kłos CommitDate: Mon May 11 13:15:26 2020 +0200 Fix language menu in statusbar Sub items from the language submenu are executed by uno calls - added handler. Change-Id: Ia83cd9331de6468c7d5a7b6f5cdbe45e68595a8b Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93956 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.StatusBar.js b/loleaflet/src/control/Control.StatusBar.js index 9bd0c8d53..59f567ad7 100644 --- a/loleaflet/src/control/Control.StatusBar.js +++ b/loleaflet/src/control/Control.StatusBar.js @@ -109,7 +109,15 @@ L.Control.StatusBar = L.Control.extend({ var docLayer = this.map._docLayer; - if (id === 'zoomin' && this.map.getZoom() < this.map.getMaxZoom()) { + if (item.uno) { + if (item.unosheet && this.map.getDocType() === 'spreadsheet') { + this.map.toggleCommandState(item.unosheet); + } + else { + this.map.toggleCommandState(window.getUNOCommand(item.uno)); + } + } + else if (id === 'zoomin' && this.map.getZoom() < this.map.getMaxZoom()) { this.map.zoomIn(1); } else if (id === 'zoomout' && this.map.getZoom() > this.map.getMinZoom()) { commit cdf964ba861a03634fd05587bb6ee5cd9588fd94 Author: Szymon Kłos AuthorDate: Mon May 11 12:39:34 2020 +0200 Commit: Szymon Kłos CommitDate: Mon May 11 13:15:20 2020 +0200 Fix cell address input handler Change-Id: Ie0a7630597f442d7f7117870cd4a52ff5b476252 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93957 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.FormulaBar.js b/loleaflet/src/control/Control.FormulaBar.js index e62bd2c86..60fd848d9 100644 --- a/loleaflet/src/control/Control.FormulaBar.js +++ b/loleaflet/src/control/Control.FormulaBar.js @@ -40,7 +40,7 @@ L.Control.FormulaBar = L.Control.extend({ window.hideTooltip(this, e.target); }, onRefresh: function() { - $('#addressInput').off('keyup', this.onAddressInput, this).on('keyup', this.onAddressInput, this); + $('#addressInput').off('keyup', that.onAddressInput.bind(that)).on('keyup', that.onAddressInput.bind(that)); } }); toolbar.bind('touchstart', function(e) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.NotebookbarBuilder.js | 30 ++-- loleaflet/src/control/Control.Toolbar.js| 13 loleaflet/src/control/Control.TopToolbar.js | 11 --- 3 files changed, 41 insertions(+), 13 deletions(-) New commits: commit fab6cb792cd1a16735fed6439e1e1628feacbd68 Author: Szymon Kłos AuthorDate: Mon May 4 10:47:18 2020 +0200 Commit: Szymon Kłos CommitDate: Wed May 6 17:03:25 2020 +0200 notebookbar: hide not useful comboboxes in calc Change-Id: Iff24a24c3264dbcc122d9c09aaa27805ae1a1aad Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93571 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js index 3ca4f3632..a07d5b3a1 100644 --- a/loleaflet/src/control/Control.NotebookbarBuilder.js +++ b/loleaflet/src/control/Control.NotebookbarBuilder.js @@ -13,8 +13,8 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ }, _overrideHandlers: function() { - this._controlHandlers['combobox'] = this._comboboxControl; - this._controlHandlers['listbox'] = this._comboboxControl; + this._controlHandlers['combobox'] = this._comboboxControlHandler; + this._controlHandlers['listbox'] = this._comboboxControlHandler; this._controlHandlers['tabcontrol'] = this._overridenTabsControlHandler; this._controlHandlers['pushbutton'] = function() { return false; }; @@ -159,13 +159,21 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ return false; }, + _comboboxControlHandler: function(parentContainer, data, builder) { + if ((data.command === '.uno:StyleApply' && builder.map.getDocType() === 'spreadsheet') || + (data.id === '')) + return false; + + return builder._comboboxControl(parentContainer, data, builder); + }, + _overridenTabsControlHandler: function(parentContainer, data, builder) { data.tabs = builder.wizard.getTabs(); return builder._tabsControlHandler(parentContainer, data, builder); }, _colorControl: function(parentContainer, data, builder) { - var commandOverride = data.command === '.uno:Color'; + var commandOverride = data.command === '.uno:Color' && builder.map.getDocType() === 'text'; if (commandOverride) data.command = '.uno:FontColor'; commit bfe0cafeef22f6ce2c9ec72b341b8b96f44f77f5 Author: Szymon Kłos AuthorDate: Mon May 4 11:05:48 2020 +0200 Commit: Szymon Kłos CommitDate: Wed May 6 17:03:15 2020 +0200 notebookbar: conditional format popup Change-Id: Id4a693cfb472af48a9f82ee798dc0c8f4e55cbf7 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93573 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js index 011cc61bb..3ca4f3632 100644 --- a/loleaflet/src/control/Control.NotebookbarBuilder.js +++ b/loleaflet/src/control/Control.NotebookbarBuilder.js @@ -38,6 +38,7 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ this._toolitemHandlers['.uno:Copy'] = this._clipboardButtonControl; this._toolitemHandlers['.uno:Paste'] = this._clipboardButtonControl; this._toolitemHandlers['.uno:BasicShapes'] = this._shapesControl; + this._toolitemHandlers['.uno:ConditionalFormatMenu'] = this._conditionalFormatControl; this._toolitemHandlers['.uno:SelectWidth'] = function() {}; this._toolitemHandlers['.uno:SetOutline'] = function() {}; @@ -260,6 +261,21 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ }); }, + _conditionalFormatControl: function(parentContainer, data, builder) { + var control = builder._unoToolButton(parentContainer, data, builder); + + $(control.container).unbind('click'); + $(control.container).click(function () { + if (!$('#conditionalformatmenu-grid').length) { + $(control.container).w2overlay(window.getConditionalFormatMenuHtml()); + + $('#conditionalformatmenu-grid tr td').click(function () { + $(control.container).w2overlay(); + }); + } + }); + }, + _insertGraphicControl: function(parentContainer, data, builder) { var control = builder._unoToolButton(parentContainer, data, builder); diff --git a/loleaflet/src/con
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.NotebookbarBuilder.js | 27 loleaflet/src/control/Control.Toolbar.js|9 ++ loleaflet/src/control/Control.TopToolbar.js |3 -- 3 files changed, 37 insertions(+), 2 deletions(-) New commits: commit bd9637ae1211423090ec1f10eadabb9e68582d53 Author: Szymon Kłos AuthorDate: Thu Apr 30 11:09:24 2020 +0200 Commit: Szymon Kłos CommitDate: Fri May 1 21:39:12 2020 +0200 notebookbar: insert shapes popup Change-Id: Icb75574372f48bf101ce14fc22bdf373e5e2026a Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93298 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js index d94e795fa..4614f27b9 100644 --- a/loleaflet/src/control/Control.NotebookbarBuilder.js +++ b/loleaflet/src/control/Control.NotebookbarBuilder.js @@ -36,6 +36,7 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ this._toolitemHandlers['.uno:Cut'] = this._clipboardButtonControl; this._toolitemHandlers['.uno:Copy'] = this._clipboardButtonControl; this._toolitemHandlers['.uno:Paste'] = this._clipboardButtonControl; + this._toolitemHandlers['.uno:BasicShapes'] = this._shapesControl; this._toolitemHandlers['.uno:SelectWidth'] = function() {}; @@ -202,6 +203,22 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ }); }, + _shapesControl: function(parentContainer, data, builder) { + var control = builder._unoToolButton(parentContainer, data, builder); + + $(control.container).unbind('click'); + $(control.container).click(function () { + if (!$('.insertshape-grid').length) { + $(control.container).w2overlay(window.getShapesPopupHtml()); + window.insertShapes(); + + $('.insertshape-grid .row .col').click(function () { + $(control.container).w2overlay(); + }); + } + }); + }, + _insertGraphicControl: function(parentContainer, data, builder) { var control = builder._unoToolButton(parentContainer, data, builder); diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 7a2290667..26777205c 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -502,6 +502,14 @@ function insertShapes(mobile) { }); } +function getShapesPopupHtml() { + return '\ + \ + \ + \ + '; +} + function getColorPickerData(type) { var uno; if (type === 'Font Color') { @@ -1063,6 +1071,7 @@ global.onClick = onClick; global.hideTooltip = hideTooltip; global.insertTable = insertTable; global.getInsertTablePopupHtml = getInsertTablePopupHtml; +global.getShapesPopupHtml = getShapesPopupHtml; global.insertShapes = insertShapes; global.createShapesPanel = createShapesPanel; global.onUpdatePermission = onUpdatePermission; diff --git a/loleaflet/src/control/Control.TopToolbar.js b/loleaflet/src/control/Control.TopToolbar.js index 0e5f9f51d..7fda20d6d 100644 --- a/loleaflet/src/control/Control.TopToolbar.js +++ b/loleaflet/src/control/Control.TopToolbar.js @@ -223,8 +223,7 @@ L.Control.TopToolbar = L.Control.extend({ {id: 'remotegraphic', text: _UNO('.uno:InsertGraphic', '', true)}, ]}, {type: 'button', id: 'insertobjectchart', img: 'insertobjectchart', hint: _UNO('.uno:InsertObjectChart', '', true), uno: 'InsertObjectChart'}, - {type: 'drop', id: 'insertshapes', img: 'basicshapes_ellipse', hint: _('Insert shapes'), overlay: {onShow: window.insertShapes}, - html: ''}, + {type: 'drop', id: 'insertshapes', img: 'basicshapes_ellipse', hint: _('Insert shapes'), overlay: {onShow: window.insertShapes}, html: window.getShapesPopupHtml()}, {type: 'button', id: 'link', img: 'link', hint: _UNO('.uno:HyperlinkDialog', '', true), disabled: true}, {type: 'button', id: 'insertsymbol', img: 'insertsymbol', hint: _UNO('.uno:InsertSymbol', '', true), uno: 'InsertSymbol'}, {type: 'spacer'}, commit 8970ab16df4e8a0fc39f01fb6a26480b3a3bc01c Author: Szymon Kłos AuthorDate: Wed Apr 29 13:17:47 2020 +0200 Commit: Szymon Kłos CommitDate: Fri May 1 21:38:56 2020 +0200 notebookbar: insert symbol control Change-Id:
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.NotebookbarBuilder.js | 36 1 file changed, 36 insertions(+) New commits: commit a2f6921fec76990d064c55c1af803905c4320a84 Author: Szymon Kłos AuthorDate: Wed Apr 29 11:59:05 2020 +0200 Commit: Szymon Kłos CommitDate: Fri May 1 21:38:48 2020 +0200 notebookbar: linespacing control Change-Id: Idb481aec70fe43d143a16d978492372f650320df Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93293 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js index 4f0b067df..b0eb08e03 100644 --- a/loleaflet/src/control/Control.NotebookbarBuilder.js +++ b/loleaflet/src/control/Control.NotebookbarBuilder.js @@ -31,6 +31,7 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ this._toolitemHandlers['.uno:InsertTable'] = this._insertTableControl; this._toolitemHandlers['.uno:InsertGraphic'] = this._insertGraphicControl; this._toolitemHandlers['.uno:InsertAnnotation'] = this._insertAnnotationControl; + this._toolitemHandlers['.uno:LineSpacing'] = this._lineSpacingControl; this._toolitemHandlers['.uno:Cut'] = this._clipboardButtonControl; this._toolitemHandlers['.uno:Copy'] = this._clipboardButtonControl; this._toolitemHandlers['.uno:Paste'] = this._clipboardButtonControl; @@ -243,6 +244,27 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ } }, + _lineSpacingControl: function(parentContainer, data, builder) { + var control = builder._unoToolButton(parentContainer, data, builder); + + $(control.container).unbind('click'); + $(control.container).click(function () { + $(control.container).w2menu({ + items: [ + {id: 'spacepara1', text: _UNO('.uno:SpacePara1'), uno: 'SpacePara1'}, + {id: 'spacepara15', text: _UNO('.uno:SpacePara15'), uno: 'SpacePara15'}, + {id: 'spacepara2', text: _UNO('.uno:SpacePara2'), uno: 'SpacePara2'}, + {type: 'break'}, + {id: 'paraspaceincrease', text: _UNO('.uno:ParaspaceIncrease'), uno: 'ParaspaceIncrease'}, + {id: 'paraspacedecrease', text: _UNO('.uno:ParaspaceDecrease'), uno: 'ParaspaceDecrease'} + ], + onSelect: function (event) { + builder.map.sendUnoCommand('.uno:' + event.item.uno); + } + }); + }); + }, + build: function(parent, data, hasVerticalParent, parentHasManyChildren) { this._amendJSDialogData(data); commit 2f98cbbf91bcd2f0b9ce113482acb0d5bc92b8c6 Author: Szymon Kłos AuthorDate: Wed Apr 29 09:26:33 2020 +0200 Commit: Szymon Kłos CommitDate: Fri May 1 21:38:37 2020 +0200 notebookbar: override copy, cut & paste actions Change-Id: I5338d844fd279f33d3832fdb2e05d83ee0a79a3f Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93292 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js index e2fb923d5..4f0b067df 100644 --- a/loleaflet/src/control/Control.NotebookbarBuilder.js +++ b/loleaflet/src/control/Control.NotebookbarBuilder.js @@ -31,6 +31,9 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ this._toolitemHandlers['.uno:InsertTable'] = this._insertTableControl; this._toolitemHandlers['.uno:InsertGraphic'] = this._insertGraphicControl; this._toolitemHandlers['.uno:InsertAnnotation'] = this._insertAnnotationControl; + this._toolitemHandlers['.uno:Cut'] = this._clipboardButtonControl; + this._toolitemHandlers['.uno:Copy'] = this._clipboardButtonControl; + this._toolitemHandlers['.uno:Paste'] = this._clipboardButtonControl; this._toolitemHandlers['.uno:SelectWidth'] = function() {}; @@ -229,6 +232,17 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ $(control.container).click(function () {builder.map.insertComment();}); }, + _clipboardButtonControl: function(parentContainer, data, builder) { + var control = builder._unoToolButton(parentContainer, data, builder); + + if (builder.map._clip) { + $(control.container).unbind('click'); + $(control.container).click(func
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js| 10 ++ loleaflet/src/control/Control.NotebookbarBuilder.js | 29 ++-- loleaflet/src/control/Control.Toolbar.js| 10 ++ loleaflet/src/control/Control.TopToolbar.js |3 -- 4 files changed, 47 insertions(+), 5 deletions(-) New commits: commit e976ab4889397cca4e2bf938867cf9b7e25c615b Author: Szymon Kłos AuthorDate: Mon Apr 27 12:11:23 2020 +0200 Commit: Szymon Kłos CommitDate: Fri May 1 18:28:51 2020 +0200 notebookbar: generate identifiers for containers Change-Id: Ib76d9bc78bdfede4774d1b01a38f635b456fb3cd Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93281 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js index eb9557c6b..a09435469 100644 --- a/loleaflet/src/control/Control.NotebookbarBuilder.js +++ b/loleaflet/src/control/Control.NotebookbarBuilder.js @@ -204,7 +204,8 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ var hasManyChildren = childData.children && childData.children.length > 1; if (hasManyChildren) { - var table = L.DomUtil.create('table', '', td); + var table = L.DomUtil.createWithId('table', 'table-' + childData.id, td); + $(table).addClass(this.options.cssClass); var childObject = L.DomUtil.create('tr', '', table); } else { childObject = td; commit 29293cbcde18d7d142e5d883fcf581b98201c627 Author: Szymon Kłos AuthorDate: Mon Apr 27 10:36:25 2020 +0200 Commit: Szymon Kłos CommitDate: Fri May 1 18:28:41 2020 +0200 notebookbar: uno:Color -> uno:FontColor Change-Id: Id5c542ee2495cce454a8fcde9e845399950d59ef Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93280 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index b6c3591bd..2c1536b09 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1515,7 +1515,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ _unoToolButton: function(parentContainer, data, builder) { var button = null; + var controls = {}; + var div = this._createIdentifiable('div', 'unotoolbutton ' + builder.options.cssClass + ' ui-content unospan', parentContainer, data); + controls['container'] = div; if (data.command) { var id = data.command.substr('.uno:'.length); @@ -1528,10 +1531,14 @@ L.Control.JSDialogBuilder = L.Control.extend({ button.src = icon; button.id = buttonId; + controls['button'] = button; + if (builder.options.noLabelsForUnoButtons !== true) { var label = L.DomUtil.create('span', 'ui-content unolabel', div); label.for = buttonId; label.innerHTML = data.text; + + controls['label'] = label; } else { div.title = data.text; $(div).tooltip(); @@ -1557,6 +1564,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ } else { button = L.DomUtil.create('label', 'ui-content unolabel', div); button.innerHTML = builder._cleanText(data.text); + controls['label'] = button; } $(div).click(function () { @@ -1567,7 +1575,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ if (data.enabled == 'false') $(button).attr('disabled', 'disabled'); - return false; + return controls; }, _divContainerHandler: function (parentContainer, data, builder) { diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js index ed3a86417..eb9557c6b 100644 --- a/loleaflet/src/control/Control.NotebookbarBuilder.js +++ b/loleaflet/src/control/Control.NotebookbarBuilder.js @@ -18,7 +18,6 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ this._controlHandlers['spinfield'] = function() { return false; }; this._toolitemHandlers['.uno:XLineColor'] = this._colorControl; - this._toolitemHandlers['.uno:SelectWidth'] = function() {}; this._toolitemHandlers['.uno:FontColor'] = this._colorControl;
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.NotebookbarBuilder.js | 38 +++- 1 file changed, 37 insertions(+), 1 deletion(-) New commits: commit 89ca66f84636abd3cba5d3eb00d748f98c079c07 Author: Szymon Kłos AuthorDate: Tue Apr 28 08:29:16 2020 +0200 Commit: Szymon Kłos CommitDate: Fri May 1 18:27:32 2020 +0200 notebookbar: hide shortcuts toolbox from tab content Change-Id: I74c1c5825a05c7c1a16275a72da764bc68e0febb Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93283 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js index 0dfed2a51..ed3a86417 100644 --- a/loleaflet/src/control/Control.NotebookbarBuilder.js +++ b/loleaflet/src/control/Control.NotebookbarBuilder.js @@ -153,6 +153,10 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ if (!childData) continue; + var childType = childData.type; + if (childType === 'toolbox' && !childData.id) + continue; + if (parentHasManyChildren) { if (!hasVerticalParent) var td = L.DomUtil.create('td', '', containerToInsert); @@ -167,7 +171,6 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ var isVertical = childData.vertical === 'true' ? true : false; this._parentize(childData); - var childType = childData.type; var processChildren = true; if ((childData.id === undefined || childData.id === '' || childData.id === null) commit 82f5268ee14e2d15e93fe757726063141b65a2f8 Author: Szymon Kłos AuthorDate: Tue Apr 28 13:07:52 2020 +0200 Commit: Szymon Kłos CommitDate: Fri May 1 18:27:24 2020 +0200 notebookbar: handle selection in comboboxes Change-Id: Idf3f7cdbe7a437f8996669eee8cc6474408c3c4a Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93285 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js index 981ed1af2..0dfed2a51 100644 --- a/loleaflet/src/control/Control.NotebookbarBuilder.js +++ b/loleaflet/src/control/Control.NotebookbarBuilder.js @@ -29,6 +29,37 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ this._toolitemHandlers['vnd.sun.star.findbar:FocusToFindbar'] = function() {}; }, + _setupComboboxSelectionHandler: function(combobox, id, builder) { + if (id === 'fontnamecombobox') { + $(combobox).on('select2:select', function (e) { + var font = e.target.value; + builder.map.applyFont(font); + builder.map.focus(); + }); + } else if (id === 'fontsizecombobox') { + $(combobox).on('select2:select', function (e) { + builder.map.applyFontSize(e.target.value); + builder.map.focus(); + }); + } else if (id === 'applystyle') { + $(combobox).on('select2:select', function (e) { + var style = e.target.value; + var docType = builder.map.getDocType(); + + if (style.startsWith('.uno:')) + builder.map.sendUnoCommand(style); + else if (docType === 'text') + builder.map.applyStyle(style, 'ParagraphStyles'); + else if (docType === 'spreadsheet') + builder.map.applyStyle(style, 'CellStyles'); + else if (docType === 'presentation' || docType === 'drawing') + builder.map.applyLayout(style); + + builder.map.focus(); + }); + } + }, + _comboboxControl: function(parentContainer, data, builder) { if (!data.entries || data.entries.length === 0) return false; @@ -41,6 +72,8 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({ placeholder: _(builder._cleanText(data.text)) }); + builder._setupComboboxSelectionHandler(select, data.id, builder); + return false; }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.or
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js| 58 ++-- loleaflet/src/control/Control.MobileWizard.js |3 - loleaflet/src/control/Control.NotebookbarBuilder.js | 10 ++- 3 files changed, 40 insertions(+), 31 deletions(-) New commits: commit dc2e4952df64b88100dff714f0475c8bb840e3d9 Author: Szymon Kłos AuthorDate: Wed Apr 22 13:00:30 2020 +0200 Commit: Szymon Kłos CommitDate: Fri May 1 12:55:45 2020 +0200 jsdialog: add css style parameter to builder Change-Id: Iddd8f36133a49d73b89ebb7997c4bbd32c35eea6 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93253 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 7aa3f67d5..60cfd41de 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -8,6 +8,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ + options: { + cssClass: 'mobile-wizard' + }, + /* Handler is a function which takes three parameters: * parentContainer - place where insert the content * data - data of a control under process @@ -350,7 +354,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ }, _explorableEntry: function(parentContainer, data, content, builder, valueNode, iconPath, updateCallback) { - var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' mobile-wizard ui-widget', parentContainer); + var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' ' + builder.options.cssClass + ' ui-widget', parentContainer); $(sectionTitle).css('justify-content', 'space-between'); if (data && data.id) sectionTitle.id = data.id; @@ -415,7 +419,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ }, this); - var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' mobile-wizard', parentContainer); + var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' ' + builder.options.cssClass, parentContainer); contentDiv.title = data.text; var contentData = content.length ? content : [content]; @@ -443,7 +447,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ }, _calcFunctionEntry: function(parentContainer, data, contentNode, builder) { - var sectionTitle = L.DomUtil.create('div', 'func-entry ui-header level-' + builder._currentDepth + ' mobile-wizard ui-widget', parentContainer); + var sectionTitle = L.DomUtil.create('div', 'func-entry ui-header level-' + builder._currentDepth + ' ' + builder.options.cssClass + ' ui-widget', parentContainer); $(sectionTitle).css('justify-content', 'space-between'); if (data && data.id) sectionTitle.id = data.id; @@ -457,7 +461,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ var arrowSpan = L.DomUtil.create('div', 'func-info-icon', rightDiv); arrowSpan.innerHTML = ''; - var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' mobile-wizard', parentContainer); + var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' ' + builder.options.cssClass, parentContainer); contentDiv.title = data.text; builder._currentDepth++; @@ -510,7 +514,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ _explorableMenu: function(parentContainer, title, children, builder, customContent, dataid) { dataid = dataid || 0; var icon = null; - var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' mobile-wizard ui-widget', parentContainer); + var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' ' + builder.options.cssClass + ' ui-widget', parentContainer); $(sectionTitle).css('justify-content', 'space-between'); var commandName = dataid; @@ -535,7 +539,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ var arrowSpan = L.DomUtil.create('span', 'sub-menu-arrow', sectionTitle); arrowSpan.innerHTML = '>'; - var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' mobile-wizard', parentContainer); + var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' ' + builder.options.cssClass, parentContainer); contentDiv.title = title; if (customContent) { @@ -611,9 +615,9 @@ L.
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Ruler.js | 78 - 1 file changed, 61 insertions(+), 17 deletions(-) New commits: commit 02505f1e8f4b40063bad66bbefdb892c3152d4e2 Author: Tomaž Vajngerl AuthorDate: Mon Apr 20 09:53:42 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Apr 20 12:45:07 2020 +0200 ruler: show context menu on longpress in touch environment Change-Id: I627977b7fc04df93e129bc2967bf966f6534a204 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92549 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js index ea1bd1a01..e4251fd4d 100644 --- a/loleaflet/src/control/Ruler.js +++ b/loleaflet/src/control/Ruler.js @@ -81,6 +81,9 @@ L.Control.Ruler = L.Control.extend({ if (L.Browser.touch) { this._hammer = new Hammer(this._rTSContainer); this._hammer.add(new Hammer.Pan({ threshold: 0, pointers: 0 })); + this._hammer.get('press').set({ + time: 500 + }); this._hammer.on('panstart', function (event) { self._initiateTabstopDrag(event); }); @@ -90,6 +93,9 @@ L.Control.Ruler = L.Control.extend({ this._hammer.on('panend', function (event) { self._endTabstopDrag(event); }); + this._hammer.on('press', function (event) { + self._onTabstopContainerLongPress(event); + }); } return this._rWrapper; }, @@ -512,6 +518,22 @@ L.Control.Ruler = L.Control.extend({ L.DomEvent.off(this._rTSContainer, 'mouseout', this._endTabstopDrag, this); }, + _onTabstopContainerLongPress: function(event) { + var pointX = event.center.x - event.target.getBoundingClientRect().left; + this.currentPositionInTwips = this._map._docLayer._pixelsToTwips({x: pointX, y:0}).x; + + $.contextMenu({ + selector: '.loleaflet-ruler-tabstopcontainer', + className: 'loleaflet-font', + items: { + inserttabstop: { + name: _('Insert tabstop'), + callback: (this._insertTabstop).bind(this) + } + } + }); + }, + _insertTabstop: function() { if (this.currentPositionInTwips != null) { var params = { commit e11202ea49ca479630751c123083502db839451b Author: Tomaž Vajngerl AuthorDate: Mon Apr 20 09:28:25 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Apr 20 12:45:01 2020 +0200 ruler: insert tabstop from a context menu (right click) Change-Id: I0699b53a6972b304f358948d49619a5004329eff Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92548 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js index 3b9e52fb2..ea1bd1a01 100644 --- a/loleaflet/src/control/Ruler.js +++ b/loleaflet/src/control/Ruler.js @@ -388,11 +388,7 @@ L.Control.Ruler = L.Control.extend({ _initiateTabstopDrag: function(event) { // console.log('===> _initiateTabstopDrag ' + event.type); - if (event.button !== 0) { - event.stopPropagation(); // prevent handling of the mother event elsewhere - return; - } - + var tabstopContainer = null; var pointX = null; @@ -405,6 +401,28 @@ L.Control.Ruler = L.Control.extend({ pointX = event.layerX; } + if (event.button === 2) { + this.currentPositionInTwips = this._map._docLayer._pixelsToTwips({x: pointX, y:0}).x; + + $.contextMenu({ + selector: '.loleaflet-ruler-tabstopcontainer', + className: 'loleaflet-font', + items: { + inserttabstop: { + name: _('Insert tabstop'), + callback: (this._insertTabstop).bind(this) + } + } + }); + + event.stopPropagation(); + return; + } + else if (event.button !== 0) { + event.stopPropagation(); // prevent handling of the mother event else
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Ruler.js | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) New commits: commit 54461e0e1ada9d2d26a952836b96eb92e336c036 Author: Tomaž Vajngerl AuthorDate: Mon Apr 20 07:31:55 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Apr 20 12:44:51 2020 +0200 ruler: only handle left mouse event in the tab-stop area Change-Id: Ifd3fe9f1b532a4dfec250482044bf860caefbd2b Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92547 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js index 1d8450a54..3b9e52fb2 100644 --- a/loleaflet/src/control/Ruler.js +++ b/loleaflet/src/control/Ruler.js @@ -388,7 +388,11 @@ L.Control.Ruler = L.Control.extend({ _initiateTabstopDrag: function(event) { // console.log('===> _initiateTabstopDrag ' + event.type); - + if (event.button !== 0) { + event.stopPropagation(); // prevent handling of the mother event elsewhere + return; + } + var tabstopContainer = null; var pointX = null; commit 2e6c2bff23922ef4db771b8c8f4faef045b88b63 Author: Tomaž Vajngerl AuthorDate: Sun Apr 19 20:14:27 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Apr 20 12:44:42 2020 +0200 limit tabstop container between left and right ruler margin Otherwise right we can't change right ruler margin as no mouse event goes through. Change-Id: Id2f536ab6cb82908e17e4c293762160e8dd2fb8c Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92546 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js index 73dbcb8ac..1d8450a54 100644 --- a/loleaflet/src/control/Ruler.js +++ b/loleaflet/src/control/Ruler.js @@ -255,8 +255,8 @@ L.Control.Ruler = L.Control.extend({ this._rMarginDrag.style.width = (this.options.DraggableConvertRatio*rMargin) + 'px'; // Put the _rTSContainer in the right place - this._rTSContainer.style.marginLeft = (this.options.DraggableConvertRatio * lMargin) + 'px'; - this._rTSContainer.style.width = 'calc(' + this._rFace.style.width + ' - ' + this._rMarginMarker.style.width + ')'; + this._rTSContainer.style.left = (this.options.DraggableConvertRatio * lMargin) + 'px'; + this._rTSContainer.style.right = (this.options.DraggableConvertRatio * rMargin) + 'px'; if (this.options.interactive) { this._changeInteractions({perm:'edit'}); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Toolbar.js |3 --- loleaflet/src/layer/tile/CalcTileLayer.js|4 loleaflet/src/layer/tile/ImpressTileLayer.js |6 ++ 3 files changed, 10 insertions(+), 3 deletions(-) New commits: commit 1d1651795c73a7f2b73bdb17b7e2926047ffcbee Author: Szymon Kłos AuthorDate: Thu Apr 16 10:42:42 2020 +0200 Commit: Szymon Kłos CommitDate: Thu Apr 16 11:11:34 2020 +0200 Initialize sheets and formula bars only in Calc Change-Id: I4b27f21404e75ae22faa2bcf8a9dc27564f2dd56 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92337 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 5812d6a0b..529e0fa71 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -852,9 +852,7 @@ function createSigningBar() { function initNormalToolbar() { createMainToolbar(); - map.addControl(L.control.formulaBar({showfunctionwizard: true})); createSigningBar(); - map.addControl(L.control.sheetsBar({shownavigation: true})); } function setupSearchInput() { diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index bc4a30f3d..658b6362d 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -50,9 +50,13 @@ L.CalcTileLayer = L.TileLayer.extend({ map.on('AnnotationCancel', this._onAnnotationCancel, this); map.on('AnnotationReply', this._onAnnotationReply, this); map.on('AnnotationSave', this._onAnnotationSave, this); + if (window.mode.isMobile() || window.mode.isTablet()) { this.onMobileInit(map); } + + map.addControl(L.control.sheetsBar({shownavigation: true})); + map.addControl(L.control.formulaBar({showfunctionwizard: true})); }, clearAnnotations: function () { commit 6b0fbeda6b61421aaa179e018a1651d326f85736 Author: Szymon Kłos AuthorDate: Thu Apr 16 10:42:03 2020 +0200 Commit: Szymon Kłos CommitDate: Thu Apr 16 11:11:22 2020 +0200 Initialize presentation bar only in Impress Change-Id: I50db46b0117b34cbbb0a95c59e8707be958c62a4 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92336 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 428b4c74b..5812d6a0b 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -855,7 +855,6 @@ function initNormalToolbar() { map.addControl(L.control.formulaBar({showfunctionwizard: true})); createSigningBar(); map.addControl(L.control.sheetsBar({shownavigation: true})); - map.addControl(L.control.presentationBar()); } function setupSearchInput() { diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js index 886509798..933a89c77 100644 --- a/loleaflet/src/layer/tile/ImpressTileLayer.js +++ b/loleaflet/src/layer/tile/ImpressTileLayer.js @@ -60,6 +60,8 @@ L.ImpressTileLayer = L.TileLayer.extend({ L.DomUtil.toBack(container); map.addControl(L.control.partsPreview(container, preview, {fetchThumbnail: false})); L.DomUtil.addClass(mobileWizardContent, 'with-slide-sorter-above'); + } else { + this.onDesktopAndTabletInit(map); } }, @@ -113,6 +115,10 @@ L.ImpressTileLayer = L.TileLayer.extend({ } }, + onDesktopAndTabletInit: function(map) { + map.addControl(L.control.presentationBar()); + }, + onMobileInit: function (map) { map.addControl(L.control.mobileTopBar('presentation')); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.MobileWizard.js | 29 +--- loleaflet/src/control/Control.Toolbar.js | 46 ++ loleaflet/src/core/LOUtil.js | 24 + 3 files changed, 53 insertions(+), 46 deletions(-) New commits: commit 5766ed7706a30c75fd9876f1d90d50854f407a9f Author: Michael Meeks AuthorDate: Thu Mar 26 12:58:48 2020 + Commit: Michael Meeks CommitDate: Thu Mar 26 19:35:37 2020 +0100 Re-factor JSON node searching into LOUtil. Change-Id: Ib6e42371441b15999cad35262c07aa1e9b38c429 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91099 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 2df267c54..ca8486600 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -362,13 +362,12 @@ L.Control.MobileWizard = L.Control.extend({ }, _modifySidebarLayout: function (data) { - var deck = this._findItemByTypeRecursive(data, 'deck'); + var deck = L.LOUtil.findItemWithAttributeRecursive(data, 'type', 'deck'); if (deck) { // merge styles into text-panel for elegance - var stylesIdx = this._findIdxInParentById(deck, 'StylesPropertyPanel'); - var textName = 'TextPropertyPanel'; - var textIdx = this._findIdxInParentById(deck, textName); + var stylesIdx = L.LOUtil.findIndexInParentByAttribute(deck, 'id', 'StylesPropertyPanel'); + var textIdx = L.LOUtil.findIndexInParentByAttribute(deck, 'id', 'TextPropertyPanel'); if (stylesIdx >= 0 && this.map.getDocType() === 'spreadsheet') { // remove rather useless calc styles panel @@ -392,28 +391,6 @@ L.Control.MobileWizard = L.Control.extend({ } }, - _findItemByTypeRecursive: function(data, t) { - var found = null; - if (data.type === t) - return data; - if (data.children) - { - for (var i = 0; !found && i < data.children.length; i++) - found = this._findItemByTypeRecursive(data.children[i], t); - } - return found; - }, - - _findIdxInParentById: function(data, id) { - if (data.children) - { - for (var i = 0; i < data.children.length; i++) - if (data.children[i].id === id) - return i; - } - return -1; - }, - _removeItems: function (data, items) { if (data.children) { for (var i = 0; i < data.children.length;) { diff --git a/loleaflet/src/core/LOUtil.js b/loleaflet/src/core/LOUtil.js index d9cf252c9..d66090d71 100644 --- a/loleaflet/src/core/LOUtil.js +++ b/loleaflet/src/core/LOUtil.js @@ -103,6 +103,30 @@ L.LOUtil = { if (commandName.indexOf('?')!== -1) return false; return res; + }, + + /// Searching in JSON trees for data with a given field + findItemWithAttributeRecursive: function(node, idName, idValue) { + var found = null; + if (node[idName] === idValue) + return node; + if (node.children) + { + for (var i = 0; !found && i < node.children.length; i++) + found = L.LOUtil.findItemWithAttributeRecursive(node.children[i], idName, idValue); + } + return found; + }, + + /// Searching in JSON trees for an identifier and return the index in parent + findIndexInParentByAttribute: function(node, idName, idValue) { + if (node.children) + { + for (var i = 0; i < node.children.length; i++) + if (node.children[i][idName] === idValue) + return i; + } + return -1; } }; commit 877e4fd5873f5344f6367fbbbfbc60c3f9dde465 Author: Michael Meeks AuthorDate: Thu Mar 26 12:45:11 2020 + Commit: Michael Meeks CommitDate: Thu Mar 26 19:35:24 2020 +0100 Allow optional color to be passed into setBorders. Change-Id: I8a5cc57bda07d1c0671262c22b93d012f2018eb0 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91098 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 4a115f5e2..6ac3cbd26 100644 -
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.LokDialog.js |3 +-- loleaflet/src/map/Map.js |9 + 2 files changed, 6 insertions(+), 6 deletions(-) New commits: commit 41cd5a562470c47564e1f6b0a7fc43458bdbae1c Author: Ashod Nakashian AuthorDate: Tue Mar 24 16:44:11 2020 -0400 Commit: Andras Timar CommitDate: Wed Mar 25 12:29:05 2020 +0100 leaflet: reuse member functions Change-Id: I8c0c58d2ab175b271df200de2b100e61c655db5f Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91018 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index f8522d1b8..024192295 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -874,7 +874,8 @@ L.Map = L.Evented.extend({ return this._winId; }, - // Returns true iff the document has input focus. + // Returns true iff the document has input focus, + // as opposed to a dialog, sidebar, formula bar, etc. editorHasFocus: function () { return this.getWinId() === 0; }, @@ -1403,7 +1404,7 @@ L.Map = L.Evented.extend({ _changeFocusWidget: function (dialog, winId, acceptInput) { if (!this._loaded) { return; } - this._winId = winId; + this.setWinId(winId); this._activeDialog = dialog; this._isSearching = false; @@ -1431,11 +1432,11 @@ L.Map = L.Evented.extend({ // Our browser tab got focus. _onGotFocus: function () { - if (this._winId === 0) { + if (this.editorHasFocus()) { this.fire('editorgotfocus'); } else if (this._activeDialog) { - this._activeDialog.focus(this._winId); + this._activeDialog.focus(this.getWinId()); } this._activate(); commit 9ccea6c8b869c427ea393e4057fd530758c17b31 Author: Ashod Nakashian AuthorDate: Tue Mar 24 17:14:31 2020 -0400 Commit: Andras Timar CommitDate: Wed Mar 25 12:28:46 2020 +0100 leaflet: give editor focus when closing sidebar And remove ineffective focus on closing sidebar. Change-Id: Iac6d46c91ca70949c73cd8cdb29416ecb80be409 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91017 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index a58766c21..67387016a 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -1162,7 +1162,7 @@ L.Control.LokDialog = L.Control.extend({ } $('#sidebar-dock-wrapper').css({display: ''}); - if (this._map.editorHasFocus()) { + if (!this._map.editorHasFocus()) { this._map.fire('editorgotfocus'); this._map.focus(); } @@ -1218,7 +1218,6 @@ L.Control.LokDialog = L.Control.extend({ this._onSidebarClose(dialogId); } } - $('#sidebar-dock-wrapper').css({display: ''}); }, _onEditorGotFocus: function() { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Toolbar.js | 40 +++--- loleaflet/src/layer/tile/CalcTileLayer.js |2 - 2 files changed, 21 insertions(+), 21 deletions(-) New commits: commit 1cf5bde981941f2ac2920819e93fb55a7ca3bac1 Author: Michael Meeks AuthorDate: Mon Jan 13 17:57:22 2020 + Commit: Michael Meeks CommitDate: Mon Jan 13 20:01:37 2020 +0100 Toolbar color buttons should track transparent state as well as colors. Change-Id: I727ff4f942b7059da4f17216fe523dd1bbb04cd2 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86710 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 0d1daef7b..0074e9585 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -1818,13 +1818,13 @@ function onCommandStateChanged(e) { color = 'transparent'; } else { - color = color.toString(16); color = '#' + Array(7 - color.length).join('0') + color; - $('#tb_editbar_item_fontcolor .w2ui-tb-image').css('box-shadow', 'inset 0 -2px #ff, inset 0px -6px ' + color); - $('#tb_editbar_item_fontcolor .w2ui-tb-down').css('display', 'none'); - $('#tb_editbar_item_fontcolor .w2ui-tb-caption').css('display', 'none'); } + $('#tb_editbar_item_fontcolor .w2ui-tb-image').css('box-shadow', 'inset 0 -2px #ff, inset 0px -6px ' + color); + $('#tb_editbar_item_fontcolor .w2ui-tb-down').css('display', 'none'); + $('#tb_editbar_item_fontcolor .w2ui-tb-caption').css('display', 'none'); + div = L.DomUtil.get('fontcolorindicator'); if (div) { L.DomUtil.setStyle(div, 'background', color); @@ -1839,15 +1839,16 @@ function onCommandStateChanged(e) { else { color = color.toString(16); color = '#' + Array(7 - color.length).join('0') + color; - //writer - $('#tb_editbar_item_backcolor .w2ui-tb-image').css('box-shadow', 'inset 0 -2px #ff, inset 0px -6px ' + color); - $('#tb_editbar_item_backcolor .w2ui-tb-down').css('display', 'none'); - $('#tb_editbar_item_backcolor .w2ui-tb-caption').css('display', 'none'); - //calc? - $('#tb_editbar_item_backgroundcolor .w2ui-tb-image').css('box-shadow', 'inset 0 -2px #ff, inset 0px -6px ' + color); - $('#tb_editbar_item_backgroundcolor .w2ui-tb-down').css('display', 'none'); - $('#tb_editbar_item_backgroundcolor .w2ui-tb-caption').css('display', 'none'); } + //writer + $('#tb_editbar_item_backcolor .w2ui-tb-image').css('box-shadow', 'inset 0 -2px #ff, inset 0px -6px ' + color); + $('#tb_editbar_item_backcolor .w2ui-tb-down').css('display', 'none'); + $('#tb_editbar_item_backcolor .w2ui-tb-caption').css('display', 'none'); + //calc? + $('#tb_editbar_item_backgroundcolor .w2ui-tb-image').css('box-shadow', 'inset 0 -2px #ff, inset 0px -6px ' + color); + $('#tb_editbar_item_backgroundcolor .w2ui-tb-down').css('display', 'none'); + $('#tb_editbar_item_backgroundcolor .w2ui-tb-caption').css('display', 'none'); + div = L.DomUtil.get('backcolorindicator'); if (div) { L.DomUtil.setStyle(div, 'background', color); commit f5d159b80bcda4493cd1086b879df83851e5f751 Author: Michael Meeks AuthorDate: Mon Jan 13 17:56:48 2020 + Commit: Michael Meeks CommitDate: Mon Jan 13 20:01:28 2020 +0100 mobile: restore calc background quick-toolbar button & fix typo. Change-Id: Ieae15188113cd646bb3fe9be7747308a95857569 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86709 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 11614f543..0d1daef7b 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -720,15 +720,14 @@ function insertShapes(mobile) { function getColorPickerData(type) { var uno; if (type === 'Font Color') { - if (map.getDocType() === 'spreadsheet') - uno = '.uno:Color'; - else if (map.getDocType() === 'presentation') + if (map.getDocType() === 'spreadsheet' || + map.getDocType() === 'presentation') uno = '.uno:Color'; else
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js |6 ++ loleaflet/src/control/Control.Menubar.js |4 ++-- loleaflet/src/control/Control.MobileWizard.js| 23 ++- 3 files changed, 26 insertions(+), 7 deletions(-) New commits: commit 2fe1e1ab8aabc010e8964ed1e3f1654d8abcb6f2 Author: Tamás Zolnai AuthorDate: Sat Dec 28 10:22:07 2019 +0100 Commit: Tamás Zolnai CommitDate: Sat Dec 28 11:39:16 2019 +0100 mobile-wizard: Fix state of insertion mobile wizard toolbar item. When user clicks in the document while insertion mobile wizard is opened, closing of the mobile wizard is triggered, but the toolbar item's state is not updated. Change-Id: I92b2585b069006e3a21c15ca687126ea49d80a95 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/85911 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 712677c4a..d8145c05a 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -76,12 +76,13 @@ L.Control.MobileWizard = L.Control.extend({ this.map.showSidebar = false; this._isActive = false; this._currentPath = []; - if (window.mobileWizard === true) { - var toolbar = w2ui['actionbar']; - if (toolbar && toolbar.get('mobile_wizard').checked) - toolbar.uncheck('mobile_wizard'); + if (window.mobileWizard === true) window.mobileWizard = false; - } + + if (window.insertionMobileWizard === true) + window.insertionMobileWizard = false; + + this._updateToolbarItemStateByClose(); if (!this.map.hasFocus()) { this.map.focus(); @@ -92,6 +93,18 @@ L.Control.MobileWizard = L.Control.extend({ document.activeElement.blur(); }, + _updateToolbarItemStateByClose: function() { + var toolbar = w2ui['actionbar']; + if (toolbar) + { + if (window.mobileWizard === false && toolbar.get('mobile_wizard').checked) + toolbar.uncheck('mobile_wizard'); + + if (window.insertionMobileWizard === false && toolbar.get('insertion_mobile_wizard').checked) + toolbar.uncheck('insertion_mobile_wizard'); + } + }, + getCurrentLevel: function() { return this._currentDepth; }, commit 35763dad713852e81c13ee230ca01fc8536f7fc8 Author: Tamás Zolnai AuthorDate: Sat Dec 28 09:53:37 2019 +0100 Commit: Tamás Zolnai CommitDate: Sat Dec 28 11:39:11 2019 +0100 mobile-wizard: Fix execution of insert header / footer menu's All item In desktop case, it depends on the checked state whether we insert or delete a header / footer. However, when deletion is triggered there is a dialog coming up, what we would like to avoid on mobile. So on mobile we allow only insertion by now. So we can add "On:bool=true" param to All menu item. Change-Id: I8ee764c488563b04226cc53e744034b22c0437ff Reviewed-on: https://gerrit.libreoffice.org/c/online/+/85910 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 916157c99..a79705df8 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1446,6 +1446,12 @@ L.Control.JSDialogBuilder = L.Control.extend({ if (data.executionType === 'action') { builder.map.menubar._executeAction(undefined, data.id); } else if (!builder.map._clip || !builder.map._clip.filterExecCopyPaste(data.command)) { + // Header / footer is already inserted. + if ((data.command.startsWith('.uno:InsertPageHeader') || + data.command.startsWith('.uno:InsertPageFooter')) && + data.checked && data.checked === true) { + return; + } builder.map.sendUnoCommand(data.command) } }); diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 75ec190c8..3f82b442f 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -624,9 +624,9 @@ L.Con
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Menubar.js | 38 +++--- loleaflet/src/map/handler/Map.StateChanges.js |4 +- 2 files changed, 37 insertions(+), 5 deletions(-) New commits: commit 05f8befe1c90a0dd3a2c730ee95ecd6e57a3313e Author: Tamás Zolnai AuthorDate: Sun Dec 22 13:54:40 2019 +0100 Commit: Tamás Zolnai CommitDate: Sun Dec 22 15:33:53 2019 +0100 Header and Footer menu options only show All in Android Add styles to the insertion mobile wizard. Change-Id: I7086a04b58999b7fe29cdb61f7488e34c241801f Reviewed-on: https://gerrit.libreoffice.org/85694 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index e27e24efd..ede42fcfa 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -816,8 +816,25 @@ L.Control.Menubar = L.Control.extend({ var pageStyles = e.commandValues['HeaderFooter']; for (var iterator in pageStyles) { style = pageStyles[iterator]; - $menuHeader.append(this._createUnoMenuItem(_(style), constHeader + encodeURIComponent(style) + constArg, style)); - $menuFooter.append(this._createUnoMenuItem(_(style), constFooter + encodeURIComponent(style) + constArg, style)); + if (!L.Browser.mobile) { + $menuHeader.append(this._createUnoMenuItem(_(style), constHeader + encodeURIComponent(style) + constArg, style)); + $menuFooter.append(this._createUnoMenuItem(_(style), constFooter + encodeURIComponent(style) + constArg, style)); + } else { + var docType = this._map.getDocType(); + var target = this.options['mobileInsertMenu'][docType]; + + var findFunction = function(item) { + return item.name === _(style); + }; + + var foundMenu = this._findSubMenuByName(target, _UNO('.uno:InsertPageHeader', 'text')) + if (foundMenu && foundMenu.menu.find(findFunction) === undefined) + foundMenu.menu.push({name: _(style), tag: style, uno: constHeader + encodeURIComponent(style) + constArg}); + + foundMenu = this._findSubMenuByName(target, _UNO('.uno:InsertPageFooter', 'text')) + if (foundMenu && foundMenu.menu.find(findFunction) === undefined) + foundMenu.menu.push({name: _(style), tag: style, uno: constFooter + encodeURIComponent(style) + constArg}); + } } } }, @@ -1492,7 +1509,22 @@ L.Control.Menubar = L.Control.extend({ } } return menuStructure; - } + }, + + _findSubMenuByName: function(menuTarget, nameString) { + if (menuTarget.name === nameString) + return menuTarget; + + if (menuTarget.menu) + { + for (var i = 0; i < menuTarget.menu.length; i++) { + var foundItem = this._findSubMenuByName(menuTarget.menu[i], nameString); + if (foundItem) + return foundItem; + } + } + return null; + }, }); L.control.menubar = function (options) { commit 544b5ffe41f9a2ceca81ef91e91417bc3f394bbc Author: Tamás Zolnai AuthorDate: Fri Dec 20 17:49:27 2019 +0100 Commit: Tamás Zolnai CommitDate: Sun Dec 22 15:33:46 2019 +0100 Fix state of InsertPageHeader / InsertPageFooter Change-Id: Iee359cdd8d4706d4cf8f7d5cc3363808c3fdb066 Reviewed-on: https://gerrit.libreoffice.org/85693 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai diff --git a/loleaflet/src/map/handler/Map.StateChanges.js b/loleaflet/src/map/handler/Map.StateChanges.js index 6afcd642c..a6b5d3f81 100644 --- a/loleaflet/src/map/handler/Map.StateChanges.js +++ b/loleaflet/src/map/handler/Map.StateChanges.js @@ -30,9 +30,9 @@ L.Map.StateChangeHandler = L.Handler.extend({ var slideMasterPageItem = this._map['stateChangeHandler'].getItemValue('.uno:SlideMasterPage'); var state; - if (typeof(e.state == 'object')) { + if (typeof(e.state) == 'object') { state = e.state; - } else if (typeof(e.state == 'stri
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 11 +++ loleaflet/src/core/LOUtil.js |5 - 2 files changed, 7 insertions(+), 9 deletions(-) New commits: commit 4f7958dcc101a0d70fa0ea244f21a05e58e7ec2e Author: Tamás Zolnai AuthorDate: Mon Dec 16 15:03:26 2019 +0100 Commit: Tamás Zolnai CommitDate: Mon Dec 16 16:15:42 2019 +0100 Revert "This is not needed anymore." This reverts commit a184b2b812405a55a63bf7d5718963f519fb3c95. Change-Id: I5373831dc6e02de255d8c439ba99118873c07c28 Reviewed-on: https://gerrit.libreoffice.org/85225 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 4b993e790..f031a13d8 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1415,7 +1415,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ var icon = null; var commandName = data.command ? data.command.substring('.uno:'.length) : data.id; - if (commandName && commandName.length) { + if (commandName && commandName.length && L.LOUtil.existsIconForCommand(commandName)) { var iconSpan = L.DomUtil.create('span', 'menu-entry-icon ' + commandName.toLowerCase(), menuEntry); var iconPath = 'images/lc_' + commandName.toLowerCase() + '.svg'; icon = L.DomUtil.create('img', '', iconSpan); commit f76e4990ed37d798be765129bc74de972da56a0b Author: Tamás Zolnai AuthorDate: Mon Dec 16 14:55:15 2019 +0100 Commit: Tamás Zolnai CommitDate: Mon Dec 16 16:15:38 2019 +0100 Revert "Context menus: Better to handle missing icon automatically." This reverts commit fb12f822699274c9c1d8a249d199ecc892070938. With this method the "missing image" icon is displayed for a moment, before removing it from the screen. Change-Id: I360279244bccddb23eadca485e571d6ac514d865 Reviewed-on: https://gerrit.libreoffice.org/85224 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 9145f2bcb..4b993e790 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1420,20 +1420,15 @@ L.Control.JSDialogBuilder = L.Control.extend({ var iconPath = 'images/lc_' + commandName.toLowerCase() + '.svg'; icon = L.DomUtil.create('img', '', iconSpan); icon.src = iconPath; - icon.onerror = function() { - L.DomUtil.removeClass(iconSpan.nextSibling, 'menu-entry-with-icon'); - L.DomUtil.addClass(iconSpan.nextSibling, 'menu-entry-no-icon'); - L.DomUtil.remove(iconSpan); - } } - if (data.checked && data.checked === true) { L.DomUtil.addClass(menuEntry, 'menu-entry-checked'); } var titleSpan = L.DomUtil.create('span', '', menuEntry); titleSpan.innerHTML = title; - L.DomUtil.addClass(titleSpan, 'menu-entry-with-icon'); + var paddingClass = icon ? 'menu-entry-with-icon' : 'menu-entry-no-icon'; + L.DomUtil.addClass(titleSpan, paddingClass); if (builder.wizard) { $(menuEntry).click(function() { diff --git a/loleaflet/src/core/LOUtil.js b/loleaflet/src/core/LOUtil.js index 0172c1058..95252882d 100644 --- a/loleaflet/src/core/LOUtil.js +++ b/loleaflet/src/core/LOUtil.js @@ -97,7 +97,8 @@ L.LOUtil = { 'InsertZWSP', 'InsertZWNBSP', 'InsertLRM', - 'InsertRLM' + 'InsertRLM', + 'None' ], existsIconForCommand: function(command) { @@ -105,6 +106,8 @@ L.LOUtil = { var res = !this.commandWithoutIcon.find(function (el) { return el.startsWith(commandName); }); + if (commandName.indexOf('?')!== -1) + return false; return res; } }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.PartsPreview.js |1 + loleaflet/src/control/Toolbar.js |1 + 2 files changed, 2 insertions(+) New commits: commit 651a4f546aa07a42e0a5416af317ef46851c69b3 Author: mert AuthorDate: Wed Dec 11 14:10:03 2019 +0300 Commit: Mert Tümer CommitDate: Wed Dec 11 16:23:20 2019 +0100 fix Keyboard pops up when switching slides Change-Id: I6b0953e4868867786a8c63c5ccbf132baa0d0324 Reviewed-on: https://gerrit.libreoffice.org/84935 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mert Tümer diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js index ddc9c6041..12c5bab19 100644 --- a/loleaflet/src/control/Control.PartsPreview.js +++ b/loleaflet/src/control/Control.PartsPreview.js @@ -170,6 +170,7 @@ L.Control.PartsPreview = L.Control.extend({ .on(img, 'click', this._map.focus, this._map) .on(img, 'click', function() { this.partsFocused = true; + document.activeElement.blur(); }, this); var topBound = this._previewContTop; commit 041b16202c35064df4e905115c69c3486f7cb717 Author: mert AuthorDate: Wed Dec 11 13:50:10 2019 +0300 Commit: Mert Tümer CommitDate: Wed Dec 11 16:22:29 2019 +0100 Fix closing hyperlink dialog doesn't focus The document should have the focus after closing the hyperlink dialog Change-Id: I5f4cf4f2cabe92b97e60a4d118ba67255f598c0b Reviewed-on: https://gerrit.libreoffice.org/84933 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mert Tümer diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index e2289a748..1a353ff67 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -470,6 +470,7 @@ L.Map.include({ } }; map.sendUnoCommand('.uno:SetHyperlink', command); + map.focus(); } } }); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/tile/CalcTileLayer.js|5 loleaflet/src/layer/tile/GridLayer.js| 29 +++ loleaflet/src/layer/tile/ImpressTileLayer.js |5 loleaflet/src/layer/tile/WriterTileLayer.js |1 4 files changed, 17 insertions(+), 23 deletions(-) New commits: commit 9f5374103ba66274e70a48fea5aebcc9a7c419a5 Author: Michael Meeks AuthorDate: Mon Dec 9 16:37:23 2019 + Commit: Michael Meeks CommitDate: Mon Dec 9 16:37:23 2019 + prefetch: disable interval timer when we've pre-fetched everything. Change-Id: I9d3b3819b3d9a960aa31f729686315e9e5d6d8e1 diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js index d9ff748a3..4db50a473 100644 --- a/loleaflet/src/layer/tile/GridLayer.js +++ b/loleaflet/src/layer/tile/GridLayer.js @@ -1278,6 +1278,9 @@ L.GridLayer = L.Layer.extend({ var fragment = document.createDocumentFragment(); this._addTiles(finalQueue, fragment); this._level.el.appendChild(fragment); + } else { + clearInterval(this._tilesPreFetcher); + this._tilesPreFetcher = undefined; } }, @@ -1285,8 +1288,10 @@ L.GridLayer = L.Layer.extend({ if (!this._map) { return; } - clearInterval(this._tilesPreFetcher); - clearTimeout(this._preFetchIdle); + if (this._tilesPreFetcher) + clearInterval(this._tilesPreFetcher); + if (this._preFetchIdle) + clearTimeout(this._preFetchIdle); if (resetBorder) { this._preFetchBorder = null; } @@ -1295,6 +1300,7 @@ L.GridLayer = L.Layer.extend({ this._preFetchPart = this._selectedPart; this._preFetchIdle = setTimeout(L.bind(function () { this._tilesPreFetcher = setInterval(L.bind(this._preFetchTiles, this), interval); + this._prefetchIdle = undefined; }, this), idleTime); } }); commit a3319eef792c3db1ec04f2cf20f2183d6895fd68 Author: Michael Meeks AuthorDate: Mon Dec 9 16:14:26 2019 + Commit: Michael Meeks CommitDate: Mon Dec 9 16:31:45 2019 + prefetch: cleanup, and avoid constant growth of pre-loading area. We were inadvertently mutating and growing our copy of the bounds to fetch here, causing a chunk of un-necessary rendering load, particularly for spreadsheets. Change-Id: Ia01565c043d1cb0172cabbec16d941dd8b66dd05 diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index abbcea8b3..511a5253e 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -528,7 +528,6 @@ L.CalcTileLayer = L.TileLayer.extend({ } else { // tile outside of the visible area, just remove it - this._preFetchBorder = null; this._removeTile(key); } } @@ -646,10 +645,6 @@ L.CalcTileLayer = L.TileLayer.extend({ }); this._resetPreFetching(true); this._update(); - if (this._preFetchPart !== this._selectedPart) { - this._preFetchPart = this._selectedPart; - this._preFetchBorder = null; - } } }, diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js index 7623f7cd8..d9ff748a3 100644 --- a/loleaflet/src/layer/tile/GridLayer.js +++ b/loleaflet/src/layer/tile/GridLayer.js @@ -1185,6 +1185,7 @@ L.GridLayer = L.Layer.extend({ var zoom = this._map.getZoom(); var tilesToFetch = 10; var maxBorderWidth = 5; + var tileBorderSrc; if (this._map._permission === 'edit') { tilesToFetch = 5; @@ -1192,19 +1193,17 @@ L.GridLayer = L.Layer.extend({ } if (!this._preFetchBorder) { - if (this._selectedPart !== this._preFetchPart) { - // all tiles from the new part have to be pre-fetched - var tileBorder = this._preFetchBorder = new L.Bounds(new L.Point(0, 0), new L.Point(0, 0)); - } - else { - var pixelBounds = this._map.getPixelBounds(center, zoom); - tileBorder = this._pxBoundsToTileRange(pixelBounds); -
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js |6 ++-- loleaflet/src/control/Control.MobileWizard.js| 32 --- 2 files changed, 32 insertions(+), 6 deletions(-) New commits: commit c6c49d52ccd7b6de8d00ec4503ee465879c79e71 Author: Szymon Kłos AuthorDate: Fri Dec 6 10:45:56 2019 +0100 Commit: Szymon Kłos CommitDate: Fri Dec 6 10:45:56 2019 +0100 jsdialog: dont animate while restoring the last path Change-Id: Ia8fc4c69318a5644b77cfef47f7f540f9ac37026 diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index fcdd65f4a..094a1b5fa 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -290,8 +290,8 @@ L.Control.JSDialogBuilder = L.Control.extend({ { $(contentDiv).hide(); if (builder.wizard) { - $(sectionTitle).click(function() { - builder.wizard.goLevelDown(contentDiv); + $(sectionTitle).click(function(event, data) { + builder.wizard.goLevelDown(contentDiv, data); if (contentNode.onshow) contentNode.onshow(); }); diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 2d10e3dd3..592ae718c 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -99,7 +99,9 @@ L.Control.MobileWizard = L.Control.extend({ this._currentElementId = elementId; }, - goLevelDown: function(contentToShow) { + goLevelDown: function(contentToShow, options) { + var animate = (options && options.animate != undefined) ? options.animate : true; + if (!this._isTabMode || this._currentDepth > 0) this.backButton.removeClass('close-button'); @@ -109,11 +111,20 @@ L.Control.MobileWizard = L.Control.extend({ } var titles = '.ui-header.level-' + this.getCurrentLevel() + '.mobile-wizard'; - $(titles).hide('slide', { direction: 'left' }, 'fast'); + + if (animate) + $(titles).hide('slide', { direction: 'left' }, 'fast'); + else + $(titles).hide(); + $(contentToShow).siblings().hide(); $('#mobile-wizard.funcwizard div#mobile-wizard-content').removeClass('hideHelpBG'); $('#mobile-wizard.funcwizard div#mobile-wizard-content').addClass('showHelpBG'); - $(contentToShow).show('slide', { direction: 'right' }, 'fast'); + + if (animate) + $(contentToShow).show('slide', { direction: 'right' }, 'fast'); + else + $(contentToShow).show(); this._currentDepth++; this._setTitle(contentToShow.title); @@ -170,7 +181,7 @@ L.Control.MobileWizard = L.Control.extend({ _goToPath: function(path) { for (var index in path) { - $('[title=\'' + path[index] + '\'').prev().click(); + $('[title=\'' + path[index] + '\'').prev().trigger('click', {animate: false}); } this._currentPath = path; commit 49e110306729509f415d5e228e7ea17552f04f32 Author: Szymon Kłos AuthorDate: Fri Dec 6 10:13:19 2019 +0100 Commit: Szymon Kłos CommitDate: Fri Dec 6 10:13:19 2019 +0100 jsdialog: scroll to last used element Change-Id: I58f88ced08263fb1cad75c60937ba4e90a424bfa diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index e60ec7bb0..fcdd65f4a 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -98,6 +98,8 @@ L.Control.JSDialogBuilder = L.Control.extend({ _defaultCallbackHandler: function(objectType, eventType, object, data, builder) { console.debug('control: \'' + objectType + '\' id:\'' + object.id + '\' event: \'' + eventType + '\' state: \'' + data + '\''); + builder.wizard.setCurrentFocus(object.id); + if (objectType == 'toolbutton' && eventType == 'click') { builder.map.sendUnoCommand(data); } else if (object) { diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 8837b2f3b..2d10e3dd3 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -15,6 +15,7 @@ L.Control.MobileWizard = L.Control.extend({ _mainTitle: '', _isTabMode:
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.LokDialog.js | 43 ++--- 1 file changed, 40 insertions(+), 3 deletions(-) New commits: commit 9e219313537f4bc8797fce27690fd860c485a91e Author: Ashod Nakashian AuthorDate: Sun Dec 1 16:56:34 2019 -0500 Commit: Ashod Nakashian CommitDate: Mon Dec 2 04:42:59 2019 +0100 leaflet: improved sidebar closing Change-Id: I547ef3e65b746c4b37176969db8eb766fc037aa9 Reviewed-on: https://gerrit.libreoffice.org/84181 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index e91a075f4..3f4f5fe32 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -875,12 +875,16 @@ L.Control.LokDialog = L.Control.extend({ _onSidebarClose: function(dialogId) { this._resizeSidebar(dialogId, 0); - $('#' + this._currentDeck.strId).remove(); - this._map.focus(); delete this._dialogs[dialogId]; - this._currentDeck = null; + if (this._currentDeck) { + $('#' + this._currentDeck.strId).remove(); + this._currentDeck = null; + } $('#sidebar-dock-wrapper').css({display: ''}); + this._map.fire('editorgotfocus'); + this._map.focus(); + }, _onCalcInputBarClose: function(dialogId) { commit 0cc3319b30733210850f3be6761b183c00a6d6b9 Author: Ashod Nakashian AuthorDate: Sun Dec 1 16:53:34 2019 -0500 Commit: Ashod Nakashian CommitDate: Mon Dec 2 04:42:49 2019 +0100 leaflet: properly handle sidebar id changes from Core Change-Id: Ic8fceb097ce8d269bf957038d84bcb536cb3b250 Reviewed-on: https://gerrit.libreoffice.org/84180 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 70f1592f7..e91a075f4 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -612,6 +612,39 @@ L.Control.LokDialog = L.Control.extend({ var strId = this._toStrId(id); if (this._currentDeck) { + + var oldId = this._currentDeck.id; + if (oldId != id) { + // This is a new deck; update the HTML elements in-place. + var strOldId = this._toStrId(oldId); + + var oldPanel = document.getElementById(strOldId); + if (oldPanel) + oldPanel.id = strOldId + '-offscreen'; + var oldCanvas = document.getElementById(strOldId + '-canvas'); + if (oldCanvas) + oldCanvas.id = strOldId + '-offscreen'; + + $('#' + this._currentDeck.strId).remove(); + delete this._dialogs[oldId]; + this._currentDeck = null; + + this._createSidebar(id, strId, width, height); + + var newCanvas = document.getElementById(strId + '-canvas'); + if (oldCanvas && newCanvas) + { + this._setCanvasWidthHeight(newCanvas, oldCanvas.width, oldCanvas.height); + var ctx = newCanvas.getContext('2d'); + ctx.drawImage(oldCanvas, 0, 0); + } + + oldPanel.remove(); + + return; + } + + // Update the existing sidebar. this._currentDeck.width = width; this._currentDeck.height = height; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.LokDialog.js | 34 - 1 file changed, 19 insertions(+), 15 deletions(-) New commits: commit aa32811089838af9118e581d7cad395ccf2163b6 Author: Ashod Nakashian AuthorDate: Sun Dec 1 16:49:01 2019 -0500 Commit: Ashod Nakashian CommitDate: Mon Dec 2 04:33:36 2019 +0100 leaflet: split sidebar launch into three stages We need to re-create the sidebar, so we need to reuse the create portion and separate it from the in-pace update logic. Similarly, the post-launch logic is common and re-usable, so we isolate it too. Change-Id: I5c72d19fd6e7f0f05c32b7bed186a562d19a8f24 Reviewed-on: https://gerrit.libreoffice.org/84178 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 0ee2e4ba2..451805101 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -635,10 +635,16 @@ L.Control.LokDialog = L.Control.extend({ else $(panel).parent().hide(); - // Render window. - this._sendPaintWindowRect(id); - return; + var panelContainer = document.getElementById(strId); + var panelCanvas = document.getElementById(strId + '-canvas'); + this._postLaunch(id, panelContainer, panelCanvas); + } else { + this._createSidebar(id, strId, width, height); } + }, + + _createSidebar: function(id, strId, width, height) { + // Create a new sidebar. var panelContainer = L.DomUtil.create('div', 'panel', L.DomUtil.get('sidebar-panel')); panelContainer.id = strId; @@ -676,12 +682,13 @@ L.Control.LokDialog = L.Control.extend({ this._currentDeck = this._dialogs[id]; this._createDialogCursor(strId); - this._setupWindowEvents(id, panelCanvas/*, dlgInput*/); - L.DomEvent.on(panelContainer, 'resize', function() { - // Don't resize the window as we handle overflowing with scrollbars. - // this._map._socket.sendMessage('resizewindow ' + id + ' size=' + panelContainer.width + ',' + panelContainer.height); - }, this); + this._postLaunch(id, panelContainer, panelCanvas); + }, + + _postLaunch: function(id, panelContainer, panelCanvas) { + + this._setupWindowEvents(id, panelCanvas/*, dlgInput*/); L.DomEvent.on(panelContainer, 'mouseleave', function() { // Move the mouse off-screen when we leave the sidebar commit 9b973d09fc2aa0e338d9055bd965a9d566ded486 Author: Ashod Nakashian AuthorDate: Sun Dec 1 16:38:46 2019 -0500 Commit: Ashod Nakashian CommitDate: Mon Dec 2 04:33:26 2019 +0100 leaflet: always setup #sidebar-dock-wrapper properties No reason to set these properties as soon as possible. Change-Id: Iee1f108c628f4e6ada640cde0c698246fe33729c Reviewed-on: https://gerrit.libreoffice.org/84177 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 75b56bf5d..0ee2e4ba2 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -609,10 +609,14 @@ L.Control.LokDialog = L.Control.extend({ return; $('#sidebar-dock-wrapper').css('display', 'block'); + if (window.mode.isTablet()) + $('#sidebar-dock-wrapper').addClass('tablet'); var ratio = 1.0; if (width > window.screen.width) { ratio = window.screen.width / width; + if (ratio < 1.0) + $('#sidebar-dock-wrapper').css('width', String(width * ratio) + 'px'); } var strId = this._toStrId(id); @@ -633,13 +637,6 @@ L.Control.LokDialog = L.Control.extend({ // Render window. this._sendPaintWindowRect(id); - - if (window.mode.isTablet()) - $('#sidebar-dock-wrapper').addClass('tablet'); - - if (ratio < 1.0) { - $('#sidebar-dock-wrapper').css('width', String(width * ratio) + 'px'); - } return; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 45 ++- 1 file changed, 44 insertions(+), 1 deletion(-) New commits: commit 045c93cf135dfdbcb14f087268789e4dd0621745 Author: Szymon Kłos AuthorDate: Fri Nov 29 16:26:01 2019 +0100 Commit: Szymon Kłos CommitDate: Fri Nov 29 19:17:13 2019 +0100 jsdialogs: dont show empty controls from panel titlebars Change-Id: I548d4280f90f7c271c44cbf279ece941b1fbed33 Reviewed-on: https://gerrit.libreoffice.org/84083 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index c6342ec13..4a8bd352b 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1449,6 +1449,11 @@ L.Control.JSDialogBuilder = L.Control.extend({ var needsToCreateContainer = childType == 'panel' || childType == 'frame' || childType == 'toolbox'; + if ((childData.id === undefined || childData.id === '' || childData.id === null) + && (childType == 'checkbox' || childType == 'radiobutton')) { + continue; + } + var childObject = needsToCreateContainer ? L.DomUtil.createWithId('div', childData.id, parent) : parent; var handler = this._controlHandlers[childType]; commit 476aedb5eea4ecd0abeb094ed70b96db0f41ff5a Author: Szymon Kłos AuthorDate: Fri Nov 29 12:30:40 2019 +0100 Commit: Szymon Kłos CommitDate: Fri Nov 29 19:16:41 2019 +0100 jsdialog: process transparency type updates Change-Id: I3cded8b48bd0bd57053242a7ffca8c34dfbb6110 Reviewed-on: https://gerrit.libreoffice.org/84058 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index c71eb2def..c6342ec13 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -142,6 +142,34 @@ L.Control.JSDialogBuilder = L.Control.extend({ return text.replace(/[^\d.-]/g, '').trim(); }, + _gradientStyleToLabel: function(state) { + switch (state) { + case 'LINEAR': + return _('Linear'); + + case 'AXIAL': + return _('Axial'); + + case 'RADIAL': + return _('Radial'); + + case 'ELLIPTICAL': + return _('Elipsoid'); + + // no, not a typo (square - quadratic, rect - square) - same as in the core + case 'SQUARE': + return _('Quadratic'); + + case 'RECT': + return _('Square'); + + case 'MAKE_FIXED_SIZE': + return _('Fixed size'); + } + + return ''; + }, + _containerHandler: function(parentContainer, data, builder) { if (data.cols && data.rows) { return builder._gridHandler(parentContainer, data, builder); @@ -574,6 +602,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ case 'verticalpos': return '.uno:Position'; + + case 'transtype': + return '.uno:FillFloatTransparence'; } return null; @@ -718,7 +749,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ case 'gradientstyle': state = items.getItemValue('.uno:FillGradient'); if (state) { - return state.style; + return builder._gradientStyleToLabel(state.style); } break; @@ -819,6 +850,13 @@ L.Control.JSDialogBuilder = L.Control.extend({ return String(L.mm100thToInch(state.split('/')[1]).toFixed(2)); } break; + + case 'transtype': + state = items.getItemValue('.uno:FillFloatTransparence'); + if (state) { + return builder._gradientStyleToLabel(state.style); + } + break; } return null; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 22 +- loleaflet/src/core/Util.js |5 + 2 files changed, 26 insertions(+), 1 deletion(-) New commits: commit 47d8f51b46d2b64e285437a33a19b74e5220c7d7 Author: Szymon Kłos AuthorDate: Thu Nov 28 12:10:01 2019 +0100 Commit: Szymon Kłos CommitDate: Thu Nov 28 12:10:01 2019 +0100 jsdialog: correctly read .uno:Size values Change-Id: Ic469c959afbf28d04ef75b53eac5559a2ea8106d diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 5d4975347..da6ce637f 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -565,6 +565,12 @@ L.Control.JSDialogBuilder = L.Control.extend({ case 'setgamma': return '.uno:GrafGamma'; + + case 'selectwidth': + return '.uno:Size'; + + case 'selectheight': + return '.uno:Size'; } return null; @@ -782,6 +788,20 @@ L.Control.JSDialogBuilder = L.Control.extend({ return String(state.replace(',', '.') / 100.0); } break; + + case 'selectwidth': + state = items.getItemValue('.uno:Size'); + if (state) { + return String(L.mm100thToInch(state.split('x')[0]).toFixed(2)); + } + break; + + case 'selectheight': + state = items.getItemValue('.uno:Size'); + if (state) { + return String(L.mm100thToInch(state.split('x')[1]).toFixed(2)); + } + break; } return null; diff --git a/loleaflet/src/core/Util.js b/loleaflet/src/core/Util.js index da81e6783..e504c92c5 100644 --- a/loleaflet/src/core/Util.js +++ b/loleaflet/src/core/Util.js @@ -195,6 +195,10 @@ L.Util = { isEmpty: function(o) { return !(o && o.length); + }, + + mm100thToInch: function(mm) { + return mm / 2540; } }; @@ -249,3 +253,4 @@ L.round = L.Util.round; L.getDpiScaleFactor = L.Util.getDpiScaleFactor; L.toggleFullScreen = L.Util.toggleFullScreen; L.isEmpty = L.Util.isEmpty; +L.mm100thToInch = L.Util.mm100thToInch; commit 17601e461ce6dedcf33becd9ec3a0996e628d286 Author: Szymon Kłos AuthorDate: Thu Nov 28 11:53:56 2019 +0100 Commit: Szymon Kłos CommitDate: Thu Nov 28 11:54:25 2019 +0100 jsdialog: correctly read gamma value Change-Id: I3eafd45bf405539a6c38d0901ec5a39d8ae1d788 diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 158c209e5..5d4975347 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -779,7 +779,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ case 'setgamma': state = items.getItemValue('.uno:GrafGamma'); if (state) { - return state.replace(',', '.'); + return String(state.replace(',', '.') / 100.0); } break; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src wsd/Admin.cpp wsd/AdminModel.cpp wsd/Auth.cpp wsd/FileServer.cpp wsd/TileDesc.hpp
loleaflet/src/control/Control.JSDialogBuilder.js | 12 +++ wsd/Admin.cpp| 30 +-- wsd/AdminModel.cpp |1 wsd/Auth.cpp |4 +- wsd/FileServer.cpp |1 wsd/TileDesc.hpp | 35 +++ 6 files changed, 45 insertions(+), 38 deletions(-) New commits: commit c8595eb7e45de9a1b05dc531c83f7c556c963c52 Author: Szymon Kłos AuthorDate: Tue Nov 12 16:27:59 2019 +0100 Commit: Szymon Kłos CommitDate: Wed Nov 13 09:51:30 2019 +0100 jsdialogs: apply .uno:ULSpacing updates Change-Id: I67e8600738bb380f5652d47b609d4db4c4e670e0 Reviewed-on: https://gerrit.libreoffice.org/82530 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index f9e827846..17e9b4c02 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -441,6 +441,18 @@ L.Control.JSDialogBuilder = L.Control.extend({ if (state) return state.firstline.replace(',', '.'); break; + + case 'aboveparaspacing': + state = items.getItemValue('.uno:ULSpacing'); + if (state) + return state.upper.replace(',', '.'); + break; + + case 'belowparaspacing': + state = items.getItemValue('.uno:ULSpacing'); + if (state) + return state.lower.replace(',', '.'); + break; } return null; commit a6b0e5b8271614ee239d6cb0e36ab843e27c1951 Author: Pranam Lashkari AuthorDate: Wed Nov 13 13:45:07 2019 +0530 Commit: Jan Holesovsky CommitDate: Wed Nov 13 09:51:04 2019 +0100 killpoco: removed StringTokenizer from wsd directory removed use of Poco::StringTokenizer from the wsd directory using LOOLProtocol::tokenize and std::vecor Change-Id: Ic50b4d4d71d4ffd005aacf6aef0ed2bfde66d40d Reviewed-on: https://gerrit.libreoffice.org/82569 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp index 8a1d858b8..3e64b5a1f 100644 --- a/wsd/Admin.cpp +++ b/wsd/Admin.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include "Admin.hpp" #include "AdminModel.hpp" @@ -43,7 +42,6 @@ using namespace LOOLProtocol; using Poco::Net::HTTPResponse; -using Poco::StringTokenizer; using Poco::Util::Application; const int Admin::MinStatsIntervalMs = 50; @@ -55,10 +53,10 @@ void AdminSocketHandler::handleMessage(bool /* fin */, WSOpCode /* code */, { // FIXME: check fin, code etc. const std::string firstLine = getFirstLine(payload.data(), payload.size()); -StringTokenizer tokens(firstLine, " ", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM); -LOG_TRC("Recv: " << firstLine << " tokens " << tokens.count()); +std::vector tokens(LOOLProtocol::tokenize(firstLine, ' ')); +LOG_TRC("Recv: " << firstLine << " tokens " << tokens.size()); -if (tokens.count() < 1) +if (tokens.empty()) { LOG_TRC("too few tokens"); return; @@ -68,7 +66,7 @@ void AdminSocketHandler::handleMessage(bool /* fin */, WSOpCode /* code */, if (tokens[0] == "auth") { -if (tokens.count() < 2) +if (tokens.size() < 2) { LOG_DBG("Auth command without any token"); sendMessage("InvalidAuthToken"); @@ -98,7 +96,7 @@ void AdminSocketHandler::handleMessage(bool /* fin */, WSOpCode /* code */, if (!_isAuthenticated) { LOG_DBG("Not authenticated - message is '" << firstLine << "' " << -tokens.count() << " first: '" << tokens[0] << "'"); +tokens.size() << " first: '" << tokens[0] << "'"); sendMessage("NotAuthenticated"); shutdown(); return; @@ -126,16 +124,16 @@ void AdminSocketHandler::handleMessage(bool /* fin */, WSOpCode /* code */, // Send LOKit version information sendTextFrame("lokitversion " + LOOLWSD::LOKitVersion); } -else if (tokens[0] == "subscribe" && tokens.count() > 1) +else if (tokens[0] == "subscribe" && tokens.size() > 1) { -for (std::size_t i = 0; i < tokens.count() - 1; i++) +for (std::size_t i = 0; i < tokens.size() - 1; i++) { model.subscribe(_sessionId, tokens[i + 1]); } } -else if (tokens[0] == "unsubscribe" && tokens.count() > 1) +else if (tokens[0] == "unsubscribe" && tokens.size() > 1) { -for (std::size_t i = 0; i < tokens.count() - 1; i++) +for (std::size_t
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Menubar.js | 10 ++ loleaflet/src/control/Control.Toolbar.js |7 +++ 2 files changed, 13 insertions(+), 4 deletions(-) New commits: commit cd21bedb54dd3c547f5d3a9c94120fde66a5c3eb Author: Ashod Nakashian AuthorDate: Wed Dec 12 21:04:16 2018 -0500 Commit: Michael Meeks CommitDate: Thu Nov 7 12:11:59 2019 +0100 leaflet: toggle between showing master page and closing it (cherry picked from commit 29146e4224ae00f825a89e8759e5a2c8b5b8767b) Change-Id: I9ba3d442cea1f3d45d296f1fb1c877cc9a56a3dc Reviewed-on: https://gerrit.libreoffice.org/82147 Reviewed-by: Michael Meeks Tested-by: Michael Meeks diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 3c7ba08df..cd6f93f5a 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -278,7 +278,8 @@ L.Control.Menubar = L.Control.extend({ {name: _('Reset zoom'), id: 'zoomreset', type: 'action'}, {type: 'separator'}, {uno: '.uno:SlideMasterPage'}, -{uno: '.uno:ModifyPage'}, + {type: 'separator'}, + {uno: '.uno:ModifyPage'}, {uno: '.uno:SlideChangeWindow'}, {uno: '.uno:CustomAnimation'}, {name: _('Master Slides'), id: 'masterslidespanel', type: 'action'}] @@ -1136,6 +1137,8 @@ L.Control.Menubar = L.Control.extend({ }); } else if (window.ThisIsAMobileApp && $(item).data('mobileappuno')) { this._map.sendUnoCommand($(item).data('mobileappuno')); + } else if (id == 'masterslidespanel') { + this._map.sendUnoCommand('.uno:MasterSlidesPanel'); } // Inform the host if asked if ($(item).data('postmessage') === 'true') { commit 8f682398befee088560d5bbc8fdff0d975defa17 Author: Ashod Nakashian AuthorDate: Wed Dec 12 02:57:40 2018 -0500 Commit: Michael Meeks CommitDate: Thu Nov 7 12:11:45 2019 +0100 leaflet: handle SlideMasterPage state change Incomplete. This is a stub hinting at what needs to be done. The menu entry should toggle between Master Slide and Close Master. (cherry picked from commit b7cc9a909d5b1d97d6a8f8268ffa8d3e47074f9d) Change-Id: I1ce7e15e72483eae520bf4914e03609446a6c71d Reviewed-on: https://gerrit.libreoffice.org/82146 Reviewed-by: Michael Meeks Tested-by: Michael Meeks diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index cb46986f4..3c7ba08df 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -278,12 +278,11 @@ L.Control.Menubar = L.Control.extend({ {name: _('Reset zoom'), id: 'zoomreset', type: 'action'}, {type: 'separator'}, {uno: '.uno:SlideMasterPage'}, - {uno: '.uno:CloseMasterView'}, - {uno: '.uno:MasterSlidesPanel'}, - {uno: '.uno:ModifyPage'}, +{uno: '.uno:ModifyPage'}, {uno: '.uno:SlideChangeWindow'}, - {uno: '.uno:CustomAnimation'} - ]}, + {uno: '.uno:CustomAnimation'}, +{name: _('Master Slides'), id: 'masterslidespanel', type: 'action'}] + }, {name: _UNO('.uno:InsertMenu', 'presentation'), id: 'insert', type: 'menu', menu: [ {name: _('Local Image...'), id: 'insertgraphic', type: 'action'}, {name: _UNO('.uno:InsertGraphic', 'presentation'), id: 'insertgraphicremote', type: 'action'}, diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 9cb3fb97d..adea5a6e0 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -1831,6 +1831,13 @@ function onCommandStateChanged(e) { toolbar.disable('repair'); } } + else if (commandName === '.uno:SlideMasterPage') { + if (state === 'true') { + // Rename menu to Close Master and set uno to .uno:CloseMasterView + } else { + // Rename menu to Master Slide and set uno to .uno:SlideMasterPage + } + } var id = unoCmdToToolbarId(commandName); if (state === 'true') { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.ColumnHeader.js |2 +- loleaflet/src/control/Control.RowHeader.js|2 +- loleaflet/src/layer/tile/TileLayer.js |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) New commits: commit edb3a3043a9d90f745778543ae161a711fbd6e51 Author: Michael Meeks AuthorDate: Tue Nov 5 20:32:44 2019 + Commit: Michael Meeks CommitDate: Tue Nov 5 20:32:59 2019 + avoid hyperlink related exception. Change-Id: I40663320dede76f6ebb6ead381b10cbb5fd8f2c5 diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 912a7e3d8..bc8d905f4 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1052,7 +1052,7 @@ L.TileLayer = L.GridLayer.extend({ this._map.hyperlinkUnderCursor = obj.hyperlink; this._map.closePopup(this._map.hyperlinkPopup); this._map.hyperlinkPopup = null; - if (obj.hyperlink.link) { + if (obj.hyperlink && obj.hyperlink.link) { this._map.hyperlinkPopup = new L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false}) .setContent('' + obj.hyperlink.link + '') .setLatLng(cursorPos) commit 84e67f6237f38476e9101c051fc6dac6b94edc72 Author: Michael Meeks AuthorDate: Tue Nov 5 20:31:57 2019 + Commit: Michael Meeks CommitDate: Tue Nov 5 20:32:59 2019 + avoid exception accessing non-existent options. introduced in 30f37ef7b080c12febea4971a4ac5cf26a517c5c, oh for sensible types. Change-Id: I411157e71e9ef03dd8305adbe9a1011bb76ed116 diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js index 19f4a1adb..c68656ae0 100644 --- a/loleaflet/src/control/Control.ColumnHeader.js +++ b/loleaflet/src/control/Control.ColumnHeader.js @@ -647,7 +647,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({ return; var rowHeader = L.DomUtil.get('spreadsheet-header-rows-container'); - var document = this.options.documentContainer; + var document = this._map.options.documentContainer; this._setCornerCanvasHeight(height); var deltaTop = height - this._canvasHeight; diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js index d4c4c9eeb..0736af32e 100644 --- a/loleaflet/src/control/Control.RowHeader.js +++ b/loleaflet/src/control/Control.RowHeader.js @@ -610,7 +610,7 @@ L.Control.RowHeader = L.Control.Header.extend({ return; var columnHeader = L.DomUtil.get('spreadsheet-header-columns-container'); - var document = this.options.documentContainer; + var document = this._map.options.documentContainer; this._setCornerCanvasWidth(width); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.LokDialog.js | 55 ++--- 1 file changed, 43 insertions(+), 12 deletions(-) New commits: commit a7ee73344effaee9e0fc1826633f9987aef67a95 Author: Szymon Kłos AuthorDate: Thu Jun 13 10:27:29 2019 +0200 Commit: Szymon Kłos CommitDate: Tue Oct 29 20:13:19 2019 +0100 Allow to use scrollbars in dialogs Change-Id: I95d54100040670aa5f30130eebdf03b8e6cc5dcc diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 147cac8eb..76ee6738d 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -287,6 +287,7 @@ L.Control.LokDialog = L.Control.extend({ return; if (e.action === 'invalidate') { + this.wasInvalidated = true; var parent = this._getParentId(e.id); var rectangle = e.rectangle; if (parent) { // this is a floating window @@ -665,6 +666,7 @@ L.Control.LokDialog = L.Control.extend({ } zoomTargets.push({key: targetId, value: zoomTarget, titlebar: titlebar, transformation: transformation, initialState: state, width:width, height: height}); + var that = this; var hammerTitlebar = new Hammer(titlebar); hammerTitlebar.add(new Hammer.Pan({ threshold: 20, pointers: 0 })); hammerTitlebar.add(new Hammer.Pinch({ threshold: 0 })).recognizeWith([hammerTitlebar.get('pan')]); @@ -697,8 +699,14 @@ L.Control.LokDialog = L.Control.extend({ hammerContent.on('pinchstart pinchmove', this.onPinch); hammerContent.on('hammer.input', function(ev) { if (ev.isFirst) { + that.wasInvalidated = false; draggedObject = ev.target; } + else if (that.wasInvalidated) { + draggedObject = null; + that.wasInvalidated = false; + return; + } if (ev.isFinal && draggedObject) { var id = toZoomTargetId(draggedObject.id); commit 3799d72bd81b6d8c68273395d12f350180b0c789 Author: Szymon Kłos AuthorDate: Tue Jun 11 18:43:54 2019 +0200 Commit: Szymon Kłos CommitDate: Tue Oct 29 20:11:31 2019 +0100 Use separate handlers for titlebar and content Fix needed for touch devices. Change-Id: Iffc0e7fe1303b7a0e4aae88ba7649bda0677320f diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index da24702d9..147cac8eb 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -60,6 +60,9 @@ L.Control.LokDialog = L.Control.extend({ dialogIdPrefix: 'lokdialog-', onPan: function (ev) { + if (!draggedObject) + return; + var id = toZoomTargetId(draggedObject.id); var target = findZoomTarget(id); @@ -71,8 +74,9 @@ L.Control.LokDialog = L.Control.extend({ if (window.mode.isDesktop() && (newX < -target.width/2 || newY < -target.height/2 || newX > window.innerWidth - target.width/2 - || newY > window.innerHeight - target.height/2)) + || newY > window.innerHeight - target.height/2)) { return; + } target.transformation.translate = { x: newX, @@ -618,8 +622,6 @@ L.Control.LokDialog = L.Control.extend({ }, _setupGestures: function(dialogContainer, id, canvas) { - var self = this; - var dialogID = id; var targetId = toZoomTargetId(canvas.id); var zoomTarget = $('#' + targetId).parent().get(0); var titlebar = $('#' + targetId).prev().children().get(0); @@ -661,23 +663,44 @@ L.Control.LokDialog = L.Control.extend({ if (findZoomTarget(targetId) != null) { removeZoomTarget(targetId); } - zoomTargets.push({key: targetId, value: zoomTarget, titlebar: titlebar, transformation: transformation, initialState: state, width:width, height: height}); - var hammerAll = new Hammer(zoomTarget); - hammerAll.add(new Hammer.Pan({ threshold: 20, pointers: 0 })); - hammerAll.add(new Hammer.Pinch({ threshold: 0 })).recognizeWith([hammerAll.get('pan')]); + var hammerTitlebar = new Hammer(titlebar); + hammerTitlebar.add(new Hammer.Pan({ threshold: 20, pointers: 0 })
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.LokDialog.js | 77 + 1 file changed, 36 insertions(+), 41 deletions(-) New commits: commit 9dab231984a8e511beb8b10373ad1a578bade5df Author: Szymon Kłos AuthorDate: Tue Jun 11 16:52:26 2019 +0200 Commit: Szymon Kłos CommitDate: Tue Oct 29 20:07:03 2019 +0100 Don't use jQuery Draggable class for dialogs Using Draggable interface it was possible to introduce window in the dragging state where it was impossible to exit. Use hammer.js instead. Change-Id: Ic4128db0199034bd328223881eaaeb1e7f649618 diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 54d2c0ca6..da24702d9 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -30,11 +30,13 @@ function updateTransformation(target) { } } +var draggedObject = null; + var zoomTargets = []; function findZoomTarget(id) { for (var item in zoomTargets) { - if (zoomTargets[item].key === id) { + if (zoomTargets[item].key === id || zoomTargets[item].titlebar.id === id) { return zoomTargets[item]; } } @@ -43,7 +45,7 @@ function findZoomTarget(id) { function removeZoomTarget(id) { for (var item in zoomTargets) { - if (zoomTargets[item].key === id) { + if (zoomTargets[item].key === id || zoomTargets[item].titlebar.id === id) { delete zoomTargets[item]; } } @@ -58,7 +60,7 @@ L.Control.LokDialog = L.Control.extend({ dialogIdPrefix: 'lokdialog-', onPan: function (ev) { - var id = toZoomTargetId(ev.target.id); + var id = toZoomTargetId(draggedObject.id); var target = findZoomTarget(id); if (target) { @@ -438,6 +440,7 @@ L.Control.LokDialog = L.Control.extend({ title: title ? title : '', modal: false, closeOnEscape: true, + draggable: false, resizable: false, dialogClass: dialogClass, close: function() { @@ -619,6 +622,7 @@ L.Control.LokDialog = L.Control.extend({ var dialogID = id; var targetId = toZoomTargetId(canvas.id); var zoomTarget = $('#' + targetId).parent().get(0); + var titlebar = $('#' + targetId).prev().children().get(0); var ratio = 1.0; var width = this._dialogs[id].width; @@ -658,10 +662,10 @@ L.Control.LokDialog = L.Control.extend({ removeZoomTarget(targetId); } - zoomTargets.push({key: targetId, value: zoomTarget, transformation: transformation, initialState: state, width:width, height: height}); + zoomTargets.push({key: targetId, value: zoomTarget, titlebar: titlebar, transformation: transformation, initialState: state, width:width, height: height}); - var hammerAll = new Hammer(canvas); - hammerAll.add(new Hammer.Pan({ threshold: 30, pointers: 0 })); + var hammerAll = new Hammer(zoomTarget); + hammerAll.add(new Hammer.Pan({ threshold: 20, pointers: 0 })); hammerAll.add(new Hammer.Pinch({ threshold: 0 })).recognizeWith([hammerAll.get('pan')]); hammerAll.on('panstart panmove panstop', function(ev) { @@ -669,13 +673,18 @@ L.Control.LokDialog = L.Control.extend({ }); hammerAll.on('pinchstart pinchmove', this.onPinch); hammerAll.on('hammer.input', function(ev) { + if (ev.isFirst) { + draggedObject = ev.target; + } + if (ev.isFinal) { - var id = toZoomTargetId(ev.target.id); + var id = toZoomTargetId(draggedObject.id); var target = findZoomTarget(id); if (target) { target.initialState.startX = target.transformation.translate.x; target.initialState.startY = target.transformation.translate.y; } + draggedObject = null; } }); commit fc61f42807404780109976fd01ad5a85e4f10f46 Author: Szymon Kłos AuthorDate: Mon May 20 16:55:02 2019 +0200 Commit: Szymon Kłos CommitDate: Tue Oct 29 20:06:40 2019 +0100 Constraints for dialogs moving Change-Id: I94bdaf4f220bfcc246df26ba95e86d3ae7521640 diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 33cf23001..54d2c0ca6 10064
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/core/Socket.js | 16 loleaflet/src/map/Map.js |7 ++- 2 files changed, 22 insertions(+), 1 deletion(-) New commits: commit 78fc78827227b783c6e302dcfbc5f9c3b1fca1df Author: Tamás Zolnai AuthorDate: Thu Aug 29 15:52:17 2019 +0200 Commit: Michael Meeks CommitDate: Fri Oct 25 17:11:13 2019 +0100 Dialog: can't get back to it after clicking into the URL bar Change-Id: Ibc4951f256245eddb56eb2c28026906515535c08 diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 09e7cbd98..b4fc79082 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -1362,7 +1362,12 @@ L.Map = L.Evented.extend({ // Our browser tab got focus. _onGotFocus: function () { - this._onEditorGotFocus(); + if (this._activeDialog === null) { + this._onEditorGotFocus(); + } else { + this._activeDialog.focus(); + } + this._activate(); }, commit a6bf52f4a2b898b76bb9030a6eb153b81a572598 Author: Tamás Zolnai AuthorDate: Fri Jul 26 14:03:52 2019 +0200 Commit: Michael Meeks CommitDate: Fri Oct 25 17:10:48 2019 +0100 viewInfo: Fix missing user avatars by the first load of a document We need to add a delay to the processing of viewinfo message to make sure it is processed by the _docLayer. See also this commit: b0317d0ff461100ce9f0ba805cb18e5d829947e2 The above commit adds a delay to the status message processing which is a dependency of handling the viewinfo correctly, so I added a similar delay here too. diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index fcc62e83b..94454b82d 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -794,6 +794,10 @@ L.Socket = L.Class.extend({ return; } } + else if (textMsg.startsWith('viewinfo:')) { + this._onViewInfoMsg(textMsg); + return; + } if (this._map._docLayer) { this._map._docLayer._onMessage(textMsg, img); @@ -900,6 +904,18 @@ L.Socket = L.Class.extend({ } }, + _onViewInfoMsg: function(textMsg) { + if (this._map._docLayer) { + this._map._docLayer._onMessage(textMsg); + } + else { + var that = this; + setTimeout(function() { + that._onViewInfoMsg(textMsg); + }, 100); + } + }, + _onSocketError: function () { console.debug('_onSocketError:'); this._map.hideBusy(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js |5 +++-- loleaflet/src/control/Control.Menubar.js |1 + 2 files changed, 4 insertions(+), 2 deletions(-) New commits: commit c99f5334fda4ff5b5b4a2ace8c97b6999d5d314d Author: Szymon Kłos AuthorDate: Thu Oct 17 14:02:26 2019 +0200 Commit: Szymon Kłos CommitDate: Thu Oct 17 14:02:26 2019 +0200 jsdialogs: insert table default values and close menu Change-Id: I255f50121b67d72df70a54c690c9d4d8cbbbe872 diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index e542cd98a..a4ed49168 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -717,8 +717,8 @@ L.Control.JSDialogBuilder = L.Control.extend({ var content = L.DomUtil.create('div', 'inserttablecontrols'); - var rowsData = { min: 0, id: 'rows', label: _('Rows') }; - var colsData = { min: 0, id: 'cols', label: _('Columns') }; + var rowsData = { min: 0, id: 'rows', text: '2', label: _('Rows') }; + var colsData = { min: 0, id: 'cols', text: '2', label: _('Columns') }; builder._spinfieldControl(content, rowsData, builder, function() { }); builder._spinfieldControl(content, colsData, builder, function() { }); @@ -727,6 +727,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ var rowsCount = parseInt($('#rows > input.spinfield').get(0).value); var colsCount = parseInt($('#cols > input.spinfield').get(0).value); builder.map.sendUnoCommand('.uno:InsertTable?Columns=' + colsCount + '&Rows=' + rowsCount); + builder.map.fire('closemobilewizard'); }); builder._explorableMenu(parentContainer, title, data.children, builder, content); commit 5a9326bc8a3939eccb5a85caaa19fc1e7a502181 Author: Szymon Kłos AuthorDate: Thu Oct 17 13:59:40 2019 +0200 Commit: Szymon Kłos CommitDate: Thu Oct 17 13:59:40 2019 +0200 jsdialogs: insert table also in impress Change-Id: Ic54d289ca4fcd0f9b5e5183e9b64786fce2d88c3 diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 6375fed20..a5fd375db 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -284,6 +284,7 @@ L.Control.Menubar = L.Control.extend({ {name: _UNO('.uno:InsertGraphic', 'presentation'), id: 'insertgraphicremote', type: 'action'}, {name: _UNO('.uno:InsertAnnotation', 'presentation'), id: 'insertcomment', type: 'action'}, {uno: '.uno:InsertObjectChart', mobile: false}, + {id: 'inserttable', type: 'action', name: _('Insert table'), desktop: false, tablet: false}, {type: 'separator'}, {name: _UNO('.uno:HyperlinkDialog'), id: 'inserthyperlink', type: 'action'}, {type: 'separator'}, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Menubar.js | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) New commits: commit 056b6dde021ba63c70f21465bb1d31a1335ce973 Author: Tamás Zolnai AuthorDate: Wed Oct 16 19:32:50 2019 +0200 Commit: Tamás Zolnai CommitDate: Wed Oct 16 19:46:00 2019 +0200 mobile-menu: calc: Move alone items upper with one level. Change-Id: Ib96557f7f3c22729115fac7e1ce6d5e5e2b420df diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index a423b5ef3..f6ff65ea0 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -569,9 +569,6 @@ L.Control.Menubar = L.Control.extend({ {type: 'separator'}, {uno: '.uno:SearchDialog'} ]}, - {name: _UNO('.uno:ViewMenu', 'spreadsheet'), id: 'view', type: 'menu', menu: [ - {name: _UNO('.uno:FullScreen', 'spreadsheet'), id: 'fullscreen', type: 'action', mobileapp: false}, - ]}, {name: _UNO('.uno:SheetMenu', 'spreadsheet'), type: 'menu', menu: [ {name: _UNO('.uno:InsertRowsMenu', 'spreadsheet'), type: 'menu', menu: [ {uno: '.uno:InsertRowsBefore'}, @@ -605,6 +602,7 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:HideDetail'}, {uno: '.uno:ShowDetail'}]} ]}, + {name: _UNO('.uno:FullScreen', 'spreadsheet'), id: 'fullscreen', type: 'action', mobileapp: false}, {name: _('About'), id: 'about', type: 'action'}, ], commit 7fc68b7a87881eeab0c142d8caa52db6e36a5359 Author: Tamás Zolnai AuthorDate: Wed Oct 16 19:22:52 2019 +0200 Commit: Tamás Zolnai CommitDate: Wed Oct 16 19:46:00 2019 +0200 mobile-menu: impress/calc: Move 'Download as' menu upper with one level. Change-Id: Id3f49c05498c8fdf2408056195edc2a02f7f1118 diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 7f550b041..a423b5ef3 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -504,11 +504,12 @@ L.Control.Menubar = L.Control.extend({ {name: _('Share...'), id:'shareas', type: 'action'}, {name: _UNO('.uno:Print', 'presentation'), id: 'print', type: 'action'}, {name: _('See revision history'), id: 'rev-history', type: 'action'}, - {name: !window.ThisIsAMobileApp ? _('Download as') : _('Export as'), id: 'downloadas', type: 'menu', menu: [ - {name: _('PDF Document (.pdf)'), id: 'downloadas-pdf', type: 'action'}, - {name: _('ODF presentation (.odp)'), id: 'downloadas-odp', type: 'action'}, - {name: _('PowerPoint 2003 Presentation (.ppt)'), id: 'downloadas-ppt', type: 'action'}, - {name: _('PowerPoint Presentation (.pptx)'), id: 'downloadas-pptx', type: 'action'}]}, + ]}, + {name: !window.ThisIsAMobileApp ? _('Download as') : _('Export as'), id:'downloadas', type: 'menu', menu: [ + {name: _('PDF Document (.pdf)'), id: 'downloadas-pdf', type: 'action'}, + {name: _('ODF spreadsheet (.ods)'), id: 'downloadas-ods', type: 'action'}, + {name: _('Excel 2003 Spreadsheet (.xls)'), id: 'downloadas-xls', type: 'action'}, + {name: _('Excel Spreadsheet (.xlsx)'), id: 'downloadas-xlsx', type: 'action'} ]}, {name: _UNO('.uno:EditMenu', 'presentation'), type: 'menu', menu: [ {uno: '.uno:Undo'}, @@ -549,11 +550,12 @@ L.Control.Menubar = L.Control.extend({ {name: _('Share...'), id:'shareas', type: 'action'}, {name: _UNO('.uno:Print', 'spreadsheet'), id: 'print', type: 'action'}, {name: _('See revision history'), id: 'rev-history', type: 'action'}, - {name: !window.ThisIsAMobileApp ? _('Download as') : _('Export as'), id:'downloadas', type: 'menu', menu: [ - {name: _('PDF Document (.pdf)'), id: 'downloadas-pdf', type: 'action'}, - {name: _('ODF spreadsheet (.ods)'), id: 'downloadas-ods', type: 'action'}, - {name: _('Excel 2003 Spreadsheet (.xls)'), id: 'downloadas-xls', type
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 61 +++ loleaflet/src/control/Control.Menubar.js |1 2 files changed, 53 insertions(+), 9 deletions(-) New commits: commit c79f95ba1d103eed49d0eff68594ba24a22632d3 Author: Szymon Kłos AuthorDate: Wed Oct 16 18:18:37 2019 +0200 Commit: Szymon Kłos CommitDate: Wed Oct 16 18:18:44 2019 +0200 Add insert table sub menu Change-Id: Ic524272a1ea48f04d1e959a6d71bed210c365a80 diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 08ae354a9..d3a88f055 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -213,7 +213,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ } }, - _explorableMenu: function(parentContainer, title, children, builder) { + _explorableMenu: function(parentContainer, title, children, builder, customContent) { var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' mobile-wizard ui-widget', parentContainer); $(sectionTitle).css('justify-content', 'space-between'); @@ -225,11 +225,15 @@ L.Control.JSDialogBuilder = L.Control.extend({ var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' mobile-wizard', parentContainer); contentDiv.title = title; - builder._currentDepth++; - for (var i = 0; i < children.length; i++) { - builder.build(contentDiv, [children[i]]); + if (customContent) { + contentDiv.appendChild(customContent); + } else { + builder._currentDepth++; + for (var i = 0; i < children.length; i++) { + builder.build(contentDiv, [children[i]]); + } + builder._currentDepth--; } - builder._currentDepth--; $(contentDiv).hide(); if (builder.wizard) { @@ -380,7 +384,12 @@ L.Control.JSDialogBuilder = L.Control.extend({ return unit; }, - _spinfieldControl: function(parentContainer, data, builder) { + _spinfieldControl: function(parentContainer, data, builder, customCallback) { + if (data.label) { + var fixedTextData = { text: data.label }; + builder._fixedtextControl(parentContainer, fixedTextData, builder); + } + var div = L.DomUtil.create('div', 'spinfieldcontainer', parentContainer); div.id = data.id; @@ -417,7 +426,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ $(spinfield).attr('value', builder._cleanValueFromUnits(data.children[0].text)); spinfield.addEventListener('change', function() { - builder.callback('spinfield', 'change', spinfield, this.value, builder); + if (customCallback) + customCallback(); + else + builder.callback('spinfield', 'change', spinfield, this.value, builder); }); if (data.hidden) @@ -444,7 +456,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _pushbuttonControl: function(parentContainer, data, builder) { + _pushbuttonControl: function(parentContainer, data, builder, customCallback) { var pushbutton = L.DomUtil.create('button', '', parentContainer); pushbutton.innerHTML = builder._cleanText(data.text); pushbutton.id = data.id; @@ -453,7 +465,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ $(pushbutton).attr('disabled', 'disabled'); $(pushbutton).click(function () { - builder.callback('pushbutton', 'click', pushbutton, data.command, builder); + if (customCallback) + customCallback(); + else + builder.callback('pushbutton', 'click', pushbutton, data.command, builder); }); if (data.hidden) @@ -694,7 +709,18 @@ L.Control.JSDialogBuilder = L.Control.extend({ _insertTableMenuItem: function(parentContainer, data, builder) { var title = data.text; - builder._explorableMenu(parentContainer, title, data.children, builder); + + var content = L.DomUtil.create('div', 'inserttablecontrols'); + + var rowsData = { min: 0, id: 'rows', label: _('Rows') }; + var colsData = { min: 0, id: 'cols', label: _('Columns') }; + builder._spinfieldContro
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.MobileWizard.js | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) New commits: commit 2d3cfba22fe6a95c8ce7bc8a6e28b43b3cf0d536 Author: Tamás Zolnai AuthorDate: Mon Oct 14 15:15:36 2019 +0200 Commit: Tamás Zolnai CommitDate: Mon Oct 14 15:15:42 2019 +0200 menu-to-mobile-wizard: Fix menu panel height Change-Id: If3a453ebaa75717cc2fb9f195b56c0bf5c6ade17 diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 3b652aa6f..ac27f778a 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -155,8 +155,11 @@ L.Control.MobileWizard = L.Control.extend({ this._setTitle(this._mainTitle); if (data.id === 'menubar') { - var newHeight = $(window).height() - $('#toolbar-wrapper').height() - 2; - $('#mobile-wizard').height(newHeight); + $('#mobile-wizard').height('100%'); + if (this.map .getDocType() === 'spreadsheet') + $('#mobile-wizard').css('top', $('#spreadsheet-row-column-frame').css('top')); + else + $('#mobile-wizard').css('top', $('#document-container').css('top')); } else { $('#mobile-wizard').height('45%'); } commit 9810a905a2e9f39c235997cafadde7af64ac8d03 Author: Tamás Zolnai AuthorDate: Mon Oct 14 14:59:57 2019 +0200 Commit: Tamás Zolnai CommitDate: Mon Oct 14 15:15:42 2019 +0200 Fix title for mobile wizard Change-Id: I0c22b4a550d8cabdc72a8b7f843bb4b14caefc2b diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 828dbafeb..3b652aa6f 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -151,10 +151,8 @@ L.Control.MobileWizard = L.Control.extend({ L.control.jsDialogBuilder({mobileWizard: this, map: this.map}).build(this.content.get(0), [data]); - if (data.id === 'insert') { - this._mainTitle = data.text ? data.text : ''; - this._setTitle(this._mainTitle); - } + this._mainTitle = data.text ? data.text : ''; + this._setTitle(this._mainTitle); if (data.id === 'menubar') { var newHeight = $(window).height() - $('#toolbar-wrapper').height() - 2; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.LokDialog.js|2 +- loleaflet/src/control/Control.MobileWizard.js |7 +++ loleaflet/src/layer/tile/TileLayer.js |2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) New commits: commit 4ca6a57ca5c588cc919c462bd569aaf6cef30d12 Author: Szymon Kłos AuthorDate: Thu Oct 10 16:57:27 2019 +0200 Commit: Szymon Kłos CommitDate: Thu Oct 10 17:51:11 2019 +0200 jsdialog: close after click on document and uncheck toolbar item Change-Id: I8e427fa9697132add9bd0b9e5c06970ab7e9f850 diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 6cbb4e68e..b3600cdc6 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -51,6 +51,13 @@ L.Control.MobileWizard = L.Control.extend({ $('#mobile-wizard-content').empty(); $('#toolbar-down').show(); this._isActive = false; + if (window.mobileWizard === true) { + var toolbar = w2ui['actionbar']; + if (toolbar && toolbar.get('mobile_wizard').checked) + toolbar.uncheck('mobile_wizard'); + this.map.sendUnoCommand('.uno:Sidebar'); + window.mobileWizard = false; + } }, _hideKeyboard: function() { diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 1609b9ed0..ec5a74c98 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -446,6 +446,7 @@ L.TileLayer = L.GridLayer.extend({ } else if (textMsg.startsWith('cellcursor:')) { this._onCellCursorMsg(textMsg); + this._closeMobileWizard(); } else if (textMsg.startsWith('celladdress:')) { this._onCellAddressMsg(textMsg); @@ -464,6 +465,7 @@ L.TileLayer = L.GridLayer.extend({ } else if (textMsg.startsWith('invalidatecursor:')) { this._onInvalidateCursorMsg(textMsg); + this._closeMobileWizard(); } else if (textMsg.startsWith('invalidatetiles:')) { var payload = textMsg.substring('invalidatetiles:'.length + 1); commit 9d98ed11c65be89954524bb7f857613b2d41a896 Author: Szymon Kłos AuthorDate: Thu Oct 10 17:30:51 2019 +0200 Commit: Szymon Kłos CommitDate: Thu Oct 10 17:51:11 2019 +0200 Be sure sidebar is not shown on mobile Change-Id: I776c87754979dbfcea66dc067f07e5474e2872aa diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 30eebeaa0..b346eb3f2 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -261,7 +261,7 @@ L.Control.LokDialog = L.Control.extend({ // When left/top are invalid, the dialog shows in the center. this._launchDialog(e.id, left, top, width, height, e.title); } else if (e.winType === 'deck') { - if (window.mobileWizard !== true) { + if (!window.mode.isMobile()) { this._launchSidebar(e.id, width, height); } } else if (e.winType === 'child') { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.MobileWizard.js |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) New commits: commit 3f710955ba04e9618ebb1eae6d438cc3e8065468 Author: Tamás Zolnai AuthorDate: Thu Oct 10 12:06:42 2019 +0200 Commit: Tamás Zolnai CommitDate: Thu Oct 10 12:06:42 2019 +0200 mobile_wizard: Simplify code We don't need to return with two children in _removeStylesPanelAndGetContent() method if we use only the first one in _addChildrenToTextPanel() method. Change-Id: I11137ce0620e86ad7d2c5ebcaba752f3171b96e0 diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 1f223..edde4ad8c 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -163,7 +163,7 @@ L.Control.MobileWizard = L.Control.extend({ for (var i = 0; i < data.children.length; i++) { if (data.children[i].type === 'panel' && data.children[i].children && data.children[i].children.length > 0 && data.children[i].children[0].id === 'SidebarStylesPanel') { - var ret = [data.children[i].children[0].children, data.children[i+1].children[0].children]; + var ret = data.children[i].children[0].children; data.children.splice(i, 2); return ret; } @@ -180,7 +180,7 @@ L.Control.MobileWizard = L.Control.extend({ _addChildrenToTextPanel: function (data, children) { if (data.id === 'SidebarTextPanel' && data.children && data.children.length > 0 && data.children[0].children && data.children[0].children.length > 0) { - data.children[0].children = children[0].concat(data.children[0].children); + data.children[0].children = children.concat(data.children[0].children); data.children[0].children[0].id = 'box42'; return 'success'; } commit 357f80205111528a0b5e08c50e6227d8ce56fa52 Author: Tamás Zolnai AuthorDate: Thu Oct 10 11:59:40 2019 +0200 Commit: Tamás Zolnai CommitDate: Thu Oct 10 12:00:13 2019 +0200 mobile-wizard: sidebar relayout: Keep the structure of the JSON as it was Extend the box under the panel when insert the styles panel's content. Also change the id to 'box42' to have it unique in the current context. Change-Id: I51a6975bd1da3b36b81e2783050910b781177c5c diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 1e7177f9c..1f223 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -178,8 +178,10 @@ L.Control.MobileWizard = L.Control.extend({ }, _addChildrenToTextPanel: function (data, children) { - if (data.id === 'SidebarTextPanel') { - data.children = children[0].concat(data.children); + if (data.id === 'SidebarTextPanel' && data.children && data.children.length > 0 && + data.children[0].children && data.children[0].children.length > 0) { + data.children[0].children = children[0].concat(data.children[0].children); + data.children[0].children[0].id = 'box42'; return 'success'; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.MobileWizard.js | 75 +- loleaflet/src/layer/tile/TileLayer.js | 42 -- 2 files changed, 74 insertions(+), 43 deletions(-) New commits: commit e1963de90547b636e0fc37d43747bb47679f34b0 Author: Tamás Zolnai AuthorDate: Tue Oct 8 20:03:26 2019 +0200 Commit: Tamás Zolnai CommitDate: Tue Oct 8 20:03:26 2019 +0200 mobile-wizard: move sidebar layout modification code to MobileWizard.js Change-Id: Iedc1a5dc5ee021d19c1309652c86166d658d1aaa diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 04def764b..b71a8c93f 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -119,12 +119,85 @@ L.Control.MobileWizard = L.Control.extend({ this._showWizard(); this._hideKeyboard(); + // We can change the sidebar as we want here + if (!data.text) { // sidebar indicator + this._modifySidebarLayout(data); + } + L.control.jsDialogBuilder({mobileWizard: this, map: this.map}).build(this.content.get(0), [data]); this._mainTitle = data.text ? data.text : ''; this._setTitle(this._mainTitle); } - } + }, + + _modifySidebarLayout: function (data) { + this._mergeStylesAndTextPropertyPanels(data); + this._removeItems(data, ['editcontour']); + }, + + _mergeStylesAndTextPropertyPanels: function (data) { + var stylesChildren = this._removeStylesPanelAndGetContent(data); + if (stylesChildren !== null) { + this._addChildrenToTextPanel(data, stylesChildren); + } + }, + + _removeStylesPanelAndGetContent: function (data) { + if (data.children) { + for (var i = 0; i < data.children.length; i++) { + if (data.children[i].type === 'panel' && data.children[i].children && + data.children[i].children.length > 0 && data.children[i].children[0].id === 'SidebarStylesPanel') { + var ret = data.children[i].children[0].children; + data.children.splice(i, 1); + return ret; + } + + var childReturn = this._removeStylesPanelAndGetContent(data.children[i]); + if (childReturn !== null) { + return childReturn; + } + } + } + return null; + }, + + _addChildrenToTextPanel: function (data, children) { + if (data.id === 'SidebarTextPanel') { + data.children = children.concat(data.children); + return 'success'; + } + + if (data.children) { + for (var i = 0; i < data.children.length; i++) { + var childReturn = this._addChildrenToTextPanel(data.children[i], children); + if (childReturn !== null) { + return childReturn; + } + } + } + return null; + }, + + _removeItems: function (data, items) { + if (data.children) { + var childRemoved = false; + for (var i = 0; i < data.children.length; i++) { + for (var j = 0; j < items.length; j++) { + if (data.children[i].id === items[j]) { + data.children.splice(i, 1); + childRemoved = true; + continue; + } + } + if (childRemoved === true) { + i = i - 1; + } else { + this._removeItems(data.children[i], items); + } + } + } + }, }); L.control.mobileWizard = function (options) { diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 91e5ed88b..1609b9ed0 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -756,80 +756,10 @@ L.TileLayer = L.GridLayer.extend({ _onJSDialogMsg: function (textMsg) {
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 0e290aa52df9f9e12d3f848ce136bbdd9dc07661 Author: Szymon Kłos AuthorDate: Tue Oct 8 17:22:10 2019 +0200 Commit: Szymon Kłos CommitDate: Tue Oct 8 18:10:00 2019 +0200 jsdialogs: use name of tab instead of panel id Change-Id: I29ba84a746db38d1605ca4462edb720b62f12502 Reviewed-on: https://gerrit.libreoffice.org/80482 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 89d50efb0..aa13f30e3 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -191,7 +191,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ var tabsContainer = L.DomUtil.create('div', 'ui-tabs mobile-wizard ui-widget'); var contentsContainer = L.DomUtil.create('div', 'ui-tabs-content mobile-wizard ui-widget', parentContainer); - var title1 = builder._cleanText(data.children[1].children[0].id); + var title1 = builder._cleanText(data.children[1].text); var icon1 = builder._createIconPath(title1); var tab1 = L.DomUtil.create('div', 'ui-tab mobile-wizard', tabsContainer); @@ -216,7 +216,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ var tab2 = L.DomUtil.create('div', 'ui-tab mobile-wizard', tabsContainer); - var title2 = builder._cleanText(data.children[3].children[0].id); + var title2 = builder._cleanText(data.children[3].text); var icon2 = builder._createIconPath(title2); var button2 = L.DomUtil.create('img', 'ui-tab-content mobile-wizard unobutton', tab2); commit e9fdbfe07aca366a9098c4938dfa3bb050487ab9 Author: Jan Holesovsky AuthorDate: Tue Oct 8 17:12:51 2019 +0200 Commit: Szymon Kłos CommitDate: Tue Oct 8 18:09:37 2019 +0200 mobile: Use the 'text' property for the names of the panels. Depends on a core patch. Change-Id: Ic5711c8c19bf9cb6ded12b3a704248a7e27360f8 Reviewed-on: https://gerrit.libreoffice.org/80480 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index c575d3627..89d50efb0 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -179,7 +179,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ }, _panelHandler: function(parentContainer, data, builder) { - var title = data.children[0].id; + var title = data.text; var contentNode = data.children[0]; builder._explorableEntry(parentContainer, title, contentNode, builder); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Menubar.js | 57 +++ loleaflet/src/control/Control.Toolbar.js | 13 -- loleaflet/src/layer/tile/CalcTileLayer.js|2 loleaflet/src/layer/tile/ImpressTileLayer.js |4 - loleaflet/src/layer/tile/WriterTileLayer.js |4 - 5 files changed, 34 insertions(+), 46 deletions(-) New commits: commit ec85fa7550738609bfaeca04da7d019a0dcf76e8 Author: Michael Meeks AuthorDate: Tue Oct 8 11:56:47 2019 +0100 Commit: Michael Meeks CommitDate: Tue Oct 8 12:01:38 2019 +0100 mobile: disable more irrelevant items. Change-Id: I929eaa4d855a2723ee19762ff74e8501b16443f9 diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 5ebadeb57..a37a555d2 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -62,19 +62,18 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:EditStyle'} ]}, {name: _UNO('.uno:ViewMenu', 'text'), id: 'view', type: 'menu', menu: [ - {name: _UNO('.uno:FullScreen', 'text'), id: 'fullscreen', type: 'action', mobileapp: false}, + {name: _UNO('.uno:FullScreen', 'text'), id: 'fullscreen', type: 'action', mobileapp: false, mobile: false}, {type: 'separator', mobileapp: false}, - {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: _UNO('.uno:ZoomPlus', 'text'), id: 'zoomin', type: 'action', mobile: false}, + {name: _UNO('.uno:ZoomMinus', 'text'), id: 'zoomout', type: 'action', mobile: false}, + {name: _('Reset zoom'), id: 'zoomreset', type: 'action', mobile:false }, {name: _('Show Ruler'), id: 'showruler', type: 'action'}, - {type: 'separator'}, + {type: 'separator', mobile: false}, {uno: '.uno:ControlCodes'}, - {type: 'separator'}, + {type: 'separator', mobile: false}, {name: _UNO('.uno:ShowResolvedAnnotations', 'text'), id: 'showresolved', type: 'action'}, {type: 'separator'}, {uno: '.uno:Sidebar', mobile: false}, - {id: 'mobile-wizard', type: 'action', name: _('Mobile Wizard'), mobile: true, desktop: false} ] }, {name: _UNO('.uno:InsertMenu', 'text'), id: 'insert', mobile: false, type: 'menu', menu: [ @@ -284,13 +283,12 @@ L.Control.Menubar = L.Control.extend({ ]}, {name: _UNO('.uno:ViewMenu', 'presentation'), id: 'view', type: 'menu', menu: [ {name: _UNO('.uno:FullScreen', 'presentation'), id: 'fullscreen', type: 'action', mobileapp: false}, - {type: 'separator', mobileapp: false}, - {name: _UNO('.uno:ZoomPlus', 'presentation'), id: 'zoomin', type: 'action'}, - {name: _UNO('.uno:ZoomMinus', 'presentation'), id: 'zoomout', type: 'action'}, - {name: _('Reset zoom'), id: 'zoomreset', type: 'action'}, - {uno: '.uno:Sidebar'}, - {id: 'mobile-wizard', type: 'action', name: _('Mobile Wizard'), mobile: true, desktop: false}] - }, + {type: 'separator', mobileapp: false, mobile: false}, + {name: _UNO('.uno:ZoomPlus', 'presentation'), id: 'zoomin', type: 'action', mobile: false }, + {name: _UNO('.uno:ZoomMinus', 'presentation'), id: 'zoomout', type: 'action', mobile: false}, + {name: _('Reset zoom'), id: 'zoomreset', type: 'action', mobile: false}, + {uno: '.uno:Sidebar', mobile: false} + ]}, {name: _UNO('.uno:InsertMenu', 'presentation'), id: 'insert', mobile: false, type: 'menu', menu: [ {name: _('Local Image...'), id: 'insertgraphic', type: 'action'}, {name: _UNO('.uno:InsertGraphic', 'presentation'), id: 'insertgraphicremote', type: 'action'}, @@ -303,7 +301,7 @@ L.Control.Menubar = L.Control.extend({ {type: 'separator'},
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 34 --- 1 file changed, 34 deletions(-) New commits: commit afa6376aad492a6947938d18e39ba8a2196d699a Author: Szymon Kłos AuthorDate: Fri Oct 4 19:47:34 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Oct 4 21:50:01 2019 +0200 jsdialogs: layout is horizontal now, unused code Change-Id: I070385f3890e1760eefa988f019e2729aadc730b Reviewed-on: https://gerrit.libreoffice.org/80279 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 00b6be73b..1df4efcc6 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -115,39 +115,6 @@ L.Control.JSDialogBuilder = L.Control.extend({ return null; }, - _gridHandler: function(parentContainer, data, builder) { - var columns = builder._getGridColumns(data.children); - var rows = builder._getGridRows(data.children); - var index = 0; - - var table = L.DomUtil.create('table', '', parentContainer); - for (var row = 0; row < rows; row++) { - var tr = L.DomUtil.create('tr', '', table); - for (var col = 0; col < columns; col++) { - var td = L.DomUtil.create('td', '', tr); - var child = builder._getGridChild(data.children, row, col); - - if (child) { - var childObject = null; - if (child.type == 'container') - childObject = L.DomUtil.create('table', '', td); - else - childObject = td; - - builder.build(childObject, [child], data.type); - index++; - } - - if (index > data.children.length) { - console.warn('index > data.children.length'); - return false; - } - } - } - - return false; - }, - _explorableEntry: function(parentContainer, title, contentNode, builder) { var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' mobile-wizard ui-widget', parentContainer); sectionTitle.innerHTML = title; commit f70a5c5e7626d005ad09c649ab072d3a6a2da884 Author: Szymon Kłos AuthorDate: Fri Oct 4 19:46:22 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Oct 4 21:49:53 2019 +0200 jsdialogs: remove unnecesary debug printout Change-Id: Ide9ac65707a92beae287e73ba7123327d74325c1 Reviewed-on: https://gerrit.libreoffice.org/80278 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 9dd973877..00b6be73b 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -72,7 +72,6 @@ L.Control.JSDialogBuilder = L.Control.extend({ console.debug('control: \'' + objectType + '\' event: \'' + eventType + '\' state: \'' + data + '\''); if (objectType == 'toolbutton' && eventType == 'click') { - console.log(builder); builder.map.sendUnoCommand(data); } }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/marker/ProgressOverlay.js | 54 +- loleaflet/src/layer/tile/TileLayer.js |6 -- loleaflet/src/map/Map.js | 14 -- 3 files changed, 55 insertions(+), 19 deletions(-) New commits: commit 0cf416e736abfaa1d4d26674514040f2f43fc0a6 Author: Michael Meeks AuthorDate: Fri Oct 4 17:11:46 2019 +0100 Commit: Michael Meeks CommitDate: Fri Oct 4 17:12:32 2019 +0100 Spinner: accelerate the spin, and hold off showing the progress bar. Ironically the progress bar makes people think something is slow. Change-Id: I3fb85ba1a44cdb436159abe5448d71b666020c5c diff --git a/loleaflet/src/layer/marker/ProgressOverlay.js b/loleaflet/src/layer/marker/ProgressOverlay.js index 93835c583..7100243d8 100644 --- a/loleaflet/src/layer/marker/ProgressOverlay.js +++ b/loleaflet/src/layer/marker/ProgressOverlay.js @@ -6,13 +6,15 @@ L.ProgressOverlay = L.Layer.extend({ options: { - spinnerSpeed: 15 + spinnerSpeed: 30 }, initialize: function (latlng, size) { this._latlng = L.latLng(latlng); this._size = size; + this._percent = 0; this._initLayout(); + this.intervalTimer = undefined; }, onAdd: function () { @@ -67,6 +69,55 @@ L.ProgressOverlay = L.Layer.extend({ L.DomUtil.setPosition(this._container, pos); }, + shutdownTimer: function() { + if (this.intervalTimer) + clearInterval(this.intervalTimer); + this.intervalTimer = undefined; + }, + + // Show the progress bar, but only if things seem slow + delayedStart: function(map, label, bar) { + this.setLabel(label); + this.setBar(false); + this.setValue(0); + + this.shutdownTimer(); + + var self = this; + self.state = 0; + this.intervalTimer = setInterval( + function() { + self.state = self.state + 1; + switch (self.state) { + // 0.5s -> start the spinner + case 1: + if (!map.hasLayer(self)) + map.addLayer(self); + break; + // 2s -> enable the progress bar if we have one & it's low + case 4: + if (self._percent < 80) + self.setBar(bar); + break; + // 3s -> show the bar if it's not up. + case 6: + self.setBar(bar); + break; + } + if (!map.hasLayer(self)) { + map.addLayer(self); + } + }, 500 /* ms */); + }, + + // Hide ourselves if there is anything to hide + end: function(map) { + this.shutdownTimer(); + if (map.hasLayer(this)) { + map.removeLayer(this); + } + }, + setLabel: function (label) { if (this._label.innerHTML !== label) { this._label.innerHTML = label; @@ -83,6 +134,7 @@ L.ProgressOverlay = L.Layer.extend({ }, setValue: function (value) { + this._percent = value; this._bar.style.width = value + '%'; this._value.innerHTML = value + '%'; } diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 1b5b78b68..f201ed847 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -425,22 +425,12 @@ L.Map = L.Evented.extend({ this.fire('showbusy', {label: label}); return; } - - this._progressBar.setLabel(label); - this._progressBar.setBar(bar); - this._progressBar.setValue(0); - - if (!this.hasLayer(this._progressBar)) { - this.addLayer(this._progressBar); - } + this._progressBar.delayedStart(this, label, bar); }, hideBusy: function () { this.fire('hidebusy'); - - if (this.hasLayer(this._progressBar)) { - this.removeLayer(this._progressBar); - } + this._progressBar.end(this); }, setZoom: function (zoom, options) { commit b8326b9caa2f85c957eb95a310a25ba34dab9001 Author: Michael Meeks AuthorDate: Fri Oct 4
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 15 +++ 1 file changed, 15 insertions(+) New commits: commit a758eaf5a93cd72907f2ae2b7e9c680266042474 Author: Szymon Kłos AuthorDate: Fri Oct 4 12:05:08 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Oct 4 12:24:35 2019 +0200 jsdialogs: add custom controls for font name and size Change-Id: I2b54c66abf370629a2516496d53b47958bcf5a57 Reviewed-on: https://gerrit.libreoffice.org/80200 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 33927baa8..1d073d8e2 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -46,6 +46,8 @@ L.Control.JSDialogBuilder = L.Control.extend({ this._toolitemHandlers['.uno:XLineColor'] = this._colorControl; this._toolitemHandlers['.uno:SelectWidth'] = this._lineWidthControl; + this._toolitemHandlers['.uno:CharFontName'] = this._fontNameControl; + this._toolitemHandlers['.uno:FontHeight'] = this._fontHeightControl; this._currentDepth = 0; }, @@ -364,6 +366,16 @@ L.Control.JSDialogBuilder = L.Control.extend({ builder._spinfieldControl(parentContainer, data, builder); }, + _fontNameControl: function(parentContainer, data, builder) { + data.entries = [ 'Liberation Sans' ]; + builder._comboboxControl(parentContainer, data, builder); + }, + + _fontHeightControl: function(parentContainer, data, builder) { + data.entries = [ '8', '10', '11', '12', '14', '16', '24', '32', '48' ]; + builder._comboboxControl(parentContainer, data, builder); + }, + build: function(parent, data, currentType, currentIsVertival) { var currentInsertPlace = parent; var currentHorizontalRow = parent; commit 65ae51d1f32639acf8bc02c3810c5e12ad72e6fb Author: Szymon Kłos AuthorDate: Fri Oct 4 11:56:42 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Oct 4 12:24:27 2019 +0200 jsdialogs: add ids for uno buttons Change-Id: I31bc46c919e76ea329532244e38d2df2f69bc0e8 Reviewed-on: https://gerrit.libreoffice.org/80199 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 7d01dbe6d..33927baa8 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -321,6 +321,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ button.innerHTML = builder._cleanText(data.text); } + if (data.command) + button.id = data.command.substr('.uno:'.length); + $(button).click(function () { builder.callback('toolbutton', 'click', button, data.command, builder); }); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/map/Clipboard.js | 22 +++--- loleaflet/src/map/Map.js |2 ++ 2 files changed, 5 insertions(+), 19 deletions(-) New commits: commit ca3591c2c335998d40876ca844870f8eaafbfa98 Author: Michael Meeks AuthorDate: Fri Jul 19 12:32:35 2019 +0100 Commit: Michael Meeks CommitDate: Thu Oct 3 20:44:17 2019 +0100 Switch to new UI_Paste post-message. Pass the message up the chain, instead of attempting to hit the top for happier CSS protection. Change-Id: Iccefc18d4fa2799e655a9c026e51f47d9e8670f8 diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js index 05af7afe9..ea80b2469 100644 --- a/loleaflet/src/map/Clipboard.js +++ b/loleaflet/src/map/Clipboard.js @@ -580,26 +580,10 @@ L.Clipboard = L.Class.extend({ if (operation === 'paste') { try { - if (window.top.webkit && - window.top.webkit.messageHandlers && - window.top.webkit.messageHandlers.RichDocumentsMobileInterface) { - console.log('We have richdocuments !'); - window.top.webkit.messageHandlers.RichDocumentsMobileInterface.postMessage(operation); - } else - console.log('No webkit messageHandlers'); + console.warn('Asked parent for a paste event'); + this._map.fire('postMessage', {msgId: 'UI_Paste'}); } catch (error) { - console.warn('Cannot access webkit hook: ' + error); - } - - try { - if (window.top.RichDocumentsMobileInterface && - window.top.RichDocumentsMobileInterface.paste) { - console.log('We have richdocuments !'); - window.top.RichDocumentsMobileInterface.paste(); - } else - console.log('No RichDocumentsMobileInterface'); - } catch (error) { - console.warn('Cannot access RichDocumentsMobileInterface hook: ' + error); + console.warn('Failed to post-message: ' + error); } } commit 03f5aab033b9b5e9de6eb2b990968b60c736a244 Author: Michael Meeks AuthorDate: Tue Jun 18 20:47:10 2019 +0100 Commit: Michael Meeks CommitDate: Thu Oct 3 19:26:02 2019 +0100 calc: forbid keyboard zoom to anything but 100% and 200% Change-Id: I26c9297727cc6183ff6ad11b54ef9114491389bb diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 04fa1c0f8..8048889d3 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -446,6 +446,8 @@ L.Map = L.Evented.extend({ return this; } if (this._docLayer && this._docLayer._docType === 'spreadsheet') { + if (zoom != 10 && zoom != 14) // 100% or 200% + return this; // for spreadsheets, when the document is smaller than the viewing area // we want it to be glued to the row/column headers instead of being centered this._docLayer._checkSpreadSheetBounds(zoom); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.MobileWizard.js |2 ++ loleaflet/src/control/Control.Toolbar.js |2 +- 2 files changed, 3 insertions(+), 1 deletion(-) New commits: commit 5f28613c4820b359ce9f2a2a148edc7959e67cba Author: Tamás Zolnai AuthorDate: Thu Oct 3 16:00:58 2019 +0200 Commit: Tamás Zolnai CommitDate: Thu Oct 3 16:18:13 2019 +0200 mobile-wizard: Don't focus the document for mobile wizard toolbar button It's not a good idea to trigger keyboard when we try to open the mobile wizard. Change-Id: Ib1dd4daf5689695992904c98ef597ba8d9caed75 diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 00e99b4b3..c38f57045 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -122,7 +122,7 @@ function onClick(e, id, item, subItem) { } var docLayer = map._docLayer; // In the iOS app we don't want clicking on the toolbar to pop up the keyboard. - if (!window.ThisIsTheiOSApp && id !== 'zoomin' && id !== 'zoomout') { + if (!window.ThisIsTheiOSApp && id !== 'zoomin' && id !== 'zoomout' && id !== 'mobile_wizard') { map.focus(); } if (item.disabled) { commit 2d63070796e90b35e4ca3e72189c39e83915d9a1 Author: Tamás Zolnai AuthorDate: Thu Oct 3 15:49:37 2019 +0200 Commit: Tamás Zolnai CommitDate: Thu Oct 3 16:11:12 2019 +0200 mobile-wizard: Correctly close the mobile wizard by level up We need to set window.mobileWizard to false and also need to send a sidebar message to close the sidebar entirelly. Change-Id: I897e63391a2aafd8a3f38f7ddb7b5bd14bb7a1cd diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index d5df7e8c8..382868854 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -68,6 +68,8 @@ L.Control.MobileWizard = L.Control.extend({ if (this._inMainMenu) { this._hideWizard(); this._currentDepth = 0; + window.mobileWizard = false + this.map.sendUnoCommand('.uno:Sidebar'); } else { this._currentDepth--; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.MobileWizard.js | 26 ++ 1 file changed, 18 insertions(+), 8 deletions(-) New commits: commit 167deafa8440e3745b39aec05d14ae22ae7344b3 Author: Szymon Kłos AuthorDate: Wed Oct 2 12:18:35 2019 +0200 Commit: Szymon Kłos CommitDate: Wed Oct 2 12:20:21 2019 +0200 jsdialogs: refactor wizard Remember content and back button objects, created reset method Change-Id: Ib9084c37c7ded76f265f9f3d2a3340bc71455be0 Reviewed-on: https://gerrit.libreoffice.org/80019 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index dd6cfb7e0..d5df7e8c8 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -18,11 +18,19 @@ L.Control.MobileWizard = L.Control.extend({ this._setupBackButton(); }, + _reset: function() { + this._currentDepth = 0; + this._inMainMenu = true; + this.content.empty(); + this.backButton.addClass('close-button'); + }, + _setupBackButton: function() { var that = this; - var backButton = $('#mobile-wizard-back'); - backButton.click(function() { that.goLevelUp(); }); - $(backButton).addClass('close-button'); + this.content = $('#mobile-wizard-content'); + this.backButton = $('#mobile-wizard-back'); + this.backButton.click(function() { that.goLevelUp(); }); + $(this.backButton).addClass('close-button'); }, _showWizard: function() { @@ -44,7 +52,7 @@ L.Control.MobileWizard = L.Control.extend({ }, goLevelDown: function(contentToShow) { - $('#mobile-wizard-back').removeClass('close-button'); + this.backButton.removeClass('close-button'); var titles = '.ui-header.level-' + this.getCurrentLevel() + '.mobile-wizard'; @@ -74,7 +82,7 @@ L.Control.MobileWizard = L.Control.extend({ if (this._currentDepth == 0) { this._inMainMenu = true; - $('#mobile-wizard-back').addClass('close-button'); + this.backButton.addClass('close-button'); } } }, @@ -87,15 +95,12 @@ L.Control.MobileWizard = L.Control.extend({ _onMobileWizard: function(data) { if (data) { this._isActive = true; - this._currentDepth = 0; + this._reset(); this._showWizard(); this._hideKeyboard(); - var content = $('#mobile-wizard-content'); - content.empty(); - - L.control.jsDialogBuilder({mobileWizard: this, map: this.map}).build(content.get(0), [data]); + L.control.jsDialogBuilder({mobileWizard: this, map: this.map}).build(this.content.get(0), [data]); } } }); commit 69e77af393b8d252429b215c477de479d426003a Author: Szymon Kłos AuthorDate: Wed Oct 2 11:59:02 2019 +0200 Commit: Szymon Kłos CommitDate: Wed Oct 2 12:20:03 2019 +0200 jsdialogs: differentiate close and back button in wizard Change-Id: I2c00e40606576a43b36ebf39c8ea090540c79fdc Reviewed-on: https://gerrit.libreoffice.org/80018 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index c1e8a2b14..dd6cfb7e0 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -22,6 +22,7 @@ L.Control.MobileWizard = L.Control.extend({ var that = this; var backButton = $('#mobile-wizard-back'); backButton.click(function() { that.goLevelUp(); }); + $(backButton).addClass('close-button'); }, _showWizard: function() { @@ -43,6 +44,8 @@ L.Control.MobileWizard = L.Control.extend({ }, goLevelDown: function(contentToShow) { + $('#mobile-wizard-back').removeClass('close-button'); + var titles = '.ui-header.level-' + this.getCurrentLevel() + '.mobile-wizard'; $(titles).hide('slide', { direction: 'left' }, 'fast'); @@ -69,8 +72,10 @@ L.Control.MobileWizard = L.Control.extend({ $('.ui-content.level-' + this._currentDepth + '.mobile-wizard').hide('slide', { direction: 'right' }, 'fast'); $('.ui-header.level-' + this._currentDepth + '.mobile-wizard').show('slide', { direction: 'left' }, 'fast'); - if (this._currentDepth == 0) +
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Menubar.js |5 +++-- loleaflet/src/control/Control.Toolbar.js | 31 +++ 2 files changed, 22 insertions(+), 14 deletions(-) New commits: commit 8c15584b4aff126bcde01733f469ac42cf0ce3e8 Author: Szymon Kłos AuthorDate: Thu Jul 25 13:52:50 2019 +0200 Commit: Szymon Kłos CommitDate: Tue Oct 1 10:43:48 2019 +0200 Don't show join notification for only user Change-Id: Ibc3998cb9b760a4050ddecff602b494bf515cdf8 Reviewed-on: https://gerrit.libreoffice.org/79938 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 207702ba5..f840eabe1 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -2245,19 +2245,27 @@ function escapeHtml(input) { } function onAddView(e) { + var userlistItem = w2ui['actionbar'].get('userlist'); var username = escapeHtml(e.username); - $('#tb_actionbar_item_userlist') - .w2overlay({ - class: 'loleaflet-font', - html: userJoinedPopupMessage.replace('%user', username), - style: 'padding: 5px' - }); - clearTimeout(userPopupTimeout); - userPopupTimeout = setTimeout(function() { - $('#tb_actionbar_item_userlist').w2overlay(''); + var showPopup = false; + + if (userlistItem !== null) + showPopup = $(userlistItem.html).find('#userlist_table tbody tr').length > 0; + + if (showPopup) { + $('#tb_actionbar_item_userlist') + .w2overlay({ + class: 'loleaflet-font', + html: userJoinedPopupMessage.replace('%user', username), + style: 'padding: 5px' + }); clearTimeout(userPopupTimeout); - userPopupTimeout = null; - }, 3000); + userPopupTimeout = setTimeout(function() { + $('#tb_actionbar_item_userlist').w2overlay(''); + clearTimeout(userPopupTimeout); + userPopupTimeout = null; + }, 3000); + } var color = L.LOUtil.rgbToHex(map.getViewColor(e.viewId)); if (e.viewId === map._docLayer._viewId) { @@ -2270,7 +2278,6 @@ function onAddView(e) { username += ' (' + _('Readonly') + ')'; } - var userlistItem = w2ui['actionbar'].get('userlist'); if (userlistItem !== null) { var newhtml = $(userlistItem.html).find('#userlist_table tbody').append(getUserItem(e.viewId, username, e.extraInfo, color)).parent().parent()[0].outerHTML; userlistItem.html = newhtml; commit 8ddb191d5d778962575702ff326b543f187c4ca1 Author: Szymon Kłos AuthorDate: Wed Jul 24 13:37:22 2019 +0200 Commit: Szymon Kłos CommitDate: Tue Oct 1 10:43:44 2019 +0200 Fix language selection in menubar Change-Id: I990105361decf47f0794853a5588e9f3f66e9e6e Reviewed-on: https://gerrit.libreoffice.org/79937 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 84808c65e..fc0f44f1d 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -680,7 +680,7 @@ L.Control.Menubar = L.Control.extend({ var constChecked = 'lo-menu-item-checked'; if (self._map._permission === 'edit') { if (type === 'unocommand') { // enable all depending on stored commandStates - var data, lang; + var data, lang, languageAndCode; var constUno = 'uno'; var constState = 'stateChangeHandler'; var constLanguage = '.uno:LanguageStatus'; @@ -699,7 +699,8 @@ L.Control.Menubar = L.Control.extend({ } if (unoCommand.startsWith(constLanguage)) { unoCommand = constLanguage; - lang = self._map[constState].getItemValue(unoCommand); + languageAndCode = self._map[constState].getItemValue(unoCommand); + lang = languageAndCode.split(';')[0]; data = decodeURIComponent($(aItem).data(constUno)); if (data.indexOf(lang) !== -1) { $(aItem).addClass(constChecked)
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Toolbar.js | 43 ++- 1 file changed, 26 insertions(+), 17 deletions(-) New commits: commit e498d0285f9597223533f612909fd4e9a17449e0 Author: Szymon Kłos AuthorDate: Mon Sep 30 16:05:53 2019 +0200 Commit: Szymon Kłos CommitDate: Mon Sep 30 16:07:41 2019 +0200 Don't show white space under rows on mobile in readonly mode Change-Id: Ie443781210c7b44463c26fdf2017c50a57449d29 Reviewed-on: https://gerrit.libreoffice.org/79867 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index a8d470481..ec76950bc 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -2113,7 +2113,7 @@ function onUpdatePermission(e) { break; case 'spreadsheet': $('#document-container').css('bottom', '35px'); - $('#spreadsheet-row-column-frame').css('bottom', '68px'); + $('#spreadsheet-row-column-frame').css('bottom', '35px'); $('#spreadsheet-toolbar').show(); break; case 'presentation': commit d5e9a882846f78a6aaa4377571e344aec338f4f7 Author: Szymon Kłos AuthorDate: Mon Sep 30 16:03:40 2019 +0200 Commit: Szymon Kłos CommitDate: Mon Sep 30 16:07:35 2019 +0200 Avoid using uninitialized toolbars on mobile Change-Id: I5579c8efcaadfce86275f0c08c1b4f7dcb803dc4 Reviewed-on: https://gerrit.libreoffice.org/79866 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 5f98160d0..a8d470481 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -39,6 +39,9 @@ global.mode = { var nUsers, oneUser, noUser; function _updateVisibilityForToolbar(toolbar) { + if (!toolbar) + return; + var isDesktop = _inDesktopMode(); var isMobile = _inMobileMode(); var isTablet = _inTabletMode(); @@ -1358,20 +1361,24 @@ function onDocLayerInit() { switch (docType) { case 'spreadsheet': - toolbarUp.show('textalign', 'wraptext', 'breakspacing', 'insertannotation', 'conditionalformaticonset', + if (toolbarUp) { + toolbarUp.show('textalign', 'wraptext', 'breakspacing', 'insertannotation', 'conditionalformaticonset', 'numberformatcurrency', 'numberformatpercent', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'togglemergecells', 'breakmergecells', 'setborderstyle', 'sortascending', 'sortdescending', 'breaksorting', 'backgroundcolor', 'breaksidebar', 'sidebar'); - toolbarUp.remove('styles'); + toolbarUp.remove('styles'); + } - statusbar.remove('prev', 'next', 'prevnextbreak'); + if (statusbar) { + statusbar.remove('prev', 'next', 'prevnextbreak'); - statusbar.set('zoom', { - items: [ - { id: 'zoom100', text: '100%', scale: 10}, - { id: 'zoom200', text: '200%', scale: 14} - ] - }); + statusbar.set('zoom', { + items: [ + { id: 'zoom100', text: '100%', scale: 10}, + { id: 'zoom200', text: '200%', scale: 14} + ] + }); + } if (!_inMobileMode()) { statusbar.insert('left', [ @@ -1509,8 +1516,10 @@ function onDocLayerInit() { } updateUserListCount(); - toolbarUp.refresh(); - statusbar.refresh(); + if (toolbarUp) + toolbarUp.refresh(); + if (statusbar) + statusbar.refresh(); if (!window.ThisIsTheiOSApp && window.mode.isTablet()) { map.hideMenubar(); @@ -2203,8 +2212,8 @@ function getUserItem(viewId, userName, extraInfo, color) { } function updateUserListCount() { - var userlistItem = w2ui['actionbar'].get('userlist'); - if (userlistItem === null) { + var userlistItem = w2ui.actionbar && w2ui['actionbar'].get('userlist'); + if (userlistItem == null) { return; } @@ -2407,10 +2416,10 @@ function setupToolbar(e) { w2utils.unlock(w2ui['actionbar'].box); } }); - - map.on('doclayerinit', onDocLayerInit); - map.on('updateper
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 25 ++- loleaflet/src/control/Control.MobileWizard.js|3 +- 2 files changed, 26 insertions(+), 2 deletions(-) New commits: commit 962cf621a79db1bfa42498a52f8443ef0c31459f Author: Szymon Kłos AuthorDate: Thu Sep 26 15:36:24 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 17:05:41 2019 +0200 jsdialogs: show images from JSON for toolbox items Change-Id: Id388ddd742f3f3812b4f0e6040fbdc24974fea6b Reviewed-on: https://gerrit.libreoffice.org/79740 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 25bcfde1a..b2e656847 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -274,8 +274,15 @@ L.Control.JSDialogBuilder = L.Control.extend({ }, _unoToolButton: function(parentContainer, data, builder) { - var button = L.DomUtil.create('button', '', parentContainer); - button.innerHTML = builder._cleanText(data.text); + var button = null; + + if (data.image) { + button = L.DomUtil.create('img', 'ui-content unobutton', parentContainer); + button.src = data.image; + } else { + button = L.DomUtil.create('button', '', parentContainer); + button.innerHTML = builder._cleanText(data.text); + } $(button).click(function () { builder.map.sendUnoCommand(data.command); }); commit 15d26c080b26e38d2a9de9009c0c073438aa4ed1 Author: Szymon Kłos AuthorDate: Thu Sep 26 15:02:01 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 17:05:31 2019 +0200 jsdialogs: toolbox items sending UNO commands Change-Id: Id9c4c6250f2c564418164539a432759bad1727b9 Reviewed-on: https://gerrit.libreoffice.org/79739 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index a6d6d6888..25bcfde1a 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -52,7 +52,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ if (handler) handler(parentContainer, data, builder); - else + else if (data.text) { + builder._unoToolButton(parentContainer, data, builder); + } else console.warn('Unsupported toolitem type: \"' + data.command + '\"'); } @@ -271,6 +273,19 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, + _unoToolButton: function(parentContainer, data, builder) { + var button = L.DomUtil.create('button', '', parentContainer); + button.innerHTML = builder._cleanText(data.text); + $(button).click(function () { + builder.map.sendUnoCommand(data.command); + }); + + if (data.enabled == 'false') + $(button).attr('disabled', 'disabled'); + + return false; + }, + _colorControl: function(parentContainer, data) { var colorContainer = L.DomUtil.create('div', '', parentContainer); @@ -349,5 +364,6 @@ L.control.jsDialogBuilder = function (options) { var builder = new L.Control.JSDialogBuilder(options); builder._setup(); builder.wizard = options.mobileWizard; + builder.map = options.map; return builder; }; diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 0a1498e67..90f567e27 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -11,6 +11,7 @@ L.Control.MobileWizard = L.Control.extend({ _currentDepth: 0, onAdd: function (map) { + this.map = map; map.on('mobilewizard', this._onMobileWizard, this); map.on('closemobilewizard', this._hideWizard, this); @@ -64,7 +65,7 @@ L.Control.MobileWizard = L.Control.extend({ var content = $('#mobile-wizard-content'); content.empty(); - L.control.jsDialogBuilder({'mobileWizard': this}).build(content.get(0), [data]); + L.control.jsDialogBuilder({mobileWizard: this, map: this.map}).build(content.get(0), [data]); } } }); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org ht
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 21 +++-- loleaflet/src/control/Control.MobileWizard.js| 49 +-- 2 files changed, 45 insertions(+), 25 deletions(-) New commits: commit be6d05586d05db74990c3f07dc1f23fd98c01f07 Author: Szymon Kłos AuthorDate: Thu Sep 26 17:34:20 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 17:06:02 2019 +0200 jsdialogs: refactor mobile wizard Change-Id: Id6ab9a0265e8d80bce4c446ec3b9526af6f95cf8 Reviewed-on: https://gerrit.libreoffice.org/79742 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 6f19136f5..3d19a5430 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -138,22 +138,14 @@ L.Control.JSDialogBuilder = L.Control.extend({ sectionTitle.innerHTML = title; var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' mobile-wizard', parentContainer); + contentDiv.title = title; builder._currentDepth++; builder.build(contentDiv, [contentNode]); builder._currentDepth--; $(contentDiv).hide(); - $(sectionTitle).click(function() { - var titles = '.ui-header.level-' + builder.wizard._currentDepth + '.mobile-wizard'; - - $(titles).hide('slide', { direction: 'left' }, 'fast', function() {}); - $(contentDiv).show('slide', { direction: 'right' }, 'fast'); - - builder.wizard._currentDepth++; - builder.wizard._setTitle(title); - builder.wizard._inMainMenu = false; - }); + $(sectionTitle).click(function() { builder.wizard.goLevelDown(contentDiv); }); }, _frameHandler: function(parentContainer, data, builder) { diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 90f567e27..c1e8a2b14 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -21,18 +21,7 @@ L.Control.MobileWizard = L.Control.extend({ _setupBackButton: function() { var that = this; var backButton = $('#mobile-wizard-back'); - backButton.click(function() { - if (that._inMainMenu) { - that._hideWizard(); - that._currentDepth = 0; - } else { - that._currentDepth--; - $('.ui-content.level-' + that._currentDepth + '.mobile-wizard').hide('slide', { direction: 'right' }, 'fast', function() {}); - $('.ui-header.level-' + that._currentDepth + '.mobile-wizard').show('slide', { direction: 'left' }, 'fast'); - if (that._currentDepth == 0) - that._inMainMenu = true; - } - }); + backButton.click(function() { that.goLevelUp(); }); }, _showWizard: function() { @@ -49,6 +38,42 @@ L.Control.MobileWizard = L.Control.extend({ document.activeElement.blur(); }, + getCurrentLevel: function() { + return this._currentDepth; + }, + + goLevelDown: function(contentToShow) { + var titles = '.ui-header.level-' + this.getCurrentLevel() + '.mobile-wizard'; + + $(titles).hide('slide', { direction: 'left' }, 'fast'); + $(contentToShow).show('slide', { direction: 'right' }, 'fast'); + + this._currentDepth++; + this._setTitle(contentToShow.title); + this._inMainMenu = false; + }, + + goLevelUp: function() { + if (this._inMainMenu) { + this._hideWizard(); + this._currentDepth = 0; + } else { + this._currentDepth--; + + var parent = $('.ui-content.mobile-wizard:visible'); + if (this._currentDepth > 0 && parent) + this._setTitle(parent.get(0).title); + else + this._setTitle(''); + + $('.ui-content.level-' + this._currentDepth + '.mobile-wizard').hide('slide', { direction: 'right' }, 'fast'); + $('.ui-header.level-' + this._currentDepth + '.mobile-wizard').show('slide', { direction: 'left' }, 'fast'); + + if (this._currentDepth == 0) + this._inMainMenu = true; + } + }, + _setT
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 77 --- loleaflet/src/control/Control.MobileWizard.js|1 2 files changed, 71 insertions(+), 7 deletions(-) New commits: commit ea71d18825df0422fdd7c7d40839f19dc0e070bd Author: Szymon Kłos AuthorDate: Wed Sep 25 16:28:57 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 17:05:06 2019 +0200 jsdialogs: better grid handling Change-Id: I497325cb31a9d88a734eebba0046fbffb0505f25 Reviewed-on: https://gerrit.libreoffice.org/79736 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 3bc5c84ea..164f1 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -29,6 +29,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ this._controlHandlers['combobox'] = this._comboboxControl; this._controlHandlers['listbox'] = this._comboboxControl; this._controlHandlers['fixedtext'] = this._fixedtextControl; + this._controlHandlers['grid'] = this._gridHandler; this._controlHandlers['frame'] = this._frameHandler; this._controlHandlers['panel'] = this._panelHandler; this._controlHandlers['container'] = this._containerHandler; @@ -70,6 +71,66 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, + _getGridColumns: function(children) { + var columns = 0; + for (var index in children) { + if (parseInt(children[index].left) > columns) + columns = parseInt(children[index].left); + } + return columns + 1; + }, + + _getGridRows: function(children) { + var rows = 0; + for (var index in children) { + if (parseInt(children[index].top) > rows) + rows = parseInt(children[index].top); + } + return rows + 1; + }, + + _getGridChild: function(children, row, col) { + for (var index in children) { + if (parseInt(children[index].top) == row + && parseInt(children[index].left) == col) + return children[index]; + } + return null; + }, + + _gridHandler: function(parentContainer, data, builder) { + var columns = builder._getGridColumns(data.children); + var rows = builder._getGridRows(data.children); + var index = 0; + + var table = L.DomUtil.create('table', '', parentContainer); + for (var row = 0; row < rows; row++) { + var tr = L.DomUtil.create('tr', '', table); + for (var col = 0; col < columns; col++) { + var td = L.DomUtil.create('td', '', tr); + var child = builder._getGridChild(data.children, row, col); + + if (child) { + var childObject = null; + if (child.type == 'container') + childObject = L.DomUtil.create('table', '', td); + else + childObject = td; + + builder.build(childObject, [child], data.type); + index++; + } + + if (index > data.children.length) { + console.warn('index > data.children.length'); + return false; + } + } + } + + return false; + }, + _explorableEntry: function(parentContainer, title, contentNode, builder) { var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' mobile-wizard ui-widget', parentContainer); sectionTitle.innerHTML = title; @@ -171,6 +232,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ }, _comboboxControl: function(parentContainer, data, builder) { + if (!data.entries || data.entries.length == 0) + return false; + var listbox = L.DomUtil.create('select', '', parentContainer); listbox.value = builder._cleanText(data.text); @@ -219,9 +283,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - build: function(parent, data, currentIsContainer, currentIsVertival, columns) { +
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) New commits: commit d5e58749420e4cdfb02c5446f55dcd60c5f94e83 Author: Szymon Kłos AuthorDate: Thu Sep 26 14:51:50 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 17:05:22 2019 +0200 jsdialogs: apply checked property for checkbox Change-Id: Ib42247cd6e35c681dcbdcefce85788617050273f Reviewed-on: https://gerrit.libreoffice.org/79738 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 98605e992..a6d6d6888 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -180,6 +180,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ if (data.enabled == 'false') $(radiobutton).attr('disabled', 'disabled'); + if (data.checked == 'true') + $(radiobutton).attr('checked', 'checked'); + return false; }, @@ -193,6 +196,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ if (data.enabled == 'false') $(checkbox).attr('disabled', 'disabled'); + if (data.checked == 'true') + $(checkbox).attr('checked', 'checked'); + return false; }, @@ -284,8 +290,14 @@ L.Control.JSDialogBuilder = L.Control.extend({ }, _lineWidthControl: function(parentContainer, data, builder) { - // TODO: send from the core - data.children = [ { text: '0.5' } ]; + data.children = [ { text: '0.5' }, + { text: '0.8' }, + { text: '1.0' }, + { text: '1.5' }, + { text: '2.3' }, + { text: '3.0' }, + { text: '4.5' }, + { text: '6.0' } ]; builder._spinfieldControl(parentContainer, data, builder); }, commit edd26b9e854934440ff4fd947d5ac5d17a2b49d6 Author: Szymon Kłos AuthorDate: Thu Sep 26 11:32:02 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 17:05:14 2019 +0200 jsdialogs: add dummy line width control Change-Id: I02a73be820ddeaf6e6f308d05a7388d0e43a13bb Reviewed-on: https://gerrit.libreoffice.org/79737 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 164f1..98605e992 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -40,8 +40,8 @@ L.Control.JSDialogBuilder = L.Control.extend({ this._controlHandlers['toolbox'] = this._containerHandler; this._controlHandlers['toolitem'] = this._toolitemHandler; - this._toolitemHandlers['.uno:SelectWidth'] = this._ignoreHandler; this._toolitemHandlers['.uno:XLineColor'] = this._colorControl; + this._toolitemHandlers['.uno:SelectWidth'] = this._lineWidthControl; this._currentDepth = 0; }, @@ -51,7 +51,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ var handler = builder._toolitemHandlers[data.command]; if (handler) - handler(parentContainer, data, this); + handler(parentContainer, data, builder); else console.warn('Unsupported toolitem type: \"' + data.command + '\"'); } @@ -283,6 +283,12 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, + _lineWidthControl: function(parentContainer, data, builder) { + // TODO: send from the core + data.children = [ { text: '0.5' } ]; + builder._spinfieldControl(parentContainer, data, builder); + }, + build: function(parent, data, currentType, currentIsVertival) { var currentInsertPlace = parent; var currentHorizontalRow = parent; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 49 +-- 1 file changed, 45 insertions(+), 4 deletions(-) New commits: commit 0a25b8f555a31774bff89321ac0ae2d7fd829318 Author: Szymon Kłos AuthorDate: Wed Sep 25 11:57:34 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 17:04:47 2019 +0200 jsdialogs: add toolitems, color item support Change-Id: I3391196eeb3cf94e31e4ae5f2bae15ad70f5470c Reviewed-on: https://gerrit.libreoffice.org/79734 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 2d86683de..3bc5c84ea 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -4,7 +4,7 @@ * from the JSON description provided by the server. */ -/* global $ */ +/* global $ w2ui */ L.Control.JSDialogBuilder = L.Control.extend({ /* Handler is a function which takes three parameters: @@ -16,6 +16,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ * and false otherwise */ _controlHandlers: {}, + _toolitemHandlers: {}, _currentDepth: 0, @@ -35,10 +36,28 @@ L.Control.JSDialogBuilder = L.Control.extend({ this._controlHandlers['borderwindow'] = this._containerHandler; this._controlHandlers['control'] = this._containerHandler; this._controlHandlers['scrollbar'] = this._ignoreHandler; - this._controlHandlers['toolbox'] = this._ignoreHandler; + this._controlHandlers['toolbox'] = this._containerHandler; + this._controlHandlers['toolitem'] = this._toolitemHandler; + + this._toolitemHandlers['.uno:SelectWidth'] = this._ignoreHandler; + this._toolitemHandlers['.uno:XLineColor'] = this._colorControl; + this._currentDepth = 0; }, + _toolitemHandler: function(parentContainer, data, builder) { + if (data.command) { + var handler = builder._toolitemHandlers[data.command]; + + if (handler) + handler(parentContainer, data, this); + else + console.warn('Unsupported toolitem type: \"' + data.command + '\"'); + } + + return false; + }, + _cleanText: function(text) { return text.replace('~', ''); }, @@ -182,6 +201,24 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, + _colorControl: function(parentContainer, data) { + var colorContainer = L.DomUtil.create('div', '', parentContainer); + + if (data.enabled == 'false') + $(colorContainer).attr('disabled', 'disabled'); + + var toolbar = $(colorContainer); + var items = [{type: 'color', id: 'color'}]; + toolbar.w2toolbar({ + name: 'colorselector', + tooltip: 'bottom', + items: items + }); + w2ui['colorselector'].set('color', {color: '#ff0033'}); + + return false; + }, + build: function(parent, data, currentIsContainer, currentIsVertival, columns) { var currentInsertPlace = parent; var currentHorizontalRow = parent; commit c32bd0441d8b842a5c458757e5a97d0c45e8161b Author: Szymon Kłos AuthorDate: Wed Sep 25 10:42:01 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 17:04:36 2019 +0200 jsdialogs: set spinfield value Change-Id: I4ae47734b0667b7aa32e63b6cdfafa6e6355cebd Reviewed-on: https://gerrit.libreoffice.org/79733 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index c5e498a1d..2d86683de 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -116,14 +116,18 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _spinfieldControl: function(parentContainer, data, builder) { + _spinfieldControl: function(parentContainer, data) { var spinfield = L.DomUtil.create('input', '', parentContainer); spinfield.type = 'number'; - spinfield.value = builder._cleanText(data.text); if (data.enabled == 'false') $(spinfield).attr('disabled', 'disabled'); + if (data.children && data.children.length) { + // TODO: units + $(spinfield).attr('value', data.children[0].text.replace('%', '')); + } + return false; }, __
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 38 +-- 1 file changed, 22 insertions(+), 16 deletions(-) New commits: commit d3234102c77eeb29e3b87cd847b816a212600491 Author: Szymon Kłos AuthorDate: Tue Sep 24 16:08:08 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 17:04:11 2019 +0200 jsdialogs: clean ~ from labels Change-Id: Ic73aad88ef26d785c65f29d84946ebf73168c7af Reviewed-on: https://gerrit.libreoffice.org/79730 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 2331a9fc0..979ce5a20 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -39,6 +39,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ this._currentDepth = 0; }, + _cleanText: function(text) { + return text.replace('~', ''); + }, + _containerHandler: function() { return true; }, @@ -71,7 +75,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ }, _frameHandler: function(parentContainer, data, builder) { - var title = data.children[0].text; + var title = builder._cleanText(data.children[0].text); var contentNode = data.children[1]; builder._explorableEntry(parentContainer, title, contentNode, builder); @@ -88,10 +92,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _radiobuttonControl: function(parentContainer, data) { + _radiobuttonControl: function(parentContainer, data, builder) { var radiobutton = L.DomUtil.create('input', '', parentContainer); radiobutton.type = 'radiobutton'; - radiobutton.value = data.text; + radiobutton.value = builder._cleanText(data.text); if (data.enabled == 'false') $(radiobutton).attr('disabled', 'disabled'); @@ -99,11 +103,11 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _checkboxControl: function(parentContainer, data) { + _checkboxControl: function(parentContainer, data, builder) { var checkbox = L.DomUtil.createWithId('input', data.id, parentContainer); checkbox.type = 'checkbox'; var checkboxLabel = L.DomUtil.create('label', '', parentContainer); - checkboxLabel.innerHTML = data.text; + checkboxLabel.innerHTML = builder._cleanText(data.text); checkboxLabel.for = data.id; if (data.enabled == 'false') @@ -112,10 +116,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _spinfieldControl: function(parentContainer, data) { + _spinfieldControl: function(parentContainer, data, builder) { var spinfield = L.DomUtil.create('input', '', parentContainer); spinfield.type = 'number'; - spinfield.value = data.text; + spinfield.value = builder._cleanText(data.text); if (data.enabled == 'false') $(spinfield).attr('disabled', 'disabled'); @@ -123,9 +127,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _editControl: function(parentContainer, data) { + _editControl: function(parentContainer, data, builder) { var edit = L.DomUtil.create('input', '', parentContainer); - edit.value = data.text; + edit.value = builder._cleanText(data.text); if (data.enabled == 'false') $(edit).attr('disabled', 'disabled'); @@ -133,9 +137,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _pushbuttonControl: function(parentContainer, data) { + _pushbuttonControl: function(parentContainer, data, builder) { var pushbutton = L.DomUtil.create('button', '', parentContainer); - pushbutton.innerHTML = data.text; + pushbutton.innerHTML = builder._cleanText(data.text); if (data.enabled == 'false') $(pushbutton).attr('disabled', 'disabled'); @@ -143,9 +147,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _comboboxControl: function(parentContainer, data) { + _comboboxControl: function(parentContainer, data, builder) { var listbox = L.DomUtil.create('select', '', parentContainer); - listbox.value = data.text; + listbox.value = builder._cleanText(data.text); if (data.enabled == 'false') $(listbox).attr('disabled', 'disabled'); @@ -153,
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 14 ++ 1 file changed, 14 insertions(+) New commits: commit 8bfd0473ae3b706cbe1f2c67af51142f54029e95 Author: Szymon Kłos AuthorDate: Wed Sep 25 10:27:15 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 17:04:28 2019 +0200 jsdialog: current selection in listbox Change-Id: I652b196787dc9323c09681c4b4101b9474633c80 Reviewed-on: https://gerrit.libreoffice.org/79732 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 66931a071..c5e498a1d 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -154,9 +154,18 @@ L.Control.JSDialogBuilder = L.Control.extend({ if (data.enabled == 'false') $(listbox).attr('disabled', 'disabled'); + var selected = null; + if (parseInt(data.selectedCount) > 0) { + // TODO: multiselection listbox + selected = data.selectedEntries[0]; + } + for (var index in data.entries) { var option = L.DomUtil.create('option', '', listbox); option.innerHTML = data.entries[index]; + + if (selected == index) + $(option).attr('selected', 'selected'); } return false; commit b580810092e926840a66568d7f01dc696aeeb141 Author: Szymon Kłos AuthorDate: Wed Sep 25 10:18:38 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 17:04:20 2019 +0200 jsdialogs: read listbox entries Change-Id: If4bce84fdb809269facc2855491fc8e59fee99b2 Reviewed-on: https://gerrit.libreoffice.org/79731 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 979ce5a20..66931a071 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -154,6 +154,11 @@ L.Control.JSDialogBuilder = L.Control.extend({ if (data.enabled == 'false') $(listbox).attr('disabled', 'disabled'); + for (var index in data.entries) { + var option = L.DomUtil.create('option', '', listbox); + option.innerHTML = data.entries[index]; + } + return false; }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 47 --- loleaflet/src/control/Control.MobileWizard.js| 11 +++-- 2 files changed, 40 insertions(+), 18 deletions(-) New commits: commit 4117d7d0483c2bf0cb3a544b42d92c1c6dda3f44 Author: Szymon Kłos AuthorDate: Tue Sep 24 14:32:33 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 17:03:54 2019 +0200 jsdialogs: remove 'debug' styling Change-Id: Ib025c123c5023a61b75deaba27cc39248c703df0 Reviewed-on: https://gerrit.libreoffice.org/79728 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 17c81c67b..6b041a8a2 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -190,10 +190,6 @@ L.Control.JSDialogBuilder = L.Control.extend({ else childObject = currentInsertPlace; - $(childObject).css('border-style', 'solid'); - $(childObject).css('border-width', '1px'); - $(childObject).css('border-color', 'black'); - var handler = this._controlHandlers[childType]; if (handler) commit afb1be4cd2c9788ecb9b56868ef5b5a15f0d4e69 Author: Szymon Kłos AuthorDate: Tue Sep 24 14:17:19 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 17:03:45 2019 +0200 jsdialogs: multi-level menu, panel handler Change-Id: I0bfdbea299cbedb844d9479afac2c4dbca145753 Reviewed-on: https://gerrit.libreoffice.org/79727 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index ebd3e6843..17c81c67b 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -15,6 +15,8 @@ L.Control.JSDialogBuilder = L.Control.extend({ */ _controlHandlers: {}, + _currentDepth: 0, + _setup: function() { this._controlHandlers['radiobutton'] = this._radiobuttonControl; this._controlHandlers['checkbox'] = this._checkboxControl; @@ -25,12 +27,14 @@ L.Control.JSDialogBuilder = L.Control.extend({ this._controlHandlers['listbox'] = this._comboboxControl; this._controlHandlers['fixedtext'] = this._fixedtextControl; this._controlHandlers['frame'] = this._frameHandler; + this._controlHandlers['panel'] = this._panelHandler; this._controlHandlers['container'] = this._containerHandler; this._controlHandlers['window'] = this._containerHandler; this._controlHandlers['borderwindow'] = this._containerHandler; this._controlHandlers['control'] = this._containerHandler; this._controlHandlers['scrollbar'] = this._ignoreHandler; this._controlHandlers['toolbox'] = this._ignoreHandler; + this._currentDepth = 0; }, _containerHandler: function() { @@ -41,24 +45,43 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _frameHandler: function(parentContainer, data, builder) { - var titleNode = data.children[0]; - var sectionTitle = L.DomUtil.create('div', 'ui-header mobile-wizard ui-widget', parentContainer); - sectionTitle.innerHTML = titleNode.text; + _explorableEntry: function(parentContainer, title, contentNode, builder) { + var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' mobile-wizard ui-widget', parentContainer); + sectionTitle.innerHTML = title; - var contentNode = data.children[1]; - var contentDiv = L.DomUtil.create('div', 'ui-content mobile-wizard', parentContainer); + var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' mobile-wizard', parentContainer); + + builder._currentDepth++; builder.build(contentDiv, [contentNode]); + builder._currentDepth--; $(contentDiv).hide(); $(sectionTitle).click(function() { - $('.ui-header.mobile-wizard').hide('slide', { direction: 'left' }, 'fast', function() { - $(contentDiv).show('slide', { direction: 'right' }, 'fast'); - }); - builder.wizard._setTitle(titleNode.text); + var titles = '.ui-header.level-' + builder.wizard._currentDepth + '.mobile-wizard'; + + $(titles).hide('slide', { direction: 'left' }, 'fast', function() {}); + $(contentDiv).show
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Menubar.js |4 +++- loleaflet/src/unocommands.js |1 + 2 files changed, 4 insertions(+), 1 deletion(-) New commits: commit 08d7ddcb22a09583b7026e01079f6a0b3ff836e0 Author: Henry Castro AuthorDate: Wed Feb 6 17:07:16 2019 -0400 Commit: Andras Timar CommitDate: Sun Sep 22 20:21:44 2019 +0200 loleaflet: add menu item Format→Section Change-Id: Iad9150b16f56e9460a9286f29813419fc50de90c Reviewed-on: https://gerrit.libreoffice.org/67477 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index fc1af8738..05a82e229 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -187,6 +187,7 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:ParagraphDialog'}, {uno: '.uno:OutlineBullet'}, {uno: '.uno:PageDialog'}, + {uno: '.uno:EditRegion'}, {type: 'separator'}, {uno: '.uno:TransformDialog'}, {uno: '.uno:FormatLine'}, diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js index 005f666b9..4a5e4812d 100644 --- a/loleaflet/src/unocommands.js +++ b/loleaflet/src/unocommands.js @@ -68,6 +68,7 @@ var unoCommandsArray = { DuplicateSlide:{presentation:{menu:_('Duplicate ~Slide'),},}, EditHeaderAndFooter:{spreadsheet:{menu:_('~Headers and Footers...'),},}, EditMenu:{global:{menu:_('~Edit'),},}, + EditRegion:{text:{menu:_('~Sections...'),}}, EditStyle:{global:{menu:_('~Edit Style...'),},presentation:{menu:_('E~dit Style...'),},}, EntireCell:{text:{menu:_('C~ell'),},}, EntireColumn:{presentation:{menu:_('Select Column'),},text:{menu:_('~Column'),},}, commit 18c97f1fd2f58382fdb1cd06b188402f4994f3fd Author: merttumer AuthorDate: Tue Jan 29 16:33:48 2019 +0300 Commit: Andras Timar CommitDate: Sun Sep 22 20:21:44 2019 +0200 Added "Table of Contents, Index or Biblography" option to insert menu Change-Id: I6ee18c90ef2c254ca11387e5792412c21faa502b Signed-off-by: merttumer Reviewed-on: https://gerrit.libreoffice.org/67076 Reviewed-by: Michael Meeks Tested-by: Michael Meeks diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 5c49b01c3..fc1af8738 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -111,7 +111,8 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:InsertRLM'}]}, {name: _UNO('.uno:IndexesMenu', 'text'), type: 'menu', menu: [ {uno: '.uno:InsertIndexesEntry'}, - {uno: '.uno:InsertAuthoritiesEntry'}]}, + {uno: '.uno:InsertAuthoritiesEntry'}, + {uno: '.uno:InsertMultiIndex'}]}, ]}, {name: _UNO('.uno:FormatMenu', 'text'), id: 'format', type: 'menu', menu: [ {name: _UNO('.uno:FormatTextMenu', 'text'), type: 'menu', menu: [ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/tile/TileLayer.TableOverlay.js |9 -- loleaflet/src/layer/tile/TileLayer.js | 28 +++-- 2 files changed, 21 insertions(+), 16 deletions(-) New commits: commit ed8707bcfdaeb9baae057c319f7b3382abcdcd32 Author: Tomaž Vajngerl AuthorDate: Mon Aug 26 20:28:53 2019 +0900 Commit: Tomaž Vajngerl CommitDate: Tue Aug 27 01:09:21 2019 +0200 loleaflet: enable cell selection resize markers for impress table Change-Id: I77346f13e7955f265653c79a5e4a93c124f0d94e Reviewed-on: https://gerrit.libreoffice.org/78126 Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index ea0c58c7c..bbd91a889 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -2557,15 +2557,20 @@ L.TileLayer = L.GridLayer.extend({ posEnd = this._map.unproject(posEnd); this._cellResizeMarkerEnd.setLatLng(posEnd); } - if (!this._cellAutofillMarker.isDragged) { - this._map.addLayer(this._cellAutofillMarker); - var cellAutoFillMarkerPoisition = cellRectangle.getCenter(); - cellAutoFillMarkerPoisition.lat = cellRectangle.getSouth(); - cellAutoFillMarkerPoisition = this._map.project(cellAutoFillMarkerPoisition); - var sizeAutoFill = this._cellAutofillMarker._icon.getBoundingClientRect(); - cellAutoFillMarkerPoisition = cellAutoFillMarkerPoisition.subtract(new L.Point(sizeAutoFill.width / 2, sizeAutoFill.height / 2)); - cellAutoFillMarkerPoisition = this._map.unproject(cellAutoFillMarkerPoisition); - this._cellAutofillMarker.setLatLng(cellAutoFillMarkerPoisition); + if (this._cellAutoFillArea) { + if (!this._cellAutofillMarker.isDragged) { + this._map.addLayer(this._cellAutofillMarker); + var cellAutoFillMarkerPoisition = cellRectangle.getCenter(); + cellAutoFillMarkerPoisition.lat = cellRectangle.getSouth(); + cellAutoFillMarkerPoisition = this._map.project(cellAutoFillMarkerPoisition); + var sizeAutoFill = this._cellAutofillMarker._icon.getBoundingClientRect(); + cellAutoFillMarkerPoisition = cellAutoFillMarkerPoisition.subtract(new L.Point(sizeAutoFill.width / 2, sizeAutoFill.height / 2)); + cellAutoFillMarkerPoisition = this._map.unproject(cellAutoFillMarkerPoisition); + this._cellAutofillMarker.setLatLng(cellAutoFillMarkerPoisition); + } + else if (this._cellAutofillMarker) { + this._map.removeLayer(this._cellAutofillMarker); + } } } else { @@ -2577,10 +2582,7 @@ L.TileLayer = L.GridLayer.extend({ // Update text selection handlers. _onUpdateTextSelection: function () { - if (this._docType === 'spreadsheet') { - this._onUpdateCellResizeMarkers(); - return; - } + this._onUpdateCellResizeMarkers(); var startMarker, endMarker; for (var key in this._selectionHandles) { commit 45d5715e0d34fefd2c993a812d95b059f1f1963c Author: Tomaž Vajngerl AuthorDate: Mon Aug 26 17:26:41 2019 +0900 Commit: Tomaž Vajngerl CommitDate: Tue Aug 27 01:09:17 2019 +0200 send table border drag positions as offset, not absolute value Change-Id: Ie23ff9533eb258acb93a46e00f44141fc7ad12b2 Reviewed-on: https://gerrit.libreoffice.org/78110 Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl diff --git a/loleaflet/src/layer/tile/TileLayer.TableOverlay.js b/loleaflet/src/layer/tile/TileLayer.TableOverlay.js index 4ace14da0..f2d72e33e 100644 --- a/loleaflet/src/layer/tile/TileLayer.TableOverlay.js +++ b/loleaflet/src/layer/tile/TileLayer.TableOverlay.js @@ -42,6 +42,7 @@ L.TileLayer.include({ this._map.addLayer(marker); marker._type = markerType + '-' + entry.type; marker._position = parseInt(entry.position); + marker._initialPosition = marker._position; marker._min = parseInt(entry.min); marker._max = parseInt(entry.max); marker._index = parseInt(entry.index); @@ -155,7 +156,6 @@ L.TileLa
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.ContextMenu.js |7 ++- loleaflet/src/control/Control.LokDialog.js|9 + loleaflet/src/map/handler/Map.TouchGesture.js |4 3 files changed, 19 insertions(+), 1 deletion(-) New commits: commit b0b11b6e7a036b84e5271fa64c9b7ae8b55a8c93 Author: Henry Castro AuthorDate: Fri Jun 28 13:31:02 2019 -0400 Commit: Henry Castro CommitDate: Tue Aug 20 16:34:56 2019 +0200 loleaflet: mobile: ensure to close any popups in long press event Change-Id: I64d438e3667a92f16d5bc39490ba31fdd83691fb Reviewed-on: https://gerrit.libreoffice.org/77832 Reviewed-by: Henry Castro Tested-by: Henry Castro diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js index e418bfc2a..e5d954f5f 100644 --- a/loleaflet/src/map/handler/Map.TouchGesture.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -167,6 +167,8 @@ L.Map.TouchGesture = L.Handler.extend({ return; } + this._map.fire('closepopups'); + if (window.ThisIsTheiOSApp) { // console.log('==> ' + e.timeStamp); if (!this._toolbar._map && this._map._docLayer.containsSelection(latlng)) { commit 4f0c62898cb9ac909a125b81f998bf515769bb5a Author: Henry Castro AuthorDate: Mon Jun 17 14:30:08 2019 -0400 Commit: Henry Castro CommitDate: Tue Aug 20 16:34:40 2019 +0200 loeaflet: mobile: close popup dialog on tap event Change-Id: Iad64295db4d9d135b4ce1f68bb62948e7be8e92e Reviewed-on: https://gerrit.libreoffice.org/77831 Reviewed-by: Henry Castro Tested-by: Henry Castro diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index 652971f8f..4d67b67c3 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -55,12 +55,17 @@ L.Control.ContextMenu = L.Control.extend({ map.on('locontextmenu', this._onContextMenu, this); map.on('mousedown', this._onMouseDown, this); map.on('keydown', this._onKeyDown, this); + map.on('closepopups', this._onClosePopup, this); + }, + + _onClosePopup: function () { + $.contextMenu('destroy', '.leaflet-layer'); }, _onMouseDown: function(e) { this._prevMousePos = {x: e.originalEvent.pageX, y: e.originalEvent.pageY}; - $.contextMenu('destroy', '.leaflet-layer'); + this._onClosePopup(); }, _onKeyDown: function(e) { diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 391f61490..f655a79c3 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -119,6 +119,7 @@ L.Control.LokDialog = L.Control.extend({ map.on('opendialog', this._openDialog, this); map.on('docloaded', this._docLoaded, this); map.on('closepopup', this.onCloseCurrentPopUp, this); + map.on('closepopups', this._onClosePopups, this); map.on('editorgotfocus', this._onEditorGotFocus, this); L.DomEvent.on(document, 'mouseup', this.onCloseCurrentPopUp, this); }, @@ -618,6 +619,14 @@ L.Control.LokDialog = L.Control.extend({ removeZoomTarget(this._toStrId(dialogId)); }, + _onClosePopups: function() { + for (var dialog in this._dialogs) { + if (this._dialogs[dialog].isSidebar != true) { + this._onDialogClose(this._dialogs[dialog].id, true); + } + } + }, + onCloseCurrentPopUp: function() { // for title-less dialog only (context menu, pop-up) if (!this._currentId || !this._isOpen(this._currentId) || this._dialogs[this._currentId].title) diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js index 899cd6c2d..e418bfc2a 100644 --- a/loleaflet/src/map/handler/Map.TouchGesture.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -201,6 +201,8 @@ L.Map.TouchGesture = L.Handler.extend({ if (window.ThisIsTheiOSApp) this._toolbar.remove(); + + this._map.fire('closepopups'); this._map._contextMenu._onMouseDown({originalEvent: e.srcEvent}); this._map._docLayer._postMouseEvent('buttondown', mousePos.x, mousePos.y, 1, 1, 0); this._map._docLayer._postMouseEvent('buttonup', mousePos.x, mousePos.y, 1, 1, 0); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Menubar.js |2 +- loleaflet/src/control/Control.Toolbar.js |9 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) New commits: commit 232fdf5dcbc0c8f5b46a52353796f44cb34eca4b Author: Tor Lillqvist AuthorDate: Mon Aug 19 18:41:55 2019 +0300 Commit: Tor Lillqvist CommitDate: Tue Aug 20 10:54:29 2019 +0200 tdf#126972: The "file icon" button in the menubar is useless in the iOS app In "real" Online, in a WOPI environment, it does something useful. But not in the iOS app. So no need to have it at all. Change-Id: I87a6b7badcba2899f850a1e15eae591e9ed8895c Reviewed-on: https://gerrit.libreoffice.org/77742 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist (cherry picked from commit c5d6c7dd402da6987cd01f3c0759b28b3503d85c) Reviewed-on: https://gerrit.libreoffice.org/77788 diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 3a845f926..41120cfc2 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -560,7 +560,7 @@ L.Control.Menubar = L.Control.extend({ }); $('#main-menu').attr('tabindex', 0); - if (this._map._permission !== 'readonly') { + if (!window.ThisIsTheiOSApp && this._map._permission !== 'readonly') { this._createFileIcon(); } }, commit a91025e998e1835947b6bc2da5b26350c6dc886b Author: Tor Lillqvist AuthorDate: Mon Aug 19 18:35:29 2019 +0300 Commit: Tor Lillqvist CommitDate: Tue Aug 20 10:54:14 2019 +0200 tdf#126972: Don't fold the menubar in the iOS app on a tablet As the menubar is now then always visible in that case, no need to have the hamburger button in the toolbar either. Change-Id: Iec1ae28858ad994d008c294e5fa4069c5e9bc7ed Reviewed-on: https://gerrit.libreoffice.org/77740 Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist Reviewed-on: https://gerrit.libreoffice.org/77787 diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 1e302892b..29e5c2590 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -47,7 +47,10 @@ function _updateVisibilityForToolbar(toolbar) { var toHide = []; toolbar.items.forEach(function(item) { - if (((isMobile && item.mobile === false) || (isTablet && item.tablet === false) || (isDesktop && item.desktop === false) || (!window.ThisIsAMobileApp && item.mobilebrowser === false)) && !item.hidden) { + if (window.ThisIsTheiOSApp && isTablet && item.iosapptablet === false) { + toHide.push(item.id); + } + else if (((isMobile && item.mobile === false) || (isTablet && item.tablet === false) || (isDesktop && item.desktop === false) || (!window.ThisIsAMobileApp && item.mobilebrowser === false)) && !item.hidden) { toHide.push(item.id); } else if (((isMobile && item.mobile === true) || (isTablet && item.tablet === true) || (isDesktop && item.desktop === true) || (window.ThisIsAMobileApp && item.mobilebrowser === true)) && item.hidden) { @@ -822,7 +825,7 @@ function initNormalToolbar() { {type: 'spacer'}, {type: 'button', id: 'edit', img: 'edit'}, {type: 'button', id: 'fold', img: 'fold', desktop: true, mobile: false, hidden: true}, - {type: 'button', id: 'hamburger-tablet', img: 'hamburger', desktop: false, mobile: false, tablet: true, hidden: true} + {type: 'button', id: 'hamburger-tablet', img: 'hamburger', desktop: false, mobile: false, tablet: true, iosapptablet: false, hidden: true} ]; var toolbar = $('#toolbar-up'); @@ -1498,7 +1501,7 @@ function onDocLayerInit() { toolbarUp.refresh(); statusbar.refresh(); - if (window.mode.isTablet()) { + if (!window.ThisIsTheiOSApp && window.mode.isTablet()) { map.hideMenubar(); $('#document-container').addClass('tablet'); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.LokDialog.js | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) New commits: commit f8bb16d4716de4d14e4f859bd1dbb7da0947ee8b Author: Szymon Kłos AuthorDate: Wed Jun 12 10:05:13 2019 +0200 Commit: Tor Lillqvist CommitDate: Tue Aug 20 10:52:36 2019 +0200 Fix not working clicks in dialogs on mobile devices Sometimes input event was not sent and dialog was not working. Eg. spreadsheet -> menu -> Data -> Validation Change-Id: I8d864fdd73866080df5dc0b9b84e8e39054f65e3 Reviewed-on: https://gerrit.libreoffice.org/75943 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist (cherry picked from commit 03ed7b6e6f109ace1e566c15ff09cb4e5158) Reviewed-on: https://gerrit.libreoffice.org/7 Tested-by: Tor Lillqvist diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 8f3c7091c..3c29f3437 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -464,9 +464,13 @@ L.Control.LokDialog = L.Control.extend({ L.DomEvent.on(canvas, 'mousedown mouseup', function(e) { L.DomEvent.stopPropagation(e); var buttons = 0; - buttons |= e.button === this._map['mouse'].JSButtons.left ? this._map['mouse'].LOButtons.left : 0; - buttons |= e.button === this._map['mouse'].JSButtons.middle ? this._map['mouse'].LOButtons.middle : 0; - buttons |= e.button === this._map['mouse'].JSButtons.right ? this._map['mouse'].LOButtons.right : 0; + if (this._map['mouse']) { + buttons |= e.button === this._map['mouse'].JSButtons.left ? this._map['mouse'].LOButtons.left : 0; + buttons |= e.button === this._map['mouse'].JSButtons.middle ? this._map['mouse'].LOButtons.middle : 0; + buttons |= e.button === this._map['mouse'].JSButtons.right ? this._map['mouse'].LOButtons.right : 0; + } else { + buttons = 1; + } // 'mousedown' -> 'buttondown' var lokEventType = e.type.replace('mouse', 'button'); this._postWindowMouseEvent(lokEventType, id, e.offsetX, e.offsetY, 1, buttons, 0); @@ -771,9 +775,13 @@ L.Control.LokDialog = L.Control.extend({ L.DomEvent.on(canvas, 'mousedown mouseup', function(e) { var buttons = 0; - buttons |= e.button === this._map['mouse'].JSButtons.left ? this._map['mouse'].LOButtons.left : 0; - buttons |= e.button === this._map['mouse'].JSButtons.middle ? this._map['mouse'].LOButtons.middle : 0; - buttons |= e.button === this._map['mouse'].JSButtons.right ? this._map['mouse'].LOButtons.right : 0; + if (this._map['mouse']) { + buttons |= e.button === this._map['mouse'].JSButtons.left ? this._map['mouse'].LOButtons.left : 0; + buttons |= e.button === this._map['mouse'].JSButtons.middle ? this._map['mouse'].LOButtons.middle : 0; + buttons |= e.button === this._map['mouse'].JSButtons.right ? this._map['mouse'].LOButtons.right : 0; + } else { + buttons = 1; + } var lokEventType = e.type.replace('mouse', 'button'); this._postWindowMouseEvent(lokEventType, childId, e.offsetX, e.offsetY, 1, buttons, 0); }, this); commit 8c19a0adbd2d7bbe55eb17f0fc04f738db70de04 Author: Tor Lillqvist AuthorDate: Fri Jul 19 14:44:50 2019 +0300 Commit: Tor Lillqvist CommitDate: Tue Aug 20 10:52:23 2019 +0200 Guard against this._map['mouse'] being undefined This changes makes combo boxes in the iOS app work again. Unclear what the situation for normal Online on a touch device is. Change-Id: If84124d46ea015722e8079566fc04914ee2bc542 Reviewed-on: https://gerrit.libreoffice.org/75953 Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist (cherry picked from commit 9e611b9398035ddb89a0dbc68f40388c2ec5cc4e) Reviewed-on: https://gerrit.libreoffice.org/6 diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 35d7fe74c..8f3c7091c 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -750,8 +750,13 @@ L.Control.LokDialog = L.Control.extend({ this._postWindowGestureEvent(childId, 'panEnd', firstTouchPositionX, firstTouchPositionY, firstTouchPositionY - touchY); if (pr
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/vector/Path.Transform.js |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 0f5ff84b46021e136722449cf3c21aca04fa962b Author: Tor Lillqvist AuthorDate: Fri May 31 14:43:18 2019 +0300 Commit: Tor Lillqvist CommitDate: Fri May 31 14:46:11 2019 +0300 tdf#122542: In the mobile apps, keep aspect ratio when dragging corner handles I didn't have the clout to chage the behaviour for normal online. Change-Id: Icf790ceba4b6e23ade2fe1e106a740aeeb38c082 diff --git a/loleaflet/src/layer/vector/Path.Transform.js b/loleaflet/src/layer/vector/Path.Transform.js index 4899c825a..0d1d8b9e6 100644 --- a/loleaflet/src/layer/vector/Path.Transform.js +++ b/loleaflet/src/layer/vector/Path.Transform.js @@ -709,7 +709,8 @@ L.Handler.PathTransform = L.Handler.extend({ this._handleDragged = true; - if (this.options.uniformScaling) { + if ((window.ThisIsAMobileApp && (this._activeMarker.options.index % 2) == 0) || + this.options.uniformScaling) { ratioX = originPoint.distanceTo(evt.layerPoint) / this._initialDist; ratioY = ratioX; } else { commit 946cf671198f713f763a389b42509acaa6980814 Author: Tor Lillqvist AuthorDate: Fri May 31 14:01:47 2019 +0300 Commit: Tor Lillqvist CommitDate: Fri May 31 14:46:03 2019 +0300 Add an Emacs mode line to set the appropriate js-indent-level Change-Id: Ie9e554faf269b41f277236e9b74a964456a5f7f8 diff --git a/loleaflet/src/layer/vector/Path.Transform.js b/loleaflet/src/layer/vector/Path.Transform.js index 0a45e6823..4899c825a 100644 --- a/loleaflet/src/layer/vector/Path.Transform.js +++ b/loleaflet/src/layer/vector/Path.Transform.js @@ -1,3 +1,4 @@ +/* -*- js-indent-level: 8 -*- */ /** ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.LokDialog.js | 50 - 1 file changed, 29 insertions(+), 21 deletions(-) New commits: commit 17dc46dcd166698769afaa69ffa2ddcf3c46be6d Author: Szymon Kłos AuthorDate: Mon May 20 16:55:02 2019 +0200 Commit: Szymon Kłos CommitDate: Thu May 23 15:08:14 2019 +0200 Constraints for dialogs moving Change-Id: If489126659684cd99f2a153135cb2c05b9312c02 Reviewed-on: https://gerrit.libreoffice.org/72855 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 370277afb..b2502d175 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -58,9 +58,19 @@ L.Control.LokDialog = L.Control.extend({ var target = findZoomTarget(id); if (target) { + var newX = target.initialState.startX + ev.deltaX; + var newY = target.initialState.startY + ev.deltaY; + + // Don't allow to put dialog outside the view + if (window.mode.isDesktop() && + (newX < -target.width/2 || newY < -target.height/2 + || newX > window.innerWidth - target.width/2 + || newY > window.innerHeight - target.height/2)) + return; + target.transformation.translate = { - x: target.initialState.startX + ev.deltaX, - y: target.initialState.startY + ev.deltaY + x: newX, + y: newY }; updateTransformation(target); @@ -522,7 +532,7 @@ L.Control.LokDialog = L.Control.extend({ removeZoomTarget(targetId); } - zoomTargets.push({key: targetId, value: zoomTarget, transformation: transformation, initialState: state}); + zoomTargets.push({key: targetId, value: zoomTarget, transformation: transformation, initialState: state, width:width, height: height}); var hammerAll = new Hammer(canvas); hammerAll.add(new Hammer.Pan({ threshold: 0, pointers: 0 })); commit 5dc20e98d73cabecab34eeedda5648e4edb6b28d Author: Szymon Kłos AuthorDate: Mon May 20 15:31:53 2019 +0200 Commit: Szymon Kłos CommitDate: Thu May 23 15:08:06 2019 +0200 Allow to use pan gesture on desktop Change-Id: Ifbc6102407add31f63b1be0173c5c8eeb3e8e2db Reviewed-on: https://gerrit.libreoffice.org/72854 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 072ae72b5..370277afb 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -524,24 +524,22 @@ L.Control.LokDialog = L.Control.extend({ zoomTargets.push({key: targetId, value: zoomTarget, transformation: transformation, initialState: state}); - if (window.mode.isMobile() || window.mode.isTablet()) { - var hammerAll = new Hammer(canvas); - hammerAll.add(new Hammer.Pan({ threshold: 0, pointers: 0 })); - hammerAll.add(new Hammer.Pinch({ threshold: 0 })).recognizeWith([hammerAll.get('pan')]); - - hammerAll.on('panstart panmove', this.onPan); - hammerAll.on('pinchstart pinchmove', this.onPinch); - hammerAll.on('hammer.input', function(ev) { - if (ev.isFinal) { - var id = toZoomTargetId(ev.target.id); - var target = findZoomTarget(id); - if (target) { - target.initialState.startX = target.transformation.translate.x; - target.initialState.startY = target.transformation.translate.y; - } + var hammerAll = new Hammer(canvas); + hammerAll.add(new Hammer.Pan({ threshold: 0, pointers: 0 })); + hammerAll.add(new Hammer.Pinch({ threshold: 0 })).recognizeWith([hammerAll.get('pan')]); + + hammerAll.on('panstart panmove', this.onPan); + hammerAll.on('pinchstart pinchmove', this.onPinch); + hammerAll.on('hammer.input', function(ev) { + if (ev.isFinal) { + var id = toZoomTargetId(ev.target.id); + var target = findZoomTarget(id); + if (target) { + target.initialSt
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/tile/TileLayer.js| 30 + loleaflet/src/layer/vector/Path.Transform.js | 38 ++- loleaflet/src/layer/vector/SVGGroup.js |6 ++-- 3 files changed, 58 insertions(+), 16 deletions(-) New commits: commit 88e941c659ae7d4f62934e14c2278aad0547fe52 Author: Marco Cecchetti AuthorDate: Wed Apr 10 23:23:34 2019 +0200 Commit: Marco Cecchetti CommitDate: Mon May 20 10:39:40 2019 +0200 loleaflet: exploiting new selection handling properties We use the new information sent by core through the graphic selection message, for showing only the meaning handler for the current selected object. Change-Id: I20a2d59583b89701b0f61c27c469fa916eabe20a Reviewed-on: https://gerrit.libreoffice.org/70572 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 6878229a6..6028fe3ad 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -660,6 +660,9 @@ L.TileLayer = L.GridLayer.extend({ this._twipsToLatLng(bottomRightTwips, this._map.getZoom())); this._graphicSelectionAngle = (strTwips.length > 4) ? parseInt(strTwips[4]) : 0; this._isSelectionWriterGraphic = false; + this._isGraphicSelectionDraggable = true; + this._isGraphicSelectionResizable = true; + this._isGraphicSelectionRotatable = true; if (data.length > 1) { var properties = data[1].slice(0, -1).split(','); @@ -674,12 +677,21 @@ L.TileLayer = L.GridLayer.extend({ if (name === 'WriterGraphic') { this._isSelectionWriterGraphic = value; } + else if (name === 'Draggable') { + this._isGraphicSelectionDraggable = value; + } + else if (name === 'Resizable') { + this._isGraphicSelectionResizable = value; + } + else if (name === 'Rotatable') { + this._isGraphicSelectionRotatable = value; + } } } // Workaround for tdf#123874. For some reason the handling of the // shapeselectioncontent messages that we get back causes the WebKit process // to crash on iOS. - if (!window.ThisIsTheiOSApp) { + if (!window.ThisIsTheiOSApp && this._isGraphicSelectionDraggable) { this._map._socket.sendMessage('rendershapeselection mimetype=image/svg+xml'); } } @@ -2108,7 +2120,8 @@ L.TileLayer = L.GridLayer.extend({ this._graphicMarker.removeEventParent(this._map); this._graphicMarker.off('scalestart scaleend', this._onGraphicEdit, this); this._graphicMarker.off('rotatestart rotateend', this._onGraphicRotate, this); - this._graphicMarker.dragging.disable(); + if (this._graphicMarker.dragging) + this._graphicMarker.dragging.disable(); this._graphicMarker.transform.disable(); this._map.removeLayer(this._graphicMarker); } @@ -2118,7 +2131,7 @@ L.TileLayer = L.GridLayer.extend({ } this._graphicMarker = L.svgGroup(this._graphicSelection, { - draggable: true, + draggable: this._isGraphicSelectionDraggable, transform: true, stroke: false, fillOpacity: 0, @@ -2134,14 +2147,19 @@ L.TileLayer = L.GridLayer.extend({ this._graphicMarker.on('scalestart scaleend', this._onGraphicEdit, this); this._graphicMarker.on('rotatestart rotateend', this._onGraphicRotate, this); this._map.addLayer(this._graphicMarker); - this._graphicMarker.dragging.enable(); - this._graphicMarker.transform.enable({uniformScaling: !this._isGraphicAngleDivisibleBy90()}); + if (this._isGraphicSelec
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Toolbar.js |3 ++- loleaflet/src/control/Permission.js |5 - 2 files changed, 6 insertions(+), 2 deletions(-) New commits: commit 4247dad6f54c7084710937d7efd460fac265ccd2 Author: Tor Lillqvist AuthorDate: Thu Apr 25 14:16:54 2019 +0300 Commit: Tor Lillqvist CommitDate: Thu Apr 25 17:29:01 2019 +0300 tdf#124950: Don't pop up keyboard on iOS when clicking in toolbar diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 43cb889c9..287a1598d 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -115,7 +115,8 @@ function onClick(e, id, item, subItem) { throw new Error('unknown id: ' + id); } var docLayer = map._docLayer; - if (id !== 'zoomin' && id !== 'zoomout') { + // In the iOS app we don't want clicking on the toolbar to pop up the keyboard. + if (!window.ThisIsTheiOSApp && id !== 'zoomin' && id !== 'zoomout') { map.focus(); } if (item.disabled) { commit 981db95a28b6001e1fc7e236155f13eec46d346e Author: Tor Lillqvist AuthorDate: Thu Apr 25 13:47:11 2019 +0300 Commit: Tor Lillqvist CommitDate: Thu Apr 25 17:27:30 2019 +0300 tdf#124950: Don't pop up keyboard on iOS when clicking the mobile-edit-button Only when the user taps in the document, or selects some text in it, is it obvious that they want to be able to type into it. This is just one of the instances where the on-screen keyboard popped up for no good reason. diff --git a/loleaflet/src/control/Permission.js b/loleaflet/src/control/Permission.js index 37ad81a05..de4fc7e63 100644 --- a/loleaflet/src/control/Permission.js +++ b/loleaflet/src/control/Permission.js @@ -16,7 +16,10 @@ L.Map.include({ button.hide(); that._enterEditMode('edit'); that.fire('editorgotfocus'); - that.focus(); + // In the iOS app, just clicking the mobile-edit-button is + // not reason enough to pop up the on-screen keyboard. + if (!window.ThisIsTheiOSApp) + that.focus(); }); // temporarily, before the user touches the floating action button ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.ColumnHeader.js |7 +-- loleaflet/src/control/Control.Header.js | 21 - loleaflet/src/control/Control.RowHeader.js|4 +++- 3 files changed, 20 insertions(+), 12 deletions(-) New commits: commit 53a7f069ebb41b9ba2d17f56edc371a83b210703 Author: Marco Cecchetti AuthorDate: Wed Jan 23 16:38:47 2019 +0100 Commit: Marco Cecchetti CommitDate: Tue Jan 29 16:46:59 2019 +0100 calc: header corner: group level ctrls are not scaled on hidpi display Change-Id: I9b4e016a553a3c8fc2db1a7173f95f344e108256 diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js index 96539f3aa..da1a87a7b 100644 --- a/loleaflet/src/control/Control.ColumnHeader.js +++ b/loleaflet/src/control/Control.ColumnHeader.js @@ -323,11 +323,13 @@ L.Control.ColumnHeader = L.Control.Header.extend({ var ctx = this._cornerCanvasContext; var ctrlHeadSize = this._groupHeadSize; var levelSpacing = this._levelSpacing; + var scale = L.getDpiScaleFactor(); var startOrt = levelSpacing + (ctrlHeadSize + levelSpacing) * level; - var startPar = this._cornerCanvas.width - (ctrlHeadSize + (L.Control.Header.rowHeaderWidth - ctrlHeadSize) / 2); + var startPar = this._cornerCanvas.width / scale - (ctrlHeadSize + (L.Control.Header.rowHeaderWidth - ctrlHeadSize) / 2); ctx.save(); + ctx.scale(scale, scale); ctx.fillStyle = this._hoverColor; ctx.fillRect(startPar, startOrt, ctrlHeadSize, ctrlHeadSize); ctx.strokeStyle = 'black'; @@ -521,7 +523,8 @@ L.Control.ColumnHeader = L.Control.Header.extend({ return; } - var rowOutlineWidth = this._cornerCanvas.width - L.Control.Header.rowHeaderWidth - this._borderWidth; + var scale = L.getDpiScaleFactor(); + var rowOutlineWidth = this._cornerCanvas.width / scale - L.Control.Header.rowHeaderWidth - this._borderWidth; if (pos.x <= rowOutlineWidth) { // empty rectangle on the left select all this._map.sendUnoCommand('.uno:SelectAll'); diff --git a/loleaflet/src/control/Control.Header.js b/loleaflet/src/control/Control.Header.js index 268faabca..0390cf4f2 100644 --- a/loleaflet/src/control/Control.Header.js +++ b/loleaflet/src/control/Control.Header.js @@ -615,12 +615,12 @@ L.Control.Header = L.Control.extend({ ctx.fillStyle = this._borderColor; if (this._isColumn) { - var startY = this._cornerCanvas.height - (L.Control.Header.colHeaderHeight + this._borderWidth); + var startY = this._cornerCanvas.height / scale - (L.Control.Header.colHeaderHeight + this._borderWidth); if (startY > 0) ctx.fillRect(0, startY, this._cornerCanvas.width, this._borderWidth); } else { - var startX = this._cornerCanvas.width - (L.Control.Header.rowHeaderWidth + this._borderWidth); + var startX = this._cornerCanvas.width / scale - (L.Control.Header.rowHeaderWidth + this._borderWidth); if (startX > 0) ctx.fillRect(startX, 0, this._borderWidth, this._cornerCanvas.height); } diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js index 93a99081b..fa61c0516 100644 --- a/loleaflet/src/control/Control.RowHeader.js +++ b/loleaflet/src/control/Control.RowHeader.js @@ -312,11 +312,13 @@ L.Control.RowHeader = L.Control.Header.extend({ var ctx = this._cornerCanvasContext; var ctrlHeadSize = this._groupHeadSize; var levelSpacing = this._levelSpacing; + var scale = L.getDpiScaleFactor(); var startOrt = levelSpacing + (ctrlHeadSize + levelSpacing) * level; - var startPar = this._cornerCanvas.height - (ctrlHeadSize + (L.Control.Header.colHeaderHeight - ctrlHeadSize) / 2); + var startPar = this._cornerCanvas.height / scale - (ctrlHeadSize + (L.Control.Header.colHeaderHeight - ctrlHeadSize) / 2); ctx.save(); + ctx.scale(scale, scale); ctx.fillStyle = this._hoverColor; ctx.fillRect(startOrt, startPar, ctrlHeadSize, ctrlHeadSize); ctx.strokeStyle = 'black'; commit fa5c943355d648bf758b3051a51848d643341f77 Author: Marco Cecchetti AuthorDate: Wed Jan 23 16:28:00 2019 +0100 Commit: Marco Cecchetti CommitDate: Tue Jan 29 16:46:59 2019 +0100 loleaflet: calc: headers not adjusted when grouping rows or columns Change-Id: Icfe2ce0bb03de34848faf8f1bee7e1d568156ca7 dif
[Libreoffice-commits] online.git: 2 commits - loleaflet/src wsd/ClientSession.cpp
loleaflet/src/layer/tile/GridLayer.js | 49 ++ wsd/ClientSession.cpp |5 +++ 2 files changed, 31 insertions(+), 23 deletions(-) New commits: commit 9473908d45a884827356b504c5f768e2f29cc46b Author: Tamás Zolnai AuthorDate: Sun Aug 26 06:11:08 2018 +0200 Commit: Tamás Zolnai CommitDate: Sun Aug 26 06:52:21 2018 +0200 loleaflet: Request invalid tiles too by view change Change-Id: I43c65ce025d3b18bd664d2ad16107cf828bab300 diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js index dc77255e9..ca4103077 100644 --- a/loleaflet/src/layer/tile/GridLayer.js +++ b/loleaflet/src/layer/tile/GridLayer.js @@ -532,7 +532,8 @@ L.GridLayer = L.Layer.extend({ key = this._tileCoordsToKey(coords); var tile = this._tiles[key]; - if (tile) { + var invalid = tile && tile._invalidCount && tile._invalidCount > 0; + if (tile && tile.loaded && !invalid) { tile.current = true; newView = false; } else { @@ -866,34 +867,36 @@ L.GridLayer = L.Layer.extend({ key = this._tileCoordsToKey(coords); if (coords.part === this._selectedPart) { - var tile = this.createTile(this._wrapCoords(coords), L.bind(this._tileReady, this, coords)); + if (!this._tiles[key]) { + var tile = this.createTile(this._wrapCoords(coords), L.bind(this._tileReady, this, coords)); - this._initTile(tile); + this._initTile(tile); - // if createTile is defined with a second argument ("done" callback), - // we know that tile is async and will be ready later; otherwise - if (this.createTile.length < 2) { - // mark tile as ready, but delay one frame for opacity animation to happen - setTimeout(L.bind(this._tileReady, this, coords, null, tile), 0); - } + // if createTile is defined with a second argument ("done" callback), + // we know that tile is async and will be ready later; otherwise + if (this.createTile.length < 2) { + // mark tile as ready, but delay one frame for opacity animation to happen + setTimeout(L.bind(this._tileReady, this, coords, null, tile), 0); + } - // we prefer top/left over translate3d so that we don't create a HW-accelerated layer from each tile - // which is slow, and it also fixes gaps between tiles in Safari - L.DomUtil.setPosition(tile, tilePos, true); + // we prefer top/left over translate3d so that we don't create a HW-accelerated layer from each tile + // which is slow, and it also fixes gaps between tiles in Safari + L.DomUtil.setPosition(tile, tilePos, true); - // save tile in cache - this._tiles[key] = { - el: tile, - coords: coords, - current: true - }; + // save tile in cache + this._tiles[key] = { + el: tile, + coords: coords, + current: true + }; - fragment.appendChild(tile); + fragment.appendChild(tile); - this.fire('tileloadstart', { - tile: tile, - coords: coords - }); + this.fire('tileloadstart', { + tile: tile, + coords: coords + }); + } } if (this._tileCache[key]) { commit 1b01af36059623627
[Libreoffice-commits] online.git: 2 commits - loleaflet/src scripts/unocommands.py
loleaflet/src/unocommands.js | 16 +++- scripts/unocommands.py | 12 +--- 2 files changed, 20 insertions(+), 8 deletions(-) New commits: commit 3719faf5e91678cda8f470a3975a29bdcfd8dc3f Author: Andras Timar Date: Mon Jul 16 09:03:40 2018 +0200 loleaflet: remove latin access keys in parentheses (in case of CJK, Indian, etc. langs) Change-Id: I15763165535771511a4871882dd067fc689baaa3 diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js index bb2a12fef..3d877414e 100644 --- a/loleaflet/src/unocommands.js +++ b/loleaflet/src/unocommands.js @@ -87,7 +87,7 @@ var unoCommandsArray = { IncrementLevel:{text:{menu:_('Promote One Level'),},}, IncrementSubLevels:{text:{menu:_('Promote One Level With Subpoints'),},}, InsertAnnotation:{global:{context:_('Insert Comment'),menu:_('Comme~nt'),},presentation:{menu:_('Comme~nt'),},spreadsheet:{context:_('Insert Co~mment'),menu:_('Comm~ent'),},}, - InsertAuthorField:{presentation:{menu:_('~Author'),},text:{menu:_('First ~Author'),},}, + InsertAuthorField:{presentation:{menu:_('~Author'),},text:{menu:_('~Author'),},}, InsertBreakMenu:{spreadsheet:{menu:_('Insert Page ~Break'),},}, InsertColumnBreak:{spreadsheet:{menu:_('~Column Break'),},text:{menu:_('Insert Column Break'),},}, InsertColumnsAfter:{presentation:{menu:_('Insert Column Right'),},spreadsheet:{context:_('Insert Columns ~Right'),menu:_('Columns ~Right'),},text:{menu:_('Columns R~ight'),},}, @@ -105,7 +105,7 @@ var unoCommandsArray = { InsertMenu:{global:{menu:_('~Insert'),},}, InsertNeutralParagraph:{text:{menu:_('Insert Unnumbered Entry'),},}, InsertNonBreakingSpace:{global:{menu:_('~Non-breaking space'),},}, - InsertObjectChart:{global:{menu:_('~Chart...')}}, + InsertObjectChart:{global:{context:_('Insert Chart'),menu:_('~Chart...'),},}, InsertPageCountField:{text:{menu:_('Page ~Count'),},}, InsertPageFooter:{text:{menu:_('Foote~r'),},}, InsertPageHeader:{text:{menu:_('He~ader'),},}, @@ -229,14 +229,14 @@ var unoCommandsArray = { TrackChanges:{text:{menu:_('~Record'),},}, TransformDialog:{global:{menu:_('Position and Si~ze...'),},}, Underline:{global:{menu:_('Underline'),},}, - UnderlineDouble:{global:{menu:_('Double Underline'),},}, + UnderlineDouble:{presentation:{menu:_('Double Underline '),},spreadsheet:{menu:_('Underline: Double'),},text:{menu:_('Double Underline '),},}, Undo:{global:{menu:_('~Undo'),},}, Ungroup:{global:{menu:_('~Ungroup...'),},}, UpSearch:{global:{menu:_('Find Previous'),},}, UpdateCurIndex:{text:{context:_('Update index'),menu:_('Current ~Index'),},}, Validation:{spreadsheet:{menu:_('~Validity...'),},}, ViewMenu:{global:{menu:_('~View'),},}, - WordCountDialog:{text:{menu:_('~Word Count...'),},}, + WordCountDialog:{text:{menu:_('~Word Count'),},}, WrapAnchorOnly:{text:{menu:_('~First Paragraph'),},}, WrapContour:{text:{menu:_('~Contour'),},}, WrapIdeal:{text:{menu:_('~Optimal Page Wrap'),},}, @@ -277,5 +277,11 @@ window._UNO = function(string, component, isContext) { } } - return text.replace('~', ''); + // Remove access key markers from translated strings + // 1. access key in parenthesis in case of non-latin scripts + text = text.replace(/\(~[A-Za-z]\)/, ''); + // 2. remove normal access key + text = text.replace('~', ''); + + return text; } diff --git a/scripts/unocommands.py b/scripts/unocommands.py index 8acb55355..88e7ea24c 100755 --- a/scripts/unocommands.py +++ b/scripts/unocommands.py @@ -243,7 +243,13 @@ window._UNO = function(string, component, isContext) { \t\t} \t} -\treturn text.replace('~', ''); +\t// Remove access key markers from translated strings +\t// 1. access key in parenthesis in case of non-latin scripts +\ttext = text.replace(/\(~[A-Za-z]\)/, ''); +\t// 2. remove normal access key +\ttext = text.replace('~', ''); + +\treturn text; }\n''') return descriptions commit d239a3b3736b63be03b49c2fa361c5571e91759f Author: Andras Timar Date: Thu Jul 12 23:39:45 2018 +0200 adjust paths of toolbar.js and unocommands.js Change-Id: I0373f1a05d18a85d5e351fd11bf3b81c43367279 diff --git a/scripts/unocommands.py b/scripts/unocommands.py index 808887da3..8acb55355 100755 --- a/scripts/unocommands.py +++ b/scripts/unocommands.py @@ -122,7 +122,7 @@ def extractToolbarCommands(path): commands = [] # extract from the menu specifications -f = open(path + '/loleaflet/dist/toolbar/toolbar.js', 'r') +f = open(path + '/loleaflet/js/toolbar.js', 'r') for line in f: if line.find("_UNO(") >= 0: commands += commandFromMenuLine(line) @@ -201,7 +201,7 @@ def writeUnocommandsJS(onlineDir, lofficeDir, menuCommands, contextCommands, too
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.LokDialog.js | 14 ++ loleaflet/src/control/Control.Scroll.js|3 ++ loleaflet/src/layer/tile/TileLayer.js | 38 - 3 files changed, 54 insertions(+), 1 deletion(-) New commits: commit 0a2b5c19c18cf5b5d6f1117d0b8c6bcd1ccf46d2 Author: Marco Cecchetti Date: Tue Apr 3 12:36:24 2018 +0100 calc: when expanding selection with shift-, view never scrolls Change-Id: Iaea7b53a84210bcdfc180014a7d530b1455949c9 Reviewed-on: https://gerrit.libreoffice.org/52639 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 22c3bc634..06a04f5d8 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1202,15 +1202,49 @@ L.TileLayer = L.GridLayer.extend({ this._selectionTextContent = textMsg.substr(22); }, + _updateScrollOnCellSelection: function (oldSelection, newSelection) { + if (this._map._docLayer._docType === 'spreadsheet' && oldSelection) { + var mapBounds = this._map.getBounds(); + if (!mapBounds.contains(newSelection) && !newSelection.equals(oldSelection)) { + var spacingX = Math.abs(this._cellCursor.getEast() - this._cellCursor.getWest()) / 4.0; + var spacingY = Math.abs((this._cellCursor.getSouth() - this._cellCursor.getNorth())) / 2.0; + + var scrollX = 0, scrollY = 0; + if (newSelection.getEast() > mapBounds.getEast() && newSelection.getEast() > oldSelection.getEast()) + scrollX = newSelection.getEast() - mapBounds.getEast() + spacingX; + else if (newSelection.getWest() < mapBounds.getWest() && newSelection.getWest() < oldSelection.getWest()) + scrollX = newSelection.getWest() - mapBounds.getWest() - spacingX; + if (newSelection.getNorth() > mapBounds.getNorth() && newSelection.getNorth() > oldSelection.getNorth()) + scrollY = newSelection.getNorth() - mapBounds.getNorth() + spacingY; + else if (newSelection.getSouth() < mapBounds.getSouth() && newSelection.getSouth() < oldSelection.getSouth()) + scrollY = newSelection.getSouth() - mapBounds.getSouth() - spacingY; + if (scrollX !== 0 || scrollY !== 0) { + var newCenter = mapBounds.getCenter(); + newCenter.lng += scrollX; + newCenter.lat += scrollY; + var center = this._map.project(newCenter); + center = center.subtract(this._map.getSize().divideBy(2)); + center.x = Math.round(center.x < 0 ? 0 : center.x); + center.y = Math.round(center.y < 0 ? 0 : center.y); + this._map.fire('scrollto', {x: center.x, y: center.y}); + } + } + } + }, + _onTextSelectionEndMsg: function (textMsg) { var strTwips = textMsg.match(/\d+/g); if (strTwips != null && this._map._permission === 'edit') { var topLeftTwips = new L.Point(parseInt(strTwips[0]), parseInt(strTwips[1])); var offset = new L.Point(parseInt(strTwips[2]), parseInt(strTwips[3])); var bottomRightTwips = topLeftTwips.add(offset); + + var oldSelection = this._textSelectionEnd; this._textSelectionEnd = new L.LatLngBounds( this._twipsToLatLng(topLeftTwips, this._map.getZoom()), this._twipsToLatLng(bottomRightTwips, this._map.getZoom())); + + this._updateScrollOnCellSelection(oldSelection, this._textSelectionEnd); } else { this._textSelectionEnd = null; @@ -1223,14 +1257,16 @@ L.TileLayer = L.GridLayer.extend({ var topLeftTwips = new L.Point(parseInt(strTwips[0]), parseInt(strTwips[1])); var offset = new L.Point(parseInt(strTwips[2]), parseInt(strTwips[3])); var bottomRightTwips = topLeftTwips.add(offset); + var oldSelection = this._textSelectionStart; this._textSelectionStart = new L.LatLngBounds( this._twipsToLatLng(topLeftTwi
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/core/LOUtil.js |7 +++ loleaflet/src/core/Socket.js | 34 -- loleaflet/src/map/Map.js |8 +++- 3 files changed, 42 insertions(+), 7 deletions(-) New commits: commit 7b16ab5f94083e688d623c085452727616cd Author: Pranav Kant Date: Fri Mar 30 19:26:55 2018 +0530 Ask to save unsaved changes to a new file ... when document is changed externally. Change-Id: Ieaad5f0ed5cd4ee3bf5385f2a5cd297b7758a43e diff --git a/loleaflet/src/core/LOUtil.js b/loleaflet/src/core/LOUtil.js index 286f2fa4e..fad8ad527 100644 --- a/loleaflet/src/core/LOUtil.js +++ b/loleaflet/src/core/LOUtil.js @@ -78,5 +78,12 @@ L.LOUtil = { } } return rectangles; + }, + + /// oldFileName = Example.odt, suffix = new + /// returns: Example_new.odt + generateNewFileName: function(oldFileName, suffix) { + var idx = oldFileName.lastIndexOf('.'); + return oldFileName.substring(0, idx) + suffix + oldFileName.substring(idx); } }; diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index e45ba55ac..9604131f3 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -435,21 +435,41 @@ L.Socket = L.Class.extend({ vex.close(id); } - vex.dialog.confirm({ - message: _('Document has been changed in storage. Do you want to discard your changes, and load the document from the storage?'), + vex.dialog.open({ + message: _('Document has been changed in storage. What would you like to do with your unsaved changes?'), escapeButtonCloses: false, overlayClosesOnClick: false, + contentCSS: { width: '700px' }, buttons: [ - $.extend({}, vex.dialog.buttons.YES, { text: _('Discard changes') }), - $.extend({}, vex.dialog.buttons.NO, { text: _('Overwrite document') }) + $.extend({}, vex.dialog.buttons.YES, { text: _('Discard'), + click: function($vexContent) { + $vexContent.data().vex.value = 'discard'; + vex.close($vexContent.data().vex.id); + }}), + $.extend({}, vex.dialog.buttons.YES, { text: _('Overwrite'), + click: function($vexContent) { + $vexContent.data().vex.value = 'overwrite'; + vex.close($vexContent.data().vex.id); + }}), + $.extend({}, vex.dialog.buttons.YES, { text: _('Save to new file'), + click: function($vexContent) { + $vexContent.data().vex.value = 'saveas'; + vex.close($vexContent.data().vex.id); + }}) ], callback: L.bind(function(value) { - if (value) { + if (value === 'discard') { // They want to refresh the page and load document again for all this.sendMessage('closedocument'); - } else { + } else if (value === 'overwrite') { // They want to overwrite this.sendMessage('savetostorage force=1'); + } else if (value === 'saveas') { +
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Header.js | 18 -- loleaflet/src/layer/tile/CalcTileLayer.js |6 -- 2 files changed, 4 insertions(+), 20 deletions(-) New commits: commit 62021b4f7642b1e264fd90f06ffcfa4b81bf92d2 Author: Marco Cecchetti Date: Mon Dec 18 21:55:46 2017 +0100 loleaflet: calc: removed unused function Change-Id: I0dc6b7b60ab1af2e6d77ac8b8a79fc6ad56f68b8 Reviewed-on: https://gerrit.libreoffice.org/46745 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/loleaflet/src/control/Control.Header.js b/loleaflet/src/control/Control.Header.js index 8593052d..ad8edec3 100644 --- a/loleaflet/src/control/Control.Header.js +++ b/loleaflet/src/control/Control.Header.js @@ -503,24 +503,6 @@ L.Control.Header = L.Control.extend({ } }, - _getGroupLevelHeader: function (pos) { - if (!this._groups) - return; - - var levels = this._groups.length + 1; - var size = this._levelSpacing + this._groupHeadSize; - - var level = (pos + 1) / size | 0; - var relPos = pos % size; - - if (level < this._groups.length && relPos > this._levelSpacing) { - return level; - } - else { - return -1; - } - }, - _computeOutlineWidth: function () { return this._levelSpacing + (this._groupHeadSize + this._levelSpacing) * (this._groups.length + 1); }, commit ba20cd134136a101960552f9432fb3f5969868cd Author: Marco Cecchetti Date: Mon Dec 18 21:50:37 2017 +0100 loleaflet: calc: wrong data in firing of updaterowcolumnheaders event two fixes: - wrong data in firing of updaterowcolumnheaders event (messing up pg-up/pg-down) - console error message about invocation of a method for an undefined object (annotation.mark) Change-Id: I4e7d9de38ffe18b477c99147966fd91d7a460841 Reviewed-on: https://gerrit.libreoffice.org/46744 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index c628bfb8..d0296b15 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -211,7 +211,7 @@ L.CalcTileLayer = L.TileLayer.extend({ this._map.fire('updaterowcolumnheaders', {x: 0, y: this._map._getTopLeftPoint().y, offset: {x: 0, y: undefined}}); this._map._socket.sendMessage('commandvalues command=.uno:ViewAnnotationsPosition'); } else if (textMsg.startsWith('invalidateheader: all')) { - this._map.fire('updaterowcolumnheaders', {x: this._map._getTopLeftPoint().x, y: this._map._getTopLeftPoint(), offset: {x: undefined, y: undefined}}); + this._map.fire('updaterowcolumnheaders', {x: this._map._getTopLeftPoint().x, y: this._map._getTopLeftPoint().y, offset: {x: undefined, y: undefined}}); this._map._socket.sendMessage('commandvalues command=.uno:ViewAnnotationsPosition'); } else { L.TileLayer.prototype._onMessage.call(this, textMsg, img); @@ -469,7 +469,9 @@ L.CalcTileLayer = L.TileLayer.extend({ var annotation = this._annotations[comment.tab][comment.id]; if (annotation) { annotation.setLatLngBounds(comment.cellPos); - annotation.mark.setLatLng(comment.cellPos.getNorthEast()); + if (annotation.mark) { + annotation.mark.setLatLng(comment.cellPos.getNorthEast()); + } } } this.showAnnotations(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Menubar.js | 47 --- 1 file changed, 25 insertions(+), 22 deletions(-) New commits: commit 13144cbc8f0c543e51ee7e53b5fd7f750390d241 Author: Pranav Kant Date: Wed Dec 6 17:03:55 2017 +0530 Add elipsis to dialogs in menubar And change 'Spelling & Grammar' to 'Spelling...' to match with latest desktop UI names. Change-Id: I51000e93c7dd6e60d31b11b731d9d5427fea271b diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 51aeacf5..c4ef8b41 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -35,7 +35,7 @@ L.Control.Menubar = L.Control.extend({ {name: _('Paste'), type: 'unocommand', uno: '.uno:Paste'}, {name: _('Select all'), type: 'unocommand', uno: '.uno:SelectAll'}, {type: 'separator'}, - {name: _('Find & Replace'), id: '.uno:SearchDialog', type: 'dialog'}, + {name: _('Find & Replace...'), id: '.uno:SearchDialog', type: 'dialog'}, {type: 'separator'}, {name: _('Track Changes'), type: 'menu', menu: [ {name: _('Record'), type: 'unocommand', uno: '.uno:TrackChanges'}, @@ -69,7 +69,7 @@ L.Control.Menubar = L.Control.extend({ {name: _('Page break'), type: 'unocommand', uno: '.uno:InsertPageBreak'}, {name: _('Column break'), type: 'unocommand', uno: '.uno:InsertColumnBreak'}, {type: 'separator'}, - {name: _('Hyperlink'), id: '.uno:HyperlinkDialog', type: 'dialog'}, + {name: _('Hyperlink...'), id: '.uno:HyperlinkDialog', type: 'dialog'}, {name: _('Special character...'), id: 'specialcharacter', type: 'action'}, {name: _('Formatting mark'), type: 'menu', menu: [ {name: _('Non-breaking space'), type: 'unocommand', uno: '.uno:InsertNonBreakingSpace'}, @@ -184,10 +184,10 @@ L.Control.Menubar = L.Control.extend({ {name: _('Cell'), type: 'unocommand', uno: '.uno:EntireCell'}]}, {name: _('Merge cells'), type: 'unocommand', uno: '.uno:MergeCells'}, {type: 'separator'}, - {name: _('Properties'), id: '.uno:TableDialog', type: 'dialog'} + {name: _('Properties...'), id: '.uno:TableDialog', type: 'dialog'} ]}, {name: _('Tools'), id: 'tools', type: 'menu', menu: [ - {name: _('Spelling and Grammar'), id: '.uno:SpellingAndGrammarDialog', type: 'dialog'}, + {name: _('Spelling...'), id: '.uno:SpellingAndGrammarDialog', type: 'dialog'}, {name: _('Automatic spell checking'), type: 'unocommand', uno: '.uno:SpellOnline'}, {name: _('Language for selection'), type: 'menu', menu: [ {name: _('None (Do not check spelling)'), id: 'noneselection', type: 'unocommand', uno: '.uno:LanguageStatus?Language:string=Current_LANGUAGE_NONE'}]}, @@ -195,7 +195,7 @@ L.Control.Menubar = L.Control.extend({ {name: _('None (Do not check spelling)'), id: 'noneparagraph', type: 'unocommand', uno: '.uno:LanguageStatus?Language:string=Paragraph_LANGUAGE_NONE'}]}, {name: _('Language for entire document'), type: 'menu', menu: [ {name: _('None (Do not check spelling)'), id: 'nonelanguage', type: 'unocommand', uno: '.uno:LanguageStatus?Language:string=Default_LANGUAGE_NONE'}]}, - {name: _('Word count'), id: '.uno:WordCountDialog', type: 'dialog'} + {name: _('Word Count...'), id: '.uno:WordCountDialog', type: 'dialog'} ]}, {name: _('Help'), id: 'help', type: 'menu', menu: [ {name: _('Keyboard shortcuts'), id: 'keyboard-shortcuts', type: 'action'}, @@ -226,7 +226,7 @@ L.Control.Menubar = L.Control.extend({ {name: _('Paste'), type: 'unocommand', uno: '.uno:Paste'}, {name: _('Select all'), type: 'unocommand', uno: '.uno:SelectAll'}, {type: 'separator'}, - {name: _('Find & Replace'), id: '.uno:SearchDialog', id: 'dialog'} + {name: _('Find & Replace...'), id: '.uno:SearchDi
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.ContextMenu.js |4 loleaflet/src/control/Control.LokDialog.js | 25 loleaflet/src/control/Control.Menubar.js | 152 ++- 3 files changed, 18 insertions(+), 163 deletions(-) New commits: commit 87e5d25471a9cec3fb447687799185da8541faee Author: Pranav Kant Date: Wed Nov 29 19:12:48 2017 +0530 lokdialog: Add some initial spreadsheet, presentation dialogs Change-Id: I726601533cc8a33d912d42284d5585710036a817 diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index 70f726f9..a2e407f5 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -35,9 +35,9 @@ L.Control.ContextMenu = L.Control.extend({ 'UpdateCurIndex','RemoveTableOf', 'ReplyComment', 'DeleteComment', 'DeleteAuthor', 'DeleteAllNotes'], - spreadsheet: ['MergeCells', 'SplitCells', 'RecalcPivotTable'], + spreadsheet: ['MergeCells', 'SplitCells', 'RecalcPivotTable', 'FormatCellDialog'], - presentation: [], + presentation: ['EditStyle'], drawing: [] } }, commit c6a69901fa306a4f27d0319c76f9c842d63727cf Author: Pranav Kant Date: Wed Nov 29 16:55:05 2017 +0530 lokdialog: Kill Find&Replace js code; add/remove dialogs for writer Change-Id: I3a7bb1ffdb4f50776868fee6eade44f194d290e0 diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index c6a67444..1187ea4c 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -79,7 +79,7 @@ L.Control.LokDialog = L.Control.extend({ this._sendDialogCommand(e.dialogId, this._createRectStr()); } else if (e.action === 'invalidate') { if (this._isOpen(e.dialogId)) { - if (!this._isRectangleValid(e.rectangle)) + if (e.rectangle && !this._isRectangleValid(e.rectangle)) return; if (!e.rectangle) @@ -267,29 +267,6 @@ L.Control.LokDialog = L.Control.extend({ if (!this._isOpen(dialogId)) return; - // FIXME: as a precaution, if we get larger width or height here than what we got in 'created' - // callback, then adjust the dialog canvas size - var changed = false; - var canvas = document.getElementById(dialogId + '-canvas'); - if (e.width > this._width) { - changed = true; - this._width = e.width; - canvas.width = e.width; - $('#' + dialogId).dialog('option', 'width', e.width); - } - - if (e.height > this._height) { - changed = true; - this._height = e.height; - canvas.height = e.height; - $('#' + dialogId).dialog('option', 'height', e.height); - } - - if (changed) { - this._sendDialogCommand(dialogId, this._createRectStr()); - return; - } - this._paintDialog(dialogId, e.title, e.rectangle, e.dialog); }, diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 28d5491f..db3a68c2 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -35,7 +35,7 @@ L.Control.Menubar = L.Control.extend({ {name: _('Paste'), type: 'unocommand', uno: '.uno:Paste'}, {name: _('Select all'), type: 'unocommand', uno: '.uno:SelectAll'}, {type: 'separator'}, - {name: _('Find & Replace'), id: 'findandreplace', type: 'action'}, + {name: _('Find & Replace'), id: '.uno:SearchDialog', type: 'dialog'}, {type: 'separator'}, {name: _('Track Changes'), type: 'menu', menu: [ {name: _('Record'), type: 'unocommand', uno: '.uno:TrackChanges'}, @@ -47,7 +47,7 @@ L.Control.Menubar = L.Control.extend({ {name: _('Previous'), type: 'unocommand', uno: '.uno:PreviousTrackedChange'}, {name: _('Next'), type: 'unocommand', uno: '.uno:NextTrackedChange'} ]}, - {name: _('ImageMap'), id: '.uno:ImageMapDialog', type: 'dialog'} +
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.LokDialog.js | 41 ++--- 1 file changed, 37 insertions(+), 4 deletions(-) New commits: commit 35457c4cf7c9408fb5cb8736e284800fd2fa3bda Author: Pranav Kant Date: Tue Nov 14 18:47:58 2017 +0530 lokdialog: Handle 'cursor_visible' callback to hide the cursor Change-Id: Ia4be5f1533226b493387af896812924d4bf81a72 diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index d599d6a3..0914d9b6 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -35,10 +35,15 @@ L.Control.LokDialog = L.Control.extend({ var height = parseInt(rectangle[3]); $('#' + e.dialogId + '-cursor').css({height: height}); - // set the position of the lokdialog-cursor $(this._dialogs[e.dialogId].cursor).css({left: x, top: y}); } + } else if (e.action === 'cursor_visible') { + var visible = e.visible === 'true'; + if (visible) + $('#' + e.dialogId + '-cursor').css({display: 'block'}); + else + $('#' + e.dialogId + '-cursor').css({display: 'none'}); } else if (e.action === 'close') { this._onDialogClose(e.dialogId); } commit 2dcd75ccac9b4c219777c2d4e8e1859928b9c146 Author: Pranav Kant Date: Mon Nov 13 17:25:47 2017 +0530 lokdialog: Blinking cursor for editing fields in dialog Change-Id: Ib75e87134e650053dbcd5e78f9c52ea7b7fb4f98 diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 8460eb0d..d599d6a3 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -15,7 +15,9 @@ L.Control.LokDialog = L.Control.extend({ _dialogs: {}, _isOpen: function(dialogId) { - return $('#' + dialogId).length > 0; + return this._dialogs[dialogId] && + this._dialogs[dialogId].open && + $('#' + dialogId).length > 0; }, _onDialogMsg: function(e) { @@ -25,6 +27,18 @@ L.Control.LokDialog = L.Control.extend({ if (this._isOpen(e.dialogId)) { this._map.sendDialogCommand(e.dialogId, e.rectangle); } + } else if (e.action === 'cursor_invalidate') { + if (this._isOpen(e.dialogId) && !!e.rectangle) { + var rectangle = e.rectangle.split(','); + var x = parseInt(rectangle[0]); + var y = parseInt(rectangle[1]); + var height = parseInt(rectangle[3]); + + $('#' + e.dialogId + '-cursor').css({height: height}); + + // set the position of the lokdialog-cursor + $(this._dialogs[e.dialogId].cursor).css({left: x, top: y}); + } } else if (e.action === 'close') { this._onDialogClose(e.dialogId); } @@ -32,11 +46,21 @@ L.Control.LokDialog = L.Control.extend({ _openDialog: function(e) { e.dialogId = e.dialogId.replace('.uno:', ''); - this._dialogs[e.dialogId] = true; + this._dialogs[e.dialogId] = {open: true}; this._map.sendDialogCommand(e.dialogId); }, + _launchDialogCursor: function(dialogId) { + if (!this._isOpen(dialogId)) + return; + + this._dialogs[dialogId].cursor = L.DomUtil.create('div', 'leaflet-cursor-container', L.DomUtil.get(dialogId)); + var cursor = L.DomUtil.create('div', 'leaflet-cursor lokdialog-cursor', this._dialogs[dialogId].cursor); + cursor.id = dialogId + '-cursor'; + L.DomUtil.addClass(cursor, 'blinking-cursor'); + }, + _launchDialog: function(dialogId, width, height) { var canvas = '' + '' + @@ -87,7 +111,11 @@ L.Control.LokDialog = L.Control.extend({ return false; }); - this._dialogs[dialogId] = true; + // set the dialog's cursor + this._launchDialogCursor(dialogId); + + if (!this._dialogs[dialogId] || !this._dialogs[dialogId].open) + this._dialogs[dialogId] = { open: true }; }, _postDialogMouseEvent: function(type, dialogid, x, y, count, buttons, modifier) { @@ -195,7 +223,7 @@ L.Control.LokDialog = L.Control.extend({ _onDialogPaint: function (e) {
[Libreoffice-commits] online.git: 2 commits - loleaflet/src wsd/DocumentBroker.cpp
loleaflet/src/core/Socket.js | 13 + loleaflet/src/map/Map.js |2 +- wsd/DocumentBroker.cpp |2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) New commits: commit dce714efb8b23e8ef59d3663f87cd0a557c70c9f Author: Pranav Kant Date: Thu Jun 1 21:07:52 2017 +0530 Toggle this flag after a successfull save Change-Id: Id1bf5bc5e32e24f68094f3020f4a7c4c4117f18a diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp index 981834fa..2aa10d21 100644 --- a/wsd/DocumentBroker.cpp +++ b/wsd/DocumentBroker.cpp @@ -627,6 +627,8 @@ bool DocumentBroker::saveToStorageInternal(const std::string& sessionId, // So set _documentLastModifiedTime then _documentLastModifiedTime = _storage->getFileInfo()._modifiedTime; +// After a successful save, we are sure that document in the storage is same as ours +_documentChangedInStorage = false; LOG_DBG("Saved docKey [" << _docKey << "] to URI [" << uri << "] and updated tile cache. Document modified timestamp: " << Poco::DateTimeFormatter::format(Poco::DateTime(_documentLastModifiedTime), commit 9f535580a6590bcb6f77d4227ff685f8185cdf2d Author: Pranav Kant Date: Thu Jun 1 21:07:21 2017 +0530 Close the dialog before showing a confirmation dialog Change-Id: If7220c37f8456627181500d7428caf3657816a16 diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 1d6b884f..b3b99f48 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -270,6 +270,10 @@ L.Socket = L.Class.extend({ var username = textMsg.substring('documentconflict '.length); msg = _('%user asked to refresh the document. Document will now refresh automatically.').replace('%user', username); + // Detach all the handlers from current socket, otherwise _onSocketClose tries to reconnect again + // However, we want to reconnect manually here. + this.close(); + // Reload the document this._map._active = false; map = this._map; @@ -349,6 +353,15 @@ L.Socket = L.Class.extend({ else if (command.errorKind === 'documentconflict') { storageError = errorMessages.storage.documentconflict; + + // TODO: We really really need to factor this out duplicate dialog code logic everywhere + // Close any open dialogs first. + if (vex.dialogID > 0) { + var id = vex.dialogID; + vex.dialogID = -1; + vex.close(id); + } + vex.dialog.confirm({ message: _('Document has been changed in storage. Do you want to refresh the page to load the new document ? Cancelling will continue editing and overwrite.'), callback: L.bind(function(value) { diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 1e06bae5..32b07f73 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -842,7 +842,7 @@ L.Map = L.Evented.extend({ var options = $.extend({}, vex.defaultOptions, { contentCSS: {'background':'rgba(0, 0, 0, 0)', -'font-size': 'xx-large', +'font-size': 'xx-large', 'color': '#fff', 'text-align': 'center'}, content: _('Inactive document - please click to resume editing') ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src wsd/README.vars
loleaflet/src/layer/marker/Annotation.js | 13 - wsd/README.vars |5 + 2 files changed, 13 insertions(+), 5 deletions(-) New commits: commit 827d3f63cb5b68b186bf76755eda05ea18f9491a Author: Pranav Kant Date: Wed May 17 23:30:20 2017 +0530 loleaflet: Use safer text assignment method Change-Id: Idb0e5454f5d795132c762e22c596710bfed75770 diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js index 93c71983..5c577289 100644 --- a/loleaflet/src/layer/marker/Annotation.js +++ b/loleaflet/src/layer/marker/Annotation.js @@ -2,6 +2,8 @@ * L.Annotation */ +/* global $ Autolinker L */ + L.Annotation = L.Layer.extend({ options: { minWidth: 160, @@ -284,16 +286,17 @@ L.Annotation = L.Layer.extend({ _updateContent: function () { var linkedText = Autolinker.link(this._data.text); - this._contentText.innerHTML = linkedText; + $(this._contentText).text(linkedText); // Original unlinked text - this._contentText.origText = this._nodeModifyText.innerHTML = this._data.text; - this._contentAuthor.innerHTML = this._data.author; + this._contentText.origText = this._data.text; + $(this._nodeModifyText).text(this._data.text); + $(this._contentAuthor).text(this._data.author); var d = new Date(this._data.dateTime.replace(/,.*/, 'Z')); - this._contentDate.innerHTML = (isNaN(d.getTime()) || this._map.getDocType() === 'spreadsheet')? this._data.dateTime: d.toDateString(); + $(this._contentDate).text((isNaN(d.getTime()) || this._map.getDocType() === 'spreadsheet')? this._data.dateTime: d.toDateString()); if (this._data.trackchange) { - this._captionText.innerHTML = this._data.description; + $(this._captionText).text(this._data.description); } }, commit 46acd74d83bd6ae85b497d49c260f250d1604a1a Author: Pranav Kant Date: Wed May 17 23:15:17 2017 +0530 Document LOOL_SERVE_FROM_FS Change-Id: I10d71979366f61839f2aedaf6886fa5f03132004 diff --git a/wsd/README.vars b/wsd/README.vars index 862465fd..e1f81773 100644 --- a/wsd/README.vars +++ b/wsd/README.vars @@ -35,3 +35,8 @@ LOOL_WS_JITTER LOOL_STORAGE_COOKIE Sets a cookie to all the requests made to storage. This is extremely useful for debugging WOPI implementations. For eg: Using XDebug with OwnCloud/NextCloud. + +LOOL_SERVE_FROM_FS + If mentioned, files are not loaded into the memory on start, instead they are + read from the filesystem. This can be helpful in loleaflet development + where you can tweak it without restarting wsd. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/AnnotationManager.js |1 - loleaflet/src/layer/marker/Annotation.js |5 - 2 files changed, 4 insertions(+), 2 deletions(-) New commits: commit d5cdd776cf21487fbf213fde5b1c3dfc745b8f96 Author: Pranav Kant Date: Thu Apr 27 14:06:04 2017 +0530 loleaflet: Fix replying comment behavior on IE Change-Id: If56d217073e88ed7bc554383dc3bad059b4ef305 diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js index 44e41751..93c71983 100644 --- a/loleaflet/src/layer/marker/Annotation.js +++ b/loleaflet/src/layer/marker/Annotation.js @@ -266,7 +266,10 @@ L.Annotation = L.Layer.extend({ _onReplyClick: function (e) { L.DomEvent.stopPropagation(e); this._data.reply = this._nodeReplyText.value; - this._nodeReplyText.value = null; + // Assigning an empty string to .innerHTML property in some browsers will convert it to 'null' + // While in browsers like Chrome and Firefox, a null value is automatically converted to '' + // Better to assign '' here instead of null to keep the behavior same for all + this._nodeReplyText.value = ''; this.show(); this._map.fire('AnnotationReply', {annotation: this}); }, commit bc180ed370119ee7190dce3a8bb95577e85b331f Author: Pranav Kant Date: Thu Apr 27 13:30:23 2017 +0530 Bin unused animation object Change-Id: I66d4716ba2bfac5797d8a0e7213479abd3eb3467 diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js index f35c7588..76f91341 100644 --- a/loleaflet/src/layer/AnnotationManager.js +++ b/loleaflet/src/layer/AnnotationManager.js @@ -14,7 +14,6 @@ L.AnnotationManager = L.Class.extend({ this._map = map; this._items = []; this._selected = null; - this._animation = new L.PosAnimation(); L.setOptions(this, options); this._arrow = L.polyline([], {color: 'darkblue', weight: 1}); this._map.on('zoomend', this._onAnnotationZoom, this); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/AnnotationManager.js | 23 +++ loleaflet/src/map/Map.js | 13 + 2 files changed, 28 insertions(+), 8 deletions(-) New commits: commit e3ef5d01afa5773e5562a5e5a30274c0d4ee1761 Author: Pranav Kant Date: Wed Apr 26 13:15:10 2017 +0530 loleaflet: Allow mouse clicks to pass through comment/redline selection Otherwise, it was not possible to use the mouse to click on the text beneath the text selection svg layer. This simulates a mouse click on the document after selecting the comment. Change-Id: Ia2717a0a4356f40e31db94b68563abffc87cac37 diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js index eff34d7d..f35c7588 100644 --- a/loleaflet/src/layer/AnnotationManager.js +++ b/loleaflet/src/layer/AnnotationManager.js @@ -57,13 +57,21 @@ L.AnnotationManager = L.Class.extend({ color = viewId >= 0 ? L.LOUtil.rgbToHex(this._map.getViewColor(viewId)) : '#43ACE8'; if (rectangles.length > 0) { comment.textSelected = L.polygon(rectangles, { - interactive: true, + pointerEvents: 'all', + interactive: false, fillColor: color, fillOpacity: 0.25, weight: 2, opacity: 0.25 }); - comment.textSelected.on('click', function() { + comment.textSelected.on('click', function(e) { + // Simulate a click at this position in the document + var latlng = this._map.mouseEventToLatLng(e.originalEvent); + var pos = this._map._docLayer._latLngToTwips(latlng); + this._map._docLayer._postMouseEvent('buttondown', pos.x, pos.y, 1, 1, 0); + this._map._docLayer._postMouseEvent('buttonup', pos.x, pos.y, 1, 1, 0); + + // Also select this comment this.selectById(comment.id); }, this); } @@ -88,11 +96,18 @@ L.AnnotationManager = L.Class.extend({ color = viewId >= 0 ? L.LOUtil.rgbToHex(this._map.getViewColor(viewId)) : '#43ACE8'; if (rectangles.length > 0) { redline.textSelected = L.polygon(rectangles, { - interactive: true, + pointerEvents: 'all', + interactive: false, fillOpacity: 0, opacity: 0 }); - redline.textSelected.on('click', function() { + redline.textSelected.on('click', function(e) { + // Simulate a click at this position in the document + var latlng = this._map.mouseEventToLatLng(e.originalEvent); + var pos = this._map._docLayer._latLngToTwips(latlng); + this._map._docLayer._postMouseEvent('buttondown', pos.x, pos.y, 1, 1, 0); + this._map._docLayer._postMouseEvent('buttonup', pos.x, pos.y, 1, 1, 0); + this.selectById(redline.id); }, this); } commit 91421bae3d09ba15a71db3101d21b3b08b5de0d2 Author: Pranav Kant Date: Wed Apr 26 13:15:03 2017 +0530 loleaflet: Allow selecting annotations in readonly mode too Change-Id: I5c58baf95a1cbbb2ffbe756de30e596e2c35e6fb diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 3a2ce54d..755d99d0 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -981,11 +981,16 @@ L.Map = L.Evented.extend({ // For touch devices, to pop-up the keyboard, it is required to call // .focus() method on hidden input within actual 'click' event here // Calling from some other place with no real 'click' event doesn't work - if (type === 'click' && this._permission === 'edit') { - this._textArea.blur(); - this._textArea.focus(); - if (this._docLayer && this._docLayer._annotations && this._docLayer._annotations.unselect) + if (type === 'click') { + if (this._permission === 'edit') { + this._textArea.blur(); + this._textArea.focus(); + } + + // unselect if anything is selected already + if (this._docLayer && this._docLayer._annotations && this._docLayer._annotati
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/AnnotationManager.js | 24 1 file changed, 12 insertions(+), 12 deletions(-) New commits: commit ee683c106cd8421600b2141cb43c25e5e8dd1af0 Author: Pranav Kant Date: Thu Apr 20 12:42:16 2017 +0530 loleaflet: Fix incorrect variable usage in this loop Change-Id: I586ad59874b901d31b6e138a74577ecf3e1920c3 diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js index e739930d..88fbcaba 100644 --- a/loleaflet/src/layer/AnnotationManager.js +++ b/loleaflet/src/layer/AnnotationManager.js @@ -280,7 +280,7 @@ L.AnnotationManager = L.Class.extend({ var scale = this._map.getZoomScale(this._map.getZoom(), 10); var docRight = this._map.project(this._map.options.maxBounds.getNorthEast()).subtract(this.options.extraSize.multiplyBy(scale)); var topRight = docRight.add(L.point(this.options.marginX, this.options.marginY)); - var latlng, layoutBounds, point, index; + var latlng, layoutBounds, point, idx; if (this._selected) { var selectIndexFirst = this.getRootIndexOf(this._selected._data.id); var selectIndexLast = this.getLastChildIndexOf(this._selected._data.id); @@ -293,7 +293,7 @@ L.AnnotationManager = L.Class.extend({ layoutBounds = this._items[selectIndexFirst].getBounds(); // Adjust child comments too, if any - for (var idx = selectIndexFirst + 1; idx <= selectIndexLast; idx++) { + for (idx = selectIndexFirst + 1; idx <= selectIndexLast; idx++) { if (zoom) { this._items[idx]._data.anchorPix = this._map._docLayer._twipsToPixels(this._items[idx]._data.anchorPos.min); } @@ -310,9 +310,9 @@ L.AnnotationManager = L.Class.extend({ layoutBounds.max = layoutBounds.max.add([this.options.marginX, 0]); layoutBounds.extend(layoutBounds.min.subtract([0, this.options.marginY])); layoutBounds.extend(layoutBounds.max.add([0, this.options.marginY])); - for (index = selectIndexFirst - 1; index >= 0;) { + for (idx = selectIndexFirst - 1; idx >= 0;) { var commentThread = []; - var tmpIdx = index; + var tmpIdx = idx; do { if (zoom) { this._items[idx]._data.anchorPix = this._map._docLayer._twipsToPixels(this._items[idx]._data.anchorPos.min); @@ -324,11 +324,11 @@ L.AnnotationManager = L.Class.extend({ commentThread.reverse(); // All will have some anchor position this.layoutUp(commentThread, this._map.unproject(L.point(topRight.x, commentThread[0]._data.anchorPix.y)), layoutBounds); - index = index - commentThread.length; + idx = idx - commentThread.length; } - for (index = selectIndexLast + 1; index < this._items.length;) { + for (idx = selectIndexLast + 1; idx < this._items.length;) { commentThread = []; - tmpIdx = index; + tmpIdx = idx; do { if (zoom) { this._items[idx]._data.anchorPix = this._map._docLayer._twipsToPixels(this._items[idx]._data.anchorPos.min); @@ -339,7 +339,7 @@ L.AnnotationManager = L.Class.extend({ // All will have some anchor position this.layoutDown(commentThread, this._map.unproject(L.point(topRight.x, commentThread[0]._data.anchorPix.y)), layoutBounds); - index = index + commentThread.length; + idx = idx + commentThread.length; } if (!this._selected.isEdit()) { this._selected.show(); @@ -347,9 +347,9 @@ L.AnnotationManager = L.Class.extend({ } else { point = this._map.latLngToLayerPoint(this._map.unproject(topRight)); layoutBounds = L.bounds(point, point); - for (index = 0; index < this._items.length;) { + for (idx = 0; idx < this._items.length;) { commentThread = []; - tmpIdx = index; + tmpIdx = idx;
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.ContextMenu.js | 18 ++ loleaflet/src/layer/tile/TileLayer.js| 24 +--- 2 files changed, 31 insertions(+), 11 deletions(-) New commits: commit 87c9b30f48b3e8efa9a82f37194fc5216800f3ef Author: Pranav Kant Date: Thu Mar 30 18:10:42 2017 +0530 tdf#106842: Prefix 'Internal ' to cut/copy/paste strings ... in DisableCopy mode. Change-Id: Id758d4654fbe129dd16a466050bf51686440909d diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index 54bd078d..73f0d51f 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -129,6 +129,21 @@ L.Control.ContextMenu = L.Control.extend({ // Lets use the later for simplicity and to leverage the core translations in online itemName = itemName.replace(itemName.substring('Delete All Comments by '.length), 'This Author'); } + + if (map['wopi'].DisableCopy) { + switch (commandName) { + case 'Cut': + itemName = _('Internal Cut'); + break; + case 'Copy': + itemName = _('Internal Copy'); + break; + case 'Paste': + itemName = _('Internal Paste'); + break; + } + } + contextMenu[item.command] = { name: _(itemName) }; @@ -146,6 +161,9 @@ L.Control.ContextMenu = L.Control.extend({ isLastItemText = true; } else if (item.type === 'menu') { itemName = item.text.replace('~', ''); + if (map['wopi'].DisableCopy && itemName === 'Paste Special') { + itemName = _('Internal Paste Special'); + } var submenu = this._createContextMenuStructure(item); // ignore submenus with all items disabled if (Object.keys(submenu).length === 0) { commit 017fe90af1ee125ead251f19fcb1c99120b8e2bc Author: Pranav Kant Date: Thu Mar 30 17:50:27 2017 +0530 loleaflet: Refine copy/pasting in DisableCopy mode We always want internal document copy/paste to work and always want to do a richtext copy/paste whenever possible. Change-Id: I54705293bd34bc284ceff815ebdf556c7ca1587c diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 0d5a9451..05a6e504 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1719,8 +1719,9 @@ L.TileLayer = L.GridLayer.extend({ // remember the copied text, for rich copy/paste inside a document this._selectionTextHash = this._selectionTextContent; - this._map._socket.sendMessage('uno .uno:Copy'); } + + this._map._socket.sendMessage('uno .uno:Copy'); }, _onCut: function (e) { @@ -1731,23 +1732,24 @@ L.TileLayer = L.GridLayer.extend({ // remember the copied text, for rich copy/paste inside a document this._selectionTextHash = this._selectionTextContent; - this._map._socket.sendMessage('uno .uno:Cut'); } + + this._map._socket.sendMessage('uno .uno:Cut'); }, _onPaste: function (e) { e = e.originalEvent; e.preventDefault(); var pasteString = L.Compatibility.clipboardGet(e); - if (pasteString) { - if (pasteString === this._selectionTextHash) { - // content of the clipboard did not change, we can do rich - // paste - this._map._socket.sendMessage('uno .uno:Paste'); - } - else { - this._map._socket.sendMessage('paste mimetype=text/plain;charset=utf-8\n' + pasteString); - } + if (pasteString === 'false' || !!pasteString || pasteString === this._selectionTextHash) { + // If there is nothing to paste in clipboard, no harm in +
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Menubar.js | 12 ++-- loleaflet/src/layer/AnnotationManager.js |3 +-- 2 files changed, 11 insertions(+), 4 deletions(-) New commits: commit 8328b1bdb6da69a165b14a002cdebc405dbb7ef3 Author: Pranav Kant Date: Thu Mar 2 11:44:08 2017 +0530 lolefalet: Bin unused variables Change-Id: I693f67254194f78d999103801b1cf05d1f8196b4 diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js index 5c7d4ba..4d7a66f 100644 --- a/loleaflet/src/layer/AnnotationManager.js +++ b/loleaflet/src/layer/AnnotationManager.js @@ -288,8 +288,7 @@ L.AnnotationManager = L.Class.extend({ L.Map.include({ - insertComment: function(comment) { - comment = !!comment ? comment : {}; + insertComment: function() { this._docLayer.newAnnotation({ text: '', textrange: '', commit 40a1383b6dec2e921fee1d71908445937ac0f2c3 Author: Pranav Kant Date: Wed Mar 1 15:55:11 2017 +0530 loleaflet: Show change tracking menu options in file menubar Change-Id: Ie48bfdeb9545fbe7aec40ce3e7bc0f50b7f5007f diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 01a4cb5..d066e66 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -26,8 +26,16 @@ L.Control.Menubar = L.Control.extend({ {name: _('Copy'), type: 'unocommand', uno: '.uno:Copy'}, {name: _('Paste'), type: 'unocommand', uno: '.uno:Paste'}, {type: 'separator'}, - {name: _('Select all'), type: 'unocommand', uno: '.uno:SelectAll'}] - }, + {name: _('Select all'), type: 'unocommand', uno: '.uno:SelectAll'}, + {type: 'separator'}, + {name: _('Track Changes'), type: 'menu', menu: [ + {name: _('Record'), type: 'unocommand', uno: '.uno:TrackChanges'}, + {name: _('Show'), type: 'unocommand', uno: '.uno:ShowTrackedChanges'}, + {type: 'separator'}, + {name: _('Previous'), type: 'unocommand', uno: '.uno:PreviousTrackedChange'}, + {name: _('Next'), type: 'unocommand', uno: '.uno:NextTrackedChange'} + ]} + ]}, {name: _('View'), id: 'view', type: 'menu', menu: [ {name: _('Full screen'), id: 'fullscreen', type: 'action'}, {type: 'separator'}, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/tile/CalcTileLayer.js|2 +- loleaflet/src/layer/tile/ImpressTileLayer.js | 13 - 2 files changed, 13 insertions(+), 2 deletions(-) New commits: commit 13fcb10f91dfbf5c7cc276996a765af8e814d050 Author: Tor Lillqvist Date: Thu Jan 12 13:14:19 2017 +0200 Do the oldhash thing for Impress documents, too (Copy-pasta here, too.) Change-Id: I0327889d05a8d7294499849cb0a2b2dcca60ecff diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js index 496fa91..3f20f56 100644 --- a/loleaflet/src/layer/tile/ImpressTileLayer.js +++ b/loleaflet/src/layer/tile/ImpressTileLayer.js @@ -28,6 +28,7 @@ L.ImpressTileLayer = L.TileLayer.extend({ var tilePositionsX = ''; var tilePositionsY = ''; + var oldHashes = ''; var needsNewTiles = false; for (var key in this._tiles) { @@ -51,6 +52,15 @@ L.ImpressTileLayer = L.TileLayer.extend({ tilePositionsY += ','; } tilePositionsY += tileTopLeft.y; + if (oldHashes !== '') { + oldHashes += ','; + } + if (this._tiles[key].oldhash === undefined) { + oldHashes += '0'; + } + else { + oldHashes += this._tiles[key].oldhash; + } needsNewTiles = true; if (this._debug) { this._debugAddInvalidationData(this._tiles[key]); @@ -73,7 +83,8 @@ L.ImpressTileLayer = L.TileLayer.extend({ 'tileposx=' + tilePositionsX + ' ' + 'tileposy=' + tilePositionsY + ' ' + 'tilewidth=' + this._tileWidthTwips + ' ' + - 'tileheight=' + this._tileHeightTwips; + 'tileheight=' + this._tileHeightTwips + ' ' + + 'oldhash=' + oldHashes; this._map._socket.sendMessage(message, ''); if (this._debug) { commit b35d708006a64bc13797e39646bdc51818a88872 Author: Tor Lillqvist Date: Thu Jan 12 13:12:34 2017 +0200 Bin superfluous semicolon Change-Id: I2319ef9badfa50f645af3bedd2a589de61f6d2b3 diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index b120e16..02747de 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -100,7 +100,7 @@ L.CalcTileLayer = L.TileLayer.extend({ 'tileposy=' + tilePositionsY + ' ' + 'tilewidth=' + this._tileWidthTwips + ' ' + 'tileheight=' + this._tileHeightTwips + ' ' + - 'oldhash=' + oldHashes;; + 'oldhash=' + oldHashes; this._map._socket.sendMessage(message, ''); if (this._debug) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/core/Socket.js |9 - loleaflet/src/layer/tile/CalcTileLayer.js|1 + loleaflet/src/layer/tile/ImpressTileLayer.js |1 + 3 files changed, 10 insertions(+), 1 deletion(-) New commits: commit 6370143a4b935d97556036f9c02c88ae0d00d7a0 Author: Tor Lillqvist Date: Thu Jan 12 11:38:28 2017 +0200 Slight re-factoring: introduce getParameterValue() function I started changing the cases for all the parameters to use similar code as for the 'hash=' one: Check the parameter name with startsWith() instead of fragile substring() function call where the length parameter must match the length of a string literal that the substring() result is compared to. But then I got bored and gave up. It would be even better to not have to tediously check for all defined parameter names, but instead just parse each parameter using the same code that sets the property whose name we found. Except that we have special cases where the parameter name in the protocol doesn't match our coresponding property name, and those that consist of a list of comma-separated values. Maybe we indeed should just switch to JSON (or some binary representation of JSON or somesuch). Change-Id: Ibcdb26d7228b75f6f23c186f0b17cb46a12f3cec diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 4e4c935b..9ba1ec5 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -7,6 +7,13 @@ L.Socket = L.Class.extend({ ProtocolVersionNumber: '0.1', + getParameterValue: function (s) { + var i = s.indexOf('='); + if (i === -1) + return undefined; + return s.substring(i+1); + }, + initialize: function (map) { this._map = map; try { @@ -603,7 +610,7 @@ L.Socket = L.Class.extend({ command.rendercount = parseInt(tokens[i].substring(12)); } else if (tokens[i].startsWith('hash=')) { - command.hash = tokens[i].substring(tokens[i].indexOf('=')+1); + command.hash = this.getParameterValue(tokens[i]); } } if (command.tileWidth && command.tileHeight && this._map._docLayer) { commit 23db565b5b1aecff6ae6501250792e49ae35ed9a Author: Tor Lillqvist Date: Thu Jan 12 11:19:48 2017 +0200 Add Emacs mode lines Change-Id: I208407f3017f71a4dfb2b86055a9bc639ee2f23c diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index cd4ed60..39869a6 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -1,3 +1,4 @@ +/* -*- js-indent-level: 8 -*- */ /* * Calc tile layer is used to display a spreadsheet document */ diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js index 3326fa2..496fa91 100644 --- a/loleaflet/src/layer/tile/ImpressTileLayer.js +++ b/loleaflet/src/layer/tile/ImpressTileLayer.js @@ -1,3 +1,4 @@ +/* -*- js-indent-level: 8 -*- */ /* * Impress tile layer is used to display a presentation document */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/tile/CalcTileLayer.js|4 ++-- loleaflet/src/layer/tile/GridLayer.js| 12 ++-- loleaflet/src/layer/tile/ImpressTileLayer.js |4 ++-- loleaflet/src/layer/tile/TileLayer.js| 21 - loleaflet/src/layer/tile/WriterTileLayer.js |4 ++-- loleaflet/src/map/Map.js |2 +- 6 files changed, 25 insertions(+), 22 deletions(-) New commits: commit fbb26d0d137ae8020328d4ba3b5350c8e681acc7 Author: Pranav Kant Date: Wed Dec 7 20:54:26 2016 +0530 loleaflet: Request higher pixel density tiles on retina display Change-Id: I418f0db47239c915d8f12c07979306a814370b65 diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index b66a657..5d6e6e4 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -83,8 +83,8 @@ L.CalcTileLayer = L.TileLayer.extend({ { var message = 'tilecombine ' + 'part=' + command.part + ' ' + - 'width=' + this._tileSize + ' ' + - 'height=' + this._tileSize + ' ' + + 'width=' + this._tileWidthPx + ' ' + + 'height=' + this._tileHeightPx + ' ' + 'tileposx=' + tilePositionsX + ' ' + 'tileposy=' + tilePositionsY + ' ' + 'tilewidth=' + this._tileWidthTwips + ' ' + diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js index a704b42..9f675d1 100644 --- a/loleaflet/src/layer/tile/GridLayer.js +++ b/loleaflet/src/layer/tile/GridLayer.js @@ -684,8 +684,8 @@ L.GridLayer = L.Layer.extend({ if (tilePositionsX !== '' && tilePositionsY !== '') { var message = 'tilecombine ' + 'part=' + this._selectedPart + ' ' + - 'width=' + this._tileSize + ' ' + - 'height=' + this._tileSize + ' ' + + 'width=' + this._tileWidthPx + ' ' + + 'height=' + this._tileHeightPx + ' ' + 'tileposx=' + tilePositionsX + ' ' + 'tileposy=' + tilePositionsY + ' ' + 'tilewidth=' + this._tileWidthTwips + ' ' + @@ -916,8 +916,8 @@ L.GridLayer = L.Layer.extend({ twips = this._coordsToTwips(coords); msg = 'tile ' + 'part=' + coords.part + ' ' + - 'width=' + this._tileSize + ' ' + - 'height=' + this._tileSize + ' ' + + 'width=' + this._tileWidthPx + ' ' + + 'height=' + this._tileHeightPx + ' ' + 'tileposx=' + twips.x + ' ' + 'tileposy=' + twips.y + ' ' + 'tilewidth=' + this._tileWidthTwips + ' ' + @@ -946,8 +946,8 @@ L.GridLayer = L.Layer.extend({ twips = this._coordsToTwips(coords); msg = 'tilecombine ' + 'part=' + coords.part + ' ' + - 'width=' + this._tileSize + ' ' + - 'height=' + this._tileSize + ' ' + + 'width=' + this._tileWidthPx + ' ' + + 'height=' + this._tileHeightPx + ' ' + 'tileposx=' + tilePositionsX + ' ' + 'tileposy=' + tilePositionsY + ' ' + 'tilewidth=' + this._tileWidthTwips + ' ' + diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js index 07bb75c..da0166c 100644 --- a/loleaflet/src/layer/tile/ImpressTileLayer.js +++ b/loleaflet/src/layer/tile/ImpressTileLayer.js @@ -67,8 +67,8 @@ L.ImpressTileLayer = L.TileLayer.extend({ { var message = 'tilecombine ' + 'part=' + command.part + ' ' + - 'width=' + this._tileSize + ' ' + - 'height=' + this._tileSize + ' ' + + 'width=' + this._tileWidthPx + ' ' + + 'height=' + this._tileHeightPx + ' ' + 'tileposx=' + tilePositionsX + ' ' + 'tileposy=' + tileP
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/layer/tile/TileLayer.js |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) New commits: commit 5b06f7b916d27b05c7d9f46ecd27f200e3d1f68d Author: Pranav Kant Date: Wed Dec 7 17:39:44 2016 +0530 loleaflet: Higher resoultion on retina displays Change-Id: Ib2a031d2d1cb88fe7fede392cfc2332a73252bbb diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index d830e7a..52658e7 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -45,7 +45,7 @@ L.TileLayer = L.GridLayer.extend({ maxNativeZoom: null, // Number tms: false, zoomReverse: false, - detectRetina: false, + detectRetina: true, crossOrigin: false, previewInvalidationTimeout: 1000 }, commit 322e00cab7929e5b57a22a0410992b6ed7cf5df5 Author: Pranav Kant Date: Wed Dec 7 17:23:24 2016 +0530 Ununsed option in TileLayer Change-Id: Ida522fc8f92dd264e4544948394b9c7c11d993ab diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 092d5dd..d830e7a 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -47,8 +47,7 @@ L.TileLayer = L.GridLayer.extend({ zoomReverse: false, detectRetina: false, crossOrigin: false, - previewInvalidationTimeout: 1000, - defaultPermission: 'view' + previewInvalidationTimeout: 1000 }, initialize: function (url, options) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.ColumnHeader.js | 10 +++--- loleaflet/src/control/Control.Header.js |2 +- loleaflet/src/control/Control.RowHeader.js| 11 --- 3 files changed, 16 insertions(+), 7 deletions(-) New commits: commit 4c788c3014d1f3935fdfd6e33e84ccb6baadb949 Author: Pranav Kant Date: Tue Dec 6 13:28:30 2016 +0530 loleaflet: Disable row/col header context menu in readonly/view Also fix a js error trying to disable context menu before row/column headers are created. Change-Id: I6b04ce5c0fefa00567ce5fe58fdad9102d1f1651 diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js index df19c65..cd231cc 100644 --- a/loleaflet/src/control/Control.ColumnHeader.js +++ b/loleaflet/src/control/Control.ColumnHeader.js @@ -192,6 +192,10 @@ L.Control.ColumnHeader = L.Control.Header.extend({ } L.DomEvent.addListener(text, 'click', this._onColumnHeaderClick, this); } + + if ($('.spreadsheet-header-column-text').length > 0) { + $('.spreadsheet-header-column-text').contextMenu(this._map._permission === 'edit'); + } }, _colAlphaToNumber: function(alpha) { @@ -332,9 +336,9 @@ L.Control.ColumnHeader = L.Control.Header.extend({ if (!this._initialized) { this._initialize(); } - setTimeout(function() { - $('.spreadsheet-header-column').contextMenu(e.perm === 'edit'); - }, 1000); + if ($('.spreadsheet-header-column-text').length > 0) { + $('.spreadsheet-header-column-text').contextMenu(e.perm === 'edit'); + } } }); diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js index a625efa..f2d5bfd 100644 --- a/loleaflet/src/control/Control.RowHeader.js +++ b/loleaflet/src/control/Control.RowHeader.js @@ -190,6 +190,10 @@ L.Control.RowHeader = L.Control.Header.extend({ } L.DomEvent.addListener(text, 'click', this._onRowHeaderClick, this); } + + if ($('.spreadsheet-header-row-text').length > 0) { + $('.spreadsheet-header-row-text').contextMenu(this._map._permission === 'edit'); + } }, _selectRow: function(row, modifier) { @@ -319,9 +323,10 @@ L.Control.RowHeader = L.Control.Header.extend({ if (!this._initialized) { this._initialize(); } - setTimeout(function() { - $('.spreadsheet-header-row').contextMenu(e.perm === 'edit'); - }, 1000); + // Enable context menu on row headers only if permission is 'edit' + if ($('.spreadsheet-header-row-text').length > 0) { + $('.spreadsheet-header-row-text').contextMenu(e.perm === 'edit'); + } } }); commit 5e4743a54c637045a0a8c2afebe9962cb275bb8a Author: Pranav Kant Date: Tue Dec 6 13:19:44 2016 +0530 loleaflet: Missing semi-colon Change-Id: I216dd1caa9bfba33b5538e149aeddfb7159ccbbd diff --git a/loleaflet/src/control/Control.Header.js b/loleaflet/src/control/Control.Header.js index d5443cc..8d19ec6 100644 --- a/loleaflet/src/control/Control.Header.js +++ b/loleaflet/src/control/Control.Header.js @@ -123,7 +123,7 @@ L.Control.Header = L.Control.extend({ L.DomUtil.disableTextSelection(); L.DomEvent.stopPropagation(e); - L.DomEvent.on(document, 'mousemove', this._onMouseMove, this) + L.DomEvent.on(document, 'mousemove', this._onMouseMove, this); L.DomEvent.on(document, 'mouseup', this._onMouseUp, this); var rect = target.parentNode.getBoundingClientRect(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src wsd/LOOLWSD.cpp
loleaflet/src/map/Map.js | 12 +--- wsd/LOOLWSD.cpp | 15 --- 2 files changed, 13 insertions(+), 14 deletions(-) New commits: commit c0f9ccee425a3bef5efbebccc19afecd371eeddc Author: Ashod Nakashian Date: Sun Nov 27 18:10:50 2016 -0500 loleaflet: activate and dismiss dialogs only upon reconnection Change-Id: I2d8b3d9788b7f66bc746537e34c90493a7cb408a Reviewed-on: https://gerrit.libreoffice.org/31296 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index aaa04ac..317bf7c 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -746,16 +746,14 @@ L.Map = L.Evented.extend({ this._socket.sendMessage('useractive'); this._active = true; this._docLayer._onMessage('invalidatetiles: EMPTY', null); + if (vex.dialogID > 0) { + var id = vex.dialogID; + vex.dialogID = -1; + return vex.close(id); + } } else { - this._active = true; this._socket.initialize(this); } - - if (vex.dialogID > 0) { - var id = vex.dialogID; - vex.dialogID = -1; - return vex.close(id); - } } return false; commit 68519f09278eb2c7d35f014008b42f25fc972c77 Author: Ashod Nakashian Date: Sun Nov 27 19:07:32 2016 -0500 loolwsd: destroy DocBrokers sooner Change-Id: I10d8ea57083c3b785748062a927574a63e0dd250 Reviewed-on: https://gerrit.libreoffice.org/31297 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index bb1285a..25a4bab 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -2114,10 +2114,15 @@ int LOOLWSD::main(const std::vector& /*args*/) LOG_INF("Stopping server socket listening. ShutdownFlag: " << SigUtil::isShuttingDown() << ", TerminationFlag: " << TerminationFlag); +// Wait until documents are saved and sessions closed. srv.stop(); srv2.stop(); threadPool.joinAll(); +// atexit handlers tend to free Admin before Documents +LOG_INF("Cleaning up lingering documents."); +DocBrokers.clear(); + // Terminate child processes LOG_INF("Requesting forkit process " << forKitPid << " to terminate."); SigUtil::killChild(forKitPid); @@ -2133,7 +2138,7 @@ int LOOLWSD::main(const std::vector& /*args*/) waitpid(forKitPid, &status, WUNTRACED); close(ForKitWritePipe); -// In case forkit didn't cleanup fully.' +// In case forkit didn't cleanup properly, don't leave jails behind. LOG_INF("Cleaning up childroot directory [" << ChildRoot << "]."); std::vector jails; File(ChildRoot).list(jails); @@ -2144,21 +2149,17 @@ int LOOLWSD::main(const std::vector& /*args*/) FileUtil::removeFile(path, true); } +// Finally, we no longer need SSL. if (LOOLWSD::isSSLEnabled()) { Poco::Net::uninitializeSSL(); Poco::Crypto::uninitializeCrypto(); } -// atexit handlers tend to free Admin before Documents -LOG_INF("Cleaning up lingering documents."); -DocBrokers.clear(); - -LOG_INF("Process [loolwsd] finished."); - int returnValue = Application::EXIT_OK; UnitWSD::get().returnValue(returnValue); +LOG_INF("Process [loolwsd] finished."); return returnValue; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Tabs.js |2 +- loleaflet/src/control/Parts.js|1 + 2 files changed, 2 insertions(+), 1 deletion(-) New commits: commit 7b332782da9c574bd65f06114673e8d115fa5b93 Author: Pranav Kant Date: Mon Nov 14 20:13:21 2016 +0530 loleaflet: Mention sheet name in delete sheet confirm dialog Change-Id: Ifac13c8fb2f4ec792f1e62541cb92b63edecad56 diff --git a/loleaflet/src/control/Control.Tabs.js b/loleaflet/src/control/Control.Tabs.js index d1e6bf9..3365f29 100644 --- a/loleaflet/src/control/Control.Tabs.js +++ b/loleaflet/src/control/Control.Tabs.js @@ -50,7 +50,7 @@ L.Control.Tabs = L.Control.extend({ callback: function(key, options) { var nPos = parseInt(options.$trigger.attr('id').split('spreadsheet-tab')[1]); vex.dialog.confirm({ - message: _('Are you sure you want to delete this sheet?'), + message: _('Are you sure you want to delete sheet, %sheet% ?').replace('%sheet%', options.$trigger.text()), callback: function(data) { if (data) { map.deletePage(nPos); commit 383e8a13a5de7fdd5294e8bd8209de2122d5da36 Author: Pranav Kant Date: Mon Nov 14 20:04:04 2016 +0530 loleaflet: Focus after inserting or deleting a sheet Change-Id: I2807cbeaa0fb5b7ec20002a3f5758ce47bb7d421 diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js index 1139594..1542b1c 100644 --- a/loleaflet/src/control/Parts.js +++ b/loleaflet/src/control/Parts.js @@ -46,6 +46,7 @@ L.Map.include({ this._socket.sendMessage('commandvalues command=.uno:ViewRowColumnHeaders'); } docLayer._drawSearchResults(); + this.focus(); }, getPreview: function (id, index, maxWidth, maxHeight, options) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Menubar.js | 95 ++- 1 file changed, 81 insertions(+), 14 deletions(-) New commits: commit ab0bd735e168cab01abd333b3ab3aad4fb3384b1 Author: Andras Timar Date: Fri Oct 28 11:43:58 2016 +0200 Writer Format menu diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index ada6e02..9bfafeb 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -40,6 +40,73 @@ L.Control.Menubar = L.Control.extend({ {name: _('Page break'), type: 'unocommand', uno: '.uno:InsertPageBreak'}, {name: _('Column break'), type: 'unocommand', uno: '.uno:InsertColumnBreak'}] }, + {name: _('Format'), type: 'menu', menu:[ + {name: _('Text'), type: 'menu', menu: [ + {name: _('Bold'), type: 'unocommand', uno: '.uno:Bold'}, + {name: _('Italic'), type: 'unocommand', uno: '.uno:Italic'}, + {name: _('Underline'), type: 'unocommand', uno: '.uno:Underline'}, + {name: _('Double underline'), type: 'unocommand', uno: '.uno:UnderlineDouble'}, + {name: _('Strikethrough'), type: 'unocommand', uno: '.uno:Strikeout'}, + {name: _('Overline'), type: 'unocommand', uno: '.uno:Overline'}, + {type: 'separator'}, + {name: _('Superscript'), type: 'unocommand', uno: '.uno:SuperScript'}, + {name: _('Subscript'), type: 'unocommand', uno: '.uno:SubScript'}, + {name: _('ê±á´á´ÊÊ á´á´á´ê±'), type: 'unocommand', uno: '.uno:SmallCaps'}, + {type: 'separator'}, + {name: _('Shadow'), type: 'unocommand', uno: '.uno:Shadowed'}, + {name: _('Outline'), type: 'unocommand', uno: '.uno:OutlineFont'}, + {type: 'separator'}, + {name: _('Increase size'), type: 'unocommand', uno: '.uno:Grow'}, + {name: _('Decrease size'), type: 'unocommand', uno: '.uno:Shrink'}, + {type: 'separator'}, + {name: _('UPPERCASE'), type: 'unocommand', uno: '.uno:ChangeCaseToUpper'}, + {name: _('lowercase'), type: 'unocommand', uno: '.uno:ChangeCaseToLower'}, + {name: _('Cycle case'), type: 'unocommand', uno: '.uno:ChangeCaseRotateCase'}, + {type: 'separator'}, + {name: _('Sentence case'), type: 'unocommand', uno: '.uno:ChangeCaseToSentenceCase'}, + {name: _('Capitalize Every Word'), type: 'unocommand', uno: '.uno:ChangeCaseToTitleCase'}, + {name: _('tOGGLE cASE'), type: 'unocommand', uno: '.uno:ChangeCaseToToggleCase'}]}, + {name: _('Spacing'), type: 'menu', menu: [ + {name: _('Line spacing: 1'), type: 'unocommand', uno: '.uno:SpacePara1'}, + {name: _('Line spacing: 1.5'), type: 'unocommand', uno: '.uno:SpacePara15'}, + {name: _('Line spacing: 2'), type: 'unocommand', uno: '.uno:SpacePara2'}, + {type: 'separator'}, + {name: _('Increase paragraph spacing'), type: 'unocommand', uno: '.uno:ParaspaceIncrease'}, + {name: _('Decrease paragraph spacing'), type: 'unocommand', uno: '.uno:ParaspaceDecrease'}, + {type: 'separator'}, + {name: _('Increase indent'), type: 'unocommand', uno: '.uno:IncrementIndent'}, + {name: _('Decrease indent'), type: 'unocommand', uno: '.uno:DecrementIndent'}]}, + {name: _('Align'), type: 'menu', menu: [ + {name: _('Left'), type: 'un
[Libreoffice-commits] online.git: 2 commits - loleaflet/src
loleaflet/src/control/Control.Tabs.js |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit ae0b3a6cac374f7cfdfd310b7a2fce6f95971032 Author: Andras Timar Date: Mon Oct 24 20:54:55 2016 +0200 loleaflet: add loleaflet-font class to Calc tab context menu diff --git a/loleaflet/src/control/Control.Tabs.js b/loleaflet/src/control/Control.Tabs.js index 4dd43cb..d1e6bf9 100644 --- a/loleaflet/src/control/Control.Tabs.js +++ b/loleaflet/src/control/Control.Tabs.js @@ -32,6 +32,7 @@ L.Control.Tabs = L.Control.extend({ $.contextMenu({ selector: '.spreadsheet-context-menu', + className: 'loleaflet-font', callback: function(key, options) { var nPos = parseInt(options.$trigger.attr('id').split('spreadsheet-tab')[1]); commit 67d21d682d273e134ceae41dc4d7d6a51ee994e5 Author: Andras Timar Date: Mon Oct 24 20:52:52 2016 +0200 loleaflet: typo: initalized -> initialized diff --git a/loleaflet/src/control/Control.Tabs.js b/loleaflet/src/control/Control.Tabs.js index 7e4bd46..4dd43cb 100644 --- a/loleaflet/src/control/Control.Tabs.js +++ b/loleaflet/src/control/Control.Tabs.js @@ -6,7 +6,7 @@ L.Control.Tabs = L.Control.extend({ onAdd: function(map) { map.on('updatepermission', this._onUpdatePermission, this); - this._initalized = false; + this._initialized = false; }, _onUpdatePermission: function(e) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits