Sunday, March 11, 2007

QOTM - HowTo

Please follow the instructions as mentioned in my QOTD widget post.

Replace the complete script/html content with the one given below.
<script src=" http://build.dojotoolkit.org/0.4.2rc2/dojo.js" type="text/javascript"></script>
<script language="javascript">
var quotesArray;

function loadQuotes(root) {
var content = root.entry.content.$t;
quotesArray = content.split('%');
setInterval("showRandomQuote()", 16000);
}

function showRandomQuote() {
var index = Math.floor(Math.random() * quotesArray.length);
var quote = quotesArray[index];
quote = stripHtml(quote);
document.getElementById("quotesDiv").innerHTML = quote;
dojo.lfx.html.fadeIn('quotesDiv', 2000).play();
setTimeout("dojo.lfx.html.fadeOut('quotesDiv', 2000).play()", 13000);
}

function stripHtml(s) {
return s.replace(/(<([^>]+)>)/ig,' ');
}

</script>
<div id="quotesDiv">
loading quotes...
</div>
<script language="javascript"
src
="http://www2.blogger.com/feeds/DDDDD/posts/full/SSSSSS?alt=json-in-script&amp;callback=loadQuotes ">
</script>
where DDDDDD is your blog id and SSSSSSS is your quotes-data post id.

Please refer my earlier post for all other details. Just now I found a bug in this one. The stripHTML function strips any HTML from the quote text and replaces with a blank space. This is not acceptable.

What I should do is, first replace all the <br> and/or <br/> tags with a blank space and all other tags with empty space. Comments please :)
--
regards/Yogesh

"One can resist the invasion of an army but one cannot resist the invasion of ideas." - Victor Hugo

Quote of the moment

My little quote of the day widget is now changed to quote of the moment widget.

Features :

Displays new quote every 15 seconds.

Fade-in and Fade-out effect added. (Thanks to all the people involved in the dojotoolkit project.)

Quotes are loaded only once when the page is loaded. Not everytime when the quote changes.

I am still kinda testing it. AFAIK, two guys (Alian and Sanjeev) are using it.

Will update you guys tomorrow on how to get it up on your blogs. If you are too much impatient, view the source and satisfy yourself :D

Good night!
--
regards/Yogesh

"One can resist the invasion of an army but one cannot resist the invasion of ideas." - Victor Hugo

Friday, March 09, 2007

Mo'blogging

cool. This is from my sweetheart. Thanks to hutch : )

--
regards/Yogesh

"One can resist the invasion of an army but one cannot resist the
invasion of ideas." - Victor Hugo