[Libreoffice-commits] help.git: help3xsl/help.html help3xsl/index2.html

2020-11-26 Thread Henrik Karlsson (via logerrit)
 help3xsl/help.html   |4 ++--
 help3xsl/index2.html |6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit e95e2a6d94ac5c08d3821f3da198a7982b7d0af8
Author: Henrik Karlsson 
AuthorDate: Mon Nov 23 17:41:37 2020 +0100
Commit: Olivier Hallot 
CommitDate: Thu Nov 26 12:03:03 2020 +0100

Update redirects to replace the url rather than navigate to a new one

Current links from outside (like the wiki) will cause excess history
entries when clicking the https://help.libreoffice.org/ link,
breaking the back button.

See the example of the visited pages below. Ideally only the referring
page and the final page should be in the history, allowing the user to
navigate back.

1. https://help.libreoffice.org/Main_Page
2. https://help.libreoffice.org/ - 302 redirect
3. https://help.libreoffice.org/help.html - window.location.href
4. https://help.libreoffice.org/latest/index.html - window.location.href
5. 
https://help.libreoffice.org/latest/en-US/text/shared/05/new_help.html?=WRITER=UNIX

The second 302 redirect is fine as it simply replaces the history. The
two window.location.href assigments however should be replaced with
window.location.replace.

Change-Id: I6fbe7141de87c939aa816fdfc2fe5255e9792e0b
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/106429
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/help3xsl/help.html b/help3xsl/help.html
index df4885a67..8ee3510cf 100644
--- a/help3xsl/help.html
+++ b/help3xsl/help.html
@@ -36,9 +36,9 @@
 var version = getParameterByName("Version", url);
 var query = url.substr(n + 1, url.length);
 var newURL = version + '/index.html?' + query;
-window.location.href = newURL;
+window.location.replace(newURL);
 } else {
-window.location.href = 'latest/index.html';
+window.location.replace('latest/index.html');
 }
 
 
diff --git a/help3xsl/index2.html b/help3xsl/index2.html
index 5e937f3e2..f0585c8b8 100644
--- a/help3xsl/index2.html
+++ b/help3xsl/index2.html
@@ -42,7 +42,7 @@
 }
 //Special case of application F1 or menu  Help -> LibreOffice Help
 if (target.indexOf('.uno:HelpIndex') != -1) {
-window.location.href = lang + '/' + defaultFile + '?System=' + 
system + '=' + module;
+window.location.replace(lang + '/' + defaultFile + '?System=' 
+ system + '=' + module);
 }
 var bookmark = target.slice(target.indexOf('/') + 1, 
target.length);
 var file = hid2fileMap[bookmark];
@@ -60,13 +60,13 @@
 file = file.substr(0,indx);
 var newURL = lang + '/' + file + '?System=' + system + 
'=' + module + '=' + bookmark + bm;
 }
-window.location.href = newURL;
+window.location.replace(newURL);
 } else {
 // URL came from elsewhere, direct access to webroot, we redirect 
to main Help page
 var system = 'WIN';
 if (navigator.userAgent.indexOf("Mac") != -1) system = 'MAC';
 if (navigator.userAgent.indexOf("Linux") != -1) system = 'UNIX';
-window.location.href = existingLang(navigator.language) + 
'/text/shared/05/new_help.html?=WRITER=' + system;
+window.location.replace(existingLang(navigator.language) + 
'/text/shared/05/new_help.html?=WRITER=' + system);
 }
 });
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: help3xsl/help.html help3xsl/index2.html help3xsl/index.html

2020-05-14 Thread Andras Timar (via logerrit)
 help3xsl/help.html   |2 +-
 help3xsl/index.html  |2 +-
 help3xsl/index2.html |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit dc2b016f2014208b27f7af5ad33863b6bd0d760b
Author: Andras Timar 
AuthorDate: Fri May 15 00:29:22 2020 +0200
Commit: Olivier Hallot 
CommitDate: Fri May 15 01:23:50 2020 +0200

remove *.google.com and *.googleapis.com from Content-Security-Policy

These are obsolete, since search is based on xapian-omega not on google 
search

Change-Id: I1858a3118f6b4778266c4a3d2a6559866ce8cb09
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/94257
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/help3xsl/help.html b/help3xsl/help.html
index cc22a2fdf..df4885a67 100644
--- a/help3xsl/help.html
+++ b/help3xsl/help.html
@@ -9,7 +9,7 @@
 
 
 
-
+
 
 
 
diff --git a/help3xsl/index.html b/help3xsl/index.html
index 5a319fd04..69d7ee6af 100644
--- a/help3xsl/index.html
+++ b/help3xsl/index.html
@@ -9,7 +9,7 @@
 
 
 
-
+