<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2" -->
<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/"
	>

<channel>
	<title>Hawksworx</title>
	<link>http://www.hawksworx.com/journal</link>
	<description>Ramblings</description>
	<pubDate>Tue, 27 Jul 2010 21:30:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2</generator>
	<language>en</language>
			<item>
		<title>Hitched!</title>
		<link>http://www.hawksworx.com/journal/2010/07/27/hitched/</link>
		<comments>http://www.hawksworx.com/journal/2010/07/27/hitched/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 21:30:03 +0000</pubDate>
		<dc:creator>PhilHawksworth</dc:creator>
		
		<category><![CDATA[personal]]></category>

		<category><![CDATA[announcements]]></category>

		<guid isPermaLink="false">http://www.hawksworx.com/journal/2010/07/27/hitched/</guid>
		<description><![CDATA[

After more than 14 wonderful years with my girlfriend, Verity, last weekend we finally tied the knot.

It&#8217;s hard to put into words just how excited I was to finally get to enjoy our wedding day with so many of our family and friends and there is a risk that this post could become a sprawling [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/philhawksworth/4835043849/" title="Pronounced by Phil Hawksworth, on Flickr"><img src="http://farm5.static.flickr.com/4091/4835043849_c386f0672a.jpg" alt="Pronounced" /></a></p>

<p>After more than 14 wonderful years with my girlfriend, Verity, last weekend we finally tied the knot.</p>

<p>It&#8217;s hard to put into words just how excited I was to finally get to enjoy our wedding day with so many of our family and friends and there is a risk that this post could become a sprawling gush-a-thon. I&#8217;ll try not to do that. You can take my gushing and delight as read. I do want to take a moment to acknowledge the effort that so many people put into making our day so fabulous though, and perhaps mention a few highlights.</p>

<p>Verity and I were married in the lovely little <a href="http://www.flickr.com/photos/psd/4804940489/in/set-72157624404129727/" title="St Leonard's on Flickr - Photo Sharing!">church</a> in Horringer near Bury St Edmunds before a reception at the <a href="http://www.ickworthwestwing.co.uk/" title="The West Wing at Ickworth">West Wing at Ickworth House</a>. I was surprised at how my nerves didn&#8217;t really manage to rise too much while I was waiting at the church but the fun of greeting dear family and friends as they arrive with huge smile on their faces seems to chase the butterflies away. The downside of that is that (just as everyone had advised me) the time was flying by before I had realised the day had even begun.</p>

<p>A running joke among our friends is how Verity is often late to social engagements, so there was a lot of banter around how long she would keep me waiting. Happily, she was only a fashionable 10 minutes late (or so I&#8217;m told, I was too busy soaking up the atmosphere to start looking at my watch). In that time I was incredibly well supported and attended by my best man, my brother Stephen.  A quick tip - a best man who has already been through a wedding of his own has some great little insights which can really help as you arrive at the church and prepare for your big moment.</p>

<p>Nothing, however, prepared me for the moment I saw Verity arrive at the church and make her way up the aisle towards me. Breathtaking.</p>

<p>From my vantage point, the ceremony seemed to be fun and spirited while being sincere and weighty. A difficult balance to strike so I was delighted with how well Rev Sue Nutt did. She made it really enjoyable. It also helps that when you turn and glance around at the congregation, you see nothing but the beaming faces of friends and family. (&#8230;and I said I wouldn&#8217;t gush!). We had memorable readings from Verity&#8217;s brother Mark, sister-in-law Faith (ably assisted by niece and nephew Molly and Stan), and my sister Claire. All of which had special and poignant moments for both Verity and I.</p>

<p><a href="http://www.flickr.com/photos/philhawksworth/4835046609/" title="Departing by Phil Hawksworth, on Flickr"><img src="http://farm5.static.flickr.com/4086/4835046609_c4614b652a.jpg" alt="Departing" /></a></p>

<p>The sun came out to welcome us out of the church and we spent quite a few happy moments chatting to everyone on the green before climbing into a carriage, feeling like royalty, for the short journey up to Ickworth House where we were greeted by our lovely <a href="http://www.flickr.com/photos/psd/4804975779/in/photostream/" title="Master of the Toast on Flickr">Toastmaster</a>, Colin.  Colin really helped to keep things running roughly to schedule and looked like quite the bobby dazzler.</p>

<p>The next part of the day went by in the blink of an eye.  We had our group photos taken in the grounds of the West Wing. Meanwhile a local brass band provided some music while the canapes were supplemented by an <a href="http://www.icicletricycle.co.uk/" title="Icicle Tricycle">ice cream bike</a> serving ice cream to the kids (and the adults).  I would have loved to spend a good long time mingling at this point, but this was our time to gather groups for the photos. Our awesome ushers did a great job of that, which helped keep things moving quickly.</p>

<p><a href="http://www.flickr.com/photos/philhawksworth/4828174104/" title="With my best man and ushers by Phil Hawksworth, on Flickr"><img src="http://farm5.static.flickr.com/4119/4828174104_0f22ef2a4c.jpg" alt="With my best man and ushers" /></a></p>

<p>When looking for a photographer, I was quite specific about the kind of style and quality that I was looking for.  Being a little less organised than I would have liked meant that we didn&#8217;t find quite what we were looking for in the area and so widened the search a little. At the time of writing, we&#8217;ve only seen a few <a href="http://www.barriedownie.com/index.php/wedding-photography/verity-phils-wedding-at-ickworth-house-suffolk/" title="Verity &amp; Phil&#8217;s wedding at Ickworth House Suffolk &raquo; wedding and portrait photographer London, Sussex, Surrey, Hampshire">sneaky peeks</a> at the photos, but the signs are really good. We couldn&#8217;t have been happier with the friendly and talented <a href="http://www.barriedownie.com/" title="Barrie Downie photography">Barrie Downie</a> who directed us really well, clearly loved his job and has an amazing eye.  It never felt like Barrie was dominating the proceedings and was really sensitive to what was important to us.</p>

<p>While I&#8217;m talking about people who did an amazing job for us, we were just delighted with our florist, Zoe Mills. Zoe is from the area and operates under the great name of <a href="http://millsandbloom.com/" title="Mills and Bloom - Florists based in Diss, Norfolk, UK">Mills and Bloom</a>.  Zoe was just fantastic and we&#8217;d eagerly recommend her. She seemed genuinely excited for us and about the details of the <a href="http://www.flickr.com/photos/psd/4805581012/in/set-72157624404129727/" title="Bouquet on Flickr">flowers</a> as they developed.  That kind of excitement and calm in the run up to the day was really helpful and energising for us.  She carefully listened to all of our requests and added her own insights and considerable knowledge to really bring things to life. Thanks Zoe!</p>

<p>Castleton Brass, the <a href="http://www.icicletricycle.co.uk/" title="Icicle Tricycle">Icicle Tricycle</a> and the staff at Ickworth House were all wonderfully helpful and friendly.</p>

<p>With guests seated and ready for some grub, Verity and I got to make our entrance and make our way to our seats to loud applause.  Having <strike>gobby</strike> enthusiastic friends guarantees you a generous and exciting entrance. It. Was. Awesome.</p>

<p>We opted to have our speeches before we ate, which certainly helped me enjoy my food all the more without my nerves mounting as the moment approached. As it turns out, far from being particularly nervous at this point, I was actually more excited to get the chance to thank everyone and say some things that were important to me.  I firmly believe that you can&#8217;t get a warmer, more receptive audience than at your wedding and you can&#8217;t go far wrong as the groom if you are just sincere. It felt wonderful.  My father-in-law, Keith gave an excellent, warm speech which got me settled for mine. My brother Stephen gave an absolutely remarkable best man speech which he set up and delivered entirely as rhyming couplets. Full of moments to make me cringe, everyone laugh, and many of us cry it was, frankly, legendary.</p>

<p>The food was followed by drinking, chatting and dancing. All of which went by too quickly. Verity and I opted for a combination of a home made playlist (the contents of which had been largely crowd-sourced from all of the guests) to provide some quality, wedding-grade cheese, and a live band to provide some funk.  My good friend Nigel plays the bass in an excellent band called <a href="http://www.clubsoulband.com/" title="Club Soul // London's hottest Funk / Soul / Jazz act for your event">Club Soul</a> who were absolutely amazing and packed the dance floor immediately and for the duration. Another hearty recommendation.</p>

<p><a href="http://www.flickr.com/photos/psd/4806337288/" title="Dancing by psd, on Flickr"><img src="http://farm5.static.flickr.com/4099/4806337288_5f467bc362.jpg" alt="Dancing" /></a></p>

<p>Another detail which was important to us was that ours should be a child friendly wedding. So many of our friends have young kids now and our family has grown over the years to include kids and teenagers of all ages who we couldn&#8217;t imagine the day without. We debated for a while about whether or not a creche service, which had been recommended to us, would be worth the effort. I argued that people might not want their kids vanishing into the adjoining room to be monitored by strangers, and that they might feel like their kids weren&#8217;t being included. Verity thought that many people would find it useful and that having the option would give several of our important friends the opportunity to spend more time celebrating with us, and prolong their evening.  Boy oh boy, was Verity right!  We used a group called <a href="http://www.artfullsplodgers.com/award-winning-creche.html" title="A totally stress free wedding with a creche from Artfull Splodgers">Artful Splodgers</a> who did a fantastic job. Kids of all ages were being entertained with all manor of crafts and activities and they were totally engaged. Several of our friends gave us enthusiastic hugs and thanks specifically for the creche which worked perfectly. For a wedding which had so very many children in attendance, there was no disruption during the speeches, no drama from anyone getting &#8220;over tired&#8221; and yet we got to enjoy the company of lots of excited kids who were keen to show us the latest things that they had made. Yet another recommendation!</p>

<p>All too soon, the night wound to an end and after saying some emotional goodbyes, we retired to the <a href="http://www.theangel.co.uk/" title="The Angel Hotel, Suffolk">Angel Hotel</a> in Bury St Edmunds with a handful of friends who were also staying there. We, the final few, chatted away over a bottle or two of fizz until well into the early hour before our eyelids got too heavy to manage.</p>

<p><a href="http://www.flickr.com/photos/philhawksworth/4826256489/" title="Sunrise over the Abbey Gate by Phil Hawksworth, on Flickr"><img src="http://farm5.static.flickr.com/4117/4826256489_203431d408.jpg" alt="Sunrise over the Abbey Gate" /></a></p>

<p>Verity and finally came to terms with the fact that we wrung every last drop out of the day and headed for bed around 4am and spent the next hour sitting in the window of the hotel watching the sun rise over Bury St Edmunds&#8217; Abbey Gate excitedly recounting the day. I think that we&#8217;ll be boring people with details, highlights and <a href="http://www.flickr.com/photos/tags/pvwed/" title="Flickr photos tagged 'pvwed'">photos</a> for a very, very long time to come.</p>

<p><a href="http://www.flickr.com/photos/philhawksworth/4827191797/" title="Married by Phil Hawksworth, on Flickr"><img src="http://farm5.static.flickr.com/4119/4827191797_e588ff3245_o.png" alt="Married" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hawksworx.com/journal/2010/07/27/hitched/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nodejs. I just have to use it for something.</title>
		<link>http://www.hawksworx.com/journal/2010/02/15/nodejs-i-just-have-to-use-it-for-something/</link>
		<comments>http://www.hawksworx.com/journal/2010/02/15/nodejs-i-just-have-to-use-it-for-something/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 22:37:43 +0000</pubDate>
		<dc:creator>PhilHawksworth</dc:creator>
		
		<category><![CDATA[jquery]]></category>

		<category><![CDATA[twitter]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[mash-ups]]></category>

		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.hawksworx.com/journal/2010/02/15/nodejs-i-just-have-to-use-it-for-something/</guid>
		<description><![CDATA[

A little while ago, inspired by Simon Willison&#8217;s demo of Nodejs at the 
FullFrontal conference, I felt the urge to make something, anything, using Nodejs.

Nodejs gives lightening fast, event driven IO with Javascript running server-side in the rather nippy V8 Javascript engine. Until Nodejs, I 
hadn&#8217;t seen much need to bring Javascript to the server [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.hawksworx.com/journal/wp-content/uploads/2010/02/nodejs.png' alt='nodejs.org' /></p>

<p>A little while ago, inspired by <a href="http://simonwillison.net/2009/Nov/23/node/">Simon Willison</a>&#8217;s demo of <a href="http://nodesjs.org">Nodejs</a> at the 
<a href="http://2009.full-frontal.org/">FullFrontal</a> conference, I felt the urge to make something, anything, using Nodejs.</p>

<p><a href="http://nodesjs.org">Nodejs</a> gives lightening fast, event driven IO with Javascript running server-side in the rather nippy <a href="http://code.google.com/p/v8/">V8</a> Javascript engine. Until <a href="http://nodesjs.org">Nodejs</a>, I 
hadn&#8217;t seen much need to bring Javascript to the server other than for 
testing and as a bit of a novelty.</p>

<p><a href="http://nodesjs.org">Nodejs</a> changed all of that. Built by <a href="http://tinyclouds.org/">Ryah Dahl</a> with a strict philosophy that none of its procedures should ever perform a blocking operation, it has a single threaded architecture and relies heavily on the use of a single event loop.  Anyone with a good knowledge of 
Javascript or even just a familiarity with <a href="http://jquery.com">jQuery</a> will be familiar with the pattern of event handlers, callbacks and closures needed to build some really rather powerful things, quickly and easily with <a href="http://nodesjs.org">Nodejs</a>.</p>

<p>For my part, I just wanted to make something to explore the ease in which <a href="http://nodesjs.org">Nodejs</a> could support comet-style long polling for some real-time, collaborative task. The Web is already getting flooded with examples of <a href="http://chat.nodejs.org/">chat rooms</a> and IRC servers built with <a href="http://nodesjs.org">Nodejs</a>, but I really wanted to make something that felt like a real web application, not an example.</p>

<p>To that end, I resurrected an old idea which I first built circa 1999 for randomly choosing someone from a list to make the tea. Not earth-shattering, but a bit of fun and simple enough for me to see through to completion.  For this incarnation, dubbed <a href="http://teafr.com">Teafr.com</a>, I piggybacked on the lists 
feature of <a href="http://twitter.com/philhawksworth/tea-buddies">Twitter</a> to allow people to create and manage their lists of potential tea-makers somewhere they are already comfortable. <a href="http://teafr.com">My app</a> would allow a user to recall a list of their choosing and then perform a lottery, selecting a winner (or loser) from the list at random.  To add a little suspense (in the loosest possible sense) I added a basic animation which gradually got slower until the winner was revealed.</p>

<p><a href='http://teafr.com' title='teafr.com'><img src='http://www.hawksworx.com/journal/wp-content/uploads/2010/02/teafr-tea-rotas-from-twitter-lists.png' alt='teafr.com' /></a></p>

<p>I captured a couple of <a href="http://www.vimeo.com/8144420">videos</a> showing teafr.com doing its stuff, <a href="http://www.vimeo.com/8457609">one of them</a> on an iPhone.</p>

<p>The fun part of this for me was in allowing this lottery and the animation to be visible to everyone viewing the same list from wherever they are.  <a href="http://nodesjs.org">Nodejs</a> makes it trivially simple to handle long-lived http requests so that all clients could listen out for the initiation of a new lottery event. Since this is all just lightweight HTTP, HTML, CSS and Javascript, it also runs pretty nicely on both my iPhone and Palm Pre. It is rather satisfying to stand next to someone who is viewing the site on a desktop machine, and then start their screen animating with a quick tap on your handset.</p>

<p>Cheap thrills, I know.</p>

<p>It seems to me though, that the cheapness of the thrills is what is so exciting.  I&#8217;m no rocket scientist, and I managed to create this entire application, complete with real-time online views in a couple of evenings work. The short hop and low cognitive friction for a Javascript developer to be able to build these kind of things from end to end is incredibly liberating.  I&#8217;m bursting at the seams with ideas for things I want to build, and am now capable of building with a new, powerful and yet familiar tool set.</p>

<p>The only detail which kept my new toy from the masses was having a suitable place to host it.  I&#8217;ve been using <a href="http://www.dreamhost.com/r.cgi?381199">Dreamhost</a> for a while now and have to say that I&#8217;m pretty happy with them, but even with the great level of control and access to your server that they give you, you need a little bit more control to compile and run <a href="http://nodesjs.org">Nodejs</a>.  The easiest and cheapest way that I found to host <a href="http://nodesjs.org">Nodejs</a> powered site was with a dedicated virtual server.  There is no shortage of providers in this space and as Web developers get more sophisticated, the use of this kind of solution is getting more commonplace. I opted for <a href="http://www.linode.com/?r=afc3f1becba08eb0ab33f62818cc90f396979563">Linode</a> which is working out rather nicely for me, but equally, I could have plumped for a similar offering from <a href="http://www.slicehost.com/">Slicehost</a> or <a href="http://aws.amazon.com/">Amazon Web Services</a>.  I&#8217;ll soon migrate all of my sites onto the single Linux instance that they host for me.</p>

<p>For now though, I need to resist the temptation to spend all of my spare time (ha!) noodling away with <a href="http://nodesjs.org">Nodejs</a>, <a href="http://www.mongodb.org">MongoDB</a>, <a href="http://jquery.com">jQuery</a> and various other fun things which &#8217;speak Javascript&#8217; that smart people on the Web keep on creating and selflessly sharing with the world for free.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hawksworx.com/journal/2010/02/15/nodejs-i-just-have-to-use-it-for-something/feed/</wfw:commentRss>
		</item>
		<item>
		<title>In defense of IE6</title>
		<link>http://www.hawksworx.com/journal/2009/08/10/in-defense-of-ie6/</link>
		<comments>http://www.hawksworx.com/journal/2009/08/10/in-defense-of-ie6/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 21:19:19 +0000</pubDate>
		<dc:creator>PhilHawksworth</dc:creator>
		
		<category><![CDATA[discussion]]></category>

		<category><![CDATA[observations]]></category>

		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.hawksworx.com/journal/2009/08/10/in-defense-of-ie6/</guid>
		<description><![CDATA[

No really! Read that title again. I&#8217;m about to argue against placing so much blame for painful Web development at the door of Internet Explorer 6. I&#8217;m not going try and claim that IE6 isn&#8217;t a huge pain in the arse of all good Web developers. Let&#8217;s face it, Web developers love to bitch about [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.flickr.com/photos/robotjohnny/3629069606/' title='No IE6'><img src='http://www.hawksworx.com/journal/wp-content/uploads/2009/08/3629069606_3d1a1cd8fb.jpg' alt='No IE6' /></a></p>

<p>No really! Read that title again. I&#8217;m about to argue against placing so much blame for painful Web development at the door of Internet Explorer 6. I&#8217;m not going try and claim that IE6 isn&#8217;t a huge pain in the arse of all good Web developers. Let&#8217;s face it, Web developers <a href="http://twitter.com/#search?q=ie6" title="Twitter - search for IE6">love to bitch</a> about it, but I do think that it&#8217;s time for some accountability.</p>

<p>The problem with IE6 is simple. It has poor support for <a href="http://www.webstandards.org/">Web standards</a>. It doesn&#8217;t always correctly render valid HTML and CSS, and requires nudging, tweaking and finagling in order to display the content in the desired way. Its interpretation of Javascript and interactions with the DOM are also less than perfect. That&#8217;s a pain, but does it really warrant such <a href="http://iedeathmarch.org/" title="IE Death March">massive hatred</a> from Web developers? As a Web developer, my first instinct would be to answer, &#8216;well, yes&#8217;. The cost of developing for IE6 is <a href="http://ejohn.org/blog/the-browsers-of-2009/" title="John Resig -   The Browsers of 2009">extraordinarily high</a>, even when compared to the benefit from its market share, because it is such a horrible and time consuming slog. </p>

<p>But hang on a moment.  The Web is something of a meritocracy. People tend to vote with their feet (or mice) and will abandon the weak experience in favor of the strong. Doesn&#8217;t this concept stretch to the browser too? Surely if IE6 was really that bad, people would have abandoned it and adopted a better, newer, more well behaved Web browser. Right? Yes and no. Many people have done exactly that. They have upgraded to <a href="http://www.microsoft.com/windows/internet-explorer/ie7/" title="Get Internet Explorer 7">IE7</a>, <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx" title="Internet Explorer 8: Home page">IE8</a>, <a href="http://www.mozilla.com/en-US/firefox" title="Firefox web browser | Faster, more secure, &amp; customizable">Firefox</a>, <a href="http://www.apple.com/safari/" title="Apple - Safari - Introducing Safari 4 - See the web in a whole new way">Safari</a>, <a href="http://www.opera.com/" title="Opera Browser | Faster &amp; safer Internet | Free Download">Opera</a>, <a href="http://www.google.com/chrome" title="Google Chrome - Download a new browser">Chrome</a> or something else. Let&#8217;s be honest, it isn&#8217;t hard to find a better browser than IE6 these days. But it isn&#8217;t quite that simple. </p>

<p>First of all, not everyone who uses the Web really understands what A Web browser is. Many people just know that they click an icon to get to &#8220;The Internet&#8221; (by which they often mean Google) or directly to their email (by which they mean one of the many Web based email services).  Understanding that they could choose a different application which accesses hese services to perform these tasks is something of a cognitive leap.</p>

<p>Others realised that they could use a better browser and have upgraded the browser on their home computers, but at work they are locked in to using whatever the company IT department dictates. Often, this means IE6. Why is that?</p>

<p>This is my beef. It&#8217;s not that IE6 is <a href="http://iedeathmarch.org/category/things-younger-than-ie6/" title="Things Younger Than IE6 at IE Death March">out-dated</a> and <a href="http://iedeathmarch.org/category/things-you-cant-do-in-ie6/" title="Things You Can&#8217;t Do In IE6 at IE Death March">substandard</a> (although it is), but that large organisations have needed to lock users in to using an approved Web browser. Having worked in a few large organisations, I&#8217;m no stranger to that scenario, and it&#8217;s immensely frustrating to be a user forced to use something so sub-par, and to be required to support it when you are trying to build the Webs next new hotness. So why do they do that?  There can be many reasons, but the largest, and most difficult to dispute is actually of our own creation. We (the Web developers of the world) built expensive, bespoke Web applications for large enterprises and (naturally) ensured that they worked on the most popular browser of the time. Critically though, this was done without thought to how the code might perform in future, standards compliant browsers. In many cases, the code just wasn&#8217;t future proof.</p>

<p>As a result we have applications and systems which depend being viewed in IE6 in order to function. This represents a huge risk to many large companies who invested so heavily in their development, and have come to depend on the applications. It&#8217;s little wonder that they force their employees to use IE6.</p>

<p>Remember that this isn&#8217;t just the fault of IE6. There have been many poor browsers over the years, but thankfully, natural selection has let them disappear and allowed better browsers to take over. IE6 suffers from its own success. That is, it&#8217;s market penetration.  Combine that with bad habits from developers and you have a browser which despite being left behind by <a href="http://webaim.org/blog/user-agent-string-history/">evolution</a>, is artificially kept alive by large enterprises as if it were on a magical life-support machine.  I imagine that it would rather be left to die in peace.</p>

<p>Surely then, we Web developers have learned our lesson. We&#8217;re not going let something like that happen again are we? Staggeringly, after all the grumbling and pain, I see evidence that many of us haven&#8217;t learned our lesson at all. We still write code which detects which browser is being used, before going on to specify behaviour accordingly. What we should be doing is testing for the support of our chosen implementation, then implementing accordingly. Think <a href="http://www.quirksmode.org/js/support.html" title="Javascript - Object detection">object detection</a>, not browser detection. That way, when a browser improves its support, or the user starts using a new browser, the application can enjoy the benefits, rather than just falling over.</p>

<p>I was particularly aggravated to learn how IE8 can be <a href="http://www.microsoft.com/windows/internet-explorer/readiness/developers-new.aspx" title="Internet Explorer 8 Readiness Toolkit">set to render as if it were IE7</a>. With a meta tag to provide &#8220;Internet Explorer 7 Compatibility mode&#8221;.</p>


<div class="wp_syntax"><div class="code"><pre>&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=7&quot;&gt;</pre></div></div>


<p>Why would this feature exist? Microsoft explain that it is so that developers can opt for &#8220;backwards compatibility with Internet Explorer 7 JavaScript and layout behavior&#8221;. In other words, it exists to try and get around the fact that so many developers wrote code to satisfy the quirks of IE7 without a thinking about how their code would fail when the quality of the browser is improved (have better conformance with <a href="http://www.w3.org/" title="World Wide Web Consortium - Web Standards">W3C standards</a> for HTML and CSS). </p>

<p>Microsoft didn&#8217;t want people to be resistant to upgrading to IE8 because of so many sites failing to render correctly in their shiny, new, more compliant browsers, so they provided a way to force the browser to continue to mis-interpret the code. I&#8217;m afraid I have to call &#8220;bull-shit&#8221; on this practice. I think that all this does is create another wave of Web sites and applications which are likely to get stuck in non-compliance land and require old rendering engines and legacy browsers to be kept alive to server them. </p>

<p>Only by developing for the rising tide of web standards, rather than the various quirks of specific browsers, can we hope to avoid locking our users in to a given browser. It&#8217;s time to make sure that we don&#8217;t get into this situation ever again. So next time you are tempted to grumble about IE6, remember that you can help avoid a similar mess in future by developing with standards in mind.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hawksworx.com/journal/2009/08/10/in-defense-of-ie6/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using Quicksilver to control Last.fm</title>
		<link>http://www.hawksworx.com/journal/2009/08/07/using-quicksilver-to-control-lastfm/</link>
		<comments>http://www.hawksworx.com/journal/2009/08/07/using-quicksilver-to-control-lastfm/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 13:50:08 +0000</pubDate>
		<dc:creator>PhilHawksworth</dc:creator>
		
		<category><![CDATA[osx]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.hawksworx.com/journal/2009/08/07/using-quicksilver-to-control-lastfm/</guid>
		<description><![CDATA[

For a while, I&#8217;ve been using handy Quicksilver triggers to control iTunes. I like not needing to switch my attention from what I&#8217;m working on, in order to skip a track, pause the playback, set a rating or whatever.  You can find out how to create a trigger from one of the many great [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.hawksworx.com/journal/wp-content/uploads/2009/08/quicksilver_lastfm.png' alt='Quicksilver &amp; Last.fm' /></p>

<p>For a while, I&#8217;ve been using handy <a href="http://docs.blacktree.com/quicksilver/what_is_quicksilver">Quicksilver</a> triggers to control iTunes. I like not needing to switch my attention from what I&#8217;m working on, in order to skip a track, pause the playback, set a rating or whatever.  You can find out <a href="http://leafraker.com/2007/09/17/how-to-create-a-quicksilver-trigger/">how to create a trigger</a> from one of the many great Quicksilver tutorials out on the Web.</p>

<p>At the moment though, I find myself listening to <a href="http://last.fm" rel="org fn url">Last.fm</a> more and more, and have been looking for a similar way to control the Last.fm application. I couldn&#8217;t find a plugin for Quicksilver to achieve this so I set about writing an Applescript which I could trigger with Quicksilver.</p>

<p>I&#8217;m not much of an Applescript whizz, but I managed to put the following script together to skip the track currently playing in the Last.fm application:</p>


<div class="wp_syntax"><div class="code"><pre class="javascript">tell application <span style="color: #3366CC;">&quot;Last.fm&quot;</span> to activate
tell application <span style="color: #3366CC;">&quot;System Events&quot;</span>
	tell process <span style="color: #3366CC;">&quot;Last.fm&quot;</span>
		click menu <span style="color: #000066; font-weight: bold;">item</span> <span style="color: #3366CC;">&quot;Skip&quot;</span> of menu <span style="color: #3366CC;">&quot;Controls&quot;</span> of menu bar <span style="color: #CC0000;">1</span>
	end tell
end tell</pre></div></div>


<p>After saving this in a suitable location (I have a Utils folder where I keep lots of scripts and utilities), I set a Quicksilver trigger to run the script. Simple!</p>

<p>Happy with the result, I created similar scripts for some other controls like love, ban, play and stop and assigned them all keyboard triggers.</p>

<p>My only wish was that I could do this without giving Last.fm focus. Generally this is fine for my because I have it running in a second display, so it doesn&#8217;t steal my attention, but it would be nice if I could get Applescript to execute the command without activating the application. I&#8217;d welcome suggestions from anyone with more Applescript fu than me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hawksworx.com/journal/2009/08/07/using-quicksilver-to-control-lastfm/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash v Web: Behind Enemy Lines</title>
		<link>http://www.hawksworx.com/journal/2009/07/27/flash-v-web-behind-enemy-lines/</link>
		<comments>http://www.hawksworx.com/journal/2009/07/27/flash-v-web-behind-enemy-lines/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 15:00:12 +0000</pubDate>
		<dc:creator>PhilHawksworth</dc:creator>
		
		<category><![CDATA[discussion]]></category>

		<category><![CDATA[theteam]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.hawksworx.com/journal/2009/07/27/flash-v-web-behind-enemy-lines/</guid>
		<description><![CDATA[

OK, I&#8217;m being over dramatic, but sometimes it does feel like I&#8217;m on a bit of a stealth mission. Pity that I forgot to bring any stealth! I&#8217;ve been working here at The Team for 3 months now and am enjoying myself greatly, but there is an issue that challenges me on a daily basis. [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.hawksworx.com/journal/wp-content/uploads/2009/07/flashvjs.png' alt='Flash versus Javascript' /></p>

<p>OK, I&#8217;m being over dramatic, but sometimes it does feel like I&#8217;m on a bit of a stealth mission. Pity that I forgot to bring any stealth! I&#8217;ve been working here at <a href="http://theteam.co.uk" rel="org url">The Team</a> for 3 months now and am enjoying myself greatly, but there is an issue that challenges me on a daily basis. That is that we do a lot of Flash work here, and yet I&#8217;m a big advocate of using <a href="http://www.w3.org/" rel="org url">Open Web Technologies</a>. In the past I have ranted on and on about how The Web is better off when we build things out of Web technologies than from proprietary technologies which seal in the content, limiting opportunities to get at it. How do I reconcile that?</p>

<p>Well, The Team is not just a Web development agency. We are a brand communications agency who have a <a href="http://theteam.co.uk/digital" rel="org url">digital</a> arm. That digital arm (of which I am part) produce all sorts of output, and not all of it is destined for the Web. We produce video content and interactive Flash content for DVDs, kiosks and the like which are jaw-droppingly beautiful.  Such content is produced by some very talented folks who in many cases, regard Flash as their weapon of choice.  Building things from Flash in this context is fine with me. Often it can be the ideal choice.</p>

<p>It is when this hunger for Flash crosses over to building web sites, that I have a problem. I enjoy a stunning, well crafted, interactive experience as much as the next guy, but I have pretty strong opinions on how and when we use Flash to deliver such an experience.  For me, Flash content lives in a similar category to video content or a pdf document. That is, you can put it on the Web, but that won&#8217;t make it a Web site. (as I write this, I&#8217;m find myself hearing Wesley Snipes proclaiming: &#8216;You can put a cat in the oven, but that don&#8217;t make it a biscuit!&#8217; Perhaps I&#8217;ll refrain from that level of <a href="http://en.wikiquote.org/wiki/White_Men_Can%27t_Jump">trash talking</a> for now.)</p>

<p>Being vocal about this opinion (of Flash and The Web, not cats and biscuits) in my new role, while in the company of many Flash developers and Flash fans has raised a few eyebrows and brought about some interesting debates. I was particularly chuffed to hear my colleague <a href="http://bruised-blood.livejournal.com/" rel="friend colleague met url">Stephen</a> playfully remark that I must be part of the &#8220;Anti Flash Mob&#8221;. I&#8217;ve got news for you Steve. There are loads of us out here, and we&#8217;re thinking of getting t-shirts!</p>

<p>In truth I&#8217;m not anti-Flash. I&#8217;m all for choosing this right tools for the job. But my contention is that when the job is delivering information to the widest possible audience, with the greatest amount of confidence that everyone (and everything) wanting to get at that information can do so, then Flash is the wrong choice.</p>

<p>At <a href="http://ted.com">TED</a> this year, <a href="http://www.w3.org/People/Berners-Lee/" rel="url">Tim Berners Lee</a> gave a <a href="http://www.ted.com/index.php/talks/tim_berners_lee_on_the_next_web.html">fascinating talk</a> where he touched on his vision of the future for The Web (which until HTML5 with its native <a href="http://dev.w3.org/html5/spec/Overview.html#video">video tag</a> comes along, you&#8217;ll need Flash to watch online). That future was for an &#8220;Open Data Web&#8221; where we have access not just to documents (as in The Web as conceived by TimBL in 1989) but also ready access to the core data beneath. That sounds good to me. I&#8217;d much rather build a site which lets people bookmark pages of interest, copy and paste content to other places, be addressable via hypertext links, be accessed by screen readers and search engines, provide deeper context for information with <a href="http://microformats.org" rel="org url">Microformats</a>, and so on.</p>

<p>Usually during a conversation like this, someone will bang their fist and say &#8220;&#8230;but you can do that with Flash!&#8221;, Well I&#8217;d be delighted to be proven wrong, so consider this a challenge. Show me. I&#8217;ve heard talk of Flash sites which offer all (or at least much) of the good stuff you get from developing for and with The Web, but have never been shown any evidence. I&#8217;d love to see examples.  The comments section below awaits your links.</p>

<p>For the time being, I&#8217;ll keep challenging any automatic choice of Flash over Web technologies on projects, but that&#8217;s just common sense, right?  Every technology choice should be justified.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hawksworx.com/journal/2009/07/27/flash-v-web-behind-enemy-lines/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Moving on from Osmosoft</title>
		<link>http://www.hawksworx.com/journal/2009/04/23/moving-on-from-osmosoft/</link>
		<comments>http://www.hawksworx.com/journal/2009/04/23/moving-on-from-osmosoft/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 13:56:06 +0000</pubDate>
		<dc:creator>PhilHawksworth</dc:creator>
		
		<category><![CDATA[theteam]]></category>

		<category><![CDATA[osmosoft]]></category>

		<category><![CDATA[bt]]></category>

		<category><![CDATA[announcements]]></category>

		<guid isPermaLink="false">http://www.hawksworx.com/journal/2009/04/23/moving-on-from-osmosoft/</guid>
		<description><![CDATA[

Last week was both sad and exciting for me. Exciting because I was gearing up to start my new job at theTeam, a London-based communications agency with a slightly silly name. Sad because it was my last week working at Osmosoft (a company that created plenty of silly named things itself).

I had been at Osmosoft [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.flickr.com/photos/philliecasablanca/2049169747/' title='Osmosoft'><img src='http://www.hawksworx.com/journal/wp-content/uploads/2009/04/osmosoft-on-flickr-photo-sharing.png' alt='Osmosoft' /></a></p>

<p>Last week was both sad and exciting for me. Exciting because I was gearing up to start my new job at <a href="http://theteam.co.uk">theTeam</a>, a London-based communications agency with a slightly silly name. Sad because it was my last week working at <a href="http://osmosoft.com">Osmosoft</a> (a company that created plenty of silly named things itself).</p>

<p>I had been at Osmosoft since it grew from a <a href="http://jermolene.com/2007/05/29/i-for-one-welcome-my-new-bt-overlords/">one man band</a> into an open source innovations team at <a href="http://bt.com">BT</a>, and had a terrific experience along the way. I think that it is safe to say that I have learned more about The Web during my time at Osmosoft than in any previous job and that is in no small part due to the quality and experience of the people around me.</p>

<p>During my time I honed my appreciation of what makes a good Web citizen. From technology choices to quality of delivery. From interaction design to exhibiting good taste. From the importance of the &#8216;View Source&#8217; experience to openness and data availability. I&#8217;m going to miss the raging debates and big opinions which regularly surfaced at Osmosoft.  The people there are intelligent and articulate. </p>

<p>Osmonauts, I salute you!</p>

<p>But now I&#8217;m off to pastures new. <a href="http://theteam.co.uk">theTeam</a> has a young, but growing digital arm with an impressive client list.  I&#8217;ll be involved in what we deliver into the browser and how. A chance to influence the nature of the browser experience by pushing for <a href="http://www.hawksworx.com/journal/2009/01/05/unobtrusify-your-javascript/">unobtrusive</a> technologies and best practices on a range of sites which is due to increase in both reach and diversity is a big draw for me. I&#8217;m looking forward to the challenge.</p>

<p>My transition has been made easier by a number of things. Firstly, Osmosoft and theTeam have already established a bit of a relationship. Co-hosting a recent <a href="http://upcoming.yahoo.com/event/2149675/">Open Source Show and Tell</a> revealed some common interests and enthusiasms. I&#8217;m hoping for more crossover at events like that.  Secondly, a big part of my time at Osmosoft was spent developing for an open source project called <a href="http://tiddlywiki.com">TiddlyWiki</a>. While I&#8217;ll have to scale back my time on that, there is no reason for me to turn my back on it altogether. I&#8217;m keen to keep on contributing and building applications with TiddlyWiki.  Besides, it&#8217;s nice to bump into familiar friends in the <a href="irc://irc.freenode.net/#tiddlywiki">TiddlyWiki irc</a> room.</p>

<p>Osmosoft really sparked a lot of enthusiasm for me when it comes to both open source software and compelling Web content. In addition to contributing to TiddlyWiki, I&#8217;m hoping to start a small open source project of my own to feed my desire to make great stuff for the Web that anyone can use.</p>

<p>Thanks for everything Osmosoft. It&#8217;s been a blast!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hawksworx.com/journal/2009/04/23/moving-on-from-osmosoft/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Leveraging jQuery and jQuery plugins in TiddlyWiki</title>
		<link>http://www.hawksworx.com/journal/2009/03/13/leveraging-jquery-and-jquery-plugins-in-tiddlywiki/</link>
		<comments>http://www.hawksworx.com/journal/2009/03/13/leveraging-jquery-and-jquery-plugins-in-tiddlywiki/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 14:09:07 +0000</pubDate>
		<dc:creator>PhilHawksworth</dc:creator>
		
		<category><![CDATA[jquery]]></category>

		<category><![CDATA[tips]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[tiddlywiki]]></category>

		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.hawksworx.com/journal/2009/03/13/leveraging-jquery-and-jquery-plugins-in-tiddlywiki/</guid>
		<description><![CDATA[

The recent release of TiddlyWiki v2.5 included something rather exciting for me: JQuery, the popular Javascript library is now part of the TiddlyWiki core.

This is exciting for a number of reasons. 


The TiddlyWiki core functions can now use jQuery to perform all manner of DOM inspection and DOM manipulation.  We can refactor a ton [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.hawksworx.com/journal/wp-content/uploads/2009/03/jquery_-the-write-less-do-more-javascript-library.png' alt='jQuery' /></p>

<p>The recent release of <a href="http://tiddlywiki.com/">TiddlyWiki v2.5</a> included something rather exciting for me: <a href="http://jquery.com">JQuery</a>, the popular Javascript library is now part of the TiddlyWiki core.</p>

<p>This is exciting for a number of reasons. </p>

<ol>
<li>The TiddlyWiki core functions can now use jQuery to perform all manner of DOM inspection and DOM manipulation.  We can refactor a ton of code to benefit from jQuery&#8217;s blistering Sizzle engine and pass the burden of maintaining lots of utility functions over to those clever jQuery bods. All of which will simplify the TiddlyWiki codebase and ultimately make it easier to read and easier to maintain.</li>

<li>TiddlyWiki plugin developers will now be able to make use of jQuery in their plugins. That&#8217;s great news for both hardcore plugin developers and people dabbling for the first time.  jQuery is elegantly expressive, powerful, and superbly documented.  All of this lowers the barriers to entry for a would be developer and smooths the way for exisiting developers.</li>

<li>There is a huge wealth of jQuery plugins which can now be utilised by TiddlyWiki.  The quality of many of these plugins is tremendously high. Bring &#8216;em on!</li></ol>

<p>But how does a TiddlyWiki plugin developer get started? How can we bring a jQuery plugin into TiddlyWiki and make it available via a Macro?  Let&#8217;s take a look at an example.</p>

<p><a href="http://fnd.lewcid.org/blog/" title="FND&#8217;s Blag: Just Another Personal Wobsite">Fred</a>, my colleague at <a href="http://osmosoft.com/" title="osmosoft - open source applications from BT">Osmosoft</a> stumbled upon a plugin which creates a nice navigation structure from an HTML List element.  The plugin has lots of <a href="http://www.ihwy.com/Labs/Demos/Current/jquery-listnav-plugin.aspx" title="ListNav plugin examples">examples</a> and <a href="http://www.ihwy.com/Labs/jquery-listnav-plugin.aspx" title="jQuery listnav plugin - Javascript list navigation control">documentation</a> and seemed like a good contender for bringing something useful into TiddlyWiki.</p>

<p>To include the plugin, all we need to do is copy it into a tiddler and then tag the tiddler with systemConfig. After saving the file and reloading, the plugin is available for us to use.</p>

<p><a href='http://www.hawksworx.com/journal/wp-content/uploads/2009/03/plugin_inclusion.png' title='Plugin inclusion'><img src='http://www.hawksworx.com/journal/wp-content/uploads/2009/03/plugin_inclusion.png' alt='Plugin inclusion' width='400px' /></a></p>

<p>With the jQuery plugin availble, we can use it to provide a snazzy UI for any UL or LI elements on the page. The Javascirpt syntax for that is nice and simple:</p>


<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #009900; font-style: italic;">// Turn the list element with an ID of 'myList' into a funky ListNav</span>
$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'#myList'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">listnav</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>


<p>This is great, but we want people to be able to call this from TiddlyWiki without having to write Javascript. If we create a TiddlyWiki macro to call this for us, people can easily make a nice NavList anywhere. Let&#8217;s make a macro which turns the contents of a tiddler into a NavList like this:</p>


<div class="wp_syntax"><div class="code"><pre class="javascript">&lt;&lt;listnav TiddlerTitle&gt;&gt;</pre></div></div>


<p>To make that available, we should create a TiddlyWiki plugin which delivers this macro. We do this in a new tiddler.  I created a tiddler called &#8216;ListNavPlugin&#8217; and once again tagged it with systemConfig so that it becomes code that TiddlyWiki knows to interpret. To start with, let&#8217;s just create the macro and ensure that we can invoke it.</p>


<div class="wp_syntax"><div class="code"><pre class="javascript">&nbsp;
<span style="color: #009900; font-style: italic;">// create macro object</span>
config.<span style="color: #006600;">macros</span>.<span style="color: #006600;">listnav</span> = <span style="color: #66cc66;">&#123;</span> 
&nbsp;
  <span style="color: #009900; font-style: italic;">// Add a handler function to be invoked by &lt;&lt;listnav TiddlerTitle&gt;&gt; </span>
  handler: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>place, macroName, params, wikifier, paramString, tiddler<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
    <span style="color: #009900; font-style: italic;">// do some magic...</span>
    <span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;I'm gonna make a funky listnav!&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>;</pre></div></div>


<p>To see it working, I created two more new tiddlers. MyFruityList holds a list of items, and ExampleListNav holds a call to the new macro.</p>

<p><a href='http://www.hawksworx.com/journal/wp-content/uploads/2009/03/list-and-example-call.png' title='MyFruityList and ExampleListNav'><img src='http://www.hawksworx.com/journal/wp-content/uploads/2009/03/list-and-example-call.png' alt='MyFruityList and ExampleListNav' width='400px' /></a></p>

<p>Saving the TiddlyWiki file and reloading will make the macro available to call. If we open the ExampleListNav tiddler, we should see our macro called like this:</p>

<p><a href='http://www.hawksworx.com/journal/wp-content/uploads/2009/03/macro-called-1.png' title='Macro called'><img src='http://www.hawksworx.com/journal/wp-content/uploads/2009/03/macro-called-1.png' alt='Macro called' width='400px' /></a></p>

<p>All good, but not exciting yet. Let&#8217;s flesh out our TiddlyWiki macro a bit.  We&#8217;ll use a TiddlyWiki function to get the text from our desired tiddler and then make a list from it.  Where we might once have used some TiddlyWiki utility functions to help us create the HTML elements (like createTiddlyElement), we can now use <a href="http://docs.jquery.com/Manipulation">jQuery&#8217;s helper functions</a> to append elements to the document.</p>


<div class="wp_syntax"><div class="code"><pre class="javascript">&nbsp;
<span style="color: #009900; font-style: italic;">// create macro object</span>
config.<span style="color: #006600;">macros</span>.<span style="color: #006600;">listnav</span> = <span style="color: #66cc66;">&#123;</span>
&nbsp;
  <span style="color: #009900; font-style: italic;">// Add a handler function to be invoked by &lt;&lt;listnav TiddlerTitle&gt;&gt; </span>
  handler: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>place, macroName, params, wikifier, paramString, tiddler<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
    <span style="color: #009900; font-style: italic;">// target tiddler passed in as macro parameter</span>
    <span style="color: #003366; font-weight: bold;">var</span> title = params<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #66cc66;">&#93;</span>;
&nbsp;
    <span style="color: #009900; font-style: italic;">// read list items from tiddler contents</span>
    <span style="color: #003366; font-weight: bold;">var</span> text = store.<span style="color: #006600;">getTiddlerText</span><span style="color: #66cc66;">&#40;</span>title<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>text<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
      <span style="color: #009900; font-style: italic;">// generate list</span>
      <span style="color: #003366; font-weight: bold;">var</span> items = text.<span style="color: #006600;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #003366; font-weight: bold;">var</span> list = jQuery<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;&lt;ul /&gt;&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">attr</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span>, <span style="color: #3366CC;">&quot;listnav&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">appendTo</span><span style="color: #66cc66;">&#40;</span>place<span style="color: #66cc66;">&#41;</span>;
      jQuery.<span style="color: #006600;">each</span><span style="color: #66cc66;">&#40;</span>items, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>i, itm<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        jQuery<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li /&gt;&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">text</span><span style="color: #66cc66;">&#40;</span>itm<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">appendTo</span><span style="color: #66cc66;">&#40;</span>list<span style="color: #66cc66;">&#41;</span>;
      <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>;</pre></div></div>


<p>Now we&#8217;re getting somewhere. We&#8217;ve grabbed each line from our MyFruityList tiddler and used jQuery to turn them into an unordered list.</p>

<p><a href='http://www.hawksworx.com/journal/wp-content/uploads/2009/03/example-list-created.png' title='List created from tiddler text'><img src='http://www.hawksworx.com/journal/wp-content/uploads/2009/03/example-list-created.png' alt='List created from tiddler text' width='400px' /></a></p>

<p>We can now call the jQuery plugin to render our list as a NavList. The plugin requires a little extra HTML so we can create that, and then call the listnav plugin.</p>


<div class="wp_syntax"><div class="code"><pre class="javascript">&nbsp;
<span style="color: #009900; font-style: italic;">// create macro object</span>
config.<span style="color: #006600;">macros</span>.<span style="color: #006600;">listnav</span> = <span style="color: #66cc66;">&#123;</span>
&nbsp;
  <span style="color: #009900; font-style: italic;">// Add a handler function to be invoked by &lt;&lt;listnav TiddlerTitle&gt;&gt; </span>
  handler: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>place, macroName, params, wikifier, paramString, tiddler<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
    <span style="color: #009900; font-style: italic;">// target tiddler passed in as macro parameter</span>
    <span style="color: #003366; font-weight: bold;">var</span> title = params<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #66cc66;">&#93;</span>;
&nbsp;
    <span style="color: #009900; font-style: italic;">// read list items from tiddler contents</span>
    <span style="color: #003366; font-weight: bold;">var</span> text = store.<span style="color: #006600;">getTiddlerText</span><span style="color: #66cc66;">&#40;</span>title<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>text<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
      <span style="color: #009900; font-style: italic;">// generate nav bar</span>
      jQuery<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div /&gt;&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">attr</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span>, <span style="color: #3366CC;">&quot;listnav-nav&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">appendTo</span><span style="color: #66cc66;">&#40;</span>place<span style="color: #66cc66;">&#41;</span>;
&nbsp;
      <span style="color: #009900; font-style: italic;">// generate list</span>
      <span style="color: #003366; font-weight: bold;">var</span> items = text.<span style="color: #006600;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #003366; font-weight: bold;">var</span> list = jQuery<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;&lt;ul /&gt;&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">attr</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span>, <span style="color: #3366CC;">&quot;listnav&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">appendTo</span><span style="color: #66cc66;">&#40;</span>place<span style="color: #66cc66;">&#41;</span>;
      jQuery.<span style="color: #006600;">each</span><span style="color: #66cc66;">&#40;</span>items, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>i, itm<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        jQuery<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li /&gt;&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">text</span><span style="color: #66cc66;">&#40;</span>itm<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">appendTo</span><span style="color: #66cc66;">&#40;</span>list<span style="color: #66cc66;">&#41;</span>;
      <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
      <span style="color: #009900; font-style: italic;">// apply listnav</span>
      list.<span style="color: #006600;">listnav</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>;</pre></div></div>


<p>When we save our plugin, reload the page and open up our ExampleListNav tiddler, we see the navlist. Cool! Hang on though, it looks a bit rubbish. Not like the examples we saw earlier.  We have to include the CSS to style our new navlist.  Easy enough, let&#8217;s use our TiddlyWiki plugin to create a sylesheet for our new HTML by adding this:</p>


<div class="wp_syntax"><div class="code"><pre class="javascript">&nbsp;
<span style="color: #009900; font-style: italic;">// add default styles (adapted from http://www.ihwy.com/labs/downloads/jquery-listnav/2.0/listnav.css)</span>
config.<span style="color: #006600;">shadowTiddlers</span>.<span style="color: #006600;">StyleSheetListNav</span> = <span style="color: #3366CC;">&quot;/*{{{*/<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;#listnav-nav { margin: 20px 0 10px; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;.ln-letters { overflow: hidden; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;.ln-letters a { font-size: 0.9em; display: block; float: left; padding: 2px 6px; border: 1px solid #eee; border-right: none; text-decoration: none; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>+
  <span style="color: #3366CC;">&quot;.ln-letters a.ln-last { border-right: 1px solid #eee; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;.ln-letters a:hover, .ln-letters a.ln-selected { background-color: #eaeaea; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;.ln-letters a.ln-disabled { color: #ccc; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;.ln-letter-count { text-align: center; font-size: 0.8em; line-height: 1; margin-bottom: 3px; color: #336699; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;/*}}}*/&quot;</span>;
store.<span style="color: #006600;">addNotification</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;StyleSheetListNav&quot;</span>, refreshStyles<span style="color: #66cc66;">&#41;</span>;</pre></div></div>


<p>And we&#8217;re done.  The jQuery plugin is turning our boring old list into a dynamic indexed list with navigation. Cool!  For extra credit, we can make our jQuery a little more concise. Notice that we call jQuery by name rather than with the common idiom of $.  We could simply replace each jQuery with $ in our code and that would work, but beware!  There are other Javascript libraries that use the $ shortcut.  we don&#8217;t want to introduce the possibility of a clash.  Luckily, there is a simple way to get around that.  All we need to do is wrap our TiddlyWiki plugin in a closure and pass jQuery in as an argument (as explained on the <a href="http://docs.jquery.com/Plugins/Authoring#Custom_Alias_in_plugin_code" title="Plugins/Authoring - jQuery JavaScript Library">jQuery documentation</a> site).  Then we can use whatever shortcut for jQuery in our code that we like.  The final code looks like this:</p>


<div class="wp_syntax"><div class="code"><pre class="javascript">&nbsp;
<span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>$<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #009900; font-style: italic;">// set up alias</span>
&nbsp;
  <span style="color: #009900; font-style: italic;">// create macro object</span>
  config.<span style="color: #006600;">macros</span>.<span style="color: #006600;">listnav</span> = <span style="color: #66cc66;">&#123;</span>
&nbsp;
  <span style="color: #009900; font-style: italic;">// Add a handler function to be invoked by &lt;&lt;listnav TiddlerTitle&gt;&gt; </span>
  handler: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>place, macroName, params, wikifier, paramString, tiddler<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
    <span style="color: #009900; font-style: italic;">// target tiddler passed in as macro parameter</span>
    <span style="color: #003366; font-weight: bold;">var</span> title = params<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #66cc66;">&#93;</span>;
&nbsp;
    <span style="color: #009900; font-style: italic;">// read list items from tiddler contents</span>
    <span style="color: #003366; font-weight: bold;">var</span> text = store.<span style="color: #006600;">getTiddlerText</span><span style="color: #66cc66;">&#40;</span>title<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>text<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
     <span style="color: #009900; font-style: italic;">// generate nav bar</span>
     $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div /&gt;&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">attr</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span>, <span style="color: #3366CC;">&quot;listnav-nav&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">appendTo</span><span style="color: #66cc66;">&#40;</span>place<span style="color: #66cc66;">&#41;</span>;
&nbsp;
     <span style="color: #009900; font-style: italic;">// generate list</span>
     <span style="color: #003366; font-weight: bold;">var</span> items = text.<span style="color: #006600;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;
     <span style="color: #003366; font-weight: bold;">var</span> list = $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;&lt;ul /&gt;&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">attr</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;id&quot;</span>, <span style="color: #3366CC;">&quot;listnav&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">appendTo</span><span style="color: #66cc66;">&#40;</span>place<span style="color: #66cc66;">&#41;</span>;
     $.<span style="color: #006600;">each</span><span style="color: #66cc66;">&#40;</span>items, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>i, itm<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
       $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li /&gt;&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">text</span><span style="color: #66cc66;">&#40;</span>itm<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">appendTo</span><span style="color: #66cc66;">&#40;</span>list<span style="color: #66cc66;">&#41;</span>;
     <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
     <span style="color: #009900; font-style: italic;">// apply listnav</span>
     list.<span style="color: #006600;">listnav</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>;
&nbsp;
  <span style="color: #009900; font-style: italic;">// add default styles (adapted from http://www.ihwy.com/labs/downloads/jquery-listnav/2.0/listnav.css)</span>
  config.<span style="color: #006600;">shadowTiddlers</span>.<span style="color: #006600;">StyleSheetListNav</span> = <span style="color: #3366CC;">&quot;/*{{{*/<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;#listnav-nav { margin: 20px 0 10px; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;.ln-letters { overflow: hidden; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;.ln-letters a { font-size: 0.9em; display: block; float: left; padding: 2px 6px; border: 1px solid #eee; border-right: none; text-decoration: none; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>+
  <span style="color: #3366CC;">&quot;.ln-letters a.ln-last { border-right: 1px solid #eee; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;.ln-letters a:hover, .ln-letters a.ln-selected { background-color: #eaeaea; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;.ln-letters a.ln-disabled { color: #ccc; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;.ln-letter-count { text-align: center; font-size: 0.8em; line-height: 1; margin-bottom: 3px; color: #336699; }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> +
  <span style="color: #3366CC;">&quot;/*}}}*/&quot;</span>;
  store.<span style="color: #006600;">addNotification</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;StyleSheetListNav&quot;</span>, refreshStyles<span style="color: #66cc66;">&#41;</span>;	
&nbsp;
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>jQuery<span style="color: #66cc66;">&#41;</span>;</pre></div></div>


<p>You can explore the finished example in a <a href='http://www.hawksworx.com/journal/wp-content/uploads/2009/03/listnavplugin.html' title='ListNavPlugin example TiddlyWiki'> TiddlyWiki</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hawksworx.com/journal/2009/03/13/leveraging-jquery-and-jquery-plugins-in-tiddlywiki/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mashing up flickr in the client with jQuery</title>
		<link>http://www.hawksworx.com/journal/2009/02/15/mashing-up-flickr-in-the-client-with-jquery/</link>
		<comments>http://www.hawksworx.com/journal/2009/02/15/mashing-up-flickr-in-the-client-with-jquery/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 21:24:47 +0000</pubDate>
		<dc:creator>PhilHawksworth</dc:creator>
		
		<category><![CDATA[jquery]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[mash-ups]]></category>

		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.hawksworx.com/journal/2009/02/15/mashing-up-flickr-in-the-client-with-jquery/</guid>
		<description><![CDATA[

Recently I saw Tim Stevens post on Twitter about a slide show he had built using his Liveloom application. His slide show grabs some photos from Flickr tagged with &#8216;Osmosoft&#8217; and then renders them with all manner of visual effects using Flex.

While the visual effects available via Tim&#8217;s app are impressive, I&#8217;m a big advocate [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://polaroiderizer.com/#osmosoft' title='polaroiderizer'><img src='http://www.hawksworx.com/journal/wp-content/uploads/2009/02/polaroiderizer-a-slideshow-from-your-flickr-tags-2.png' alt='polaroiderizer' /></a></p>

<p>Recently I saw Tim Stevens <a href="http://twitter.com/san1t1/status/1193906661">post on Twitter</a> about a slide show he had built using his <a href="http://www.liveloom.com/">Liveloom</a> application. His slide show grabs some photos from Flickr tagged with &#8216;Osmosoft&#8217; and then renders them with all manner of visual effects using Flex.</p>

<p>While the visual effects available via Tim&#8217;s app are impressive, I&#8217;m a big advocate of open web standards and enjoy making things from HTML and Javascript, rather than using tools like Flex. My first encounter with the slide show made by Liveloom was on an iPhone where it couldn&#8217;t run. The temptation to cobble together a simple Flickr mashup which could operate in any Javascript capable browser was too much to resist.</p>

<p>Let&#8217;s not pretend, that there aren&#8217;t already slide show mashups galore, or that I was going to be able to rival some of the advanced visual effects that Liveloom can offer, but making a simple, attractive slide show which could run on lots of devices seemed like a fun and valuable exercise.  I was also keen to see just how quickly and easily I could produce this using jQuery.  I&#8217;m forever going on about how good jQuery is at manipulating the DOM, so this seemed like a good chance to demonstrate that.</p>

<p>I shared the result my efforts as the &#8216;Poloaroiderizer&#8217; and after getting some great feedback, promoted it to its very own domain. Check it out over at <a href="http://polaroiderizer.com">polaroiderizer.com</a></p>

<p>As it turns out, the task was incredibly simple and took just a few hours one evening. The interface is rendered with HTML and CSS. As such, it will work in any modern browser.  I used jQuery to request <a href="http://ajaxian.com/archives/jsonp-json-with-padding">JSONP</a> from the Flickr API. JSPONP gets you around the cross domain scripting restrictions and delivers JSON to the browser which is a snap to parse and render.  There is no logic on the server. All of my code is run in the browser.</p>

<p>The animations are provided by CSS and DOM manipulation, made simple by <a href="http://docs.jquery.com/Effects/animate">jQuery&#8217;s animation functions</a>.  The display needs Javascript to render, so without it Polaroiderizer is a bit toothless, but that doesn&#8217;t mean we can forget about those without Javascript. If you submit a flickr tag while you don&#8217;t have Javascript capabilities, the form will submit your tag to the standard flickr interface and you&#8217;ll find yourself at the flickr search results page.  This is another example of progressive enhancement. A topic close to my heart that I tried to demonstrate recently on <a href="http://unobtrusify.com">Unobtrusify</a>.</p>

<p>Another little bonus of building this slide show app this way, is that it is super-easy to share the results. I made sure that the tag entered was echoed into the address of the page as the page fragment identifier. Manipulating and interrogating the frag id can be useful in Ajax applications as my colleague <a href="http://softwareas.com/fun-with-fragment-identifiers">Michael Mahemoff explained recently</a>.  When the page loads, it looks for a tag stored in the frag id as its starting point. That means you can bookmark slide shows and share them as easily as email a URI. Here are a few:</p>

<p><a href="http://polaroiderizer.com/#PhilHawksworth">http://polaroiderizer.com/#PhilHawksworth</a>
<a href="http://polaroiderizer.com/#TheWebIsAgreement">http://polaroiderizer.com/#TheWebIsAgreement</a>
<a href="http://polaroiderizer.com/#TED2009">http://polaroiderizer.com/#TED2009</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hawksworx.com/journal/2009/02/15/mashing-up-flickr-in-the-client-with-jquery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Unobtrusify your Javascript</title>
		<link>http://www.hawksworx.com/journal/2009/01/05/unobtrusify-your-javascript/</link>
		<comments>http://www.hawksworx.com/journal/2009/01/05/unobtrusify-your-javascript/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 13:13:47 +0000</pubDate>
		<dc:creator>PhilHawksworth</dc:creator>
		
		<category><![CDATA[jquery]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.hawksworx.com/journal/2009/01/05/unobtrusify-your-javascript/</guid>
		<description><![CDATA[


Recently Jon Lister, a colleague of mine at Osmosoft showed me a website made by his friend Joshua Bradley. The site, used some of the Javscript code from TiddlyWiki&#8217;s animation engine to create some nice visual effects. I loved the design, but could see some room for improvement in the implementation. I&#8217;m a big advocate [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://unobtrusify.com' title='Unobtrusive Javascript'><img src='http://www.hawksworx.com/journal/wp-content/uploads/2009/01/unobtrusive.png' alt='Unobtrusive Javascript' /></a></p>

<p>
Recently <a href="http://jaybyjayfresh.com" title="jaybyjayfresh">Jon Lister</a>, a colleague of mine at <a href="http://www.osmosoft.com">Osmosoft</a> showed me a website made by his friend <a href="http://joshuabradley.co.uk/" title="Joshua Bradley">Joshua Bradley</a>. The site, used some of the Javscript code from <a href="http://tiddlywiki.com" title='TiddlyWiki'>TiddlyWiki</a>&#8217;s animation engine to create some nice visual effects. I loved the design, but could see some room for improvement in the implementation. I&#8217;m a big advocate of <a href="http://en.wikipedia.org/wiki/Unobtrusive_JavaScript" title="Unobtrusive JavaScript">Unobtrusive Javascript</a> and <a href="http://en.wikipedia.org/wiki/Progressive_enhancement" title="Progressive enhancement">Progressive Enhancement</a> and so I set about producing a quick demo of how a similar result could be achieved in the most Web-kind and accessible way available using <a href="http://jquery.com" title='jQuery'>jQuery</a> for the behaviors.
</p>

<p>
The result has been published as <a href="http://unobtrusify.com" title="Unobtrusify.com - Unobtrusive Javascript for Progressive Enhancement">Unobtrusify.com</a>.
</p>

<h4>The aim.</h4>

<ul>
    <li>Create a similar effect to that on Josh&#8217;s site, but make sure that the page is readable without Javascript.</li>
    <li>Use images to make the headings look snazzy, but make sure that they are not required in order for the content to make sense.</li>
    <li>Use only unobtrusive Javascript and keep the HTML as clean as possible.</li>
    <li>Reduce the number of http requests required to as few as possible in order to improve performance.</li>
</ul>

<h4>The approach.</h4>

<p>
First of all, I wrote the text for the page. I chose a simple statement and tried to structure it such that it would make sense regardless of which sections were expanded.
</p>

<p>
Then I used the simplest HTML markup I could to logically represent the content with its various headings.  <a href="http://unobtrusify.com/justhtml.html" title="Unobtrusify.com - Unobtrusive Javascript for Progressive Enhancement (HTML only)">This is how the page would look</a> to text-only browsers search engines, web-crawlers and screen-readers.</p>

<p>I then used a well-known CSS technique to replace the text in the headings with images. This would ensure that the text would remain for non-human consumers of the site, while the images would be presented to those able to appreciate them.  The technique is simple.  You prevent the browser from scrolling the content of your element with <code>overflow:hidden</code> and then scoot the text out of the way with <code>text-indent</code>. Now that the way is clear, you can display an image with <code>background-image</code>.  Be sure to specify the dimensions of your desired image as the <code>background-image</code> property will not resize your element to the correct size automatically. The CSS would look something like this:</p>


<div class="wp_syntax"><div class="code"><pre class="css"><span style="color: #cc00cc;">#myHeading</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">text-indent</span>: -<span style="color: #933;">9999px</span>;
	<span style="color: #000000; font-weight: bold;">overflow</span>: <span style="color: #993333;">hidden</span>;
	<span style="color: #000000; font-weight: bold;">background-image</span>: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span><span style="color: #933;">myImage<span style="color: #6666ff;">.gif</span></span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">width</span>: <span style="color: #933;">380px</span>;
	<span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #933;">123px</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>


<p>My content had 6 headings to render in this way. I also wanted to have a mouseover effect to give some affordance for the click-ability of the headings so this would require another 6 images. Rather than having 12 images to download (which would require 12 separate HTTP requests), I combined all of these images into a single image.  This would have a number of effects. Firstly, combining the 12 images into one meant that the total download would be a bit smaller due to the way that the file was compressed. (A tiny saving, but every little helps.)  Secondly, there is an overhead with making HTTP requests so when it comes to performance, the fewer the better. This method cuts out 11 HTTP requests. Score!  Thirdly, as the browser uses the same image for the original heading images and their associated mouseover images, there is no need to preload the alternate images to avoid that nasty pause when mousing over. The image is already downloaded and ready to display. A nice bonus.</p>

<p>In order to use this &#8216;image sprite&#8217; for each and every heading, I just needed to specify the <code>background-position </code>for each one. Some attributes would be common to each one so I could save some code like this:</p>


<div class="wp_syntax"><div class="code"><pre class="css">h1 <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">text-indent</span>: -<span style="color: #933;">9999px</span>;
	<span style="color: #000000; font-weight: bold;">overflow</span>: <span style="color: #993333;">hidden</span>;
	<span style="color: #000000; font-weight: bold;">background-image</span>: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span><span style="color: #933;">images/unobtrusive_sprite<span style="color: #6666ff;">.gif</span></span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">width</span>: <span style="color: #933;">380px</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
h1<span style="color: #cc00cc;">#uj</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-position</span>: <span style="color: #933;">0</span> <span style="color: #933;">0</span>;
	<span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #933;">123px</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
h1<span style="color: #cc00cc;">#cmh</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-position</span>: <span style="color: #933;">0</span> -<span style="color: #933;">123px</span>;
	<span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #933;">150px</span>;
<span style="color: #66cc66;">&#125;</span>
...</pre></div></div>


<p>At this point our <a href="http://unobtrusify.com/withcss.html" title="Unobtrusify.com - Unobtrusive Javascript for Progressive Enhancement (with CSS)">page looks like this</a>.  This is exactly how we want things to appear for those without Javascript. There is no ability to toggle the display of the various sections, the content is shown in full, and there is no mouseover behavior on the headings to suggest that they can be clicked (since they cannot).  This is the essence of <a href="http://en.wikipedia.org/wiki/Progressive_enhancement" title="Progressive enhancement">Progressive Enhancement</a>.  We have a perfectly serviceable web page (albeit a simple one) which we can now enhance for those with Javascript enabled.
</p>

<p>Using jQuery to easily and unobtrusively add behavior to elements on the page, we can now hide all of the expanded sections. We do this with a simple jQuery statement like this:
</p>


<div class="wp_syntax"><div class="code"><pre class="javascript">$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'#wrapper &gt; div'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">hide</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>


<p>This hides all of the div elements which are a direct descendent of the element with an ID of wrapper. (my chosen HTML structure). 
</p>

<p>Headings are not by default clickable so we can add some behavior to suggest that the clicking a heading will have a effect by changing the cursor for them like this:
</p>


<div class="wp_syntax"><div class="code"><pre class="javascript">$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'#wrapper h1'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">addClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'clickable'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>


<p>A CSS class of &#8216;clickable&#8217; specifies the cursor with <code>cursor: pointer;</code></p>

<p>We also use jQuery to show the hover image by just repositioning the background image when we hover with the mouse and also to show the hidden div element when we click a heading. Remember, none of this will happen unless Javascript is available.
</p>

<p><a href='http://unobtrusify.com' title='Unobtrusify.com'><img src='http://www.hawksworx.com/journal/wp-content/uploads/2009/01/unobtrusifycom-unobtrusive-javascript-for-progressive-enhancement.png' alt='Unobtrusify.com' width='400px'/></a></p>

<p>I also use an additional trick to prevent a flash of unstyled content or FOUC (gratifyingly pronounced &#8216;FOOOOOOK&#8217; by <a href="http://hicksdesign.co.uk/" title="hicksdesign: design for print and new-fangled media">John Hicks</a>) while the Javascript is being downloaded. This trick is <a href="http://www.learningjquery.com/2008/10/1-awesome-way-to-avoid-the-not-so-excellent-flash-of-amazing-unstyled-content" title="1 (Awesome) Way To Avoid the (Not So Excellent) Flash of (Amazing) Unstyled Content &raquo; Learning jQuery - Tips, Techniques, Tutorials">very well explained</a> by <a href="http://www.englishrules.com/" title="English Rules">Karl Swedberg</a> on the excellent <a href="http://www.learningjquery.com/" title="Learning jQuery - Tips, Techniques, Tutorials">learningjquery.com</a> site.
</p>

<p>
    For a better picture of exactly what is going on, why not swing by <a href="http://Unobtrusify.com" title="Unobtrusify.com - Unobtrusive Javascript for Progressive Enhancement">Unobtrusify.com</a> and exercise your right as a citizen of the Web to view the source. Hitting View Source is so often the best way to learn how things are done. Go on! Go and get your hands dirty!
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hawksworx.com/journal/2009/01/05/unobtrusify-your-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Enthusiasm and Good Food at TiddlyParis</title>
		<link>http://www.hawksworx.com/journal/2008/08/27/enthusiasm-and-good-food-at-tiddlyparis/</link>
		<comments>http://www.hawksworx.com/journal/2008/08/27/enthusiasm-and-good-food-at-tiddlyparis/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 14:26:27 +0000</pubDate>
		<dc:creator>PhilHawksworth</dc:creator>
		
		<category><![CDATA[events]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[osmosoft]]></category>

		<category><![CDATA[tiddlywiki]]></category>

		<guid isPermaLink="false">http://www.hawksworx.com/journal/2008/08/27/enthusiasm-and-good-food-at-tiddlyparis/</guid>
		<description><![CDATA[<a href="http://farm4.static.flickr.com/3131/2803239794_6a48afbdc3.jpg" title="TiddlyParis"><img src="http://farm4.static.flickr.com/3131/2803239794_6a48afbdc3.jpg" width="400" alt="TiddlyParis" /></a>

Yesterday I was fortunate to be able to make the quick trip over to Paris to attend a meeting of <a href="http://tiddlywiki.com">TiddlyWiki</a> enthusiasts at <a href="http://upcoming.yahoo.com/event/1028826/">TiddlyParis</a>. Arranged by long time <a href="http://tiddlywiki.com">TiddlyWiki</a> community member and <a href="http://unamesa.org">Una Mesa</a> stalwart <a href="http://lewcid.org">Saq Imtiaz</a>, this event was a great chance to put some faces to the names of some of the <a href="http://tiddlywiki.com">TiddlyWiki</a> developers and users whose work I have been enjoying and benefitting from for some time.]]></description>
			<content:encoded><![CDATA[<p><a href="http://farm4.static.flickr.com/3131/2803239794_6a48afbdc3.jpg" title="TiddlyParis"><img src="http://farm4.static.flickr.com/3131/2803239794_6a48afbdc3.jpg" width="400" alt="TiddlyParis" /></a></p>

<p>Yesterday I was fortunate to be able to make the quick trip over to Paris to attend a meeting of <a href="http://tiddlywiki.com">TiddlyWiki</a> enthusiasts at <a href="http://upcoming.yahoo.com/event/1028826/">TiddlyParis</a>. Arranged by long time <a href="http://tiddlywiki.com">TiddlyWiki</a> community member and <a href="http://unamesa.org">Una Mesa</a> stalwart <a href="http://lewcid.org">Saq Imtiaz</a>, this event was a great chance to put some faces to the names of some of the <a href="http://tiddlywiki.com">TiddlyWiki</a> developers and users whose work I have been enjoying and benefitting from for some time.</p>

<p>Gathering in a funky bar on the Champs Elysees, the 10 of us shared a beer or two and got to talk about what we were all doing with <a href="http://tiddlywiki.com">TiddlyWiki</a> and get to know each other a little better.</p>

<p>The spectrum of <a href="http://tiddlywiki.com">TiddlyWiki</a> experience was pleasingly broad. </p>

<p>Zap recently found <a href="http://tiddlywiki.com">TiddlyWiki</a> and is using it to manage his notes and background material to support the effort in writing a novel. He is also tinkering with <a href="http://gettematasks.com">TeamTasks</a> and made the observation that once you start experimenting with ways to customise and extend <a href="http://tiddlywiki.com">TiddlyWiki</a>, you can easily find yourself absorbed in the endeavor. Ideas spring forth even faster than you can execute them.</p>

<p>At the other end of the spectrum we have Jacques, who has been working with <a href="http://tiddlywiki.com">TiddlyWiki</a> since the very early days.  Jacques showed us all his <a href="http://tiddlywiki.com">TiddlyWiki</a> PIM on his 4 year old tablet PC. The file was well over 3MB in size (something of a beast in <a href="http://tiddlywiki.com">TiddlyWiki</a> terms) chock full of content and heavily customised. I  mean really heavily customised!  Jacques had moulded it to fit his way of working and had borrowed from the best <a href="http://tiddlywiki.com">TiddlyWiki</a> adaptations around the web. With advanced workflow management and various task lists, widgets and doohickies, I found it a bit hard to drink it all in, but it was a perfect fit for Jacques and goes everywhere with him.  Jacques pledged to make a blank copy available at some point. You&#8217;ll need to speak French though as he had also carried out extensive translation.</p>

<p><a href="http://farm4.static.flickr.com/3013/2802391393_d939f28c9a.jpg" title="Jacques"><img src="http://farm4.static.flickr.com/3013/2802391393_d939f28c9a.jpg" width="400" alt="Jacques" /></a></p>

<p>I was delighted to learn that relative newcomer Pier, whose Google Maps / <a href="http://tiddlywiki.com">TiddlyWiki</a> mashup gathers information about popular activities and movements around Paris, chose <a href="http://tiddlywiki.com">TiddlyWiki</a> primarily because of its ease of use as a mashup platform. Score!  (He was also attracted by the snazzy tiddler animations!)</p>

<p>Loic Dachary revealed several <a href="http://tiddlywiki.com">TiddlyWiki</a> resources which have been around for a while, but I had failed to stumble upon. Perhaps targeted at the more techie geeks among us, they were impressive nonetheless. My favorite was <a href="http://tiddlywikicp.dachary.org/">TiddlyWiki_CP</a> which is a ruby gem providing a library and a command line interface to copy <a href="http://tiddlywiki.com">TiddlyWiki</a> tiddlers to files and vice versa. Incredibly useful for any developer who builds a variety of TiddlyWikis.</p>

<p><a href="http://farm4.static.flickr.com/3209/2802391055_ca4fe53d4e.jpg" title="Loic"><img src="http://farm4.static.flickr.com/3209/2802391055_ca4fe53d4e.jpg" width="400" alt="Loic" /></a></p>

<p>I was very keen to meet BidiX who has quietly been producing great <a href="http://tiddlywiki.com">TiddlyWiki</a> assets for some time. Recent work includes <a href="http://itw.bidix.info/">iTW</a>, the best iPhone <a href="http://tiddlywiki.com">TiddlyWiki</a> that I know of. The <a href="http://itw.bidix.info/tiddlyparis/">TiddlyParis edition</a> of iTW went with me in my pocket to help me find the venue and read about the agenda.  BidiX is also the man behind <a href="http://tiddlyhome.bidix.info">TiddlyHome</a>, a lovely and seemingly simple hosted <a href="http://tiddlywiki.com">TiddlyWiki</a> resource which he recently deployed to Google App Engine for its <a href="http://th2.bidix.info/">next release</a> (which we got to play with, but he insists isn&#8217;t quite ready for prime time yet).</p>

<p>For my part I spoke about <a href="http://gettematasks.com">TeamTasks</a>, which I was happy to learn was being used to some degree by several people around the table. I also answered questions about <a href="http://bt.com">BTs</a> interest in <a href="http://tiddlywiki.com">TiddlyWiki</a> and motives for being involved in such a project and community.  I&#8217;ll not go over that again here, as it has already been well articulated by several of my colleagues on <a href="http://jermolene.com/2008/08/13/what-is-the-point-of-osmosoft/">their</a> <a href="http://philwhitehouse.blogspot.com/2008/01/managing-open-source-projects.html">blogs</a>.</p>

<p>I went on to talk about a new pet project of mine which, following the <a href="http://tiddlywiki.com">TiddlyWiki</a> convention for absurd names, has been dubbed JigglyWiki. (As it turns out, the French accent lends this name much more gravitas due to the soft &#8216;j&#8217;. Marvelous!)  <a href="http://www.hawksworx.com/journal/2008/08/27/announcing-jigglywiki-a-tiddlywiki-experiment-with-jquery/">JigglyWiki deserves a blog post of its own</a>. For now, through, let&#8217;s just describe it as and experiment to explore what TiddlyWiki 3.0 might be like if it were to be developed from the ground up with the use of the jQuery javascript library and adopt an unobtrusive Javascript approach. </p>

<p>JigglyWiki (I can only hear that in a French accent now!) created quite a bit of discussion.  Proppy and Loic Dachary were particularly vocal about the potential for a <a href="http://tiddlywiki.com">TiddlyWiki</a> implementation benefitting from unobtrusive javascript and built in a modular way with a library such as jQuery.  Debate raged about the need for a javascript library to properly manage plugins and dependancies. A topic that I&#8217;m sure I will be discussing more in a later post.</p>

<p>My thanks go out to all of the folks I encountered at <a href="http://upcoming.yahoo.com/event/1028826/">TiddlyParis</a>. Not only for their passion about <a href="http://tiddlywiki.com">TiddlyWiki</a>, but also for making me feel so welcome and for conducting the entire event in English rather than in French which I know required considerable effort from some.  For what it&#8217;s worth, my French stretched far enough for me to order my meal (which was bloomin&#8217; great) and a few drinks without totally shaming myself. Big thanks also to <a href="http://lewcid.org">Saq Imtiaz</a> for putting it all together. When&#8217;s the next one?!</p>

<p>A bientôt!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hawksworx.com/journal/2008/08/27/enthusiasm-and-good-food-at-tiddlyparis/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
