var presentation = ["animated film<\/word>","nicknamed Dumbo<\/word>","ridiculed for his big ears<\/word>","capable of flying<\/word>","using his ears as wings<\/word>","only true friend<\/word>","the mouse, Timothy<\/word>","Dumbo<\/word>","Walt Disney Productions<\/word>","main character<\/word>","Jumbo Jr<\/word>","film<\/word>","his mother<\/word>","Dumbo<\/strong> is a 1941 American animated film<\/strong> produced by Walt Disney Productions<\/strong>. The main character<\/strong> is Jumbo Jr<\/strong>., an elephant who is cruelly nicknamed Dumbo<\/strong>. He is ridiculed for his big ears<\/strong>, but in fact he is capable of flying<\/strong> by using his ears as wings<\/strong>. Throughout most of the film<\/strong>, his only true friend<\/strong>, aside from his mother<\/strong>, is the mouse, Timothy<\/strong>.<\/phrase>","flock of storks deliver babies to circus animals<\/word>","mothers receive their parcels<\/word>","except the elephant Mrs. Jumbo<\/word>","lost stork<\/word>","brings her an elephant<\/word>","adorned with extraordinarily large ears<\/word>","object of ridicule<\/word>","given the nickname Dumbo<\/word>","Mrs. Jumbo attempts to remain dignified<\/word>","treats her child with all her maternal love<\/word>","group of rascals<\/word>","mocking Dumbo<\/word>","Mrs. Jumbo catches one of them with her trunk<\/word>","spanks him<\/word>","circus ringmaster deems Mrs. Jumbo mad<\/word>","has her locked in a cage<\/word>","Dumbo is made a pariah<\/word>","consoles Dumbo<\/word>","vows to make him a star<\/word>","Winter Quarters<\/word>","Florida<\/word>","travel<\/word>","circus troupe<\/word>","small mouse<\/word>","Timothy<\/word>","Upon the passing of winter, in 1941, a flock of storks deliver babies to circus animals<\/strong> within the Winter Quarters<\/strong> in Florida<\/strong>. All the mothers receive their parcels<\/strong> before departure except the elephant Mrs. Jumbo<\/strong>. During travel<\/strong>, a lost stork<\/strong> brings her an elephant<\/strong> who, to the other elephants' surprise, is adorned with extraordinarily large ears<\/strong>. He is made an object of ridicule<\/strong> and given the nickname Dumbo<\/strong>. Mrs. Jumbo attempts to remain dignified<\/strong> and treats her child with all her maternal love<\/strong>, but when a group of rascals<\/strong> takes to mocking Dumbo<\/strong>, Mrs. Jumbo catches one of them with her trunk<\/strong> and spanks him<\/strong>. The circus ringmaster deems Mrs. Jumbo mad<\/strong> and has her locked in a cage<\/strong>. The lone Dumbo is made a pariah<\/strong> amongst the rest of the circus troupe<\/strong>. A small mouse<\/strong> named Timothy<\/strong> consoles Dumbo<\/strong> and vows to make him a star<\/strong>.<\/phrase>","ringmaster makes Dumbo the top of an elephant pyramid stunt<\/word>","performance goes awry<\/word>","Dumbo trips over his ears<\/word>","other elephants to suffer various injuries<\/word>","Dumbo is made into a clown<\/word>","falling into a vat of pie filling<\/word>","his newfound popularity and fame<\/word>","Dumbo hates this job<\/word>","more miserable than ever<\/word>","To cheer Dumbo up<\/word>","Timothy takes him to visit his imprisoned mother<\/word>","unable to see each other face to face<\/word>","only entwine trunks<\/word>","Dumbo cries<\/word>","gets the hiccups<\/word>","Timothy takes him for a drink of water<\/word>","accidentally had a bottle of champagne spilled into it<\/word>","Dumbo and Timothy both get drunk<\/word>","surreal hallucinations<\/word>","Timothy<\/word>","his target<\/word>","pink elephants<\/word>","After being secretly encouraged by Timothy<\/strong>, the ringmaster makes Dumbo the top of an elephant pyramid stunt<\/strong>. The performance goes awry<\/strong> when Dumbo trips over his ears<\/strong> and misses his target<\/strong>, causing the other elephants to suffer various injuries<\/strong>, and bring down the big top. Dumbo is made into a clown<\/strong> as a result, to the shame of the other elephants, and plays the main role in an act that involves him falling into a vat of pie filling<\/strong>. Despite his newfound popularity and fame<\/strong>, Dumbo hates this job<\/strong>, and is now more miserable than ever<\/strong>. To cheer Dumbo up<\/strong>, Timothy takes him to visit his imprisoned mother<\/strong>. The two are unable to see each other face to face<\/strong>, and can only entwine trunks<\/strong>. On the way back, Dumbo cries<\/strong> and then gets the hiccups<\/strong>, so Timothy takes him for a drink of water<\/strong> from a bucket that, unknown to them, has accidentally had a bottle of champagne spilled into it<\/strong> by the clowns. As a result, Dumbo and Timothy both get drunk<\/strong> and have surreal hallucinations<\/strong> of pink elephants<\/strong>.<\/phrase>","awakened by a group of crows<\/word>","find an elephant sitting on the highest branches of a tree<\/word>","Timothy surmises that Dumbo had managed to achieve flight<\/word>","large ears as wings<\/word>","crows' leader<\/word>","gives Dumbo one of his feathers<\/word>","carries magic properties that will allow him to fly<\/word>","next morning<\/word>","Dumbo<\/word>","Timothy<\/word>","initial astonishment passes<\/word>","The next morning<\/strong>, Dumbo<\/strong> and Timothy<\/strong> are awakened by a group of crows<\/strong> who are surprised to find an elephant sitting on the highest branches of a tree<\/strong>. As the initial astonishment passes<\/strong>, Timothy surmises that Dumbo had managed to achieve flight<\/strong> using his large ears as wings<\/strong>. Timothy<\/strong> persuades an insecure Dumbo<\/strong> to use this gift with the support of the crows' leader<\/strong>, who gives Dumbo one of his feathers<\/strong> and convinces him that it carries magic properties that will allow him to fly<\/strong>.<\/phrase>","Timothy proposes to Dumbo to transform his clown act into a flying performance<\/word>","Dumbo unfolds his ears<\/word>","loses the feather and panics<\/word>","Timothy quickly confesses that the feather was never magical<\/word>","still able to fly<\/word>","flies around the circus<\/word>","striking back at his tormentors<\/word>","stunned audience<\/word>","looks on in amazement<\/word>","Dumbo<\/word>","Back at the circus, Timothy proposes to Dumbo to transform his clown act into a flying performance<\/strong>. As Dumbo unfolds his ears<\/strong> during the plummet, he loses the feather and panics<\/strong>. Timothy quickly confesses that the feather was never magical<\/strong>, and that he is still able to fly<\/strong>. Dumbo<\/strong> is able to pull out of the dive and flies around the circus<\/strong>, finally striking back at his tormentors<\/strong> as a stunned audience<\/strong> looks on in amazement<\/strong>.<\/phrase>","Dumbo becomes a media sensation<\/word>","Timothy becomes his manager<\/word>","new owner of the circus<\/word>","Dumbo and Mrs. Jumbo are given a private car<\/word>","circus train<\/word>","Mrs. Jumbo<\/word>","wave goodbye<\/word>","elephant's new friends wishing him good luck<\/word>","Casey Jr<\/word>","Dumbo<\/word>","After this performance, Dumbo becomes a media sensation<\/strong>, Timothy becomes his manager<\/strong> and the new owner of the circus<\/strong>, Dumbo and Mrs. Jumbo are given a private car<\/strong> on the circus train<\/strong>, and while the sentient train Casey Jr<\/strong>. travels to the next destination, Mrs. Jumbo<\/strong>, Dumbo<\/strong> and the crows wave goodbye<\/strong> in the distance, with the little elephant's new friends wishing him good luck<\/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':2240, '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':2240, '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':2240, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }