From f41e71b2d7ef18931433139e522629785305ad89 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Sun, 20 Mar 2022 15:55:42 +0400 Subject: [PATCH] viewer_taskbar.js + viewer.html = BFF Foundation for never-ending friendship between viewer_taskbar.js and viewer.html has been established by a slight change in how the book name is obtained and commenting out the rest of the code. --- static/skin/viewer_taskbar.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/static/skin/viewer_taskbar.js b/static/skin/viewer_taskbar.js index bedc93281..d9fb5218c 100644 --- a/static/skin/viewer_taskbar.js +++ b/static/skin/viewer_taskbar.js @@ -37,11 +37,12 @@ function setupAutoHidingOfTheToolbar() { } document.addEventListener('DOMContentLoaded', function () { - const root = document.querySelector(`link[type='root']`).getAttribute("href"); - const bookName = (window.location.pathname == `${root}/search`) - ? (new URLSearchParams(window.location.search)).get('content') - : window.location.pathname.split(`${root}/`)[1].split('/')[0]; + const p = location.pathname; + const root = p.slice(0, p.length - '/viewer'.length); + const bookName = location.hash.slice(1).split('/')[0]; + +/* const autoCompleteJS = new autoComplete( { selector: "#kiwixsearchbox", @@ -68,7 +69,7 @@ document.addEventListener('DOMContentLoaded', function () { }, resultsList: { noResults: true, - /* We must display 10 results (requested) + 1 potential link to do a full text search. */ + // We must display 10 results (requested) + 1 potential link to do a full text search. maxResults: 11, }, resultItem: { @@ -118,5 +119,5 @@ document.addEventListener('DOMContentLoaded', function () { if (document.body.clientWidth < 520) { setupAutoHidingOfTheToolbar(); } - + */ });