[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - loleaflet/dist loleaflet/src

2018-11-08 Thread Libreoffice Gerrit user
 loleaflet/dist/toolbar/w2ui-1.5.rc1.js|2 +-
 loleaflet/src/core/LOUtil.js  |2 +-
 loleaflet/src/layer/marker/ProgressOverlay.js |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit fc511aaf049c3e5fe5316018ba945cfaafd956d0
Author: Ashod Nakashian 
AuthorDate: Thu Nov 8 11:05:22 2018 -0500
Commit: Michael Meeks 
CommitDate: Thu Nov 8 20:15:07 2018 +0100

leaflet: reduce some animation timeouts to avoid hammering cpu/browser

Change-Id: I4194db181f1cc0f89c906cbb87846c89df47e4ee
Reviewed-on: https://gerrit.libreoffice.org/63108
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/loleaflet/dist/toolbar/w2ui-1.5.rc1.js 
b/loleaflet/dist/toolbar/w2ui-1.5.rc1.js
index 89f54de62..b9f7d778d 100644
--- a/loleaflet/dist/toolbar/w2ui-1.5.rc1.js
+++ b/loleaflet/dist/toolbar/w2ui-1.5.rc1.js
@@ -2093,7 +2093,7 @@ w2utils.event = {
 hideTag();
 return;
 }
-if (!instant) setTimeout(checkIfMoved, 100);
+if (!instant) setTimeout(checkIfMoved, 200);
 // monitor if moved
 var posClass = 'w2ui-tag-right';
 var posLeft  = parseInt(offset.left + el.offsetWidth + 
(options.left ? options.left : 0));
diff --git a/loleaflet/src/core/LOUtil.js b/loleaflet/src/core/LOUtil.js
index fad8ad527..42c513736 100644
--- a/loleaflet/src/core/LOUtil.js
+++ b/loleaflet/src/core/LOUtil.js
@@ -38,7 +38,7 @@ L.LOUtil = {
context.beginPath();
context.arc(x, y, radius, 0, Math.PI * 1.3);
context.stroke();
-   }, 1);
+   }, 30);
 
