[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-5' - 5 commits - discovery.xml loleaflet/js loleaflet/src

Andras Timar (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 26 09:34:21 UTC 2020


 discovery.xml                             |   18 ---------------
 loleaflet/js/global.js                    |   35 +++++++++++++++++++-----------
 loleaflet/src/control/Control.Menubar.js  |    2 -
 loleaflet/src/control/Toolbar.js          |    9 +++++++
 loleaflet/src/map/handler/Map.Keyboard.js |    2 -
 5 files changed, 34 insertions(+), 32 deletions(-)

New commits:
commit 7bbb8a872bc17df6386f43cec5fa5b6b4ef48a55
Author:     Andras Timar <andras.timar at collabora.com>
AuthorDate: Fri Jun 26 10:59:12 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 26 11:33:57 2020 +0200

    existing integrations prefer text/rtf
    
    Change-Id: Ia85c198178d6c3f579d69bb7df3b131ffcaa4847

diff --git a/discovery.xml b/discovery.xml
index 95c346240..b694f97d3 100644
--- a/discovery.xml
+++ b/discovery.xml
@@ -251,7 +251,7 @@
         <app name="application/x-pagemaker">
             <action name="view" default="true" ext="p65"/>
         </app>
-        <app name="application/rtf">
+        <app name="text/rtf">
             <action name="edit" default="true" ext="rtf"/>
         </app>
         <app name="text/plain">
commit 4b9bd350d206fd8a76b14a7214f14897378392ec
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Jun 25 11:59:50 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 26 11:33:53 2020 +0200

    Remove duplicating extensions from discovery
    
    Fixes the problem that binding with SharePoint using New-SPWOPIBinding
    is only possible when specific extensions or applications are specified.
    Trying to bind all information from discovery resulted in error:
    
        New-SPWOPIBinding : One or more of the WOPI bindings specified in
        New-SPWOPIBinding already exist. The operation has been cancelled.
    
    Change-Id: I5675c4cee8b68b81b5c0971a5dc577f653a1ae5b
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97063
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/discovery.xml b/discovery.xml
index 0f114c095..95c346240 100644
--- a/discovery.xml
+++ b/discovery.xml
@@ -254,9 +254,6 @@
         <app name="application/rtf">
             <action name="edit" default="true" ext="rtf"/>
         </app>
-        <app name="text/rtf">
-            <action name="edit" default="true" ext="rtf"/>
-        </app>
         <app name="text/plain">
             <action name="edit" default="true" ext="txt"/>
         </app>
@@ -266,15 +263,9 @@
         <app name="application/clarisworks">
             <action name="view" default="true" ext="cwk"/>
         </app>
-        <app name="application/vnd.corel-draw">
-            <action name="view" default="true" ext="cdr"/>
-        </app>
         <app name="image/x-wpg">
             <action name="view" default="true" ext="wpg"/>
         </app>
-        <app name="application/prs.plucker">
-            <action name="view" default="true" ext="pdb"/>
-        </app>
         <app name="application/x-iwork-pages-sffpages">
             <action name="view" default="true" ext="pages"/>
         </app>
@@ -290,21 +281,12 @@
         <app name="image/x-freehand">
             <action name="view" default="true" ext="fh"/>
         </app>
-        <app name="application/vnd.palm">
-            <action name="view" default="true" ext="pdb"/>
-        </app>
         <app name="application/vnd.sun.xml.chart">
             <action name="view" default="true" ext="sxs"/>
         </app>
-        <app name="application/vnd.sun.xml.writer.web">
-            <action name="view" default="true" ext="stw"/>
-        </app>
         <app name="application/x-t602">
             <action name="view" default="true" ext="602"/>
         </app>
-        <app name="application/vnd.sun.xml.report.chart">
-            <action name="edit" default="true" ext="odc"/>
-        </app>
         <app name="image/bmp">
             <action name="view" ext="bmp"/>
         </app>
commit bde3255e8cbea4bc9064c39e755ea279151b406c
Author:     mert <mert.tumer at collabora.com>
AuthorDate: Thu Jun 25 18:53:39 2020 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 26 11:33:49 2020 +0200

    Fix images are not shown in online help page on proxy
    
    Relative urls must be replaced for proxy
    
    Change-Id: Ia1d888941c33736c4eb19070aec73c5bdd6fa197
    Signed-off-by: mert <mert.tumer at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97166
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Tested-by: Jenkins
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit 29c92b5c8db5b470facf09b19811805a9ea69192)
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97138

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 1ce90a3ba..6f76e0540 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -254,6 +254,15 @@ L.Map.include({
 						}
 					} else /* id === 'online-help' */ {
 						document.getElementById('keyboard-shortcuts').style.display='none';
+						if (window.socketProxy) {
+							var helpdiv = document.getElementById('online-help');
+							var imgList = helpdiv.querySelectorAll('img');
+							for (var p = 0; p < imgList.length; p++) {
+								var imgSrc = imgList[p].src;
+								imgSrc = imgSrc.substring(imgSrc.indexOf('/images'));
+								imgList[p].src = window.host + window.serviceRoot + '/loleaflet/dist'+ imgSrc;
+							}
+						}
 						// Display help according to document opened
 						if (map.getDocType() === 'text') {
 							var x = document.getElementsByClassName('text');
commit 239ad06fbc44d17d4b5f2599347850d3cb853a39
Author:     Andras Timar <andras.timar at collabora.com>
AuthorDate: Thu Jun 25 12:18:36 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 26 11:33:45 2020 +0200

    Fix: when help was invoked with F1 %productName was not replaced
    
    Change-Id: I2f0255e0aedbe70116b2fb7423b0d077c14fa7b4
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97068
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index c8d12a868..283318f2e 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -1295,7 +1295,7 @@ L.Control.Menubar = L.Control.extend({
 
 		// handle help - F1
 		if (e.type === 'keydown' && !e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode == 112) {
-			self._map.showHelp();
+			self._map.showHelp('online-help');
 		}
 	},
 
diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index 6ba2dc165..6ea10c40e 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -308,7 +308,7 @@ L.Map.Keyboard = L.Handler.extend({
 
 		// handle help - F1
 		if (ev.type === 'keydown' && !shift && !ctrl && !alt && !cmd && keyCode === 112) {
-			this._map.showHelp();
+			this._map.showHelp('online-help');
 			ev.preventDefault();
 			return;
 		}
commit f1038a66a3b699c20601502beb088c823057a0ed
Author:     mert <mert.tumer at collabora.com>
AuthorDate: Wed Jun 24 19:39:32 2020 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 26 11:33:39 2020 +0200

    Fix url errors on backgroundImage in css files for proxy
    
    Current replacing url strings method works fine,
    however, it does not cover all the rules
    for cases like when @media or @import are used.
    They have a subset of their own rules which must
    be covered as well.
    
    Change-Id: Ib10f7cc361aea5cd3b855f64e3a64566a6c51a12
    Signed-off-by: mert <mert.tumer at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97060
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index 6a0bd23df..5e0007d43 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -571,20 +571,16 @@
 	{
 		// re-write relative URLs in CSS - somewhat grim.
 		window.addEventListener('load', function() {
-			var sheets = document.styleSheets;
-			for (var i = 0; i < sheets.length; ++i) {
-				var relBases = sheets[i].href.split('/');
-				relBases.pop(); // bin last - css name.
-				var replaceBase = 'url("' + relBases.join('/') + '/images/';
+			var replaceUrls = function(rules, replaceBase) {
+				if (!rules)
+					return;
 
-				var rules;
-				try {
-					rules = sheets[i].cssRules || sheets[i].rules;
-				} catch (err) {
-					console.log('Missing CSS from ' + sheets[i].href);
-					continue;
-				}
 				for (var r = 0; r < rules.length; ++r) {
+					// check subset of rules like @media or @import
+					if (rules[r] && rules[r].type != 1) {
+						replaceUrls(rules[r].cssRules || rules[r].rules, replaceBase);
+						continue;
+					}
 					if (!rules[r] || !rules[r].style)
 						continue;
 					var img = rules[r].style.backgroundImage;
@@ -596,6 +592,21 @@
 							img.replace('url("images/', replaceBase);
 					}
 				}
+			};
+			var sheets = document.styleSheets;
+			for (var i = 0; i < sheets.length; ++i) {
+				var relBases = sheets[i].href.split('/');
+				relBases.pop(); // bin last - css name.
+				var replaceBase = 'url("' + relBases.join('/') + '/images/';
+
+				var rules;
+				try {
+					rules = sheets[i].cssRules || sheets[i].rules;
+				} catch (err) {
+					console.log('Missing CSS from ' + sheets[i].href);
+					continue;
+				}
+				replaceUrls(rules, replaceBase);
 			}
 		}, false);
 	}


More information about the Libreoffice-commits mailing list