mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Welcome page interoperates with iframe-based viewer
- /viewer (without any hash) dynamically redirects to the welcome page - The book links on the welcome page point to the iframe-based viewer
This commit is contained in:
@ -8,6 +8,19 @@
|
||||
<link type="text/css" href="./skin/css/autoComplete.css?KIWIXCACHEID" rel="Stylesheet" />
|
||||
<script type="text/javascript" src="./skin/viewer_taskbar.js?KIWIXCACHEID" defer></script>
|
||||
<script type="text/javascript" src="./skin/autoComplete.min.js?KIWIXCACHEID"></script>
|
||||
<script>
|
||||
function getRootLocation() {
|
||||
const p = location.pathname;
|
||||
return p.slice(0, p.length - '/viewer'.length);
|
||||
}
|
||||
|
||||
const root = getRootLocation();
|
||||
const blankPageUrl = `${root}/skin/blank.html`;
|
||||
|
||||
if ( location.hash == '' ) {
|
||||
location.href = root + '/';
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body style="margin:0" onload="handle_visual_viewport_change()">
|
||||
@ -23,7 +36,7 @@
|
||||
<input type="checkbox" id="kiwix_button_show_toggle">
|
||||
<label for="kiwix_button_show_toggle"><img src="./skin/caret.png?KIWIXCACHEID" alt=""></label>
|
||||
<div class="kiwix_button_cont">
|
||||
<a id="kiwix_serve_taskbar_library_button" title="Go to welcome page" aria-label="Go to welcome page" href="#"><button>🏠</button></a>
|
||||
<a id="kiwix_serve_taskbar_library_button" title="Go to welcome page" aria-label="Go to welcome page" href="./"><button>🏠</button></a>
|
||||
<span id="kiwix_serve_taskbar_book_ui_group">
|
||||
<a id="kiwix_serve_taskbar_home_button"
|
||||
title="Go to the main page of the current book"
|
||||
@ -58,14 +71,6 @@
|
||||
//
|
||||
// iframe url: the URL to be loaded in the viewer iframe.
|
||||
|
||||
function getRootLocation() {
|
||||
const p = location.pathname;
|
||||
return p.slice(0, p.length - '/viewer'.length);
|
||||
}
|
||||
|
||||
const root = getRootLocation();
|
||||
const blankPageUrl = `${root}/skin/blank.html`;
|
||||
|
||||
function userUrl2IframeUrl(url) {
|
||||
if ( url == '' ) {
|
||||
return blankPageUrl;
|
||||
|
Reference in New Issue
Block a user