<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CodeDread Blog &#187; JavaScript</title>
	<atom:link href="http://www.codedread.com/blog/archives/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codedread.com/blog</link>
	<description></description>
	<lastBuildDate>Mon, 02 Jan 2012 15:30:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>kthoom!</title>
		<link>http://www.codedread.com/blog/archives/2010/04/12/kthoom/</link>
		<comments>http://www.codedread.com/blog/archives/2010/04/12/kthoom/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 12:55:51 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[comics]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://www.codedread.com/blog/?p=832</guid>
		<description><![CDATA[[clipart]Sometimes I get an idea and I just have to see it through to a point where it will let my brain go. At work Thursday we were all slobbering over Steve&#8217;s iPad and someone brought up how cool the Marvel app is. I had to admit it was much nicer than any piece of [...]]]></description>
			<content:encoded><![CDATA[<p><object type="image/svg+xml" width="100" height="100" style="float:right" data="http://codedread.com/clipart/kthoom.svgz">[clipart]</object>Sometimes I get an idea and I just have to see it through to a point where it will let my brain go.  At work Thursday we were all slobbering over <a href="http://nuthatch.com/blog/">Steve&#8217;s</a> iPad and someone brought up how cool the <a href="http://marvel.com/news/comicstories.11835.download_the_official_marvel_comics_ipad_app">Marvel app</a> is.  I had to admit it was much nicer than any piece of software I&#8217;d used for viewing comics before on my laptop.</p>
<p>In the meantime, I&#8217;ve been carefully watching WebKit creep <a href="https://bugs.webkit.org/show_bug.cgi?id=32624">closer</a> and <a href="https://bugs.webkit.org/show_bug.cgi?id=36567">closer</a> to implementing the <a href="http://www.w3.org/TR/FileAPI/">W3C File API</a> (Go Kinuko!).  Something I&#8217;ve been eagerly waiting for more browsers to do so you can open up local files in <a href="http://svg-edit.googlecode.com/">SVG-edit</a>.</p>
<p>And then it hit me. <span id="more-832"></span></p>
<p>Why not a comic book reader done directly in the browser?</p>
<p>In case you don&#8217;t know, <a href="http://en.wikipedia.org/wiki/Comic_Book_Archive_file">comic book archive files</a> are just ZIP or RAR files containing JPEG images.  Browsers can handle images.  Some browsers can now handle opening local files.  Even binary ones.  So theoretically you could write unzip/unrar in pure JavaScript, extract the JPEGs, turn them into data: URIs and shove them into an &#60;image&#62; element.  You can even do the unzipping in a separate thread using <a href="http://www.whatwg.org/specs/web-workers/current-work/">Web Workers</a>.</p>
<p>Theoretically.</p>
<p><a href="http://code.google.com/p/kthoom/">kthoom</a> was how far I was able to get in a weekend.</p>
<p>Some limitations:</p>
<ul>
<li><a href="http://code.google.com/p/kthoom/issues/detail?id=10">Unzipping is slow</a>.  None of the code has been optimized yet and I&#8217;m probably doing a lot of really stupid things.</li>
<li>Only supports CBZ files, <a href="http://code.google.com/p/kthoom/issues/detail?id=9">not CBR files</a> at the moment &#8211; I am accepting patches</li>
<li>Unzipping is <em>really</em> slow.  I need to <a href="http://code.google.com/p/kthoom/issues/detail?id=8">provide visual progress reporting</a> from the Web Worker thread, I know.</li>
<li>kthoom will crash Firefox 3.6 about half the time.  Firefox nightly (3.7) seems to handle it just fine.  I opened <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=558621">this bug</a>.</li>
<li>Did I mention that unzipping is slow?</li>
</ul>
<p>If I&#8217;m honest, this was really an exercise to see just how easy/hard it would be to do something like this in the browser &#8211; and to get some hands-on experience with Web Workers.  And hey, I&#8217;m not the <a href="http://jsxgraph.uni-bayreuth.de/wp/">first</a> or even <a href="http://github.com/tlrobinson/zipjs">second</a> person to think of doing unzip/deflate in JavaScript either.</p>
<p>It was my first experience writing JavaScript to handle binary files.  It was fun.  It took a weekend.  </p>
<p>Some essential tools:  Firebug, a hex editor, pen &#38; paper, a clear mind, patience.</p>
<p>Now swinging my attention back to stuff I should be working on&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codedread.com/blog/archives/2010/04/12/kthoom/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tight JavaScript</title>
		<link>http://www.codedread.com/blog/archives/2010/01/18/tight-javascript/</link>
		<comments>http://www.codedread.com/blog/archives/2010/01/18/tight-javascript/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 23:29:07 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.codedread.com/?p=552</guid>
		<description><![CDATA[[clipart]When I was fiddling with my JavaScript (sounds obscene) for the MIX 10k Challenge, I was obviously interested in shrinking the code as small as possible. I was also interested in learning some best practices that would produce tighter minified code but would not reduce the readability and integrity of the unminified source. I came [...]]]></description>
			<content:encoded><![CDATA[<p><object type="image/svg+xml" width="100" height="100" style="float:right" data="http://codedread.com/clipart/rubik.svgz">[clipart]</object>When I was fiddling with my JavaScript (sounds obscene) for the <a href="http://www.codedread.com/blog/archives/2010/01/14/mix-10k-code-challenge-svg/">MIX 10k Challenge</a>, I was obviously interested in shrinking the code as small as possible.  I was also interested in learning some best practices that would produce tighter minified code but would <em>not</em> reduce the readability and integrity of the unminified source.<span id="more-552"></span></p>
<p>I came up with two simple practices that I intend to follow going forward to produce readable JavaScript that minifies better:</p>
<h3>1. Reduce Early Returns</h3>
<p>When I&#8217;m writing code, sometimes I think of error situations after I&#8217;ve written the main body of a function.  This often results in me inserting a quick early return at the top of a function:<br />
<code><br />
&#160;&#160;function foo() {<br />
<b>&#160;&#160;&#160;&#160;if (garbage > 0) return;</b><br />
&#160;&#160;&#160;&#160;// rest of function here<br />
&#160;&#160;}<br />
</code></p>
<p>This gets the error condition &#8220;out of the way&#8221; and I don&#8217;t have to think about it anymore.  However, it is usually better practice to write this as:<br />
<code><br />
&#160;&#160;function foo() {<br />
<b>&#160;&#160;&#160;&#160;if (garbage == 0) {</b><br />
&#160;&#160;&#160;&#160;&#160;&#160;// rest of function here<br />
<b>&#160;&#160;&#160;&#160;}</b><br />
&#160;&#160;}<br />
</code></p>
<p>Early returns are sometimes debatable, but in general they make your code harder to read (particular if your return is embedded deeper in the function than at the top in my simple example).  They also have the side effect of making your code larger: that extra &#8216;return;&#8217; is 7 more characters compared to the two required for the braces.</p>
<p>In my experiments <a href="http://developer.yahoo.com/yui/compressor/">YUI Compressor</a> does not rewrite my code to the second example, eliminating the early return.  On the other hand, the <a href="http://code.google.com/closure/compiler/">Closure Compiler</a> does.</p>
<h3>2. Collapsing Variable Declarations</h3>
<p>This one is pretty straightforward.  Instead of writing this:<br />
<code><br />
&#160;&#160;var x = 5;<br />
&#160;&#160;var y = 2;<br />
&#160;&#160;var z = "foo";<br />
</code></p>
<p>write this:<br />
<code><br />
&#160;&#160;var x = 5,<br />
&#160;&#160;&#160;&#160;&#160;&#160;y = 2,<br />
&#160;&#160;&#160;&#160;&#160;&#160;z = "foo";<br />
</code></p>
<p>It looks just as readable and reduces the extra &#8216;var&#8217; characters.</p>
<p>Again, as with the first case, YUI did not reduce my code while Closure Compiler did.</p>
<h3>What Else?</h3>
<p>By the way, I don&#8217;t mean to imply that the Closure Compiler is an overall better minifier than YUI Compressor.  </p>
<p>These are just two simple examples, but I&#8217;m interested in learning some more best practices that will keep my un-minified code readable but produce tighter JS when minified.</p>
<p>It may sound silly to worry about 3 characters here and 5 characters there, but I think about it this way:  it doesn&#8217;t hurt my code at all to follow the practices above and it has the potential to reduce size when minified (by even a very small amount), so why not follow it?  This is similar to when I retrained myself to consistently use the pre-increment operator in C++ for-loops in case the loop variable is an iterator: doesn&#8217;t reduce the readability of my code and has the potential to improve the efficiency (<a href="http://en.allexperts.com/q/C-1040/Increment-operators.htm">read more</a>).</p>
<p>So what else?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codedread.com/blog/archives/2010/01/18/tight-javascript/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>MIX 10k Code Challenge += SVG</title>
		<link>http://www.codedread.com/blog/archives/2010/01/14/mix-10k-code-challenge-svg/</link>
		<comments>http://www.codedread.com/blog/archives/2010/01/14/mix-10k-code-challenge-svg/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 15:56:59 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://blog.codedread.com/archives/2010/01/14/mix-10k-code-challenge-svg/</guid>
		<description><![CDATA[[clipart]I came across the MIX 10k Coding Challenge on the weekend, and on a whim I decided to submit one of my old SVG demos to the contest. The 10k challenge&#8217;s tagline is &#8220;What could you create for the Web if you had only 10 kilobytes of code?&#8221;. The rules didn&#8217;t explicitly say I could [...]]]></description>
			<content:encoded><![CDATA[<p><object type="image/svg+xml" width="100" height="100" style="float:right" data="http://codedread.com/clipart/villain.svgz">[clipart]</object>I came across the <a href="http://mix10k.visitmix.com/">MIX 10k Coding Challenge</a> on the weekend, and on a whim I decided to submit one of my old SVG demos to the contest.  The 10k challenge&#8217;s tagline is &#8220;What could you create for the Web if you had only 10 kilobytes of code?&#8221;.  The rules didn&#8217;t explicitly say I could use pure SVG, they mention SVG/Canvas in the context of HTML5 only, but I thought I&#8217;d give it a shot.  It&#8217;s in the spirit of the contest, after all.  At the very least it would encourage Microsoft to clarify the rules and at the very best it would be accepted and the rules updated to allow pure SVG applications.  Looks like it was my lucky day.<span id="more-551"></span></p>
<p>I decided to go with my <a href="http://codedread.com/solitaire.php">Solitaire</a> demo because it was the most complete, didn&#8217;t infringe on any copyrights (looking at you Tetris), and most visually recognizable.  It&#8217;s not the most innovative, but then again the point of this is not necessarily to win any prizes.  It&#8217;s really about increasing awareness.</p>
<p>Unfortunately, the SVG (26kb) and JavaScript (16kb + 21kb) totaled 63kb.  I did some cleanup of the SVG, minified the JS and then put the script inline with the SVG and then gzipped it.  The result was a .svgz file that was 9kb.  Perfect!</p>
<p>I then got an email from a friendly marketing/evangelism person at Microsoft who said that the engineers did not know how to open the svgz file to review the code to ensure it was under 10k.  Woops!  I explained to her that I thought it would be ok for the SVG to be gzipped, much as PNG/GIF files use compression and sent her the uncompressed SVG file for them to review.  After all, SVG is just an image format, right? <img src='http://www.codedread.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Was I following the rules?  Did Microsoft give me a fair shake?  <a href="http://mix10k.visitmix.com/Entry/Details/160">See for yourself</a>.  Who knows, maybe this is the first time a Microsoft admin had to figure out how to serve SVG on a Microsoft web server.</p>
<p>Out of curiosity, I later tried to see how far I was able to get down the Solitaire game: <a href="http://codedread.com/solitaire.svgz">5811 bytes</a>.  Not bad for a complete game that has scalable graphics.  I&#8217;d be curios to see the equivalent SWF file.</p>
<p>I don&#8217;t expect you to vote for my entry, but what I do expect you to do is now go out and submit .SVGZ entries to the MIX 10k challenge.  That one SVG entry is looking pretty lonely.  If I can get Solitaire down to 5811 bytes, surely you can do better?</p>
<p>Thanks a lot to Amy, the evangelist/marketing person who really was quite patient with me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codedread.com/blog/archives/2010/01/14/mix-10k-code-challenge-svg/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Smile Zen Garden?</title>
		<link>http://www.codedread.com/blog/archives/2008/05/19/smile-zen-garden/</link>
		<comments>http://www.codedread.com/blog/archives/2008/05/19/smile-zen-garden/#comments</comments>
		<pubDate>Tue, 20 May 2008 02:49:48 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[fakesmile]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[smil]]></category>

		<guid isPermaLink="false">http://blog.codedread.com/archives/2008/05/19/smile-zen-garden/</guid>
		<description><![CDATA[I&#8217;ve been watching David&#8217;s FakeSmile script evolve over the course of the last few months. At the same time, I have been reading up on SMIL Timesheets, a recent specification drafted by the SYMM Working Group. With recent support of timesheets in FakeSmile, I thought it would be a good chance to experiment. Flickr Badges [...]]]></description>
			<content:encoded><![CDATA[<p><object type="image/svg+xml" width="100" height="100" align="right" hspace="10" data="http://codedread.com/clipart/smile.svgz"><span/></object>I&#8217;ve been watching David&#8217;s <a href="http://leunen.d.free.fr/fakesmile/" title="Animate Graphics and Text in Web Pages">FakeSmile</a> script evolve over the course of the last few months.  At the same time, I have been reading up on <a href="http://www.w3.org/TR/timesheets/" title="SMIL Timesheets">SMIL Timesheets</a>, a recent specification drafted by the <a href="http://www.w3.org/AudioVideo/">SYMM Working Group</a>.  With recent support of timesheets in FakeSmile, I thought it would be a good chance to experiment.  <span id="more-462"></span></p>
<h3 id="flickr-badges">Flickr Badges</h3>
<p><a href="http://www.flickr.com/">Flickr</a> is a pretty popular site for sharing photos with friends, family and the world.  Flickr even lets you embed &#8216;badges&#8217; of your recent or popular photos into your own web page using HTML or Flash.  Of course the Flash badge has some animation effects that are not easily achievable in HTML.  I thought I&#8217;d use FakeSmile + SVG to create my own badge.  I started with some backend code that <a href="http://www.latenightpc.com/blog/" title="Rob Russell's blog">Rob</a> has had kicking around in his repository for almost two years.</p>
<p><object align="right" type="image/svg+xml" width="75" height="150" hspace="20" data="http://www.codedread.com/flickr/badge.php"><span/></object>You can see the results to the right and also on my <a href="http://www.codedread.com/about.php" title="Jeff Schiller">personal info</a> page.  The badge has been tested in <a href="http://www.mozilla.com/firefox" title="Firefox web browser">Firefox</a>, <a href="http://www.opera.com/" title="Opera Web Browser">Opera</a> or <a href="http://www.apple.com/safari" title="Safari Web Browser for MacOSX and Windows">Safari</a>.  There seems to be some trouble with the <a href="http://www.examotion.com/index.php?id=product_player_download" title="SVG Plugin for Internet Explorer">Renesis 1.1 plugin</a> for Internet Explorer, so please stay tuned there.  The badge can be seen full-browser <a href="http://www.codedread.com/flickr/badge.php">here</a> (sorry for the low-quality rasters, I&#8217;m only grabbing 75&#215;75 pixel thumbnails from Flickr at the moment).</p>
<p>The images are cached from Flickr using a bit of <a href="http://php.net/">PHP</a> and the Flickr feed is checked every hour for new photos.  If you want to see the source of the PHP, please <a href="http://www.codedread.com/flickr/badge.php?view_source=1">click here</a>.</p>
<h3 id="smil-timesheets">SMIL Timesheets</h3>
<p><a href="http://my.opera.com/MacDev_ed/blog/2008/05/18/timetravel" title="Erik Dahlström's Opera blog">Others</a> have started experimenting with FakeSmile, too.  Usually the people that I talk to that have used <abbr title="Synchronized Multimedia Integration Language">SMIL</abbr> are pretty delighted with the technology.  It&#8217;s a shame that it&#8217;s not well-supported across modern browsers yet &#8211; perhaps it has something to do with the <a href="http://lists.w3.org/Archives/Public/www-smil/2008AprJun/">slow public response rate</a> of the SYMM Working Group? <img src='http://www.codedread.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>However, while Opera (and now <a href="http://webkit.org/">WebKit</a>) have started to support SMIL within <a href="http://www.w3.org/Graphics/SVG" title="Scalable Vector Graphics">SVG</a>, there are no browsers that support SMIL Timesheets yet.  So FakeSmile will have to do for now (<a href="http://www.tml.tkk.fi/~pv/timesheets/instructions.xhtml">here&#8217;s</a> another alternative that I have not experimented with).</p>
<p>You can think of SMIL Timesheets as the counterpart to <a href="http://www.w3.org/Style/CSS/" title="Cascading StyleSheets">CSS</a> for web pages.  If <a href="http://www.csszengarden.com/" title="CSS Zen Garden">stylesheets</a> are like the <em>set decoration</em> of your web page, then timesheets are like the <em>choreography</em>.  What&#8217;s really nice about this is that you can have a nice, concise bit of markup representing your content (the images, in this case) and then you can externally link to a separate timesheet to animate the web page.  You can use CSS selectors to apply animations to any of your web elements and use the same timesheet across multiple pages.  You can see my SMIL Timesheet <a href="http://www.codedread.com/flickr/flash.smil.txt">here</a>.</p>
<p>If anyone wants to send me a SMIL timesheet with other cool effects, please feel free (look for my email address <a href="http://www.codedread.com/about.php">here</a>).  Perhaps I&#8217;ll eventually have my PHP pick a random effect one day.</p>
<h3 id="fakesmile">FakeSmile</h3>
<p>The <a href="http://leunen.d.free.fr/fakesmile/">FakeSmile</a> script has come a long way since David released it a few months ago.  It implements a decent amount of SMIL and SMIL Timesheets so that you can actually use these technologies now while the browser vendors catch up.  David has also recently included a full version of <a href="http://jquery.com/">jQuery</a> inside the FakeSmile script, so it&#8217;s beefed up with lots of power now.  I think he will probably be releasing minimized/compressed versions eventually.</p>
<p><i>[Update:  I should also acknowledge <a href="http://www.alleged.org.uk/pdc/2006/01/01.html">Damian Cugley</a> for being the original inspiration behind Rob starting his project]</i></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codedread.com/blog/archives/2008/05/19/smile-zen-garden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fake Smile</title>
		<link>http://www.codedread.com/blog/archives/2008/03/16/fake-smile/</link>
		<comments>http://www.codedread.com/blog/archives/2008/03/16/fake-smile/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 04:10:43 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[smil]]></category>

		<guid isPermaLink="false">http://blog.codedread.com/archives/2008/03/16/fake-smile/</guid>
		<description><![CDATA[David Leunen has released a new JavaScript library to fake SMIL for modern browsers that do not yet support declarative animation (Firefox 3.0- and Safari 3.0-). The nice thing about this is that it uses existing standards, so that when Mozilla and WebKit finally implement SMIL, this script will avoid executing. On that day, suddenly [...]]]></description>
			<content:encoded><![CDATA[<p><object type="image/svg+xml" width="100" height="100" align="right" hspace="10" data="http://codedread.com/clipart/smile.svgz"><span/></object><a href="http://fakesmil.blogspot.com/">David Leunen</a> has released a new <a href="http://leunen.d.free.fr/fakesmile/" title="FakeSmile">JavaScript library</a> to fake <a href="http://www.w3.org/AudioVideo/" title="Synchronized Multimedia Integration Language">SMIL</a> for modern browsers that do not yet support declarative animation (Firefox 3.0- and Safari 3.0-).  The nice thing about this is that it uses existing standards, so that when Mozilla and WebKit finally implement SMIL, this script will avoid executing.  On that day, suddenly animations will become less processor-intensive.  I&#8217;m all about <a href="http://en.wikipedia.org/wiki/Progressive_enhancement">progressive enhancement</a>, but I&#8217;m also not above occasionally faking it a little to experiment with cool features.  <span id="more-440"></span></p>
<p>As with all experiments of late, you need a cool browser like <a href="http://www.opera.com/">Opera</a>, <a href="http://www.mozilla.org/firefox/">Firefox</a> or <a href="http://www.apple.com/safari">Safari</a> to see this stuff.  I&#8217;d be interested to hear if Konqueror 4.0 supports it.  Internet Explorer will just not do, I&#8217;m afraid.</p>
<p id="where-i-use-smil">I currently use SMIL in <a href="http://www.codedread.com/menu.svg">my menu</a> above, in the leering FakeSmile icon to the right <strike>(which I&#8217;ve inlined to see what happens when it gets aggregated in feed readers like <a href="http://intertwingly.net/code/venus/">Planet Venus</a>)</strike>, and now in my comment box when you focus and blur it.</p>
<p>Yes, this is just <abbr title="shits and giggles">shiggles</abbr> and not very productive &#8211; but I&#8217;m <a href="http://realtech.burningbird.net/design/having-ones-cake/">not alone</a> in experimenting with some advanced web features on my blog.</p>
<p>Yes, SMIL intermixes &#8220;presentational&#8221;-type markup with &#8220;content&#8221; markup &#8211; but <a href="http://www.w3.org/TR/2008/WD-timesheets-20080110/">SMIL Timesheets</a> looks to me like an attempt by the SYMM Working Group to address this.  Maybe something in the future for FakeSmile to support?</p>
<p>And yes, it&#8217;s kinda fun.  SMIL is the blink tag of the new millenium&#8230;</p>
<p>Oh, and in case you <a href="#where-i-use-smil">missed it</a> above, I&#8217;ve started using SMIL in my blog&#8217;s <a href="http://blog.codedread.com/?p=440&#038;preview=true#comment">comment</a> textarea &#8211; that&#8217;s XHTML, not SVG.  The FakeSmile library supports a limited subset of SMIL functionality in not just SVG content but on any attribute in a XML-based language (provided you properly namespace where required, like in XHTML):</p>
<div class="code">&#60;textarea rows=&#8221;5&#8243; &#8230;&#62;<br/><b>&#160;&#160;&#60;smil:animate attributeName=&#8221;rows&#8221; from=&#8221;5&#8243; to=&#8221;10&#8243; dur=&#8221;350ms&#8221; begin=&#8221;focus&#8221; end=&#8221;blur&#8221; fill=&#8221;freeze&#8221; /&#62;</b><br/>&#60;/textarea&#62;</div>
<p>That&#8217;s what makes XHTML so attractive to me &#8211; the X is for eXtensibility.  While I still support the effort, the <a href="http://esw.w3.org/topic/HTML/SVGInTextHTML">current HTML 5 activity</a> is mostly focused on SVG (and to a lesser extent MathML) integration with text/html.  I hope they do address more <a href="http://www.intertwingly.net/blog/2007/08/02/HTML5-and-Distributed-Extensibility">flexible extensibility</a> within HTML5 at a later date.  It would be great if someone had already done <a href="http://www.w3.org/TR/NOTE-HTMLplusTIME">HTML+SMIL</a> so there was some basis off which to work.  Snarkiness aside, I will admit to not understanding the ins-and-outs of namespaces within HTML and all the problems it poses, but I&#8217;m trying to learn in my spare time&#8230;</p>
<p>One semi-amusing footnote:  You won&#8217;t see the textarea expand when you focus it in Opera.  This is because Opera supports SMIL-in-SVG already, so the FakeSmile script is not executed (short-circuited).  It would be great if Opera went ahead with <a href="http://www.w3.org/TR/XHTMLplusSMIL/">XHTML+SMIL</a> support.  I&#8217;m not sure why that hasn&#8217;t happened yet&#8230;</p>
<p><i>[Update: David has fixed his library to allow Opera to use the library for XHTML+SMIL as well as interpolate between properties with units (i.e. 2em).]</i></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codedread.com/blog/archives/2008/03/16/fake-smile/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

