From 731b680af333bddf9ea87ceefccdc6b1c308d371 Mon Sep 17 00:00:00 2001 From: Martin Weise <martin.weise@tuwien.ac.at> Date: Thu, 7 Mar 2024 07:40:06 +0000 Subject: [PATCH] Updated the switcher --- .docs/overrides/main.html | 16 ---------------- .docs/scripts/extra.js | 13 +++++++++++++ mkdocs.yml | 2 ++ 3 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 .docs/scripts/extra.js diff --git a/.docs/overrides/main.html b/.docs/overrides/main.html index db14ec6adb..9f9a6daf6f 100644 --- a/.docs/overrides/main.html +++ b/.docs/overrides/main.html @@ -8,20 +8,4 @@ <option value="1.4.0">1.4.0</option> <option value="1.3.0">1.3.0</option> </select> -<script> - function getVersion() { - const segments = location.pathname.split('/') - console.debug('segments', segments) - if (segments.length >= 4) { - return segments[3] - } else { - return '__APPVERSION__' - } - } - function switchVersion(value) { - if (!value) { return } - this.location.href = location.protocol + '//' + location.host + '/infrastructures/dbrepo/' + value + '/' - } - document.getElementById("version").value = getVersion() -</script> {% endblock %} diff --git a/.docs/scripts/extra.js b/.docs/scripts/extra.js new file mode 100644 index 0000000000..4768615e22 --- /dev/null +++ b/.docs/scripts/extra.js @@ -0,0 +1,13 @@ +function getVersion() { + const segments = location.pathname.split('/'); + if (segments.length >= 4) { + return segments[3]; + } else { + return '__APPVERSION__'; + } +} +function switchVersion(value) { + if (!value) { return } + this.location.href = location.protocol + '//' + location.host + '/infrastructures/dbrepo/' + value + '/'; +} +document.getElementById("version").value = getVersion(); \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 14affa17a9..60f1c85e88 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -43,6 +43,8 @@ nav: - contact.md extra_css: - stylesheets/extra.css +extra_javascript: + - scripts/extra.js theme: favicon: images/signet_white.png custom_dir: .docs/overrides -- GitLab