Custom quote widget for Blogger

On a blog that I have I wanted to have a list of custom quotes that I could have displayed at the top of my blog.  After a bit of searching I came upon this link to a site with a simple widget that did the job.  Here is the code as well.  The only change that I made to it was to add the  to change the color to better match my theme.

http://wishingdoesntmakeitso.blogspot.com/2008/09/quote-widget-for-blogger.html

    
var quotecounter = 0;
var m
/**********************************************************
This code is meant to be installed as an "html/javascript" gadget on a blogger blog.
**********************************************************/
/***************************************************
This code is coprighted by Gove Allen, Ph.D.
Non-comercial use of this code is permiotted provided
that any additions or modifications made are also
made freely available for non-comercial use. For
all use, this comment must remain intact.
For commercial use, contact Gove Allen at
http://gove.net
****************************************************/
var quotes = new Array(); var author = new Array(); var second = new Array()
/*-------------- User Configuration --------------*/
/* the next line allows you to control whether the
link shows to allow the user to pop up a windows
showing all the quotes. Just put the text you want
to show for link in the quotes*/
var labelForAllQuotes = 'View my quotes';

/*-------------- add quotes here --------------*/
/* The first parameter is the number of seconds
the quote should display/ The second is the name
of the person who said the quote. The third is the
quote itself. The second and third are delimited by
either a single quote(') or a double quote ("), you
choose. However, you cannot put the same kind of
delimiter insite the argument that is used to delimit
the argument.*/

q(100, 'Albert Einstein', 'If at first the idea is not absurd, then there is no hope for it.')
q(100, 'Lord Chesterton', 'There are no uninteresting things; there are only uninterested people.')

//-------------- No user-configurable parameters below this line --------------
m = quotecounter;
quotecounter = 0;
function q(secs, auth, quote) {
quotes[quotecounter] = quote
author[quotecounter] = auth
second[quotecounter] = secs
quotecounter = quotecounter + 1
}
function putquote() {
document.getElementById('quotetext').innerHTML = quotes[quotecounter];
document.getElementById('author').innerHTML = author[quotecounter];
document.getElementById('allQuotes').innerHTML = '' + labelForAllQuotes + '';
setTimeout("putquote()", second[quotecounter] * 1000)
quotecounter = quotecounter + 1
if (quotecounter >= m) { quotecounter = 0 }
}
function showQuotes() {
var w = window.open('', 'Quotes', 'toolbar=0,location=0,menubar=0,width=600,height=600,scrollbars=1')
w.document.write('');
w.document.write('Quotes');
w.document.write('');
w.document.write('
');
var o = '"
for (x = 0; x < m; x++) {
w.document.write(o);
w.document.write(quotes[x]);
w.document.write(c);
w.document.write(o2);
w.document.write(author[x]);
w.document.write(c2);
}
//w.document.write(>
"
var c2 = "
';
var o2 = '
';
var c = "
');
w.document.write('');
w.document.close();
}



















putquote()


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s