var presentation = ["To the Young Men of the United States, I dedicate this new edition of a Speech on the Barbarism of Slavery, in token of heartfelt gratitude to them for brave and patriotic service rendered in the present War for Civilization:<\/phrase>","ennobling<\/word>","black marble keystone<\/word>","our national arch<\/word>","effrontery<\/word>","It is now more than three years since I deemed it my duty to expose, in the Senate, the Barbarism of Slavery. This phrase, though common now, was new then. The speech was a strict and logical reply to the assumptions of Senators, asserting the \"divine origin\" of Slavery, its \"ennobling<\/strong>\" character, and that it was the \"black marble keystone<\/strong>\" of our national arch<\/strong>. Listening to these assumptions, which were of daily recurrence, I felt that they ought to be answered. And, considering their effrontery<\/strong>, it seemed to me that they should be answered frankly and openly by exhibiting Slavery\u202fas it really is,\u202fwithout reserve; careful that I should \"nothing extenuate, nor set down aught in malice.\" This I did.<\/phrase>","Trial by Battle<\/word>","Slavery naturally ripened in Rebellion and War<\/word>","vindicate<\/word>","ennobling<\/word>","black marble keystone<\/word>","our national arch<\/word>","In that debate the issue was joined which is still pending in the Trial by Battle<\/strong>. The inordinate assumptions for Slavery naturally ripened in Rebellion and War<\/strong>. If Slavery were, in reality, all that it was said to be by its representatives, they must have failed in duty if they did not vindicate<\/strong> and advance it. Not easily could they see a thing so \"divine\" and so \"ennobling<\/strong>\"--constituting the \"black marble keystone<\/strong>\" of our national arch<\/strong>--discredited by a popular vote, even if not yet doomed to sacrifice.<\/phrase>","The election of Mr. Lincoln was a judgment against Slavery, and its representatives were aroused.<\/phrase>","luxuriance<\/word>","absurdity<\/word>","Meanwhile, for more than a generation, an assumption of constitutional law, hardly less outrageous, had become rooted side by side with Slavery, so that the two had shot up in rank luxuriance<\/strong> together. It was assumed that any State was privileged, under the Constitution, at any time, in the exercise of its own discretion, to withdraw from the Union. This absurdity<\/strong> found little favor at first, even among the representatives of Slavery. To say that two and two make five could not be more irrational. But custom and constant repetition gradually produced an impression, until, at last, all who were maddest for Slavery were equally mad for this disorganizing ally.<\/phrase>","virulent vigor<\/word>","State Rights<\/word>","It was under the shadow of this constitutional assumption that the assumption for Slavery grew into virulent vigor<\/strong>, so that, at last, when Mr. Lincoln was elected, it broke forth in open war; but the war was declared in the name of State Rights<\/strong>.<\/phrase>","rudiments<\/word>","State Rights<\/word>","Therefore, there are two\u202fapparent\u202frudiments<\/strong> to this war. One is Slavery and the other is State Rights<\/strong>. But the latter is only a cover for the former. If Slavery were out of the way there would be no trouble from State Rights<\/strong>.<\/phrase>","vindicate<\/word>","The war, then, is for Slavery, and nothing else. It is an insane attempt to vindicate<\/strong> by arms the lordship which had been already asserted in debate. With mad-cap audacity it seeks to install this Barbarism as the truest Civilization. Slavery is declared to be the \"corner-stone\" of the new edifice. This is enough.<\/phrase>","The question is thus presented between Barbarism and Civilization; not merely between two different forms of Civilization, but between Barbarism on the one side and Civilization on the other side. If you are for Barbarism, join the Rebellion, or, if you can not join it, give it your sympathies. If you are for Civilization, stand by the Government of your country with mind, soul, heart, and might!<\/phrase>","the auction-block<\/word>","Such is the issue simply stated. On the one side are women and children on the auction-block<\/strong>; families rudely separated; human flesh lacerated and seamed by the bloody scourge; labor extorted without wages; and all this frightful, many-sided wrong is the declared foundation of a mock commonwealth. On the other side is the Union of our Fathers, with the image of \"Liberty\" on its coin and the sentiment of Liberty in its Constitution, now arrayed under a patriotic Government, which insists that no such mock Commonwealth, having such a declared foundation, shall be permitted on our territory, purchased with money and blood, to impair the unity of our jurisdiction and to insult the moral sense of mankind.<\/phrase>","Therefore, the battle which is now waged by the Union is for Civilization itself, and it must have aid and God-speed from all who are not openly for Barbarism. There is no word of peace, no tone of gentleness, no whisper of humanity, which does not become trumpet-tongued against the Rebellion. War itself seems to \"smooth its wrinkled front\" as it undertakes the championship of such a cause. The armed soldier becomes a minister of mercy.<\/phrase>","\"The Cid was in the midst, his shout was heard afar;\nI am Rui Diez, the champion of Bivar;\nStrike amongst them, gentlemen, for sweet mercy's sake.\"<\/phrase>","In the name of mercy, strike, young men, so that the revolting Barbarism, which began the war, shall disappear forever. Any thing less than this will be an abandonment of duty.<\/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':2810, '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':2810, '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':2810, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }