Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(typeof(window.___loaded) == 'undefined') {
- window.___loaded = true;
- // Anonymous "self-invoking" function
- (function() {
- // Load the script
- var script = document.createElement("SCRIPT");
- script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
- script.type = 'text/javascript';
- script.onload = function() {
- var $ = window.jQuery;
- setInterval(function() {
- if(document.location.pathname.split('/')[2] == 'learn') {
- var definition = "";
- var tdfs = document.getElementsByClassName("FormattedText notranslate TermText lang-photo");
- if(tdfs.length >= 1) {
- definition = tdfs[0].innerText;
- } else {
- definition = $('.Image-image').attr('src')
- }
- var terms = Quizlet.assistantModeData.terms;
- for(var i = 0; i < terms.length; i++) {
- if(terms[i].definition == definition || terms[i]._imageUrl == definition) {
- $(".UITextarea-label").children().html("TYPE <u>" + terms[i].word + "</u>");
- $('.TermText').filter(function () {
- return $(this).text() == terms[i].word;
- }).click();
- }
- }
- } else if(document.location.pathname.split('/')[2] == 'write') {
- if(document.getElementById('user-answer') != null) {
- document.getElementById('user-answer').value = Game.curTerm.word;
- document.getElementById('js-learnModeAnswerButton').click();
- }
- } else if(document.location.pathname.split('/')[2] == 'spell') {
- if(document.getElementById('js-spellRoundAnalysis').style.display == "none"
- && document.getElementsByClassName("UITextarea-label")[0].innerText == "ANSWER") {
- Game.beatTerm();
- }
- } else if(document.location.pathname.split('/')[2] == 'test') {
- var ts = $('.TestModeSection-questionItem').find("textarea");
- var terms = Quizlet.TestModeData.terms;
- for(var i = 0; i < ts.length; i++) {
- var t = ts[i];
- var definition = "";
- var im = $(t.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.children[0]).find('img').attr('src');
- if(typeof(im) != 'undefined')
- definition = im;
- else
- definition = t.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.children[0].innerText;
- for(var j = 0; j < terms.length; j++) {
- if(terms[j].definition == definition || terms[j]._imageUrl == definition) {
- $(t.parentElement.parentElement.parentElement.parentElement.children[1]).html("type <u>" + terms[j].word + "</u>");
- }
- }
- }
- } else if(document.location.pathname.split('/')[2] == 'match') {
- var ts = $('.MatchModeQuestionScatterTile');
- var terms = Quizlet.matchModeData.terms;
- for(var i = 0; i < ts.length; i++) {
- var t = $(ts[i]);
- var definition = "";
- var im = t.find('img').attr('src');
- if(typeof(im) != 'undefined')
- definition = im;
- else
- definition = t.text();
- for(var j = 0; j < terms.length; j++) {
- if(terms[j].definition == definition || terms[j]._imageUrl == definition || terms[j].word == definition) {
- t.css({ 'background': '#' + Math.floor((Math.abs(Math.sin(j) * 16777215)) % 16777215).toString(16) });
- }
- }
- }
- }
- }, 1);
- };
- document.getElementsByTagName("head")[0].appendChild(script);
- })();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement