From eadc0ac72b0dcdecdd186d221265148ae9de0374 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Wed, 10 Aug 2022 12:31:05 +0400 Subject: [PATCH] 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 --- static/skin/index.js | 15 +++++++++------ static/viewer.html | 23 ++++++++++++++--------- test/server.cpp | 4 ++-- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/static/skin/index.js b/static/skin/index.js index fd1c338ea..7f29b316e 100644 --- a/static/skin/index.js +++ b/static/skin/index.js @@ -110,6 +110,9 @@ } catch { downloadLink = ''; } + const bookName = link.split('/').pop(); + const viewerLink = `${root}/viewer#${bookName}`; + const humanFriendlyZimSize = humanFriendlySize(zimSize); const divTag = document.createElement('div'); @@ -122,7 +125,7 @@ const languageAttr = langCode != '' ? `title="${language}" aria-label="${language}"` : 'style="background-color: transparent"'; divTag.innerHTML = `
- +