aboutsummaryrefslogtreecommitdiffstats
path: root/htdocs/src/js/app.js
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-10-28 17:08:13 +0200
committerArmand Philippot <git@armandphilippot.com>2021-10-28 17:21:41 +0200
commit2a8464001efce8c76e8109af7eb68d9e86105692 (patch)
treeefb3c1f2543515a10815dfaf81588e578e8878cd /htdocs/src/js/app.js
parentb7334838318e4a42171491349038941d347538a0 (diff)
chore: add legal notice
In France, legal notice is required for any website.
Diffstat (limited to 'htdocs/src/js/app.js')
-rw-r--r--htdocs/src/js/app.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/htdocs/src/js/app.js b/htdocs/src/js/app.js
index efb4c33..4f5f5a5 100644
--- a/htdocs/src/js/app.js
+++ b/htdocs/src/js/app.js
@@ -327,6 +327,18 @@ function printRequestedPage() {
}
}
+/**
+ * Replace the legal notice link and text.
+ */
+function replaceLegalNoticeLink() {
+ const link = document.querySelector('.nav__link--legal');
+ link.href = translate('footer.legalNotice.link');
+ link.textContent = translate('footer.legalNotice.txt');
+}
+
+/**
+ * Translate all text available in HTML templates.
+ */
function translateHTMLContent() {
const brandingDesc = document.querySelector('.branding__description');
const navLabel = document.querySelector('.nav__label');
@@ -335,7 +347,7 @@ function translateHTMLContent() {
brandingDesc.textContent = translate('branding.description');
navLabel.textContent = translate('nav.title');
license.title = translate('footer.license');
- instructions.textContent = translate('main.instructions');
+ if (instructions) instructions.textContent = translate('main.instructions');
}
/**
@@ -357,6 +369,7 @@ function setAppLocale() {
function init() {
setAppLocale();
translateHTMLContent();
+ replaceLegalNoticeLink();
loadWebpackStyles();
printProjectsNav();
updateView();