<?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>Funk Rock &#187; Projects</title>
	<atom:link href="http://rossboucher.com/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://rossboucher.com</link>
	<description>Blog by Ross</description>
	<lastBuildDate>Sun, 01 Mar 2009 21:31:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Accessibility &amp; Degradation in Cappuccino</title>
		<link>http://rossboucher.com/2009/02/26/accessibility-degradation-in-cappuccino/</link>
		<comments>http://rossboucher.com/2009/02/26/accessibility-degradation-in-cappuccino/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 09:59:47 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[280north]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[atlas]]></category>
		<category><![CDATA[cappuccino]]></category>

		<guid isPermaLink="false">http://rossboucher.com/?p=41</guid>
		<description><![CDATA[On Tuesday, we announced Atlas, our new visual layout tool for Cappuccino. I&#8217;m incredibly excited about where Atlas is headed, and I&#8217;m also glad to hear all the feedback we&#8217;ve been getting just from our demo video. One of the things in particular that I&#8217;ve read several discussion on is accessibility and Cappuccino, and I [...]]]></description>
			<content:encoded><![CDATA[<p>On Tuesday, we announced <a href="http://280atlas.com">Atlas</a>, our new visual layout tool for <a href="http://cappuccino.org">Cappuccino</a>. I&#8217;m incredibly excited about where Atlas is headed, and I&#8217;m also glad to hear all the feedback we&#8217;ve been getting just from our demo video. One of the things in particular that I&#8217;ve read several discussion on is accessibility and Cappuccino, and I wanted to share some thoughts on the topic.</p>
<p>Drew McLellan wrote <a href="http://allinthehead.com/retro/337/the-cost-of-accessibility">an interesting piece</a> outlining his concerns about the subject, but I think certain things need to be clarified. First, there&#8217;s a difference between accessibility and the availability of JavaScript. Accessibility is about enabling assistive technologies like screen readers to relay information to users with disabilities like vision impairment. JavaScript availability, on the other hand, is about whether or not a user&#8217;s browser has JavaScript enabled (or supports JavaScript at all). JavaScript availability is what people are talking about when they talk about graceful degradation. Both of these issues are important, but they need to be addressed separately.</p>
<p>Let me state the obvious: JavaScript availability is a requirement for writing an application in the browser. The reason is simple, writing a program requires a programming language, which HTML and CSS are not. To be more precise, I&#8217;m talking about an application that doesn&#8217;t rely on the server for all its logic, a truly browser based application, not a website with a dynamic back end. Not all programs should be or need to be written this way, that is something we readily acknowledge. But, some applications only make sense written like this: a presentation editor can&#8217;t hit the server on every single move or update or reposition of a slide element; a word processor can&#8217;t hit the server every time you need to type a character. I don&#8217;t believe this is a controversial statement, it&#8217;s a fundamental reality of the web. And it&#8217;s something you see not just in Cappuccino, but in any complex web application, from Google&#8217;s to Apple&#8217;s and countless others.</p>
<p>The second issue is accessibility, and I do believe its important. First, to put on my contrarian hat, you have to consider that not all applications can be made accessible. Although I could be wrong, I don&#8217;t think there&#8217;s a reasonable way to make Photoshop accessible to someone who can&#8217;t see; fundamentally it&#8217;s a visual tool. 280 Slides, for the most part, is the same (and to a large extent, Atlas may be as well). They are largely visual tools, heavily relying on visual design, drag and drop, and other mouse based metaphors. Since Cappuccino development up to this point has been driven mostly by our own needs, that may help explain why this hasn&#8217;t been a top priority for us. </p>
<p>All that aside, we absolutely want Cappuccino to be an accessible platform. Until pretty recently, this just wasn&#8217;t a possibility. Browser vendors and assistive technology vendors provided absolutely no facilities for interacting with the accessibility system. We&#8217;ve been working on Cappuccino for some time now, and I think it would be a travesty if none of the things we&#8217;ve accomplished had been done simply because there wasn&#8217;t yet a way to make them accessible. Cappuccino is pushing the edges of web development right now, and understandably some things take time to catch up. Vendors need to take their share of responsibility for the problem.</p>
<p>More recently, efforts like WAI ARIA are starting to be taken seriously enough to consider as a potential avenue for Cappuccino. Like the rest of our APIs, we have a strong foundation to build upon &#8212; Mac OS X has great support for accessibility in custom UI. I am extremely excited about integrating some of these technologies into Cappuccino. At the same time, 280 North is a three person company, developing our own products to support our business, and developing Cappuccino in the open to benefit everyone. We can&#8217;t program every feature needed in Cappuccino all at once, but that&#8217;s part of why we&#8217;re embracing open source. If people feel strongly about WAI ARIA, I encourage them to get in touch with us about helping to add support to Cappuccino. It isn&#8217;t an area we have a great deal of expertise in, but we&#8217;re happy to learn new things, and this is absolutely a problem we want to work on.</p>
<p>As for Atlas, I&#8217;m looking forward to sharing more about development status, and what it can do. We&#8217;ve got a lot of ideas, but we really love hearing what fellow developers feel is important. This is just one good example of the feedback we&#8217;ve been getting, and hopefully I&#8217;ll be able to share more in the coming months.</p>
]]></content:encoded>
			<wfw:commentRss>http://rossboucher.com/2009/02/26/accessibility-degradation-in-cappuccino/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>iReddit &#8211; the official reddit iPhone App</title>
		<link>http://rossboucher.com/2009/02/15/ireddit-the-official-reddit-iphone-app/</link>
		<comments>http://rossboucher.com/2009/02/15/ireddit-the-official-reddit-iphone-app/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 18:47:01 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ireddit]]></category>
		<category><![CDATA[reddit]]></category>
		<category><![CDATA[wil wheaton]]></category>

		<guid isPermaLink="false">http://rossboucher.com/?p=35</guid>
		<description><![CDATA[An iPhone application I wrote just got posted to the app store yesterday. iReddit (cleverly named huh?) is the official reddit client for the iPhone. I may have built the iPhone app, but they built reddit, which is the really hard part, and for that we&#8217;re all thankful.

Actually, I&#8217;ve been interested in trying out the [...]]]></description>
			<content:encoded><![CDATA[<p>An iPhone application I wrote just got posted to the app store yesterday. <a href="http://itunes.com/apps/ireddit">iReddit</a> (cleverly named huh?) is the <a href="http://www.reddit.com/iphone">official reddit client for the iPhone</a>. I may have built the iPhone app, but they built reddit, which is the really hard part, and for that we&#8217;re all thankful.</p>
<div id="attachment_36" align="alignleft" style="float:left; width:200; margin-right:10px;"><a href="http://rossboucher.com/wp-content/uploads/2009/02/img_0009.png"><img src="http://rossboucher.com/wp-content/uploads/2009/02/img_0009-200x300.png" alt="iReddit Home Screen" title="iReddit" width="200" height="300" class="size-medium wp-image-36" /></a></div>
<p>Actually, I&#8217;ve been interested in trying out the iPhone dev environment for some time. I got to talking with Alexis and thought this would be a great opportunity to build something useful, and help out our startup at the same time. All in all it was a good experience, but at times the iPhone dev process may make you want to kill yourself (and not because of the programming part). Don&#8217;t say I didn&#8217;t warn you.</p>
<p>The app itself is pretty great. You can browse the combined front page, or look at individual subreddits, and even get your own customized reddit list on the phone by logging in. Commenting, voting, and saving are all there, plus &#8220;serendipity&#8221; mode, which displays a random upcoming reddit story every time you shake the iPhone. The best part of the app is probably the reddit alien getting pissed off at slow loading pages. The effect is great.</p>
<p>So, if you haven&#8217;t already, <a href="http://itunes.com/apps/ireddit">go buy the app</a>! I&#8217;ll try and write more about the dev process in future posts, and in particular about my take on the app store and some of the things people have been complaining about.</p>
<p>Alexis has a bit of a crazy side to him, and it called him to make this commercial for the app. Hand modeling by yours truly. Still waiting to hear what <a href="http://twitter.com/wilw">Wil Wheaton</a> actually thinks of it.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/jjxlEodOETU&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/jjxlEodOETU&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://rossboucher.com/2009/02/15/ireddit-the-official-reddit-iphone-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google, iPhone, and Thinking Like a Programmer</title>
		<link>http://rossboucher.com/2008/11/20/google-iphone-and-thinking-like-a-programmer/</link>
		<comments>http://rossboucher.com/2008/11/20/google-iphone-and-thinking-like-a-programmer/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 19:37:01 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://rossboucher.com/2008/11/20/google-iphone-and-thinking-like-a-programmer/</guid>
		<description><![CDATA[Yesterday, John Gruber declared that Google Mobile uses private iPhone APIs. Since he wrote it, it must be true, which is why TechCrunch picked up on the article this morning. Nevermind the fact that the only evidence offered by Gruber was that &#8220;there is no public API in the iPhone SDK for using the proximity [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, John Gruber declared that <a href="http://daringfireball.net/2008/11/google_mobile_uses_private_iphone_apis">Google Mobile uses private iPhone APIs</a>. Since he wrote it, it must be true, which is why TechCrunch <a href="http://www.crunchgear.com/2008/11/20/googles-mobile-app-uses-secret-proximity-sensing-system-untruthiness/">picked up</a> on the article this morning. Nevermind the fact that the only evidence offered by Gruber was that &#8220;there is no public API in the iPhone SDK for using the proximity sensor in this way.&#8221;</p>
<p>The critical mistake Gruber makes is assuming that because there&#8217;s no documented method for trivially utilizing the proximity sensor, there must be <em>no possible way</em> to do it. This is a severe lack of imagination.</p>
<p>Programming is an exercise in creative thinking, especially when working within the context of specific platform. There are always things you, the developer, want to do but don&#8217;t seem to be able to. This has always been and will always be true. It&#8217;s the reason why plenty of desktop Mac apps use private Apple APIs, and it&#8217;s the reason why plenty of iPhone apps on the store are using undocumented APIs.</p>
<p>The essential question, then, is can what Google is doing be done without using undocumented APIs on the phone? I think it can. I spent an hour this morning trying to prove it, and came up with <a href="/downloads/proximity.zip">this iPhone app</a>.</p>
<p>To be fair, this doesn&#8217;t work as well as Google&#8217;s version, or exactly the same way. For one, I didn&#8217;t bother to program in the proximity requirement for the trigger. This is well documented, so anyone could easily add it to this project. The other way in which my method underperforms Google&#8217;s is that the phone actually has to touch your ear before it will trigger. Google&#8217;s just needs to come close to your ear. But, the code does use the proximity sensor, and it only uses the available API method for that sensor, which gives you the ability to turn it on and off. The code uses no undocumented APIs.</p>
<p>How does it work? As I mentioned, it requires you actually touch the phone to your ear. Once you do, the application receives a touchBegan event, and turns on the proximity sensor. It also makes a note that the app is in the middle of a touch sequence, and finally it fires off a timer which makes this trick work. Once the proximity sensor is turned on, it is immediately engaged because the phone is so close to your face. When the proximity sensor is engaged Cocoa turns off the touch sensor, but it doesn&#8217;t send a touchEnded message to the application. Thanks to that timer we fired, we can poll for the current number of touches on the screen. If it drops to zero, but we never saw the touchEnded message, we know we&#8217;ve triggered the proximity sensor. The project I&#8217;ve included will turn the screen yellow and play a little sound, just like the Google application. Here&#8217;s all the relevant code:</p>
<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; ">- (<span style="color:#881350;">void</span>)<span style="color:#6c0540;">touchesBegan:</span>(<span style="color:#400080;">NSSet</span> *)touches <span style="color:#6c0540;">withEvent:</span>(UIEvent *)event<br />
{<br />
    [<span style="color:#881350;">self</span> <span style="color:#6c0540;">setBackgroundColor:</span>[UIColor <span style="color:#6c0540;">redColor</span>]];<br />
    [UIApplication <span style="color:#6c0540;">sharedApplication</span>].proximitySensingEnabled = <span style="color:#881350;">YES</span>;<br />
    <br />
    _inLiveTouch = <span style="color:#881350;">YES</span>;<br />
    <br />
    [<span style="color:#881350;">self</span> <span style="color:#6c0540;">performSelector:</span><span style="color:#881350;">@selector</span>(checkTouches:) <span style="color:#6c0540;">withObject:</span>event <span style="color:#6c0540;">afterDelay:</span><span style="color:#0000ff;">0</span>];<br />
}</p>
<p>- (<span style="color:#881350;">void</span>)<span style="color:#6c0540;">touchesEnded:</span>(<span style="color:#400080;">NSSet</span> *)touches <span style="color:#6c0540;">withEvent:</span>(UIEvent *)event<br />
{<br />
    [<span style="color:#881350;">self</span> <span style="color:#6c0540;">setBackgroundColor:</span>[UIColor <span style="color:#6c0540;">greenColor</span>]];<br />
    <br />
    _inLiveTouch = <span style="color:#881350;">NO</span>;<br />
    [UIApplication <span style="color:#6c0540;">sharedApplication</span>].proximitySensingEnabled = <span style="color:#881350;">NO</span>;<br />
}</p>
<p>- (<span style="color:#881350;">void</span>)<span style="color:#6c0540;">checkTouches:</span>(UIEvent *)event<br />
{   <br />
    <span style="color:#881350;">if</span><span style="color:#003369;"> </span>(_inLiveTouch &#038;&#038; [[event <span style="color:#6c0540;">allTouches</span>] <span style="color:#6c0540;">count</span>] == <span style="color:#0000ff;">0</span>)<br />
    {<br />
        [<span style="color:#881350;">self</span> <span style="color:#6c0540;">setBackgroundColor:</span>[UIColor <span style="color:#6c0540;">yellowColor</span>]];<br />
        <span style="color:#003369;">AudioServicesPlaySystemSound</span>(_sound);<br />
        <span style="color:#881350;">return</span>;<br />
    }</p>
<p>    <span style="color:#881350;">if</span><span style="color:#003369;"> </span>(_inLiveTouch)<br />
        [<span style="color:#881350;">self</span> <span style="color:#6c0540;">performSelector:</span><span style="color:#881350;">@selector</span>(checkTouches:) <span style="color:#6c0540;">withObject:</span>event <span style="color:#6c0540;">afterDelay:</span><span style="color:#0000ff;">0.5</span>];<br />
}</div>
<p>An hour of programming, and three methods get us something relatively close to what Google is doing. I&#8217;m far from an expert in the iPhone SDK, but it only took a little bit of imagination to come up with this idea. Google has perhaps a dozen or more employees working full time on the iPhone. It&#8217;s not much of a leap to believe they figured out an even smarter trick than mine to accomplish what they wanted to do. Gruber did mention later that at least <a href="http://itunes.com/app/Note2Self">one other app</a> is doing something similar without using the proximity sensor, but was quick to point out how inferior it was to the proximity based approach.</p>
<p>Now, as it turns out, Google <em>probably is</em> using private APIs to do what they&#8217;re doing. Erica Sadun, over at Ars Technica, <a href="http://arstechnica.com/journals/apple.ars/2008/11/19/ars-investigates-does-google-mobile-use-private-apis">made a more convincing case</a>.</p>
<p>The ultimate question then, is does it matter? The reality of the situation is that there are a lot of apps doing this that have already shipped. It isn&#8217;t just Google, and it isn&#8217;t just big companies, it&#8217;s everybody. Either Apple knows this and isn&#8217;t doing anything about it, or they don&#8217;t know. Either way points to indifference. If they know, it&#8217;s obvious how not taking action is indifferent towards things, but what about if  they don&#8217;t know. In that case, it means the review process they&#8217;ve built is not designed to catch these cases. To be sure, the dynamic nature of Objective-C would make it difficult to catch all instances of runtime tomfoolery, but it&#8217;s not impossible to do so, nor would it be particularly burdensome to catch <em>most</em> of the cases. As it currently works, I believe they are only checking to see which frameworks you link against statically, and denying anyone who includes private frameworks in that list.</p>
<p>Even if Apple was deeply concerned that people were using undocumented APIs, would it be a big deal if Google was granted an exception? Gruber thinks so:</p>
<blockquote><p>
Third-party iPhone development is purportedly a level playing field. If regular developers are forced to play by the rules, but Google is allowed to use private APIs just because they’re Google, the system is rigged.
</p></blockquote>
<p>Rigged? Who said the iPhone SDK was a level playing field in the first place? Apple has never been a company that stands up for level playing fields, nor should they have to be. Every business makes business deals, partnerships, exclusive rights agreements &#8212; this is common business practice, at Apple, Google, and everywhere else in the business world. Why should the iPhone be any different? If you had billions of dollars in the bank, Apple would talk to you too.</p>
<p>This isn&#8217;t only realistic, it&#8217;s also reasonable. One of the reasons to prevent people from using undocumented APIs is not wanting applications to break between upgrades. If Apple knows every single application that will break, because it has an arrangement with the developer, it can make sure to correct the problem in advance. This obviously doesn&#8217;t scale to every developer, but it makes perfect sense to do so on a limited case by case basis. In fact, this is how Apple already behaves in the desktop world. Wil Shipley gets his bugs fixed faster than Joe the Indy Developer. Why? Because his app is popular, and because he has connections at Apple. </p>
<p>TechCrunch claimed in their article this morning that &#8220;Apple wouldn’t allow Google to use an unsupported call. It’s not in their DNA.&#8221; If anything, Apple is more likely to help Google than any other company. After all, Google provided Apple with a special version of maps for the iPhone application, and now the company refuses to license Google Maps to any other iPhone developer, even the ones willing to pay the outrageous sums of money a license costs. Google gave Apple a virtual maps monopoly for the iPhone, the least Apple can do is let them use an undocumented method here and there.</p>
]]></content:encoded>
			<wfw:commentRss>http://rossboucher.com/2008/11/20/google-iphone-and-thinking-like-a-programmer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>iPhone Touch Events in JavaScript</title>
		<link>http://rossboucher.com/2008/08/19/iphone-touch-events-in-javascript/</link>
		<comments>http://rossboucher.com/2008/08/19/iphone-touch-events-in-javascript/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 18:44:40 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://rossboucher.com/2008/08/19/iphone-touch-events-in-javascript/</guid>
		<description><![CDATA[Yesterday I gave a presentation at the San Francisco JavaScript Meetup about the new JavaScript touch events API in iPhone 2.0.  I thought I&#8217;d share the slides, in case people were interested in viewing them after the fact.

I owe a great deal of thanks to Neil Roberts from SitePen, who&#8217;s post on the topic [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I gave a presentation at the <a href="http://javascript.meetup.com/4/">San Francisco JavaScript Meetup</a> about the new JavaScript touch events API in iPhone 2.0.  I thought I&#8217;d share the slides, in case people were interested in viewing them after the fact.</p>
<p><iframe width="400" height="328" src="http://280slides.com/Viewer/?user=37&#038;name=javascript%20iphone%20events" style="border: 1px solid black; margin: 0; padding: 0;"></iframe></p>
<p>I owe a great deal of thanks to Neil Roberts from SitePen, who&#8217;s <a href="http://www.sitepen.com/blog/2008/07/10/touching-and-gesturing-on-the-iphone/">post on the topic</a> was my main source of information.  My co-founder Tom Robinson was also helpful, thanks to his <a href="http://tlrobinson.net/iphone/lighttable/">iPhone light-table</a>.</p>
<p>One of the interesting things I was able to talk about was reusing existing mouse based libraries with the iPhone by using touch events to simulate mouse events.  The basic idea behind it was to address the fact that mouse events don&#8217;t work particularly well on the phone.  It&#8217;s unpredictable when you&#8217;ll get them, if at all (you won&#8217;t if you attach only to document, for example).  Mousemove in particular doesn&#8217;t work in any meaningful way.</p>
<p>In contrast, the touch events are completely predictable and reliable (excepting the existing bugs). We can use these events to simulate the existing mouse events with a fair amount of accuracy.  In particular, when one finger is down on the screen, touchstart, touchend, and touchmove correspond nicely with mousedown, mouseup, and mousemove.  There&#8217;s some difference in the way mousemove works, since we can&#8217;t get mousemove events when the finger is not touching the screen, but this is an acceptable trade off.  It doesn&#8217;t make sense on the iPhone anyway because there&#8217;s no persistent cursor.</p>
<p>I took this jQuery based <a href="http://threedubmedia.blogspot.com/2008/08/eventspecialdrop.html">drag and drop example</a> to see if I could get it working on the iPhone without modification.  Here&#8217;s the <a href="http://rossboucher.com/iphone/">working iPhone demo</a>.  The only existing code that I modified was some CSS to make the page fit nicely on the iPhone screen, and a viewport meta tag.  The added code to get drag and drop working is really simple:</p>
<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#881350;">function</span> <span style="color:#003369;">touchHandler</span>(event)<br />
{<br />
    <span style="color:#881350;">var</span> touches = event.changedTouches,<br />
        first = touches[<span style="color:#0000ff;">0</span>],<br />
        type = <span style="color:#760f15;">&#8220;&#8221;</span>;<br />
    <br />
    <span style="color:#881350;">switch</span>(event.type)<br />
    {<br />
        <span style="color:#881350;">case</span> <span style="color:#760f15;">&#8220;touchstart&#8221;</span>: type = <span style="color:#760f15;">&#8220;mousedown&#8221;</span>; <span style="color:#881350;">break</span>;<br />
        <span style="color:#881350;">case</span> <span style="color:#760f15;">&#8220;touchmove&#8221;</span>:  type=<span style="color:#760f15;">&#8220;mousemove&#8221;</span>; <span style="color:#881350;">break</span>;        <br />
        <span style="color:#881350;">case</span> <span style="color:#760f15;">&#8220;touchend&#8221;</span>:   type=<span style="color:#760f15;">&#8220;mouseup&#8221;</span>; <span style="color:#881350;">break</span>;<br />
        <span style="color:#881350;">default</span>: <span style="color:#881350;">return</span>;<br />
    }<br />
        <br />
    <span style="color:#236e25;">//initMouseEvent(type, canBubble, cancelable, view, clickCount, <br />
</span>    <span style="color:#236e25;">//           screenX, screenY, clientX, clientY, ctrlKey, <br />
</span>    <span style="color:#236e25;">//           altKey, shiftKey, metaKey, button, relatedTarget);<br />
</span>    <br />
    <span style="color:#881350;">var</span> simulatedEvent = document.<span style="color:#003369;">createEvent</span>(<span style="color:#760f15;">&#8220;MouseEvent&#8221;</span>);<br />
    simulatedEvent.<span style="color:#003369;">initMouseEvent</span>(type, <span style="color:#881350;">true</span>, <span style="color:#881350;">true</span>, window, <span style="color:#0000ff;">1</span>, <br />
                              first.screenX, first.screenY, <br />
                              first.clientX, first.clientY, <span style="color:#881350;">false</span>, <br />
                              <span style="color:#881350;">false</span>, <span style="color:#881350;">false</span>, <span style="color:#881350;">false</span>, <span style="color:#0000ff;">0</span><span style="color:#236e25;">/*left*/</span>, null);<br />
                                                                            <br />
    first.target.<span style="color:#003369;">dispatchEvent</span>(simulatedEvent);<br />
    event.<span style="color:#003369;">preventDefault</span>();<br />
}</p>
<p><span style="color:#881350;">function</span> <span style="color:#003369;">init</span>() <br />
{<br />
    document.<span style="color:#003369;">addEventListener</span>(<span style="color:#760f15;">&#8220;touchstart&#8221;</span>, touchHandler, <span style="color:#881350;">true</span>);<br />
    document.<span style="color:#003369;">addEventListener</span>(<span style="color:#760f15;">&#8220;touchmove&#8221;</span>, touchHandler, <span style="color:#881350;">true</span>);<br />
    document.<span style="color:#003369;">addEventListener</span>(<span style="color:#760f15;">&#8220;touchend&#8221;</span>, touchHandler, <span style="color:#881350;">true</span>);<br />
    document.<span style="color:#003369;">addEventListener</span>(<span style="color:#760f15;">&#8220;touchcancel&#8221;</span>, touchHandler, <span style="color:#881350;">true</span>);    <br />
}
</div>
<p>I&#8217;ve captured the touch events and then manually fired my own mouse events to match. Although the code isn&#8217;t particularly general purpose as is, it should be trivial to adapt to most existing drag and drop libraries, and probably most existing mouse event code.  Hopefully this idea will come in handy to people developing web applications for the iPhone.</p>
<p>Update: In posting this, I noticed that calling preventDefault on all touch events will prevent links from working properly.  The main reason to call preventDefault at all is to stop the phone from scrolling, and you can do that by calling it only on the touchmove callback.  The only downside to doing it this way is that the iPhone will sometimes display its hover popup over the drag origin.  If I discover a way to prevent that, I&#8217;ll update this post.</p>
<p><strong>Second Update:</strong> I&#8217;ve found the CSS property to turn off the callout, &#8220;-webkit-touch-callout&#8221;. You can read about it in Apple&#8217;s <a href="http://developer.apple.com/DOCUMENTATION/AppleApplications/Reference/SafariCSSRef/Articles/StandardCSSProperties.html#//apple_ref/doc/uid/TP30001266-UserInterface">documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://rossboucher.com/2008/08/19/iphone-touch-events-in-javascript/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Aftermath of 280 Slides</title>
		<link>http://rossboucher.com/2008/06/19/aftermath-of-280-slides/</link>
		<comments>http://rossboucher.com/2008/06/19/aftermath-of-280-slides/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 23:49:48 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://rossboucher.com/2008/06/19/aftermath-of-280-slides/</guid>
		<description><![CDATA[We launched 280 Slides two weeks ago, and it&#8217;s been a great experience. After putting five months of non stop work into it, it&#8217;s a good feeling to be able to point to it and say &#8220;That&#8217;s what I&#8217;ve been doing.&#8221; It&#8217;s also fantastic to be getting all kinds of feedback from people who like [...]]]></description>
			<content:encoded><![CDATA[<p>We <a href="http://blog.280north.com/2008/06/15/on-ramp/">launched 280 Slides</a> two weeks ago, and it&#8217;s been a great experience. After putting five months of non stop work into it, it&#8217;s a good feeling to be able to point to it and say &#8220;That&#8217;s what I&#8217;ve been doing.&#8221; It&#8217;s also fantastic to be getting all kinds of feedback from people who like (and dislike) the application. It really does help you focus on what matters to people. </p>
<p>We&#8217;ve had some great press mentions too (both <a href="http://280slides.com">Slides</a> and <a href="http://objective-j.org">Cappuccino</a>):</p>
<p><a href="http://www.techcrunch.com/2008/06/05/280-north-launches-its-online-keynote-280-slides/">TechCrunch</a><br />
<a href="http://rossboucher.com/wp-admin/post.php">Ajaxian</a><br />
<a href="http://www.tuaw.com/2008/06/15/wwdc-08-280-north/">TUAW</a><br />
<a href="http://blogs.guardian.co.uk/technology/2008/06/05/want_to_use_apples_keynote_on_a_pc_you_can_via_the_web.html">Guardian.co.uk</a></p>
<p><a href="http://iamthewalr.us/blog/2008/06/05/280-slides/">And</a> <a href="http://www.xxeo.com/archives/2008/06/05/new-web-site-in-objective-c-via-javascript.html">quite</a> <a href="http://www.indezine.com/blog/2008/06/first-look-at-280-slides.html">a</a> <a href="http://www.matthewpaulmoore.com/articles/923-bringing-sexy-back-280slides">few</a> <a href="http://log.scifihifi.com/post/37541224/ajaxian-an-interview-with-280-north-on-objective-j">blogs</a><a href="http://www.shauninman.com/archive/2008/06/06/280_slides">.</a> (<a href="http://twitter.com/chockenberry/statuses/828065292">and twitter</a>)</p>
<p>There&#8217;s also been a fair amount of confusion regarding <a href="http://www.apple.com/mobileme/">MobileMe</a> and <a href="http://sproutcore.com">SproutCore</a>.  Just to clarify, MobileMe is not based on Objective-J or Cappuccino, and 280 Slides is not based on SproutCore.  280 Slides isn&#8217;t part of MobileMe, and we have no affiliation to Apple.  Oh, and there are <a href="http://tlrobinson.net">three</a> <a href="http://tolmasky.com">of</a> <a href="http://rossboucher.com">us</a>, not two.</p>
]]></content:encoded>
			<wfw:commentRss>http://rossboucher.com/2008/06/19/aftermath-of-280-slides/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cold Brewed Coffee</title>
		<link>http://rossboucher.com/2008/02/15/cold-brewed-coffee/</link>
		<comments>http://rossboucher.com/2008/02/15/cold-brewed-coffee/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 20:11:49 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://blog.rossboucher.com/2008/02/15/cold-brewed-coffee/</guid>
		<description><![CDATA[A while ago, the New York Times had an article about cold brewed coffee that peaked my interest.  I&#8217;m not much of a coffee drinker, but iced coffee is, on occasion, a pretty exceptional summer time drink, so I filed the article in the back of my mind for future reference.  
Some time [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, the <a href="http://nytimes.com">New York Times</a> had an article about <a href="http://www.nytimes.com/2007/06/27/dining/27coff.html?em&#038;ex=1183262400&#038;en=4256d03a7a4c4c5">cold brewed coffee</a> that peaked my interest.  I&#8217;m not much of a coffee drinker, but iced coffee is, on occasion, a pretty exceptional summer time drink, so I filed the article in the back of my mind for future reference.  </p>
<p>Some time later, Francisco, aware of my <a href="http://homepage.mac.com/wadetregaskis/Journal/C753517938/E20071201111930/index.html">irrational love</a> for <a href="https://www.dunkindonuts.com/">Dunkin&#8217; Donuts</a> (or, more accurately, my rational hatred for Krispy Kreme), brought back a few bags of Dunkin&#8217; Donuts coffee for me from his trip to New York.  Not having a coffee maker, or any desire to drink it really, it sat in the cabinet for a few months, until yesterday.  </p>
<p>The weather is already pretty nice again here in Cupertino, and combined with the discovery of <a href="http://www.ineedcoffee.com/06/coldhome/">this article</a>, I had no excuse not to give cold brewed coffee a chance.  Substitute taco bell cups (gross) for a couple red cups, recalculate the ingredients proportionally, and I was ready to go.  24 hours later, I&#8217;m enjoying a great cup of iced coffee that was practically free (compared with $2.80 at that <em>other</em> coffee place)!</p>
<p>A picture&#8217;s worth a thousand words, so here&#8217;s 5k (courtesy of iPhone).</p>
<p><a class="imagelink" href="http://blog.rossboucher.com/wp-content/uploads/2008/02/img_0055.JPG" title="Cold Brewing"><img id="image10" src="http://blog.rossboucher.com/wp-content/uploads/2008/02/img_0055.thumbnail.JPG" alt="Cold Brewing" /></a><a class="imagelink" href="http://blog.rossboucher.com/wp-content/uploads/2008/02/img_0052.JPG" title="Filtration"><img id="image11" src="http://blog.rossboucher.com/wp-content/uploads/2008/02/img_0052.thumbnail.JPG" alt="Filtration" /></a><a class="imagelink" href="http://blog.rossboucher.com/wp-content/uploads/2008/02/img_0053.JPG" title="Tiny Holes"><img id="image12" src="http://blog.rossboucher.com/wp-content/uploads/2008/02/img_0053.thumbnail.JPG" alt="Tiny Holes" /></a><a class="imagelink" href="http://blog.rossboucher.com/wp-content/uploads/2008/02/img_0056.JPG" title="Coffee Concentrate"><img id="image13" src="http://blog.rossboucher.com/wp-content/uploads/2008/02/img_0056.thumbnail.JPG" alt="Coffee Concentrate" /></a><a class="imagelink" href="http://blog.rossboucher.com/wp-content/uploads/2008/02/img_0054.JPG" title="Iced Coffee"><img id="image14" src="http://blog.rossboucher.com/wp-content/uploads/2008/02/img_0054.thumbnail.JPG" alt="Iced Coffee" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://rossboucher.com/2008/02/15/cold-brewed-coffee/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
