Allow jumping to random pages through pagination fillers.

This commit is contained in:
2016-09-02 14:19:47 +02:00
parent 29030eade6
commit df7655e00b
8 changed files with 67 additions and 11 deletions

View File

@@ -134,6 +134,10 @@ ul#nav li a:hover {
background-color: transparent;
}
.pagination .page-padding {
cursor: pointer;
}
/* Tiled grid
---------------*/

16
public/js/main.js Normal file
View File

@@ -0,0 +1,16 @@
function promptGoToPage(index_no) {
var page_no = prompt('Go to which page?');
if (page_no === null) {
return;
}
var index = window['page_index_' + index_no];
page_no = parseInt(page_no);
if (isNaN(page_no) || page_no < 1 || page_no > index.num_pages) {
return alert('Invalid page number.');
}
var offset = index.wildcard_url.indexOf('start=') !== -1 ? (page_no - 1) * index.per_page : page_no;
window.location.href = index.wildcard_url.replace('%d', offset)
}