summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.org>2025-07-25 19:28:34 -0400
committerJakob L. Kreuze <zerodaysfordays@sdf.org>2025-07-25 19:28:34 -0400
commit939594d1cfd2d11f7acc300f117204c050af2d13 (patch)
tree4aaee6acff3449b4802e92d37bdb91895958d88d
parent178c427e6e1a2cee0f22455f9a13e1502e87059f (diff)
Add cram mode
-rw-r--r--srs-anywhere.html2
-rw-r--r--srs-anywhere.js19
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]);