Enabled random page button in the iframe-based viewer

This commit is contained in:
Veloman Yunkan 2022-08-07 16:55:11 +04:00
parent a9446714ea
commit 4a55b136f6
1 changed files with 10 additions and 4 deletions

View File

@ -32,10 +32,12 @@
title="Go to the main page of the current book" title="Go to the main page of the current book"
aria-label="Go to the main page of the current book" aria-label="Go to the main page of the current book"
onclick="gotoMainPageOfCurrentBook()"></a> onclick="gotoMainPageOfCurrentBook()"></a>
<!-- <a id="kiwix_serve_taskbar_random_button"
<a id="kiwix_serve_taskbar_random_button" title="Go to a randomly selected page" aria-label="Go to a randomly selected page" title="Go to a randomly selected page"
href="{{root}}/random?content={{#urlencoded}}{{{content}}}{{/urlencoded}}"><button>&#x1F3B2;</button></a> aria-label="Go to a randomly selected page"
--> onclick="gotoRandomPage()">
<button>&#x1F3B2;</button>
</a>
</span> </span>
</div> </div>
</div> </div>
@ -93,6 +95,10 @@
location.hash = currentBook + '/'; location.hash = currentBook + '/';
} }
function gotoRandomPage() {
cf.src = `${root}/random?content=${currentBook}`;
}
function setCurrentBook(book, title) { function setCurrentBook(book, title) {
currentBook = book; currentBook = book;
currentBookTitle = title; currentBookTitle = title;