Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tribute to marine primates #887

Merged
merged 3 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions static/skin/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ function getUserLanguage() {
}

function setUserLanguage(lang, callback) {
const rootPath = new URL('..', import.meta.url).pathname.replace(/\/$/, '');
document.cookie = `userlang=${lang};path=${rootPath};max-age=31536000`;
setPermanentGlobalCookie('userlang', lang);
Translations.load(lang);
Translations.whenReady(callback);
}
Expand Down
5 changes: 3 additions & 2 deletions static/skin/taskbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
margin: 0 auto;
}

#ui_language {
float: left
.kiwix #ui_language {
float: left;
}

#kiwix_button_show_toggle {
Expand Down Expand Up @@ -84,6 +84,7 @@ label[for="kiwix_button_show_toggle"],
float: right;
}

.kiwix #ui_language,
.kiwix #kiwixtoolbar button,
.kiwix #kiwixtoolbar input[type="submit"] {
box-sizing: border-box !important;
Expand Down
9 changes: 8 additions & 1 deletion static/skin/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ function updateToolbarVisibilityState() {
}

function handle_visual_viewport_change() {
contentIframe.height = window.visualViewport.height - contentIframe.offsetTop - 4;
const wh = window.visualViewport
? window.visualViewport.height
: window.innerHeight;
contentIframe.height = wh - contentIframe.offsetTop - 4;
}

function handle_location_hash_change() {
Expand Down Expand Up @@ -512,3 +515,7 @@ function finishViewerSetupOnceTranslationsAreLoaded()

viewerSetupComplete = true;
}

function setPermanentGlobalCookie(name, value) {
document.cookie = `${name}=${value};path=${root};max-age=31536000`;
}
2 changes: 1 addition & 1 deletion static/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<body style="margin:0" onload="setupViewer()">
<div class="kiwix" style="display:none" id="kiwixtoolbarwrapper">
<div id="kiwixtoolbar" class="ui-widget-header">
<select id="ui_language" onchange="changeUILanguage()">
<select id="ui_language" class="kiwix" onchange="changeUILanguage()">
</select>
<div class="kiwix_centered">
<div class="kiwix_searchform">
Expand Down
12 changes: 6 additions & 6 deletions test/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const ResourceCollection resources200Compressible{
{ DYNAMIC_CONTENT, "/ROOT/skin/favicon/favicon.ico" },
{ STATIC_CONTENT, "/ROOT/skin/favicon/favicon.ico?cacheid=fba03a27" },
{ DYNAMIC_CONTENT, "/ROOT/skin/i18n.js" },
{ STATIC_CONTENT, "/ROOT/skin/i18n.js?cacheid=dcf3d584" },
{ STATIC_CONTENT, "/ROOT/skin/i18n.js?cacheid=6da2bca0" },
{ DYNAMIC_CONTENT, "/ROOT/skin/index.css" },
{ STATIC_CONTENT, "/ROOT/skin/index.css?cacheid=0f9ba34e" },
{ DYNAMIC_CONTENT, "/ROOT/skin/index.js" },
Expand All @@ -71,9 +71,9 @@ const ResourceCollection resources200Compressible{
{ DYNAMIC_CONTENT, "/ROOT/skin/mustache.min.js" },
{ STATIC_CONTENT, "/ROOT/skin/mustache.min.js?cacheid=bd23c4fb" },
{ DYNAMIC_CONTENT, "/ROOT/skin/taskbar.css" },
{ STATIC_CONTENT, "/ROOT/skin/taskbar.css?cacheid=2cbac34b" },
{ STATIC_CONTENT, "/ROOT/skin/taskbar.css?cacheid=eb3bec90" },
{ DYNAMIC_CONTENT, "/ROOT/skin/viewer.js" },
{ STATIC_CONTENT, "/ROOT/skin/viewer.js?cacheid=b3c754ec" },
{ STATIC_CONTENT, "/ROOT/skin/viewer.js?cacheid=03fd97ee" },
{ DYNAMIC_CONTENT, "/ROOT/skin/fonts/Poppins.ttf" },
{ STATIC_CONTENT, "/ROOT/skin/fonts/Poppins.ttf?cacheid=af705837" },
{ DYNAMIC_CONTENT, "/ROOT/skin/fonts/Roboto.ttf" },
Expand Down Expand Up @@ -298,11 +298,11 @@ R"EXPECTEDRESULT( <img src="../skin/download.png?
},
{
/* url */ "/ROOT/viewer",
R"EXPECTEDRESULT( <link type="text/css" href="./skin/taskbar.css?cacheid=2cbac34b" rel="Stylesheet" />
R"EXPECTEDRESULT( <link type="text/css" href="./skin/taskbar.css?cacheid=eb3bec90" rel="Stylesheet" />
<link type="text/css" href="./skin/css/autoComplete.css?cacheid=08951e06" rel="Stylesheet" />
<script type="module" src="./skin/i18n.js?cacheid=dcf3d584" defer></script>
<script type="module" src="./skin/i18n.js?cacheid=6da2bca0" defer></script>
<script type="text/javascript" src="./skin/languages.js?cacheid=fe100348" defer></script>
<script type="text/javascript" src="./skin/viewer.js?cacheid=b3c754ec" defer></script>
<script type="text/javascript" src="./skin/viewer.js?cacheid=03fd97ee" defer></script>
<script type="text/javascript" src="./skin/autoComplete.min.js?cacheid=1191aaaf"></script>
const blankPageUrl = root + "/skin/blank.html?cacheid=6b1fa032";
<label for="kiwix_button_show_toggle"><img src="./skin/caret.png?cacheid=22b942b4" alt=""></label>
Expand Down