What the Quote?
Category domino javascript
I really, really, really like Ext. As fun as manual DOM scripting can be, sometimes it's nice to just let a framework work its magic... especially when that framework happens to be very well-written and ridiculously easy to use.
Although I'd like to believe that some of the little code nuggets I post here are of occasional use, the popular favorite portion of my site seems to be the random quote section. I've had several requests for a way to view all the quotes, not just a few at random. A while back, a friend of mine even envisioned expanding it to allow quotes to be submitted, and voted on, by anyone - similar, but on a smaller scale, to ideaExchange. He even registered WhatTheQuote.com for that very purpose. Well, I figure it's a shame such a fun domain name is fusting unused, and I'd been itching for an excuse to dig into the Ext 2.0 API anyway, so this is what I've been playing with for the last two hours. Yup, that's all it took. Ext rules. I added 4 images, 44 lines of JavaScript, 30 lines of LotusScript, and 3 lines of CSS... and Ext does everything else. Caveat: the submit stuff doesn't do anything yet... maybe tomorrow.
Something curious about all this: check out the source for that page. Notice anything strange? Specifically, don't web pages usually have a <body> tag? I was surprised to find that none of the major browsers (I.E., Firefox, Opera, Safari) care that it's missing. I guess sometimes all you need is the right head.
UPDATE: Quote submission works now. So does voting (double-click any quote to display a vote dialog). For some reason it doesn't work in I.E. Aren't browsers wonderful?
I really, really, really like Ext. As fun as manual DOM scripting can be, sometimes it's nice to just let a framework work its magic... especially when that framework happens to be very well-written and ridiculously easy to use.
Although I'd like to believe that some of the little code nuggets I post here are of occasional use, the popular favorite portion of my site seems to be the random quote section. I've had several requests for a way to view all the quotes, not just a few at random. A while back, a friend of mine even envisioned expanding it to allow quotes to be submitted, and voted on, by anyone - similar, but on a smaller scale, to ideaExchange. He even registered WhatTheQuote.com for that very purpose. Well, I figure it's a shame such a fun domain name is fusting unused, and I'd been itching for an excuse to dig into the Ext 2.0 API anyway, so this is what I've been playing with for the last two hours. Yup, that's all it took. Ext rules. I added 4 images, 44 lines of JavaScript, 30 lines of LotusScript, and 3 lines of CSS... and Ext does everything else. Caveat: the submit stuff doesn't do anything yet... maybe tomorrow.
Something curious about all this: check out the source for that page. Notice anything strange? Specifically, don't web pages usually have a <body> tag? I was surprised to find that none of the major browsers (I.E., Firefox, Opera, Safari) care that it's missing. I guess sometimes all you need is the right head.
UPDATE: Quote submission works now. So does voting (double-click any quote to display a vote dialog). For some reason it doesn't work in I.E. Aren't browsers wonderful?

Comments
As for the body tag, you would be really amazed at some of the crazy things the browser will accept/do. Try adding a head { display: block; background-color:yellow; height:100px; } sometime
Posted by Rich Waters At 10:30:51 AM On 10/11/2007 | - Website - |
Can't wait for the submit to work...
"You can always spot Java written by C-coders because it's littered with public void (blah, blah, blah) They're proceduretarded."
Posted by Nathan T. Freeman At 07:38:59 AM On 10/11/2007 | - Website - |