From 2675d723c9f458d3bdb4fc4437b53dd947692634 Mon Sep 17 00:00:00 2001 From: relikd Date: Tue, 27 Feb 2024 20:21:22 +0100 Subject: [PATCH] feat: save page to url --- index.html | 1 + script.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index a51cc74c..c159ec6e 100644 --- a/index.html +++ b/index.html @@ -14,6 +14,7 @@

IPA Archive

+ diff --git a/script.js b/script.js index 587ae02a..b576516b 100644 --- a/script.js +++ b/script.js @@ -124,13 +124,18 @@ function applySearch() { function searchByBundleId(sender) { document.getElementById('bundleid').value = sender.innerText; document.getElementById('search').value = ''; + document.getElementById('page').value = null; document.getElementById('unique').checked = false; searchIPA(); } -function searchIPA() { +function searchIPA(restorePage) { + var page = 0; + if (restorePage) { + page = document.getElementById('page').value; + } applySearch(); - printIPA(); + printIPA((page || 0) * PER_PAGE); saveConfig(); } @@ -237,6 +242,8 @@ function printIPA(offset) { function p(page) { printIPA(page * PER_PAGE); + document.getElementById('page').value = page || null; + saveConfig(); } function paginationShort(page, pages) {