summaryrefslogtreecommitdiff
path: root/help3xsl/help.html
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2018-08-10 17:20:07 +0200
committerAndras Timar <andras.timar@collabora.com>2018-08-10 21:36:29 +0200
commit768af6e9bbadd50c99363d3e401a8d7f3d91bc70 (patch)
tree7be2ec8ec800a17c5d9bbd345bdfcd03380d9c0e /help3xsl/help.html
parent983096a7dc932457fe1ae116669c66c14ed1f320 (diff)
Avoid several JS errors.
Change-Id: If0b8b4f3e8c3464f4e7f812ba727a929330438f3 Reviewed-on: https://gerrit.libreoffice.org/58858 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'help3xsl/help.html')
-rw-r--r--help3xsl/help.html36
1 files changed, 25 insertions, 11 deletions
diff --git a/help3xsl/help.html b/help3xsl/help.html
index 1dade67f0d..a9a369ecc5 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>