diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-08-10 18:34:15 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-08-10 21:37:11 +0200 |
commit | 12f5d9d91e4fa37c6f657c1a7b9ef28890a917f7 (patch) | |
tree | 2e7a868ebe8001988732e552c6b91e72a6b4e668 | |
parent | 768af6e9bbadd50c99363d3e401a8d7f3d91bc70 (diff) |
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@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | help3xsl/help.html | 7 | ||||
-rw-r--r-- | help3xsl/index2.html | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/help3xsl/help.html b/help3xsl/help.html index a9a369ecc5..9bb30b5dca 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 6ca41cc906..c761c33ee1 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){ |