3 Commits
Author SHA1 Message Date
jdb d7b18e8f86 Ignore empty answers. 2020-12-11 15:44:14 -06:00
jdb 6a5b1589ef Update README for 2.x 2020-12-11 15:37:32 -06:00
jdb 8d265c400c Prevent the importFromURL button from submitting the form. 2020-12-11 15:33:18 -06:00
2 changed files with 14 additions and 7 deletions
+4 -1
View File
@@ -1,10 +1,13 @@
Simple Flashcards takes a set of text values, one value per line, and shows
them to the user one at a time. It has the following features:
* Configurable timing between cards.
* Support for prompts only or prompts and answers.
* Image URLs can be used as values for pictoral flashcards.
* Configurable timing between cards and answers.
* Configurable size of the text (small, medium, and large).
* In-order, reverse-order, and random-order traversal of the cards.
* Support for saving/loading settings and inputs (locally to the browser).
* Support for importing/exporting saved card sets as a file.
* Support for importing saved card sets from a URL.
Simple Flashcards is available at http://flashcards.jdbernard.com
+10 -6
View File
@@ -127,13 +127,15 @@
const promptDiv = document.createElement("div");
promptDiv.classList.add('prompt');
promptDiv.innerHTML = FC.transformContent(item.prompt);
const answerDiv = document.createElement("div");
answerDiv.classList.add('answer');
answerDiv.innerHTML = FC.transformContent(item.answer);
newCardDiv.appendChild(promptDiv);
newCardDiv.appendChild(answerDiv);
if (item.answer) {
const answerDiv = document.createElement("div");
answerDiv.classList.add('answer');
answerDiv.innerHTML = FC.transformContent(item.answer);
newCardDiv.appendChild(answerDiv);
}
return newCardDiv;
};
@@ -272,6 +274,8 @@
};
FC.importCardSetFromURL = function(ev) {
ev.preventDefault();
fetch(FC.$('input[name=importURL]').value)
.then(resp => resp.json())
.then(set => {