var presentation = ["Previously On<\/word>","eighth episode<\/word>","television miniseries<\/word>","WandaVision<\/word>","Marvel Comics characters<\/word>","Wanda Maximoff<\/word>","Scarlet Witch<\/word>","Vision<\/word>","follows Wanda<\/word>","relives moments of her past<\/word>","idyllic suburban life<\/word>","Westview<\/word>","Marvel Cinematic Universe<\/word>","create<\/word>","\"Previously On<\/strong>\" is the eighth episode<\/strong> of the American television miniseries<\/strong> WandaVision<\/strong>, based on the Marvel Comics characters<\/strong> Wanda Maximoff<\/strong> \/ Scarlet Witch<\/strong> and Vision<\/strong>. It follows Wanda<\/strong> as she relives moments of her past<\/strong> that led her to create<\/strong> the idyllic suburban life<\/strong> in the town of Westview<\/strong>. The episode is set in the Marvel Cinematic Universe<\/strong>.<\/phrase>","Salem, 1693<\/word>","Agatha Harkness<\/word>","put on trial<\/word>","coven of witches<\/word>","practicing dark magic<\/word>","attempt to kill Agatha<\/word>","drains the life from them<\/word>","In Salem, 1693<\/strong>, Agatha Harkness<\/strong> is put on trial<\/strong> by a coven of witches<\/strong> led by her mother Evanora for practicing dark magic<\/strong>. As they attempt to kill Agatha<\/strong>, she drains the life from them<\/strong>.<\/phrase>","present day<\/word>","Agatha interrogates<\/word>","Wanda Maximoff<\/word>","demanding to know<\/word>","how she is controlling Westview<\/word>","threatening her<\/word>","forces Wanda<\/word>","relive key moments<\/word>","she and her brother Pietro<\/word>","trapped<\/word>","next to an unexploded bomb<\/word>","day their parents died<\/word>","Wanda was born a witch<\/word>","basic hex magic<\/word>","simple probability hex<\/word>","prevent the bomb from going off<\/word>","In the present day<\/strong>, Agatha interrogates<\/strong> Wanda Maximoff<\/strong>, demanding to know<\/strong> how she is controlling Westview<\/strong> and threatening her<\/strong> with her children's lives. Agatha forces Wanda<\/strong> to relive key moments<\/strong> in her life, including when she and her brother Pietro<\/strong> were trapped<\/strong> in rubble next to an unexploded bomb<\/strong> the day their parents died<\/strong>. In this memory, Agatha deduces that Wanda was born a witch<\/strong> who engaged in basic hex magic<\/strong> as a child, reinforced by Wanda's inadvertent use of a simple probability hex<\/strong> to prevent the bomb from going off<\/strong>.<\/phrase>","next memory<\/word>","experimented on by Hydra<\/word>","Mind Stone<\/word>","activating and augmenting<\/word>","latent magical abilities<\/word>","relives her first fond memory<\/word>","Vision<\/word>","Avengers Compound<\/word>","bonded<\/word>","being individuals who have come to be alone<\/word>","In the next memory<\/strong>, Wanda watches herself as she is experimented on by Hydra<\/strong>. As she approached the Mind Stone<\/strong>, it reacted to her presence, activating and augmenting<\/strong> her latent magical abilities<\/strong>. Wanda also witnessed an apparition in the Mind Stone<\/strong>'s light before passing out. She then relives her first fond memory<\/strong> of Vision<\/strong>, back at the Avengers Compound<\/strong>, as they bonded<\/strong> over being individuals who have come to be alone<\/strong>.<\/phrase>","Wanda visited S.W.O.R.D<\/word>","try and recover Vision's body<\/word>","Director Tyler Hayward<\/word>","Vision<\/word>","mutilated corpse<\/word>","broke into the lab<\/word>","left without Vision's body<\/word>","failing to feel his presence<\/word>","dilapidated lot<\/word>","Westview<\/word>","Vision had bought for her<\/word>","intending to live there together<\/word>","fit of grief<\/word>","create a house<\/word>","manifested a new version of Vision<\/word>","extended the Hex across the entire town<\/word>","Later, it is revealed that Wanda visited S.W.O.R.D<\/strong>. to try and recover Vision's body<\/strong>. When Director Tyler Hayward<\/strong> showed her Vision<\/strong>'s mutilated corpse<\/strong>, Wanda lost her temper and broke into the lab<\/strong>, but left without Vision's body<\/strong> after failing to feel his presence<\/strong>. Finally, Wanda drove to a dilapidated lot<\/strong> in Westview<\/strong> that Vision had bought for her<\/strong>, intending to live there together<\/strong>. In a fit of grief<\/strong>, she used her powers to create a house<\/strong> on the lot, manifested a new version of Vision<\/strong>, and ultimately extended the Hex across the entire town<\/strong>.<\/phrase>","Wanda runs outside<\/word>","confronted by Agatha<\/word>","holding her children, Billy and Tommy, captive<\/word>","Agatha mocks Wanda<\/word>","revealing that her powers<\/word>","chaos magic<\/word>","makes Wanda<\/word>","Scarlet Witch<\/word>","Coming out of her trance, Wanda runs outside<\/strong>, only to be confronted by Agatha<\/strong>, who is holding her children, Billy and Tommy, captive<\/strong>. Agatha mocks Wanda<\/strong> for not knowing the full extent of her own abilities before revealing that her powers<\/strong> are actually chaos magic<\/strong>, which makes Wanda<\/strong> the mythical Scarlet Witch<\/strong>.<\/phrase>","mid-credits scene<\/word>","S.W.O.R.D. reveals<\/word>","Project Cataract<\/word>","original Vision<\/word>","now white<\/word>","activated using Wanda's energy<\/word>","In a mid-credits scene<\/strong>, S.W.O.R.D. reveals<\/strong> Hayward's \"Project Cataract<\/strong>\"-- The original Vision<\/strong>, now white<\/strong>, activated using Wanda's energy<\/strong> from the drone she previously destroyed.<\/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':2805, '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':2805, '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':2805, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }