diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-08-10 21:08:47 +0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2018-08-12 15:45:51 +0200 |
commit | 7ab3eded419b6fddbdd9d7a7c1f676b3720950c0 (patch) | |
tree | ea865e25214768bfbbc00f0d6a552c302230e432 /help3xsl | |
parent | 5c1d1eb33951982ffa5352980d4713489c0d98ae (diff) |
Use window.location.href = ...; instead of window.open(..., '_self');
Otherwise the interim URLs end up in the history.
Change-Id: If99aa1a29126f93387d2f5a6460cc0d43b488cd9
Reviewed-on: https://gerrit.libreoffice.org/58867
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl')
-rw-r--r-- | help3xsl/help.html | 22 | ||||
-rw-r--r-- | help3xsl/index2.html | 86 |
2 files changed, 54 insertions, 54 deletions
diff --git a/help3xsl/help.html b/help3xsl/help.html index 1dade67f0d..acaf55b2d1 100644 --- a/help3xsl/help.html +++ b/help3xsl/help.html @@ -14,17 +14,17 @@ <body> <script type="text/javascript"> 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'); + var n = url.indexOf('?'); + if (n != -1) { + // the URL came from LibreOffice help (F1) + var version = getParameterByName("Version", url); + var query = url.substr(n + 1, url.length); + var newURL = version + '/index.html?' + query; + window.location.href = newURL; + } else { + // URL came from elsewhere, direct access to webroot, we redirect to main Help page + var userLang = navigator.language || navigator.userLanguage; + window.location.href = 'latest/' + userLang + '/text/shared/main0108.html?&DbPAR=WRITER&System=WIN'; } </script> </body> diff --git a/help3xsl/index2.html b/help3xsl/index2.html index 6ca41cc906..4f7c744e27 100644 --- a/help3xsl/index2.html +++ b/help3xsl/index2.html @@ -16,49 +16,49 @@ <script type="text/javascript"> var url = window.location.href; var n = url.indexOf('index.html?'); - if (n != -1){ - // the URL came from LibreOffice help (F1) - 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('/')); - switch (smodule) { - case "swriter": {defaultFile='text/swriter/main0000.html';module="WRITER";break;} - case "scalc": {defaultFile='text/scalc/main0000.html';module="CALC";break;} - case "simpress": {defaultFile='text/simpress/main0000.html';module="IMPRESS";break;} - case "sdraw": {defaultFile='text/sdraw/main0000.html';module="DRAW";break;} - case "smath": {defaultFile='text/smath/main0000.html';module="MATH";break;} - case "sdatabase": {defaultFile='text/shared/explorer/database/main.html';module="BASE";break;} - 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 file = map[bookmark]; - // check first if a root bookmark @@nowidget@@ can be used - if (file === undefined){ - var b2 = bookmark.substring(0, bookmark.lastIndexOf("/")) + '/@@nowidget@@'; - file = map[b2]; - } - // rebuild URL - if (file === undefined){ - var newURL = lang + '/' + defaultFile + '?System=' + system + '&DbPAR=' + module; - }else{ - var indx = file.indexOf('#'); - var bm = file.substr(indx,file.length); - file = file.substr(0,indx); - var newURL = lang + '/' + file + '?System=' + system + '&DbPAR=' + module + bm; - } - window.open(newURL,'_self'); - }else{ - // URL came from elsewhere, direct access to webroot, we redirect to main Help page - var userLang = navigator.language; - if(userLang === undefined ){ - userlang="en-US"; - } - window.open(userLang + '/text/shared/main0108.html?&DbPAR=WRITER&System=WIN','_self'); + 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 module; + var defaultFile; + 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;} + case "simpress": {defaultFile='text/simpress/main0000.html';module="IMPRESS";break;} + case "sdraw": {defaultFile='text/sdraw/main0000.html';module="DRAW";break;} + case "smath": {defaultFile='text/smath/main0000.html';module="MATH";break;} + case "sdatabase": {defaultFile='text/shared/explorer/database/main.html';module="BASE";break;} + case "sbasic": {defaultFile='text/sbasic/shared/main0601.html';module="BASIC";break;} + default: {defaultFile='text/shared/main0000.html';module="WRITER";break;} + } + 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) { + var b2 = bookmark.substring(0, bookmark.lastIndexOf("/")) + '/@@nowidget@@'; + file = map[b2]; + } + // rebuild URL + if (file === undefined) { + var newURL = lang + '/' + defaultFile + '?System=' + system + '&DbPAR=' + module; + } else { + var indx = file.indexOf('#'); + var bm = file.substr(indx,file.length); + file = file.substr(0,indx); + var newURL = lang + '/' + file + '?System=' + system + '&DbPAR=' + module + bm; + } + window.location.href = newURL; + } else { + // URL came from elsewhere, direct access to webroot, we redirect to main Help page + var userLang = navigator.language; + if (userLang === undefined) { + userlang="en-US"; + } + window.location.href = userLang + '/text/shared/main0108.html?&DbPAR=WRITER&System=WIN'; } </script> </body> |