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

<channel>
	<title>Michael Barrett &#187; Development</title>
	<atom:link href="http://abouthalf.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://abouthalf.com</link>
	<description>@ Abouthalf.com</description>
	<lastBuildDate>Wed, 01 Feb 2012 16:15:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Private enterprise &#8211; The Daily</title>
		<link>http://abouthalf.com/2012/02/01/private-enterprise-the-daily/</link>
		<comments>http://abouthalf.com/2012/02/01/private-enterprise-the-daily/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 16:15:57 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://abouthalf.com/?p=1323</guid>
		<description><![CDATA[This is a nice little article discusses my new favorite search engine, DuckDuckGo. DuckDuckGo&#8217;s best two features are: It has no features It respects your online privacy Well. It&#8217;s not true that it has no features. DuckDuckGo just focuses entirely on web search. It doesn&#8217;t litter the page with garbage-ey social features and doesn&#8217;t filter your [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.thedaily.com/page/2012/01/30/013012-tech-features-duckduckgo-1-2/">This is a nice little article</a> discusses my new favorite search engine, <a href="http://duckduckgo.com/">DuckDuckGo</a>.</p>
<p>DuckDuckGo&#8217;s best two features are:</p>
<ol>
<li>It has no features</li>
<li>It respects your online privacy</li>
</ol>
<p>Well. It&#8217;s not true that it has <em>no</em> features. DuckDuckGo just focuses entirely on web search. It doesn&#8217;t litter the page with garbage-ey social features and doesn&#8217;t filter your search results based upon your past search history.</p>
<p>And sure they have lots of little <a href="http://duckduckgo.com/goodies.html">goodies and widgets</a> but mostly it&#8217;s just a nice clean search engine with no BS.</p>
 <img src="http://abouthalf.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1323" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2012/02/01/private-enterprise-the-daily/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Cut the rope</title>
		<link>http://abouthalf.com/2012/01/10/html5-cut-the-rope/</link>
		<comments>http://abouthalf.com/2012/01/10/html5-cut-the-rope/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 17:11:39 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://abouthalf.com/?p=1314</guid>
		<description><![CDATA[Microsoft is promoting an HTML port of the popular iPhone game &#8220;Cut the rope&#8221; as a part of their marketing and promotion of Internet Explorer 10. It works well in Safari (and probably Chrome too). They include a &#8216;behind the scenes&#8217; page where they discuss some of the technologies used. It&#8217;s fairly interesting but includes some [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft is <a href="http://www.cuttherope.ie/">promoting</a> an HTML port of the popular iPhone game &#8220;Cut the rope&#8221; as a part of their marketing and promotion of Internet Explorer 10. It works well in Safari (and probably Chrome too).</p>
<p style="text-align: center;"><a href="http://www.cuttherope.ie/"><img class="aligncenter size-large wp-image-1315" title="Cut the rope screen capture" src="/wp-content/uploads/2012/01/Screen-Shot-2012-01-10-at-9.05.57-AM-480x309.png" alt="Cut the rope screen capture" width="480" height="309" /></a></p>
<p>They include a &#8216;behind the scenes&#8217; page where they discuss some of the technologies used. It&#8217;s fairly interesting but includes some dumb marketing language:</p>
<blockquote><p>It was a daunting task: get this code into a browser while maintaining the unique personality and incredible quality that gamers are accustomed to. To accomplish this, we bet on JavaScript.</p></blockquote>
<p>Safe bet. When I have to choose between JavaScript or JavaScript I also bet on JavaScript.</p>
<p>&nbsp;</p>
 <img src="http://abouthalf.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1314" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2012/01/10/html5-cut-the-rope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Follow up to the update to the update</title>
		<link>http://abouthalf.com/2011/12/19/follow-up-to-the-update-to-the-update/</link>
		<comments>http://abouthalf.com/2011/12/19/follow-up-to-the-update-to-the-update/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 01:42:21 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[ie9]]></category>

		<guid isPermaLink="false">http://abouthalf.com/?p=1294</guid>
		<description><![CDATA[I recently updated my update on working around Internet Explorer 9’s deficiencies with gradients and rounded corners. Based upon feedback from a friendly reader, I tweaked the HTC script to work when gradients are applied on hover or mouseover states &#8211; the sort of styling you might want to use on a big, friendly, rounded [...]]]></description>
			<content:encoded><![CDATA[<p>I recently <a title="Updated IE9 gradients with rounded corners" href="http://abouthalf.com/2011/10/04/updated-ie9-gradients-with-rounded-corners/">updated my update</a> on working around Internet Explorer 9’s deficiencies with gradients and rounded corners. Based upon feedback from a friendly reader, I tweaked the HTC script to work when gradients are applied on hover or mouseover states &#8211; the sort of styling you might want to use on a big, friendly, rounded form button. Very close to the time I created this HTC workaround, the fantastic <a href="http://www.colorzilla.com/gradient-editor/">Colorzilla</a> gradient editor was updated to support IE 9 in much the same way my script does.</p>
<p>The Colorzilla gradient editor is a visual gradient editor like you might find in <span title="Old busted">Photoshop</span> or <span title="New hotness">Pixelmator</span>. Once you’ve specified your gradient, you see an HTML preview plus CSS style rules to create that gradient in modern browsers, and a reasonable approximation using IE’s filter syntax.</p>
<div id="attachment_1295" class="wp-caption aligncenter  " style="width: 389px"><a href="/wp-content/uploads/2011/12/Screen-Shot-2011-12-19-at-8.33.27-AM.png"><img class="size-large wp-image-1295" title="Colorzilla interface" src="/wp-content/uploads/2011/12/Screen-Shot-2011-12-19-at-8.33.27-AM-389x480.png" alt="Colorzilla interface" width="389" height="480" /></a><p class="wp-caption-text">Click and draggy</p></div>
<p>A new checkbox toggles IE 9 support. Selecting this option includes a base64 encoded SVG background image along with the rest of the browser gradient definitions. In order for this to work properly it is necessary to include an IE9 specific style rule (in a conditional stylesheet) which disables the filter definition for legacy versions of IE. An example of this style rule is included in the application.</p>
<div id="attachment_1296" class="wp-caption aligncenter  " style="width: 458px"><a href="/wp-content/uploads/2011/12/Screen-Shot-2011-12-19-at-8.33.00-AM.png"><img class="size-full wp-image-1296" title="IE 9 feature" src="/wp-content/uploads/2011/12/Screen-Shot-2011-12-19-at-8.33.00-AM.png" alt="IE 9 SVG feature" width="458" height="398" /></a><p class="wp-caption-text">Click the box for IE 9 support</p></div>
<p>I have to confess that I’ve been using this tool in lieu of my own script. There are a few reasons.</p>
<h2 id="pros">Pros</h2>
<p>Having the SVG definition pre-built and available right in-line removes dependencies on JavaScript and means there’s no extra HTC file to keep up with. Additionally, since there’s no scripting involved, there’s no possibility of collisions with your any scripting in your application.</p>
<p>If one wanted, one could just use the SVG definition and remove all the other gradient definitions (except of course the filter rule). Any browser which supports CSS3 gradients will support an SVG background image. This would let you clean out redundant, browser specific style rules in all your gradient styles.</p>
<p>This technique is reasonably future proof, as it uses standard HTML and a standard SVG. If IE 10 fails to support gradients, this technique will still work.</p>
<p>I have no idea if my HTC script will work on the new mobile IE on Windows Phone 7and (hypothetically) Windows 8. (If someone wants to give me a free Windows Phone, I’ll be happy to test.)</p>
<h2 id="cons">Cons</h2>
<p>If you’re using CSS3 gradient definitions, it’s technically possible to tweak or edit them “by hand” without using a special tool. To make any changes to an encoded SVG image you’ll either have to decode, edit, and re-encode or you’ll have to create a new image from scratch. If you’re using a tool like the Colorzilla gradient editor, this isn’t a huge problem &#8211; but it’s still an extra step.</p>
<p>Since the SVG gradient is encoded inline in the main stylesheet, all browsers must download this image whether they use it or not. So in a way you’re punishing all users for IE 9’s sins. My dynamic solution targets IE 9 specifically.</p>
<p>It is possible that one day this tool will simply disappear. If that happens, then designers and developers might be scrambling for a replacement.</p>
<h2 id="irecommend">I recommend</h2>
<p>I recommend using Colorzilla’s tool over my script for supporting IE 9 gradients. In practice, I find it’s simply far easier for me to just define a gradient and copy/paste the generated CSS into mine, and follow up with a little clean up once the design is settled.</p>
<p>I’m happy with my script, and there may be cases where it’s preferred (smaller download sizes, targeting only modern desktop browsers, etc) but I think the Pros of using Colorzilla’s tool outweigh the Cons.</p>
 <img src="http://abouthalf.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1294" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2011/12/19/follow-up-to-the-update-to-the-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mr. Stephen Fry helps around the office</title>
		<link>http://abouthalf.com/2011/10/28/mr-stephen-fry-helps-around-the-office/</link>
		<comments>http://abouthalf.com/2011/10/28/mr-stephen-fry-helps-around-the-office/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 15:43:10 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://abouthalf.com/?p=1279</guid>
		<description><![CDATA[Mr. Stephen Fry helps out around the office by announcing to my colleagues which development environment is about to be updated.]]></description>
			<content:encoded><![CDATA[<div id="attachment_1280" class="wp-caption aligncenter  " style="width: 432px"><a href="/wp-content/uploads/2011/10/MrFrySays.png"><img class="size-large wp-image-1280" title="MrFrySays" src="/wp-content/uploads/2011/10/MrFrySays-432x480.png" alt="" width="432" height="480" /></a><p class="wp-caption-text">Attention!</p></div>
<p>Mr. Stephen Fry helps out around the office by announcing to my colleagues which development environment is about to be updated.</p>
 <img src="http://abouthalf.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1279" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2011/10/28/mr-stephen-fry-helps-around-the-office/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated IE9 gradients with rounded corners</title>
		<link>http://abouthalf.com/2011/10/04/updated-ie9-gradients-with-rounded-corners/</link>
		<comments>http://abouthalf.com/2011/10/04/updated-ie9-gradients-with-rounded-corners/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 15:53:14 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://abouthalf.com/?p=1265</guid>
		<description><![CDATA[Update to the update: I&#8217;ve made a slight modification to the HTC script to handle mouse-over / hover events better. By &#8220;better&#8221; I mean &#8220;it handles them now.&#8221; Thanks to the reader who suggested it. Some time ago I wrote up a hacky way to work around an annoying IE9 bug. The full write-up has [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update to the update:</strong> I&#8217;ve made a slight modification to the HTC script to handle mouse-over / hover events better. By &#8220;better&#8221; I mean &#8220;it handles them now.&#8221; Thanks to the reader who suggested it.</p>
<hr />
<p><a title="Internet Explorer 9 gradients with rounded corners" href="http://abouthalf.com/2010/10/25/internet-explorer-9-gradients-with-rounded-corners/">Some time ago I wrote up a hacky way to work around an annoying IE9 bug</a>.</p>
<p>The full write-up has the details, but in short, Internet Explorer 9 doesn’t play well with CSS3 border radius rules (for rounded corners on boxes) and IE’s proprietary gradient filter. The gradient pokes out from underneath the rounded corners. <em>Unsightly</em>.</p>
<p>Since IE9 has full support for SVGs, you can substitute an SVG for a gradient background on any arbitrarily sized HTML element.</p>
<p>Supporting both CSS3 gradients plus MS gradient filters <em>and</em> an extra SVG image plus supporting CSS is clunky at best. CSS hacks are best when they’re invisible.</p>
<p>With a little experimentation I learned one could extract the gradient details from MS’ gradient filter and build an SVG with those details. IE9 has robust support for data URIs in CSS, which means I could base64 encode the constructed SVG and use it as a background image.</p>
<p><a href="http://abouthalf.com/examples/ie9roundedbackgrounds/htc-sample.html">Blammo</a>.</p>
<p>What you have here is an HTC (HTML Component) which, on “contentready”, extracts gradient filter data, builds an SVG, base64 encodes that SVG, creates a stylesheet and style rule to hold that encoded data, and then applies the new background style to the element in question, and caches all this info so the next element with the same gradient definition just inherits the new style rule.</p>
<div id="attachment_1266" class="wp-caption aligncenter  " style="width: 480px"><a href="/wp-content/uploads/2011/10/Screen-Shot-2011-10-02-at-9.26.34-PM.png"><img class="size-large wp-image-1266" title="Screen capture of gradient bug and fix" src="/wp-content/uploads/2011/10/Screen-Shot-2011-10-02-at-9.26.34-PM-480x409.png" alt="" width="480" height="409" /></a><p class="wp-caption-text">Screen capture of gradient bug and fix</p></div>
<p>Because each gradient is defined in a style rule, and then reused as needed, it’s pretty <a href="http://abouthalf.com/examples/ie9roundedbackgrounds/htc-performance.html">fast</a>.</p>
<p><a href="http://abouthalf.com/examples/ie9roundedbackgrounds/htc-multiple.html">An example with many gradients</a>.</p>
<p><a href="http://abouthalf.com/examples/ie9roundedbackgrounds/htc.zip">Download the zipped HTC file and .htaccess file</a>.</p>
<p>You can enable the filter in your IE9-targeted CSS in an HTML document like so:</p>
<pre><code>&lt;!--[if ie 9]&gt;
	&lt;style type="text/css" media="screen"&gt;
		.filter
		{
			behavior: url(ie9-gradient-fix.htc);
		}
	&lt;/style&gt;
&lt;![endif]--&gt;</code></pre>
<p>This HTC doesn’t sniff out the version of IE, so it should be included in a conditional stylesheet.</p>
<p>IE9 is more strict with HTCs than previous versions. You’ll need to make sure your web server is sending HTC files with the correct mime type, otherwise IE9 will ignore it. If you’re hosting on Apache, add the following to your .htaccess file or host configuration:</p>
<pre><code>AddType text/x-component .htc</code></pre>
<p>I’m pretty sure that Windows servers will take care of this automatically, but I don’t care.</p>
<h2 id="details">Details</h2>
<p>HTC files are basically a way to attach JavaScript event handlers to HTML elements via CSS selectors. In the following example, event handlers defined in behavior.htc are attached to all paragraph elements that are contained within a DIV element having the CSS class name “foo”.</p>
<pre><code>div.foo p {behavior: url(behavior.htc);}</code></pre>
<p>It’s like a primitive jQuery. Event handlers are defined and attached to elements at the beginning of the HTC document:</p>
<pre><code>&lt;PUBLIC:ATTACH EVENT="oncontentready" ONEVENT="myOnContentReadyHandler()" /&gt;</code></pre>
<p>Later in the document a javascript function is defined with the same signature: <code>myOnContentReadyHandler()</code>. Within that function the JS keyword “this” refers to the element the event handler is attached to. So my example function could make all the <code>&lt;p&gt;</code> tags in a <code>&lt;div&gt;</code> with a class of “foo” disappear like so:</p>
<pre><code>function myOnContentReadyHandler()
{
	this.style.display = "none";
}</code></pre>
<h3 id="thegradientfixtheoryofoperation">The gradient fix theory of operation</h3>
<p>Here’s how the IE9 gradient fix works:</p>
<ol>
<li>Determine if the current element has both at least one rounded corner via CSS border-radius and a gradient filter applied. If so, continue.</li>
<li>Determine if the current filter gradient has already been processed and cached. If not, continue building the background SVG</li>
<li>Extract the starting color, ending color, and direction (horizontal or vertical) for the gradient from the filter css rule using the element’s <code>currentStyle</code> property</li>
<li>If the colors are using #AARRGGBB format (a proprietary form of RGBA color) &#8211; extract the alpha value and convert to a decimal value from 0 to 1 for use in the SVG.</li>
<li>Using the extracted colors, opacity, and gradient direction. Build an SVG graphic with a single gradient definition and a single rectangle filled with that gradient.</li>
<li>Base64 encode the SVG</li>
<li>Create a style rule with a unique classname selector defining a background image using the encoded SVG image in a data uri and removing the filter definition (e.g. removing the original gradient background).</li>
<li>Append the style rule to a dynamically created stylesheet.</li>
<li>Cache the class name of the new style rule in a globally accessible object using the filter rule definition as a key (this should be reasonably unique)</li>
<li>Apply the class name to the element.</li>
</ol>
<p>In step #2, if the filter definition exists in the cache, we skip to step #10 and apply the cached class name to the element. This way gradients are only created once per page request and reused throughout the page.</p>
<p>Below are some gotchas or other considerations.</p>
<h3 id="assumptionsconditions">Assumptions/Conditions</h3>
<ol>
<li>HTC files only work when javascript is enabled.</li>
<li>Elements with filter gradients have no other MS filters.</li>
</ol>
<h3 id="creatingastylesheetwithinanhtc">Creating a stylesheet within an HTC</h3>
<p>HTC files, once loaded by IE, have their own document namespace. If you want to build a stylesheet dynamically from within an HTC, you’ll need to reference the ‘window.document’ namespace.</p>
<pre><code>window.document.createStyleSheet();</code></pre>
<h3 id="cssistricky">CSS is tricky</h3>
<p>The SVG background is applied via a CSS classname &#8211; the CSS rule corresponding to that class name is added to a new stylesheet, which should appear last in the list of stylesheets for the document. The declaration which unsets the original filter background uses an <code>!important</code> rule. So the new background image styles should override any previously defined background styles. However, your CSS may not play nicely with this dynamically created style rule. If the gradient pokes through your nicely rounded corners, consult IE9’s dev tools and make sure that you don’t have a CSS rule that’s overriding the dynamic rule.</p>
<h3 id="base64">Base64</h3>
<p>I didn’t write my own base64 encoding function. I’m no dummy. I used the JavaScript class provided by <a title="Base64" href="http://www.webtoolkit.info/javascript-base64.html">WebTookKit.info</a>.</p>
 <img src="http://abouthalf.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1265" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2011/10/04/updated-ie9-gradients-with-rounded-corners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook in the news</title>
		<link>http://abouthalf.com/2011/09/27/facebook-in-the-news/</link>
		<comments>http://abouthalf.com/2011/09/27/facebook-in-the-news/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 14:26:18 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://abouthalf.com/?p=1257</guid>
		<description><![CDATA[Facebook is starting a Political Action Committee. (Facebook, and most major tech companies employ lobbyists &#8211; Facebook has been ramping up their presence in DC) Facebook is scaring Dave Winer &#8211; Dave Winer writes about &#8216;frictionless  sharing&#8217; &#8211; a feature of where sites who partner with Facebook can automatically post to your news feed (and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nytimes.com/2011/09/27/us/politics/in-turn-to-politics-facebook-starts-a-pac.html?_r=1&amp;smid=tw-nytimes&amp;seid=auto">Facebook is starting a Political Action Committee.</a> (Facebook, and most major tech companies employ lobbyists &#8211; Facebook has been ramping up their presence in DC)</p>
<p><a href="http://scripting.com/stories/2011/09/24/facebookIsScaringMe.html">Facebook is scaring Dave Winer</a> &#8211; Dave Winer writes about &#8216;frictionless  sharing&#8217; &#8211; a feature of where sites who partner with Facebook can automatically post to your news feed (and therefore to your friends and creepy  subscribers)</p>
<p><a href="http://nikcub-static02.appspot.com/logging-out-of-facebook-is-not-enough">Nik Cubrilovic does a little testing and notes that  you never <em>really </em>log out of Facebook</a> &#8211; meaning that all the &#8220;like&#8221; buttons you see on other sites know who you are and what you&#8217;re looking at even if you&#8217;re not logged in. A person commenting on that article claims to be Facebook engineer; he claims that Facebook never uses this data for tracking, but this <a href="http://blogs.wsj.com/digits/2011/09/26/facebook-defends-getting-data-from-logged-out-users/">Wall Street Journal article</a> contradicts that stating the data is used and then <em>totally deleted. </em>You can trust us.</p>
<p>After a couple of days, and a lot of noisy web traffic, <a href="http://nikcub.appspot.com/facebook-fixes-logout-issue-explains-cookies">Facebook works with Nik Cubrliovic to explain itself and it&#8217;s cookies and fixes a bug </a>(which left your user id in an undeleted cookie)</p>
<p>If you can&#8217;t quit Facebook, because otherwise there&#8217;s no way to get Gramma&#8217;s cookie recipes, you should consider using a browser extension like <a href="http://www.orbicule.com/incognito/">Incognito</a> which blocks all this cookie tracking nonsense.</p>
 <img src="http://abouthalf.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1257" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2011/09/27/facebook-in-the-news/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RGBA in IE 7 and 8</title>
		<link>http://abouthalf.com/2011/08/23/rgba-in-ie-7-and-8/</link>
		<comments>http://abouthalf.com/2011/08/23/rgba-in-ie-7-and-8/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 21:22:55 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://abouthalf.com/?p=1222</guid>
		<description><![CDATA[I found this little trick today for tricking legacy IE into using RGBA colors &#8211; that is a color defined with transparency. It seems to work fairly well, with some caveats, specifically potential font weirdness. http://kilianvalkhof.com/2010/css-xhtml/how-to-use-rgba-in-ie/]]></description>
			<content:encoded><![CDATA[<p>I found this little trick today for tricking legacy IE into using RGBA colors &#8211; that is a color defined with transparency. It seems to work fairly well, with some caveats, specifically potential font weirdness.</p>
<p><a href="http://kilianvalkhof.com/2010/css-xhtml/how-to-use-rgba-in-ie/">http://kilianvalkhof.com/2010/css-xhtml/how-to-use-rgba-in-ie/</a></p>
 <img src="http://abouthalf.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1222" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2011/08/23/rgba-in-ie-7-and-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enhanced documents and applications</title>
		<link>http://abouthalf.com/2011/08/13/enhanced-document-and-applications/</link>
		<comments>http://abouthalf.com/2011/08/13/enhanced-document-and-applications/#comments</comments>
		<pubDate>Sat, 13 Aug 2011 23:24:53 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://abouthalf.com/?p=1176</guid>
		<description><![CDATA[I&#8217;ve been doing a little work at home with jQuery and jQuery Mobile recently; at the jobby job we use ExtJS widgets and components. Comparing the two has me thinking. Each of these javascript libraries represents a different philosophical approach to developing web applications. jQuery Mobile is an extension of the jQuery library, and similarly [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing a little work at home with jQuery and jQuery Mobile recently; at the jobby job we use ExtJS widgets and components. Comparing the two has me thinking. Each of these javascript libraries represents a different philosophical approach to developing web applications.</p>
<p>jQuery Mobile is an extension of the jQuery library, and similarly Ext JS components are based on the Ext Core library. Both core libraries do similar things. They normalize browser differences in event handling and XmlHttp request implementations; they add to or extend the core browser document object model; they provide a means to create custom events and subscribe to these events with handlers; and they provide an API to create custom components or plugins. They approach things slightly differently. jQuery focuses on a xpath/CSS selector based API for working with DOM elements. Ext has this feature too, but also creates some base classes to supplement javascript&#8217;s core objects. Ext<a href="#fn:ext-prototype" id="fnref:ext-prototype" title="see footnote" class="footnote">1</a> also extends some of the core javascript objects (like String and Array) to provide additional functionality. Beyond this though, the libraries diverge.</p>
<p>Ext is component based. The goal of the library is to provide the developer with reusable application components that can be wired up with data access objects which, to a certain degree, simulate a database or an object store in javascript. The dataobjects are configured to communicate with your server application via XmlHttp request. This approach is also used by libraries like Sproutcore. Components include toolbars, forms, various navigational tools, panels, modals, dialogs, charts, etc. The components can be used independently on a given HTML page, but they are often brought together into a complete application that works much like a desktop application that lives in a browser. The default themes provided with Ext look very much like a Windows XP era desktop application.</p>
<p>jQuery has some <a href="http://jqueryui.com/" title="jQuery UI">ui components</a> as well, but the scope is limited. jQuery UI basically extends HTML with a few extra niceties like date picking components, tabbed navigation, sliding selectors (imagine a volume control) and so on. These components aren&#8217;t really designed to be bolted together into an application. Instead they <em>enhance</em> an existing HTML interface. This underscores the differences in philosophy.</p>
<p>I think of jQuery&#8217;s approach as an enhanced, interactive document approach &#8211; where each web page is just that, a page of information. The page can be used (or at least read) without javascript enabled and, more importantly, be discovered and interpreted by search engines. Netflix.com is a good example of this pattern.</p>
<p>Ext embraces an application approach. The web page, the HTML document, is a host for a complete software application written in javascript<a href="#fn:ext-html" id="fnref:ext-html" title="see footnote" class="footnote">2</a>. The application doesn&#8217;t function (or even exist) if the browser doesn&#8217;t have javascript enabled. The application is effectively invisible to search engines. Gmail is a good example of this kind of application, so are Apple&#8217;s old Mobile Me applications (soon to be replaced with iCloud apps, I suppose).</p>
<p>These approaches can  be combined. Google+ and Facebook have document centric &#8220;core&#8221; functionality like news feeds, but advanced features like &#8220;chat&#8221; and contact management are application-like modules that are welded onto the document base. </p>
<p>Combined or not though, I think these are <em>the</em> two ways of thinking about client side architecture of web applications. Each method has its tradeoffs.</p>
<h2 id="theenhanceddocumentapproach">The enhanced document approach</h2>
<h3 id="youget">You get</h3>
<ul>
<li>Search engine visibility, and likewise the possibility to support older browsers or javascript disabled or inhibited browsers</li>
<li>Separation of concerns: The design and HTML/CSS implementation of that design can be largely, if not completely, separated from the interactivity</li>
<li>Complete design control</li>
<li>Shallow learning curve</li>
<li>The ability to create a simple page/application first, then add features as they are discovered or needed.</li>
<li>Lightweight JS and interaction model &#8211; for example a simple web page can be made highly interactive with a small amount of custom JS supported jQuery. The full Ext library is rather large.</li>
</ul>
<h3 id="youlose">You lose</h3>
<ul>
<li>Enhanced interactivity. Powerful widgets like data grids and the like must either be manually integrated, built custom, or done without.</li>
<li>Speed of prototyping and development. With a toolkit like Ext or Sproutcore, there&#8217;s probably already a widget that&#8217;s pretty close to what you need. The widget might be used as-is in a prototype, and extended for the real application.</li>
</ul>
<h2 id="theapplicationapproach">The application approach</h2>
<h3 id="youget">You get</h3>
<ul>
<li>Speed of prototyping and development</li>
<li>A reasonably good look and feel (if not UI design) &#8220;out of the box&#8221;</li>
<li>Advanced features that resemble &#8220;real&#8221; desktop software (this can be very important in, say, a corporate setting)</li>
<li>Easier division of server side and client side development. For example, an Ext developer can build an entire application powered by dummy JSON data, while the Java developer builds out a RESTful server application to support it. They only need to agree on the data api.</li>
</ul>
<h3 id="youlose">You lose</h3>
<ul>
<li>Time due to high learning curve</li>
<li>Design flexibility</li>
<li>Integration of legacy or third party client side components may be difficult or impossible.</li>
<li>Search engine visibility</li>
<li>Libraries, components, and custom javascript tend to be large and complex with these sorts of applications</li>
<li>Performance can be poor on slower machines</li>
</ul>
<p>I imagine a seasoned jQuery developer reading this and thinking &#8220;but I just downloaded a data grid plugin for jQuery&#8230;&#8221;; there&#8217;s an Ext developer somewhere thinking &#8220;I just wrote my fifth custom Ext theme, it&#8217;s not that big of a deal…&#8221;. All true. These lists are just big executive level<a href="#fn:executive-level" id="fnref:executive-level" title="see footnote" class="footnote">3</a> ways of thinking about the two approaches.</p>
<p>The next time I have to make a big decision about which approach to take with some new development, I&#8217;ll probably use this list (or a list like it) as my guide. The next time I have to convince a room full of <strike>wolves</strike> developers to take an approach, I&#8217;ll definitely make a big list on a big white board.</p>
<hr />
<p>I&#8217;m working on a small personal project now in which I&#8217;m taking the enhanced document approach. This approach has allowed me to work pretty quickly by banging out the required features using standard HTTP type web application methods (forms, links, and redirects) while planning for more advanced features down the road. Also, because I&#8217;m forced somewhat to keep things simple, it&#8217;s allowing me to target desktop browsers and mobile browsers at more or less the same time (because I completely control the design) which is pretty cool too.</p>
<div class="footnotes">
<hr />
<ol>
<li id="fn:ext-prototype">
<p>Ext reminds me a lot of the Prototype JS library in this way<a href="#fnref:ext-prototype" title="return to article" class="reversefootnote">&#160;&#8617;</a></p>
</li>
<li id="fn:ext-html">
<p>Of course Ext components ultimately deliver HTML to the browser &#8211; but that HTML is generated by the Ext library itself. A developer only touches HTML if they are creating a custom component.<a href="#fnref:ext-html" title="return to article" class="reversefootnote">&#160;&#8617;</a></p>
</li>
<li id="fn:executive-level">
<p>Right in spirit, wrong on facts.<a href="#fnref:executive-level" title="return to article" class="reversefootnote">&#160;&#8617;</a></p>
</li>
</ol>
</div>
 <img src="http://abouthalf.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1176" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2011/08/13/enhanced-document-and-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be careful with those hash-bangs, kids</title>
		<link>http://abouthalf.com/2011/07/22/be-careful-with-those-hash-bangs-kids/</link>
		<comments>http://abouthalf.com/2011/07/22/be-careful-with-those-hash-bangs-kids/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 01:36:08 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://abouthalf.com/?p=1118</guid>
		<description><![CDATA[Oh, Twitter. The other day Twitter went &#8216;bonk&#8217; &#8211; which hey, stuff happens &#8211; but because the site has no non-javascript fallback it went boom. Be careful out there, kids.]]></description>
			<content:encoded><![CDATA[<p>Oh, Twitter.</p>
<div id="attachment_1119" class="wp-caption aligncenter  " style="width: 393px"><a href="/wp-content/uploads/2011/07/Screen-shot-2011-07-18-at-5.43.48-PM.png"><img class="size-large wp-image-1119" title="Twitter done broke" src="/wp-content/uploads/2011/07/Screen-shot-2011-07-18-at-5.43.48-PM-393x480.png" alt="Twitter done broke" width="393" height="480" /></a><p class="wp-caption-text">Twitter data feed borked the display of the site.</p></div>
<p>The other day Twitter went &#8216;bonk&#8217; &#8211; which hey, stuff happens &#8211; but because the site has no non-javascript fallback it went boom.</p>
<p>Be careful out there, kids.</p>
 <img src="http://abouthalf.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1118" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2011/07/22/be-careful-with-those-hash-bangs-kids/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Poor man&#8217;s nth-child selector for IE 7 and 8</title>
		<link>http://abouthalf.com/2011/07/06/poor-mans-nth-child-selector-for-ie-7-and-8/</link>
		<comments>http://abouthalf.com/2011/07/06/poor-mans-nth-child-selector-for-ie-7-and-8/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 03:27:26 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[ie8]]></category>

		<guid isPermaLink="false">http://abouthalf.com/?p=1073</guid>
		<description><![CDATA[I&#8217;ve been doing some client side development at the jobbity job. I had to re-discover the zen art of making shit work in Internet Explorer. I pulled an old trick out of my hat that I thought would be worth sharing. Internet Exploer 7, and 8 do not support the nth-child pseudo element selector, but [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing some client side development at the jobbity job. I had to re-discover the zen art of making shit work in Internet Explorer.</p>
<p>I pulled an old trick out of my hat that I thought would be worth sharing.</p>
<p>Internet Exploer 7, and 8 do not support the <a href="http://www.w3.org/TR/css3-selectors/#nth-child-pseudo">nth-child</a> pseudo element selector, but they do support the <a href="http://www.w3.org/TR/css3-selectors/#adjacent-sibling-combinators">adjacent sibling</a> selector. This means you can fake a basic nth-child selector for IE with the following:</p>
<pre><code>/* standard nth */
ul.menu li:nth-child(3)
{
    /* styles for the 3rd LI */
}

/* IE nth */
ul.menu&gt;li + li + li
{
    /* styles for the 3rd LI */
}

/* alternate, more specific IE nth */
ul.menu&gt;li:first-child + li + li
{
    /* styles for the 3rd LI */
}
</code></pre>
<p>Complex or formulaic nth-child selectors, or selectors with keywords are not possible with this method &#8211; but it does mean you can style, say, all the known list items in a static menu without resorting to lots of IDs or class names.</p>
<p>And no, of course this doesn&#8217;t work in IE 6 If you&#8217;re targeting IE 6 in this day and age you need to rethink your web strategy.</p>
 <img src="http://abouthalf.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1073" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2011/07/06/poor-mans-nth-child-selector-for-ie-7-and-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

