From ecaebc1b2f0e9e71f9f3e6b5a731e3e81afcf072 Mon Sep 17 00:00:00 2001 From: devenblake Date: Thu, 17 Dec 2020 08:34:05 -0500 Subject: [PATCH] hopefully fixes quotes --- homepage/index.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/homepage/index.html b/homepage/index.html index 8cdf7a9..b7dde4d 100644 --- a/homepage/index.html +++ b/homepage/index.html @@ -44,13 +44,12 @@ window.getCookie = function(cname) { /* end stolen code; */ window.genQuote = function() { - quotes = window.quotes; - quote = window.quote; - while(quote == window.quote) quote = Math.floor(Math.random() * quotes.length); - window.quote = quote; + if(window.quote != "") window.quotes.push(window.quote); + quoteindex = Math.floor(Math.random() * window.quotes.length); + window.quote = window.quotes.splice(quoteindex, 1); document.getElementById('getaquote').setAttribute('value', 'Get another free quote today!'); - document.getElementById('quote').textContent = '\"' + quotes[quote][0] + '\"'; - document.getElementById('quoteauthor').textContent = '~ ' + quotes[quote][1]; + document.getElementById('quote').textContent = '\"' + window.quote[0] + '\"'; + document.getElementById('quoteauthor').textContent = '~ ' + window.quote[1]; } window.setStyling = function(sheet) { @@ -73,12 +72,15 @@ window.quotes = [ "Darth Vader" ], [ "A checklist can aid here.", "Lance Leventhal" ] + [ "Special thanks to Ками for their help adding quotes to this page.", + "Deven Blake" ] ];