<?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>AlastairC</title>
	<atom:link href="http://alastairc.ac/feed/" rel="self" type="application/rss+xml" />
	<link>http://alastairc.ac</link>
	<description>Kything web interactions</description>
	<lastBuildDate>Tue, 24 Jan 2012 23:25:03 +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>Is HRD equivalent to eye exposure?</title>
		<link>http://alastairc.ac/2012/01/hdr-like-eye-exposure/</link>
		<comments>http://alastairc.ac/2012/01/hdr-like-eye-exposure/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 22:32:24 +0000</pubDate>
		<dc:creator>AlastairC</dc:creator>
				<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://alastairc.ac/?p=802</guid>
		<description><![CDATA[<img src="/wp-content/uploads/2012/01/cathedral-new2-150x111.jpg" alt="" width="150" height="111" class="alignleft" />In a rare non-web related post, I had a thought on HDR (High Dynamic Range) photography I wanted to share. Some people seem anti-HDR, I've just been trying it out.]]></description>
			<content:encoded><![CDATA[<p>In a rare non-web related post, I had a thought on HDR (High Dynamic Range) photography I wanted to share. Some people seem anti-HDR, I&#8217;ve just been trying it out and explaining what I&#8217;ve found. NB: I&#8217;m relatively new to photography, so this is my experience, I&#8217;m not trying to be authoritative.</p>
<h2><abbr title="To long, didn't read">TL;DR</abbr> version</h2>
<p>When your eye looks around a scene, it will automatically adapt to the differences in brightness. In photographic terms, your eye creates many &#8216;exposures&#8217; as you look around a scene.</p>
<p>When you take a photograph at one exposure, it isn&#8217;t as adaptable so the contrast in a dark and bright scene is very harsh.</p>
<p>Therefore, an HDR pictures (multiple exposure combined into one) is more like what you would see than the &#8216;normal&#8217; pictures.</p>
<p>However, like any effect, it can be taken too far.</p>
<h2>Example</h2>
<p>Wondering around Bristol last weekend, a saw the sun behind the main Cathedral, which is a pretty impressive building.</p>
<p>The &#8216;normal&#8217; shot looks like this:</p>
<p><img src="http://alastairc.ac/wp-content/uploads/2012/01/1-shot.jpg" alt="Shot of the cathedral, wide angle from quite close, with very bright sky and quite dark building." title="Canon 550D, 17-55mm at 17mm, ISO 100, F5, 1/60" width="500" height="333" class="centered size-full wp-image-803" /></p>
<p>Ok, but nothing special. By normal, I just mean that I set the aperture to F5, and the camera took an average reading of the scene and decided on the exposure time. A lot of the time that means the sky gets washed out to white, as shown above. You can&#8217;t actually see the clouds that were there.</p>
<p>In this case, I took a bracketed shot, where you set the camera up to take three (or 5) shots. The first is the standard one, and then it takes an under-exposed version, and then an over-exposed version.</p>
<p>Those shots look like this, and you can see the sky properly in the middle one:</p>
<p><a href="/wp-content/uploads/2012/01/3-shots.jpg"><img src="http://alastairc.ac/wp-content/uploads/2012/01/3-shots-300x66.jpg" alt="Three shots, standard, dark and light." title="Second shot is at 1/250, third shot is at 1/30." width="300" height="66" class="centered size-medium wp-image-804" /></a></p>
<p>You then stick those shots into a programme like Photomatix or Photoshop and it blends them together to even out the exposure.</p>
<p>A lot of HDR looks rather fake, but the default isn&#8217;t necessarily unnatural looking:</p>
<p><img src="http://alastairc.ac/wp-content/uploads/2012/01/hdr-neutral.jpg" alt="A more even version of the cathedral image." title="PHotomatix version " width="497" height="330" class="centered size-full wp-image-806" /></p>
<p>The sky is a bit blue and the clouds a bit yellow, but you could handle that with any photo-editor.</p>
<p>You can also go mental with it, and you&#8217;ll see a few shots like this around:</p>
<p><img src="http://alastairc.ac/wp-content/uploads/2012/01/hdr-extreme.jpg" alt="An un-real looking picture where the cathedral is actually brighter and more colourful than the sky!"  width="500" height="333" class="centered size-full wp-image-807" /></p>
<p>However, if you aren&#8217;t so heavy handed, I quite like this version, especially at full size (click through for that):<br />
<a href="http://alastairc.ac/wp-content/uploads/2012/01/cathedral-new2.jpg"><img src="http://alastairc.ac/wp-content/uploads/2012/01/cathedral-new-sm.jpg" alt="A reasonable looking shot of the same thing, moderate shadows and sky."  class="centered size-medium wp-image-808" /></a></p>
<p>For me, that is closer to what I was seeing, because at the time, my eye would flick to the building and I could see the details, and then flick to the sky and not see a washed-out white thing.</p>
<p>People, sky and water are not easy to capture with HDR, but it has found a place in my arsenal. If you are interested in HDR photography, I recommend checking out <a href="https://plus.google.com/105237212888595777019/">Trey Ratcliff&#8217;s</a> <a href="http://www.stuckincustoms.com/hdr-tutorial">StuckinCustoms</a>. Apart from using <a href="http://www.pixelmator.com/">Pixelmator</a> instead of Photoshop (which I can&#8217;t use to save my life), I learned about HDR from his site.</p>
]]></content:encoded>
			<wfw:commentRss>http://alastairc.ac/2012/01/hdr-like-eye-exposure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zooming bug in Webkit</title>
		<link>http://alastairc.ac/2012/01/zooming-bug-in-webkit/</link>
		<comments>http://alastairc.ac/2012/01/zooming-bug-in-webkit/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 00:08:12 +0000</pubDate>
		<dc:creator>AlastairC</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Front-end code]]></category>
		<category><![CDATA[media queries]]></category>
		<category><![CDATA[responsive design]]></category>
		<category><![CDATA[zoom]]></category>

		<guid isPermaLink="false">http://alastairc.ac/?p=786</guid>
		<description><![CDATA[<img class="alignleft size-thumbnail wp-image-794" title="Boston globe zoomed in Chrome" src="http://alastairc.ac/wp-content/uploads/2012/01/boston-globe-chrome-200-150x108.png" alt="Boston globe zoomed in Chrome" width="150" height="108" />I've noticed a bug in Webkit browsers that impacts accessibility: Zooming in does not trigger media queries. Responsive design techniques can really help people who zoom in with their browser, but not in Chrome or Safari at the moment.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve noticed a bug in Webkit browsers (Chrome and Safari) that impacts accessibility: Zooming in does not trigger media queries.</p>
<p>To show the effect, take a recent responsive design such as the <a href="http://bostonglobe.com/">Boston Globe</a> and zoom in. In Firefox, Internet Explorer or Opera and it behaves how I expected, the media-queries trigger and the layout adapts:</p>
<p><a href="/wp-content/uploads/2012/01/boston-globe-ff-both.png"><img class="aligncenter size-full wp-image-792" title="Boston Globe Firefox screenshots" src="http://alastairc.ac/wp-content/uploads/2012/01/boston-globe-ff-both-small.png" alt="Two screen shots of the boston globe site at different zoom levels." width="500" height="187" /></a></p>
<p>&nbsp;</p>
<p>However, when you try the same thing with Chrome or Safari, the zoom works (text and images get bigger), but all within the same layout:</p>
<p><a href="/wp-content/uploads/2012/01/boston-globe-chrome-both.png"><img class="aligncenter size-full wp-image-793" title="Boston Globe Chrome screenshots." src="http://alastairc.ac/wp-content/uploads/2012/01/boston-globe-chrome-both-small.png" alt="Two screenshots using Chrome, where the zoomed in version has a lot of overlapping elements." width="500" height="182" /></a></p>
<p>&nbsp;</p>
<p>NB: I think it is around 200% zoom, but it may be a little off.</p>
<p>It gets even more obvious when you scroll down, as you have huge text in narrow columns.</p>
<h2>Accessibility</h2>
<p>It looks like a bug, but you might be asking what effect that has on accessibility? The main impact is on people with mild to moderate visual impairment who use browser controls to increase the visibility of websites.</p>
<p>The browser landscape has changed a lot in the last few years, including how browsers zoom. In ye-olde days most browsers allowed you to increase the text size. Now the default method across virtually all browsers is to &#8220;zoom&#8221;, which increases the size of <em>everything</em>.</p>
<p>Zoom works well for people who need things a bit bigger unless you immediately get <strong>horizontal scrolling</strong>. That is why <a href="http://www.alistapart.com/articles/responsive-web-design/">responsive designs</a> (which re-flows the layout at smaller resolutions) work well for zooming, because the layout adapts to the available width.</p>
<h2>What is a zoomed pixel?</h2>
<p>I don&#8217;t know what the root cause is, however, from a front-end development point of view it is as though Firefox and Internet Explorer increase the effective pixel size, so when you zoom in there are less pixels in the same area. Webkit does not seem to take the same approach.</p>
<p>It is not event-related, as reloading the page does not trigger the media queries (except the edge-case described below). Overall it is very odd, because the reported pixel size of the window does change, at least for JavaScript (<a href="/testing/window_sizing.html">test example</a>).</p>
<p>Mobile Webkit uses a different style of zooming, as when you &#8216;zoom in&#8217; the window stays the same, but your view zooms in without affecting the layout. I wonder if this is a conflicting method?</p>
<p>Another oddity is the difference when using EMs. I created a <a href="/testing/media-query-width.html">simple test case of max-width media queries</a> in pixels and EMs. If you zoom in so the page reports less than 500px of width, neither triggers. However, if you then refresh the page, the EM based query (only) does trigger. Bizarre, but another facet to the bug(s).</p>
<p>I suspect that Google is aware of some issues to do with this, otherwise you wouldn&#8217;t get a red-banner warning if you zoom in on a Google Doc:</p>
<p><a href="/wp-content/uploads/2012/01/Good-doc-warning.png"><img class="aligncenter size-medium wp-image-790" title="Google doc warning" src="http://alastairc.ac/wp-content/uploads/2012/01/Good-doc-warning-300x107.png" alt="Screenshot of a blank Google document with a red banner saying this zoom level is not supported." width="300" height="107" /></a></p>
<p>It might not affect many people at the moment (although that is debatable), but Chrome is rapidly gathering market share, so either it will affect people or it reduces Webkit browsers usefulness on the desktop.</p>
<p>I&#8217;m not in the Webkit browser world, so my question is: where&#8217;s the best place to report this?</p>
]]></content:encoded>
			<wfw:commentRss>http://alastairc.ac/2012/01/zooming-bug-in-webkit/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The &#8220;Open Web Stack&#8221; &#8211; Snappy acronym needed</title>
		<link>http://alastairc.ac/2011/01/the-open-web-stack-snappy-acronym-needed/</link>
		<comments>http://alastairc.ac/2011/01/the-open-web-stack-snappy-acronym-needed/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 18:13:50 +0000</pubDate>
		<dc:creator>AlastairC</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://alastairc.ac/?p=759</guid>
		<description><![CDATA[<img src="/wp-content/uploads/2011/01/is_it_really_html5.png" alt="The W3C&#039;s new logo for HTML5 with a whacking great question mark next to it." title="HTML5, really?" width="180" height="128" class="alignleft size-full wp-image-761" />Chris Mills at the Web Standards project posted up <a href="http://www.webstandards.org/2011/01/18/regarding-the-html5-logo/">an open letter to the W3C</a> about the new "<a href="http://www.w3.org/html/logo/">HTML5 logo</a>", which I commented on, but it seems comments are off. So here's what I wrote...]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2011/01/is_it_really_html5.png" alt="The W3C&#039;s new logo for HTML5 with a whacking great question mark next to it." title="HTML5, really?" width="180" height="128" class="alignleft size-full wp-image-761" />Chris Mills at the Web Standards project posted up <a href="http://www.webstandards.org/2011/01/18/regarding-the-html5-logo/">an open letter to the W3C</a> about the new &#8220;<a href="http://www.w3.org/html/logo/">HTML5 logo</a>&#8220;, which I commented on, but it seems comments are off. So here&#8217;s what I wrote:</p>
<p class="cl">Good points, and I certainly agree with not using HTML5 as the umbrella term.</p>
<p>However, I’m not sure <a href="http://adactio.com/journal/4289/">Jeremy’s point</a> that we didn’t need a catch-all term for “HTML4.01 plus JavaScript” is going to help. (We did have DHTML as an umbrella term. Ok, that is a tarnished example, but my point is that people still remember the acronym.).</p>
<p>Presumably the aim of the logo is to let (non-developers) know that a site is built with a certain set of technologies?</p>
<p>So the next question is: <strong>What should the umbrella term be?</strong></p>
<p>I believe Eric Meyer has been using “Open web stack”, which is accurate and works with developers. However, I think we need something a little shorter and snappier (preferably an acronym of 6 letters or less that can be pronounced easily. Like AJAX.).</p>
<p>Something that combines W3C, open, web… the WOW stack? Maybe not, <strong>any other ideas?</strong></p>
<p>We need <em>something else</em>, or HTML5 will become entrenched as the umbrella term.</p>
]]></content:encoded>
			<wfw:commentRss>http://alastairc.ac/2011/01/the-open-web-stack-snappy-acronym-needed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PDF vs HTML for organisations</title>
		<link>http://alastairc.ac/2011/01/pdf-vs-html-for-organisations/</link>
		<comments>http://alastairc.ac/2011/01/pdf-vs-html-for-organisations/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 19:00:46 +0000</pubDate>
		<dc:creator>AlastairC</dc:creator>
				<category><![CDATA[PDF / Flash]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://alastairc.ac/?p=747</guid>
		<description><![CDATA[<p>The Australian Government recently released <a href="http://www.finance.gov.au/publications/pdf-accessibility-study/index.html">a study</a> into the Accessibility of the Portable Document Format (PDF) for people with a disability, which <a href="http://www.appligent.com/talkingpdf-AGIMO-Report-Assessment">Duff Johnson analysed</a> very effectively. </p>
<p>I can agree with <em>almost</em> all of Duff&#8217;s points, and it&#8217;s covered so well I didn&#8217;t feel I needed to&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>The Australian Government recently released <a href="http://www.finance.gov.au/publications/pdf-accessibility-study/index.html">a study</a> into the Accessibility of the Portable Document Format (PDF) for people with a disability, which <a href="http://www.appligent.com/talkingpdf-AGIMO-Report-Assessment">Duff Johnson analysed</a> very effectively. </p>
<p>I can agree with <em>almost</em> all of Duff&#8217;s points, and it&#8217;s covered so well I didn&#8217;t feel I needed to check the source material (although I will). But as is the nature of blogging, there is something I&#8217;d like to disagree with:<br />
The comparison with HTML.</p>
<p>Duff knows a great deal more than I do about PDF standards and technologies, however, I&#8217;m pretty strong on the web-standards side of things, so it&#8217;s a useful discussion around the intersection of these areas.</p>
<p>I&#8217;d not heard it put in this way, but it is an excellent point:</p>
<blockquote title="Quote from Duff Johnson" cite="http://www.appligent.com/talkingpdf-AGIMO-Report-Assessment" id="main-quote">
<h4>PDF creation is democratic, HTML is centralized</h4>
<p>&#8230;most people don&#8217;t write HTML, so most don&#8217;t author documents with any attention to semantics. Since PDFs may be created and posted without the benefit of a content management professional, it&#8217;s harder to impose authoring standards outside of specific organizations.</p>
</blockquote>
<p>I agree with the point made, but there is a good reason why HTML websites are more likely to be accessible than PDFs in this context: <strong>the interface</strong>.</p>
<h2 id="lockdown">Interface lockdown</h2>
<p>When you <a href="http://alastairc.ac/2006/09/wysiwyg-editor-spec/">setup the editor</a> in a Content Management System, you can lock it down to <em>only</em> allow semantic elements. You can even make the inclusion of style-oriented elements look wrong by adding certain CSS. </p>
<p>The key thing is that the available options are accessible, and the inaccessible ones have been removed (e.g. font/background colours). There are <a href="http://alastairc.ac/category/wysiwyg-editors/">other things to do</a>, but that problem is <strong>solved once</strong>, and then works for that website ongoing. If the CMS is sufficiently usable, you can even extend the number of contributors without worrying about the accessibility.</p>
<p>Theoretically, you can also lock down <strong>Word templates</strong> so that you can only use Word&#8217;s styles (I&#8217;m not sure about InDesign?). However, it&#8217;s a pain to implement, and I&#8217;ve not come across an organisation prepared to do so.</p>
<h2 id="process-docs">How organisations typically publish documents</h2>
<p>In a typical medium/large organisation that publishes web content, it is generally non-technical people updating web pages and uploading documents. When I&#8217;ve run courses teaching people how to make accessible PDFs, it is generally people on a web team that attend (government, private and charity sector organisations). Not coders, content authors and managers.</p>
<p>The web team are usually happy with the web pages, but they are sent inaccessible PDFs to publish, often without access to the source documents. The central team simply doesn&#8217;t have the resource to <strong>repeat the same accessibility fixes</strong> on every document they are sent. </p>
<p>I&#8217;m not blaming PDF for this situation, I&#8217;m even reluctant to blame Microsoft (where the interface matters most), it&#8217;s the people buying software that aren&#8217;t aware of the issue. </p>
<p>Pressure from organisational procurement (on Microsoft and Adobe) to provide a good option to use a locked down interface (and enforce it&#8217;s use) would prevent most of the accessibility problems we see. Oh, not to mention some more competition in the PDF-tagging software space.</p>
<p id="conclusion">Therefore, I agree with Duff that the report is likely to lead to an ineffective policy, even though I have a different perspective on why.</p>
]]></content:encoded>
			<wfw:commentRss>http://alastairc.ac/2011/01/pdf-vs-html-for-organisations/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Bristol Council CMS discussion</title>
		<link>http://alastairc.ac/2010/09/bristol-council-cms-discussion/</link>
		<comments>http://alastairc.ac/2010/09/bristol-council-cms-discussion/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 13:31:21 +0000</pubDate>
		<dc:creator>AlastairC</dc:creator>
				<category><![CDATA[Real life]]></category>
		<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[councils]]></category>
		<category><![CDATA[procurement]]></category>

		<guid isPermaLink="false">http://alastairc.ac/?p=711</guid>
		<description><![CDATA[<img src="/wp-content/uploads/2010/09/IMG_0673-150x122.jpg" alt="Presentation slide." width="150" height="122" class="alignleft size-thumbnail wp-image-712" />I attended the Roundtable Discussion about Bristol City Council’s Future Web Platform, an interesting insight into how local authorities think about their web presence. Something about the presentations &#38; process jarred with me, and it took a little while to work out what the problem was: <strong>the assumptions</strong>. I've dissected some of them and proposed new ones.]]></description>
			<content:encoded><![CDATA[<p>I attended the <a href="http://bccwww.wordpress.com/2010/08/10/roundtable/">Roundtable Discussion</a> about Bristol City Council’s Future Web Platform, an interesting insight into how local authorities think about their web presence. Something about the presentations &amp; process jarred with me, and it took a little while to work out what the problem was: <strong>the assumptions</strong>.</p>
<p>I&#8217;d glanced through the <a href="http://bccwww.files.wordpress.com/2010/08/func-andtech-requirements-cms.pdf">requirements</a>, which were relatively good for a Council, but obviously include everything and the kitchen sink. The presentation gave a brief outline, these are some key slides for the requirements:<br />

<a href='http://alastairc.ac/2010/09/bristol-council-cms-discussion/img_0673/' title='Presentation slide 1'><img width="150" height="122" src="http://alastairc.ac/wp-content/uploads/2010/09/IMG_0673-150x122.jpg" class="attachment-thumbnail" alt="Website functionality, including ability to create multiple website, personalisation, forms engine, multi-lingual." title="Presentation slide 1" /></a>
<a href='http://alastairc.ac/2010/09/bristol-council-cms-discussion/img_0674/' title='Presentation slide 2'><img width="150" height="121" src="http://alastairc.ac/wp-content/uploads/2010/09/IMG_0674-150x121.jpg" class="attachment-thumbnail" alt="Web presence: web 2.0 functionality, video &amp; audio, alerts and messages." title="Presentation slide 2" /></a>
<a href='http://alastairc.ac/2010/09/bristol-council-cms-discussion/img_0675/' title='Presentation slide 3'><img width="150" height="120" src="http://alastairc.ac/wp-content/uploads/2010/09/IMG_0675-150x120.jpg" class="attachment-thumbnail" alt="Technologies: Java or Microsoft, 5 year roadmap, open standards enabling interoperability." title="Presentation slide 3" /></a>
</p>
<p>Apologies for the picture quality, check out the full presentations on <a href="http://bccwww.wordpress.com/2010/09/13/presentations-from-fridays-event/">Bristol City Council&#8217;s blog</a>. (Some of it is available on <a href="http://www.connectingbristol.org/2010/09/09/live-webcast-roundtable-discussion-about-the-councils-future-web-platform/">Connecting Bristol</a> in video.)</p>
<p>I think these requirements will lead the Council down just the same path they are trying to escape. Particularly:</p>
<ul>
<li><strong>Using Java</strong> or Microsoft (internally support technologies)</li>
<li>Having a <strong>5 Year roadmap</strong></li>
<li><strong>Over-arching requirements</strong> that affect all other functionality; such as being multi-lingual, personalised, and accessible. Assuming that each of the specific functionalities (e.g. forum) has to meet those over-arching requirements (which is implied), they create an enormous overhead. Not that they are unachievable, but the chances of a traditional CMS being able to meet them across all the specific functionalities are non-existant.</li>
</ul>
<p>Although not in the slides, there are two implicit requirements:</p>
<ul>
<li><abbr title="Bristol City Council">BCC</abbr> do not want to be trapped using a niche product with limited suppliers.</li>
<li>The &#8216;solution&#8217; would be a single product</li>
</li>
<p>Unfortunately there isn&#8217;t a solution that will meet those requirements.</p>
<h2>Java</h2>
<p><strong>NB:</strong> There was no-mention of Microsoft &#8216;solutions&#8217; at the meeting, so I&#8217;m assuming <abbr title="Bristol City Council">BCC</abbr> don&#8217;t believe one would be open or cheap enough.</p>
<p>I would ditch this requirement for several reasons:</p>
<dl>
<dt>It assumes people unfamiliar with the website&#8217;s development will edit it.</dt>
<dd>Even if a Java CMS were used, why would Council staff mess with the CMS? Perhaps if the internal staff are involved in the development work it would be ok. But then, why use an external supplier at all? Assuming that the Council physically host it then they can and should administer the system, but it doesn&#8217;t need to be in Java for that. I would separate the development from the (hosting) administration, and have a contract with the developers for support for the application(s).</dd>
<dd>Another option would be to hand-off the hosting to the company developing the website (or their hosting partner).</dd>
<dt>Java isn&#8217;t used by people creating modern websites.</dt>
<dd>I have nothing against Java, and it is eminently suitable for many purposes. Unfortunately quick development of a modern website is not one of them. I recently looked around for a Java framework that produced good, clean, accessible HTML. There are some promising developments (e.g. <a href="http://www.grails.org/">Grails</a>), but as a general rule Java developers/development doesn&#8217;t tend to care about the front-end. For example, a client was considering the Java Icefaces framework, who&#8217;s <a href="http://www.icefaces.org/main/ajax-java/jsf-components.iface">knowledge of accessibility</a> is years behind current thinking.</dd>
<dt>How future proof is Java?</dt>
<dd>Another count against Java (especially in a 5 year time frame) is whether it will be open. Since Oracle bought Sun, and especially since they <a href="http://news.cnet.com/8301-30684_3-20013546-265.html">sued Google over Java</a>, Java&#8217;s future direction is in doubt. Not that I think <abbr title="Bristol City Council">BCC</abbr> would have a legal issue, but Java could be a legacy technology in 5 years.</p>
</dd>
<dt>Java is inherently a heavy technology.</dt>
<dd>We used to use Java for <a href="http://www.nomensa.com/">our</a> CMS, and using the <abbr title="Java Virtual Machine">JVM</abbr> plus database and webserver is a lot for a server. Compared to a LAMP stack (or our preferred Linux/Nginx/Postgres/Python) you won&#8217;t get a lot of bang for your buck. A modern website tends to integrate multiple streams (e.g. RSS), databases of things, and related components, and if you look at the big players (Yahoo, Facebook etc.) they aren&#8217;t using Java as their primary technology. Neither are the products catering to small players (e.g. WordPress &#038; Drupal)</p>
</dd>
</dl>
<h2>5 year roadmap</h2>
<p>This requirement is inherently going to discriminate against open source solutions. The nature of open source development is distributed and reactive, there isn&#8217;t a &#8220;guy in marketing&#8221; who will draw up a customer friendly roadmap.</p>
<p>You need to either to find a partner company with a good track record who looks like they will be around in 5 years, or go into the initial development assuming that you&#8217;ll have to be able to move off the solution with a 1 year turn-around.</p>
<p>I also don&#8217;t think that proprietary solutions are realistically better here, it&#8217;s just as likely they&#8217;ll get bought out or go under. The difference between an open source CMS dying out (like <a href="http://forge.osor.eu/projects/aplaws/">APLAWS</a>) and a proprietary one going under is negligible, you&#8217;d have to migrate in both cases.</p>
<h2>Overarching Requirements </h2>
<p>These are useful and necessary requirements (e.g. accessibility), I&#8217;m not suggesting they are ditched, just that combined with the desired functionality, the Council should not be looking at one product.</p>
<h2>Start at a lower level</h2>
<p>Council (in fact most) procurement starts with the assumption that you can draw up a list of requirements, and assess a series of products and see how well they match. CMS products (commercial and open source) are built to meet these tick-lists.</p>
<p>The thing is, <strong>the more boxes a product can tick, the less likely it is going to do it well</strong>. You know that joke about consultants? They can be quick, good, cheap: pick any two.</p>
<p>There is a similar &#8216;law&#8217; of content management systems, pick two out of:</p>
<ul>
<li>Quick to implement</li>
<li>Flexible functionality</li>
<li>Have an easy to use interface</li>
</ul>
<p>Take WordPress as a well known example, it&#8217;s got a reasonably good interface, and it can be very quick to implement. However, it isn&#8217;t going to be flexible enough for the Council&#8217;s requirements (e.g. changing the workflow).</p>
<p>Drupal can be quick to implement (for sites which have the same assumptions that Drupal makes), it is quite flexible, but it&#8217;s a pig to use for non-technical authors. (You can modify the interface, but then it&#8217;s not quick to implement.)</p>
<p>Having done some Reddot development, that is fairly quick to implement a site, and the interface for authors is ok, but extending it can be a nightmare. </p>
<h2>New assumptions</h2>
<p>So what to do? The most important change in assumptions are:</p>
<ul>
<li><strong>The website will be highly customised</strong> and that a traditional CMS is not going to meet the council&#8217;s requirements.</li>
<li>Start with only the core requirements to provide the most important services, and a roadmap.</li>
</ul>
<p>I&#8217;ve done a lot of user-research with local authorities, and if you don&#8217;t get the basics right (easy access to core services) all the fancy &#8216;Web 2.0&#8242; style functionality is wasted.</p>
<p>My recommendation for technical direction would be to use a framework based approach. Use a lower-level framework like <a href="http://www.djangoproject.com/">Django</a>, <a href="http://rubyonrails.org/">Ruby on Rails</a> or <a href="http://www.asp.net/mvc">MS MVC</a>. These were created as toolsets for creating modern web sites / applications. Some companies have CMS type products that provide an easy-to-use interface that sit on top, just be careful they retain the flexibility of the underlying framework. The key is that you start with a core website and build exactly what you need.</p>
<p>Another approach would be to assume the use of several technologies. For example, use Drupal as the main tool for the website, but assume that there will be an extended development time for customisation, and other products will be used, skinned and customised.</p>
<p>I prefer the framework approach, as you spend less time working around the assumptions of the CMS, but it depends on the situation. Let&#8217;s hope the Council can get past the standard thinking.</p>
<hr />
<h2>My biases</h2>
<p>I think everyone at the meeting has some inherent bias or agenda, I&#8217;ll make mine explicit:<br />
I work for a company (<a href="http://www.nomensa.com">Nomensa</a>) that does work with local authorities (and others) in the area of user-research, web design and content management. The usual disclaimer that these are my words applies.</p>
<p>So in experience terms, I&#8217;ve run or seen lots of usability testing, Information Architecture sessions, and focus groups of citizens/customers for local authorities. I&#8217;ve also been involved with many CMS-migration / redesign projects at local authorities (and other markets).</p>
<p>I&#8217;ve also spearheaded development of our (DJango based) Content Management System Defacto (website updating soon), which was born out of frustration with inflexible and inaccessible CMS products.</p>
<p>However, what I&#8217;ve written above is my honest assessment, we haven&#8217;t bid for the website and I don&#8217;t have any commercial interest at this time, just a Bristonian&#8217;s interest!</p>
]]></content:encoded>
			<wfw:commentRss>http://alastairc.ac/2010/09/bristol-council-cms-discussion/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Send to my&#8230; fridge?</title>
		<link>http://alastairc.ac/2010/09/send-to-my-fridge/</link>
		<comments>http://alastairc.ac/2010/09/send-to-my-fridge/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 23:37:35 +0000</pubDate>
		<dc:creator>AlastairC</dc:creator>
				<category><![CDATA[Usability / IA]]></category>
		<category><![CDATA[Web APIs]]></category>
		<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[boxee]]></category>
		<category><![CDATA[huffduffer]]></category>
		<category><![CDATA[instapaper]]></category>

		<guid isPermaLink="false">http://alastairc.ac/?p=688</guid>
		<description><![CDATA[<img src="/wp-content/uploads/2010/09/boxee-example-150x84.png" alt="" title="Boxee screenshot" width="150" height="84" class="alignleft size-thumbnail wp-image-693" />I've noticed a trend in how I use the internet now, where I use different aspects of it in different contexts. In my browser there is a set of bookmarks in a folder called "Send to", which allows me to direct resources to different places.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve noticed a trend in how I use the internet now, where I use different aspects of it in different contexts. In my browser there is a set of bookmarks in a folder called &#8220;Send to&#8221;, which allows me to direct resources to different places.</p>
<p>Admittedly I&#8217;m on the geeky side; I&#8217;ve got lots of gadgets. However, I&#8217;m have very lazy/efficient habits and would rather spend several hours setting something up if it saves me time in the long run. The main things I have setup are:</p>
<ul>
<li><a href="http://delicious.com/">Delicious</a></li>
<li><a href="http://www.instapaper.com/">Instapaper</a></li>
<li><a href="http://huffduffer.com/">Huffduffer</a></li>
<li><a href="http://boxee.tv">Boxee</a></li>
</ul>
<p>What that actually equates to is that I use those resources on my:</p>
<ul>
<li>Laptop (working)</li>
<li>iPad (reading)</li>
<li>iPod (listening)</li>
<li>TV (watching)</li>
</ul>
<p>The key is that it is easy, and largely automated. If I see an audio file on a webpage, I can use a bookmarklet to &#8216;huffduff&#8217; it. iTunes will then download it automatically and it appears on my iPod the next time I sync.</p>
<p>Boxee and Instapaper are even quicker, as external services they sync over wireless. For example, a friend sends me a funny YouTube video whilst I&#8217;m at work, I hit &#8220;send to Boxee&#8221;. </p>
<p>Next time I&#8217;m lounging on the sofa, I open up Boxee on the television (via the Mac Mini) and up pops the funny video in my list. (I do recommend watching the <a href="http://www.youtube.com/watch?v=U9lFe504i2s">James Galea card trick</a> by the way.)</p>
<p><a href="/wp-content/uploads/2010/09/boxee-example.png"><img src="/wp-content/uploads/2010/09/boxee-example.png" alt="Screen shot from Boxee that shows a listing of online videos I&#039;ve added." title="Boxee example" class="size-full wp-image-693" /></a></p>
<p>The key is not the device per-se, it&#8217;s the situation. I can read/watch/listen on my laptop, but I&#8217;d rather send funny videos to my living room, and read long articles away from my computer.</p>
<h2>Where will it go from here?</h2>
<p>I can only see this type of functionality becoming more widespread. Google has already added &#8216;Send to mobile&#8217; to the Chrome browser for sending to an Android phone. It feels like when Jack Bower (in 24) says <q>Send it to my screen!</q>, but more fun.</p>
<p>I picked on fridges for the title of this post because it is the household appliance that was always touted as being internet enabled someday, but could this be useful soon?</p>
<p>Apply the &#8220;send to&#8221; principle to e-commerce and I could see something online and order it to my fridge. That doesn&#8217;t sound very practical. This example would be better the other way around, so that when I am at my fridge, I&#8217;d know I&#8217;ve run out of something and it has a &#8220;send to&#8221; feature that goes straight to a shopping list on my computer, or even to the supermarket.</p>
<p>If you are creating an online service, the simplest implementation at the moment is to create bookmarklets for people to &#8216;send to&#8217; your service. You can win over a lot of users by not making them think, now you can also enable them to use the most appropriate device for their context.</p>
]]></content:encoded>
			<wfw:commentRss>http://alastairc.ac/2010/09/send-to-my-fridge/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Are browser-updates a thing of the past?</title>
		<link>http://alastairc.ac/2010/05/are-browser-updates-a-thing-of-the-past/</link>
		<comments>http://alastairc.ac/2010/05/are-browser-updates-a-thing-of-the-past/#comments</comments>
		<pubDate>Wed, 05 May 2010 23:07:38 +0000</pubDate>
		<dc:creator>AlastairC</dc:creator>
				<category><![CDATA[Browsers]]></category>

		<guid isPermaLink="false">http://alastairc.ac/?p=649</guid>
		<description><![CDATA[<img src="/wp-content/uploads/2010/05/chrome_stats_2010-05-05.png" alt="Chrome stats during the upgrade from three to four, they switch between February and March." width="150" class="alignleft" />I noticed something in the browser stats before I noticed it on my laptop - Google's Chrome doesn't ask you about updates. I knew, almost subconsciously, that there was a Google updater programme running. However, I didn't realise the impact it could have on web development, and potentially users as well.]]></description>
			<content:encoded><![CDATA[<p>I noticed something in the browser stats before I noticed it on my laptop &#8211; Google&#8217;s Chrome doesn&#8217;t ask you about updates. I knew, almost subconsciously, that there was a Google updater programme running. However, I didn&#8217;t realise the impact it could have on web development, and potentially users as well.</p>
<p>A small part of StatCounter&#8217;s Global statistics for browser versions caught my eye:<br />
<a href="http://gs.statcounter.com/#browser_version-ww-monthly-200904-201005"><img src="/wp-content/uploads/2010/05/global_stats_2010-05-05.png" alt="Global browser version statistics from StatCounter." title="" class="aligncenter size-full wp-image-650" /></a></p>
<p>You might remember from Jacob Neilson&#8217;s Alert Box that we were <a href="http://www.useit.com/alertbox/990418.html">stuck with old browsers for three years</a>:</p>
<blockquote><p><img src="http://www.useit.com/alertbox/990418_browserversions.gif" alt="Browser usage in the late '90s, showing slow upgrade times."></p>
</blockquote>
<p>With <a href="http://cwilso.com/2010/04/30/the-ie-plateau-a-history-lesson/">IE6&#8242;s plateau</a>, it seemed like things were getting worse. Even Firefox (with more tech-savvy users, we assume) is taking the better part of a year to drop under 5% from the release of a new version.</p>
<h2>The Google Way</h2>
<p>But now there is a new browser in town, with a web application perspective. Let&#8217;s zoom in on Chrome, when it updated from Chrome 3 to 4. Light green is 3, dark green is 4:</p>
<p><img src="/wp-content/uploads/2010/05/chrome_stats_2010-05-05.png" alt="Chrome stats during the upgrade from three to four, they switch between February and March." width="250" class="centered" /></p>
<p>In a month, <strong>Chrome 3 virtually disappeared</strong> (5% down to 0.3%), and Chrome 4 took off.</p>
<p>As a web developer: This is fantastic! No more waiting for users to download, they don&#8217;t even need to think about it. I don&#8217;t need to worry about having multiple browsers installed, because the general population can&#8217;t use old versions.</p>
<p>As a user: It&#8217;s great&#8230; until it breaks. Taking the choice away about <em>when</em> to update a program strikes me as dangerous.</p>
<p>The potential danger is very limited at the moment because Chrome is not bursting with pluggins and isn&#8217;t relied on by anything else. However, pluggins are becoming more popular, and upgrades that break web-apps could be a new problem.</p>
<p>We know how well Microsofts upgrades are received when they break things, if Chrome carries on gaining market-share, is it risking the same issues without even giving people the choice of when to update?</p>
<h2>Update (August 2010)</h2>
<p>This is a consistent approach from Google, the update from 4 to 5 happened just as quickly:</p>
<p><a href="http://gs.statcounter.com/#browser_version-ww-monthly-200908-201007"><img src="http://alastairc.ac/wp-content/uploads/2010/05/chrome-stats.png" title="" alt="Browser stats chart, showing chrome 4 dip to almost nothing, and Chrome 5 take over." width="176" height="184" class="centered" /></a></p>
<p>The line that chrome overtakes in July is IE6 by the way, so Chrome 5 is more popular than IE6 now.</p>
]]></content:encoded>
			<wfw:commentRss>http://alastairc.ac/2010/05/are-browser-updates-a-thing-of-the-past/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 and WAI-ARIA</title>
		<link>http://alastairc.ac/2010/04/accessibility-and-html5/</link>
		<comments>http://alastairc.ac/2010/04/accessibility-and-html5/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 13:41:04 +0000</pubDate>
		<dc:creator>AlastairC</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[W3C]]></category>

		<guid isPermaLink="false">http://alastairc.ac/?p=229</guid>
		<description><![CDATA[I've recently been struck by a parallel: the differences between usability and accessibility are very similar to the differences between writing the HTML5 spec and covering accessibility requirements. Perhaps that can help explain the friction, and why WAI-ARIA is needed.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been struck by a parallel: the differences between usability and accessibility are very similar to the differences between writing the <abbr title="HyperText Markup Language 5">HTML5</abbr> spec and covering accessibility requirements.</p>
<h2>Creating the HTML5 spec is like usability practice</h2>
<p>I haven&#8217;t been following the HTML5 progress very closely (how much time does that take?!), but skimming the surface, the friction between developers in the &#8216;accessibility community&#8217; and some of the core group developing HTML5 is obvious.</p>
<p>Usability tries to optimise for the majority. Techniques such as usability testing (with a representative sample) are oriented around getting the best results for the least expense. The changes to the interface based on usability testing should be kept simple and consistent for the majority of people.<br />
I would guess that writing a spec is also an exercise in trying to keep things simple and coherent.</p>
<p><a href="/2009/04/is-usability-actually-accessibility/">Accessibility overlaps a lot with usability</a>, and historically <em>web-standards + usability = accessibility</em>. </p>
<p>However, there can be a few things missing, such as alt-text and making sure the keyboard focus is visible. These don&#8217;t get noticed by the majority of people, but are needed for people with particular requirements.</p>
<p>During the creation of HTML5 there have been several arguments around what is needed for accessibility, such as <a href="http://www.w3.org/html/wg/wiki/IssueAltAttribute">whether to make alt text required</a>, and <a href="http://www.w3.org/html/wg/wiki/IssueTableHeaders">whether table headers are needed</a>.</p>
<p>I completely understand that it&#8217;s very difficult to create an understandable, cohesive spec for HTML, so everything possible has to be done to minimise the complexity. However, accessibility is something that has to be included in such as way that developers and authors can create <em>all </em>their content in a way that is accessible.</p>
<p>For example, although complex tables are rare, it is necessary that they can be created in a way that works for everyone. Otherwise Governments and Financial institutions that <em>have</em> to publish content accessibly will have to go elsewhere. (Such as <abbr title="Portable Document Format.">PDF</abbr>.) </p>
<p><a href="http://adactio.com/journal/1343">Jeremy Keith summed this up</a> well in 2007: </p>
<blockquote cite="http://adactio.com/journal/1343" title="Jeremy Keith on Pareto's Principle."><p>I am more than a little concerned at the way that studying existing behaviour is being held up as a make-or-break point in discussions around HTML5&#8230; By their very nature, accessibility concerns are not going to affect the majority of users.</p></blockquote>
<p>So yes, it&#8217;s useful to pave the cowpaths when you know the common ground, but sometimes you also add another path for those that need it.</p>
<h2 id="wai-aria"><abbr title="Web Accessibility Initiative">WAI</abbr>-<abbr title="Accessible Rich Text Applications">ARIA</abbr></h2>
<p>There is an argument brewing about whether HTML5 makes WAI-ARIA redundant, and a <a href="http://annevankesteren.nl/2010/04/clean-markup-plea">plea for clean mark-up</a>. </p>
<p>I agree that simpler markup is better, and that native controls tend to work best. I wouldn&#8217;t want to use something that creates front-end code based on Java people have written. However, some people (at rather large companies) do, and so you get the lowest common-denominator crap code that <a href="http://www.paciellogroup.com/blog/?p=585">Steve Falkner pointed out</a>.</p>
<p>So yes: it would be better if people like Google used cleaner code. However, even if browsers improve the styling of elements so that Google doesn&#8217;t feel the need to use krufty code, and HTML5 arrives, we are not there yet. </p>
<p>Working only on a future spec where the native controls don&#8217;t exist yet is kind of like saying to people with disabilities: &#8220;Don&#8217;t worry about your internet access for now, you can have intermittent dial-up for the moment, and we&#8217;ll get you broadband in a few years.&#8221; That doesn&#8217;t cut it.</p>
<p>There are several reasons why <a href="http://www.w3.org/WAI/PF/aria/">WAI-ARIA</a>is needed:</p>
<ul>
<li>It bridges a gap highlighted by modern web apps.</li>
<li>It can be added now without causing compatibility issues.</li>
<li>It can be added at a function level (e.g. to GWT and JavaScript libraries).</li>
</ul>
<p><del datetime="2010-04-22T16:56:31+00:00">There is another important reason though: <strong>It should help simplify the HTML5 spec.</strong></p>
<p><em>Should</em> HTML5 cover all the elements in WAI-ARIA? For example, should there be a &#8216;tab&#8217; element that HTML authors need to know about?</p>
<p>There isn&#8217;t, and I think that&#8217;s ok.</del></p>
<p><ins datetime="2010-04-22T16:56:31+00:00">I&#8217;ve been reading into this more, and would like to modify my stance. The trigger was this: <q><a href="http://www.w3.org/html/wg/wiki/ChangeProposals/KeepNewElements#Semantics_are_best_expressed_at_the_semantic_layer_.28HTML.29.2C_not_at_the_presentation_layer_.28CSS.29_or_the_accessibility_layer_.28ARIA.29">Semantics are best expressed at the semantic layer</a> (HTML), not at the presentation layer (CSS) or the accessibility layer (ARIA)</q>, and the realisation that this is the built-in approach, where as WAI-ARIA is the bolt-on approach.</p>
<p>One thing I&#8217;m not clear on though, is what approach JavaScript libraries should take. Historically, people creating (web) applications have been really, really awful at using the limited HTML 4.01 semantics properly. Is adding more elements going to help that? Something like WAI-ARIA can probably be built into a Library more easily than adjusting elements dynamically.</ins></p>
]]></content:encoded>
			<wfw:commentRss>http://alastairc.ac/2010/04/accessibility-and-html5/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Detecting touch-based browsing</title>
		<link>http://alastairc.ac/2010/03/detecting-touch-based-browsing/</link>
		<comments>http://alastairc.ac/2010/03/detecting-touch-based-browsing/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 17:39:17 +0000</pubDate>
		<dc:creator>AlastairC</dc:creator>
				<category><![CDATA[Front-end code]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://alastairc.ac/?p=614</guid>
		<description><![CDATA[<img class="alignleft size-thumbnail wp-image-616" title="Touch me, copyright jjjohn." src="http://alastairc.ac/wp-content/uploads/2010/03/touch-me-150x100.jpg" alt="" width="150" height="100" />I came across a situation recently where a JavaScript widget didn't 'work' on the iPhone. It did technically work, but without knowing about two-fingered scrolling (and when you need to use it), it didn't appear to work. So how do you differentiate the iPhone (and other touch based devices) from a regular browser?]]></description>
			<content:encoded><![CDATA[<div class="update">Please note, the method I outlined used <code>ontouchmove</code>, which was also picked up by Google Chrome 6. I changed it to use <code>ongesturestart</code>, which excluded Chrome 6. Now Chrome 7 (windows) does not pick up <code>ontouchmove</code> or <code>ongesturestart</code>.</div>
<p><a href="http://www.flickr.com/photos/jjjohn/2947070519/sizes/o/"><img class="alignleft size-thumbnail wp-image-616" title="Touch me, copyright jjjohn." src="http://alastairc.ac/wp-content/uploads/2010/03/touch-me-150x100.jpg" alt="A finger pointing down towards you, blurry figure and trees in the background." width="150" height="100" /></a>I came across a situation recently where a JavaScript widget didn&#8217;t &#8216;work&#8217; on the iPhone. It did technically work, but without knowing about two-fingered scrolling (and when you need to use it), it didn&#8217;t appear to work. So how do you differentiate the iPhone (and other touch based devices) from a regular browser?<br />
Well, we all know <a href="http://www.quirksmode.org/js/support.html">object detection</a> beats browser detection, but what object would you detect?</p>
<p>The issue in this case was with the <a href="http://www.prismstudio.co.uk/plugins/stylish-select/0.4/">Stylish Select</a> jQuery pluggin. It replaces a standard drop-down with a nicer looking one. It is reasonably accessible as well, supporting keyboard use.</p>
<p>However, it creates a <code>div</code> with <code>overflow </code>of <code>auto </code>and a fixed <code>height</code>, which in desktop browsers creates a scroll bar. In the iPhone, it looks as though you can only select the ones that are initially visible, because there is no scroll bar.</p>
<p>In this case there is a nice fall-back: the select box that the JavaScript is replacing. The iPhone (and I assume other mobile browsers) show this in a system-native way.</p>
<p>So the question becomes how do you detect that a touch-based device is in use?</p>
<p>The solution came from this article on <a href="http://perfectionkills.com/detecting-event-support-without-browser-sniffing/">Detecting event support without browser sniffing</a>, however, it does more than I was looking for, and wasn&#8217;t aimed at touch based detection.</p>
<p>I put together a little script that so far, seems to do what I&#8217;d like:</p>
<pre><code>function isTouchDevice() {
   var el = document.createElement('div');
   el.setAttribute('ongesturestart', 'return;');
   if(typeof el.ongesturestart == "function"){
      return true;
   }else {
      return false
   }
}</code></pre>
<p>Currently this script gives good results for:</p>
<ul>
<li>IE8 / Win (no event detected)</li>
<li>FF 3.6 / Win (no)</li>
<li>Chrome / Win (no)</li>
<li>iPhone 4.0 (yes)</li>
</ul>
<p>I originally picked <code>ontouchmove</code> as a fairly advanced touch event, but Google&#8217;s Chrome started firing for that event. I&#8217;ve moved to <code>ongesturestart</code> which works for now, but may also be used in Chrome later.</p>
<p>If you have another device or browser, please try the <a href="/testing/touch_events.html">test page</a> and let me know the results.</p>
]]></content:encoded>
			<wfw:commentRss>http://alastairc.ac/2010/03/detecting-touch-based-browsing/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Removing empty HTML tags from TinyMCE</title>
		<link>http://alastairc.ac/2010/03/removing-emtpy-html-tags-from-tinymce/</link>
		<comments>http://alastairc.ac/2010/03/removing-emtpy-html-tags-from-tinymce/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 14:53:24 +0000</pubDate>
		<dc:creator>AlastairC</dc:creator>
				<category><![CDATA[Front-end code]]></category>
		<category><![CDATA[WYSIWYG editors]]></category>

		<guid isPermaLink="false">http://alastairc.ac/?p=609</guid>
		<description><![CDATA[A little post for those that run into the same problem I had with TinyMCE and blank instances not quite being blank. I created a little configuration to remove empty HTML tags.]]></description>
			<content:encoded><![CDATA[<p>A little post for those that run into the same problem I had with TinyMCE and blank instances not quite being blank. I created a little configuration to remove empty HTML tags.</p>
<p>If you have an editable box with TinyMCE, and that box will appear on the website if it contains content, sometimes you can get a &#8216;blank&#8217; box. When a user deletes content from the box, they might not delete everything in the box, leaving some blank HTML tags.</p>
<p>For example, if there was a list of links, and you use the mouse to select the list, and press delete, it can leave either <code>&lt;ul&gt;&lt;/ul&gt;</code>, or <code>&lt;ul&gt;&lt;li&gt;&lt;/li&gt;&lt;/ul&gt;</code> depending on the browser.</p>
<p>In our CMS, when that went through to the front-end page the HTML content meant the box was displayed, but without visible content.</p>
<p>I messed around with some of the <a href="http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.Editor#Events">TinyMCE API events</a>, ruling out onSaveContent and onSubmit.</p>
<p>The key event was <a href="http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.Editor/onPostProcess">onPostProcess</a>, which allows you to run a script on the content before it is submitted.</p>
<p>Combine that with a little script from Stackoverflow to <a href="http://stackoverflow.com/questions/822452/strip-html-from-text-javascript#answer-822486">strip HTML from text with JavaScript</a>, and you get:</p>
<pre><code>tinyMCE.init({
   ... // other settings here
    setup : function(ed) {
    // If there is no text content, return nothing.
    //   NB: Image-only content would get swallowed.
      ed.onPostProcess.add(function(ed, o) {
            var text = "";
            var tmp = document.createElement("DIV");

            tmp.innerHTML = o.content;
            //console.debug("inner html=" + tmp.innerHTML);

            if (tmp.innerHTML) {
               text = tmp.textContent||tmp.innerText||"";
               text = text.replace(/\n/gi, "");
               text = text.replace(/\s/g, "");
               text = text.replace(/\t/g, "");
               //console.debug("if content, text=" + text);
            } else {
                text = "";
                //console.debug("else no content, and typeof =" + typeof(text));
            }
            if (text == "") {
                o.content = text;
                //console.debug("content set, possibly, get content = " + o.content);
            }

      });
   } // add comma here if there's another thing in the list
});</code></pre>
<p>The only weakness I know of in that, is that something containing only an image but no text would return a blank box. I left the console logging in (but commented) if you&#8217;d like to see what happens though Firebug.</p>
<p>Free free to use this or to feedback any improvements below.</p>
]]></content:encoded>
			<wfw:commentRss>http://alastairc.ac/2010/03/removing-emtpy-html-tags-from-tinymce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

