<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The HTML Pad</title>
	<atom:link href="http://htmlpad.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://htmlpad.wordpress.com</link>
	<description>Three friends learning to program their iPads using web technologies</description>
	<lastBuildDate>Wed, 09 Nov 2011 05:41:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='htmlpad.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The HTML Pad</title>
		<link>http://htmlpad.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://htmlpad.wordpress.com/osd.xml" title="The HTML Pad" />
	<atom:link rel='hub' href='http://htmlpad.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Preventing Copy : Select : Paste Dialog in Web pages iPhone and iPad</title>
		<link>http://htmlpad.wordpress.com/2010/03/14/preventing-copy-select-paste-dialog-in-web-pages-iphone-and-ipad/</link>
		<comments>http://htmlpad.wordpress.com/2010/03/14/preventing-copy-select-paste-dialog-in-web-pages-iphone-and-ipad/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 22:57:45 +0000</pubDate>
		<dc:creator>thethirdamigo</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[User Experience]]></category>

		<guid isPermaLink="false">http://htmlpad.wordpress.com/?p=149</guid>
		<description><![CDATA[I found when developing a painting application that I did not want to allow text copying on a canvas element. With the iPad and iPhone this can be done with CSS. Now simply add this to the elements you do not want to have the copy dialog appear.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=149&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_151" class="wp-caption alignnone" style="width: 210px"><a href="http://htmlpad.files.wordpress.com/2010/03/photo1.jpg"><img class="size-medium wp-image-151 " title="Copy : Select : Select All" src="http://htmlpad.files.wordpress.com/2010/03/photo1.jpg?w=200&#038;h=300" alt="" width="200" height="300" /></a><p class="wp-caption-text">There  are times when you want to prevent copying</p></div>
<p>I found when developing a painting application that I did not want to allow text copying on a canvas element. With the iPad and iPhone this can be done with CSS.</p>
<p><pre class="brush: css;">
.no-copy {
  -webkit-user-select: none;
}
</pre></p>
<p>Now simply add this to the elements you do not want to have the copy dialog appear.</p>
<p><pre class="brush: css;">
  &lt;canvas id=&quot;touchpaint&quot; class=&quot;no-copy&quot;&gt;&lt;/canvas&gt;
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/htmlpad.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/htmlpad.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/htmlpad.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/htmlpad.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/htmlpad.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/htmlpad.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/htmlpad.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/htmlpad.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/htmlpad.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/htmlpad.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/htmlpad.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/htmlpad.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/htmlpad.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/htmlpad.wordpress.com/149/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=149&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://htmlpad.wordpress.com/2010/03/14/preventing-copy-select-paste-dialog-in-web-pages-iphone-and-ipad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffe066b0daf7819de9d4d59ac7cbbd95?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thethirdamigo</media:title>
		</media:content>

		<media:content url="http://htmlpad.files.wordpress.com/2010/03/photo1.jpg?w=200" medium="image">
			<media:title type="html">Copy : Select : Select All</media:title>
		</media:content>
	</item>
		<item>
		<title>HTML 5 Data Storage JavaScript API on iPad and iPhone</title>
		<link>http://htmlpad.wordpress.com/2010/03/10/html-5-data-storage-javascript-api-on-ipad-and-iphone/</link>
		<comments>http://htmlpad.wordpress.com/2010/03/10/html-5-data-storage-javascript-api-on-ipad-and-iphone/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 07:17:38 +0000</pubDate>
		<dc:creator>thethirdamigo</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[html 5]]></category>
		<category><![CDATA[javascirpt]]></category>

		<guid isPermaLink="false">http://htmlpad.wordpress.com/?p=138</guid>
		<description><![CDATA[After creating TouchPaint I quickly realized that there were some users out there putting a lot of work into there pictures and they would lose them with a simple page reload. There is an easy solution. Many of the latest generation of browsers including the IPad / iPhone, Safari 4+, Chrome, Firefox 3.5+ already support [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=138&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After creating <a href="http://htmlpad.wordpress.com/2010/03/09/touchpaint/">TouchPaint</a> I quickly realized that there were some users out there putting a lot of work into there pictures and they would lose them with a simple page reload.</p>
<p>There is an easy solution. Many of the latest generation of browsers including the IPad / iPhone, Safari 4+, Chrome, Firefox 3.5+ already support the HTML 5 Storage.</p>
<p><strong>What HTML 5 Storage Provides</strong></p>
<ul>
<li>5 megabytes of storage per domain</li>
<li>A SQL Light Database</li>
<li>JavaScript APIs to access the storage</li>
</ul>
<p>I found this plenty for storing images however after going over the <a href="http://webkit.org/demos/sticky-notes/index.html">Webkit Data Storage Example</a> I thought there might be something a little more  approachable for Java developers. So I created a simple Data Access Object (DAO) that does the following</p>
<ul>
<li>Intializes a database connection with a callback for successful attempts. Unsupported browsers see nothing.</li>
<li>Creates the site Database and tables on the first access.</li>
<li>Provides a Read and Update API</li>
</ul>
<p>Lets look at each piece. If you want to see the raw JavaScript source you can find it <a href="http://gregmurray.org/ipad/storage/resources/storage.js">here</a>.</p>
<p><strong>SQL Statements</strong> </p>
<p>First of all I keep the SQL statements which are prepared statements all together in a JavaScript map. This keeps the DAO pretty clean and it makes the SQL easy to update.</p>
<p><pre class="brush: jscript;">    var sql = {
      CREATE : &quot;CREATE TABLE paintings (id REAL UNIQUE, json TEXT )&quot;,
      INSERT : &quot;INSERT INTO paintings (id, json ) VALUES ( ?, ?)&quot;,
      UPDATE : &quot;UPDATE paintings SET json = ? WHERE id = ?&quot;,
      GET : &quot;SELECT json FROM paintings&quot;,
      COUNT : &quot;SELECT COUNT(*) FROM paintings&quot;
    };
</pre></p>
<p><strong>Database Creation</strong></p>
<p>New users will always be checked if the Database is intialized.</p>
<p><pre class="brush: jscript;">function initDB( _callback ) {
        try {
            if ( window.openDatabase ) {
                db = openDatabase(&quot;Storage&quot;, &quot;1.0&quot;, &quot;Painting Database&quot;, 2200000);
                checkIfDBInitialized();
                if ( !db ) {
                    alert( &quot;Failed to open the database. Have you allocated enough space?&quot; );
                } else {
                    if ( typeof _callback === &quot;function&quot; ) {
                        _callback.apply({}, []);
                    }
                }
            }
        } catch( error ) { 
            alert( &quot;Error trying to open database : &quot; + error );
        }
    }
</pre></p>
<p>I added the callback so those that want to then query or start polling for data can do so. A refactoring might also provide a failure case callback as well.</p>
<p><strong>Check if Initialized </strong></p>
<p>This code tries to see how many items have been put in the database. You can pull the count out if you choose and use it to assign numeric ids to future items.</p>
<p><pre class="brush: jscript;">  function checkIfDBInitialized() {
        db.transaction( 
               function(tx) {
                tx.executeSql( sql.COUNT, [],
                            function(tx, result) {
                                // do nothing 
                            },
                            function( tx, error) {
                               tx.executeSql( sql.CREATE, [],
                                              function(result) {
                                   // create our single row
                                   tx.executeSql( sql.INSERT, [ dataId, &quot;[]&quot; ]);
                             });
            });
        });
    }
</pre></p>
<p><strong>Read</strong></p>
<p>My example stores a JSON string which could be any text really.</p>
<p><pre class="brush: jscript;">function load( _callback) {
        db.transaction(function(tx) {
            tx.executeSql( sql.GET, [], function(tx, result) {
                if (result.rows.length &gt; 0) {
                    var _row = result.rows.item(0);
                    var _json = _row['json'];
                    if ( typeof _callback === &quot;function&quot; ) {
                        _callback.apply( {}, [ _json ] );
                    }
                }
            }, function(tx, error) {
                alert( &quot;Failed to retrieve paintings from database - &quot; + error.message );
                return;
            });
        });
    };

</pre></p>
<p><strong>Update</strong></p>
<p><pre class="brush: jscript;">    function save( _json, _callback ) {
        db.transaction(function (tx) {
            tx.executeSql( sql.UPDATE, [ _json, dataId ], _callback);
        });
    };
</pre></p>
<p><strong>Sample code :</strong></p>
<p>Here the is an example which you may find at <a href="http://gregmurray.org/ipad/storage/">http://gregmurray.org/ipad/storage</a>.</p>
<p><pre class="brush: jscript;">window.onload = function() {
    pictureDao.init( function() {
        // we have succesffuly loaded.
        pictureDao.load( function( text ) {
            var dataDiv = document.getElementById( &quot;data&quot; ).value = text;
        });
    });
};

function save() {
    var dataDiv = document.getElementById( &quot;data&quot; );
    pictureDao.save( dataDiv.value );
}
</pre></p>
<p>The <code>window.onload</code> fires and the database is initialized. If successful it will load text in the text area in the screen. Enter something and click save which results in the <code>save</code>function being invoked. The <code>save</code> function takes the text from the div and put it in local storage. You can verify by reloading the page.</p>
<p>That is pretty much it.</p>
<p><strong>Resources :</strong></p>
<p><a href="http://gregmurray.org/ipad/storage/resources/storage.js">Full source used in the examples in this page</a><br />
<a href="http://dev.w3.org/html5/webstorage/">What WG Web Storage Specification</a><br />
<a href="http://gregmurray.org/ipad/storage/">HTML 5 Data Storage Example on gregmurray.org</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/htmlpad.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/htmlpad.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/htmlpad.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/htmlpad.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/htmlpad.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/htmlpad.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/htmlpad.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/htmlpad.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/htmlpad.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/htmlpad.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/htmlpad.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/htmlpad.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/htmlpad.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/htmlpad.wordpress.com/138/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=138&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://htmlpad.wordpress.com/2010/03/10/html-5-data-storage-javascript-api-on-ipad-and-iphone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffe066b0daf7819de9d4d59ac7cbbd95?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thethirdamigo</media:title>
		</media:content>
	</item>
		<item>
		<title>Touchpaint &#8211; A Web based Painting for the iPad</title>
		<link>http://htmlpad.wordpress.com/2010/03/09/touchpaint/</link>
		<comments>http://htmlpad.wordpress.com/2010/03/09/touchpaint/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 19:00:43 +0000</pubDate>
		<dc:creator>thethirdamigo</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Nexus One]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://htmlpad.wordpress.com/?p=129</guid>
		<description><![CDATA[The JavaScript touch APIs can be used with the canvas tag to easily create a painting application in a web page that work in multiple clients which include the iPad / iPhone / and Nexus One. Given the iPad will have such a large working are a touch painting application would be very fun. The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=129&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_135" class="wp-caption alignleft" style="width: 310px"><a href="http://htmlpad.files.wordpress.com/2010/03/temp-image_2_128.png"><img src="http://htmlpad.files.wordpress.com/2010/03/temp-image_2_128.png?w=300&#038;h=224" alt="Happy Greg" title="Touch Paint" width="300" height="224" class="size-medium wp-image-135" /></a><p class="wp-caption-text">A portrait of me by a friend.</p></div>The JavaScript touch APIs can be used with the canvas tag to easily create a painting application in  a web page that work in multiple clients which include the iPad / iPhone / and Nexus One. Given the iPad will have such a large working are a touch painting application would be very fun.</p>
<p>The Touchpaint application which you can find <a href="http://gregmurray.org/ipad/touchpaint/">here</a> is pretty straight forward. The key code for event tracking is :</p>
<p><pre class="brush: jscript;">
function move( e ) {  
  if ( _widget.drawing ) {  
      var te =  e.touches.item(0);  
      var _current = { x : te.clientX - _widget.pos.x, y : te.clientY - _widget.pos.y };  
      if ( _widget.last !== null) {  
              _widget.drawLine( _widget.last, _current );  
      }  
      _widget.last = _current;  
    }  
    e.preventDefault();  
}  
</pre></p>
<p>The main code of interest is the access to the e.touches to get the location of the touch event and the <code>e.preventDefault();</code> which prevents the event from propagating to the page and causing a page scroll.</p>
<p>And for non touch users the equivalent is :</p>
<p><pre class="brush: jscript;">
function moveMouse( e ) {  
  if ( _widget.drawing ) {  
      var _current = { x : e.pageX - _widget.pos.x, y : e.pageY - _widget.pos.y };  
      if ( _widget.last !== null) {  
              _widget.drawLine( _widget.last, _current );  
      }  
      _widget.last = _current;  
    }  
    e.preventDefault();  
}  
</pre></p>
<p>In a future post I will show how to store the drawing in the HTML 5 based local storage and or send to a server component. For now if you want to play with the source go to <a href="http://gregmurray.org/ipad/touchpaint/">http://gregmurray.org/ipad/touchpaint</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/htmlpad.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/htmlpad.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/htmlpad.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/htmlpad.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/htmlpad.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/htmlpad.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/htmlpad.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/htmlpad.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/htmlpad.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/htmlpad.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/htmlpad.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/htmlpad.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/htmlpad.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/htmlpad.wordpress.com/129/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=129&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://htmlpad.wordpress.com/2010/03/09/touchpaint/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffe066b0daf7819de9d4d59ac7cbbd95?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thethirdamigo</media:title>
		</media:content>

		<media:content url="http://htmlpad.files.wordpress.com/2010/03/temp-image_2_128.png?w=300" medium="image">
			<media:title type="html">Touch Paint</media:title>
		</media:content>
	</item>
		<item>
		<title>Nexus One JavaScript Touch Support</title>
		<link>http://htmlpad.wordpress.com/2010/03/06/nexus-one-javascript-touch-support/</link>
		<comments>http://htmlpad.wordpress.com/2010/03/06/nexus-one-javascript-touch-support/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 05:40:43 +0000</pubDate>
		<dc:creator>thethirdamigo</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Nexus One]]></category>
		<category><![CDATA[User Experience]]></category>

		<guid isPermaLink="false">http://htmlpad.wordpress.com/?p=126</guid>
		<description><![CDATA[I had the chance to get my hands on a Nexus One and was able to run though my touch and gesture tests at http://gregmurray.org/ipad. Given both the Nexus one and the iPhone / iPad all use a variant of Webkit I found the following : ontouchstart, ontouchmove, ontouchend work fine. ongesturestart, ongesturechange, ongestureend do [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=126&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had the chance to get my hands on a Nexus One and was able to run though my touch and gesture tests at http://gregmurray.org/ipad. Given both the Nexus one and the iPhone / iPad all use a variant of Webkit I found the following :</p>
<ul>
<li><code>ontouchstart</code>, <code>ontouchmove</code>, <code>ontouchend</code> work fine.</li>
<li><code>ongesturestart</code>, <code>ongesturechange</code>, <code>ongestureend</code> do <strong>not</strong> work.</li>
</ul>
<p><strong>What does this mean? </strong></p>
<p>You can create some UIs that use patterns such  page swipe / flick gestures as seen in <a href="http://gregmurray.org/ipad/carousel">my carousel widget</a> but some other gestures like <a href="http://gregmurray.org/ipad/stacks">stack spread</a> and pinch to zoom will not. See the <a href="http://gregmurray.org/ipad/gesture-events.html">gesture page</a> if you want to try yourself. While limited there is still the chance to develop some HTML interfaces that work across a wide array of touch devices.</p>
<p><strong> Hope for Standardized Touch Support </strong></p>
<p>Let&#8217;s hope going forward that the Nexus One ( Android ) browser will expand it&#8217;s support for gestures. For now we will have to work with touch events which are the basis for the gestures. Let&#8217;s keep our fingers crossed that other touch based operating system providers expose gestures and touch events in their browsers. An even better solution would be to have gesture and touch events in a future HTML standard.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/htmlpad.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/htmlpad.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/htmlpad.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/htmlpad.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/htmlpad.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/htmlpad.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/htmlpad.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/htmlpad.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/htmlpad.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/htmlpad.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/htmlpad.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/htmlpad.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/htmlpad.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/htmlpad.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=126&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://htmlpad.wordpress.com/2010/03/06/nexus-one-javascript-touch-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffe066b0daf7819de9d4d59ac7cbbd95?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thethirdamigo</media:title>
		</media:content>
	</item>
		<item>
		<title>Implementing iPad User Interactions in a Web Page</title>
		<link>http://htmlpad.wordpress.com/2010/03/01/implementing-ipad-user-interactions-in-a-web-page/</link>
		<comments>http://htmlpad.wordpress.com/2010/03/01/implementing-ipad-user-interactions-in-a-web-page/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 07:45:44 +0000</pubDate>
		<dc:creator>thethirdamigo</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://htmlpad.wordpress.com/?p=93</guid>
		<description><![CDATA[Bill Scott directed me to a catalog of user interactions that the user experience community is creating to track new patterns seen with the iPad. To that end I have begun working on some widgets to that end. Following are two patterns from the catalog as a Stack widget implemented in using JavaScript and CSS. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=93&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://looksgoodworkswell.blogspot.com/" target="_blank">Bill Scott</a> directed me to a catalog of user interactions that the user experience community is creating to track new patterns seen with the iPad. To that end I have begun working on some widgets to that end.</p>
<p><a href="http://htmlpad.files.wordpress.com/2010/03/touchstack.png"><img class="size-medium wp-image-95 alignnone" title="touchstack" src="http://htmlpad.files.wordpress.com/2010/03/touchstack.png?w=240&#038;h=184" alt="" width="240" height="184" /></a></p>
<p>Following are two patterns from the catalog as a <a href="http://gregmurray.org/ipad/stacks/">Stack</a> widget  implemented in using JavaScript and CSS. The JavaScript event handlers are <a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariJSRef/SafariJSRef.pdf">Safari Extension</a>s to JavaScript. I also used some Webkit CSS transforms for rotating the image and creating a light box.</p>
<p><strong><a href="http://www.flickr.com/photos/designingwebinterfaces/sets/72157623376785044/">Tap to Open</a></strong></p>
<p>Pretty self explanatory. This is achieved by adding a <code>onclick</code> event to the top level image and expand the widget with a user tap. I added a window surrounding the expanded images with a close button styled using webkit gradients. The images are also randomly rotated plus or minus 15 degrees to make it look like a stack of images. The initial rotation and location is saved so when the stack is closed it can return to its initial state.</p>
<p><a href="http://htmlpad.files.wordpress.com/2010/03/touchstack-expanded.png"><img class="size-medium wp-image-98 alignnone" title="touchstack-expanded" src="http://htmlpad.files.wordpress.com/2010/03/touchstack-expanded.png?w=240&#038;h=184" alt="" width="240" height="184" /></a></p>
<p>This pattern can be seen in any Webkit based browser or the iPad simulator.</p>
<p><strong><a href="http://www.flickr.com/photos/designingwebinterfaces/sets/72157623376782396/">Stack Spread</a></strong></p>
<p>Basically a user can sneak a peak at what is inside a stack using a spread gesture and close the stack using a pinch gesture.</p>
<p>This gesture was the most difficult to integrate. It basically required tracking two events at both the widget and page level. When a spread or pinch gesture occurs the widget will scale accordingly. I wanted to know the location of touch events and all the changes.</p>
<p><a href="http://htmlpad.files.wordpress.com/2010/03/touchstack-expanding.png"><img class="size-medium wp-image-99 alignnone" title="touchstack-expanding" src="http://htmlpad.files.wordpress.com/2010/03/touchstack-expanding.png?w=240&#038;h=184" alt="" width="240" height="184" /></a></p>
<p>You will need an iPhone or an iPad (not the simulator) to see this in action.  I created some internal hooks into the widget to allow for manual scaling of the widget so I could develop this widget using Safari 4.x.</p>
<p><strong>Tracking Gestures and Touch Events in web pages</strong></p>
<p>A gesture such as a spread or pinch fires the following events :</p>
<ol>
<li><code>touchstart</code> ( first finger )</li>
<li> <code>gesturestart</code></li>
<li><code>touchstart</code> (second finger)</li>
<li><code>gesturechange</code> ( many times )</li>
<li><code>gestureend</code> (when second finger is removed)</li>
<li><code>touchend</code> ( second finger )</li>
<li><code>touchend</code> ( first finger)</li>
</ol>
<p>Confused yet? I was which led me to create a gesture object that is created following the second touchstart event.</p>
<p>I created a wrapper for the touch events that I could use to track through the life of the gesture.  The event once created looks like this.</p>
<p><pre class="brush: jscript;">
window.currentGesture {
   touch1 :  { id : 7, y : 325 }
   touch2 :  { id : 4r, y : 200 },
   top : // reference too touch2
   bottom : // reference too touch1
   scale : 125 // distance between top and bottom
}
</pre></p>
<p>This object is build with this function :</p>
<p><pre class="brush: jscript;">
    function touchStart( e ) {
    	if ( window.inTouch !== true  ) {
    	    window.currentGesture = {
    	        touch1 : { id : e.touches.item(0).identifier, y : e.touches.item(0).pageY }
    	    };
    	} else {
    		var wc = window.currentGesture ;
           	wc.touch2 =   { id : e.touches.item(0).identifier, y : e.touches.item(0).pageY }
          	wc.scale = Math.abs( wc.touch2 - wc.touch1 );
        	if ( wc.touch2.y &amp;gt; wc.touch1.y ) {
        	    wc.top =  wc.touch1;
        	    wc.bottom = wc.touch2;
        	} else {
                    wc.top =  wc.touch2;
        	    wc.bottom = wc.touch1;
        	}
    	}
    }
</pre></p>
<p>This code gets called for each finger touch and will only complete when a gesture is in process (<code> window.inTouch === true </code> ) .</p>
<p>The next difficulty was tracking the changes in the pageY events. At first I thought I could do this by tracking the identifiers for events though there were cases when they were the same for both so I went with an easier approach. If the number is less than the top it becomes the top and vise-versa with the bottom. Next I needed to track the changes as they happened. I thought the <code>gesturechange</code> event would be the event for me but it did not contain references to the touches so I instead used the <code>touchmove</code> events which are what the <code>gesturechange</code> events are built on.</p>
<p><pre class="brush: jscript;">
    function touchMove( e ) {
        if ( window.inTouch !== true) {
            return;
        }
        var t1 = e.changedTouches.item(0);
        if ( t1.pageY   window.currentGesture.bottom.y) {
        	window.currentGesture.bottom.y = t1.pageY;
        }
         window.currentGesture.scale = window.currentGesture.bottom.y - window.currentGesture.top.y ;
        e.preventDefault();
    }
</pre></p>
<p>The code above fires many times for each finger as you gesture occurs. At first I used tried to access the <code>e.touches.item(0)</code> but found the events were from the original touch event while I wanted the current event. The problem was solved by getting the changed events <code>e.changedTouches.item(0)</code>.</p>
<p>One thing I noticed was that while the first touch may have been in the widget sometime the second might fall slightly outside and once the touchmove events went outside the widget they would not get detected. I was able to get around this by attaching the touchMove event listener to both the <code>document</code> and the top image.</p>
<p>&lt;b&gt;So what did we learn?&lt;/b&gt;</p>
<ul>
<li>You can detect events and gestures in a web page.</li>
<li>Touch Events are the basis for gestures</li>
<li>Touch Events can be used to find additional information about a gesture such as the location</li>
<li>In some cases an additional level of abstraction might be needed to track a gesture</li>
</ul>
<p>Find the working touch <a href="http://gregmurray.org/ipad/stacks/">stack widget and source and working example  here</a>.</p>
<p>Let me know if you have any questions comments.</p>
<p>Additional Reading :</p>
<p><a href="http://looksgoodworkswell.blogspot.com/2010/02/ipad-interesting-moments.html">iPad Interesting Moments (Bill Scott)</a><br />
<a href="http://www.lukew.com/ff/entry.asp?991">New Multi-touch Interactions (Luke Wroblewski)</a><br />
<a href="http://www.sitepen.com/blog/2008/07/10/touching-and-gesturing-on-the-iphone/">Touching and Gesturing on the iPhone (Neil Roberts)</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/htmlpad.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/htmlpad.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/htmlpad.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/htmlpad.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/htmlpad.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/htmlpad.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/htmlpad.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/htmlpad.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/htmlpad.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/htmlpad.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/htmlpad.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/htmlpad.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/htmlpad.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/htmlpad.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=93&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://htmlpad.wordpress.com/2010/03/01/implementing-ipad-user-interactions-in-a-web-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffe066b0daf7819de9d4d59ac7cbbd95?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thethirdamigo</media:title>
		</media:content>

		<media:content url="http://htmlpad.files.wordpress.com/2010/03/touchstack.png?w=300" medium="image">
			<media:title type="html">touchstack</media:title>
		</media:content>

		<media:content url="http://htmlpad.files.wordpress.com/2010/03/touchstack-expanded.png?w=300" medium="image">
			<media:title type="html">touchstack-expanded</media:title>
		</media:content>

		<media:content url="http://htmlpad.files.wordpress.com/2010/03/touchstack-expanding.png?w=300" medium="image">
			<media:title type="html">touchstack-expanding</media:title>
		</media:content>
	</item>
		<item>
		<title>iPhone Web Keyboards</title>
		<link>http://htmlpad.wordpress.com/2010/02/17/iphone-web-keyboards/</link>
		<comments>http://htmlpad.wordpress.com/2010/02/17/iphone-web-keyboards/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 06:25:26 +0000</pubDate>
		<dc:creator>jamesgdriscoll</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://htmlpad.wordpress.com/?p=87</guid>
		<description><![CDATA[Mobile Safari supports multiple new input types, and displays separate keyboards for each. I found the following image on twitpic, posted there by Remi Grumeau. I think that the image speaks for itself as a reference for the different input types supported.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=87&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Mobile Safari supports multiple new input types, and displays separate keyboards for each.</p>
<p>I found the following image on <a href="http://twitpic.com/13qhxb">twitpic</a>, posted there by <a href="http://www.remi-grumeau.com/">Remi Grumeau</a>.  </p>
<p>I think that the image speaks for itself as a reference for the different input types supported.</p>
<p><img src="http://htmlpad.files.wordpress.com/2010/02/iphonekeyboards.jpg?w=500" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/htmlpad.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/htmlpad.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/htmlpad.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/htmlpad.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/htmlpad.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/htmlpad.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/htmlpad.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/htmlpad.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/htmlpad.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/htmlpad.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/htmlpad.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/htmlpad.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/htmlpad.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/htmlpad.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=87&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://htmlpad.wordpress.com/2010/02/17/iphone-web-keyboards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d9afbb6c607e6444dcad007a6180ced?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jamesgdriscoll</media:title>
		</media:content>

		<media:content url="http://htmlpad.files.wordpress.com/2010/02/iphonekeyboards.jpg" medium="image" />
	</item>
		<item>
		<title>Touch Carousel Widget</title>
		<link>http://htmlpad.wordpress.com/2010/02/15/touch-enabled-carousel-widget/</link>
		<comments>http://htmlpad.wordpress.com/2010/02/15/touch-enabled-carousel-widget/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 08:29:04 +0000</pubDate>
		<dc:creator>thethirdamigo</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://htmlpad.wordpress.com/?p=69</guid>
		<description><![CDATA[Many sites use carousel widgets to display images, videos, and headlines. For a long time these widgets were the domain of Flash but today JavaScript and CSS can be used to create similar experiences. What&#8217;s missing is the ability to interact with the widgets like you would any other UI component in a touch environment. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=69&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Many sites use carousel widgets to display images, videos, and headlines. For a long time these widgets were the domain of Flash but today JavaScript and CSS can be used to create similar experiences. What&#8217;s missing is the ability to interact with the widgets like you would any other UI component in a touch environment.</p>
<p>This led me to create a configurable standalone widget that responds to touch commands. I&#8217;m calling it the <a title="Touch Carousel" href="http://gregmurray.org/ipad/carousel/index.html" target="_blank">Touch Carousel</a>. It works well both in traditional pages as well as the iPhone and iPad (through the simulator). Best of all, the widget is not tied to any library and weighs in at under 23kb uncompressed.</p>
<p><img class="size-medium wp-image-70 alignleft" title="touch-carousel" src="http://htmlpad.files.wordpress.com/2010/02/touch-carousel.jpg?w=300&#038;h=199" alt="" width="300" height="199" /></p>
<p>Navigation can be done with a left or right swipe, or by hitting the left or right arrows.  Using the touch <a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariJSRef/SafariJSRef.pdf">Safari extensions</a> this was relatively easy. Below is the code attached to the center scroll pane of the widget.  It detects a left or right touch event using a combination of  the <code>ontouchstart</code> and <code>ontouchmove</code> events.</p>
<p><pre class="brush: jscript;">
_widget.node.ontouchstart = function( e ) {
    _widget.touches = [];
    e.preventDefault();
};
_widget.scrollpane.ontouchmove = function( e ) {
    var targetEvent =  e.touches.item(0);
    _widget.touches.push( targetEvent.clientX );
    if ( _widget.touches.length &amp;gt;= 2 ) {
        if ( _widget.touches[0] &amp;gt; _widget.touches[1] ) {
            _widget.getNext();
        } else {
            _widget.getPrevious();
        }
        delete _widget.touches;
    }
};
</pre></p>
<p>The key is code is :</p>
<p><pre class="brush: jscript;">
_widget.touches.push( targetEvent.clientX );
    if ( _widget.touches.length &amp;gt;= 2 ) {
        if ( _widget.touches[0] &amp;gt; _widget.touches[1] ) {
            _widget.getNext();
        } else {
           _widget.getPrevious();
    }
};
</pre></p>
<p>This looks at two touch events and determines if the slide was to the right or left on the X axis.</p>
<p>One other thing to note is that the <code>ontouchmove</code> handler does not prevent the events from bubbling up to the page. You&#8217;ve got to be careful with this.  When I coded this originally, users were not able zoom in our around, or worse they were getting stuck because the widget was gobbling up the events.</p>
<p>Another quirk was that the mouse down events on the left and right navigation arrows were not going through very easily. It takes a lot more effort to get a <code>onclick</code> event to register. I found myself firmly pressing the left and right navigation links or lightly clicking it 2-3 times to get the event to fire. An easy solution was to detect a touch event on both navigation arrows using a <code>ontouchstart</code> handler. After I added this code the navigation on the iPhone and iPad simulator worked much more smoothly.</p>
<p><pre class="brush: jscript;">
_prevLink.ontouchstart = function( e ) {
    _widget.pause();
    _widget.getNext();
    e.preventDefault();
};
</pre></p>
<p>The Touch Carousel widget and a working examples can be found <a href="http://gregmurray.org/ipad/carousel/">here</a>. While the example works well with the iPad simulator I would suggest giving it a try with a iPhone so you can really do the touch gestures, until you get an iPad. Let me know what you think.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/htmlpad.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/htmlpad.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/htmlpad.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/htmlpad.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/htmlpad.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/htmlpad.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/htmlpad.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/htmlpad.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/htmlpad.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/htmlpad.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/htmlpad.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/htmlpad.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/htmlpad.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/htmlpad.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=69&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://htmlpad.wordpress.com/2010/02/15/touch-enabled-carousel-widget/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffe066b0daf7819de9d4d59ac7cbbd95?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thethirdamigo</media:title>
		</media:content>

		<media:content url="http://htmlpad.files.wordpress.com/2010/02/touch-carousel.jpg?w=300" medium="image">
			<media:title type="html">touch-carousel</media:title>
		</media:content>
	</item>
		<item>
		<title>iPhone Web Frameworks</title>
		<link>http://htmlpad.wordpress.com/2010/02/14/iphone-web-frameworks/</link>
		<comments>http://htmlpad.wordpress.com/2010/02/14/iphone-web-frameworks/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 04:29:54 +0000</pubDate>
		<dc:creator>jamesgdriscoll</dc:creator>
				<category><![CDATA[framework]]></category>

		<guid isPermaLink="false">http://htmlpad.wordpress.com/?p=67</guid>
		<description><![CDATA[When I see a new platform, I&#8217;m the kind of guy that looks for tools first thing. Here&#8217;s a list of existing tools for iPhone web development&#8230; Sadly, many aren&#8217;t suitable for iPad web development (and I&#8217;m sure some would argue that some&#8217;re not even suitable for iPhone web development). So &#8211; what I&#8217;m looking [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=67&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When I see a new platform, I&#8217;m the kind of guy that looks for tools first thing.</p>
<p>Here&#8217;s a list of existing tools for iPhone web development&#8230; Sadly, many aren&#8217;t suitable for iPad web development (and I&#8217;m sure some would argue that some&#8217;re not even suitable for iPhone web development).</p>
<p>So &#8211; what I&#8217;m looking for in a framework:</p>
<ol>
<li>Small enough to be stored in the safari cache (&lt;24kb)
</li>
<li>Provide native look and feel (I may not use it, but it&#8217;s always nice to have)
</li>
<li>Provide basic functionality for Ajax (I could write my own, but why not?)
</li>
</ol>
<p>Here&#8217;s a list of the frameworks I&#8217;ve found.  I haven&#8217;t looked at most of them yet, I&#8217;ll update this page as I do.</p>
<ul>
<li><a href="http://code.google.com/p/iui/">iUI</a></li>
<p>A simple library designed to mimic native look and feel in iPhone web apps.  Joe Hewett, the initial designer, has <a href="http://www.joehewitt.com/blog/introducing_iui.php">a blog post</a> describing it in general terms.  The focus on iPhone behavior means that it&#8217;s either going to have to be rewritten for iPad, or folks will just have to put up with a very blocky interface.</p>
<li><a href="http://paularmstrongdesigns.com/weblog/basejs-a-mobile-javascript-framework/">BaseJS</a></li>
<p>A small, focused library that provides mostly non-visual helper methods</p>
<li><a href="http://phonegap.com/">PhoneGap</a></li>
<li><a href="http://xuijs.com/">XUI</a></li>
<li><a href="http://www.funkyspacemonkey.com/pastrykit-iphone-javascript-framework-apple-takes-webapps-level">PastryKit</a>
</li>
<li><a href="http://www.jqtouch.com/">jQTouch</a>
</li>
<li><a href="http://iwebkit.net/">iWebkit</a>
</li>
<li><a href="http://webapp-net.com/">WebApp.net</a>
</li>
<li><a href="http://code.google.com/p/iphone-universal/">UiUIKit</a></li>
<li>Apples provided <a href="http://developer.apple.com/mac/library/documentation/AppleApplications/Conceptual/Dashcode_UserGuide/Contents/Resources/en.lproj/MakingaWebApp/MakingaWebApp.html#//apple_ref/doc/uid/TP40004692-CH18-SW1">Dashcode app builder</a> (not a framework per se, of course)
</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/htmlpad.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/htmlpad.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/htmlpad.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/htmlpad.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/htmlpad.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/htmlpad.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/htmlpad.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/htmlpad.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/htmlpad.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/htmlpad.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/htmlpad.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/htmlpad.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/htmlpad.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/htmlpad.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=67&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://htmlpad.wordpress.com/2010/02/14/iphone-web-frameworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d9afbb6c607e6444dcad007a6180ced?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jamesgdriscoll</media:title>
		</media:content>
	</item>
		<item>
		<title>Useful Links for General HTML5 information</title>
		<link>http://htmlpad.wordpress.com/2010/02/13/useful-links-for-general-html5-information/</link>
		<comments>http://htmlpad.wordpress.com/2010/02/13/useful-links-for-general-html5-information/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 05:26:32 +0000</pubDate>
		<dc:creator>jamesgdriscoll</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://htmlpad.wordpress.com/?p=64</guid>
		<description><![CDATA[Here&#8217;s a few useful links for learning HTML5: A short introduction to HTML5 (mostly just covering the new semantic markup). Mark Pilgrim&#8217;s excellent and soon to be published book A pocket reference to HTML5 semantic tags The HTML5 Doctor Blog (now also in our blogroll) Official W3C Document on differences from HTML4 And of course, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=64&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a few useful links for learning HTML5:</p>
<ul>
<li>A short introduction to <a href="http://robertnyman.com/2009/10/14/an-introduction-to-html5/">HTML5</a> (mostly just covering the new semantic markup).</li>
<li>Mark Pilgrim&#8217;s excellent and soon to be published <a href="http://diveintohtml5.org/">book</a></li>
<li>A <a href="http://adactio.com/extras/pocketbooks/html5/">pocket reference</a> to HTML5 semantic tags</li>
<li><a href="http://html5doctor.com/">The HTML5 Doctor</a> Blog (now also in our blogroll)</li>
<li><a href="http://dev.w3.org/html5/html4-differences/">Official W3C Document</a> on differences from HTML4</li>
<li>And of course, for the masochistic, there&#8217;s always <a href="http://dev.w3.org/html5/spec/Overview.html">the full spec in it&#8217;s entirety</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/htmlpad.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/htmlpad.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/htmlpad.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/htmlpad.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/htmlpad.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/htmlpad.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/htmlpad.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/htmlpad.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/htmlpad.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/htmlpad.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/htmlpad.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/htmlpad.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/htmlpad.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/htmlpad.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=64&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://htmlpad.wordpress.com/2010/02/13/useful-links-for-general-html5-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d9afbb6c607e6444dcad007a6180ced?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jamesgdriscoll</media:title>
		</media:content>
	</item>
		<item>
		<title>Tracking Touch Events on the iPad</title>
		<link>http://htmlpad.wordpress.com/2010/02/12/tracking-touch-events-on-the-ipad/</link>
		<comments>http://htmlpad.wordpress.com/2010/02/12/tracking-touch-events-on-the-ipad/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 08:11:02 +0000</pubDate>
		<dc:creator>thethirdamigo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://htmlpad.wordpress.com/?p=58</guid>
		<description><![CDATA[Touch events on the iPad work like they do on the iPhone. You can attach event listeners two DOM elements and have listeners called when an event occurs. Apple has provides this resource which provides a nice example which I thought might be good to simplify. Basically what you need to do is : 1) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=58&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Touch events on the iPad work like they do on the iPhone. You can attach event listeners two DOM elements and have listeners called when an event occurs. Apple has provides <a title="Interactive Visual Effects" href="http://developer.apple.com/safari/library/documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/InteractiveVisualEffects/InteractiveVisualEffects.html" target="_blank">this</a> resource which provides a nice example which I thought might be good to simplify.</p>
<p>Basically what you need to do is :</p>
<p>1) Attach a listener to an element</p>
<p><pre class="brush: xml;">
 &lt;div id=&quot;_mcePaste&quot;&gt;
   &lt;div id=&quot;box&quot; style=&quot;height:225px;width:225px;background:red;position:absolute&quot;&lt;/div&gt;
   &lt;div&gt;ontouchmove=&quot;touchMove(event)&quot;&lt;/div&gt;
   &lt;div&gt;ontouchstart=&quot;touchStart(event)&quot;&lt;/div&gt;
 &lt;/div&gt;
</pre></p>
<p>2) Do something when an event occurs</p>
<p><pre class="brush: jscript;">
function touchStart( e ) {
 var box = document.getElementById(&quot;box&quot;);
 box.style.background = &quot;green&quot;;
 e.preventDefault();
 return false;
}
</pre></p>
<p><pre class="brush: jscript;">
function touchMove( e ) {
 var targetEvent =  e.touches.item(0);
 var box = document.getElementById(&quot;box&quot;);
 box.style.background = &quot;yellow&quot;;
 box.style.left = targetEvent.clientX + &quot;px&quot;;
 box.style.top= targetEvent.clientY + &quot;px&quot;;
 e.preventDefault();
 return false;
}
</pre></p>
<p>It is important to have the <span style="font-family:monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;"> e.preventDefault(); in the  the event handler to prevent the event from being propagated to the browser and causing unwanted scrolling events.</span></p>
<p><span style="font-family:monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">I have created a full working example with source <a title="iPad Touch Event Test" href="http://gregmurray.org/ipad/touch-events.html" target="_blank">here</a>. You will need an iPhone or iPad simulator to test this code.</span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/htmlpad.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/htmlpad.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/htmlpad.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/htmlpad.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/htmlpad.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/htmlpad.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/htmlpad.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/htmlpad.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/htmlpad.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/htmlpad.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/htmlpad.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/htmlpad.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/htmlpad.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/htmlpad.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=htmlpad.wordpress.com&amp;blog=11943894&amp;post=58&amp;subd=htmlpad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://htmlpad.wordpress.com/2010/02/12/tracking-touch-events-on-the-ipad/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffe066b0daf7819de9d4d59ac7cbbd95?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thethirdamigo</media:title>
		</media:content>
	</item>
	</channel>
</rss>
