Added UI language selector on the welcome page

Also:

- Moved the language selector to the right hand side on the ZIM viewer
  page (to be consistent with the welcome page)
This commit is contained in:
Veloman Yunkan
2023-02-09 16:23:27 +01:00
parent 351bc87231
commit 514d6e6514
5 changed files with 27 additions and 9 deletions

View File

@ -157,6 +157,11 @@ body {
font-weight: bolder;
}
#ui_language {
float: right;
top: 0;
}
.book__list {
position: relative;
margin: 0 auto;
@ -472,11 +477,11 @@ body {
.kiwixHomeBody {
min-height: calc(100vh - 287px);
}
.kiwixSearch {
margin-top: 11px;
}
.kiwixButton {
margin: 15px 0;
width: 229px;

View File

@ -31,6 +31,14 @@
document.querySelector('#feedLink').href = feedLink;
}
function changeUILanguage() {
const s = document.getElementById("ui_language");
const lang = s.options[s.selectedIndex].value;
const q = new URLSearchParams(window.location.search);
q.set("userlang", lang);
location.search = q.toString();
}
function queryUrlBuilder() {
let url = `${root}/catalog/search?`;
url += Object.keys(incrementalLoadingParams).map(key => `${key}=${incrementalLoadingParams[key]}`).join("&");
@ -466,6 +474,7 @@
}
async function onload() {
initUILanguageSelector(getUserLanguage(), changeUILanguage);
iso = new Isotope( '.book__list', {
itemSelector: '.book',
getSortData:{

View File

@ -45,7 +45,7 @@
}
.kiwix #ui_language {
float: left;
float: right;
}
#kiwix_button_show_toggle {