diff options
| -rw-r--r-- | srs-anywhere.html | 2 | ||||
| -rw-r--r-- | srs-anywhere.js | 19 |
2 files changed, 15 insertions, 6 deletions
diff --git a/srs-anywhere.html b/srs-anywhere.html index 220d54f..1e4aa4e 100644 --- a/srs-anywhere.html +++ b/srs-anywhere.html @@ -19,6 +19,8 @@ <hr> <input type="file" id="cards-input" accept=".json" /> <button id="open-modal">?</button> + <br /> + <label for="cram">Cram mode? <input type="checkbox" id="cram-mode-checkbox"></label> </div> <div id="button-container"> diff --git a/srs-anywhere.js b/srs-anywhere.js index 6256eeb..6dc82bf 100644 --- a/srs-anywhere.js +++ b/srs-anywhere.js @@ -342,12 +342,19 @@ function loadCards(data) { document.getElementById('rating-button-easy') .addEventListener('click', () => rateCard('easy')); - let today = new Date(); - // Granularity only at the day level. - today.setHours(0, 0, 0, 0); - window.cards = data.filter((card) => { - return (new Date(card._scheduled)) <= today; - }); + const cramEnabled = document.getElementById('cram-mode-checkbox').checked; + + if (cramEnabled) { + window.cards = data; + } else { + let today = new Date(); + // Granularity only at the day level. + today.setHours(0, 0, 0, 0); + window.cards = data.filter((card) => { + return (new Date(card._scheduled)) <= today; + }); + } + shuffleArray(window.cards); loadCard(window.cards[0]); |