parameterize download count dropdown on android

This commit is contained in:
Danny Coates 2018-09-25 11:36:23 -07:00
parent 8b21a54ab4
commit 6b9a735bec
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
2 changed files with 8 additions and 9 deletions

View file

@ -14,6 +14,8 @@ window.LIMITS = {
}; };
window.DEFAULTS = { window.DEFAULTS = {
DOWNLOAD_COUNTS: [1, 2, 3, 4, 5, 20, 50, 100, 200],
EXPIRE_TIMES_SECONDS: [300, 3600, 86400, 604800],
EXPIRE_SECONDS: 3600 EXPIRE_SECONDS: 3600
}; };

View file

@ -1,3 +1,4 @@
/* globals DEFAULTS */
const html = require('choo/html'); const html = require('choo/html');
export default function options(state, emit) { export default function options(state, emit) {
@ -55,15 +56,11 @@ export default function options(state, emit) {
<div id="expires-after-section"> <div id="expires-after-section">
<h5>Expires after</h5> <h5>Expires after</h5>
<select name="numDownloads"> <select name="numDownloads">
<option value="1">1 download</option> ${DEFAULTS.DOWNLOAD_COUNTS.map(i => {
<option value="2">2 downloads</option> return html`<option value="${i}">${i} download${
<option value="3">3 downloads</option> i > 1 ? 's' : ''
<option value="4">4 downloads</option> }</option>`;
<option value="5">5 downloads</option> })}
<option value="20">20 downloads</option>
<option value="50">50 downloads</option>
<option value="100">100 downloads</option>
<option value="200">200 downloads</option>
</select> </select>
or or
<select name="maxTime"> <select name="maxTime">