diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2023-07-31 11:14:36 -0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2023-07-31 16:23:53 +0200 |
commit | 886cebba80267127e47de6f5dad57745cfe54752 (patch) | |
tree | 385e6afb1c71df9e05c3d906373bfd93e31ac6e1 /help3xsl | |
parent | 6417a881f92e9e18d2c73ab2595ce0f23c2dc84c (diff) |
tdf#144859 - fix switch javascript logic.
Change-Id: I7add8db42f1944052ea5907e24b889cb9e504d3f
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/155097
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl')
-rw-r--r-- | help3xsl/help2.js | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/help3xsl/help2.js b/help3xsl/help2.js index 728453134b..7e938b5404 100644 --- a/help3xsl/help2.js +++ b/help3xsl/help2.js @@ -8,19 +8,19 @@ */ // Used to set Application in caseinline=APP function setApplSpan(spanZ) { - var module = getParameterByName("DbPAR"); + let module = getParameterByName("DbPAR"); if (module === null) { - module = "WRITER"; + module = "SHARED"; } - var y = spanZ.getElementsByTagName("SPAN"); - var n = y.length; - var foundAppl = false; + let y = spanZ.getElementsByTagName("SPAN"); + let n = y.length; + let foundAppl = false; for (i = 0; i < n; i++) { if (y[i].getAttribute("id") === null){ continue; } else if( y[i].getAttribute("id").startsWith(module)){ - y[i].removeAttribute("hidden"); + y[i].hidden = false; foundAppl=true; } } @@ -29,8 +29,9 @@ function setApplSpan(spanZ) { continue; } else if( y[i].getAttribute("id").startsWith("default")){ + y[i].hidden = true; if(!foundAppl){ - y[i].removeAttribute("hidden"); + y[i].hidden = false; } } } @@ -38,29 +39,31 @@ function setApplSpan(spanZ) { // Used to set system in case, caseinline=SYSTEM function setSystemSpan(spanZ) { // if no System in URL, get browser system - var system = getParameterByName("System"); + let system = getParameterByName("System"); if (system === null) { system = getSystem(); } - var y = spanZ.getElementsByTagName("SPAN"); - var n = y.length; - var foundSystem = false; - for (i = 0; i < n; i++) { + let y = spanZ.getElementsByTagName("SPAN"); + let n = y.length; + let foundSystem = false; + + for (let i = 0; i < n; i++) { if (y[i].getAttribute("id") === null){ continue; } else if( y[i].getAttribute("id").startsWith(system)){ - y[i].removeAttribute("hidden"); + y[i].hidden = false; foundSystem=true; } } - for (i = 0; i < n; i++) { + for (let i = 0; i < n; i++) { if (y[i].getAttribute("id") === null){ continue; } else if( y[i].getAttribute("id").startsWith("default")){ + y[i].hidden = true; if(!foundSystem){ - y[i].removeAttribute("hidden"); + y[i].hidden = false; } } } @@ -187,7 +190,7 @@ function setupModules(lang) { var modulesNav = document.getElementById('modules-nav'); if (!modulesNav.classList.contains('loaded')) { var html = - '<a href="' + lang + '/text/shared/05/new_help.html?DbPAR=SHARED"><div class="office-icon"></div>%PRODUCTNAME</a>' + + '<a href="' + lang + '/text/shared/05/new_help.html?DbPAR=SHARED"><div class="office-icon"></div>LibreOfficeDev</a>' + '<a href="' + lang + '/text/swriter/main0000.html?DbPAR=WRITER"><div class="writer-icon"></div>Writer</a>' + '<a href="' + lang + '/text/scalc/main0000.html?DbPAR=CALC"><div class="calc-icon"></div>Calc</a>' + '<a href="' + lang + '/text/simpress/main0000.html?DbPAR=IMPRESS"><div class="impress-icon"></div>Impress</a>' + |