[Libreoffice-commits] help.git: Branch 'distro/collabora/cp-6.0' - help3xsl/help.html help3xsl/index2.html

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Aug 10 19:37:31 UTC 2018


 help3xsl/help.html   |    7 ++++---
 help3xsl/index2.html |    6 +++---
 2 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 12f5d9d91e4fa37c6f657c1a7b9ef28890a917f7
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Fri Aug 10 18:34:15 2018 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Aug 10 21:37:11 2018 +0200

    Let's make the help urls more standard, and use ?Target=...&... form.
    
    Change-Id: Ic2568c769ab11e3622f71b92a46fb124012a3c90
    Reviewed-on: https://gerrit.libreoffice.org/58859
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/help3xsl/help.html b/help3xsl/help.html
index a9a369ecc..9bb30b5dc 100644
--- a/help3xsl/help.html
+++ b/help3xsl/help.html
@@ -27,13 +27,14 @@
         }
         return decodeURIComponent(results[2].replace(/\+/g, " "));
     }
+
     var url = window.location.href;
-    var n = url.indexOf('help.html?');
+    var n = url.indexOf('?');
     if (n != -1) {
         // the URL came from LibreOffice help (F1)
         var version = getParameterByName("Version", url);
-        var rest = url.substr(n + 12, url.length);
-        var newURL = version + '/index.html?' + rest;
+        var query = url.substr(n + 1, url.length);
+        var newURL = version + '/index.html?' + query;
         window.open(newURL, '_self');
     } else {
         // URL came from elsewhere, direct access to webroot, we redirect to main Help page
diff --git a/help3xsl/index2.html b/help3xsl/index2.html
index 6ca41cc90..c761c33ee 100644
--- a/help3xsl/index2.html
+++ b/help3xsl/index2.html
@@ -18,13 +18,13 @@
     var n = url.indexOf('index.html?');
     if (n != -1){
     // the URL came from LibreOffice help (F1)
+    var target = getParameterByName("Target",url);
     var version = getParameterByName("Version",url);
     var lang = getParameterByName("Language",url);
     var system  = getParameterByName("System",url);
-    var rest= url.substr(n+11,url.length);
     var module;
     var defaultFile;
-    var smodule = rest.substr(0, rest.indexOf('/'));
+    var smodule = target.substr(0, target.indexOf('/'));
     switch (smodule) {
     case "swriter":   {defaultFile='text/swriter/main0000.html';module="WRITER";break;}
     case "scalc":     {defaultFile='text/scalc/main0000.html';module="CALC";break;}
@@ -35,7 +35,7 @@
     case "sbasic":    {defaultFile='text/sbasic/shared/main0601.html';module="BASIC";break;}
     default:          {defaultFile='text/shared/main0000.html';module="WRITER";break;}
     }
-    var bookmark = rest.slice(rest.indexOf('/')+1, rest.indexOf('?'));
+    var bookmark = target.slice(target.indexOf('/') + 1, target.length);
     var file = map[bookmark];
     // check first if a root bookmark @@nowidget@@ can be used
     if (file === undefined){


More information about the Libreoffice-commits mailing list