mirror of https://github.com/kiwix/libkiwix.git
Enabled random page button in the iframe-based viewer
This commit is contained in:
parent
a9446714ea
commit
4a55b136f6
|
@ -32,10 +32,12 @@
|
|||
title="Go to the main page of the current book"
|
||||
aria-label="Go to the main page of the current book"
|
||||
onclick="gotoMainPageOfCurrentBook()"></a>
|
||||
<!--
|
||||
<a id="kiwix_serve_taskbar_random_button" title="Go to a randomly selected page" aria-label="Go to a randomly selected page"
|
||||
href="{{root}}/random?content={{#urlencoded}}{{{content}}}{{/urlencoded}}"><button>🎲</button></a>
|
||||
-->
|
||||
<a id="kiwix_serve_taskbar_random_button"
|
||||
title="Go to a randomly selected page"
|
||||
aria-label="Go to a randomly selected page"
|
||||
onclick="gotoRandomPage()">
|
||||
<button>🎲</button>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -93,6 +95,10 @@
|
|||
location.hash = currentBook + '/';
|
||||
}
|
||||
|
||||
function gotoRandomPage() {
|
||||
cf.src = `${root}/random?content=${currentBook}`;
|
||||
}
|
||||
|
||||
function setCurrentBook(book, title) {
|
||||
currentBook = book;
|
||||
currentBookTitle = title;
|
||||
|
|
Loading…
Reference in New Issue