return spinnerInterval;
},
diff --git a/loleaflet/src/layer/marker/ProgressOverlay.js 
b/loleaflet/src/layer/marker/ProgressOverlay.js
index a6f7e3532..4a60e89c5 100644
--- a/loleaflet/src/layer/marker/ProgressOverlay.js
+++ b/loleaflet/src/layer/marker/ProgressOverlay.js
@@ -5,7 +5,7 @@
 L.ProgressOverlay = L.Layer.extend({
 
options: {
-   spinnerSpeed: 1.5
+   spinnerSpeed: 15
},
 
initialize: function (latlng, size) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - loleaflet/dist loleaflet/src

2018-07-04 Thread Tor Lillqvist
 loleaflet/dist/leaflet.css |   10 +++---
 loleaflet/src/map/Map.js   |6 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 874b54a193c462a147a370e35f7b84ec4ca363e3
Author: Tor Lillqvist 
Date:   Wed Jul 4 16:51:14 2018 +0300

Better and more dynamic way to show ruler conditionally

Use conditional CSS, setting the ruler height to zero if it would be
too high. Now the ruler even shows up and disappears dynamically as
the window height changes, for instance when turning a mobile device
between landscape and portrait orientation. No JS conditional needed
after all.

Change-Id: I9046d8b9535de60902142a1fc6e45dd6f4c5e5a0
Reviewed-on: https://gerrit.libreoffice.org/56951
Reviewed-by: Henry Castro 
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index 6cee86cf2..d42802bef 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -775,14 +775,18 @@ input.clipboard {
 
 .loleaflet-ruler {
background-color: #efefef;
-   /* If you change the below 20px, also change the window height limit
-* in the doclayerinit thing in Map.js.
-*/
height: 20px;
width: 100vw;
margin: 0px;
}
 
+/* The 20px above is 5% of the 400px below. */
+@media screen and (max-height: 400px) {
+   .loleaflet-ruler {
+   height: 0px;
+   }
+}
+
 .loleaflet-ruler-breakcontainer {
height: 100%;
position: absolute;
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 1791e240e..b3ef7730b 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -117,11 +117,7 @@ L.Map = L.Evented.extend({
if (!this.initComplete) {
this._fireInitComplete('doclayerinit');
}
-   // Don't show the ruler if the window is small. Use 5% 
of window height as
-   // the fairly arbitrary limit how high the ruler can 
be. We "know" (from
-   // leaflet.css, .loleaflet-ruler, height) that the 
ruler height is 20px.
-   // That makes the limit 400px.
-   if ($(window).height() >= 400 && 
this._docLayer._docType == 'text') {
+   if (this._docLayer._docType == 'text') {
var interactiveRuler = this._permission === 
'edit' ? true : false;
L.control.ruler({position:'topleft', 
interactive:interactiveRuler}).addTo(this);
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - loleaflet/dist loleaflet/src

2018-07-04 Thread Tor Lillqvist
 loleaflet/dist/leaflet.css |3 +++
 loleaflet/src/map/Map.js   |6 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 3ff7a36fdbc800658f56db8f97eafd0490755610
Author: Tor Lillqvist 
Date:   Wed Jul 4 13:24:34 2018 +0300

Don't show the ruler if the window has too small height

Of course, for this to really be worthy of being called "responsive"
web design, we should update this decision also if the window is
re-sized dynamically, like when a desktop browser's window is
arbitrarily re-sized by the user, or a mobile device is rotated
between portrait and landscape orientation, or a mobile device enters
or leaves some kind of split-screen mode where another application
than the browser shares the display.

We use 5% of the window height as the limit for how much vertical
space the ruler can occupy. Sadly I don't know if there is any way to
get the height attribute of .loleaflet-ruler in
loleaflet/dist/leaflet.css (which is 20px) in Map.js, so I hard-code
the limit of window height as the magic value 400 (5% of 400 is 20).

Change-Id: I02bb54f309bc116ae1a0b5264e72b9ba674f56e4
Reviewed-on: https://gerrit.libreoffice.org/56940
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index d1a615a50..6cee86cf2 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -775,6 +775,9 @@ input.clipboard {
 
 .loleaflet-ruler {
background-color: #efefef;
+   /* If you change the below 20px, also change the window height limit
+* in the doclayerinit thing in Map.js.
+*/
height: 20px;
width: 100vw;
margin: 0px;
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index b3ef7730b..1791e240e 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -117,7 +117,11 @@ L.Map = L.Evented.extend({
if (!this.initComplete) {
this._fireInitComplete('doclayerinit');
}
-   if (this._docLayer._docType == 'text') {
+   // Don't show the ruler if the window is small. Use 5% 
of window height as
+   // the fairly arbitrary limit how high the ruler can 
be. We "know" (from
+   // leaflet.css, .loleaflet-ruler, height) that the 
ruler height is 20px.
+   // That makes the limit 400px.
+   if ($(window).height() >= 400 && 
this._docLayer._docType == 'text') {
var interactiveRuler = this._permission === 
'edit' ? true : false;
L.control.ruler({position:'topleft', 
interactive:interactiveRuler}).addTo(this);
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - loleaflet/dist loleaflet/src

2018-04-05 Thread Tor Lillqvist
 loleaflet/dist/framed.html|  117 ++
 loleaflet/src/layer/tile/TileLayer.js |9 ++
 loleaflet/src/map/handler/Map.WOPI.js |7 ++
 3 files changed, 133 insertions(+)

New commits:
commit 9975e51d60bb9924407d1f32423a29e9adde316e
Author: Tor Lillqvist 
Date:   Thu Jan 18 18:54:20 2018 +0200

Add handling of the SetCellColor proof-of-concept postMessage event

When we receive such a message, we forward it to the corresponding
Python script (from core's scripting/examples/python/SetCellColor.py).
We also save the event's source so that we can send the return value
of the script back to its window.

Change-Id: I1f54a9937d6c9b91fb15cdfde329223cf8db
(cherry picked from commit 0b77d1b1761f4bb64862ed38b2b8d6f152e9beaa)
(cherry picked from commit 05917b9a46f4784a3d88b52c00b0ff821e7bbaf9)
(cherry picked from commit d43c3ec8595436ed2fc215219043f676d3ef59f6)
(cherry picked from commit fdaa96cff0d7230429b8e86fbd63fac14608f3af)
(cherry picked from commit a0158a143230a3ed573c56275f51d857f61d8da3)
Reviewed-on: https://gerrit.libreoffice.org/52104
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/dist/framed.html b/loleaflet/dist/framed.html
new file mode 100644
index 0..f45054d4f
--- /dev/null
+++ b/loleaflet/dist/framed.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+  
+
+Online Editor
+
+
+  function callPythonScript() {
+window.frames[0].postMessage(JSON.stringify({'MessageId': 
'Host_PostmessageReady'}), '*');
+var x = document.forms[0].elements['x'].value;
+var y = document.forms[0].elements['y'].value;
+var color = document.forms[0].elements['color'].value;
+console.log('x=' + x + ' y=' + y + ' color=' + color);
+color = parseInt('0x' + color.substring(1));
+console.log('x=' + x + ' y=' + y + ' color=' + color);
+window.frames[0].postMessage(JSON.stringify({'MessageId': 
'CallPythonScript',
+ 'SendTime': Date.now(),
+ 'ScriptFile': 
'SetCellColor.py',
+ 'Function': 
'SetCellColor',
+ 'Values': {'x': {'type': 
'long', 'value': x},
+'y': {'type': 
'long', 'value': y},
+'color': 
{'type': 'long', 'value': color}
+}
+ }),
+ '*');
+  }
+
+  function receiveMessage(event) {
+var msg = JSON.parse(event.data);
+console.log(' framed.html receiveMessage: ' + event.data);
+console.log(' ' + msg);
+if (msg.hasOwnProperty('MessageId') &&
+msg.MessageId === 'CallPythonScript-Result' &&
+msg.hasOwnProperty('Values') &&
+msg.Values.hasOwnProperty('commandName') &&
+   msg.Values.commandName === 
'vnd.sun.star.script:SetCellColor.py$SetCellColor?language=Python&location=share'
 &&
+   msg.Values.hasOwnProperty('success') &&
+   msg.Values.success == 'true' &&
+   msg.Values.hasOwnProperty('result') &&
+   msg.Values.result.hasOwnProperty('value')) {
+  document.forms[0].elements['result'].readOnly = false;
+  document.forms[0].elements['result'].value = msg.Values.result.value;
+  document.forms[0].elements['result'].readOnly = true;
+}
+  }
+  window.addEventListener("message", receiveMessage, false);
+
+
+
+
+  
+
+  
+
+
+  
+   Cell: (, 
),
+   colour: 
+   
+   Click here
+   to send message to iframe below. It returned .
+  
+
+
+
+
+http://snorken.local:9980/loleaflet/94781ec6/loleaflet.html?file_path=file:///home/tml/lo/internal-online/test/data/empty.ods=true;
 height="1000" width="1000">
+  
+
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 4fdee2095..330c86c90 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1081,6 +1081,7 @@ L.TileLayer = L.GridLayer.extend({
},
 
_onUnoCommandResultMsg: function (textMsg) {
+   // console.log('_onUnoCommandResultMsg: "' + textMsg + '"');
textMsg = textMsg.substring(18);
var obj = JSON.parse(textMsg);
var commandName = obj.commandName;
@@ -1094,6 +1095,14 @@ L.TileLayer = L.GridLayer.extend({
this._map.hideBusy();
this._map.fire('commandresult', {commandName: commandName, 
success: 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - loleaflet/dist loleaflet/src

2018-03-27 Thread Pranav Kant
 loleaflet/dist/loleaflet.css   |6 +-
 loleaflet/src/control/Control.LokDialog.js |6 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 0a96e51c98e2672b074d59b87fa9470922fe2c08
Author: Pranav Kant 
Date:   Tue Mar 27 15:13:41 2018 +0200

lokdialog: Don't show the title bar when no title was provided.

Change-Id: If08dc81e88d35a924d10695a38b138f6403e58bd
Reviewed-on: https://gerrit.libreoffice.org/51955
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index e6389f06b..3ffd36737 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -339,6 +339,10 @@ body {
text-indent: 1px;
 }
 
+.lokdialog_container.lokdialog_notitle .ui-dialog-titlebar {
+   display: none;
+}
+
 .lokdialog_container.ui-dialog.ui-widget-content {
padding: 0px;
overflow: visible;
@@ -373,4 +377,4 @@ body {
 .vex.vex-theme-bottom-right-corner .vex-content {
bottom: 40px !important;
right: 10px !important;
-}
\ No newline at end of file
+}
diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 930655d2f..4f3e01d05 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -240,6 +240,10 @@ L.Control.LokDialog = L.Control.extend({
 
L.DomEvent.on(dialogCanvas, 'contextmenu', 
L.DomEvent.preventDefault);
 
+   var dialogClass = 'lokdialog_container';
+   if (!title)
+   dialogClass += ' lokdialog_notitle';
+
var that = this;
$(dialogContainer).dialog({
minWidth: width,
@@ -248,7 +252,7 @@ L.Control.LokDialog = L.Control.extend({
modal: false,
closeOnEscape: true,
resizable: false,
-   dialogClass: 'lokdialog_container',
+   dialogClass: dialogClass,
close: function() {
that._onDialogClose(that._toRawDlgId(strDlgId), 
true);
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - loleaflet/dist loleaflet/src

2018-03-12 Thread Jan Holesovsky
 loleaflet/dist/loleaflet.css   |5 +++--
 loleaflet/src/control/Control.LokDialog.js |9 -
 2 files changed, 3 insertions(+), 11 deletions(-)

New commits:
commit 5b140f1bfd332aeb9a8544b765b754eea1c8a608
Author: Jan Holesovsky 
Date:   Mon Mar 12 16:48:29 2018 +0100

lokdialog: Don't strip the sub-menus in tunneled context menu.

Simplifies the vertical growing / shrinking of listbox popups too.

Change-Id: I8d8aa7e07a5bf9119713363dd95a5db843683feb
Reviewed-on: https://gerrit.libreoffice.org/51154
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index fac0c79cb..e6389f06b 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -341,7 +341,7 @@ body {
 
 .lokdialog_container.ui-dialog.ui-widget-content {
padding: 0px;
-   overflow: hidden;
+   overflow: visible;
width: auto;
height: auto;
border: none;
@@ -350,7 +350,8 @@ body {
 }
 
 .lokdialog.ui-dialog-content.ui-widget-content {
-padding: 0px;
+   padding: 0px;
+   overflow: visible;
 }
 
 .lokdialog_canvas {
diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 7b43848ba..11a18ce78 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -227,7 +227,6 @@ L.Control.LokDialog = L.Control.extend({
var dialogContainer = L.DomUtil.create('div', 'lokdialog', 
document.body);
L.DomUtil.setStyle(dialogContainer, 'padding', '0px');
L.DomUtil.setStyle(dialogContainer, 'margin', '0px');
-   L.DomUtil.setStyle(dialogContainer, 'overflow', 'hidden');
dialogContainer.id = strDlgId;
 
var dialogCanvas = L.DomUtil.create('canvas', 
'lokdialog_canvas', dialogContainer);
@@ -373,14 +372,6 @@ L.Control.LokDialog = L.Control.extend({
ctx.drawImage(img, 0, 0);
};
img.src = imgData;
-
-   // increase the height of the container,
-   // so that if the floating window goes out of the parent,
-   // it doesn't get stripped off
-   height = parseInt(canvas.style.top) + canvas.height;
-   var currentHeight = parseInt($('#' + strDlgId).css('height'));
-   if (height > currentHeight)
-   $('#' + strDlgId).css('height', height + 'px');
},
 
_onDialogChildClose: function(dialogId) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits