summaryrefslogtreecommitdiff
path: root/help3xsl/help2.js
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-01-31 16:07:28 +0300
committerOlivier Hallot <olivier.hallot@libreoffice.org>2020-02-10 02:34:34 +0100
commit96f1ee8417e4d6c7134e13ab86ac55e52f1bc841 (patch)
treea83046f8a02d0511eac775c566b7817a338ddc38 /help3xsl/help2.js
parentb6e3324d71cd4b17cd9384b43b762fb10ce92343 (diff)
Don't hardcode version in links in online help
... so that when current page URL is like https://help.libreoffice.org/latest/en-US/text/shared/05/new_help.html links from it will lead to other pages under 'latest', not to https://help.libreoffice.org/6.3/... The problem reason was that in online help, HTML referred to resources with relative URLs starting with version number, like 'href="6.3/media/navigation/favicon.ico"'. The links didn't include the version level in local help: 'href="media/navigation/favicon.ico"'. This was naturally accompanied by <base href="../../../../../"> (online) and '<base href="../../../../">' (local), coming from "tokenize" in help3xsl/online_transform.xsl. This unifies online help behaviour with that of local help. Change-Id: I486cbfbd680d52d00ef99ade9af5ecac2967c115 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/87768 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl/help2.js')
-rw-r--r--help3xsl/help2.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/help3xsl/help2.js b/help3xsl/help2.js
index a1739eeaf0..8c2b60d725 100644
--- a/help3xsl/help2.js
+++ b/help3xsl/help2.js
@@ -154,29 +154,29 @@ function existingLang(lang) {
return 'en-US';
}
-function setupModules(target, lang) {
+function setupModules(lang) {
var modulesNav = document.getElementById('modules-nav');
if (!modulesNav.classList.contains('loaded')) {
var html =
- '<a href="' + target + lang + '/text/swriter/main0000.html?DbPAR=WRITER"><div class="writer-icon"></div>Writer</a>' +
- '<a href="' + target + lang + '/text/scalc/main0000.html?DbPAR=CALC"><div class="calc-icon"></div>Calc</a>' +
- '<a href="' + target + lang + '/text/simpress/main0000.html?DbPAR=IMPRESS"><div class="impress-icon"></div>Impress</a>' +
- '<a href="' + target + lang + '/text/sdraw/main0000.html?DbPAR=DRAW"><div class="draw-icon"></div>Draw</a>' +
- '<a href="' + target + lang + '/text/shared/explorer/database/main.html?DbPAR=BASE"><div class="base-icon"></div>Base</a>' +
- '<a href="' + target + lang + '/text/smath/main0000.html?DbPAR=MATH"><div class="math-icon"></div>Math</a>' +
- '<a href="' + target + lang + '/text/schart/main0000.html?DbPAR=CHART"><div class="chart-icon"></div>Chart</a>' +
- '<a href="' + target + lang + '/text/sbasic/shared/main0601.html?DbPAR=BASIC"><div class="basic-icon"></div>Basic</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>' +
+ '<a href="' + lang + '/text/sdraw/main0000.html?DbPAR=DRAW"><div class="draw-icon"></div>Draw</a>' +
+ '<a href="' + lang + '/text/shared/explorer/database/main.html?DbPAR=BASE"><div class="base-icon"></div>Base</a>' +
+ '<a href="' + lang + '/text/smath/main0000.html?DbPAR=MATH"><div class="math-icon"></div>Math</a>' +
+ '<a href="' + lang + '/text/schart/main0000.html?DbPAR=CHART"><div class="chart-icon"></div>Chart</a>' +
+ '<a href="' + lang + '/text/sbasic/shared/main0601.html?DbPAR=BASIC"><div class="basic-icon"></div>Basic</a>';
modulesNav.innerHTML = html;
modulesNav.classList.add('loaded');
}
}
-function setupLanguages(target, page) {
+function setupLanguages(page) {
var langNav = document.getElementById('langs-nav');
if (!langNav.classList.contains('loaded')) {
var html = '';
languagesSet.forEach(function(lang) {
- html += '<a href="' + target + lang + page + '">' + ((lang in languageNames)? languageNames[lang]: lang) + '</a>';
+ html += '<a href="' + lang + page + '">' + ((lang in languageNames)? languageNames[lang]: lang) + '</a>';
});
langNav.innerHTML = html;
langNav.classList.add('loaded');