var presentation = ["Aladdin<\/word>","animated musical fantasy film<\/word>","based on the Arabic folktale<\/word>","One Thousand and One Nights<\/word>","film follows Aladdin<\/word>","Arabian street urchin<\/word>","finds a magic lamp<\/word>","disguises himself<\/word>","tries to impress<\/word>","Jasmine<\/word>","Walt Disney Feature Animation<\/word>","Walt Disney Pictures<\/word>","same name<\/word>","genie<\/word>","wealthy prince<\/word>","Sultan<\/word>","his daughter<\/word>","Aladdin<\/strong> is a 1992 American animated musical fantasy film<\/strong> produced by Walt Disney Feature Animation<\/strong> and released by Walt Disney Pictures<\/strong>. It is based on the Arabic folktale<\/strong> of the same name<\/strong> from the One Thousand and One Nights<\/strong>. The film follows Aladdin<\/strong>, an Arabian street urchin<\/strong>, who finds a magic lamp<\/strong> containing a genie<\/strong>. He disguises himself<\/strong> as a wealthy prince<\/strong>, and tries to impress<\/strong> the Sultan<\/strong> and his daughter<\/strong>, Jasmine<\/strong>.<\/phrase>","Jafar<\/word>","seek a lamp<\/word>","only one person is worthy to enter<\/word>","diamond in the rough<\/word>","Jafar later identifies as Aladdin<\/word>","Agrabah street urchin<\/word>","Princess Jasmine of Agrabah<\/word>","upset<\/word>","law requires her to marry a prince instead of one she loves<\/word>","escapes the palace<\/word>","meets Aladdin<\/word>","his pet monkey<\/word>","Abu<\/word>","palace guards capture Aladdin<\/word>","Jafar's orders<\/word>","Jasmine confronts Jafar<\/word>","demand Aladdin's release<\/word>","lies<\/word>","says Aladdin has been executed<\/word>","Royal Vizier<\/word>","fictional city<\/word>","Agrabah<\/word>","his parrot<\/word>","Iago<\/word>","Cave of Wonders<\/word>","Jafar<\/strong>, the Royal Vizier<\/strong> of the fictional city<\/strong> of Agrabah<\/strong>, and his parrot<\/strong> Iago<\/strong> seek a lamp<\/strong> hidden within the Cave of Wonders<\/strong>. They are told that only one person is worthy to enter<\/strong>; the diamond in the rough<\/strong>, whom Jafar later identifies as Aladdin<\/strong>, an Agrabah street urchin<\/strong>. Princess Jasmine of Agrabah<\/strong> is upset<\/strong> that the law requires her to marry a prince instead of one she loves<\/strong>, escapes the palace<\/strong>, and meets Aladdin<\/strong> and his pet monkey<\/strong>, Abu<\/strong>. The palace guards capture Aladdin<\/strong> on Jafar's orders<\/strong>. Jasmine confronts Jafar<\/strong> to demand Aladdin's release<\/strong>, but he lies<\/strong> and says Aladdin has been executed<\/strong>.<\/phrase>","Disguised as an old man<\/word>","Jafar frees Aladdin and Abu<\/word>","brings them to the cave<\/word>","ordering them to retrieve the lamp<\/word>","told to touch nothing but the lamp<\/word>","Aladdin<\/word>","obtains the lamp<\/word>","Abu grabs a jewel<\/word>","Aladdin, Abu, and the carpet rush to escape the cave<\/word>","Aladdin gives the lamp to Jafar<\/word>","throws him and Abu back into the cave<\/word>","Abu steals the lamp back<\/word>","Aladdin rubs the lamp<\/word>","meets the Genie who lives inside it<\/word>","Aladdin tricks the Genie into freeing them all<\/word>","without using a wish<\/word>","become a prince<\/word>","woo Jasmine<\/word>","promises to use his third wish<\/word>","free the Genie from servitude<\/word>","magic carpet<\/word>","genie<\/word>","three wishes<\/word>","first wish<\/word>","Disguised as an old man<\/strong>, Jafar frees Aladdin and Abu<\/strong> and brings them to the cave<\/strong>, ordering them to retrieve the lamp<\/strong>. After being told to touch nothing but the lamp<\/strong>, Aladdin<\/strong> finds a magic carpet<\/strong> inside and obtains the lamp<\/strong>. Forgetting the cave's rule, Abu grabs a jewel<\/strong>. Aladdin, Abu, and the carpet rush to escape the cave<\/strong> as it collapses. Aladdin gives the lamp to Jafar<\/strong>, who throws him and Abu back into the cave<\/strong>, though not before Abu steals the lamp back<\/strong>. Trapped, Aladdin rubs the lamp<\/strong> and meets the Genie who lives inside it<\/strong>. The genie<\/strong> grants Aladdin<\/strong> three wishes<\/strong>. Aladdin tricks the Genie into freeing them all<\/strong> from the cave without using a wish<\/strong>. He uses his first wish<\/strong> to become a prince<\/strong> to woo Jasmine<\/strong> and promises to use his third wish<\/strong> to free the Genie from servitude<\/strong>.<\/phrase>","Iago's suggestion<\/word>","Jafar<\/word>","become Sultan<\/word>","marrying Jasmine<\/word>","Aladdin<\/word>","Jasmine becomes angry<\/word>","discusses her fate with her father<\/word>","without her<\/word>","Aladdin takes Jasmine on a ride on the magic carpet<\/word>","deduces his true identity<\/word>","convinces her<\/word>","only dresses as a peasant to escape the stresses of royal life<\/word>","Jasmine<\/word>","palace guards capture Aladdin<\/word>","throw him into the sea<\/word>","Genie appears<\/word>","saves him<\/word>","cost of his second wish<\/word>","exposes Jafar's evil plot<\/word>","Jafar flees<\/word>","spotting the lamp<\/word>","thus discovering Aladdin's true identity<\/word>","Prince Ali Ababwa<\/word>","Agrabah<\/word>","Sultan<\/word>","At Iago's suggestion<\/strong>, Jafar<\/strong> plots to become Sultan<\/strong> by marrying Jasmine<\/strong>. Aladdin<\/strong>, as Prince Ali Ababwa<\/strong>, arrives in Agrabah<\/strong> with a large host, but Jasmine becomes angry<\/strong> when he discusses her fate with her father<\/strong>, the Sultan<\/strong>, and Jafar<\/strong> without her<\/strong>. As a means of apologizing, Aladdin takes Jasmine on a ride on the magic carpet<\/strong>. When she deduces his true identity<\/strong>, he convinces her<\/strong> that he only dresses as a peasant to escape the stresses of royal life<\/strong>. After Aladdin<\/strong> brings Jasmine<\/strong> home, the palace guards capture Aladdin<\/strong> on Jafar<\/strong>'s behest and throw him into the sea<\/strong>. The Genie appears<\/strong> and saves him<\/strong> at the cost of his second wish<\/strong>. Aladdin<\/strong> returns to the palace and exposes Jafar's evil plot<\/strong>. Jafar flees<\/strong> after spotting the lamp<\/strong> and thus discovering Aladdin's true identity<\/strong>.<\/phrase>","Fearing that he will lose Jasmine<\/word>","Aladdin breaks his promise<\/word>","refuses to free the Genie<\/word>","Iago steals the lamp<\/word>","Jafar<\/word>","Genie's new master<\/word>","become Sultan<\/word>","world's most powerful sorcerer<\/word>","exposes Aladdin's identity<\/word>","exiles him, Abu, and the carpet<\/word>","frozen wasteland<\/word>","return to the palace<\/word>","Jasmine<\/word>","Aladdin<\/word>","steal the lamp back<\/word>","Jafar notices<\/word>","overpowers the heroes with his magic<\/word>","Aladdin taunts Jafar<\/word>","less powerful than the Genie<\/word>","last wish to become an all-powerful genie himself<\/word>","Jafar ends up trapped<\/word>","taking Iago with him<\/word>","two wishes<\/word>","escape<\/word>","help<\/word>","Fearing that he will lose Jasmine<\/strong> if the truth is revealed, Aladdin breaks his promise<\/strong> and refuses to free the Genie<\/strong>. Iago steals the lamp<\/strong>, and Jafar<\/strong> becomes the Genie's new master<\/strong>. He uses his first two wishes<\/strong> to become Sultan<\/strong> and the world's most powerful sorcerer<\/strong>. He then exposes Aladdin's identity<\/strong> and exiles him, Abu, and the carpet<\/strong> to a frozen wasteland<\/strong>. They escape<\/strong> and return to the palace<\/strong>. Jasmine<\/strong> tries to help<\/strong> Aladdin<\/strong> steal the lamp back<\/strong>, but Jafar notices<\/strong> and overpowers the heroes with his magic<\/strong>. Aladdin taunts Jafar<\/strong> for being less powerful than the Genie<\/strong>, tricking Jafar<\/strong> into using his last wish to become an all-powerful genie himself<\/strong>. Now bound to his new lamp, Jafar ends up trapped<\/strong> inside it, taking Iago with him<\/strong>.<\/phrase>","Genie banishes Jafar's lamp<\/word>","advises Aladdin to use his third wish<\/word>","regain his royal title<\/word>","allow him to stay with Jasmine<\/word>","Aladdin<\/word>","keep his promise<\/word>","frees the Genie<\/word>","Realizing Aladdin and Jasmine's love<\/word>","Sultan changes the law<\/word>","allow Jasmine to marry whom she chooses<\/word>","Genie leaves to explore the world<\/word>","Aladdin and Jasmine start their new life together<\/word>","Agrabah<\/word>","With Agrabah<\/strong> returned to normal, the Genie banishes Jafar's lamp<\/strong> and advises Aladdin to use his third wish<\/strong> to regain his royal title<\/strong>, so the law will allow him to stay with Jasmine<\/strong>. Aladdin<\/strong> decides instead to keep his promise<\/strong> and frees the Genie<\/strong>. Realizing Aladdin and Jasmine's love<\/strong>, the Sultan changes the law<\/strong> to allow Jasmine to marry whom she chooses<\/strong>. The Genie leaves to explore the world<\/strong>, while Aladdin and Jasmine start their new life together<\/strong>.<\/phrase>"]; var currentPosition = 0; var totalPositions = 0; var timePerWord = 1500; var timePerPhraseWord = 120 var readAheadPlayerTimer; var autoPlay = true; var setMinimized = false; var wordSpeedOptions = {'Slower':2000,'Moderate':1200,'Fast':800}; var phraseSpeedOptions = {'Slower':280,'Moderate':200,'Fast':80}; var defaultWordSpeedOption = 'Moderate'; var defaultPhraseSpeedOption = 'Moderate'; var logToLTI = false; $(window).load(function(){ totalPositions = presentation.length; if (totalPositions > 0){ $('body').prepend('
'); $('body').prepend('
'); $('#read_ahead_player').prepend('
'); initializeReadAheadControls(); initializeReadAheadSlider(); initializeReadAheadSpeedOptions(); currentReadAheadControls(); resumeReadAheadPlayback(); } }); $(document).keyup(function(e){ switch(e.which) { case 37: pauseReadAheadPresentation(); priorReadAheadPresentationItem(); break; case 39: pauseReadAheadPresentation(); nextReadAheadPresentationItem(); break; default: break; } }); function initializeReadAheadControls(){ var s = ''; s += ''; s += ''; s += ''; s += '
'; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += '
'; $('#read_ahead_player').append(s); } function initializeReadAheadSlider(){ var s = ''; s += '
'; s += '
'; s += '
'; $('#read_ahead_controls').prepend(s); updateReadAheadSliderPosition(); } function initializeReadAheadSpeedOptions(){ var s = '
'; s += '
'; s += ' Word Speed
'; s += '
'; optionCount = 0; for (index in wordSpeedOptions) { optionCount++; } optionWidth = 100 / optionCount; for (index in wordSpeedOptions) { var option = wordSpeedOptions[index]; if (index == defaultWordSpeedOption) { s += ''; updateReadAheadWordSpeed(option); } else { s += ''; } } s += '
'; s += '
'; s += '
'; s += ' Phrase Speed
'; s += '
'; optionCount = 0; for (index in phraseSpeedOptions) { optionCount++; } optionWidth = 100 / optionCount; for (index in phraseSpeedOptions) { var option = phraseSpeedOptions[index]; if (index == defaultWordSpeedOption) { s += ''; updateReadAheadPhraseSpeed(option); } else { s += ''; } } s += '
'; s += '
'; s += '
'; $('#read_ahead_controls').append(s); } function updateReadAheadWordSpeed(microseconds,sender) { microseconds = microseconds != undefined && microseconds > 0 ? microseconds : 0; if (microseconds > 0) { timePerWord = microseconds; } if (sender!=undefined) { $('#slider_control_word_speed').find('a').removeClass('current_speed'); $(sender).addClass('current_speed'); } logReadAheadPlayerAction('updateReadAheadWordSpeed','Presentation',microseconds); } function updateReadAheadPhraseSpeed(microseconds,sender) { microseconds = microseconds != undefined && microseconds > 0 ? microseconds : 0; if (microseconds > 0 ) { timePerPhraseWord = microseconds; } if (sender!=undefined) { $('#slider_control_phrase_speed').find('a').removeClass('current_speed'); $(sender).addClass('current_speed'); } logReadAheadPlayerAction('updateReadAheadPhraseSpeed','Presentation',microseconds); } function updateReadAheadSliderPosition(){ var currentSliderBarWidth = 100 - (100 / totalPositions * (currentPosition + 1)); $('#readAheadSliderBar').css('width',currentSliderBarWidth+'%'); } function currentReadAheadControls(){ $('#read_ahead_player_pause_play').show(); if (currentPosition < totalPositions - 1) { $('#read_ahead_player_next_word').removeClass('disabled'); } else { $('#read_ahead_player_next_word').addClass('disabled'); } if (currentPosition > 0) { $('#read_ahead_player_previous_word').removeClass('disabled'); } else { $('#read_ahead_player_previous_word').addClass('disabled'); } } function restartReadAheadPresentation(){ currentPosition = 0; logReadAheadPlayerAction('restartReadAheadPresentation','Presentation',''); resumeReadAheadPlayback(); } function resumeReadAheadPlayback(){ $('.fa-repeat').removeClass('fa-repeat').addClass('fa-play'); $('#read_ahead_player_pause_play').each(function(){ $(this).find('.fa-play').removeClass('fa-play').addClass('fa-pause'); $(this).off('click'); $(this).attr('onclick','pauseReadAheadPresentation()'); }); logReadAheadPlayerAction('resumeReadAheadPlayback','Presentation',''); playReadAheadPresentation(); } function pauseReadAheadPresentation(){ $('#read_ahead_player_pause_play').each(function(){ $(this).find('.fa-pause').removeClass('fa-pause').addClass('fa-play'); $(this).off('click'); $(this).attr('onclick','resumeReadAheadPlayback()'); }); logReadAheadPlayerAction('pauseReadAheadPresentation','Presentation',''); read_ahead_pause(); } function endReadAheadPresentation(){ $('.fa-play').removeClass('fa-play').addClass('fa-repeat'); $('.fa-pause').removeClass('fa-pause').addClass('fa-repeat'); $('#read_ahead_player_pause_play').each(function(){ $(this).off('click'); $(this).attr('onclick','restartReadAheadPresentation()'); }); logReadAheadPlayerAction('endReadAheadPresentation','Presentation',''); logLTIEndPresentation(); } function playReadAheadPresentation(){ autoPlay=true; currentPosition--; logReadAheadPlayerAction('playReadAheadPresentation','Presentation',''); nextReadAheadPresentationItem(); } function startReadAheadStepper(timeDisplayWord){ clearInterval(readAheadPlayerTimer); readAheadPlayerTimer = setTimeout(function() { read_ahead_step(); },timeDisplayWord); } function stopReadAheadStepper(){ clearInterval(readAheadPlayerTimer); } function read_ahead_step(){ if (autoPlay) { nextReadAheadPresentationItem(); } } function read_ahead_pause(){ autoPlay=false; stopReadAheadStepper(); } function showReadAheadPresentationItem(index){ currentPosition = index; currentPresentationItem = presentation[currentPosition] != undefined ? presentation[currentPosition].trim() : ""; if (currentPresentationItem != "") { currentItemWordCount = presentation[currentPosition].replace("\n","").split(" ").length; if (currentPresentationItem.startsWith("")){ startReadAheadStepper(currentItemWordCount*timePerWord); $('#read_ahead_player_field').html('
'+currentPresentationItem+'
'); logReadAheadPlayerAction('showReadAheadPresentationItem','Word',currentPresentationItem); } else { startReadAheadStepper(currentItemWordCount*timePerPhraseWord); $('#read_ahead_player_field').html('
'+currentPresentationItem.replace("\n","
")+'
'); logReadAheadPlayerAction('showReadAheadPresentationItem','Phrase',''); } } else { if (currentPosition < totalPositions) { nextReadAheadPresentationItem(); } else { endReadAheadPresentation(); read_ahead_minimize(); } } currentReadAheadControls(); updateReadAheadSliderPosition(); saveReadAheadPosition(); } function priorReadAheadPresentationItem(){ stopReadAheadStepper(); logReadAheadPlayerAction('priorReadAheadPresentationItem','Controls',''); showReadAheadPresentationItem(currentPosition-1); } function nextReadAheadPresentationItem(){ stopReadAheadStepper(); logReadAheadPlayerAction('nextReadAheadPresentationItem','Controls',''); showReadAheadPresentationItem(currentPosition+1); } function read_ahead_playAgain(){ currentWordIndex = 0; logReadAheadPlayerAction('read_ahead_playAgain','Controls',''); playReadAheadPresentation(); } function read_ahead_minimize(){ setMinimized = true; logReadAheadPlayerAction('read_ahead_minimize','Controls',''); read_ahead_switch_min_max(); } function read_ahead_maximize(){ setMinimized = false; logReadAheadPlayerAction('read_ahead_maximize','Controls',''); read_ahead_switch_min_max(); } function read_ahead_switch_min_max(forceSwitch){ forceSwitch = forceSwitch != undefined ? forceSwitch : false; if (forceSwitch) { setMinimized = !setMinimized; } if (setMinimized) { $('#read_ahead_player_back').fadeOut(); $('#read_ahead_player').addClass('minimize'); $('.player-icons .fa-stack').removeClass('fa-lg').addClass('fa-sm'); $('.player-icons .fa-minus').removeClass('fa-minus').addClass('fa-expand'); logReadAheadPlayerAction('read_ahead_switch_min_max','Min',''); //$('#read_ahead_player_max_min').each(function(){ // $(this).off('click'); // $(this).attr('onclick','read_ahead_maximize()'); //}); } else { $('#read_ahead_player_back').fadeIn(); $('#read_ahead_player').removeClass('minimize'); $('.player-icons .fa-stack').removeClass('fa-sm').addClass('fa-lg'); $('.player-icons .fa-expand').removeClass('fa-expand').addClass('fa-minus'); logReadAheadPlayerAction('read_ahead_switch_min_max','Max',''); //$('#read_ahead_player_max_min').each(function(){ // $(this).off('click'); // $(this).attr('onclick','read_ahead_minimize()'); //}); } } function saveReadAheadPosition(){ $.ajax({ type:'POST', url:'/ajax/save_user_presentation_position.php', data: { 'id':2276, 'position': currentPosition } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); } function logLTIEndPresentation(action) { if (!logToLTI) { return; } $.ajax({ type:'POST', url:'/lti/presentationEnded.php', data: { 'documentId':2276, 'userId':0, } }) } function logReadAheadPlayerAction(action,area,details){ var d = new Date(); var t = d.getTime(); action = action != undefined ? action.trim() : 'UNKNOWN'; area = area != undefined ? area.trim() : ''; details = details != undefined ? details : ''; // If we are about to show a new word, increase the number of keywords // reinforced so we can log that for the Dashboard page. if (area == 'Word') { window.keywordCount++; } $.ajax({ type:'POST', url:'/logging/logPlayerAction.php', data: { 'documentId':2276, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }