var presentation = ["A Charlie Brown Christmas<\/word>","comic strip Peanuts<\/word>","Charles M. Schulz<\/word>","depressed<\/word>","direct a neighborhood Christmas play<\/word>","ignored<\/word>","true meaning of Christmas<\/word>","Peanuts gang unites to celebrate the Christmas season<\/word>","animated television special<\/word>","first TV special<\/word>","Charlie Brown<\/word>","cheerful holiday season<\/word>","Lucy<\/word>","best efforts<\/word>","his peers<\/word>","Linus<\/word>","A Charlie Brown Christmas<\/strong> is a 1965 animated television special<\/strong>, and is the first TV special<\/strong> based on the comic strip Peanuts<\/strong>, by Charles M. Schulz<\/strong>. In this special, Charlie Brown<\/strong> finds himself depressed<\/strong> despite the onset of the cheerful holiday season<\/strong>. Lucy<\/strong> suggests he direct a neighborhood Christmas play<\/strong>, but his best efforts<\/strong> are ignored<\/strong> and mocked by his peers<\/strong>. After Linus<\/strong> tells Charlie Brown<\/strong> about the true meaning of Christmas<\/strong>, Charlie Brown<\/strong> cheers up, and the Peanuts gang unites to celebrate the Christmas season<\/strong>.<\/phrase>","On their way to join their friends ice skating<\/word>","onset of Christmas<\/word>","he is still depressed<\/word>","Linus' reproach<\/word>","put-down from Violet<\/word>","visits Lucy's psychiatric booth<\/word>","involved in a Christmas project<\/word>","direct the school Christmas play<\/word>","Charlie Brown<\/word>","Linus<\/word>","his problem<\/word>","On their way to join their friends ice skating<\/strong> on a frozen pond, Charlie Brown<\/strong> confides in Linus<\/strong> that despite the onset of Christmas<\/strong> he is still depressed<\/strong>. After Linus' reproach<\/strong>, and a put-down from Violet<\/strong>, he visits Lucy's psychiatric booth<\/strong> and tells her his problem<\/strong>. She suggests getting involved in a Christmas project<\/strong>, inviting him to direct the school Christmas play<\/strong>.<\/phrase>","Charlie Brown becomes even more discouraged<\/word>","Christmas' commercialization<\/word>","Snoopy decorating his doghouse<\/word>","Sally, dictating a letter to Santa Claus<\/word>","long list of gifts<\/word>","Nativity play has been modernized<\/word>","Charlie Brown and Linus leave to search for a Christmas tree.<\/word>","neighborhood lights and display contest<\/word>","play rehearsal<\/word>","Charlie Brown<\/word>","Christmas Queen<\/word>","play<\/word>","proper mood<\/word>","En route to the auditorium, Charlie Brown becomes even more discouraged<\/strong> by his observations of Christmas' commercialization<\/strong>--Snoopy decorating his doghouse<\/strong> for a neighborhood lights and display contest<\/strong>; and Sally, dictating a letter to Santa Claus<\/strong> asking for a long list of gifts<\/strong>, and preferably cash. At the play rehearsal<\/strong>, Charlie Brown<\/strong> finds the Nativity play has been modernized<\/strong> with dancing, lively music and a \"Christmas Queen<\/strong>\". Sensing the play<\/strong> needs a more proper mood<\/strong>, Charlie Brown and Linus leave to search for a Christmas tree.<\/strong><\/phrase>","Linus is dubious about Charlie Brown's choice<\/word>","Lucy and the others scorn him and the tree<\/word>","Charlie Brown loudly asks if anyone knows what Christmas is all about<\/word>","Luke 2:8\u201314<\/word>","tree lot<\/word>","Charlie Brown<\/word>","small sapling<\/word>","Linus<\/word>","At the tree lot<\/strong>, Charlie Brown<\/strong> picks a small sapling<\/strong> that, ironically, is the only real tree there. Linus is dubious about Charlie Brown's choice<\/strong>, but he believes that once decorated the little tree will be perfect. Lucy and the others scorn him and the tree<\/strong> and walk away laughing. In despair, Charlie Brown loudly asks if anyone knows what Christmas is all about<\/strong>; Linus<\/strong> says he does and, walking to center stage, asks for a spotlight and recites the Luke 2:8\u201314<\/strong>. When finished Linus<\/strong> returns to Charlie Brown<\/strong> and quietly says, \"That's what Christmas is all about, Charlie Brown<\/strong>.\"<\/phrase>","doesn't have to let commercialism ruin his own Christmas<\/word>","take the tree home to decorate it<\/word>","show the others that it will work in the play<\/word>","Snoopy's winning doghouse<\/word>","large red ornament<\/word>","hang on his tree<\/word>","causes the tiny tree to bend to the ground<\/word>","Charlie Brown walks away dejected<\/word>","Charlie Brown<\/word>","Realizing that he doesn't have to let commercialism ruin his own Christmas<\/strong>, Charlie Brown<\/strong> decides to take the tree home to decorate it<\/strong> and show the others that it will work in the play<\/strong>. He stops at Snoopy's winning doghouse<\/strong> and takes a large red ornament<\/strong> from it to hang on his tree<\/strong>. But when the heavy bulb causes the tiny tree to bend to the ground<\/strong>, Charlie Brown walks away dejected<\/strong>.<\/phrase>","realize that they were too hard on Charlie Brown<\/word>","uprights the drooping tree<\/word>","lovingly wraps his blanket around the tree's base<\/word>","give the tree a startling makeover<\/word>","start humming<\/word>","Hark! The Herald Angels Sing<\/word>","Merry Christmas, Charlie Brown!<\/word>","Charlie Brown joining in<\/word>","snow begins to fall<\/word>","Linus<\/word>","Lucy<\/word>","Charlie Brown<\/word>","sing<\/word>","Hark<\/word>","The others, who also heard Linus<\/strong>' oratory, realize that they were too hard on Charlie Brown<\/strong> and quietly follow him. Linus<\/strong> gently uprights the drooping tree<\/strong>, bulb and all, and lovingly wraps his blanket around the tree's base<\/strong>. After the others give the tree a startling makeover<\/strong> using more decorations from the doghouse, even Lucy<\/strong> concedes to Charlie Brown<\/strong>'s choice. The kids then start humming<\/strong> \"Hark! The Herald Angels Sing<\/strong>\". Hearing them, Charlie Brown<\/strong> returns to see that his little sapling is now a magnificent Christmas tree. All the kids shout, \"Merry Christmas, Charlie Brown!<\/strong>\", and then sing<\/strong> \"Hark<\/strong>\" with Charlie Brown joining in<\/strong> as snow begins to fall<\/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':2136, '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':2136, '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':2136, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }