[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-4' - loleaflet/html loleaflet/src

2020-06-08 Thread Michael Meeks (via logerrit)
 loleaflet/html/loleaflet.html.m4|2 +
 loleaflet/src/control/Control.JSDialogBuilder.js|   36 ++--
 loleaflet/src/control/Control.NotebookbarBuilder.js |2 -
 loleaflet/src/core/LOUtil.js|   19 ++
 loleaflet/src/layer/FormFieldButtonLayer.js |2 -
 loleaflet/src/layer/marker/Annotation.js|2 -
 loleaflet/src/layer/tile/TileLayer.js   |2 -
 loleaflet/src/map/Map.js|2 -
 8 files changed, 44 insertions(+), 23 deletions(-)

New commits:
commit 8bfa1318b246d7c9df2b1d22d2e8094205a53acd
Author: Michael Meeks 
AuthorDate: Mon Jun 8 13:28:55 2020 +0100
Commit: Andras Timar 
CommitDate: Mon Jun 8 22:12:39 2020 +0200

Proxy: centralize URL building and use absolute URL for images.

Fixes missing images on mobile.

Change-Id: If5f858cec5fc81ea50c4679162b36eb000f6d872
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95803
Tested-by: Jenkins
Reviewed-by: Michael Meeks 
(cherry picked from commit 33ae2bec0fddd3f21ef2278ada0b8ac62252d87d)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95821
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4
index 547c603c5..d3c3e21de 100644
--- a/loleaflet/html/loleaflet.html.m4
+++ b/loleaflet/html/loleaflet.html.m4
@@ -231,6 +231,7 @@ m4_ifelse(MOBILEAPP,[true],
 m4_ifelse(MOBILEAPP,[true],
  [window.host = '';
   window.serviceRoot = '';
+  window.versionPath = '%VERSION%';
   window.accessToken = '';
   window.accessTokenTTL = '';
   window.accessHeader = '';
@@ -246,6 +247,7 @@ m4_ifelse(MOBILEAPP,[true],
   window.tileSize = 256;],
  [window.host = '%HOST%';
   window.serviceRoot = '%SERVICE_ROOT%';
+  window.versionPath = '%VERSION%';
   window.accessToken = '%ACCESS_TOKEN%';
   window.accessTokenTTL = '%ACCESS_TOKEN_TTL%';
   window.accessHeader = '%ACCESS_HEADER%';
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 5498d04dd..71bf67726 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -53,7 +53,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
var commandName = data.id ? 
data.id.substring('.uno:'.length) : data.id;
if (commandName && commandName.length && 
L.LOUtil.existsIconForCommand(commandName, builder.map.getDocType())) {
var image = L.DomUtil.create('img', 
'spinfieldimage', div);
-   var icon = builder._createIconPath(data.id);
+   var icon = builder._createIconURL(data.id);
image.src = icon;
icon.alt = '';
}
@@ -396,7 +396,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
}
},
 
-   _explorableEntry: function(parentContainer, data, content, builder, 
valueNode, iconPath, updateCallback) {
+   _explorableEntry: function(parentContainer, data, content, builder, 
valueNode, iconURL, updateCallback) {
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)
@@ -409,10 +409,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
var titleClass = '';
console.debug('sectionTitle.id' + sectionTitle.id);
if (sectionTitle.id === 'paperformat' || sectionTitle.id === 
'orientation' || sectionTitle.id === 'masterslide' || sectionTitle.id === 
'SdTableDesignPanel')
-   iconPath = 'images/lc_'+ sectionTitle.id.toLowerCase() 
+'.svg';
-   if (iconPath) {
+   iconURL = L.LOUtil.getImageURL('lc_'+ 
sectionTitle.id.toLowerCase() +'.svg');
+   if (iconURL) {
var icon = L.DomUtil.create('img', 'menu-entry-icon', 
leftDiv);
-   icon.src = iconPath;
+   icon.src = iconURL;
icon.alt = '';
titleClass = 'menu-entry-with-icon';
}
@@ -567,9 +567,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
if (commandName && commandName.length && 
L.LOUtil.existsIconForCommand(commandName, builder.map.getDocType())) {
var iconName = 
builder._generateMenuIconName(commandName);
var iconSpan = L.DomUtil.create('span', 
'menu-entry-icon ' + iconName, sectionTitle);
-   var iconPath = 'images/lc_' + iconName + '.svg';
+ 

[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-4' - loleaflet/html loleaflet/src wsd/ClientSession.cpp

2020-06-08 Thread Samuel Mehrbrodt (via logerrit)
 loleaflet/html/framed.doc.html |2 ++
 loleaflet/src/core/Socket.js   |   19 ++-
 wsd/ClientSession.cpp  |   13 -
 3 files changed, 20 insertions(+), 14 deletions(-)

New commits:
commit eeb8b737420f22550052f7e26d540ef8cb0fa2f8
Author: Samuel Mehrbrodt 
AuthorDate: Tue May 19 11:45:04 2020 +0200
Commit: Andras Timar 
CommitDate: Mon Jun 8 10:28:23 2020 +0200

tdf#131123 Report back save result

Change-Id: Ie3dee5d344bc65c325b95f2746c9734bdd9e2f9d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94490
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95704
Reviewed-by: Andras Timar 

diff --git a/loleaflet/html/framed.doc.html b/loleaflet/html/framed.doc.html
index 0b68c698d..c58d306c9 100644
--- a/loleaflet/html/framed.doc.html
+++ b/loleaflet/html/framed.doc.html
@@ -107,6 +107,8 @@
   if (msg.Values) {
 if (msg.Values.success == true) {
   document.getElementById("ModifiedStatus").innerHTML = "Saved";
+} else {
+  document.getElementById("ModifiedStatus").innerHTML = "Error 
during save";
 }
   }
 }
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index a5e394c67..9f48d3145 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -358,9 +358,16 @@ L.Socket = L.Class.extend({
}
else if (textMsg.startsWith('commandresult: ')) {
var commandresult = 
JSON.parse(textMsg.substring(textMsg.indexOf('{')));
-   if (commandresult['command'] === 'savetostorage' && 
commandresult['success']) {
-   // Close any open confirmation dialogs
-   vex.closeAll();
+   if (commandresult['command'] === 'savetostorage' || 
commandresult['command'] === 'save') {
+   if (commandresult['success']) {
+   // Close any open confirmation dialogs
+   vex.closeAll();
+   }
+
+   var postMessageObj = {
+   success: commandresult['success']
+   };
+   this._map.fire('postMessage', {msgId: 
'Action_Save_Resp', args: postMessageObj});
}
return;
}
@@ -744,12 +751,6 @@ L.Socket = L.Class.extend({
}
});
}
-
-   // Issue the save response to be consistent 
with normal save.
-   var postMessageObj = {
-   success: true
-   };
-   this._map.fire('postMessage', {msgId: 
'Action_Save_Resp', args: postMessageObj});
}
// var name = command.name; - ignored, we get the new 
name via the wopi's BaseFileName
}
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 20b1ed011..3f37c88c4 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -552,8 +552,11 @@ bool ClientSession::_handleInput(const char *buffer, int 
length)
 
 constexpr bool isAutosave = false;
 constexpr bool isExitSave = false;
-docBroker->sendUnoSave(getId(), dontTerminateEdit != 0, 
dontSaveIfUnmodified != 0,
+bool result = docBroker->sendUnoSave(getId(), dontTerminateEdit != 
0, dontSaveIfUnmodified != 0,
 isAutosave, isExitSave, extendedData);
+std::string resultstr = result ? "true" : "false";
+std::string msg = "commandresult: { \"command\": \"save\", 
\"success\": " + resultstr + " }";
+docBroker->broadcastMessage(msg);
 }
 }
 else if (tokens.equals(0, "savetostorage"))
@@ -562,10 +565,10 @@ bool ClientSession::_handleInput(const char *buffer, int 
length)
 if (tokens.size() > 1)
 getTokenInteger(tokens[1], "force", force);
 
-if (docBroker->saveToStorage(getId(), true, "" /* This is irrelevant 
when success is true*/, true))
-{
-docBroker->broadcastMessage("commandresult: { \"command\": 
\"savetostorage\", \"success\": true }");
-}
+bool result = docBroker->saveToStorage(getId(), true, "" /* This is 
irrelevant when success is true*/, true);
+std::string resultstr = result ? "true" : "false";
+std::string msg = "commandresult: { \"command\": \"savetostorage\", 
\"success\": " + resultstr + " }";
+docBroker->broadcastMessage(msg);
 }
 else if