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

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


 help3xsl/help.html |   36 +++++++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 11 deletions(-)

New commits:
commit 768af6e9bbadd50c99363d3e401a8d7f3d91bc70
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Fri Aug 10 17:20:07 2018 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Aug 10 21:36:29 2018 +0200

    Avoid several JS errors.
    
    Change-Id: If0b8b4f3e8c3464f4e7f812ba727a929330438f3
    Reviewed-on: https://gerrit.libreoffice.org/58858
    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 1dade67f0..a9a369ecc 100644
--- a/help3xsl/help.html
+++ b/help3xsl/help.html
@@ -8,23 +8,37 @@
 -->
 <html>
 <head>
-    <script type="text/javascript" src="latest/help.js"></script>
     <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org *.google.com *.googleapis.com"/>
 </head>
 <body>
 <script type="text/javascript">
+    function getParameterByName(name, url) {
+        if (!url) {
+            url = window.location.href;
+        }
+        name = name.replace(/[\[\]]/g, "\\$&");
+        var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)");
+        var results = regex.exec(url);
+        if (!results) {
+            return null;
+        }
+        if (!results[2]) {
+            return '';
+        }
+        return decodeURIComponent(results[2].replace(/\+/g, " "));
+    }
     var url = window.location.href;
     var n = url.indexOf('help.html?');
-    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;
-    window.open(newURL,'_self');
-    }else{
-    // URL came from elsewhere, direct access to webroot, we redirect to main Help page
-    var userLang = navigator.language || navigator.userLanguage;
-    window.open('latest/'+userLang+'/text/shared/main0108.html?&DbPAR=WRITER&System=WIN','_self');
+    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;
+        window.open(newURL, '_self');
+    } else {
+        // URL came from elsewhere, direct access to webroot, we redirect to main Help page
+        var userLang = navigator.language || navigator.userLanguage;
+        window.open('latest/' + userLang + '/text/shared/main0108.html?&DbPAR=WRITER&System=WIN', '_self');
     }
 </script>
 </body>


More information about the Libreoffice-commits mailing list