var presentation = ["Pirates of the Caribbean: The Curse of the Black Pearl<\/word>","fantasy swashbuckler film<\/word>","Pirates of the Caribbean film series<\/word>","pirate<\/word>","Jack Sparrow<\/word>","blacksmith<\/word>","Will Turner<\/word>","rescue<\/word>","kidnapped<\/word>","Elizabeth Swann<\/word>","cursed crew<\/word>","Black Pearl<\/word>","captained by<\/word>","Hector Barbossa<\/word>","undead skeletons<\/word>","Pirates of the Caribbean: The Curse of the Black Pearl<\/strong> is a 2003 American fantasy swashbuckler film<\/strong> and the first film in the Pirates of the Caribbean film series<\/strong>. The story follows pirate<\/strong> Jack Sparrow<\/strong> and blacksmith<\/strong> Will Turner<\/strong> as they rescue<\/strong> the kidnapped<\/strong> Elizabeth Swann<\/strong> from the cursed crew<\/strong> of the Black Pearl<\/strong>, captained by<\/strong> Hector Barbossa<\/strong>, who become undead skeletons<\/strong> in moonlight.<\/phrase>","Port Royal<\/word>","HMS Dauntless<\/word>","Governor Weatherby Swann<\/word>","his daughter Elizabeth<\/word>","Joshamee Gibbs<\/word>","Lieutenant James Norrington<\/word>","shipwreck<\/word>","recover a boy<\/word>","Will Turner<\/word>","golden pirate medallion<\/word>","In the year 1720, while sailing to Port Royal<\/strong>, Jamaica aboard HMS Dauntless<\/strong>, Governor Weatherby Swann<\/strong>, his daughter Elizabeth<\/strong>, Joshamee Gibbs<\/strong>, and Lieutenant James Norrington<\/strong> encounter a shipwreck<\/strong> and recover a boy<\/strong>, Will Turner<\/strong>. Elizabeth discovers a golden pirate medallion<\/strong> around his neck, and takes it for herself.<\/phrase>","Norrington is promoted to commodore<\/word>","proposes to Elizabeth<\/word>","corset<\/word>","makes her faint<\/word>","causes the medallion<\/word>","emit a pulse<\/word>","Jack Sparrow<\/word>","Port Royal<\/word>","commandeer a ship<\/word>","rescues Elizabeth<\/word>","identifies Jack<\/word>","pirate<\/word>","chase ensues<\/word>","encounters Will<\/word>","blacksmith<\/word>","swordsman<\/word>","duel<\/word>","Jack is captured<\/word>","Black Pearl attacks<\/word>","capture Elizabeth<\/word>","Captain Barbossa<\/word>","claims<\/word>","last name is Turner<\/word>","conceal her identity<\/word>","882 gold pieces<\/word>","took from a treasure<\/word>","Hern\u00e1n Cort\u00e9s<\/word>","Isla de Muerta<\/word>","placed a curse on Barbossa and his crew<\/word>","immortals<\/word>","take the appearance of skeletons<\/word>","returned all but one of the pieces<\/word>","Elizabeth's medallion<\/word>","being the final piece<\/word>","Barbossa takes her prisoner<\/word>","believing her<\/word>","daughter of William Turner<\/word>","Bootstrap Bill<\/word>","blood is needed<\/word>","lift the curse<\/word>","Eight years later, Norrington is promoted to commodore<\/strong> and proposes to Elizabeth<\/strong>. Her corset<\/strong> makes her faint<\/strong> and fall into the sea, which causes the medallion<\/strong> to emit a pulse<\/strong>. Captain Jack Sparrow<\/strong>, just arrived in Port Royal<\/strong> to commandeer a ship<\/strong>, rescues Elizabeth<\/strong>. Norrington identifies Jack<\/strong> as a pirate<\/strong>, and a chase ensues<\/strong>. Jack encounters Will<\/strong>, now a blacksmith<\/strong> and swordsman<\/strong>. They duel<\/strong>, and Jack is captured<\/strong> and imprisoned. That night, the Black Pearl attacks<\/strong> Port Royal<\/strong> in search of the medallion. The crew of the Pearl capture Elizabeth<\/strong>, taking her to meet Captain Barbossa<\/strong>. Elizabeth claims<\/strong> her last name is Turner<\/strong> to conceal her identity<\/strong> as the governor's daughter. Barbossa explains that the medallion is one of 882 gold pieces<\/strong> that his crew took from a treasure<\/strong> of Hern\u00e1n Cort\u00e9s<\/strong> on Isla de Muerta<\/strong>. This placed a curse on Barbossa and his crew<\/strong>, turning them into immortals<\/strong> who take the appearance of skeletons<\/strong> while in moonlight. Barbossa and his crew have returned all but one of the pieces<\/strong>, with Elizabeth's medallion<\/strong> being the final piece<\/strong>. Barbossa takes her prisoner<\/strong>, believing her<\/strong> to be the daughter of William Turner<\/strong> who is known as \"Bootstrap Bill<\/strong>\", whose blood is needed<\/strong> to lift the curse<\/strong>.<\/phrase>","Will frees Jack<\/word>","rescue Elizabeth<\/word>","whom Will loves<\/word>","Jack, the previous captain<\/word>","Black Pearl<\/word>","Barbossa staged a mutiny<\/word>","deal with Will<\/word>","reclaim his ship<\/word>","commandeer HMS Interceptor<\/word>","Tortuga<\/word>","Jack enlists Gibbs<\/word>","assemble a crew<\/word>","Isla de Muerta<\/word>","Barbossa sacrificing Elizabeth's blood<\/word>","returning the final gold piece<\/word>","curse is not lifted<\/word>","does not carry the blood<\/word>","Bootstrap Bill<\/word>","Will's father<\/word>","former crewmate of the Pearl<\/word>","thrown overboard<\/word>","Will rescues Elizabeth<\/word>","Jack is captured by Barbossa<\/word>","locked in the brig<\/word>","Pearl pursues the Interceptor<\/word>","destroying the ship<\/word>","taking Jack's crew hostage<\/word>","deal with Barbossa<\/word>","release Elizabeth<\/word>","exchange for his blood<\/word>","Barbossa exploits a loophole<\/word>","marooning Jack and Elizabeth<\/word>","smoke signal<\/word>","Norrington brings the Dauntless<\/word>","rescue Elizabeth and arrest Jack<\/word>","Elizabeth asks Norrington<\/word>","pursue the Pearl<\/word>","save Will<\/word>","accepting Norrington's marriage proposal<\/word>","Will frees Jack<\/strong> to rescue Elizabeth<\/strong>, whom Will loves<\/strong>. Jack, the previous captain<\/strong> of the Black Pearl<\/strong> before Barbossa staged a mutiny<\/strong>, makes a deal with Will<\/strong> to reclaim his ship<\/strong>. The two commandeer HMS Interceptor<\/strong>, and head for Tortuga<\/strong>. There, Jack enlists Gibbs<\/strong> to help them assemble a crew<\/strong>. Chasing the Pearl to the Isla de Muerta<\/strong>, Will and Jack witness Barbossa sacrificing Elizabeth's blood<\/strong> and returning the final gold piece<\/strong>. The curse is not lifted<\/strong> because Elizabeth does not carry the blood<\/strong> of \"Bootstrap Bill<\/strong>\" Turner, who was in fact Will's father<\/strong> and a former crewmate of the Pearl<\/strong> who was thrown overboard<\/strong> for giving the medallion to Will. Will rescues Elizabeth<\/strong> and brings her to the Interceptor, while Jack is captured by Barbossa<\/strong> and locked in the brig<\/strong> of the Pearl. The Pearl pursues the Interceptor<\/strong>, destroying the ship<\/strong> and taking Jack's crew hostage<\/strong>. Will makes a deal with Barbossa<\/strong> to release Elizabeth<\/strong> in exchange for his blood<\/strong>, but Barbossa exploits a loophole<\/strong> in the agreement, marooning Jack and Elizabeth<\/strong> on an island. Elizabeth makes a smoke signal<\/strong>, and Norrington brings the Dauntless<\/strong> to rescue Elizabeth and arrest Jack<\/strong>. Elizabeth asks Norrington<\/strong> to pursue the Pearl<\/strong> and save Will<\/strong>, convincing him by accepting Norrington's marriage proposal<\/strong>.<\/phrase>","Dauntless arrives<\/word>","Isla de Muerta<\/word>","lure the pirates out<\/word>","ambushed by the crew of the Dauntless<\/word>","persuades Barbossa's crew<\/word>","attack the Dauntless<\/word>","lift the curse<\/word>","lose their immortality<\/word>","Elizabeth escapes<\/word>","frees Jack's crew<\/word>","refuse to rescue<\/word>","Jack and Will<\/word>","Elizabeth sets out on her own<\/word>","Jack again switches sides<\/word>","freeing Will<\/word>","dueling Barbossa<\/word>","Barbossa stabs Jack<\/word>","Jack had taken a piece of gold<\/word>","under the curse<\/word>","Jack shoots Barbossa<\/word>","Will returns both coins<\/word>","his and Jack's blood on them<\/word>","curse is lifted<\/word>","Barbossa dies<\/word>","Barbossa's crew<\/word>","no longer immortal<\/word>","surrender<\/word>","arrested<\/word>","That night, the Dauntless arrives<\/strong> at Isla de Muerta<\/strong>. Jack tells Norrington he will lure the pirates out<\/strong> to be ambushed by the crew of the Dauntless<\/strong>, but once inside he instead persuades Barbossa's crew<\/strong> to attack the Dauntless<\/strong> before they lift the curse<\/strong> and lose their immortality<\/strong>. Elizabeth escapes<\/strong> the Dauntless and frees Jack's crew<\/strong> from the brig of the Pearl. They refuse to rescue<\/strong> Jack and Will<\/strong>, so Elizabeth sets out on her own<\/strong> while Jack's crew depart aboard the Pearl. Jack again switches sides<\/strong>, freeing Will<\/strong> and dueling Barbossa<\/strong>, while Elizabeth and Will fight off Barbossa's crewmen. When Barbossa stabs Jack<\/strong>, it is revealed that Jack had taken a piece of gold<\/strong> from the chest and is likewise under the curse<\/strong>. Jack shoots Barbossa<\/strong>, and Will returns both coins<\/strong> to the chest, with his and Jack's blood on them<\/strong>. The curse is lifted<\/strong>; Barbossa dies<\/strong> from Jack's gunshot, and the rest of Barbossa's crew<\/strong>, realizing they are no longer immortal<\/strong>, surrender<\/strong> and are arrested<\/strong>.<\/phrase>","Port Royal<\/word>","Jack is led to the gallows<\/word>","hanged for piracy<\/word>","Elizabeth diverts<\/word>","Norrington's attention<\/word>","Will attempts a rescue<\/word>","Jack and Will<\/word>","Elizabeth intercedes<\/word>","declares her love for Will<\/word>","Governor Swann pardons Will<\/word>","gives his blessing<\/word>","Elizabeth to marry him<\/word>","Jack dives into the sea<\/word>","escapes aboard the nearby Pearl<\/word>","Norrington decides<\/word>","permit Jack<\/word>","one day's head start<\/word>","initiating pursuit<\/word>","At Port Royal<\/strong>, Jack is led to the gallows<\/strong> to be hanged for piracy<\/strong>. Elizabeth diverts<\/strong> Norrington's attention<\/strong> while Will attempts a rescue<\/strong>, but Jack and Will<\/strong> are surrounded. Elizabeth intercedes<\/strong> and declares her love for Will<\/strong>, leaving Norrington crestfallen but he forgives her. Governor Swann pardons Will<\/strong> and gives his blessing<\/strong> for Elizabeth to marry him<\/strong>. Jack dives into the sea<\/strong> and escapes aboard the nearby Pearl<\/strong>, reclaiming the ship and his new crew. Norrington decides<\/strong> to permit Jack<\/strong> and the Pearl one day's head start<\/strong> before initiating pursuit<\/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':3048, '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':3048, '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':3048, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }