summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2020-06-12 20:22:18 -0300
committerOlivier Hallot <olivier.hallot@libreoffice.org>2020-06-13 12:41:36 +0200
commiteb0d68a963d42e07d4b1572f6b6546ffb607e2c1 (patch)
tree10abe0fb43b768ebfeae401aa336eb9d777e6ae1 /sfx2
parentdcdac8613223c7ac4b407600e92c49e71cf0b6ea (diff)
tdf#133928 Help need javascript enabled in browser
Warn user that javascript must be enabled to display Help pages Change-Id: I3c2fd6bea68346584faef2a0f8d4e383ffcf1bc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96237 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/sfxhelp.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 3a32e147e5af..1c4152fb9936 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -912,10 +912,13 @@ bool rewriteFlatpakHelpRootUrl(OUString * helpRootUrl) {
}
+// add <noscript> meta for browsers without javascript
+
#define SHTML1 "<!DOCTYPE HTML><html lang=\"en-US\"><head><meta charset=\"UTF-8\">"
-#define SHTML2 "<meta http-equiv=\"refresh\" content=\"1; url='"
-#define SHTML3 "'\"><script type=\"text/javascript\"> window.location.href = \""
-#define SHTML4 "\";</script><title>Help Page Redirection</title></head><body></body></html>"
+#define SHTML2 "<noscript><meta http-equiv=\"refresh\" content=\"0; url='"
+#define SHTML3 "/noscript.html'\"></noscript><meta http-equiv=\"refresh\" content=\"1; url='"
+#define SHTML4 "'\"><script type=\"text/javascript\"> window.location.href = \""
+#define SHTML5 "\";</script><title>Help Page Redirection</title></head><body></body></html>"
// use a tempfile since e.g. xdg-open doesn't support URL-parameters with file:// URLs
static bool impl_showOfflineHelp( const OUString& rURL )
@@ -945,8 +948,9 @@ static bool impl_showOfflineHelp( const OUString& rURL )
pStream->SetStreamCharSet(RTL_TEXTENCODING_UTF8);
OUString aTempStr = SHTML1 SHTML2 +
- aHelpLink + SHTML3 +
- aHelpLink + SHTML4;
+ aBaseInstallPath + "/" + HelpLocaleString() + SHTML3 +
+ aHelpLink + SHTML4 +
+ aHelpLink + SHTML5;
pStream->WriteUnicodeOrByteText(aTempStr);