var presentation = ["dignity of man<\/word>","destiny of democracy<\/word>","I speak tonight for the dignity of man<\/strong> and the destiny of democracy<\/strong>.<\/phrase>","history and fate meet<\/word>","search for freedom<\/word>","Appomattox<\/word>","long-suffering<\/word>","I urge every member of both parties, Americans of all religions and of all colors, from every section of this country, to join me in that cause. At times history and fate meet<\/strong> at a single time in a single place to shape a turning point in man's unending search for freedom<\/strong>. So it was at Lexington and Concord. So it was a century ago at Appomattox<\/strong>. So it was last week in Selma, Alabama. There, long-suffering<\/strong> men and women peacefully protested the denial of their rights as Americans. Many were brutally assaulted. One good man, a man of God, was killed. There is no cause for pride in what has happened in Selma. There is no cause for self-satisfaction in the long denial of equal rights of millions of Americans. But there is cause for hope and for faith in our democracy in what is happening here tonight.<\/phrase>","cries of pain<\/word>","summoned<\/word>","convocation<\/word>","right wrong<\/word>","do justice<\/word>","serve man<\/word>","For the cries of pain<\/strong> and the hymns and protests of oppressed people have summoned<\/strong> into convocation<\/strong> all the majesty of this great Government-the Government of the greatest Nation on earth.\nOur mission is at once the oldest and the most basic of this country: to right wrong<\/strong>, to do justice<\/strong>, to serve man<\/strong>.<\/phrase>","moments of great crisis<\/word>","secret heart of America<\/word>","issue of equal rights<\/word>","failed as a people and as a nation<\/word>","In our time we have come to live with moments of great crisis<\/strong>. Our lives have been marked with debate about great issues; issues of war and peace, issues of prosperity and depression. But rarely in any time does an issue lay bare the secret heart of America<\/strong> itself. Rarely are we met with a challenge, not to our growth or abundance, our welfare or our security, but rather to the values and the purposes and the meaning of our beloved Nation. The issue of equal rights<\/strong> for American Negroes is such an issue. And should we defeat every enemy, should we double our wealth and conquer the stars, and still be unequal to this issue, then we will have failed as a people and as a nation<\/strong>. For with a country as with a person, \"What is a man profited, if he shall gain the whole world, and lose his own soul?\"<\/phrase>","There is only an American problem<\/word>","founded with a purpose<\/word>","There is no Negro problem. There is no Southern problem. There is no Northern problem. There is only an American problem<\/strong>. And we are met here tonight as Americans-not as Democrats or Republicans-we are met here as Americans to solve that problem. This was the first nation in the history of the world to be founded with a purpose<\/strong>.<\/phrase>","All men are created equal<\/word>","government by consent of the governed<\/word>","give me liberty or give me death<\/word>","The great phrases of that purpose still sound in every American heart, North and South: \"All men are created equal<\/strong>\"-\"government by consent of the governed<\/strong>\"-\"give me liberty or give me death<\/strong>.\" Well, those are not just clever words, or those are not just empty theories. In their name Americans have fought and died for two centuries, and tonight around the world they stand there as guardians of our liberty, risking their lives.<\/phrase>","dignity of man<\/word>","equal in opportunity<\/word>","Those words are a promise to every citizen that he shall share in the dignity of man<\/strong>. This dignity cannot be found in a man's possessions; it cannot be found in his power, or in his position. It really rests on his right to be treated as a man equal in opportunity<\/strong> to all others. It says that he shall share in freedom, he shall choose his leaders, educate his children, and provide for his family according to his ability and his merits as a human being.<\/phrase>","injustice<\/word>","dishonor the dead<\/word>","To apply any other test-to deny a man his hopes because of his color or race, his religion or the place of his birth-is not only to do injustice<\/strong>, it is to deny America and to dishonor the dead<\/strong> who gave their lives for American freedom.<\/phrase>","rooted in democracy<\/word>","The Right to Vote\nOur fathers believed that if this noble view of the rights of man was to flourish, it must be rooted in democracy<\/strong>. The most basic right of all was the right to choose your own leaders. The history of this country, in large measure, is the history of the expansion of that right to all of our people.<\/phrase>","issues of civil rights<\/word>","must have an equal right to vote<\/word>","Many of the issues of civil rights<\/strong> are very complex and most difficult. But about this there can and should be no argument. Every American citizen must have an equal right to vote<\/strong>. There is no reason which can excuse the denial of that right. There is no duty which weighs more heavily on us than the duty we have to ensure that right.\nYet the harsh fact is that in many places in this countrymen and women are kept from voting simply because they are Negroes.<\/phrase>","ingenuity<\/word>","disqualified<\/word>","abbreviated<\/word>","Every device of which human ingenuity<\/strong> is capable has been used to deny this right. The Negro citizen may go to register only to be told that the day is wrong, or the hour is late, or the official in charge is absent. And if he persists, and if he manages to present himself to the registrar, he may be disqualified<\/strong> because he did not spell out his middle name or because he abbreviated<\/strong> a word on the application.<\/phrase>","sole judge<\/word>","recite<\/word>","And if he manages to fill out an application he is given a test. The registrar is the sole judge<\/strong> of whether he passes this test. He may be asked to recite<\/strong> the entire Constitution, or explain the most complex provisions of State law. And even a college degree cannot be used to prove that he can read and write.<\/phrase>","show a white skin<\/word>","systematic and ingenious discrimination<\/word>","sworn an oath<\/word>","act in obedience<\/word>","For the fact is that the only way to pass these barriers is to show a white skin<\/strong>.\nExperience has clearly shown that the existing process of law cannot overcome systematic and ingenious discrimination<\/strong>. No law that we now have on the books - and I have helped to put three of them there-can ensure the right to vote when local officials are determined to deny it. In such a case our duty must be clear to all of us. The Constitution says that no person shall be kept from voting because of his race or his color. We have all sworn an oath<\/strong> before God to support and to defend that Constitution. We must now act in obedience<\/strong> to that oath.<\/phrase>","eliminate illegal barriers<\/word>","Guaranteeing the Right to Vote\nWednesday I will send to Congress a law designed to eliminate illegal barriers<\/strong> to the right to vote.<\/phrase>","comprehensive analysis<\/word>","The broad principles of that bill will be in the hands of the Democratic and Republican leaders tomorrow. After they have reviewed it, it will come here formally as a bill. I am grateful for this opportunity to come here tonight at the invitation of the leadership to reason with my friends, to give them my views, and to visit with my former colleagues.\nI have had prepared a more comprehensive analysis<\/strong> of the legislation which I had intended to transmit to the clerk tomorrow but which I will submit to the clerks tonight. But I want to really discuss with you now briefly the main proposals of this legislation.<\/phrase>","strike down restrictions<\/word>","flout our Constitution<\/word>","This bill will strike down restrictions<\/strong> to voting in all elections-Federal, State, and local-which have been used to deny Negroes the right to vote.\nThis bill will establish a simple, uniform standard which cannot be used, however ingenious the effort, to flout our Constitution<\/strong>.<\/phrase>","eliminate tedious<\/word>","not prohibited<\/word>","It will provide for citizens to be registered by officials of the United States Government if the State officials refuse to register them.\nIt will eliminate tedious<\/strong>, unnecessary lawsuits which delay the right to vote.\nFinally, this legislation will ensure that properly registered individuals are not prohibited<\/strong> from voting.<\/phrase>","command of the Constitution<\/word>","I will welcome the suggestions from all of the Members of Congress-I have no doubt that I will get some-on ways and means to strengthen this law and to make it effective. But experience has plainly shown that this is the only path to carry out the command of the Constitution<\/strong>.<\/phrase>","all your people<\/word>","register and vote<\/word>","Extend the rights<\/word>","To those who seek to avoid action by their National Government in their own communities; who want to and who seek to maintain purely local control over elections, the answer is simple:\nOpen your polling places to all your people<\/strong>.\nAllow men and women to register and vote<\/strong> whatever the color of their skin.\nExtend the rights<\/strong> of citizenship to every citizen of this land.<\/phrase>","command of the Constitution<\/word>","deadly wrong<\/word>","human rights<\/word>","The Need for Action\nThere is no constitutional issue here. The command of the Constitution<\/strong> is plain.\nThere is no moral issue. It is wrong-deadly wrong<\/strong>-to deny any of your fellow Americans the right to vote in this country.\nThere is no issue of States rights or national rights. There is only the struggle for human rights<\/strong>.\nI have not the slightest doubt what will be your answer.<\/phrase>","civil rights bill to the Congress<\/word>","heart of the voting provision had been eliminated<\/word>","The last time a President sent a civil rights bill to the Congress<\/strong> it contained a provision to protect voting rights in Federal elections. That civil rights bill was passed after 8 long months of debate.\nAnd when that bill came to my desk from the Congress for my signature, the heart of the voting provision had been eliminated<\/strong>.<\/phrase>","we must not<\/word>","time for waiting is gone<\/word>","This time, on this issue, there must be no delay, no hesitation and no compromise with our purpose.\nWe cannot, we must not<\/strong>, refuse to protect the right of every American to vote in every election that he may desire to participate in. And we ought not and we cannot and we must not<\/strong> wait another 8 months before we get a bill. We have already waited a hundred years and more, and the time for waiting is gone<\/strong>.<\/phrase>","outraged conscience of a nation<\/word>","So I ask you to join me in working long hours-nights and weekends, if necessary-to pass this bill. And I don't make that request lightly. For from the window where I sit with the problems of our country I recognize that outside this chamber is the outraged conscience of a nation<\/strong>, the grave concern of many nations, and the harsh judgment of history on our acts.<\/phrase>","battle will not be over<\/word>","crippling legacy of bigotry<\/word>","injustice<\/word>","We Shall Overcome\nBut even if we pass this bill, the battle will not be over<\/strong>. What happened in Selma is part of a far larger movement which reaches into every section and State of America. It is the effort of American Negroes to secure for themselves the full blessings of American life.\nTheir cause must be our cause too. Because it is not just Negroes, but really it is all of us, who must overcome the crippling legacy of bigotry<\/strong> and injustice<\/strong>.\nAnd we shall overcome.<\/phrase>","agonizing<\/word>","Abraham Lincoln<\/word>","Emancipation Proclamation<\/word>","As a man whose roots go deeply into Southern soil I know how agonizing<\/strong> racial feelings are. I know how difficult it is to reshape the attitudes and the structure of our society.\nBut a century has passed, more than a hundred years, since the Negro was freed. And he is not fully free tonight.\nIt was more than a hundred years ago that Abraham Lincoln<\/strong>, a great President of another party, signed the Emancipation Proclamation<\/strong>, but emancipation is a proclamation and not a fact.<\/phrase>","equality was promised<\/word>","promise is unkept<\/word>","A century has passed, more than a hundred years, since equality was promised<\/strong>. And yet the Negro is not equal.\nA century has passed since the day of promise. And the promise is unkept<\/strong>.\nThe time of justice has now come. I tell you that I believe sincerely that no force can hold it back. It is right in the eyes of man and God that it should come. And when it does, I think that day will brighten the lives of every American.<\/phrase>","stark poverty<\/word>","scarred<\/word>","maintain the barriers<\/word>","denying<\/word>","For Negroes are not the only victims. How many white children have gone uneducated, how many white families have lived in stark poverty<\/strong>, how many white lives have been scarred<\/strong> by fear, because we have wasted our energy and our substance to maintain the barriers<\/strong> of hatred and terror?\nSo I say to all of you here, and to all in the Nation tonight, that those who appeal to you to hold on to the past do so at the cost of denying<\/strong> you your future.<\/phrase>","opportunity and education and hope<\/word>","poverty, ignorance, disease<\/word>","This great, rich, restless country can offer opportunity and education and hope<\/strong> to all: black and white, North and South, sharecropper and city dweller. These are the enemies: poverty, ignorance, disease<\/strong>. They are the enemies and not our fellow man, not our neighbor. And these enemies too, poverty, disease and ignorance, we shall overcome.<\/phrase>","prideful righteousness<\/word>","fruits of freedom<\/word>","An American Problem\nNow let none of us in any sections look with prideful righteousness<\/strong> on the troubles in another section, or on the problems of our neighbors. There is really no part of America where the promise of equality has been fully kept. In Buffalo as well as in Birmingham, in Philadelphia as well as in Selma, Americans are struggling for the fruits of freedom<\/strong>.<\/phrase>","legitimate<\/word>","shoulder to the wheel<\/word>","root out injustice<\/word>","This is one Nation. What happens in Selma or in Cincinnati is a matter of legitimate<\/strong> concern to every American. But let each of us look within our own hearts and our own communities, and let each of us put our shoulder to the wheel<\/strong> to root out injustice<\/strong> wherever it exists.<\/phrase>","Iwo Jima<\/word>","Old Glory<\/word>","fighting together without regard<\/word>","As we meet here in this peaceful, historic chamber tonight, men from the South, some of whom were at Iwo Jima<\/strong>, men from the North who have carried Old Glory<\/strong> to far corners of the world and brought it back without a stain on it, men from the East and from the West, are all fighting together without regard<\/strong> to religion, or color, or region, in Vietnam. Men from every region fought for us across the world 20 years ago.<\/phrase>","honor and gallantry<\/word>","vindicate<\/word>","And in these common dangers and these common sacrifices the South made its contribution of honor and gallantry<\/strong> no less than any other region of the great Republic-and in some instances, a great many of them, more.\nAnd I have not the slightest doubt that good men from everywhere in this country, from the Great Lakes to the Gulf of Mexico, from the Golden Gate to the harbors along the Atlantic, will rally together now in this cause to vindicate<\/strong> the freedom of all Americans. For all of us owe this duty; and I believe that all of us will respond to it.\nYour President makes that request of every American.<\/phrase>","real hero<\/word>","American Negro<\/word>","awakened the conscience<\/word>","injustice<\/word>","provoke change<\/word>","stir reform<\/word>","persistent bravery<\/word>","Progress Through the Democratic Process\nThe real hero<\/strong> of this struggle is the American Negro<\/strong>. His actions and protests, his courage to risk safety and even to risk his life, have awakened the conscience<\/strong> of this Nation. His demonstrations have been designed to call attention to injustice<\/strong>, designed to provoke change<\/strong>, designed to stir reform<\/strong>.\nHe has called upon us to make good the promise of America. And who among us can say that we would have made the same progress were it not for his persistent bravery<\/strong>, and his faith in American democracy.<\/phrase>","force of moral right<\/word>","For at the real heart of battle for equality is a deep-seated belief in the democratic process.\nEquality depends not on the force of arms or tear gas but upon the force of moral right<\/strong>; not on recourse to violence but on respect for law and order.\nThere have been many pressures upon your President and there will be others as the days come and go. But I pledge you tonight that we intend to fight this battle where it should be fought: in the courts, and in the Congress, and in the hearts of men.<\/phrase>","preserve<\/word>","holler fire<\/word>","infringe<\/word>","We must preserve<\/strong> the right of free speech and the right of free assembly. But the right of free speech does not carry with it, as has been said, the right to holler fire<\/strong> in a crowded theater. We must preserve<\/strong> the right to free assembly, but free assembly does not carry with it the right to block public thoroughfares to traffic.\nWe do have a right to protest, and a right to march under conditions that do not infringe<\/strong> the constitutional rights of our neighbors. And I intend to protect all those rights as long as I am permitted to serve in this office.<\/phrase>","stifled rights<\/word>","imposed<\/word>","peace cannot be purchased at the cost of liberty<\/word>","We will guard against violence, knowing it strikes from our hands the very weapons which we seek-progress, obedience to law, and belief in American values.\nIn Selma as elsewhere we seek and pray for peace. We seek order. We seek unity. But we will not accept the peace of stifled rights<\/strong>, or the order imposed<\/strong> by fear, or the unity that stifles protest. For peace cannot be purchased at the cost of liberty<\/strong>.<\/phrase>","heal the wounds<\/word>","build a new community<\/word>","In Selma tonight, as in every-and we had a good day there-as in every city, we are working for just and peaceful settlement. We must all remember that after this speech I am making tonight, after the police and the FBI and the Marshals have all gone, and after you have promptly passed this bill, the people of Selma and the other cities of the Nation must still live and work together.\nAnd when the attention of the Nation has gone elsewhere they must try to heal the wounds<\/strong> and to build a new community<\/strong>.<\/phrase>","battleground of violence<\/word>","outstandingly impressive responsibility<\/word>","This cannot be easily done on a battleground of violence<\/strong>, as the history of the South itself shows. It is in recognition of this that men of both races have shown such an outstandingly impressive responsibility<\/strong> in recent days-last Tuesday, and again today.<\/phrase>","civil rights program<\/word>","privileges of citizenship<\/word>","Rights Must Be Opportunities\nThe bill that I am presenting to you will be known as a civil rights bill. But, in a larger sense, most of the program I am recommending is a civil rights program<\/strong>. Its object is to open the city of hope to all people of all races.\nBecause all Americans just must have the right to vote. And we are going to give them that right.\nAll Americans must have the privileges of citizenship<\/strong> regardless of race. And they are going to have those privileges of citizenship<\/strong> regardless of race.<\/phrase>","clutches of poverty<\/word>","But I would like to caution you and remind you that to exercise these privileges takes much more than just legal right. It requires a trained mind and a healthy body. It requires a decent home, and the chance to find a job, and the opportunity to escape from the clutches of poverty<\/strong>.\nOf course, people cannot contribute to the Nation if they are never taught to read or write, if their bodies are stunted from hunger, if their sickness goes untended, if their life is spent in hopeless poverty just drawing a welfare check.<\/phrase>","open the gates<\/word>","So we want to open the gates<\/strong> to opportunity. But we are also going to give all our people, black and white, the help that they need to walk through those gates.<\/phrase>","pain of prejudice<\/word>","The Purpose of this Government\nMy first job after college was as a teacher in Cotulla, Tex., in a small Mexican-American school.\nFew of them could speak English, and I couldn't speak much Spanish. My students were poor and they often came to class without breakfast, hungry. They knew even in their youth the pain of prejudice<\/strong>. They never seemed to know why people disliked them. But they knew it was so, because I saw it in their eyes. I often walked home late in the afternoon, after the classes were finished, wishing there was more that I could do. But all I knew was to teach them the little that I knew, hoping that it might help them against the hardships that lay ahead.<\/phrase>","scars on the hopeful face<\/word>","Somehow you never forget what poverty and hatred can do when you see its scars on the hopeful face<\/strong> of a young child.\nI never thought then, in 1928, that I would be standing here in 1965. It never even occurred to me in my fondest dreams that I might have the chance to help the sons and daughters of those students and to help people like them all over this country.<\/phrase>","grandeur<\/word>","find their own way<\/word>","protected the right<\/word>","But now I do have that chance-and I'll let you in on a secret-I mean to use it. And I hope that you will use it with me.\nThis is the richest and most powerful country which ever occupied the globe. The might of past empires is little compared to ours. But I do not want to be the President who built empires, or sought grandeur<\/strong>, or extended dominion.\nI want to be the President who educated young children to the wonders of their world. I want to be the President who helped to feed the hungry and to prepare them to be taxpayers instead of taxeaters.\nI want to be the President who helped the poor to find their own way<\/strong> and who protected the right<\/strong> of every citizen to vote in every election.<\/phrase>","end hatred<\/word>","promoted love<\/word>","helped to end war<\/word>","I want to be the President who helped to end hatred<\/strong> among his fellow men and who promoted love<\/strong> among the people of all races and all regions and all parties.\nI want to be the President who helped to end war<\/strong> among the brothers of this earth.<\/phrase>","Mr. McCulloch<\/word>","veto<\/word>","share this task<\/word>","And so at the request of your beloved Speaker and the Senator from Montana; the majority leader, the Senator from Illinois; the minority leader, Mr. McCulloch<\/strong>, and other Members of both parties, I came here tonight-not as President Roosevelt came down one time in person to veto<\/strong> a bonus bill, not as President Truman came down one time to urge the passage of a railroad bill-but I came down here to ask you to share this task<\/strong> with me and to share it with the people that we both work for. I want this to be the Congress, Republicans and Democrats alike, which did all these things for all these people.<\/phrase>","yonder<\/word>","pursuit of happiness<\/word>","Beyond this great chamber, out yonder<\/strong> in 50 States, are the people that we serve. Who can tell what deep and unspoken hopes are in their hearts tonight as they sit there and listen. We all can guess, from our own lives, how difficult they often find their own pursuit of happiness<\/strong>, how many problems each little family has. They look most of all to themselves for their futures. But I think that they also look to each of us.<\/phrase>","God has favored our undertaking<\/word>","duty to divine<\/word>","Above the pyramid on the great seal of the United States it says-in Latin-\"God has favored our undertaking<\/strong>.\"\nGod will not favor everything that we do. It is rather our duty to divine<\/strong> His will. But I cannot help believing that He truly understands and that He really favors the undertaking that we begin here tonight.<\/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':2657, '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':2657, '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':2657, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }