summaryrefslogtreecommitdiff
path: root/help3xsl/help2.js
diff options
context:
space:
mode:
authorIlmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>2019-03-22 12:06:44 +0200
committerOlivier Hallot <olivier.hallot@libreoffice.org>2019-03-27 09:42:01 +0100
commitca2a6bf2c3c59d106f1c6ad432eab21f696c23fc (patch)
tree3616969f889f8450502e4778d292417c355d85a2 /help3xsl/help2.js
parent9b776454d95f5c6bf13c0ca5508c0b2225aa4c1c (diff)
tdf#124245 Polyfills and fixes for IE11
The polyfills can be removed after we drop IE11 support. Other IE11 fixes: Change from document.URL to window.location.pathname because otherwise we get local Windows paths with backward slashes. Use clear: left; for google-donation element so it doesn't float on top of other elements. Don't use defer to load fuzzysort.js and prism.js. Change-Id: I6c0143eab555c8b1fbdbde8e749a24baed2f69c8 Reviewed-on: https://gerrit.libreoffice.org/69549 Tested-by: Jenkins Reviewed-by: himajin100000 <himajin100000@gmail.com> Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl/help2.js')
-rw-r--r--help3xsl/help2.js23
1 files changed, 14 insertions, 9 deletions
diff --git a/help3xsl/help2.js b/help3xsl/help2.js
index 0003b72d82..f62105dc62 100644
--- a/help3xsl/help2.js
+++ b/help3xsl/help2.js
@@ -82,13 +82,14 @@ for (z = 0; z < n; z++) {
/* add &DbPAR= and &System= to the links in DisplayArea div */
/* skip for object files */
function fixURL(module, system) {
- var itemlink = document.getElementById("DisplayArea").getElementsByTagName("a");
+ if ((DisplayArea = document.getElementById("DisplayArea")) === null) return;
+ var itemlink = DisplayArea.getElementsByTagName("a");
var pSystem = (system === null) ? getSystem() : system;
var pAppl = (module === null) ? "WRITER" : module;
var n = itemlink.length;
for (var i = 0; i < n; i++) {
- if (itemlink[i].getAttribute("class") != "objectfiles"){
- setURLParam(itemlink[i], pSystem, pAppl);
+ if (itemlink[i].getAttribute("class") != "objectfiles") {
+ setURLParam(itemlink[i], pSystem, pAppl);
}
}
}
@@ -203,12 +204,16 @@ if (document.body.getElementsByTagName('meta')) {
var module = getParameterByName("DbPAR");
var helpID = getParameterByName("HID");
fixURL(module,system);
-var dbg = getParameterByName("Debug");
-if (dbg == null) { dbg=0; }
-document.getElementById("DEBUG").style.display = (dbg == 0) ? "none":"block";
-document.getElementById("bm_module").innerHTML ="Module is: "+module;
-document.getElementById("bm_system").innerHTML ="System is: "+system;
-document.getElementById("bm_HID").innerHTML ="HID is: "+helpID;
+
+function debugInfo(dbg) {
+ if (dbg == null) return;
+ document.getElementById("DEBUG").style.display = "block";
+ document.getElementById("bm_module").innerHTML = "Module is: "+module;
+ document.getElementById("bm_system").innerHTML = "System is: "+system;
+ document.getElementById("bm_HID").innerHTML = "HID is: "+helpID;
+}
+
+debugInfo(getParameterByName("Debug"));
// Mobile devices need the modules and langs on page load
if (Math.max(document.documentElement.clientWidth, window.innerWidth || 0) < 960) {