From 1a2d17c785d6a86e3bd757de8ac5d502bec73e36 Mon Sep 17 00:00:00 2001 From: Akhil Gupta Date: Mon, 8 Mar 2021 06:30:10 +0530 Subject: [PATCH] Some pointes mentioned in #63 --- client/episodes.html | 40 ++++++++++++++++++++++++++++++++++++++-- client/index.html | 10 ++++++++++ client/player.html | 2 +- controllers/pages.go | 17 +++++++++++------ db/dbfunctions.go | 6 +++--- main.go | 8 ++++++++ 6 files changed, 71 insertions(+), 12 deletions(-) diff --git a/client/episodes.html b/client/episodes.html index 319fe14..79da232 100644 --- a/client/episodes.html +++ b/client/episodes.html @@ -188,19 +188,43 @@
+ {{if .previousPage }} + Newest + {{end}} {{if .previousPage }} NewerNewer - {{end}} {{if .nextPage }} + {{end}} + + + + {{if .nextPage }} Older {{end}} + {{if gt .totalPages .page }} + + Oldest + {{end}}
@@ -319,6 +343,18 @@ .then(function () {}); return false; } + document.getElementById('pageDdl').addEventListener('change', function() { + currentPage= {{.page}}; + if(parseInt(this.value)===currentPage){ + return; + } + var queryParams = new URLSearchParams(window.location.search); + + // Set new or modify existing parameter value. + queryParams.set("page", this.value); + + window.top.location= window.top.location.origin+window.top.location.pathname+"?"+queryParams.toString(); + });