css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!--
Random Quote Generator

version 2.0
author: Chazona Baum <chazona@chazonabaum.com>
copyright: Chazona Baum 2016
-->
<!DOCTYPE html>
<html lang="en">
   <head>
   <meta charset="utf-8" />
   <title>Random Quote Generator</title>
   </head>
   <body id="body">
      <header id="header"></header>
      <div class="container-fluid">
      <main id="main">
         <section id="home"></section>
         <section id="quoteBox"></section>
         <section id="resultsBox"></section>
         <section id="previousQuotes"></section>
      </main>
      </div>
      <footer id="footer"></footer>
   </body>
</html>
            
          
!
            
              @import 'https://fonts.googleapis.com/css?family=Bree+Serif|PT+Sans';

body {
  margin: 20px 0 0 0;
  font-family: "PT Sans", sans-serif;
  background-color: #DAEBE8;
}

p {
  font-size: 1.25em;
}

blockquote p {
  font-family: "Bree Serif", serif;
  font-size: 1.5em;
}

blockquote {
  margin: 40px;
  border-color: rgba(0,0,0,0.25);
}

blockquote footer {
  font-size: 1em;
  color: rgba(0,0,0,0.5);
}

.btn {
  font-size: 1.25em;
}

.quotePic {
  width: 20%;
}

@media (max-width: 767px) {
  body {
    margin: 40px 0 0 0;
    background-position: center;
    background-attachment: fixed;
  }
  
  blockquote {
    margin: 10px;
  }
}
            
          
!
            
              var HTMLfooter = '<hr><p class="text-center"><a href="%url%">%name%</a> &#169 2016. All Rights Reserved.</p>';
