Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris Delange committed Jan 28, 2024
1 parent bd9eaaa commit ca502aa
Show file tree
Hide file tree
Showing 60 changed files with 1,104 additions and 930 deletions.
35 changes: 19 additions & 16 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ template:
if (item.textContent === "Reference" || item.textContent === "Fonctions") {
item.textContent = lang === "fr" ? "Fonctions" : "Reference";
}
var home_url = document.querySelector(".navbar-brand[href='index.html'], .navbar-brand[href='fr_index.html']");
if (home_url) {
if (lang == "fr") home_url.href = "fr_index.html";
else if (lang == "en") home_url.href = "index.html"
}
});
}
Expand All @@ -84,34 +78,43 @@ template:
window.location.href = current_url;
}
function initializeLanguageSelector() {
var languageSelect = document.getElementById("language");
if (languageSelect) {
function initialize_language_selector() {
var selected_language = document.getElementById("language");
if (selected_language) {
var selectedLanguage = localStorage.getItem("selectedLanguage");
if (selectedLanguage) {
languageSelect.value = selectedLanguage;
selected_language.value = selectedLanguage;
}
change_language(selectedLanguage);
}
}
document.addEventListener("DOMContentLoaded", function() {
var languageSelect = document.getElementById("language");
if (languageSelect) {
languageSelect.addEventListener("change", function() {
var selected_language = document.getElementById("language");
if (selected_language) {
selected_language.addEventListener("change", function() {
localStorage.setItem("selectedLanguage", this.value);
change_language(this.value);
});
}
var home_url = document.querySelector(".navbar-brand[href='index.html'], .navbar-brand[href='../index.html'], .navbar-brand[href='fr_index.html'], .navbar-brand[href='..fr_index.html']");
if (home_url) {
if (selected_language.value == "fr" && !home_url.href.includes("fr_index.html")) {
home_url.href = home_url.href.replace("index.html", "fr_index.html");
} else {
home_url.href = home_url.href.replace("fr_index.html", "index.html");
}
}
window.addEventListener('storage', function(e) {
if (e.key === 'selectedLanguage') {
initializeLanguageSelector();
initialize_language_selector();
}
});
initializeLanguageSelector();
initialize_language_selector();
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
Expand Down
35 changes: 19 additions & 16 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 19 additions & 16 deletions docs/CODE_OF_CONDUCT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 19 additions & 16 deletions docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 19 additions & 16 deletions docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ca502aa

Please sign in to comment.