NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Progress Display for Magoosh Flashcards // @namespace http://qingxiang-jia.github.io/ // @version 0.2.1 // @description Adds a progress display at the upper right corner that indicates the number of words seen so far. And hotkeys to see definition (enter), "I know this word (1)", and "I don't know this word (2)". Perfect for reviewing a completed deck. // @author Qingxiang Jia // @match https://gre.magoosh.com/flashcards/vocabulary/* // @grant none // ==/UserScript== var mySet = new Set(); var observable = document.getElementsByClassName('flashcard-container')[0]; observable.addEventListener('DOMSubtreeModified', function(ev) { console.log(ev.target.nodeValue, ev.timeStamp); var word = document.getElementsByClassName("flashcard-word flashcard-word-small")[0].innerHTML; mySet.add(word); console.log(mySet); document.getElementsByClassName('long-version')[0].innerHTML = "Progress: " + mySet.size ; }, false); window.onkeyup = function(e) { console.log('keyup'); console.log(e.which); if (e.which == 49) { $('.flashcard-btn.success').trigger('click'); } else if (e.which == 50) { $('.flashcard-btn.danger').trigger('click'); } else if (e.which == 13 || e.which == 32 || e.which == 39) { $('.flashcard-btn')[0].click(); } };