var presentation = ["The Little Mermaid<\/word>","The Little Mermaid II: Return to the Sea<\/word>","The Little Mermaid: Ariel's Beginning<\/word>","fourth in the Disney Princess lineup<\/word>","mother to her own child<\/word>","Ariel<\/word>","fictional character<\/word>","title character<\/word>","Walt Disney Pictures<\/word>","animated film<\/word>","film<\/word>","prequel television series<\/word>","direct-to-video sequel<\/word>","direct-to-video prequel<\/word>","Jodi Benson<\/word>","nonhuman princess<\/word>","only princess<\/word>","Ariel<\/strong> is a fictional character<\/strong> and the title character<\/strong> of Walt Disney Pictures<\/strong>' 28th animated film<\/strong> The Little Mermaid<\/strong>. She subsequently appears in the film<\/strong>'s prequel television series<\/strong>, direct-to-video sequel<\/strong> The Little Mermaid II: Return to the Sea<\/strong>, and direct-to-video prequel<\/strong> The Little Mermaid: Ariel's Beginning<\/strong>. Ariel<\/strong> is voiced by Jodi Benson<\/strong> in all official animated appearances and merchandise. She is fourth in the Disney Princess lineup<\/strong>, the first nonhuman princess<\/strong>, and the only princess<\/strong> to become a mother to her own child<\/strong>.<\/phrase>","Ariel<\/word>","seventh-born daughter<\/word>","King Triton<\/word>","Queen Athena<\/word>","underwater kingdom<\/word>","Atlantica<\/word>","first film<\/word>","part<\/word>","human world<\/word>","Prince Eric<\/word>","Melody<\/word>","Ariel<\/strong> is the seventh-born daughter<\/strong> of King Triton<\/strong> and Queen Athena<\/strong> of an underwater kingdom<\/strong> of merfolk called Atlantica<\/strong>. She is often rebellious, and in the first film<\/strong>, she longs to be a part<\/strong> of the human world<\/strong>. She marries Prince Eric<\/strong>, whom she rescued from a shipwreck, and together they have a daughter, Melody<\/strong>.<\/phrase>","The Little Mermaid<\/word>","criticize her for being too devoted to Eric<\/word>","title character<\/word>","Hans Christian Andersen<\/word>","fairy tale<\/word>","different personality<\/word>","film adaptation<\/word>","Ariel<\/word>","mixed reception<\/word>","some publications<\/word>","Time<\/word>","whereas others<\/word>","Empire<\/word>","rebellious personality<\/word>","Disney Princesses<\/word>","The character is based on the title character<\/strong> of Hans Christian Andersen<\/strong>'s 1837 fairy tale<\/strong> \"The Little Mermaid<\/strong>\" but was developed into a different personality<\/strong> for the 1989 animated film adaptation<\/strong>. Ariel<\/strong> has received a mixed reception<\/strong> from critics; some publications<\/strong> such as Time<\/strong> criticize her for being too devoted to Eric<\/strong> whereas others<\/strong>, such as Empire<\/strong>, praise the character for her rebellious personality<\/strong>, a departure from previous Disney Princesses<\/strong>.<\/phrase>","The Little Mermaid<\/word>","curious about the world of humans<\/word>","not allowed<\/word>","in search of human objects<\/word>","Ariel<\/word>","her father<\/word>","King Triton<\/word>","Sebastian<\/word>","human world<\/word>","Flounder<\/word>","Scuttle<\/word>","Ariel<\/strong> first appears in The Little Mermaid<\/strong>, in which she is shown as being adventurous and curious about the world of humans<\/strong>, a fascination which annoys both her father<\/strong> King Triton<\/strong> and his court composer Sebastian<\/strong>, as merfolk are not allowed<\/strong> to make contact with the human world<\/strong>. She and Flounder<\/strong> go in search of human objects<\/strong>, which they take to a seagull named Scuttle<\/strong> for appraisal.<\/phrase>","falls in love<\/word>","turn her into a human<\/word>","exchange for her voice<\/word>","belong to Ursula forever<\/word>","Ariel<\/word>","Prince Eric<\/word>","Ursula<\/word>","love<\/word>","kiss<\/word>","Ariel<\/strong> falls in love<\/strong> with a human prince named Prince Eric<\/strong> after saving him from drowning, and visits the sea witch, Ursula<\/strong>, who agrees to turn her into a human<\/strong> in exchange for her voice<\/strong>. Ariel<\/strong> must make Prince Eric<\/strong> fall in love<\/strong> with her and romantically kiss<\/strong> her within three days, lest she belong to Ursula forever<\/strong>.<\/phrase>","part of Ursula's bigger plan<\/word>","steal his magical trident<\/word>","take her to the surface<\/word>","kiss of true love<\/word>","Ariel<\/word>","trap<\/word>","King Triton<\/word>","Sebastian<\/word>","Flounder<\/word>","obtain<\/word>","Ursula<\/word>","Unknown to Ariel<\/strong>, this agreement is part of Ursula's bigger plan<\/strong> to trap<\/strong> Ariel<\/strong>'s father, King Triton<\/strong> and steal his magical trident<\/strong>. After being transformed, Ariel<\/strong> found that she can no longer breathe, nor swim. Sebastian<\/strong> and Flounder<\/strong> take her to the surface<\/strong>. She is soon found by Eric and is taken back to his castle. Ariel<\/strong> almost manages to obtain<\/strong> the \"kiss of true love<\/strong>\", but is stopped by Ursula<\/strong>'s underhanded tactics.<\/phrase>","transforms herself into a human<\/word>","using Ariel's voice<\/word>","bewitches Eric<\/word>","disrupts the wedding<\/word>","regains her voice<\/word>","back into a mermaid<\/word>","Ursula<\/word>","Vanessa<\/word>","marry<\/word>","Scuttle<\/word>","Ariel<\/word>","Prince Eric<\/word>","kiss<\/word>","King Triton<\/word>","Sebastian<\/word>","On the third day, Ursula<\/strong> transforms herself into a human<\/strong>, calling herself \"Vanessa<\/strong>\" and using Ariel's voice<\/strong>, and bewitches Eric<\/strong> to make him marry<\/strong> her. After learning from Scuttle<\/strong> that the woman is Ursula<\/strong> in disguise, Ariel<\/strong> disrupts the wedding<\/strong> and regains her voice<\/strong> but the sun sets as Ariel<\/strong> and Prince Eric<\/strong> are about to kiss<\/strong>, transforming Ariel<\/strong> back into a mermaid<\/strong>. After transforming herself back into her true witch form, Ursula<\/strong> takes Ariel<\/strong> back into the ocean, where she is met by King Triton<\/strong> and Sebastian<\/strong>.<\/phrase>","Triton trades himself for Ariel<\/word>","Ursula to steal his crown<\/word>","not allow Ursula to destroy merfolk<\/word>","Ariel<\/word>","battle<\/word>","Ursula<\/word>","destroy<\/word>","Triton trades himself for Ariel<\/strong>, enabling Ursula to steal his crown<\/strong> and enabling her to claim his trident, a fascination which angers Ariel<\/strong>, who will not allow Ursula to destroy merfolk<\/strong> and humans. In the battle<\/strong> that follows, Ariel<\/strong> is trapped at the bottom of a whirlpool. Before Ursula<\/strong> can destroy<\/strong> her, Eric kills Ursula<\/strong> by ramming a derelict ship's splintered prow through her.<\/phrase>","Ursula dies<\/word>","spell is broken<\/word>","end of the film<\/word>","transform her into a human<\/word>","live happily ever after<\/word>","King Triton<\/word>","Ariel<\/word>","live<\/word>","human world<\/word>","Eric marry<\/word>","After Ursula dies<\/strong>, her spell is broken<\/strong>, and King Triton<\/strong> and the merfolk are transformed back to normal merpeople. At the end of the film<\/strong>, after King Triton<\/strong> uses his magical trident to transform her into a human<\/strong>, Ariel<\/strong> leaves the sea to live<\/strong> in the human world<\/strong>, and she and Eric marry<\/strong> and live happily ever after<\/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':1573, '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':1573, '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':1573, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }