var presentation = ["1989<\/word>","mother<\/word>","previous signs of pregnancy<\/word>","Sir Reginald Hargreeves<\/word>","save the world<\/word>","The Umbrella Academy<\/word>","summon eldritch creatures<\/word>","portal to another dimension<\/word>","disbanded<\/word>","Ben Hargreeves<\/word>","forty-three children<\/word>","same day<\/word>","individual usefulness<\/word>","Number Six<\/word>","main reasons<\/word>","Ben Hargreeves<\/strong> is one of the forty-three children<\/strong> who were all born on the same day<\/strong> in 1989<\/strong> to a mother<\/strong> without any previous signs of pregnancy<\/strong>. The baby was one of seven adopted by Sir Reginald Hargreeves<\/strong> with the intention of training them to save the world<\/strong>. Ranked by their individual usefulness<\/strong>, Ben was Hargreeves' Number Six<\/strong> as a member of The Umbrella Academy<\/strong>. He possesses the ability to summon eldritch creatures<\/strong> through a portal to another dimension<\/strong> located in his body. Ben's death is one of the main reasons<\/strong> that the Academy disbanded<\/strong>.<\/phrase>","died while on a mission<\/word>","statue of him was erected<\/word>","The Umbrella Academy<\/word>","communicate with the dead<\/word>","talk to Ben<\/word>","sober<\/word>","after his funeral<\/word>","expert on the dead<\/word>","Klaus does not tell his siblings he talks with Ben<\/word>","terrible fate<\/word>","Klaus<\/word>","first summons<\/word>","In 2006, Ben died while on a mission<\/strong>, suffering a terrible fate<\/strong>. A statue of him was erected<\/strong> in the courtyard of The Umbrella Academy<\/strong>. However, Ben was not entirely gone. Klaus<\/strong>' power to communicate with the dead<\/strong> allowed him to see and talk to Ben<\/strong> when he was sober<\/strong>. Klaus<\/strong> first summons<\/strong> Ben after his funeral<\/strong> where Ben tells him that he needs to go back and he has been told to go into the light. Klaus<\/strong> blows this off, stating that Ben can go whenever he wants. After Klaus<\/strong> assures him that he knows as the expert on the dead<\/strong>, Ben agrees to stick around. Klaus does not tell his siblings he talks with Ben<\/strong>.<\/phrase>","The Umbrella Academy<\/word>","alongisde Klaus<\/word>","fallen in love<\/word>","Klaus's cult followers<\/word>","Klaus is reluctant to return<\/word>","other members<\/word>","Dallas<\/word>","return<\/word>","San Fransisco<\/word>","Jill<\/word>","large tensions<\/word>","Ben travels with the other members<\/strong> of The Umbrella Academy<\/strong> and is scattered throughout the Dallas<\/strong> timeline alongisde Klaus<\/strong>. Ben desperately wants to return<\/strong> to San Fransisco<\/strong>, however, where he has fallen in love<\/strong> with Jill<\/strong>, one of Klaus's cult followers<\/strong>. Klaus is reluctant to return<\/strong>, however, and this causes large tensions<\/strong> between the two.<\/phrase>","interrupted by Diego<\/word>","Klaus<\/word>","allow<\/word>","temporarily possess<\/word>","Jill<\/word>","two kiss<\/word>","time<\/word>","travel<\/word>","Eventually, Klaus<\/strong> agrees to allow<\/strong> Ben to temporarily possess<\/strong> him while he talks with Jill<\/strong>, and the two kiss<\/strong> before agreeing to be together; this is eventually interrupted by Diego<\/strong>, however, who is relieved to see that Ben jumped to 1963 like the rest of them despite Klaus<\/strong>' remarks that he couldn't time<\/strong> travel<\/strong>.<\/phrase>","The Umbrella Academy<\/word>","causing the apocalypse<\/word>","locates his sister hiding in her mind<\/word>","restoration of her memories<\/word>","comforts her<\/word>","not a monster but his sister<\/word>","risking everything to save her<\/word>","Vanya<\/word>","shock waves<\/word>","her power<\/word>","their siblings<\/word>","After The Umbrella Academy<\/strong> realizes Vanya<\/strong> is in danger of destroying the FBI building and causing the apocalypse<\/strong>, Ben, the only one able to get through the shock waves<\/strong> created by her power<\/strong>, jumps into Vanya<\/strong>'s body and locates his sister hiding in her mind<\/strong>, traumatized by the restoration of her memories<\/strong>. Ben recognizes that everything that's happened isn't Vanya<\/strong>'s fault and comforts her<\/strong>, pointing out that after everything that Reginald did to her, it's no wonder she couldn't control her power<\/strong>. Ben states that Vanya<\/strong> is not a monster but his sister<\/strong> and their siblings<\/strong> are risking everything to save her<\/strong>. Ben promises that Vanya<\/strong> isn't alone at the table anymore and can do this.<\/phrase>","disintegrating<\/word>","he can't go back with her<\/word>","she's hurting him<\/word>","not her fault<\/word>","message for Klaus<\/word>","disintegrating completely<\/word>","traveling to his long avoided afterlife<\/word>","averting the apocalypse<\/word>","Vanya<\/word>","hug<\/word>","long time<\/word>","As Vanya<\/strong> smiles at Ben, he suddenly starts disintegrating<\/strong>. Ben sadly explains that he can't go back with her<\/strong>, and Vanya<\/strong> realizes that she's hurting him<\/strong>; Ben states its not her fault<\/strong>. He's been holding on as long as he can, but he can't anymore. Ben asks Vanya<\/strong> to hug<\/strong> him as he goes, having not been hugged in a long time<\/strong> which she immediately does. Ben whispers a message for Klaus<\/strong> to Vanya<\/strong> before disintegrating completely<\/strong> and finally going into the light, traveling to his long avoided afterlife<\/strong>. Ben's sacrifice calms Vanya<\/strong> down in the real world averting the apocalypse<\/strong>.<\/phrase>","help Harlan<\/word>","Ben traded his life for hers<\/word>","saved the world in the process<\/word>","too scared to go into the light<\/word>","it wasn't Klaus that made him stay<\/word>","final message<\/word>","his fault<\/word>","that Ben never went to Heaven<\/word>","Vanya<\/word>","Klaus<\/word>","As Vanya<\/strong> goes to help Harlan<\/strong>, Klaus<\/strong> enters her car and asks if Ben is gone forever. Vanya<\/strong> confirms it, stating that Ben traded his life for hers<\/strong> and saved the world in the process<\/strong>. Vanya<\/strong> passes Ben's message onto Klaus: Ben was too scared to go into the light<\/strong> and it wasn't Klaus that made him stay<\/strong>. Klaus<\/strong> is comforted by Ben's final message<\/strong>, having thought for 17 years that it was his fault<\/strong> that Ben never went to Heaven<\/strong>.<\/phrase>","The Umbrella Academy<\/word>","Number One<\/word>","altered timeline<\/word>","not recognizing them<\/word>","Luther<\/word>","When The Umbrella Academy<\/strong> returns to 2019, Luther<\/strong> is surprised to find a painting of Ben hanging over the fireplace, signifying his role as Number One<\/strong> in the altered timeline<\/strong>. Ben enters the room, still alive in this timeline, and demands of his father who his siblings are, not recognizing them<\/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':1746, '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':1746, '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':1746, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }