fix: use current filter for random
This commit is contained in:
@@ -78,7 +78,7 @@
|
|||||||
<div>Rating: $RATING</div>
|
<div>Rating: $RATING</div>
|
||||||
<div>Advisory: $ADVISORY</div>
|
<div>Advisory: $ADVISORY</div>
|
||||||
<br>
|
<br>
|
||||||
<div>Current Version: $VERSION (last update: $DATE)</div>
|
<div>Current Version: <b>$VERSION</b> (last update: $DATE)</div>
|
||||||
<div>Price: $PRICE</div>
|
<div>Price: $PRICE</div>
|
||||||
<div>Link: <a href="$URL" rel="noopener noreferrer nofollow">iTunes</a></div>
|
<div>Link: <a href="$URL" rel="noopener noreferrer nofollow">iTunes</a></div>
|
||||||
<div>$IMG</div>
|
<div>$IMG</div>
|
||||||
|
|||||||
12
script.js
12
script.js
@@ -76,7 +76,9 @@ function saveConfig() {
|
|||||||
data.push(e.id + '=' + encodeURIComponent(value));
|
data.push(e.id + '=' + encodeURIComponent(value));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const prev = location.hash;
|
||||||
location.hash = '#' + data.join('&');
|
location.hash = '#' + data.join('&');
|
||||||
|
return prev !== location.hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -166,7 +168,15 @@ function urlsToImgs(list) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function randomIPA() {
|
function randomIPA() {
|
||||||
const idx = DB_result[Math.floor(Math.random() * DB_result.length)];
|
if (saveConfig()) {
|
||||||
|
applySearch();
|
||||||
|
}
|
||||||
|
var idx = 0;
|
||||||
|
if (DB_result.length > 0) {
|
||||||
|
idx = DB_result[Math.floor(Math.random() * DB_result.length)];
|
||||||
|
} else {
|
||||||
|
idx = Math.floor(Math.random() * DB.length);
|
||||||
|
}
|
||||||
const entry = entryToDict(DB[idx]);
|
const entry = entryToDict(DB[idx]);
|
||||||
const output = document.getElementById('content');
|
const output = document.getElementById('content');
|
||||||
output.innerHTML = entriesToStr('.single', [idx]);
|
output.innerHTML = entriesToStr('.single', [idx]);
|
||||||
|
|||||||
Reference in New Issue
Block a user