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"
|
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>🎲</button></a>
|
aria-label="Go to a randomly selected page"
|
||||||
-->
|
onclick="gotoRandomPage()">
|
||||||
|
<button>🎲</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;
|
||||||
|
|
Loading…
Reference in New Issue