var HTMLhelpButton = '<button type="button" class="btn btn-link btn-lg center-block" data-toggle="modal" data-target="#helpModal">Need help?</button>';
var HTMLquoteStart = '<div class="row"><h1 class="text-center">Random Quote Generator</h1></div><div class="row"><p class="lead text-center">curated by Chazona Baum</p></div>';
var HTMLquoteBoxStart = '<div class="row"><p class="lead text-center">Click below to enjoy a different quote for endless motivation.</p>' + HTMLhelpButton + '<div id="image"></div></div><div class="row"><div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2 col-xs-12"><blockquote class="blockquote" id="quoteBlock"></blockquote></div></div>';
var HTMLquoteButtons = '<div class="row"><div class="col-md-6 col-md-offset-3 col-xs-12"><button class="btn btn-default btn-block btn-lg" id = "btnNewQuote">Generate Random Quote</button></div></div><div class="row"><div class="col-md-3 col-md-offset-3 col-xs-12"><button class="btn btn-default btn-block btn-lg" id="btnTweetQuote"><i class="fa fa-twitter"></i> Tweet this Quote</button></div><div class="col-md-3 col-xs-12"><button class="btn btn-default btn-block btn-lg" id="btnFacebookQuote"><i class="fa fa-facebook-square"></i> Share the Generator</button></div></div><div class="row"><div class="col-md-6 col-md-offset-3 col-xs-12"><button class="btn btn-default btn-block btn-lg" id = "btnPreviousQuote">Show Previous Quotes</button></div></div>';
var HTMLquoteImage = '<img src="%imgurl%" class="quotePic img-responsive img-circle center-block" />';
var HTMLquoteItem = '<p><span class="fa fa-quote-left"></span> %quote% <span class="fa fa-quote-right"></span></p><footer>%citation%</footer>';
var HTMLpreviousQuotes = '<div class="row"><div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2 col-xs-12"><h3>You previously generated:</h3></div><div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2 col-xs-12"><blockquote class="previousQuotes"></blockquote></div></div>';
var HTMLgenericError = '<div class="alert alert-danger alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true"><span class="fa fa-times-circle-o"></span></span></button>%errorMessage%<button type="button" class="btn btn-danger" data-dismiss="alert">Close</button></div>';
var HTMLerrorNoQuotes = HTMLgenericError.replace(/%errorMessage%/g, '<h4>Hey, there aren\'t any quotes here!</h4><p>No quotes have been generated, so there\'s nothing to display. How about generating a quote?</p>');
var HTMLquoteTagsDrop = '<div class="row"><div class="col-md-4 col-md-offset-3 col-sm-8 col-xs-6"><div class="dropdown"><select id="quoteTags" class="quoteTags form-control input-lg"></select></div></div><div class="col-md-2 col-sm-4 col-xs-6"><button id="btnTagClick" type="button" class="btn btn-default btn-block btn-lg">Choose Tag</button></div></div></div>';
var HTMLquoteTagsEach = '<option value="%data%">%data%</option>'
var HTMLquoteResults = '<div class="row"><div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2 col-xs-12"><h3>Quotes tagged "%data%":</h3></div><div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2 col-xs-12"><blockquote class="blockquote" id="resultsBlock"></blockquote></div></div>';
var HTMLsearchBox = '<div class="row"><div class="col-md-4 col-md-offset-3 col-sm-8 col-xs-6"><input type="search" class="form-control input-lg" placeholder="Search" id="inputSearch" aria-label="Search" /></div><div class="col-md-2 col-sm-4 col-xs-6"><button class="btn btn-default btn-block btn-lg" id="resultsBtn">%data%</button></div></div>';
var HTMLsearchResults = '<div class="row"><div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2 col-xs-12"><h3>Quotes containing your search term, "%data%":</h3></div><div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2 col-xs-12"><blockquote class="blockquote" id="resultsBlock"></blockquote></div></div>';
var HTMLerrorNoSearch = HTMLgenericError.replace(/%errorMessage%/g, '<h4>Hey, did you forget to search for something?</h4><p>No search term was entered, so no results can be found. Do you want to try that again?</p>');
var HTMLhelpModal = '<div class="modal fade" tabindex="-1" id="helpModal" role="dialog" aria-labelledby="helpModalLabel"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"><span class="fa fa-times-circle-o"></span></span></button><h4 class="modal-title" id="helpModalLabel">%title%</h4></div><div class="modal-body">%data%</div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button></div></div></div></div>';
var HTMLhelpBox = '<h3>Frequently Asked Questions:</h3><div class="panel-group faq-item" id="helpAccordion" role="tablist" aria-multiselectable="true">';
var HTMLquoteHelpText = '<div class="panel panel-default"><div class="panel-heading" role="tab" id="%heading%"><h4 class="panel-title"><a class="collapsed" role="button" data-toggle="collapse" data-parent="#helpAccordion" href="#%collapseid%" aria-expanded="true" aria-controls="%collapseid%">%question%</a></h4></div><div id="%collapseid%" class="panel-collapse collapse" role="tabpanel" aria-labelledby="%heading%"><div class="panel-body">%answer%</div></div></div>';
var frequentlyAskedQuestions = {
	"index" : [
	{
		"question" : "An Industrious Bootstrapper",
		"answer" : "\"How many jobs you got?\" While I could never compete with the characters on <em>In Living Color</em>'s Hey Mon sketches, it hasn't been unusual for me to work two or three different jobs simultaneously, even while raising my eldest son. I've walked three hours to get to work on multiple occasions. I'm a self-starter who, when dissatisfied with the status quo, will take whatever action I can to improve my circumstances. Because I'm constantly seeking additional knowledge and workplace responsibilites, it hasn't been unusual for me to be promoted expeditiously or be assigned special projects."
	},
	{
		"question" : "An Obsessive Problem-Solver",
		"answer" : "When I have an interesting problem to solve or task to do, it takes an intense amount of my concentration. When I was younger, it wasn't uncommon for me to completely lose track of time, neglecting to eat or drink while focusing on my work. Since having my children, I'm better at checking in with myself to ensure I'm taking care of myself while still enjoying the benefits my obsessive focus has on the creative process. I'm not the type to search for excuses to go home early."
	},
	{
		"question" : "An Accidental Leader",
		"answer" : "Whenever possible, I prefer to create things rather than manage people, though I do enjoy coaching and mentoring. I do not seek out commanding roles, but in the absence of leadership, I step up to fill the void. For example, while learning to code, I had a need to meet with other coders locally, but the closest local group was prohibitively far from home. Despite having barely a month's experience with web development, I formed a local group that now serves almost 50 people learning a variety of languages. Because I do not have a need to be \"in charge,\" I tend to be collaborative in leadership roles, and I seek to bring out the best ideas and talents in my teams."
	},
	{
		"question" : "A Nimble Apprentice",
		"answer" : "I pick up new information incredibly quickly, and it's not unusual for me to end up helping to teach new concepts to my collegues while still training for my position. I am skilled at mentally drawing patterns between concepts and prior knowledge, which enables me to master material more quickly. More importantly, I have a knack for navigating resources and a hunger to know as much as possible. I am not afraid of asking questions if it will increase my understanding, but if I can find the information quicker through searches or established materials, I will seek it out myself."
	},
	{
		"question" : "A Compassionate Wanderer",
		"answer" : "Of all the virtues a person can aspire to, the one I want to be remembered for most is kindness. I understand that we all begin this journey from different positions, and that our accumulated experiences tend to shape our perspectives and actions. Whenever possible, I strive to ask questions to build further understanding and to offer help and encouragement, so that I can hopefully improve the lives of those around me. I'm not one to cast someone aside or shatter my integrity simply to improve my own standing."
	}
	],
	"tribute_page" : [
	{
		"question" : "What is this?",
		"answer" : "This page is a Tribute Page project I built while studying with Free Code Camp. It highlights a picture, a quote from the figure, and details of their life."
	},
	{
		"question" : "So does everyone at Free Code Camp have one like this?",
		"answer" : "While it is a common project, each developer takes a different approach to it, and most go back and add additional features or functionality. These projects will not be the same, even though they are made to fit the same user stories."
	},
	{
		"question" : "I don't like this person. Is this really who you did a tribute on?",
		"answer" : "The person you are seeing is featured in my Random Quote Generator project. If you don't like this person, no worries. Refresh the page for a random other person's tribute page. Just as all people are products of their times, some of these figures may not be overly likeable. I don't personally like each person listed, but I don't have to like a person to acknowledge something good they've had to say."
	}
	],
	"local_weather_app" : [
	{
		"question" : "What is this?",
		"answer" : "This page is a Local Weather App project I built while studying with Free Code Camp. Assuming you allow it to obtain your location, it provides you with the current weather at your location. It includes a photo based on the type of weather you're having, the temperature, what it actually feels like, as well as a description."
	},
	{
		"question" : "Why is this in Fahrenheit?",
		"answer" : "That's what we use in America. Somewhere else or don't like Fahrenheit? Click the button to toggle Celsius values instead."
	}
	],
	"random_quote_generator" : [
	{
		"question" : "What is this?",
		"answer" : "This page is a Random Quote Generator project I built while studying with Free Code Camp. Click the button to get a completely random quote by a random person."
	},
		{
		"question" : "So does everyone at Free Code Camp have one like this?",
		"answer" : "While it is a common project, each developer takes a different approach to it, and most go back and add additional features or functionality. These projects will not be the same, even though they are made to fit the same user stories."
	},
	{
		"question" : "How to I generate a new quote?",
		"answer" : "Click the \"Generate Random Quote\" button."
	},
	{
		"question" : "Aww....I got a good one, but then I forgot it.",
		"answer" : "If it was during this session, click the \"Show Previous Quotes\" button. It will show you a list of quotes you've already generated."
	},
	{
		"question" : "How can I view a quote on a specific topic?",
		"answer" : "For most broad topics, select from the drop-down menu the tag about your topic. Click \"Choose Tag\", and a list of any quotes tagged with your topic will display. For a more specific search, choose a word or phrase you want included in your quote, and enter it in the search box. Click \"Search Quotes\" to pull up a list of all quotes that include your word or phrase."
	}
	],
	"wikipedia_viewer" : [
	{
		"question" : "What is this?",
		"answer" : "This page is a project I built while studying with Free Code Camp. It allows you to search for anything and find related Wikipedia articles. You can also choose to view a random article."
	},
		{
		"question" : "So does everyone at Free Code Camp have one like this?",
		"answer" : "While it is a common project, each developer takes a different approach to it, and most go back and add additional features or functionality. These projects will not be the same, even though they are made to fit the same user stories."
	},
	{
		"question" : "What if I see something I like?",
		"answer" : "Click it, of course! It will open the correct Wikipedia page for you."
	}
	],
	"twitch_tv_json_api" : [
	{
		"question" : "What is this?",
		"answer" : "This page is a project I built while studying with Free Code Camp. It allows you to see which of a group of Twitch live-streamers are currently streaming."
	},
		{
		"question" : "So does everyone at Free Code Camp have one like this?",
		"answer" : "While it is a common project, each developer takes a different approach to it, and most go back and add additional features or functionality. These projects will not be the same, even though they are made to fit the same user stories."
	},
	{
		"question" : "Oh, this stream looks really cool!",
		"answer" : "Awesome! Click that stream to view it live."
	},
	{
		"question" : "What if I don't want all these offline people cluttering the page.",
		"answer" : "No worries. Click the \"Online\" button to only show current streamers. You can also click the \"Offline\" button to only show those offline or whose accounts are closed, or the \"All\" button to view everyone."
	}
	]
};
var quotes = {
	"speakers" : [
	{
		"speaker" : "Aristotle Onassis",
		"headline" : "Shipping Magnate",
		"image" : "//chazonabaum.com/images/aristotle_onassis.jpg",
		"quotes" : [
		{
			"quoteText" : "It is during our darkest moments that we must focus to see the light.",
			"tags" : [
			"hope",
			"life",
			"motivational",
			"moving on"
			]
		},
		{
			"quoteText" : "The secret of business is to know something that nobody else knows.",
			"tags" : [
			"business",
			"knowledge",
			"money"
			]
		},
		{
			"quoteText" : "To succeed in business it is necessary to make others see things as you see them.",
			"tags" : [
			"business",
			"knowledge",
			"money"
			]
		},
		{
			"quoteText" : "We must free ourselves of the hope that the sea will ever rest. We must learn to sail in high winds.",
			"tags" : [
			"attitude",
			"life",
			"motivational"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1906",
			"event" : "Born in Karatas, Smyrna."
		},
		{
			"date" : "1922",
			"event" : "Flees with his family to Greece as refugees after the Great Fire of Smyrna in the Greco-Turkish War. He loses uncles, an aunt, and her family in the fire."
		},
		{
			"date" : "1923",
			"event" : "Leaves for Buenos Aires, Argentina, and gets his first job as a telephone operator. He begins eavesdropping on business calls, and uses that information to secure his own deals."
		},
		{
			"date" : "1928",
			"event" : "Makes a trade agreement with Greece. He becomes involved with smuggling, bribing, and other illegitimate activities."
		},
		{
			"date" : "1929",
			"event" : "An increase in Greek tariffs of 1000% poses a massive disruption for his South American business. He bribes Greek ministers and successfully gains an exemption from these taxes."
		},
		{
			"date" : "1931",
			"event" : "Once again manages to secure exemption from Greek tariffs by bribing Greek officials."
		},
		{
			"date" : "1946",
			"event" : "Marries Athina Livanos, the young daughter of a shipping magnate."
		},
		{
			"date" : "1950",
			"event" : "Enters the whaling industry off the coast of Peru, to great success."
		},
		{
			"date" : "1956",
			"event" : "Sells his whaling business to a Japanese company called Kyokuyo Hogei Kaisha."
		},
		{
			"date" : "1957",
			"event" : "Begins a relationship with singer Maria Callas."
		},
		{
			"date" : "1960",
			"event" : "Divorces from his first wife Athina Livanos as a result of his relationship with Maria Callas."
		},
		{
			"date" : "1968",
			"event" : "Marries Jackie Kennedy, widow of President John F. Kennedy."
		},
		{
			"date" : "1957",
			"event" : "Enters the airline business, rebranding the Greek National Airline as Olympic Airlines."
		},
		{
			"date" : "1973",
			"event" : "His son, Alexander, dies in a plane crash, leaving him devastated."
		},
		{
			"date" : "1975",
			"event" : "Dies in Neuilly-sur-Seine, France."
		}
		]
	},
	{
		"speaker" : "Audrey Hepburn",
		"headline" : "Film and Fashion Icon",
		"image" : "//chazonabaum.com/images/audrey_hepburn.jpg",
		"quotes" : [
		{
			"quoteText" : "As you grow older, you will discover that you have two hands, one for helping yourself, the other for helping others.",
			"tags" : [
			"attitude",
			"equality",
			"experience",
			"wisdom"
			]
		},
		{
			"quoteText" : "Nothing is impossible, the word itself says 'I'm possible'!",
			"tags" : [
			"attitude",
			"hope",
			"motivational"
			]
		},
		{
			"quoteText" : "People, even more than things, have to be restored, renewed, revived, reclaimed, and redeemed; never throw out anyone.",
			"tags" : [
			"failure",
			"respect"
			]
		},
		{
			"quoteText" : "The most important thing is to enjoy your life - to be happy - it's all that matters.",
			"tags" : [
			"happiness",
			"life"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1929",
			"event" : "Born in Brussels, Belgium."
		},
		{
			"date" : "1948",
			"event" : "Appears in her first stage performance in the musical <em>High Button Shoes</em> as a chorus girl."
		},
		{
			"date" : "1951",
			"event" : "Performs the lead in <em>Gigi</em> for two years, leading to the recognition of her acting potential."
		},
		{
			"date" : "1953",
			"event" : "Plays the lead role of Princess Anne in the film <em>Last Holiday</em>, her breakthrough role which earned her an Academy Award."
		},
		{
			"date" : "1954",
			"event" : "Marries Mel Ferrer, a fellow actor she has worked with."
		},
		{
			"date" : "1959",
			"event" : "After enduring two miscarriages, she takes time off from her career to focus on her pregnancy and the delivery of her son Sean."
		},
		{
			"date" : "1960",
			"event" : "Three months after delivering her son, she begins filming <em>Breakfast at Tiffany's</em>, which will be released the next year and become one of her most acclaimed roles. She is also awarded a star on the Hollywood Walk of Fame."
		},
		{
			"date" : "1961",
			"event" : "Takes time off from her career again to care for Sean and her husband."
		},
		{
			"date" : "1963",
			"event" : "Stars in a number of movies over the next four years, including <em>My Fair Lady</em>."
		},
		{
			"date" : "1967",
			"event" : "Takes a nine-year break from acting."
		},
		{
			"date" : "1976",
			"event" : "Stars in a sparse number of movies, including <em>Robin and Marian</em> over the next twelve years."
		},
		{
			"date" : "1988",
			"event" : "Goes on a field mission for UNICEF to Ethiopia to bring food to an orphanage, followed by a mission to Turkey to help with immunizations, and another mission to South America."
		},
		{
			"date" : "1990",
			"event" : "Goes to Vietnam on a UNICEF trip to aid with immunization and providing clean water."
		},
		{
			"date" : "1992",
			"event" : "Is awarded the BAFTA Lifetime Achievements Award. She goes to Somalia to help provide clean water. After returning from Somalia, she falls ill with an abdominal cancer which has grown over the years without being detected. She attempts chemotherapy and surgery, but the terminal cancer is inoperable."
		},
		{
			"date" : "1993",
			"event" : "Dies in Vaud, Switzerland."
		}
		]
	},
	{
		"speaker" : "Benjamin Franklin",
		"headline" : "Founding Father of the US",
		"image" : "//chazonabaum.com/images/benjamin_franklin.jpg",
		"quotes" : [
		{
			"quoteText" : "An investment in knowledge pays the best interest.",
			"tags" : [
			"knowledge",
			"wisdom"
			]
		},
		{
			"quoteText" : "By failing to prepare, you are preparing to fail.",
			"tags" : [
			"business",
			"wisdom"
			]
		},
		{
			"quoteText" : "Either write something worth reading or do something worth writing.",
			"tags" : [
			"motivational"
			]
		},
		{
			"quoteText" : "Tell me and I forget, teach me and I may remember, involve me and I learn.",
			"tags" : [
			"education",
			"knowledge"
			]
		},
		{
			"quoteText" : "They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.",
			"tags" : [
			"politics"
			]
		},
		{
			"quoteText" : "Well done is better than well said.",
			"tags" : [
			"experience"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1706",
			"event" : "Born in Boston, Massachusetts Bay Colony."
		},
		{
			"date" : "1727",
			"event" : "Establishes the Junto, a group of people looking to effect change in society and express creativity. Since books are scarce, they begin collecting books as a group, leading to America's first subscription library."
		},
		{
			"date" : "1731",
			"event" : "Writes the charter for the Library Company of Philadelphia, creating the first American library."
		},
		{
			"date" : "1733",
			"event" : "Purchases the <em>Pennsylvania Gazette</em> and begins publishing <em>Poor Richard's Almanack</em> under the pseudonym \"Poor Richard\"."
		},
		{
			"date" : "1736",
			"event" : "Establishes the Union Fire Company, America's first volunteer firefighting organization."
		},
		{
			"date" : "1751",
			"event" : "Publishes <em>Observations Concerning the Increase of Mankind, Peopling of Countries, &c.</em> on the study of demographics, which will influence Adam Smith and Thomas Malthus."
		},
		{
			"date" : "1753",
			"event" : "Receives the Copley Medal from the Royal Society of London."
		},
		{
			"date" : "1756",
			"event" : "Is elected a fellow of the Royal Society of London."
		},
		{
			"date" : "1758",
			"event" : "Published <em>The Way to Wealth</em>, a guide to finance and entrepreneurship."
		},
		{
			"date" : "1771",
			"event" : "Begins writing his autobiography, which will be published posthumously."
		},
		{
			"date" : "1776",
			"event" : "Assists the creation of the <em>Declaration of Independence</em>. He is appointed Commissioner of the United States to France."
		},
		{
			"date" : "1785",
			"event" : "Is made the President of the Executive Council of Pennsylvania."
		},
		{
			"date" : "1787",
			"event" : "Is selected as delegate to the Philadelphia Convention."
		},
		{
			"date" : "1790",
			"event" : "Dies in Philadelphia, Pennsylvania."
		}
		]
	},
	{
		"speaker" : "Francis of Assisi",
		"headline" : "Patron Saint of Italy, Animals, and Ecology",
		"image" : "//chazonabaum.com/images/francis_of_assisi.jpg",
		"quotes" : [
		{
			"quoteText" : "All the darkness in the world cannot extinguish the light of a single candle.",
			"tags" : [
			"attitude",
			"moving on"
			]
		},
		{
			"quoteText" : "For it is in giving that we receive.",
			"tags" : [
			"attitude",
			"wisdom"
			]
		},
		{
			"quoteText" : "Start by doing what's necessary, then what's possible, and suddenly you are doing the impossible.",
			"tags" : [
			"attitude",
			"motivational"
			]
		},
		{
			"quoteText" : "While you are proclaiming peace with your lips, be careful to have it even more fully in your heart.",
			"tags" : [
			"attitude",
			"wisdom"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1181",
			"event" : "Born in Assisi, in the Holy Roman Empire."
		},
		{
			"date" : "1226",
			"event" : "Died in Assisi, Umbria."
		}
		]
	},
	{
		"speaker" : "Grace Hopper",
		"headline" : "Inventer of the First Compiler",
		"image" : "//chazonabaum.com/images/grace_hopper.jpg",
		"quotes" : [
		{
			"quoteText" : "I've always been more interested in the future than in the past.",
			"tags" : [
			"attitude",
			"future",
			"motivational"
			]
		},
		{
			"quoteText" : "It's easier to ask forgiveness than it is to get permission.",
			"tags" : [
			"attitude",
			"forgiveness",
			"motivational"
			]
		},
		{
			"quoteText" : "The most damaging phrase in the language is 'We've always done it this way!'",
			"tags" : [
			"attitude",
			"leadership",
			"wisdom"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1906",
			"event" : "Born in New York City."
		},
		{
			"date" : "1992",
			"event" : "Died in Arlington, Virginia."
		}
		]
	},
	{
		"speaker" : "Helen Keller",
		"headline" : "Prolific Deaf-Blind Author and Activist",
		"image" : "//chazonabaum.com/images/helen_keller.jpg",
		"quotes" : [
		{
			"quoteText" : "Alone we can do so little; together we can do so much.",
			"tags" : [
			"alone",
			"friendship"
			]
		},
		{
			"quoteText" : "Although the world is full of suffering, it is also full of the overcoming of it.",
			"tags" : [
			"attitude",
			"moving on"
			]
		},
		{
			"quoteText" : "Life is either a great adventure or nothing.",
			"tags" : [
			"attitude",
			"life"
			]
		},
		{
			"quoteText" : "Optimism is the faith that leads to achievement. Nothing can be done without hope and confidence.",
			"tags" : [
			"attitude",
			"success"
			]
		},
		{
			"quoteText" : "The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart.",
			"tags" : [
			"beauty",
			"experience",
			"love",
			"wisdom"
			]
		},
		{
			"quoteText" : "When one door of happiness closes, another opens; but often we look so long at the closed door that we do not see the one which has been opened for us.",
			"tags" : [
			"attitude",
			"happiness",
			"moving on"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1880",
			"event" : "Born in Tuscumbia, Alabama."
		},
		{
			"date" : "1968",
			"event" : "Died in Easton, Connecticut."
		}
		]
	},
	{
		"speaker" : "Jane Addams",
		"headline" : "The Mother of Social Work",
		"image" : "//chazonabaum.com/images/jane_addams.jpg",
		"quotes" : [
		{
			"quoteText" : "Action indeed is the sole medium of expression for ethics.",
			"tags" : [
			"ethics"
			]
		},
		{
			"quoteText" : "America's future will be determined by the home and the school. The child becomes largely what he is taught; hence we must watch what we teach, and how we live.",
			"tags" : [
			"education",
			"future"
			]
		},
		{
			"quoteText" : "Civilization is a method of living, an attitude of equal respect for all men.",
			"tags" : [
			"equality",
			"respect"
			]
		},
		{
			"quoteText" : "Life cannot be administered by definite rules and regulations; that wisdom to deal with a man's difficulties comes only through some knowledge of his life and habits as a whole.",
			"tags" : [
			"life",
			"wisdom"
			]
		},
		{
			"quoteText" : "Of all the aspects of social misery nothing is so heartbreaking as unemployment.",
			"tags" : [
			"money",
			"society",
			"work"
			]
		},
		{
			"quoteText" : "Old-fashioned ways which no longer apply to changed conditions are a snare in which the feet of women have always become readily entangled.",
			"tags" : [
			"change",
			"equality",
			"future",
			"society",
			"women"
			]
		},
		{
			"quoteText" : "The cure for the ills of Democracy is more Democracy.",
			"tags" : [
			"politics"
			]
		},
		{
			"quoteText" : "The essence of immorality is the tendency to make an exception of myself.",
			"tags" : [
			"attitude",
			"equality",
			"ethics"
			]
		},
		{
			"quoteText" : "Social advance depends as much upon the process through which it is secured as upon the result itself.",
			"tags" : [
			"ethics",
			"future",
			"society"
			]
		},
		{
			"quoteText" : "The common stock of intellectual enjoyment should not be difficult of access because of the economic position of him who would approach it.",
			"tags" : [
			"education",
			"equality",
			"money"
			]
		},
		{
			"quoteText" : "The good we secure for ourselves is precarious and uncertain until it is secured for all of us and incorporated into our common life.",
			"tags" : [
			"equality",
			"ethics",
			"society",
			"success"
			]
		},
		{
			"quoteText" : "What after all has maintained the human race on this old globe despite all the calamities of nature and all the tragic failings of mankind, if not faith in new possibilities and courage to advocate them.",
			"tags" : [
			"courage",
			"failure",
			"hope",
			"motivational"
			]
		}		
		],
		"timeline" : [
		{
			"date" : "1860",
			"event" : "Born in Cedarville, Illinois."
		},
		{
			"date" : "1864",
			"event" : "Contracts Pott's disease, leading to a curvature of the spine and lifelong health problems."
		},
		{
			"date" : "1881",
			"event" : "Graduates Rockford Female Seminary with a collegiate certificate and membership in Phi Beta Kappa. Inspired by her late mother, she hopes to become a doctor so she can help the poor in Cedarville. Her father, John H. Addams, dies that summer. With his passing, she moves to Philadelphia for two years to pursue a medical education, but due to her physical and mental health, does not complete a degree and returns after one year."
		},
		{
			"date" : "1883",
			"event" : "After receiving spinal surgery from her brother-in-law, travels Europe with her stepmother, deciding to help the poor without becoming a doctor."
		},
		{
			"date" : "1887",
			"event" : "Falls into depression over the conventional life expected of well-off women of her time. Visits the first settlement house - a home where rich and poor live together in an interdependent community - Toynbee Hall, in London. She dreams of opening one of her own."
		},
		{
			"date" : "1889",
			"event" : "Co-founds Hull House, a settlement house in Chicago, with Ellen Gates Starr. It will eventually house 25 women and be visited by more than 2,000 people weekly."
		},
		{
			"date" : "1894",
			"event" : "Is the first woman to be appointed sanitary inspector to Chicago's 19th ward. Under her leadership, over a thousand new health violations are reported, reducing disease and death in the ward."
		},
		{
			"date" : "1898",
			"event" : "Joins the Anti-Imperialist Leaghe against the annexation of the Plilippines."
		},
		{
			"date" : "1905",
			"event" : "Is a charter member of the American Sociological Society. During her lifetime, she will remain the most prominent female member."
		},
		{
			"date" : "1909",
			"event" : "Argues that play and recreational programs are critical for children."
		},
		{
			"date" : "1910",
			"event" : "Helps mediate during the Garment Worker's Strike."
		},
		{
			"date" : "1912",
			"event" : "Helps form the new Progressive Party and supports Theodore Roosevelt's presidential campaign."
		},
		{
			"date" : "1915",
			"event" : "Becomes a part of the Women's Peace Party and is elected national chairman. She is invited to preside over the International Congress of Women at the Hague and is chosen to head the commission to find an end to the war. She is elected president of the International Committee of Women for a Permanent Peace; she will maintain her presidency through the organization being developed into the Women's International League for Peace and Freedom."
		},
		{
			"date" : "1931",
			"event" : "Is the first woman awarded a Nobel Peace prize."
		},
		{
			"date" : "1935",
			"event" : "Dies in Chicago, Illinois."
		}
		]
	},
	{
		"speaker" : "Jim Rohn",
		"headline" : "Entrepreneur and Motivational Speaker",
		"image" : "//chazonabaum.com/images/jim_rohn.jpg",
		"quotes" : [
		{
			"quoteText" : "Happiness is not something you postpone for the future; it is something you design for the present.",
			"tags" : [
			"design",
			"future",
			"happiness",
			"motivational",
			"wisdom"
			]
		},
		{
			"quoteText" : "Work harder on yourself than you do on your job.",
			"tags" : [
			"work"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1930",
			"event" : "Born in Yakima, Washington."
		},
		{
			"date" : "2009",
			"event" : "Died in West Hills, California."
		}
		]
	},
	{
		"speaker" : "Jimmy Dean",
		"headline" : "Country Music Singer and Businessman",
		"image" : "//chazonabaum.com/images/jimmy_dean.jpg",
		"quotes" : [
		{
			"quoteText" : "I can't change the direction of the wind, but I can adjust my sails to always reach my destination.",
			"tags" : [
			"attitude",
			"motivational",
			"success"
			]
		},
		{
			"quoteText" : "You gotta try your luck at least once a day, because you could be going around lucky all day and not even know it.",
			"tags" : [
			"motivational"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1928",
			"event" : "Born in Plainview, Texas."
		},
		{
			"date" : "2010",
			"event" : "Died in Varina, Virginia."
		}
		]
	},
	{
		"speaker" : "John Romero",
		"headline" : "Game Designer and Developer",
		"image" : "//chazonabaum.com/images/john_romero.jpg",
		"quotes" : [
		{
			"quoteText" : "You might not think that programmers are artists, but programming is an extremely creative profession. It's logic-based creativity.",
			"tags" : [
			"art",
			"computers",
			"work"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1967",
			"event" : "Born in Colorado Springs, Colorado."
		}
		]
	},
	{
		"speaker" : "Joseph Campbell",
		"headline" : "Mythologist and Lecturer",
		"image" : "//chazonabaum.com/images/joseph_campbell.jpg",
		"quotes" : [
		{
			"quoteText" : "A hero is someone who has given his or her life to something bigger than oneself.",
			"tags" : [
			"life",
			"success"
			]
		},
		{
			"quoteText" : "It is by going down into the abyss that we recover the treasures of life. Where you stumble, there lies your treasure.",
			"tags" : [
			"failure",
			"success"
			]
		},
		{
			"quoteText" : "The cave you fear to enter holds the treasure you seek.",
			"tags" : [
			"success"
			]
		},
		{
			"quoteText" : "The goal of life is to make your heartbeat match the beat of the universe, to match your nature with Nature.",
			"tags" : [
			"life"
			]
		},
		{
			"quoteText" : "We must be willing to get rid of the life we've planned, so as to have the life that is waiting for us.",
			"tags" : [
			"change",
			"future",
			"life",
			"moving on",
			"wisdom"
			]
		},
		{
			"quoteText" : "Your sacred space is where you can find yourself again and again.",
			"tags" : [
			"wisdom"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1904",
			"event" : "Born in White Plains, New York."
		},
		{
			"date" : "1987",
			"event" : "Died in Honolulu, Hawaii."
		}
		]
	},
	{
		"speaker" : "Maya Angelou",
		"headline" : "Poet and Civil Rights Activist",
		"image" : "//chazonabaum.com/images/maya_angelou.jpg",
		"quotes" : [
		{
			"quoteText" : "If you don't like something, change it. If you can't change it, change your attitude.",
			"tags" : [
			"attitude",
			"change"
			]
		},
		{
			"quoteText" : "I've learned that people will forget what you said, people will forget what you did, but people will never forget how you made them feel.",
			"tags" : [
			"failure",
			"success"
			]
		},
		{
			"quoteText" : "Prejudice is a burden that confuses the past, threatens the future and renders the present inaccessible.",
			"tags" : [
			"wisdom"
			]
		},
		{
			"quoteText" : "There is no greater agony than bearing an untold story inside you.",
			"tags" : [
			"life"
			]
		},
		{
			"quoteText" : "Try to be a rainbow in someone's cloud.",
			"tags" : [
			"attitude"
			]
		},
		{
			"quoteText" : "We delight in the beauty of the butterfly, but rarely admit the changes it has gone through to achieve that beauty.",
			"tags" : [
			"beauty",
			"change",
			"life",
			"success"
			]
		},
		{
			"quoteText" : "You may not control all the events that happen to you, but you can decide not to be reduced by them.",
			"tags" : [
			"attitude",
			"moving on"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1928",
			"event" : "Born in St. Louis, Missouri."
		},
		{
			"date" : "2014",
			"event" : "Died in Winston-Salem, North Carolina."
		}
		]
	},
	{
		"speaker" : "Norman Vincent Peale",
		"headline" : "Author and Minister",
		"image" : "//chazonabaum.com/images/norman_vincent_peale.jpg",
		"quotes" : [
		{
			"quoteText" : "Believe in yourself! Have faith in your abilities! Without a humble but reasonable confidence in your own powers you cannot be successful or happy.",
			"tags" : [
			"attitude",
			"success"
			]
		},
		{
			"quoteText" : "Change your thoughts and you change your world.",
			"tags" : [
			"attitude",
			"change"
			]
		},
		{
			"quoteText" : "Stand up to your obstacles and do something about them. You will find that they haven't half the strength you think they have.",
			"tags" : [
			"attitude",
			"success"
			]
		},
		{
			"quoteText" : "There is a real magic in enthusiasm. It spells the difference between mediocrity and accomplishment.",
			"tags" : [
			"attitude",
			"success"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1898",
			"event" : "Born in Bowersville, Ohio."
		},
		{
			"date" : "1993",
			"event" : "Died in Pawling, New York."
		}
		]
	},
	{
		"speaker" : "Paul Gauguin",
		"headline" : "Experimental Artist",
		"image" : "//chazonabaum.com/images/paul_gauguin.jpg",
		"quotes" : [
		{
			"quoteText" : "Art is either plagiarism or revolution.",
			"tags" : [
			"art",
			"change"
			]
		},
		{
			"quoteText" : "Art requires philosophy, just as philosophy requires art. Otherwise, what would become of beauty?",
			"tags" : [
			"art"
			]
		},
		{
			"quoteText" : "It is the eye of ignorance that assigns a fixed and unchangeable color to every object; beware of this stumbling block.",
			"tags" : [
			"failure"
			]
		},
		{
			"quoteText" : "We never really know what stupidity is until we have experimented on ourselves.",
			"tags" : [
			"failure"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1848",
			"event" : "Born in Paris, France."
		},
		{
			"date" : "1903",
			"event" : "Died in French Polynesia."
		}
		]
	},
	{
		"speaker" : "Siddhartha Gautama",
		"headline" : "Founder of Buddhism",
		"image" : "//chazonabaum.com/images/siddhartha_gautama.jpg",
		"quotes" : [
		{
			"quoteText" : "Holding on to anger is like grasping a hot coal with the intent of throwing it at someone else; you are the one who gets burned.",
			"tags" : [
			"attitude",
			"failure",
			"wisdom"
			]
		},
		{
			"quoteText" : "The mind is everything. What you think, you become.",
			"tags" : [
			"attitude",
			"wisdom"
			]
		},
		{
			"quoteText" : "Thousands of candles can be lighted from a single candle, and the life of the candle will not be shortened. Happiness never decreases by being shared.",
			"tags" : [
			"attitude",
			"wisdom"
			]
		},
		{
			"quoteText" : "You will not be punished for your anger, you will be punished by your anger.",
			"tags" : [
			"attitude",
			"failure",
			"wisdom"
			]
		}
		],
		"timeline" : [
		{
			"date" : "563 BCE",
			"event" : "Born in Lumbini, Shakya Republic."
		},
		{
			"date" : "483 BCE",
			"event" : "Died in Kushinagar, Malla Republic."
		}
		]
	},
	{
		"speaker" : "Sophia Loren",
		"headline" : "Award-winning Actress",
		"image" : "//chazonabaum.com/images/sophia_loren.jpg",
		"quotes" : [
		{
			"quoteText" : "It's a mistake to think that once you're done with school you need never learn anything new.",
			"tags" : [
			"education",
			"failure",
			"knowledge"
			]
		},
		{
			"quoteText" : "Mistakes are part of the dues one pays for a full life.",
			"tags" : [
			"failure",
			"life"
			]
		},
		{
			"quoteText" : "When you are a mother, you are never really alone in your thoughts. A mother always has to think twice, once for herself and once for her child.",
			"tags" : [
			"alone",
			"women"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1934",
			"event" : "Born in Rome, Italy."
		}
		]
	},
	{
		"speaker" : "Steve Jobs",
		"headline" : "Co-founder and CEO of Apple",
		"image" : "//chazonabaum.com/images/steve_jobs.jpg",
		"quotes" : [
		{
			"quoteText" : "My favorite things in life don't cost any money. It's really clear that the most precious resource we all have is time.",
			"tags" : [
			"life",
			"money",
			"time"
			]
		},
		{
			"quoteText" : "Sometimes life is going to hit you in the head with a brick. Don't lose faith.",
			"tags" : [
			"life",
			"hope"
			]
		},
		{
			"quoteText" : "Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it.",
			"tags" : [
			"happiness",
			"life",
			"work"
			]
		}	
		],
		"timeline" : [
		{
			"date" : "1955",
			"event" : "Born in San Francisco, California."
		},
		{
			"date" : "2011",
			"event" : "Died in Palo Alto, California."
		}
		]
	},
	{
		"speaker" : "Vince Lombardi",
		"headline" : "Hall of Fame-inducted NFL Coach",
		"image" : "//chazonabaum.com/images/vince_lombardi.jpg",
		"quotes" : [
		{
			"quoteText" : "Individual commitment to a group effort - that is what makes a team work, a company work, a society work, a civilization work.",
			"tags" : [
			"business"
			]
		},
		{
			"quoteText" : "It's not whether you get knocked down, it's whether you get up.",
			"tags" : [
			"attitude",
			"failure"
			]
		},
		{
			"quoteText" : "Perfection is not attainable, but if we chase perfection we can catch excellence.",
			"tags" : [
			"motivational",
			"success"
			]
		},
		{
			"quoteText" : "The harder you work, the harder it is to surrender.",
			"tags" : [
			"failure",
			"work"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1913",
			"event" : "Born in Brooklyn, New York."
		},
		{
			"date" : "1970",
			"event" : "Died in Washington, D.C."
		}
		]
	},
	{
		"speaker" : "Walt Whitman",
		"headline" : "The Father of Free Verse",
		"image" : "//chazonabaum.com/images/walt_whitman.jpg",
		"quotes" : [
		{
			"quoteText" : "Be curious, not judgmental.",
			"tags" : [
			"attitude",
			"wisdom"
			]
		},
		{
			"quoteText" : "Behold I do not give lectures or a little charity. When I give I give myself.",
			"tags" : [
			"giving"
			]
		},
		{
			"quoteText"  : "Do I contradict myself? Very well then I contradict myself, (I am large, I contain multitudes.)",
			"tags" : [
			"miscelaneous"
			]
		},
		{
			"quoteText" : "I exist as I am, that is enough.",
			"tags" : [
			"attitude",
			"success"
			]
		},
		{
			"quoteText" : "Keep your face always toward the sunshine - and shadows will fall behind you.",
			"tags" : [
			"attitude",
			"hope"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1819",
			"event" : "Born in Long Island, New York."
		},
		{
			"date" : "1892",
			"event" : "Died in Camden, New Jersey."
		}
		]
	},
	{
		"speaker" : "William Shakespeare",
		"headline" : "The Bard of Avon",
		"image" : "//chazonabaum.com/images/william_shakespeare.jpg",
		"quotes" : [
		{
			"quoteText" : "Better three hours too soon than a minute too late.",
			"tags" : [
			"time"
			]
		},
		{
			"quoteText" : "Cowards die many times before their deaths; the valiant never taste of death but once.",
			"tags" : [
			"courage"
			]
		},
		{
			"quoteText" : "Love all, trust a few, do wrong to none.",
			"tags" : [
			"love",
			"wisdom"
			]
		},
		{
			"quoteText" : "The course of love never did run smooth.",
			"tags" : [
			"love"
			]
		},
		{
			"quoteText" : "We know what we are, but know not what we may be.",
			"tags" : [
			"future",
			"knowledge",
			"motivational"
			]
		}
		],
		"timeline" : [
		{
			"date" : "1564",
			"event" : "Baptised in Stratford-upon-Avon, England."
		},
		{
			"date" : "1616",
			"event" : "Died in Stratford-upon-Avon, England."
		}
		]
	}
	]
};
var functionName = "";
function emptyError(field, functionName) {
	console.log('Error: The ' + field + ' field in the function ' + functionName +' is empty.');
}
function titleCaseArray(array) {
    for (item in array) {
        array[item][0] = array[item[0]].toUpperCase();
    }
    return array;
}
function confirmEnding(str, target) {
	var ending = str.substring(str.length - target.length);
	if (ending === target) {
		return true;
	} else {
		return false;
	}
}
function addToPage(section, helper, data) {
 	if (data != "") {
 		var formatted = helper.replace(/%data%/g, data);
 		$(section).append(formatted);
 	} else if (data != "") {
 		emptyError("data", addToPage);
 	}
}
function helpModal(initial, page, short) {
	var modalText = initial;
	for (item in frequentlyAskedQuestions[page]) {
		var heading = short + 'Help' + item.toString();
		var collapseid = short + 'HelpAnswer' + item.toString();
		var question = frequentlyAskedQuestions[page][item].question;
		var answer = frequentlyAskedQuestions[page][item].answer;
		var formattedHelpText = HTMLquoteHelpText.replace(/%heading%/g, heading).replace(/%collapseid%/g, collapseid).replace(/%question%/g, question).replace(/%answer%/g, answer);
		modalText = modalText + formattedHelpText;
	}
	modalText = modalText + '</div>';
	return modalText;
}
function modalText(section, title, data) {
	var formattedModal = HTMLhelpModal;
	formattedModal = HTMLhelpModal.replace(/%title%/g, title).replace(/%data%/g, data);
	$(section).append(formattedModal);
}
footer.display = function() {
	var formatted = HTMLfooter.replace(/%url%/g, "//chazonabaum.com");
	formatted = formatted.replace(/%name%/g, "Chazona Baum");
	$("#footer").append(formatted);
}
function randomizer(groupLength) {
	var maxID = groupLength - 1;
	var minID = 0;
	var randomIndex = 0;
	randomIndex = Math.floor(Math.random() * (maxID - minID + 1) + minID);
	return randomIndex;
}
function ownership(name) {
    if (name.endsWith("s")) {
        name = name + "'";
    } else {
        name = name + "'s";
    }
    return name;
}
function makeSnakeCase(name) {
    var nameArray = name.split(" ");
    name = nameArray.join("_");
    return name;
}
$('#home').append(HTMLquoteStart);
$('#home').append(HTMLquoteTagsDrop);
addToPage('#home', HTMLsearchBox, 'Search Quotes');
var quoteTagsArray = []
for (speaker in quotes.speakers) {
    if (quotes.speakers[speaker].quotes.length > 0) {
        for (quote in quotes.speakers[speaker].quotes) {
            if (quotes.speakers[speaker].quotes[quote].tags.length > 0) {
                for (tag in quotes.speakers[speaker].quotes[quote].tags) {
                    quoteTagsArray.push(quotes.speakers[speaker].quotes[quote].tags[tag]);
                }
            }
        }   
    }
}
quoteTagsArray = quoteTagsArray.sort();
var uniqueTagArray = [];
$.each(quoteTagsArray, function(i, value) {
    if($.inArray(value, uniqueTagArray) === -1) uniqueTagArray.push(value);
});
var titleCaseTagArray = titleCaseArray(uniqueTagArray);
for(tag in uniqueTagArray) {
    addToPage($('.quoteTags:last'), HTMLquoteTagsEach, uniqueTagArray[tag]);
}
$('#quoteBox').append(HTMLquoteBoxStart);
var helpTitle = 'Random Quote Generator Help';
modalText('#quoteBox', helpTitle, helpModal(HTMLhelpBox, 'random_quote_generator', 'quote'));
$('#quoteBox').append(HTMLquoteButtons);
footer.display();
$(document).ready(function() {
    var prevQuotesArray = [];
    $('#btnNewQuote').on('click', function() {
        var citationIndex = randomizer(quotes.speakers.length);
        var quoteIndex = randomizer(quotes.speakers[citationIndex].quotes.length);
        var formatted = HTMLquoteItem.replace(/%quote%/g, quotes.speakers[citationIndex].quotes[quoteIndex].quoteText);
        formatted = formatted.replace(/%citation%/g, quotes.speakers[citationIndex].speaker);
        var formattedImg = HTMLquoteImage.replace(/%imgurl%/g, quotes.speakers[citationIndex].image);
        $('#quoteBlock').html(formatted);
        $('#image').html(formattedImg);
        prevQuotesArray.push(formatted);
    });
    $('#btnPreviousQuote').on('click', function() {
        if (prevQuotesArray.length > 0) {
            $('#previousQuotes').html(HTMLpreviousQuotes);
            for (item in prevQuotesArray) {
                $('.previousQuotes:last').append(prevQuotesArray[item]);
            }
        } else {
            $('#previousQuotes').html(HTMLerrorNoQuotes);
        }
    });
    $('#btnTagClick').click(function(event) {
        var selectedTag;
        selectedTag = $('#quoteTags option:selected').text();
        selectedTagArray = [];
        for (speaker in quotes.speakers) {
            if (quotes.speakers[speaker].quotes.length > 0) {
                for (quote in quotes.speakers[speaker].quotes) {
                    if (quotes.speakers[speaker].quotes[quote].tags.length > 0) {
                        for (tag in quotes.speakers[speaker].quotes[quote].tags) {
                            if (quotes.speakers[speaker].quotes[quote].tags[tag] == selectedTag) {
                                var formatted = HTMLquoteItem.replace(/%quote%/g, quotes.speakers[speaker].quotes[quote].quoteText);
                                formatted = formatted.replace(/%citation%/g, quotes.speakers[speaker].speaker);
                                selectedTagArray.push(formatted);
                            }
                        }
                    }
                }   
            }
        }
        var formattedQuoteResults = HTMLquoteResults.replace(/%data%/g, selectedTag);
        $('#resultsBox').html(formattedQuoteResults);
        for (item in selectedTagArray) {
            $('#resultsBlock').append(selectedTagArray[item]);
        }
    });
    $('#resultsBtn').click(function(event) {
        var searchQuery = document.getElementById('inputSearch').value.replace(/</, '&lt;').replace(/>/, '&gt;').replace(/&/, '&amp;').replace(/"/, '&quot;').replace(/'/, '&#x27;').replace(/\//, '&#x2F');
        var resultsArray = [];
        for (speaker in quotes.speakers) {
            if (quotes.speakers[speaker].quotes.length > 0) {
                for (quote in quotes.speakers[speaker].quotes) {
                    var searchIndex;
                    console.log(searchQuery);
                    console.log(quotes.speakers[speaker].quotes[quote].quoteText);
                    searchIndex = quotes.speakers[speaker].quotes[quote].quoteText.search(searchQuery);
                    console.log(searchIndex);
                    if (searchIndex != -1) {
                        var formatted = HTMLquoteItem.replace(/%quote%/g, quotes.speakers[speaker].quotes[quote].quoteText);
                        formatted = formatted.replace(/%citation%/g, quotes.speakers[speaker].speaker);
                        resultsArray.push(formatted);
                    }
                }
            }
        }
        var formattedSearchResults = HTMLsearchResults.replace(/%data%/g, searchQuery);
        $('#resultsBox').html(formattedSearchResults);
        for (item in resultsArray) {
            $('#resultsBlock').append(resultsArray[item]);
        }
    });
    var twitter = 'https://twitter.com/intent/tweet?';
    var facebook = 'https://www.facebook.com/sharer.php?'
    function socialShare(site, status) {
        window.open(site + status);
    }
    $('#btnTweetQuote').click(function(event) {
        var twitterStatus = 'hashtags=quotes&related=freecodecamp&text=' + $('#quoteBlock').text();
        socialShare(twitter, twitterStatus);
    });
    $('#btnFacebookQuote').click(function(event) {
        var facebookStatus = 's=100&p[title]=Quote&p[url]=https://cdpn.io/EyLoOv[summary]=' + $('#quoteBlock').text();
        socialShare(facebook, facebookStatus);
    })
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console