Created
November 20, 2018 05:21
-
-
Save MrAnhell/9924c5d32376329d565b0bcd4445a2f6 to your computer and use it in GitHub Desktop.
Revisions
-
aaronzolla created this gist
Aug 26, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ var timeout=parseFloat(prompt("Timeout? In seconds."));function eventFire(e,t){if(e.fireEvent)e.fireEvent("on"+t);else{var n=document.createEvent("Events");n.initEvent(t,!0,!1),e.dispatchEvent(n)}}document.body.addEventListener("click",function(){setTimeout(function(){for(var e=document.body.innerHTML,t=JSON.parse(e.split("window.Quizlet.matchModeData = ")[1].split("; QLoad('Quizlet.matchModeData')")[0]).terms,n=[],i=0;i<t.length;i++)n.push([t[i].definition,t[i].word]);for(var o=document.querySelectorAll("div.MatchModeQuestionGridBoard-tile div div div div"),r=[],d=0;d<o.length;d++)r.push([o[d].innerText,o[d]]);for(var a=0;a<r.length;a++)for(var v=0;v<n.length;v++)if(r[a][0]==n[v][0])for(var u=0;u<r.length;u++)r[u][0]==n[v][0]&&eventFire(r[u][1],"pointerdown"),r[u][0]==n[v][1]&&eventFire(r[u][1],"pointerdown")},1e3*timeout)});