[Libreoffice-commits] online.git: 5 commits - loleaflet/src

2019-10-16 Thread Tamás Zolnai (via logerrit)
 loleaflet/src/control/Control.Menubar.js |   52 ++-
 1 file changed, 31 insertions(+), 21 deletions(-)

New commits:
commit 1da5d303071f32f980a68a589357ce699d8069c2
Author: Tamás Zolnai 
AuthorDate: Wed Oct 16 19:13:43 2019 +0200
Commit: Tamás Zolnai 
CommitDate: Wed Oct 16 19:14:12 2019 +0200

mobile-menu: Make sure requested hidden elements are actually hidden.

Change-Id: I1e45363009af05bad78d5643178c9e97e1b0

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 28c1b6107..7f550b041 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -1210,7 +1210,11 @@ L.Control.Menubar = L.Control.extend({
if (this._map['wopi'].HideExportOption)
return false;
}
-   return true
+
+   if (this._hiddenItems && 
this._hiddenItems.includes(menuItem.id))
+   return false;
+
+   return true;
},
 
_createMenu: function(menu) {
commit 6c89ac38221d71ad5fd0e238b92fba6bad54bff9
Author: merttumer 
AuthorDate: Sun Aug 11 15:56:02 2019 +0300
Commit: Tamás Zolnai 
CommitDate: Wed Oct 16 19:14:12 2019 +0200

Fixed #4194 fullscreen button visibility conflict

Used hiddenitemlist for menubar to prevent hidden items
from to be shown after reinitialize of the menu
Signed-off-by: merttumer 

Change-Id: I9e374aba3beab89687394b6b334564db074c3b25

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index eeb098866..28c1b6107 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -623,6 +623,7 @@ L.Control.Menubar = L.Control.extend({
 
onAdd: function (map) {
this._initialized = false;
+   this._hiddenItems = [];
this._menubarCont = L.DomUtil.get('main-menu');
this._initializeMenu(this.options.initial);
 
@@ -1264,6 +1265,10 @@ L.Control.Menubar = L.Control.extend({
$(aItem).css('display', 'none');
}
 
+   if (this._hiddenItems && 
this._hiddenItems.includes(menu[i].id)) {
+   $(aItem).css('display', 'none');
+   }
+
itemList.push(liItem);
}
 
@@ -1293,14 +1298,20 @@ L.Control.Menubar = L.Control.extend({
 
hideItem: function(targetId) {
var item = this._getItem(targetId);
-   if (item)
+   if (item) {
+   if (!this._hiddenItems.includes(targetId))
+   this._hiddenItems.push(targetId);
$(item).css('display', 'none');
+   }
},
 
showItem: function(targetId) {
var item = this._getItem(targetId);
-   if (item)
+   if (item) {
+   if (this._hiddenItems.includes(targetId))
+   
this._hiddenItems.splice(this._hiddenItems.indexOf(targetId), 1);
$(item).css('display', '');
+   }
},
 
_initializeMenu: function(menu) {
commit a4c440b45de95ad01e88fc32f8c51d2907fd063e
Author: Tamás Zolnai 
AuthorDate: Wed Oct 16 19:04:04 2019 +0200
Commit: Tamás Zolnai 
CommitDate: Wed Oct 16 19:14:12 2019 +0200

mobile-menu: impress: Move alone items upper with one level.

We don't need menus with only one item.

Change-Id: Ia325933a44cbfc26436f842e4f12bf7b4b1ed8a5

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 3b957c9e5..eeb098866 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -522,9 +522,6 @@ L.Control.Menubar = L.Control.extend({
{type: 'separator'},
{uno: '.uno:SearchDialog'}
]},
-   {name: _UNO('.uno:ViewMenu', 'presentation'), id: 
'view', type: 'menu', menu: [
-   {name: _UNO('.uno:FullScreen', 'presentation'), 
id: 'fullscreen', type: 'action', mobileapp: false}
-   ]},
{name: _UNO('.uno:TableMenu', 'text'/*HACK should be 
'presentation', but not in xcu*/), type: 'menu', menu: [
{uno: '.uno:InsertRowsBefore'},
{uno: '.uno:InsertRowsAfter'},
@@ -538,11 +535,10 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:SlideMenu', 'presentation'), type: 
'menu', menu: [
{name: _UNO('.uno:InsertSlide', 
'presentation'), id: 'insertpage', type: 'action'},
{name: 

[Libreoffice-commits] online.git: 5 commits - loleaflet/src

2016-09-22 Thread Pranav Kant
 loleaflet/src/control/Permission.js   |1 -
 loleaflet/src/core/Socket.js  |   13 +
 loleaflet/src/layer/marker/ProgressOverlay.js |3 +--
 loleaflet/src/layer/tile/TileLayer.js |   10 +-
 loleaflet/src/map/Map.js  |   16 +---
 5 files changed, 16 insertions(+), 27 deletions(-)

New commits:
commit 56d92527c2c3457c0578814216a678d1c7e7592c
Author: Pranav Kant 
Date:   Fri Sep 23 01:21:43 2016 +0530

loleaflet: Kill this troublesome editlock related code

This code throws sometimes. Rather than investigating what makes
it actually throw, lets kill it because we don't want any
editlock functionality anyways now.

Change-Id: I8a484ba9e3a658ca739122bb6d2d0c92c4180ff5

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index f4158d1..122028c 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -198,17 +198,9 @@ L.TileLayer = L.GridLayer.extend({
this);
 
map.on('updatepermission', function(e) {
-   // {En,Dis}able selection handles
-   for (var key in this._selectionHandles) {
-   this._selectionHandles[key].setDraggable(e.perm 
=== 'edit');
-   }
-
-   // we want graphic selection handles to appear
-   // when in editmode, and dissappear when in view mode
if (e.perm !== 'edit') {
-   this._graphicSelection = null;
+   this._clearSelections();
}
-   this._onUpdateGraphicSelection();
}, this);
 
for (var key in this._selectionHandles) {
commit afe14df0476835b49d4d12a56e263a52c86dbd9b
Author: Pranav Kant 
Date:   Fri Sep 23 00:25:32 2016 +0530

loleaflet: Start spinner when added to map

... otherwise we see a non-rotating spinner after first
initialization.

Change-Id: Idf6e259634607249e3411bf772a55fee768f925a

diff --git a/loleaflet/src/layer/marker/ProgressOverlay.js 
b/loleaflet/src/layer/marker/ProgressOverlay.js
index 91785e9..a6f7e35 100644
--- a/loleaflet/src/layer/marker/ProgressOverlay.js
+++ b/loleaflet/src/layer/marker/ProgressOverlay.js
@@ -20,6 +20,7 @@ L.ProgressOverlay = L.Layer.extend({
this.update();
}
 
+   this._spinnerInterval = 
L.LOUtil.startSpinner(this._spinnerCanvas, this.options.spinnerSpeed);
this._map.on('moveend', this.update, this);
},
 
@@ -56,8 +57,6 @@ L.ProgressOverlay = L.Layer.extend({
 
this._container.style.width  = this._size.x + 'px';
 
-   this._spinnerInterval = 
L.LOUtil.startSpinner(this._spinnerCanvas, this.options.spinnerSpeed);
-
L.DomEvent
.disableClickPropagation(this._progress)
.disableScrollPropagation(this._container);
commit 460ca57dab5aae99f10439dd0f66e7ebe89396c3
Author: Pranav Kant 
Date:   Thu Sep 22 23:42:11 2016 +0530

loleaflet: Smooth reconnection of documents

Change-Id: Id8e2b02ee47e163f046c81949d3d2ce75f330542

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 2c45d8e..3971f3e 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -74,13 +74,10 @@ L.Socket = L.Class.extend({
// TODO: Move the version number somewhere sensible.
this._doSend('loolclient ' + this.ProtocolVersionNumber);
 
-   var reconnecting = false;
var msg = 'load url=' + this._map.options.doc;
if (this._map._docLayer) {
// we are reconnecting after a lost connection
-   reconnecting = true;
msg += ' part=' + this._map.getCurrentPartNumber();
-   this._map.fire('statusindicator', {statusType : 
'reconnected'});
}
if (this._map.options.timestamp) {
msg += ' timestamp=' + this._map.options.timestamp;
@@ -101,10 +98,6 @@ L.Socket = L.Class.extend({
}
this._msgQueue = [];
 
-   if (reconnecting) {
-   this._map.setPermission(this._map.options.permission);
-   }
-
this._map._activate();
},
 
@@ -274,6 +267,11 @@ L.Socket = L.Class.extend({
this._map._docLayer = docLayer;
this._map.addLayer(docLayer);
this._map.fire('doclayerinit');
+   } else if (textMsg.startsWith('status:')) {
+   // we are reconnecting ...
+   

[Libreoffice-commits] online.git: 5 commits - loleaflet/src

2016-04-21 Thread Jan Holesovsky
 loleaflet/src/layer/tile/GridLayer.js |  238 +-
 loleaflet/src/layer/tile/TileLayer.js |1 
 2 files changed, 153 insertions(+), 86 deletions(-)

New commits:
commit 22e8f8b1fefc2cbb50c4be27d3a04df0604d8859
Author: Jan Holesovsky 
Date:   Thu Apr 21 11:31:32 2016 +0200

loleaflet: Group tile requests into rectangular areas, and call tilecombine.

Instead of asking for individual tiles, try to find rectangular areas in the
tile requests, and ask for the large rectangles using tilecombine, instead 
of
asking for individual tiles.

diff --git a/loleaflet/src/layer/tile/GridLayer.js 
b/loleaflet/src/layer/tile/GridLayer.js
index 2954ed0..fad90c0 100644
--- a/loleaflet/src/layer/tile/GridLayer.js
+++ b/loleaflet/src/layer/tile/GridLayer.js
@@ -779,7 +779,7 @@ L.GridLayer = L.Layer.extend({
 
_addTiles: function (coordsQueue, fragment) {
// first take care of the DOM
-   for (i = 0; i < coordsQueue.length; i++) {
+   for (var i = 0; i < coordsQueue.length; i++) {
var coords = coordsQueue[i];
 
var tilePos = this._getTilePos(coords),
@@ -821,25 +821,124 @@ L.GridLayer = L.Layer.extend({
}
}
 
-   // then ask for the actual tiles
-   for (i = 0; i < coordsQueue.length; i++) {
-   var coords = coordsQueue[i];
+   // sort the tiles by the rows
+   coordsQueue.sort(function(a, b){
+   if (a.y != b.y ) {
+   return a.y-b.y;
+   } else {
+   return a.x-b.x;
+   }
+   });
+
+   // try group the tiles into rectangular areas
+   var rectangles = [];
+   while (coordsQueue.length > 0) {
+   var coords = coordsQueue[0];
 
+   // tiles that do not interest us
var key = this._tileCoordsToKey(coords);
+   if (this._tileCache[key] || coords.part !== 
this._selectedPart) {
+   coordsQueue.splice(0, 1);
+   continue;
+   }
 
-   if (!this._tileCache[key]) {
-   if (coords.part === this._selectedPart) {
+   var rectQueue = [ coords ];
+   var bound = new L.Point(coords.x, coords.y);
+
+   // remove it
+   coordsQueue.splice(0, 1);
+
+   // find the close ones
+   var rowLocked = false;
+   var hasHole = false
+   var i = 0;
+   while (i < coordsQueue.length) {
+   var current = coordsQueue[i];
+
+   // extend the bound vertically if possible (so 
far it was
+   // continous)
+   if (!hasHole && (current.y == bound.y + 1)) {
+   rowLocked = true;
+   ++bound.y;
+   }
+
+   if (current.y > bound.y) {
+   break;
+   }
+
+   if (!rowLocked) {
+   if (current.y == bound.y && current.x 
== bound.x + 1) {
+   // extend the bound horizontally
+   ++bound.x;
+   rectQueue.push(current);
+   coordsQueue.splice(i, 1);
+   } else {
+   // ignore the rest of the row
+   rowLocked = true;
+   ++i;
+   }
+   } else if (current.x <= bound.x && current.y <= 
bound.y) {
+   // we are inside the bound
+   rectQueue.push(current);
+   coordsQueue.splice(i, 1);
+   } else {
+   // ignore this one, but there still may 
be other tiles
+   hasHole = true;
+   ++i;
+   }
+   }
+
+   rectangles.push(rectQueue);
+   }
+
+   for (var r = 0; r < rectangles.length; ++r) {
+   var rectQueue = rectangles[r];
+
+   

[Libreoffice-commits] online.git: 5 commits - loleaflet/src

2015-11-13 Thread Mihai Varga
 loleaflet/src/control/Control.ColumnHeader.js |  116 --
 loleaflet/src/control/Control.Fonts.js|2 
 loleaflet/src/control/Control.Formulabar.js   |4 
 loleaflet/src/control/Control.InsertImg.js|6 -
 loleaflet/src/control/Control.RowHeader.js|  108 +++-
 loleaflet/src/control/Control.Scroll.js   |4 
 loleaflet/src/control/Control.Styles.js   |   12 +-
 loleaflet/src/control/Toolbar.js  |2 
 loleaflet/src/core/Socket.js  |2 
 loleaflet/src/dom/DomEvent.MultiClick.js  |4 
 loleaflet/src/dom/DomEvent.js |2 
 loleaflet/src/layer/tile/CalcTileLayer.js |   68 +++
 loleaflet/src/layer/tile/TileLayer.js |   51 +--
 loleaflet/src/map/handler/Map.FileInserter.js |1 
 loleaflet/src/map/handler/Map.Keyboard.js |5 -
 loleaflet/src/map/handler/Map.Mouse.js|4 
 loleaflet/src/map/handler/Map.Print.js|2 
 loleaflet/src/map/handler/Map.SlideShow.js|   14 +--
 18 files changed, 202 insertions(+), 205 deletions(-)

New commits:
commit d8b91fbc293b61a35e9cdef4e260a47dc0dd20fa
Author: Mihai Varga 
Date:   Fri Nov 13 11:27:54 2015 +0200

loleaflet: fixed js lint errors in src/control/*

diff --git a/loleaflet/src/control/Control.ColumnHeader.js 
b/loleaflet/src/control/Control.ColumnHeader.js
index b2f9af4..b38fee1 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -3,75 +3,73 @@
 */
 
 L.Control.ColumnHeader = L.Control.extend({
-onAdd: function (map) {
-var docContainer = L.DomUtil.get('document-container');
-var divHeader = L.DomUtil.create('div', 
'spreadsheet-container-column', docContainer.parentElement);
-var tableContainer =  L.DomUtil.create('table', 
'spreadsheet-container-table', divHeader);
-var tbodyContainer = L.DomUtil.create('tbody', '', 
tableContainer);
-var trContainer = L.DomUtil.create('tr', '', tbodyContainer);
-L.DomUtil.create('th', 'spreadsheet-container-th-corner', 
trContainer);
-var thColumns = L.DomUtil.create('th', 
'spreadsheet-container-th-column', trContainer);
-var divInner = L.DomUtil.create('div', 
'spreadsheet-container-column-inner', thColumns);
-this._table = L.DomUtil.create('table', '', divInner);
-this._table.id = 'spreadsheet-table-column';
-L.DomUtil.create('tbody', '', this._table);
-this._columns = L.DomUtil.create('tr','', 
this._table.firstChild);
+   onAdd: function () {
+   var docContainer = L.DomUtil.get('document-container');
+   var divHeader = L.DomUtil.create('div', 
'spreadsheet-container-column', docContainer.parentElement);
+   var tableContainer =  L.DomUtil.create('table', 
'spreadsheet-container-table', divHeader);
+   var tbodyContainer = L.DomUtil.create('tbody', '', 
tableContainer);
+   var trContainer = L.DomUtil.create('tr', '', tbodyContainer);
+   L.DomUtil.create('th', 'spreadsheet-container-th-corner', 
trContainer);
+   var thColumns = L.DomUtil.create('th', 
'spreadsheet-container-th-column', trContainer);
+   var divInner = L.DomUtil.create('div', 
'spreadsheet-container-column-inner', thColumns);
+   this._table = L.DomUtil.create('table', '', divInner);
+   this._table.id = 'spreadsheet-table-column';
+   L.DomUtil.create('tbody', '', this._table);
+   this._columns = L.DomUtil.create('tr', '', 
this._table.firstChild);
 
-this._position = 0;
+   this._position = 0;
 
-// dummy initial header
-L.DomUtil.create('th','spreadsheet-table-column-cell', 
this._columns);
+   // dummy initial header
+   L.DomUtil.create('th', 'spreadsheet-table-column-cell', 
this._columns);
 
-return document.createElement('div');
-},
+   return document.createElement('div');
+   },
 
-clearColumns : function () {
-L.DomUtil.remove(this._columns);
-this._columns = L.DomUtil.create('tr', '', 
this._table.firstChild);
-},
+   clearColumns : function () {
+   L.DomUtil.remove(this._columns);
+   this._columns = L.DomUtil.create('tr', '', 
this._table.firstChild);
+   },
 
 
-setScrollPosition: function (position) {
-this._position = position;
-L.DomUtil.setStyle(this._table, 'left', this._position + 'px');
-},
+   setScrollPosition: function (position) {
+   this._position = position;
+   L.DomUtil.setStyle(this._table, 'left', this._position + 'px');
+   

[Libreoffice-commits] online.git: 5 commits - loleaflet/src loolwsd/bundled loolwsd/LOKitClient.cpp loolwsd/LOOLSession.cpp

2015-11-05 Thread Andrzej Hunt
 loleaflet/src/layer/tile/TileLayer.js|   72 ++-
 loolwsd/LOKitClient.cpp  |1 
 loolwsd/LOOLSession.cpp  |5 
 loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |9 +
 4 files changed, 84 insertions(+), 3 deletions(-)

New commits:
commit 96965bec95370e595eb213ed76e8c10ea5c47556
Author: Andrzej Hunt 
Date:   Thu Nov 5 09:57:29 2015 +0100

loleaflet: update .uno:CellCursor parameter format

This mirrors the parameter format for .uno:ViewRowColumnHeaders

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 60fadd9..3cdf098 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -943,11 +943,11 @@ L.TileLayer = L.GridLayer.extend({
// hence we need to request an updated cell cursor position for this 
level.
_onCellCursorShift: function (bForce) {
if (this._cellCursorMarker || bForce) {
-   L.Socket.sendMessage('commandvalues 
command=.uno:CellCursor:'
-+ '' + this._tileSize + ','
-+ '' + this._tileSize + ','
-+ '' + this._tileWidthTwips + ','
-+ '' + this._tileHeightTwips );
+   L.Socket.sendMessage('commandvalues 
command=.uno:CellCursor'
++ '?outputHeight=' + this._tileSize
++ '=' + this._tileSize
++ '=' + 
this._tileWidthTwips
++ '=' + 
this._tileHeightTwips );
}
},
 
commit d9d0d47514fef09d0606abcf7dc48b6b977c8987
Author: Andrzej Hunt 
Date:   Wed Nov 4 15:44:29 2015 +0100

loleaflet: tdf#94605 Show cell cursor

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 6dc4d1f..60fadd9 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -66,6 +66,10 @@ L.TileLayer = L.GridLayer.extend({
this._graphicSelectionTwips = new L.bounds(new L.point(0, 0), 
new L.point(0, 0));
// Rectangle graphic selection
this._graphicSelection = new L.LatLngBounds(new L.LatLng(0, 0), 
new L.LatLng(0, 0));
+   // Original rectangle of cell cursor in twips
+   this._cellCursorTwips = new L.bounds(new L.point(0, 0), new 
L.point(0, 0));
+   // Rectangle for cell cursor
+   this._cellCursor = new L.LatLngBounds(new L.LatLng(0, 0), new 
L.LatLng(0, 0));
// Position and size of the selection start (as if there would 
be a cursor caret there).
 
this._lastValidPart = -1;
@@ -110,10 +114,21 @@ L.TileLayer = L.GridLayer.extend({
map.on('paste', this._onPaste, this);
map.on('zoomend', this._onUpdateCursor, this);
map.on('zoomend', this._onUpdatePartPageRectangles, this);
+   map.on('zoomend', this._onCellCursorShift, this);
map.on('dragstart', this._onDragStart, this);
map.on('requestloksession', this._onRequestLOKSession, this);
map.on('error', this._mapOnError, this);
map.on('resize', this._fitDocumentHorizontally, this);
+   // Retrieve the initial cell cursor position (as LOK only sends 
us an
+   // updated cell cursor when the selected cell is changed and 
not the initial
+   // cell).
+   map.on('statusindicator',
+  function (e) {
+if (e.statusType === 'alltilesloaded') {
+  this._onCellCursorShift(true);
+}
+  },
+  this);
for (var key in this._selectionHandles) {
this._selectionHandles[key].on('drag dragend', 
this._onSelectionHandleDrag, this);
}
@@ -204,6 +219,9 @@ L.TileLayer = L.GridLayer.extend({
else if (textMsg.startsWith('graphicselection:')) {
this._onGraphicSelectionMsg(textMsg);
}
+   else if (textMsg.startsWith('cellcursor:')) {
+   this._onCellCursorMsg(textMsg);
+   }
else if (textMsg.startsWith('hyperlinkclicked:')) {
this._onHyperlinkClickedMsg(textMsg);
}
@@ -264,7 +282,9 @@ L.TileLayer = L.GridLayer.extend({
 
_onCommandValuesMsg: function (textMsg) {
var obj = JSON.parse(textMsg.substring(textMsg.indexOf('{')));
-   if