<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>chromasynthetic</title>
	
	<link>http://www.chromasynthetic.com/blog</link>
	<description>a blog about web design and development</description>
	<pubDate>Tue, 05 May 2009 19:35:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/chromasynthetic" type="application/rss+xml" /><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://my.feedlounge.com/external/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://static.feedlounge.com/buttons/subscribe_0.gif">Subscribe with FeedLounge</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.newsalloy.com/?rss=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://www.newsalloy.com/subrss3.gif">Subscribe with NewsAlloy</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.yourminis.com/subscribe.aspx?u=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://www.yourminis.com/images/addtoyourminisbadge.gif">Subscribe with Yourminis.com</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://download.attensa.com/app/get_attensa.html?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://www.attensa.com/blogs/attensa/WindowsLiveWriter/BadgeredintoBadges_10C02/attensa_feed_button5.gif">Subscribe with Attensa for Outlook</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://hub.netomat.net/account/account.autoSubscribe.jspa?urls=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://www.netomat.net/blogger/images/icon_netomat_feedbutton.gif">Subscribe with netomat Hub</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.flurry.com/pushRssFeed.do?r=fb&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="http://www.flurry.com/images/flurry_rss_logo2.gif">Subscribe with Flurry</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="https://intouch.particls.com/download/?mode=2&amp;feed=http%3A%2F%2Ffeeds.feedburner.com%2Fchromasynthetic" src="https://intouch.particls.com/resources/buttons/it-button2.gif">Subscribe with Particls</feedburner:feedFlare><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Learning jQuery 1.3 Review</title>
		<link>http://www.chromasynthetic.com/blog/learning-jquery-13-review/</link>
		<comments>http://www.chromasynthetic.com/blog/learning-jquery-13-review/#comments</comments>
		<pubDate>Tue, 05 May 2009 19:35:05 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chromasynthetic.com/blog/?p=216</guid>
		<description><![CDATA[I recently finished reading Learning jQuery 1.3 written by Jonathan Chaffer and Karl Swedberg, and while this version is merely a rewrite of an earlier edition, my review will be based on the book as a whole and will not compare differences. If you&#8217;re looking looking for that, try this review.
Being an intermediate jQuery user, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.chromasynthetic.com/blog/uploads/learningjquery13.gif" alt="Learning jQuery 1.3 Book Cover" title="Learning jQuery 1.3" width="100" height="123" class="size-full wp-image-218" style="float:left;margin:10px 20px 10px 0;border:solid 1px #000;padding:2px;" />I recently finished reading <a href="http://www.packtpub.com/learning-jquery-1.3/book/">Learning jQuery 1.3</a> written by Jonathan Chaffer and Karl Swedberg, and while this version is merely a rewrite of an earlier edition, my review will be based on the book as a whole and will not compare differences. If you&#8217;re looking looking for that, try <a href="http://godbit.com/article/learning-jquery-13">this review</a>.</p>
<p>Being an intermediate jQuery user, I found the book a bit too basic. It seems to be written mostly for beginners. With that being said, it is an excellent book for beginners. I was really impressed with the quality of the examples. The authors always keep in mind progressive enhancement and graceful degradation. They even mention event delegation! Those are a few topics I wish I knew about when I first started JavaScript development. They are good habits to get into.</p>
<p>Though you should probably have an understanding of JavaScript before learning jQuery, there is also some good material that applies to general JavaScript authoring, such as closures. I found the description of events pretty comprehensive as well.</p>
<p>Anyone will find useful the list of resources and plugins at the end of the book. Something missing from the jQuery plugin repository is a way to filter through bad plugins to find the good ones. The list of recommended plugins in this book is a good place to start.</p>
<p>If you&#8217;re a jQuery beginner, I highly recommend this book. If not, you might want to pass it up for something more advanced. Here is a <a href="http://www.packtpub.com/files/learning-jquery-1-3-sample-chapter-4-effects.pdf">sample chapter on effects</a> if you&#8217;d like to take a look</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=umZse7t966A:CroQUaE_UbY:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=umZse7t966A:CroQUaE_UbY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=umZse7t966A:CroQUaE_UbY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=umZse7t966A:CroQUaE_UbY:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=umZse7t966A:CroQUaE_UbY:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=umZse7t966A:CroQUaE_UbY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=umZse7t966A:CroQUaE_UbY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=umZse7t966A:CroQUaE_UbY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/chromasynthetic/~4/umZse7t966A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chromasynthetic.com/blog/learning-jquery-13-review/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Valerie 0.6</title>
		<link>http://www.chromasynthetic.com/blog/valerie-06/</link>
		<comments>http://www.chromasynthetic.com/blog/valerie-06/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 22:30:09 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chromasynthetic.com/blog/?p=213</guid>
		<description><![CDATA[I&#8217;m getting ready to release Valerie 0.6 (form generation/validation/filtering) and I could use some help testing it.
To get the latest code, check out trunk with svn: http://valerie.googlecode.com/svn/trunk/
None of the documentation is up to date in the docs folder, but the inline documentation is. There&#8217;s also a working demo to take a look at.
I&#8217;m particularly looking [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m getting ready to release Valerie 0.6 (form generation/validation/filtering) and I could use some help testing it.</p>
<p>To get the latest code, check out trunk with svn: http://valerie.googlecode.com/svn/trunk/</p>
<p>None of the documentation is up to date in the docs folder, but the inline documentation is. There&#8217;s also a working demo to take a look at.</p>
<p>I&#8217;m particularly looking for feedback on ease of use. Let me know what you think!</p>
<p>Related to a <a href="http://www.chromasynthetic.com/blog/generated-docs-with-code-illuminated/">previous post</a>, you can view <a href="http://www.chromasynthetic.com/dev/code-illuminated2/docs/docs.php">docs</a> generated from the inline documentation, but note that this is a work in progress and the location will definitely change once it&#8217;s ready to be released.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=2Ci-f42K33o:98elivIjF5U:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=2Ci-f42K33o:98elivIjF5U:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=2Ci-f42K33o:98elivIjF5U:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=2Ci-f42K33o:98elivIjF5U:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=2Ci-f42K33o:98elivIjF5U:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=2Ci-f42K33o:98elivIjF5U:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=2Ci-f42K33o:98elivIjF5U:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=2Ci-f42K33o:98elivIjF5U:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/chromasynthetic/~4/2Ci-f42K33o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chromasynthetic.com/blog/valerie-06/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JibberBook 2.3 Released</title>
		<link>http://www.chromasynthetic.com/blog/jibberbook-23-released/</link>
		<comments>http://www.chromasynthetic.com/blog/jibberbook-23-released/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 19:02:55 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[scripts]]></category>

		<category><![CDATA[2.3]]></category>

		<category><![CDATA[guestbook]]></category>

		<category><![CDATA[jibberbook]]></category>

		<guid isPermaLink="false">http://www.chromasynthetic.com/blog/?p=210</guid>
		<description><![CDATA[JibberBook 2.3 is out and contains a few bug fixes for xml storage and additional options, mostly for combating spam. Read the groups message for more information or download it.
Enjoy!
]]></description>
			<content:encoded><![CDATA[<p>JibberBook 2.3 is out and contains a few bug fixes for xml storage and additional options, mostly for combating spam. Read the <a href="http://groups.google.com/group/jibberbook/browse_thread/thread/b0931e9a4a8d96f8">groups message</a> for more information or <a href="http://code.google.com/p/jibberbook/downloads/detail?name=jibberbook-2.3.zip">download it</a>.</p>
<p>Enjoy!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=t2iIVU6ROJI:e7JicaUSGTc:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=t2iIVU6ROJI:e7JicaUSGTc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=t2iIVU6ROJI:e7JicaUSGTc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=t2iIVU6ROJI:e7JicaUSGTc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=t2iIVU6ROJI:e7JicaUSGTc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=t2iIVU6ROJI:e7JicaUSGTc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=t2iIVU6ROJI:e7JicaUSGTc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=t2iIVU6ROJI:e7JicaUSGTc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/chromasynthetic/~4/t2iIVU6ROJI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chromasynthetic.com/blog/jibberbook-23-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Generated Docs with Code Illuminated</title>
		<link>http://www.chromasynthetic.com/blog/generated-docs-with-code-illuminated/</link>
		<comments>http://www.chromasynthetic.com/blog/generated-docs-with-code-illuminated/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 16:21:51 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[scripts]]></category>

		<category><![CDATA[code-illuminated]]></category>

		<category><![CDATA[documentation]]></category>

		<category><![CDATA[generator]]></category>

		<category><![CDATA[geshi]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.chromasynthetic.com/blog/?p=204</guid>
		<description><![CDATA[I really like the documentation generated by Code Illuminated, but I don&#8217;t like the inline documentation format, which has to look something like this:

// ** {{{ App.addMenuItem() }}} **
//
// Adds a menu item to the {{{element}}} DOM node showing the {{{label}}}
// text.  If {{{urlOrCallback}}} is an URL, choosing the item causes a new
// window [...]]]></description>
			<content:encoded><![CDATA[<p>I really like the <a href="http://code-illuminated.googlecode.com/svn/trunk/index.html">documentation</a> generated by <a href="http://code.google.com/p/code-illuminated/">Code Illuminated</a>, but I don&#8217;t like the inline documentation format, which has to look something like this:</p>
<pre>
// ** {{{ App.addMenuItem() }}} **
//
// Adds a menu item to the {{{element}}} DOM node showing the {{{label}}}
// text.  If {{{urlOrCallback}}} is an URL, choosing the item causes a new
// window to be opened with that URL.  If it's a function, it will be called
// when choosing the item.
//
// If the node does not have a menu yet, one will be created.
</pre>
<p>I think this renders the inline documentation unreadable. <a href="http://www.naturaldocs.org/">Natural Docs</a> has a lot nicer format that would look like this:</p>
<pre>
/*
  Function: App.addMenu

  Adds a menu item to the element DOM node showing the label
  text.  If urlOrCallback is an URL, choosing the item causes a new
  window to be opened with that URL.  If it's a function, it will be called
  when choosing the item.

  If the node does not have a menu yet, one will be created.
*/
</pre>
<p>So I took Code Illuminated and made half of it into a PHP script so it wasn&#8217;t limited to same-domain ajax calls. I also added a very basic Natural Docs parser and a Markdown parser, code highlighting courtesy of <a href="http://www.google.com/url?sa=t&#038;source=web&#038;ct=res&#038;cd=1&#038;url=http%3A%2F%2Fqbnz.com%2Fhighlighter%2F&#038;ei=gc7cSYSePI7GM5WV9OYN&#038;usg=AFQjCNFTiD6zQPGcCZYMWxt5ljSbs1iFHg&#038;sig2=Fm3bMYmsByuokc5gBLeTdQ">GeSHi</a>, and caching. Here&#8217;s a <a href="http://www.chromasynthetic.com/dev/code-illuminated2/docs/docs.php">demo</a>. It&#8217;s nothing special right now and needs a lot more work. In particular, I need a full-fledged Natural Docs parser in PHP. Anyone have one handy?</p>
<p>Is anyone interested in this? I&#8217;ll be using it for JibberBook documentation, but I don&#8217;t know if I&#8217;ll release it unless there&#8217;s an interest in it.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=261wafEqJIU:2uVC9MApJTI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=261wafEqJIU:2uVC9MApJTI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=261wafEqJIU:2uVC9MApJTI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=261wafEqJIU:2uVC9MApJTI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=261wafEqJIU:2uVC9MApJTI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=261wafEqJIU:2uVC9MApJTI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=261wafEqJIU:2uVC9MApJTI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=261wafEqJIU:2uVC9MApJTI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/chromasynthetic/~4/261wafEqJIU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chromasynthetic.com/blog/generated-docs-with-code-illuminated/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Emenu, a jQuery plugin</title>
		<link>http://www.chromasynthetic.com/blog/emenu-a-jquery-plugin/</link>
		<comments>http://www.chromasynthetic.com/blog/emenu-a-jquery-plugin/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 23:04:05 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[scripts]]></category>

		<category><![CDATA[jquery]]></category>

		<category><![CDATA[mootools]]></category>

		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.chromasynthetic.com/blog/?p=196</guid>
		<description><![CDATA[I suppose since I&#8217;ve given up MooTools, I&#8217;d get more familiar with jQuery, which I&#8217;ve used primarily for work. And what better way to do that than to port one of my Mootools plugins to jQuery! You can find it in the jQuery plugin repository.
I made it more flexible than the original because now you [...]]]></description>
			<content:encoded><![CDATA[<p>I suppose since I&#8217;ve <a href="http://www.chromasynthetic.com/blog/goodbye-mootools/">given up MooTools</a>, I&#8217;d get more familiar with jQuery, which I&#8217;ve used primarily for work. And what better way to do that than to port <a href="http://www.chromasynthetic.com/blog/elegant-menu-mootools-plugin/">one of my Mootools plugins</a> to jQuery! You can find it in the <a href="http://plugins.jquery.com/project/emenu">jQuery plugin repository</a>.</p>
<p>I made it more flexible than the original because now you can use whatever effect you want. There are four custom events that I&#8217;ve added, and here are the defaults:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#containerId'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">emenu</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  over<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #339933;">,</span> bg<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    bg.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeTo</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">400</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
  out<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #339933;">,</span> bg<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    bg.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeTo</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">400</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
  show<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #339933;">,</span> ul<span style="color: #339933;">,</span> li<span style="color: #339933;">,</span> width<span style="color: #339933;">,</span> height<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    ul.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'visibility'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'visible'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeTo</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">200</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
  hide<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #339933;">,</span> ul<span style="color: #339933;">,</span> li<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    ul.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeTo</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">200</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      ul.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'visibility'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'hidden'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>There are three ways to add your own. You can overwrite them like above by passing in your own or you can do <code>$.fn.emenu.defaults.[event] = function(){&#8230;}</code>. Plus since they are custom events attached to the container, you can also do <code>$("#containerId").bind('emenu.[event]&#8216;, function(){&#8230;})</code>. Keep in mind this won&#8217;t overwrite the defaults unless you unbind them first.</p>
<p>The custom events receive a few arguments worth explaining.The events <code>over</code> and <code>out</code> receive the div element that contains non-menu-related content; <code>show</code> and <code>hide</code> receive the item menu moused over/out and its submenu. Additionally, <code>show</code> receives the height of the menu and the width of the submenu if you&#8217;ve used auto-calculation.</p>
<p>There&#8217;s a demo and additional options listed on the <a href="http://plugins.jquery.com/project/emenu">plugin page</a>.</p>
<p>I think I&#8217;ll be working on converting my other scripts to jQuery as well so keep an eye out for them!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=a0Hvom8qPzg:ycgRkduzv_M:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=a0Hvom8qPzg:ycgRkduzv_M:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=a0Hvom8qPzg:ycgRkduzv_M:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=a0Hvom8qPzg:ycgRkduzv_M:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=a0Hvom8qPzg:ycgRkduzv_M:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=a0Hvom8qPzg:ycgRkduzv_M:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=a0Hvom8qPzg:ycgRkduzv_M:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=a0Hvom8qPzg:ycgRkduzv_M:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/chromasynthetic/~4/a0Hvom8qPzg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chromasynthetic.com/blog/emenu-a-jquery-plugin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Goodbye MooTools</title>
		<link>http://www.chromasynthetic.com/blog/goodbye-mootools/</link>
		<comments>http://www.chromasynthetic.com/blog/goodbye-mootools/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 02:21:52 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[news]]></category>

		<category><![CDATA[goodbye]]></category>

		<category><![CDATA[mootools]]></category>

		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://www.chromasynthetic.com/blog/?p=191</guid>
		<description><![CDATA[I&#8217;m sure you&#8217;ve encountered Sizzle in one way or another. Sizzle is John Resig&#8217;s (of jQuery fame) new library-independent selector engine that&#8217;s supposed to be the fastest around. What&#8217;s going on now is major js libraries are planning (or at least looking at the possibility) to replace their own selector engines with Sizzle. According to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure you&#8217;ve encountered <a href="http://github.com/jeresig/sizzle/tree/master">Sizzle</a> in one way or another. Sizzle is John Resig&#8217;s (of jQuery fame) new library-independent selector engine that&#8217;s supposed to be the fastest around. What&#8217;s going on now is major js libraries are planning (or at least looking at the possibility) to replace their own selector engines with Sizzle. According to the link jQuery, MochiKit, Prototype, and Dojo are all jumping on the bandwagon.</p>
<p>Where does <a href="http://mootools.net/">MooTools</a> come in to this? The lead developer&#8217;s <a href="http://mootools.net/blog/2008/12/04/sizzle/">official response</a>. To me, it sounds overly defensive and rude. And when I <a href="http://mootools.net/blog/2008/12/04/sizzle/#comment-87">suggested</a> he reword a blanket statement, I got an equally <a href="http://mootools.net/blog/2008/12/04/sizzle/#comment-89">rude response</a> from another developer. Did I say something wrong?</p>
<p>If this were the first time it happened, I&#8217;d be ok with it, but I&#8217;ve been with MooTools since the MooFx days, and they&#8217;ve never been nice to the community. I&#8217;ve seen it expressed multiple times that MooTools is for their own (the developer&#8217;s) use and they just put it out there for other people to use if they so desire. They don&#8217;t care about the community, and I&#8217;ve found this proven by their actions time and again, and this time, I&#8217;ve had enough.</p>
<p>Anyone remember when the jQuery site got <a href="http://blog.jquery.com/2008/08/29/jquerycom-site-redesign/">redesigned</a> with the javascript rockstar? Remember how quickly it was <a href="http://blog.jquery.com/2008/08/29/death-to-javascript-rock-stars/">removed</a> based on user feedback? If you don&#8217;t like jQuery as a library, you definitely have to respect their attention to the community. Now here&#8217;s the opposite response. MooTools 1.2 was released, and with that release, the forum was removed. There was no prior warning and it was weeks before we had any official word on what happened to it. Understandably, a lot of the community was upset. If I had discovered MooTools in that state, I would not have adopted it, but even after that, I stuck with MooTools hoping they would get better at interacting with the community.</p>
<p>But they haven&#8217;t. I don&#8217;t know if Valerio just doesn&#8217;t have good people skills or if he&#8217;s really a jerk or both, but I think MooTools could benefit from a PR person (and I&#8217;ve told them this), but it&#8217;s too late for me.</p>
<p>For the record, I think MooTools should stick with it&#8217;s own selector engine, and I think MooTools is the best library for a majority of my needs, which is why I&#8217;ve waited so long to ditch it. I just can&#8217;t stand behind it anymore. Farewell, MooTools. Let me know if you ever decide to care about the community you should be fostering.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=T43SbTRiwjM:JWzpnlq9jjo:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=T43SbTRiwjM:JWzpnlq9jjo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=T43SbTRiwjM:JWzpnlq9jjo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=T43SbTRiwjM:JWzpnlq9jjo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=T43SbTRiwjM:JWzpnlq9jjo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=T43SbTRiwjM:JWzpnlq9jjo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=T43SbTRiwjM:JWzpnlq9jjo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=T43SbTRiwjM:JWzpnlq9jjo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/chromasynthetic/~4/T43SbTRiwjM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chromasynthetic.com/blog/goodbye-mootools/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Extending MooTools is Easy!</title>
		<link>http://www.chromasynthetic.com/blog/extending-mootools-is-easy/</link>
		<comments>http://www.chromasynthetic.com/blog/extending-mootools-is-easy/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 19:54:14 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[web development]]></category>

		<category><![CDATA[cross-library]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[jquery]]></category>

		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://www.chromasynthetic.com/blog/?p=183</guid>
		<description><![CDATA[I&#8217;d never attempted to extend MooTools before, but while trying to make its api a little more similar to jQuery, I found out it&#8217;s rather simple. I like how jQuery has a function for each event like $(el).click(fn). A lot prettier than $(el).addEvent('click', fn). After digging around in MooTools a bit, I figured out how [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d never attempted to extend MooTools before, but while trying to make its api a little more similar to jQuery, I found out it&#8217;s rather simple. I like how jQuery has a function for each event like <code>$(el).click(fn)</code>. A lot prettier than <code>$(el).addEvent('click', fn)</code>. After digging around in MooTools a bit, I figured out how to do that in 10 lines:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>events<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> methods <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> event <span style="color: #000066; font-weight: bold;">in</span> events<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ev<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            methods<span style="color: #009900;">&#91;</span>ev<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>fn<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>fn<span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span>ev<span style="color: #339933;">,</span> fn<span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">fireEvent</span><span style="color: #009900;">&#40;</span>ev<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    Native.<span style="color: #660066;">implement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>Element<span style="color: #339933;">,</span> Window<span style="color: #339933;">,</span> Document<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> methods<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>Element.<span style="color: #660066;">NativeEvents</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I can also use <code>$(el).click()</code> to trigger the click event just like jQuery.</p>
<p>Next, let&#8217;s say I like $(document).ready(fn) better than window.addEvent(&#8217;domready&#8217;, fn). Just do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Document.<span style="color: #660066;">implement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    ready<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>fn<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        window.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'domready'</span><span style="color: #339933;">,</span> fn<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And finally, while this is purely aesthetics, I like $(el).is(selector) better than $(el).match(selector). Internally MooTools uses alias() to assign the same function multiple names so I can do that too like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Element.<span style="color: #660066;">alias</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'match'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'is'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>With these changes I can now use this code with MooTools:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">document.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'myLink'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> e.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And combined with some simple wrappers for jQuery, this is also valid jQuery code.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=7B9YtPlDVE0:PAguqkwlcJ0:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=7B9YtPlDVE0:PAguqkwlcJ0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=7B9YtPlDVE0:PAguqkwlcJ0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=7B9YtPlDVE0:PAguqkwlcJ0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=7B9YtPlDVE0:PAguqkwlcJ0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=7B9YtPlDVE0:PAguqkwlcJ0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=7B9YtPlDVE0:PAguqkwlcJ0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=7B9YtPlDVE0:PAguqkwlcJ0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/chromasynthetic/~4/7B9YtPlDVE0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chromasynthetic.com/blog/extending-mootools-is-easy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Writing Cross-Library JavaScript</title>
		<link>http://www.chromasynthetic.com/blog/writing-cross-library-javascript/</link>
		<comments>http://www.chromasynthetic.com/blog/writing-cross-library-javascript/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 02:26:16 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[web development]]></category>

		<category><![CDATA[cross-library]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.chromasynthetic.com/blog/?p=180</guid>
		<description><![CDATA[In my recent quest to write cross-library JavaScript, I&#8217;ve come up with a few different methods. Some of these can be found in the wild and some are obvious, but here we go.
Writing POJS (plain old JavaScript)
This is probably the most obvious, but least optimal, solution. Just write code that doesn&#8217;t use a library. The [...]]]></description>
			<content:encoded><![CDATA[<p>In my recent quest to write cross-library JavaScript, I&#8217;ve come up with a few different methods. Some of these can be found in the wild and some are obvious, but here we go.</p>
<h3>Writing POJS (plain old JavaScript)</h3>
<p>This is probably the most obvious, but least optimal, solution. Just write code that doesn&#8217;t use a library. The down-side is that you can&#8217;t take advantage of what&#8217;s available to you resulting in re-inventing the wheel and a larger code base. The biggest plus of using this method is portability as it isn&#8217;t dependent on anything else.</p>
<p>As far as examples go, there aren&#8217;t any specific ones since it&#8217;s hard to tell if the author didn&#8217;t use a library to increase portability or compatibility, but <a href="http://www.datejs.com/">date.js</a> is a useful library that benefits from that portability.</p>
<h3>Detect Libraries</h3>
<p>This second method is similar to detecting browsers and writing browser specific code, and that is detecting which library is being used and writing code specific to that library&#8217;s syntax. While you don&#8217;t necessarily have to re-invent the wheel, you have to duplicate code logic for each library. Also, when introducing dependencies you introduce more potential bugs. When a new library comes out, more code will need to be written to support that library.</p>
<p>I&#8217;ve found this technique being used in <a href="http://beebole.com/pure/">PURE</a>, and you can find one of the down-sides at work. It just recently gained support for its second library (even though from the beginning it was planned to support multiple libraries).</p>
<h3>Adapter</h3>
<p>This last technique involves creating your own API and writing adapters or wrappers for each library and its functionality. This method sort of combines the benefits of the previous two in that you can take advantage of existing code while keeping repeated logic out of your core code.</p>
<p><a href="http://extjs.com/">Ext JS</a> is a good example of this. Not only does it have adapters for YUI, jQuery, and Prototype, but it also has it&#8217;s own adapter if you&#8217;re not using a library, effectively combining the first and third methods. Ext JS enjoys maximum portability, while keeping the core code small, but this combined method requires the most work.</p>
<h3>My Vision</h3>
<p>I&#8217;d like to see a cross-library library of sorts. Including this library would automatically load an adapter for a previously included library that it detects or load its own core code if one is not found. This would provide a common API to build your code on and make the library used transparent to you. To take it a step further, it could also provide any functionality not provided in your library of choice.</p>
<p>Are you aware of any other solutions?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=EnO4P81N30k:RZI354EVSxI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=EnO4P81N30k:RZI354EVSxI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=EnO4P81N30k:RZI354EVSxI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=EnO4P81N30k:RZI354EVSxI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=EnO4P81N30k:RZI354EVSxI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=EnO4P81N30k:RZI354EVSxI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=EnO4P81N30k:RZI354EVSxI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=EnO4P81N30k:RZI354EVSxI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/chromasynthetic/~4/EnO4P81N30k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chromasynthetic.com/blog/writing-cross-library-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>BarCamp Milwaukee 3!</title>
		<link>http://www.chromasynthetic.com/blog/barcamp-milwaukee-3/</link>
		<comments>http://www.chromasynthetic.com/blog/barcamp-milwaukee-3/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 22:21:57 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[web development]]></category>

		<category><![CDATA[barcamp]]></category>

		<category><![CDATA[barcampmilwaukee3]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.chromasynthetic.com/blog/?p=169</guid>
		<description><![CDATA[I&#8217;m back from BarCamp Milwaukee 3, and while it wasn&#8217;t the greatest, it was interesting and definitely worth it. I just wish there were more JavaScripters there. I was on a panel for a JavaScript discussion and only two other people showed up. Not enough for a nice discussion  
But hanging out at BarCamp [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m back from <a href="http://barcampmilwaukee.com/">BarCamp Milwaukee 3</a>, and while it wasn&#8217;t the greatest, it was interesting and definitely worth it. I just wish there were more JavaScripters there. I was on a panel for a JavaScript discussion and only two other people showed up. Not enough for a nice discussion <img src='http://www.chromasynthetic.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>But hanging out at BarCamp really makes me want to start a web/tech community here in Manitowoc. I haven&#8217;t figured out the first step yet. There aren&#8217;t any groups to hook up locally (and I&#8217;d really like it to be local). I&#8217;ll probably have to hit up the colleges around here, maybe organize something with Silver Lake College (my alma mater).</p>
<p>Anyway, here I am introducing myself:<br />
<a style="border:0;" href="http://www.flickr.com/photos/johndecember/2914155414/" title="mke-2008-10-04a 468 by johndecember, on Flickr"><img style="border-color:#666;" src="http://farm4.static.flickr.com/3105/2914155414_d0efb3ef2c.jpg" width="500" height="333" alt="mke-2008-10-04a 468" /></a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=e5xlWPr9Vu0:WrO1oAfLY00:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=e5xlWPr9Vu0:WrO1oAfLY00:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=e5xlWPr9Vu0:WrO1oAfLY00:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=e5xlWPr9Vu0:WrO1oAfLY00:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=e5xlWPr9Vu0:WrO1oAfLY00:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=e5xlWPr9Vu0:WrO1oAfLY00:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=e5xlWPr9Vu0:WrO1oAfLY00:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=e5xlWPr9Vu0:WrO1oAfLY00:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/chromasynthetic/~4/e5xlWPr9Vu0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chromasynthetic.com/blog/barcamp-milwaukee-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JibberBook 2.2 Released</title>
		<link>http://www.chromasynthetic.com/blog/jibberbook-22-released/</link>
		<comments>http://www.chromasynthetic.com/blog/jibberbook-22-released/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 15:56:10 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[scripts]]></category>

		<category><![CDATA[guestbook]]></category>

		<category><![CDATA[jibberbook]]></category>

		<guid isPermaLink="false">http://www.chromasynthetic.com/blog/?p=167</guid>
		<description><![CDATA[JibberBook 2.2 has been released. Not too much new. There are now 15 different languages available (wow!) and there&#8217;s flood control to prevent spammers from posting multiple comments. Over all it should be more stable.
This marks the last feature release for JibberBook 2. Next up is JibberBook 3, a complete rewrite to make it a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/jibberbook/">JibberBook 2.2</a> has been released. Not too much new. There are now 15 different languages available (wow!) and there&#8217;s flood control to prevent spammers from posting multiple comments. Over all it should be more stable.</p>
<p>This marks the last feature release for JibberBook 2. Next up is JibberBook 3, a complete rewrite to make it a more flexible commenting system. Anybody want to help?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=m2CXUXVs8nk:8gxCPOYM4NI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=m2CXUXVs8nk:8gxCPOYM4NI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=m2CXUXVs8nk:8gxCPOYM4NI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=m2CXUXVs8nk:8gxCPOYM4NI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=m2CXUXVs8nk:8gxCPOYM4NI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=m2CXUXVs8nk:8gxCPOYM4NI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?i=m2CXUXVs8nk:8gxCPOYM4NI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/chromasynthetic?a=m2CXUXVs8nk:8gxCPOYM4NI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/chromasynthetic?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/chromasynthetic/~4/m2CXUXVs8nk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chromasynthetic.com/blog/jibberbook-22-released/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
