feat: save page to url

This commit is contained in:
relikd
2024-02-27 20:21:22 +01:00
parent 589ac0ead2
commit 2675d723c9
2 changed files with 10 additions and 2 deletions

View File

@@ -14,6 +14,7 @@
<body>
<h1>IPA Archive</h1>
<form onsubmit="event.preventDefault(); searchIPA(); return false;" autocomplete="off">
<input id="page" hidden>
<label for="search">Search: <input id="search" placeholder="Search"></label>
<label for="bundleid">BundleId: <input id="bundleid" placeholder="com.gameloft."></label>
<label for="unique">Unique: <input id="unique" type="checkbox"></label>

View File

@@ -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) {