<?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>uxebu » blog &#187; frontend engineering</title>
	<atom:link href="http://uxebu.com/category/frontend-engineering/feed/" rel="self" type="application/rss+xml" />
	<link>http://uxebu.com/blog</link>
	<description></description>
	<lastBuildDate>Mon, 23 Apr 2012 19:10:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>My console.log() strategy</title>
		<link>http://uxebu.com/blog/2011/09/02/my-console-log-strategy/</link>
		<comments>http://uxebu.com/blog/2011/09/02/my-console-log-strategy/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 10:00:36 +0000</pubDate>
		<dc:creator>Wolfram Kriesing</dc:creator>
				<category><![CDATA[development tools]]></category>
		<category><![CDATA[frontend engineering]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[console.log]]></category>

		<guid isPermaLink="false">http://uxebu.com/blog/?p=1723</guid>
		<description><![CDATA[This time I feel like sharing my (maybe) strange looking console.log() strategy, but I find it very effective, read on to learn why. If I can&#8217;t debug, for whatever reason and have to fall back to console.log()s you normally see my code looking like this: 123456789console.log&#40;&#34;i = &#34;, i&#41;; &#160; &#160; if &#40;i==0&#41;&#123; console.log&#40;1&#41;; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>This time I feel like sharing my (maybe) strange looking <code class="codecolorer text mac-classic"><span class="text">console.log()</span></code> strategy, but I find it very effective, read on to learn why.<br />
<span id="more-1723"></span></p>
<p>If I can&#8217;t debug, for whatever reason and have to fall back to <code class="codecolorer text mac-classic"><span class="text">console.log()</span></code>s you normally see my code looking like this:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;i = &quot;</span><span style="color: #339933;">,</span> i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">==</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// Do something here</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// Do else </span><br />
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>You can see two things here:</p>
<ul>
<li>the first line prints out a variable&#8217;s value, simple I guess</li>
<li>all <code class="codecolorer text mac-classic"><span class="text">console.log()</span></code>s are not indented at all</li>
</ul>
<p>Let me touch on the &#8220;not indenting&#8221; first.<br />
I don&#8217;t like to indent <code class="codecolorer text mac-classic"><span class="text">console.log()</span></code>s because this just makes the code look ugly, and that is intentional, because <code class="codecolorer text mac-classic"><span class="text">console.log()</span></code> normally just doesn&#8217;t belong in the code. By making the code look ugly I am quickly forced to remove them again, the latest I will stumble on it before committing, because I never commit without looking at the diff.<br />
If I ever forget to remove the <code class="codecolorer text mac-classic"><span class="text">console.log()</span></code> I can be sure that a coworker will be annoyed by it and hopefully either ping me or remove it. But I am trying my best not to forget it :).</p>
<h2>Komodo macro</h2>
<p>Back to the first <code class="codecolorer text mac-classic"><span class="text">console.log()</span></code> you see in the code example up there, that one is actually one keystroke away for me, I have hacked a simple macro in my editor (<a href="http://www.activestate.com/komodo-edit">Komodo Edit</a>) that takes the text I selected and creates a <code class="codecolorer text mac-classic"><span class="text">console.log()</span></code> in the line below throwing out this variable and it&#8217;s value.<br />
This little script looks like this:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> s <span style="color: #339933;">=</span> ko.<span style="color: #660066;">views</span>.<span style="color: #660066;">manager</span>.<span style="color: #660066;">currentView</span>.<span style="color: #660066;">scimoz</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> t <span style="color: #339933;">=</span> s.<span style="color: #660066;">selText</span><span style="color: #339933;">;</span><br />
komodo.<span style="color: #660066;">doCommand</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'cmd_end'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
komodo.<span style="color: #660066;">doCommand</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'cmd_newlineBare'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">// Only if something was selected put it there.</span><br />
t <span style="color: #339933;">=</span> t <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;'&quot;</span><span style="color: #339933;">+</span>t<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; = ', &quot;</span><span style="color: #339933;">+</span>t<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;arguments&quot;</span><span style="color: #339933;">;</span><br />
s.<span style="color: #660066;">insertText</span><span style="color: #009900;">&#40;</span>s.<span style="color: #660066;">currentPos</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;console.log(&quot;</span><span style="color: #339933;">+</span>t<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;);&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">// Set the cursor inside the &quot;()&quot; at the end, so we can add</span><br />
<span style="color: #006600; font-style: italic;">// parameters</span><br />
komodo.<span style="color: #660066;">doCommand</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'cmd_end'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
komodo.<span style="color: #660066;">doCommand</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'cmd_left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
komodo.<span style="color: #660066;">doCommand</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'cmd_left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Just create a new macro with it and attach a key-combination to it and logging a variable is just one key stroke away.</p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2011/09/02/my-console-log-strategy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript, HTML5, CSS3 workshop</title>
		<link>http://uxebu.com/blog/2011/06/10/javascript-html5-css3-workshop/</link>
		<comments>http://uxebu.com/blog/2011/06/10/javascript-html5-css3-workshop/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 13:58:56 +0000</pubDate>
		<dc:creator>Wolfram Kriesing</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[frontend engineering]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[html5apps]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[uxebu]]></category>
		<category><![CDATA[workshop]]></category>

		<guid isPermaLink="false">http://uxebu.com/blog/?p=1554</guid>
		<description><![CDATA[Uxebu is spreading its knowledge, get some of it &#8211; for 699€ if you are an early bird (999€ later)! Uxebu is now operating it&#8217;s business purely in the JavaScript space for about three years (oh that reminds me we should have a party!). We are convinced that JavaScript is ramping up now and we [...]]]></description>
			<content:encoded><![CDATA[<h2>Uxebu is spreading its knowledge, get some of it &#8211; for 699€ if you are an early bird (999€ later)!</h2>
<p><span id="more-1554"></span></p>
<p>Uxebu is now operating it&#8217;s business purely in the JavaScript space for about three years (oh that reminds me we should have a party!). We are convinced that JavaScript is ramping up now and we see that there are more and more things done and possible with the language. The browser landscape is developing rapidly and changing every day. The mobile industry is pushing the limits and we are helping to do our part in it. We learned a lot and are still learning. As it is in the nature of our company to spread our knowledge to allow everyone to use the technology at it&#8217;s best and push the limits with us, we think now it&#8217;s the time that we share our knowledge and pass it on to those hungering for diving into JavaScript!</p>
<p>We really have <a href="http://twitter.com/void_0">gathered</a> <a href="http://twitter.com/jensarps">a lot</a> of <a href="http://twitter.com/tobeytailor">bright</a>, <a href="http://twitter.com/evilhackerdude">bleeding-edge</a> <a href="http://twitter.com/kuvos">people</a> and each of us is learning from another everyday. If you want to get some of the know how (at least as much as we can pass on in a two day workshop) you are invited to <a href="http://uxebu.com/html5-workshop/">join our workshops</a>. There will be one held in <a href="http://de.amiando.com/jsmunich.html"><strong>Munich 29th and 30th of June</strong></a> and another one in <a href="http://de.amiando.com/jsamsterdam.html"><strong>Amsterdam 11th and 12th of July</strong></a>. We will always have at least two uxebus teaching you the latest and hottest. We might even have some of the latest <a href="http://twitter.com/twtomcat/statuses/79157866954637313">bleeding-edge mobile devices</a> for you to run the app you will develop in the workshop.</p>
<hr style="margin: 4em 0;" />
<h2>Workshop Details</h2>
<p>In this course we will cover a broad spectrum from JavaScript essentials to the bleeding edge of cross platform HTML5 development. We start from the ground up and go step by step, depending on the level of the participants we accelerate to show you the deep and dark sides of JavaScript.</p>
<p>Each day of the course is split into an intensive “knowledge transfer” session in the morning and a hands on hacking workshop in the afternoon in which you will apply the contents learned during the morning. At the end you will have touched all contents not only through theory but also through intensive real life application and coding.</p>
<p><em>Note that this course will not explain you how to work with jQuery and also not how to work without jQuery. The course mainly focuses on JavaScript, mobile and HTML5.</em></p>
<h2>Day 1 (part 1) &#8211; JavaScript</h2>
<p>We start with a small overview of the history. We tackle the basic structure of the language and move on with <strong>statements</strong>, <strong>expressions</strong>, <strong>functions</strong> and <strong>objects</strong>. We touch the different <strong>operators</strong> and when semi colons are introduced.</p>
<p>We continue our way through the JavaScript landscape by taking a look at <strong>objects</strong>, <strong>properties</strong> and <strong>built-in functionality</strong>. At that point we’ll encounter our first major obstacles; <strong>scopes</strong> and <strong>closures</strong>. Once we conquer these we touch on the <strong>difference between functions and constructors</strong>. This is followed by our second major obstacle; <strong>prototype</strong> and the various values of the <strong>this keyword</strong>.</p>
<h2>Day 1 (part 2) &#8211; Hackday: HTML5, CSS3</h2>
<p>During the second part of day one, we will take what we have learned in the morning and mix it with a little shot of HTML5 fanciness. We will look at all those new APIs we can now access on our (mobile) devices to bring JavaScript to a new level. We will include cool APIs such as the <strong>Audio API, Video API, history, Canvas, SVG, File API, WebGL, DeviceMotion, WebWorkers, WebSocket, GPS</strong> &#8211; and if all ingredients fit well you might just end up with your first app written in JavaScript.</p>
<h2>Day 2 (part 1) &#8211; The App Day</h2>
<p>During the second day we willl continue with <strong>timers</strong>, <strong>callbacks</strong>, <strong>web workers</strong>, <strong>eval</strong> and the <strong>future of JavaScript</strong>. The speed of the course is matched with it’s participants. The important parts of the languages will be handled in the workshop. During the first part of day two we will also specifically look into topics which you want to cover after determining those during day one. This will give you the chance to get all your open questions answered so that you have your pockets full of knowledge after the workshop is over.</p>
<h2>Day 2 &#8211; part two (Mobile)</h2>
<p>JavaScript has grown strongly into the mobile space, so we will show you how to get the app you have started building during day one onto <strong>mobile devices</strong>. You will learn about <strong>media queries</strong>, some <strong>device sensors</strong>, <strong>performance</strong> and HTML5/CSS3/JavaScript tricks and how to optimize some parts for mobile and how to make a <strong>native app</strong> out of it, so you finally could even make get it into the <strong>app store</strong> and make money with it.</p>
<h2>Now you want to join our workshop?</h2>
<p>Join us either</p>
<ul>
<li>in <a href="http://de.amiando.com/jsmunich.html"><strong>Munich 29th and 30th of June</strong></a>or</li>
<li>in <a href="http://de.amiando.com/jsamsterdam.html"><strong>Amsterdam 11th and 12th of July</strong> </a></li>
</ul>
<p><a href="http://uxebu.com/html5-workshop/"><img style="position: fixed; left: 0; top: 0;" src="http://uxebu.com/html5-workshop/workshop-badge.png" alt="Workshop: " /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2011/06/10/javascript-html5-css3-workshop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using IndexedDB on Firefox</title>
		<link>http://uxebu.com/blog/2011/03/30/using-indexeddb-on-firefox/</link>
		<comments>http://uxebu.com/blog/2011/03/30/using-indexeddb-on-firefox/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 14:55:00 +0000</pubDate>
		<dc:creator>Jens Arps</dc:creator>
				<category><![CDATA[frontend engineering]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[IDB]]></category>
		<category><![CDATA[indexedDB]]></category>
		<category><![CDATA[offline]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://uxebu.com/blog/?p=1494</guid>
		<description><![CDATA[As Firefox 4 is now stable, chances are that the async IDB (IndexedDB) API is not going to change anymore. But IDB is not localStorage – it can be a major pain to work with. So, here is a guide on how to use IDB in Firefox as a key-value store. TL;DR There is example code [...]]]></description>
			<content:encoded><![CDATA[<p>As Firefox 4 is now stable, chances are that the async IDB (IndexedDB) API is not going to change anymore. But IDB is not localStorage – it can be a major pain to work with. So, here is a guide on how to use IDB in Firefox as a key-value store.</p>
<p><em><strong>TL;DR</strong></em><br />
There is example code available at the end of the post. If you don‘t want to read this lengthy post and/or prefer to jump right in the middle of the action, grab the example implementation and play around with it.<br />
<span id="more-1494"></span></p>
<h1>Key-Value Store? But, IDB is a full-blown database!</h1>
<p>Yes, it is. But I still argue that in WebApp context a key-value store will cover about 90% of use cases. So I won‘t cover in this post how to create fancy key ranges or how to create multiple indices. But I will cover the five basic methods that you will need to work with any store: get, set, remove, getAll and clear – this will enable you to work with IDB and give you an understanding of how it works. You‘re then of course heartly encouraged to explore it and it‘s features further!</p>
<h1>A word on requests, transactions and events</h1>
<p>As long as the sync API is not there, all operations are async. That means that you will make requests. All the time. These requests will have an onerror and an onsuccess property, where you can put your callbacks/handlers in. If your request was successful, you will get an event in your callback. That event contains a lot of useful and useless information, but what you will want to look at in most cases is event.target.result – this is where your result lives in. In most cases, you will have to start a transaction before; inside of the transaction, you can access the objectStore and make your request. However, there are different types of transactions, but you will get the details below.</p>
<h1>Getting the Object Store ready to use</h1>
<p>Yep, it‘s not that you can just start away and store your data, there‘s some work to do ahead…</p>
<h2>Open the Database</h2>
<p>Easy one:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> openRequest <span style="color: #339933;">=</span> mozIndexedDB.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>dbName<span style="color: #339933;">,</span> dbDescription<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
openRequest.<span style="color: #660066;">onsuccess</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//event.target.result contains a reference to the db</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p><code class="codecolorer text mac-classic"><span class="text">event.target.result</span></code> then contains a reference to the database. Store it, you will need it.</p>
<h2>Creating/Opening the ObjectStore</h2>
<p>That‘s a little tougher. Some operations, such as creating and deleting object stores, require the database to be in a „mutation transaction state“. Wow. Well, there‘s only one way to put the db into this state, and that‘s via a <code class="codecolorer text mac-classic"><span class="text">setVersion</span></code> request. If you are opening the db for the first time ever, you will need to do this anyway. You can, of course, change the version of the database anytime, which might be a useful thing if you, e.g., change the structure of how your objectStore saves the data. To check what version the database in the user‘s browser has, you can check the <code class="codecolorer text mac-classic"><span class="text">version</span></code> property in the reference to the database anytime.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> versionRequest <span style="color: #339933;">=</span> db.<span style="color: #660066;">setVersion</span><span style="color: #009900;">&#40;</span>dbVersion<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
versionRequest.<span style="color: #660066;">onsuccess</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// Woohoo, the database is in a mutation transaction!!</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Inside of the callback function, you can now check if your store already exists, or if you need to create it. The reference to your db contains an object called <code class="codecolorer text mac-classic"><span class="text">objectStoreNames</span></code>, which is a list of existing objectStores. As this is a DOMStringList, it features the handy <code class="codecolorer text mac-classic"><span class="text">contains()</span></code> method:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> hasMyStore <span style="color: #339933;">=</span> db.<span style="color: #660066;">objectStoreNames</span>.<span style="color: #660066;">contains</span><span style="color: #009900;">&#40;</span>storeName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>If the store is not there, you need to create it via the <code class="codecolorer text mac-classic"><span class="text">createObjectStore()</span></code> method. It takes two arguments: the name of the store, and an object with two properties: <code class="codecolorer text mac-classic"><span class="text">keyPath</span></code> and <code class="codecolorer text mac-classic"><span class="text">autoIncrement</span></code>. keyPath is… well… the path to the key. Think of it as the one column that is the primary key in your data table (you all did some MySQL at some time, I bet). You can do really fancy things with the keyPath in objectStores, but it‘s perfectly fine to just use something like „id“ as the keyPath. If you want to store an object and want to provide the keyPath, all you need to do is let the object you want to store have a property with the name of the keyPath, and a unique value. Uh, it‘s not that complicated, examples will follow. AutoIncrement is, well, autoIncrement. You have the option to let the objectStore take care for the uniqueness of it‘s data‘s keyPath properties, or do it yourself.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> store <span style="color: #339933;">=</span> db.<span style="color: #660066;">createObjectStore</span><span style="color: #009900;">&#40;</span>storeName<span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>keyPath<span style="color: #339933;">:</span> <span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> autoIncrement<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>You immediately get a reference to the newly created objectStore, so save it.</p>
<p>If the store is already there, you need to open it. Um, well, you don‘t really have to open it, but you might want to obtain a reference to it, just to make sure that it really exists. To do this, you need to start a transaction via the <code class="codecolorer text mac-classic"><span class="text">transaction()</span></code> method. It accepts three arguments: an array of store names (the ones which you want to work with), an integer denoting whether you want to read and/or write during that transaction, and a timeout. There are constants for read/write you can use for better readability in your code, you can find them at <code class="codecolorer text mac-classic"><span class="text">IDBTransaction.READ_ONLY</span></code> and <code class="codecolorer text mac-classic"><span class="text">IDBTransaction.READ_WRITE</span></code>. The timeout parameter is optional. That method returns a transaction object that contains a method called <code class="codecolorer text mac-classic"><span class="text">objectStore</span></code>, which you can use to access your store. This is the „default“ way transactions work; the mutation transaction above is an eception to this, where you need to be in the callback of the transaction to modify the database.</p>
<p>In our case, we can start an „empty“ transaction:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> emptyTransaction <span style="color: #339933;">=</span> db.<span style="color: #660066;">transaction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> IDBTransaction.<span style="color: #660066;">READ_ONLY</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> store <span style="color: #339933;">=</span> emptyTransaction.<span style="color: #660066;">objectStore</span><span style="color: #009900;">&#40;</span>storeName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>There you have your reference to the store.</p>
<h1>Data Manipulation</h1>
<p>Now that the store is ready to use, it‘s time to store some data in it. To do so, you need to start a transaction, access the object store, and call the store‘s <code class="codecolorer text mac-classic"><span class="text">put</span></code> method:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> putTransaction <span style="color: #339933;">=</span> db.<span style="color: #660066;">transaction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>storeName<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> IDBTransaction.<span style="color: #660066;">READ_WRITE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> putRequest <span style="color: #339933;">=</span> putTransaction.<span style="color: #660066;">objectStore</span><span style="color: #009900;">&#40;</span>storeName<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">put</span><span style="color: #009900;">&#40;</span>dataObj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
putRequest.<span style="color: #660066;">onsuccess</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//event.target.result contains the value of the keyPath of the data written (the „key“)</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>That‘s all. This type of transaction is what you also use for other data manipulation tasks, for example to retrieve data:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> getTransaction <span style="color: #339933;">=</span> db.<span style="color: #660066;">transaction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>storeName<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> IDBTransaction.<span style="color: #660066;">READ_ONLY</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> getRequest <span style="color: #339933;">=</span> getTransaction.<span style="color: #660066;">objectStore</span><span style="color: #009900;">&#40;</span>storeName<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
getRequest.<span style="color: #660066;">onsuccess</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//event.target.result contains the data object</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>You will need to provide the key of the stored entry to get it; as you need to do when you want to remove it:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> removeTransaction <span style="color: #339933;">=</span> db.<span style="color: #660066;">transaction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>storeName<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> IDBTransaction.<span style="color: #660066;">READ_WRITE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> deleteRequest <span style="color: #339933;">=</span> removeTransaction.<span style="color: #660066;">objectStore</span><span style="color: #009900;">&#40;</span>storeName<span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">delete</span><span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
deleteRequest.<span style="color: #660066;">onsuccess</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//event.target.result contains the key of the deleted data object</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>If you want to get all data objects from the store:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> getAllTransaction <span style="color: #339933;">=</span> db.<span style="color: #660066;">transaction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>storeName<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> IDBTransaction.<span style="color: #660066;">READ_ONLY</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> getAllRequest <span style="color: #339933;">=</span> getAllTransaction.<span style="color: #660066;">objectStore</span><span style="color: #009900;">&#40;</span>storeName<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
getAllRequest.<span style="color: #660066;">onsuccess</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//event.target.result contains an array of all data objects</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>And, finally, if you want to clear (i.e., delete all data objects) the store:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> clearTransaction <span style="color: #339933;">=</span> db.<span style="color: #660066;">transaction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>storeName<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> IDBTransaction.<span style="color: #660066;">READ_WRITE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> clearRequest <span style="color: #339933;">=</span> clearTransaction.<span style="color: #660066;">objectStore</span><span style="color: #009900;">&#40;</span>storeName<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">clear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
clearRequest.<span style="color: #660066;">onsuccess</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//event.target.result contains undefined</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h1>But how‘s this better than localStorage?</h1>
<p>It isn‘t. Yeah, well, it is, as you can store objects and don‘t have to stringify them before. But basically, to get the real advantages of IDB, you will need to dive deeper into it. Features like keyRanges remove the need to do map/reduce action when you search for items in your store. But now you have an idea of how the whole thing works. If you want to go further, browse in the spec or the MDC docs and try things out!</p>
<p><strong>Example Code</strong></p>
<p>There is an example page over here: <a href="http://static.uxebu.com/~jens/indexeddb/ff-idb.html" target="_blank">http://static.uxebu.com/~jens/indexeddb/ff-idb.html</a>.</p>
<p>It uses an ObjectStore wrapper I created using dojo that covers the basic methods mentioned above, the JavaScript is here: <a href="http://static.uxebu.com/~jens/indexeddb/idb-ff.js" target="_blank">http://static.uxebu.com/~jens/indexeddb/idb-ff.js</a>.</p>
<p>When you open the page, open the console and you will see some messages there. Check out the source to see what‘s going on; it‘s basically a round trip through all the basic methods.</p>
<p><strong>Further Reading</strong></p>
<ul>
<li>The spec: <a href="http://www.w3.org/TR/IndexedDB/" target="_blank">http://www.w3.org/TR/IndexedDB/</a></li>
<li>The MDC article: <a href="https://developer.mozilla.org/en/IndexedDB" target="_blank">https://developer.mozilla.org/en/IndexedDB</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2011/03/30/using-indexeddb-on-firefox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What is WAC and how it could help us</title>
		<link>http://uxebu.com/blog/2011/02/24/what-is-wac-and-how-it-could-help-us/</link>
		<comments>http://uxebu.com/blog/2011/02/24/what-is-wac-and-how-it-could-help-us/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 16:53:08 +0000</pubDate>
		<dc:creator>Stephan</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[development tools]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[frontend engineering]]></category>
		<category><![CDATA[html5apps]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[w3c widgets]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[w3c]]></category>
		<category><![CDATA[wac]]></category>

		<guid isPermaLink="false">http://uxebu.com/blog/?p=1402</guid>
		<description><![CDATA[At Mobile World Congress 2011 in Barcelona, @uxebu attended the WAC event to catch up with the future of WAC. WAC, short for Wholesale Applications Community, is a group of global mobile operators. They provide, among other things, a spec for their correspondent web application runtime &#8220;WAC&#8221;. Recently the new WAC 2.0 Spec got out [...]]]></description>
			<content:encoded><![CDATA[<p>
At Mobile World Congress 2011 in Barcelona, @uxebu attended the WAC event to catch up with the future of WAC.<br />
WAC, short for Wholesale Applications Community, is a group of global mobile operators.<br />
They provide, among other things, a spec for their correspondent web application runtime &#8220;WAC&#8221;.
</p>
<p>
Recently the new WAC 2.0 Spec got out and it&#8217;s looking good.<br />
Compared to WAC 1.0, the WAC 2.0 Spec is a shift into the right direction:<br />
Instead of inventing new APIs, WAC 2.0 adheres to web standards like HTML5 and W3C Widget Packaging.
</p>
<p><span id="more-1402"></span></p>
<p>
Let&#8217;s compare the two major spec revisions in that repsect:
</p>
<p>
As said before, the WAC 1.0 Spec described distinct APIs, e.g., for audio, messaging (SMS &#038; email), camera and geo-location.
</p>
<p>
Taking photos, for example, involved assigning a callback to a global value inside the Camera object and invoking Camera&#8217;s captureImage method.
</p>
<p>
There&#8217;s a problem with that: What if two pieces of code both assign their own callback to that shared value?<br />
The one which assigned its callback last will be executed. The first callback is &#8220;dead code&#8221;.<br />
Of course this can be remedied by the app developer, but I believe it&#8217;s the library&#8217;s job to get something as essential as deferred execution right.<br />
All WAC 1.0 APIs use this global callback model and inherit the problem.<br />
There are better, more elegant ways to defer execution (e.g. dojo&#8217;s Deferred or node&#8217;s callback passing &#038; EventEmitter).<br />
And fortunately, WAC 2.0 replaced the old model with a callback passing approach.
</p>
<p>
If everything goes well, what could WAC provide developers with?
</p>
<ol>
<li>An easy way to package web apps &#8220;for home screens &#038; app stores&#8221; by wrapping web apps in native container apps.</li>
<li>An extension of browsers&#8217; capabilities to enable richer web apps. This includes APIs for camera and file access.</li>
<li>In contrast to alternatives WAC has a strong focus on carrier network APIs. This could enable purchase through carrier billing.</li>
<li>A security model to effectively protect user&#8217;s privacy and security.</li>
</ol>
<p>
So go ahead and look at what the new WAC 2.0 has to offer.<br />
I&#8217;m excited to build apps with it once it&#8217;s running on some major platforms!
</p>
<p>
To conclude I&#8217;d like to end this post with my personal opinion on what I believe WAC needs to focus on to succeed:
</p>
<ol>
<li>WAC runtimes have to run at least on iOS, Android and a few other major-marketshare platforms. There&#8217;s no point in developing cross-platform web apps if you ignore major platforms.</li>
<li>WAC&#8217;s marketing &#038; identity need to be more developer-centric. Different top-notch WAC runtimes need to be advertised by WAC. Ideally there would be an official runtime for each platform.</li>
<li>Apps built on top of WAC runtimes have to be compatible to major app stores. For example, imagine a developer is targeting Android and iOS. What if Apple rejected WAC-based apps because of, e.g., a bundled custom WebKit build? I&#8217;m pretty sure no sane developer would consider WAC if that effectively banned their app from ever going into the most profitable app store. And while there will be carrier-operated stores I am not overly confident in that. Human beings simply prefer one familiar store/market on their phone.</li>
<li>Web app developers want their code base functioning consistently across multiple platforms with little or no effort. This implies that different WAC runtimes should strictly respect the specification. If there are implementation differences it&#8217;ll result in multiple code branches in the app code to repair broken implementations. Well, if WAC wants to succeed this must not become an issue for the app developer! Most apps are going to need custom code to support physical device differences. So hey, it will be incredibly helpful if the basic APIs were consistently implemented! Please don&#8217;t screw this up, because I somehow doubt someone would develop a cross-WAC-platform JavaScript framework.</li>
<li>WAC 2.0 runtimes with the above properties should appear very soon. They also need to be advertised in an easy to understand manner.</li>
<li>WAC should stick to W3C specs &#038; drafts for APIs. If an API becomes part of a given platform it should be removed from that platform&#8217;s WAC runtime. Think back to when Google removed Gears support from their own browser to make way for standardized APIs.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2011/02/24/what-is-wac-and-how-it-could-help-us/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Travel with uxebu &#8211; We are hiring!</title>
		<link>http://uxebu.com/blog/2011/02/10/travel-with-uxebu-we-are-hiring/</link>
		<comments>http://uxebu.com/blog/2011/02/10/travel-with-uxebu-we-are-hiring/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 16:56:04 +0000</pubDate>
		<dc:creator>Wolfram Kriesing</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[frontend engineering]]></category>
		<category><![CDATA[html5apps]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[uxebu]]></category>

		<guid isPermaLink="false">http://uxebu.com/blog/?p=1377</guid>
		<description><![CDATA[Yesterday HP announced the new WebOS devices in San Francisco. Nikolai and Stephan had been there (and they are still there). MWC starts on Monday. Six out of seven of the uxebus will be there in Barcelona, all week, one apartment, sea view and fun. After JSConf in Portland (at least) three of us are [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday HP announced the new WebOS devices in <strong>San Francisco</strong>. Nikolai and Stephan had been there (and they are still there). MWC starts on Monday. Six out of seven of the uxebus will be there in <strong>Barcelona</strong>, all week, one apartment, sea view and fun. After JSConf in <strong>Portland</strong> (at least) three of us are going to <a href="http://nodeconf.com/">NodeConf</a> and <a href="http://www.google.com/events/io/2011/">Google IO</a> again in <strong>San Francisco</strong>. Right after it all of uxebu will be in <strong>Amsterdam</strong> for <a href="http://mobilism.nl/2011">mobilism</a>. We have also been in <strong><a href="http://skillsmatter.com/podcast/ajax-ria/the-mobile-web-the-future-today">London</a></strong>, <strong><a href="http://swdc-central.com/">Malmö</a></strong>, <strong><a href="http://www.developermarch.com/mods/2010/report/index.html">Bangalore</a></strong> and more &#8230; Yeah we are a travel company!<br />
<span id="more-1377"></span></p>
<p>You do not only get to travel in uxebu. First and foremost we want to give you the opportunity and platform to accelerate the things you can do, show it to the community and enable you to reach more than you could on your own.<br />
It doesn&#8217;t matter where you live! We are currently flirting with San Francisco too :).</p>
<p>But we are also a family company! We encourage you to have fun and put the priorities right. And family and health are top priorities at uxebu. As you can also see, as long as you like traveling and hanging out with the top geeks in our community you get to do that at uxebu, a lot. Because this is the bread and butter of high quality that we offer to our customers. And in order to become a top geek (which is one goal that we have for you at uxebu, if you aren&#8217;t one yet :)) you should be around those where you can suck know how and hopefully also give back and share yours as well.<br />
You get the hardware that you need to work as efficient as possible. You prefer working at home or in a co-working space? No problem, feel free! Once in a time we meet some place and hack together for a couple of days, talk about our roadmap, find out where each of us wants to head and we figure out the way how to achieve reaching the goal we determine together. We normally meet some nice place, like at a lake or in the mountains. The last times we had both :). And we take the families with us.</p>
<p><a href="http://twitter.com/jensarps">Jens Arps</a> joined uxebu in May 2010, he is the guy behind <a href="https://github.com/jensarps/StorageJS">StorageJS</a>, he is project lead for the just new dojo foundation member <a href="http://embedjs.org">embedJS</a> and is working on a really exciting HTML5 customer project that I can not link here :(. <a href="http://twitter.com/evilhackerdude">Stephan Seidt</a> has hacked the newest (still unreleased) <a href="http://apparat.io">apparatio</a> API, he is the one who does the <a href="http://nodejs.org/">node.js</a> stuff in our team and WebGL is what <a href="http://2011.jsconf.us/#/proposal/6f23fd600302403a9f53e11390179c4e">he is passionate</a> about, really passionate! I don&#8217;t have to say much about <a href="http://twitter.com/tobeytailor">Tobias Schneider</a> the guy behind <a href="https://github.com/tobeytailor/gordon">Gordon</a>, he has become famous over night, spoke at the last two JSConf&#8217;s and is our hard-core optimizer.  <a href="http://twitter.com/davidaurelio">David Aurelio</a> has created <a href="https://github.com/davidaurelio/TouchScroll">TouchScroll</a> and if you team him up with Tobias Schneider we have ALL JavaScript knowhow in da house, and they are currently hacking together on a really awesome project. <a href="http://twitter.com/nonken">Nikolai Onken</a> a co-founder of uxebu is our social community front man and the party goer number one and besides that he has created HumanAPI and knows all the JavaScript guys around! <a href="http://twitter.com/tklipstein">Tobias von Klipstein</a> is also guilty of founding uxebu and he is our Jack of all trades, he had created the first version of apparatio almost all alone.<br />
<a href="http://twitter.com/wolframkriesing">Me</a>, I write blog articles, sometimes. But I get to go to all parties anyway :).</p>
<p>If you are a JavaScript geek, love to walk along the edge of what is possible with web technologies and think that <a href="http://techcrunch.com/2011/02/09/html5-versus-native-apps/">HTML5 is the rocket ship</a> you should send us an <a href="mailto:job@uxebu.com?subject=Let%20me%20in!">email</a> with some links to some of your projects and a short, convincing reasoning why you would like to work with us. And if you think that you can&#8217;t work with us because you are not ready yet, shoot us an email anyways and let us talk first and decide later. We are made of talented individuals each. But working together as a team is what makes us really strong. Be ready for it!</p>
<p>And btw get ready to learn something new every day. And do also pass on your know how!</p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2011/02/10/travel-with-uxebu-we-are-hiring/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Explaining EmbedJS</title>
		<link>http://uxebu.com/blog/2011/01/31/explaining-embedjs/</link>
		<comments>http://uxebu.com/blog/2011/01/31/explaining-embedjs/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 14:02:28 +0000</pubDate>
		<dc:creator>Jens Arps</dc:creator>
				<category><![CDATA[development tools]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[frontend engineering]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[uxebu]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[embedjs]]></category>
		<category><![CDATA[memory usage]]></category>
		<category><![CDATA[optimize]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://uxebu.com/blog/?p=1366</guid>
		<description><![CDATA[Last week, we tagged the current state of EmbedJS 0.1. This is a large step for us, and something we have been waiting for and wanting to do for a long time. And with doing so, the need arises to answer a lot of questions – and we better start sooner than later. So, here [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, we tagged the current state of EmbedJS 0.1. This is a large step for us, and something we have been waiting for and wanting to do for a long time. And with doing so, the need arises to answer a lot of questions – and we better start sooner than later. So, here it is, the first part of „Explaining EmbedJS“.</p>
<h2>What is it?</h2>
<p>It‘s a JavaScript Toolkit, especially aimed at embedded devices. Embedded devices, that is phones, tablet devices, TVs, car dashboards and the like. Devices that are capable of running JavaScript. We are sure that this list is going to grow over time – and will hopefully one day also include devices like your fridge. EmbedJS is based on the Dojo Toolkit.<br />
<span id="more-1366"></span></p>
<h2>Why?</h2>
<p>Because the toolkits and frameworks that exist focus on desktop browsers and therefore have a different approach – an approach we didn‘t find that suitable for embedded/mobile development. And the JS frameworks that target mobile devices are flawed, too: either they target only a specific device or platform, or they provide far more than we do need and want.</p>
<p>What we wanted was a toolkit that offered a unified API across different platforms, but with the best implementation that was available for each platform. And we didn‘t want to ship code that implemented a certain feature for, say, an old Blackberry device to an iPhone. Plus, we wanted that API to be small – enough to assist us in our daily work, but not that bloated that we would ship code to a phone that we wouldn‘t need in most of our projects.</p>
<h2>The Dojo Toolkit</h2>
<p>We at uxebu have a strong affinity to the <a href="http://dojotoolkit.org/" target="_blank">Dojo Toolkit</a> – most of us are committers – for a good reason: we believe that it has done many things right, and that it has an excellent code quality. Thus, finding a starting point for our venture to what was later to be EmbedJS was pretty easy: It was the very core of the Dojo Toolkit, dojo._base.</p>
<p>We examined the code and split it into its smallest parts (features, how we call them in EmbedJS). After having the features all nicely separated, we could look for the best implementation for each of the platforms we wanted to support, and put it into a separate file. Then we optimized our code, tweaking here and there, but also using the code from dojo._base as it was, because it already was the best implementation.</p>
<p>And we needed to find means to put all these tiny parts together again, respecting any given dependecies, to create a file that then contained all the feature‘s implementations for a given platform – so the EmbedJS Tools were born, including our highly flexible build system.</p>
<h2>API</h2>
<p>EmbedJS‘ API is a small subset on Dojo‘s API. It provides around 70 methods, from the fields language enhancement (like Array manipulation or JSON), OO (like classes and inheritance), transport (like JSONP or XHR), event system (like connecting to DOM events or methods), DOM manipulation (like style or node creation) and misc things like Promises or pub/sub.</p>
<p>We kept the method signatures intact so that you can import your existing knowledge from working with the Dojo Toolkit to EmbedJS. There are only a few minor changes where we<br />
a) found a new name highly useful, e.g <code class="codecolorer text mac-classic"><span class="text">dojo.io.script.get()</span></code> is <code class="codecolorer text mac-classic"><span class="text">embed.jsonp()</span></code><br />
b) we needed to strip given functionality for the sake of code size.</p>
<p>All methods in EmbedJS are available under the embed namespace as well as under the dojo namespace. I.e. to call the connect method you can use <code class="codecolorer text mac-classic"><span class="text">dojo.connect()</span></code> and <code class="codecolorer text mac-classic"><span class="text">embed.connect()</span></code>.</p>
<p>The full API documentations is <a href="http://embedjs.org/apidocs/dools/app/apidoc/embedjs/" target="_blank">here</a>, though it‘s undergoing some updates right now.</p>
<h2>Summary</h2>
<p>I didn‘t want to dig too deep in the first article on EmbedJS, but I guess you got the point: EmbedJS is a highly optimized Dojo core, and offers you a specialized, optimal build for a given platform. To explain how the build system works, how we manage dependencies, how we separate our features and our implementations and how one can create a project-oriented custom build will need another blog post – but if you are too curious, you are invited to take a look at <a href="https://github.com/uxebu/embedjs" target="_blank">the source code at github</a>; a lot is self-explenatory there. A further source of information is the <a href="http://uxebu.github.com/embedjs/" target="_blank">EmbedJS project page</a>, as well as the <a href="https://github.com/uxebu/embedjs-tools" target="_blank">EmbedJS Tools source</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2011/01/31/explaining-embedjs/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>indexedDB Updates &#8211; FF4.09b</title>
		<link>http://uxebu.com/blog/2011/01/17/indexeddb-updates-ff4-09b/</link>
		<comments>http://uxebu.com/blog/2011/01/17/indexeddb-updates-ff4-09b/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 15:52:26 +0000</pubDate>
		<dc:creator>Jens Arps</dc:creator>
				<category><![CDATA[frontend engineering]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[IDB]]></category>
		<category><![CDATA[indexedDB]]></category>
		<category><![CDATA[offline]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://uxebu.com/blog/?p=1344</guid>
		<description><![CDATA[IndexedDB is all the buzz right now, but it is pretty hard to find information about it&#8217;s implementations. In addition to that, the impls change on a weekly basis. So I figured it would be nice to summarize every now and then what has been happening around IDB in the last time. And as Mozilla [...]]]></description>
			<content:encoded><![CDATA[<p>IndexedDB is all the buzz right now, but it is pretty hard to find information about it&#8217;s implementations. In addition to that, the impls change on a weekly basis. So I figured it would be nice to summarize every now and then what has been happening around IDB in the last time.</p>
<p>And as Mozilla released a new Firefox 4 beta these days, and introduces changes to it&#8217;s IDB impl, let&#8217;s start the series with a brief summary of the most important of these changes.<br />
<span id="more-1344"></span></p>
<h2>Changes in 4.09b</h2>
<ul>
<li>The indexedDB object has been renamed: <code class="codecolorer text mac-classic"><span class="text">moz_indexedDB</span></code> is now <code class="codecolorer text mac-classic"><span class="text">mozIndexedDB</span></code>.</li>
<li>When opening a database, the event handed over to the onsuccess callback no more has a property called &#8220;result&#8221;, where a reference to the databasse used to be; it is now available at <code class="codecolorer text mac-classic"><span class="text">event.target.result</span></code> (event.target contains the IDBRequest).</li>
<li>This applies to many (all?) cases, where you&#8217;d expect the result of a request to live in event.result, where it now is in event.target.result.</li>
<li>When creating an object store, the second argument, <code class="codecolorer text mac-classic"><span class="text">keyPath</span></code>, now has to be passed as a property inside of an object: <code class="codecolorer text mac-classic"><span class="text">{keyPath: &quot;keyPathName&quot;}</span></code></li>
<li>When creating an objectStore, the third argument, <code class="codecolorer text mac-classic"><span class="text">autoIncrement</span></code>, is dropped and now has to be part of the second argument: <code class="codecolorer text mac-classic"><span class="text">{autoIncrement: true}</span></code></li>
<li>Methods that read from an objectStore now only seem to work inside of a transaction; before, it was allowed to call methods like get directly.</li>
<li>keyRange support seems to have increased. However, I&#8217;m not really interested (right now) in keyRanges and queries, so I did not play around with these.</li>
</ul>
<p>Note that the changes for the <code class="codecolorer text mac-classic"><span class="text">createObjectStore</span></code> arguments are against the spec &#8211; the 4.08b was compliant, the 4.09b is no more. But, on the other hand, it is now closer to the Chrome impl, which also expects an object as second argument (but has no support for autoIncrement).</p>
<h2>What it does *not* have (yet)</h2>
<p>The <a href="http://www.w3.org/TR/IndexedDB/#sync-database" target="_blank">sync API</a>. Alas. To me, the snychronous implementation is exactly what makes indexedDB that attractive – I&#8217;m not a fan of databases and I don&#8217;t like to start transactions, iterate over resultSets and the like… I want a store with easy access. Seriously, in most real life scenarios, an async approach won&#8217;t get you anywhere but displaying a waiting message to your user, because you can&#8217;t go on until you have the data from the store.</p>
<h2>More info?</h2>
<p>If you want to stay in touch with what happens around the indexedDB impl, the best place to go ist the Mozilla bugtracker. Um, yeah, reading browser source code can be no fun at times, but it gets you as close as you can get. Or, check what happens in the test files.</p>
<h2>Need working code?</h2>
<p>The *only* place to get reliable, working code is the test files in the repository. Seriously, there&#8217;s so much code out there claiming to work, but it simply doesn&#8217;t. And even if it did one day, it might break the other day, after changes have been made to the impl. And there will be *lots* of changes in the future.</p>
<h2>Where are these test files?</h2>
<p>In the repo. To see them online, go here: <a href="http://hg.mozilla.org/mozilla-central/file/" target="_blank">http://hg.mozilla.org/mozilla-central/file/</a> and then navigate to dom/indexedDB/test.</p>
<h2>Something else?</h2>
<p>Nope, not really. There don&#8217;t seem to be any *major* changes for 4.09b – I hope you still found this short summary useful.</p>
<p>I hope to continue this series about IDB and post about different IDB topics every now and then  – so if you want to know more about indexedDB in general, or something specific, just drop a line in the comments!</p>
<h3>Further reading</h3>
<ul>
<li>The spec: <a href="http://www.w3.org/TR/IndexedDB/" target="_blank">http://www.w3.org/TR/IndexedDB/</a></li>
<li>The MDC article: <a href="https://developer.mozilla.org/en/IndexedDB" target="_blank">https://developer.mozilla.org/en/IndexedDB</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2011/01/17/indexeddb-updates-ff4-09b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BlackBerry6, WebKit, WebWorks, DevCon10, etc.</title>
		<link>http://uxebu.com/blog/2010/10/25/blackberry6-webkit-webworks-devcon10-etc/</link>
		<comments>http://uxebu.com/blog/2010/10/25/blackberry6-webkit-webworks-devcon10-etc/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 08:59:59 +0000</pubDate>
		<dc:creator>Wolfram Kriesing</dc:creator>
				<category><![CDATA[development tools]]></category>
		<category><![CDATA[frontend engineering]]></category>
		<category><![CDATA[html5apps]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[w3c widgets]]></category>
		<category><![CDATA[blackberry6]]></category>
		<category><![CDATA[embedjs]]></category>
		<category><![CDATA[torch]]></category>

		<guid isPermaLink="false">http://uxebu.com/blog/?p=1311</guid>
		<description><![CDATA[The BlackBerry DevCon 2010 closed it&#8217;s doors a couple of days ago and to put the conclusion first, I have become a new evangelist for the BlackBerry6 platform. It supports W3C widgets, well &#8230; in a way ;). The core message I took away: web technologies have become first class citizens on the new BlackBerry [...]]]></description>
			<content:encoded><![CDATA[<p>The BlackBerry DevCon 2010 closed it&#8217;s doors a couple of days ago and to put the conclusion first, I have become a new evangelist for the BlackBerry6 platform. It supports W3C widgets, well &#8230; in a way ;). The core message I took away: web technologies have become first class citizens on the new BlackBerry platform. And we from uxebu really love this, as you can imagine.<br />
<span id="more-1311"></span></p>
<p><a href="http://hub.uxebu.com:33550/wp-content/uploads/2010/10/embedTests-Torch.jpg" style="float:right; margin:1em;"><img class="size-thumbnail wp-image-1320" title="embedTests-Torch" src="http://hub.uxebu.com:33550/wp-content/uploads/2010/10/embedTests-Torch-150x150.jpg" alt="" width="150" height="150" /></a>First I want to thank RIM for sending us two Torch devices. Right away I navigated to <a href="http://bit.ly/embed-tests">the embedJS tests</a> and I didn&#8217;t expect it differently, the tests passed without any problem, 100% passed tests. Actually I expected the tests to pass lightning fast, the time it took was ok, but not lightning fast, unfortunately. The test suite executed in about 14 seconds, on the iPhone4 it took about 10. To be fair the processor power and the system architectures are completely different and not really comparable, but the user experience counts in the end. We have heard that the RIM guys are hard working on improvements and speeding up the device, there is some cool stuff to come.</p>
<h2>WebKit and WebWorks</h2>
<p>The most impressive and revolutionary thing was definitely that BlackBerry brings an 100 points ACID compliant WebKit and runs W3C widgets using it. So there are by default two ways that are even fun to get content onto this platform. You can write mobile websites expecting an a-grade browser and you can write apps, for the so called WebWorks platform (which are W3C widgets inside). All we want. The browser supports CSS transitions and transforms, not 3D though, since there is no GPU in those devices, but you never know what might come next. There is SVG on it, WebSockets, Canvas and a lot more niceties, I just browsed the objects using <a href="http://bit.ly/object-browser">Object Browser</a>, go try it yourself, on your device.<br />
RIM renamed their widgets that existed already on BlackBerry5 to &#8220;WebWorks&#8221; and they got completely overhauled. The approach RIM went is pretty close to how PhoneGap works. WebWorks basically is a wrapper written in Java (the native language of BlackBerry) which internally instanciates a WebKit view and provides a bridge into JavaScript where the underlying native functionality is written in Java, of course. The cool thing about it is that this code is completely <a href="http://github.com/blackberry/WebWorks">open  source and on github</a>. Unfortunately the build scripts are still not on github, so you would still have to figure out yourself how to use the source from github to package your apps. RIM please push them soon! Currently <a href="http://na.blackberry.com/eng/developers/browserdev/widgetsdk.jsp">the executables</a> are the most comfortable way to build your widget.<br />
Back to the API, since the implementation is open source you can easily extend it and make functionality available into JavaScript which currently is not there. So <a href="http://jsconf.eu/2010/speaker/livingroombindmotion_function.html">Nikolai&#8217;s robotic JavaScript</a> will really become fun and reality on BlackBerry too. Why RIM went this way becomes very obvious when you understand the security concept on BlackBerry. Since all APIs are, in the end, provided by a Java implementation and only &#8220;piped&#8221; into JavaScript all security restrictions apply to the widget just as if it was a native app. That means if you access GPS in your widget (using JavaScript) the Java function will be called and will be secured the same way as if it would have been called from within a pure Java app. Of course this doesn&#8217;t make your widget secure by default, since you are using web technologies you have to take care of writing apps which are not vulnerable by XSS attacs or alike. But it offers really comfortable extendability for this platform and is no workaround to get web technologies onto BlackBerries, I think it&#8217;s a very clever approach, good job RIM.</p>
<h2>Security</h2>
<p><a href="http://hub.uxebu.com:33550/wp-content/uploads/2010/10/PermissionsBlackBerry.jpg" style="float:right; margin:1em;"><img src="http://hub.uxebu.com:33550/wp-content/uploads/2010/10/PermissionsBlackBerry-150x150.jpg" alt="" title="PermissionsBlackBerry" width="150" height="150" class="size-thumbnail wp-image-1321" /></a>Everybody knows the ridiculous installation dialogs on Android which show you the APIs the app wants to access and the final question if you want to allow the app to access this functionality or not. If you say &#8220;no&#8221;, the app won&#8217;t install. That doesn&#8217;t really make me feel that the security concept is very flexible. It&#8217;s not giving the user a lot of control. Working with Opera&#8217;s widget runtimes already for a while I thought of a concept that would allow a lot kore control for the user and make apps hopefully more successful.<br />
I will use a short example to explain it. Imagine a twitter app that you want to install and that has a lot of functionality but on the first install you only want it to be able to go online to read and send tweets. Functionality like GPS, searching my addressbook or taking pictures with the camera are built in into the app. But as long as i don&#8217;t trust the app i don&#8217;t want this functionality enabled. So I turn of access to certain APIs upon installation and enable them just when I feel secure and gained trust in the app or had been told by experts that the app is secure. But this is currently not possible on platforms like Android or iPhone. I talked about this idea and told <a href="http://supportforums.blackberry.com/t5/user/viewprofilepage/user-id/28983">RIM&#8217;s Tim Neil</a> about it, in the hope to meet open ears and confirm that this is a good idea. The answer I got surprised me big time: BlackBerry already has this for a while. We got out our Torch devices to look it up, and yes in the menu under &#8220;Device / Application Management&#8221; you can edit the permissions per app (see picture). Awesome and just right, I love this.<br />
So Opera this was my idea to improve your widget runtime and maybe to jump ahead of the crowd again, I would like it.</p>
<p>Overall the BlackBerry6 platform is very exciting and a lot of thought seem to have gone into it, especially with focus on the web, which is a really good thing. So, I will just step away and try to build the Object Browser as a WebWorks App.</p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2010/10/25/blackberry6-webkit-webworks-devcon10-etc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>uxebu is hiring</title>
		<link>http://uxebu.com/blog/2010/09/18/uxebu-is-hiring/</link>
		<comments>http://uxebu.com/blog/2010/09/18/uxebu-is-hiring/#comments</comments>
		<pubDate>Sat, 18 Sep 2010 20:17:05 +0000</pubDate>
		<dc:creator>wolfram</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[frontend engineering]]></category>
		<category><![CDATA[html5apps]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[uxebu]]></category>
		<category><![CDATA[hiring]]></category>

		<guid isPermaLink="false">http://uxebu.com/blog/?p=1271</guid>
		<description><![CDATA[JSConf is just around the corner and all the JavaScript geeks are meeting there. We from uxebu are going there too, of course :). We are going to give four cool talks David Aurelio (of TouchScroll fame) &#8211; Interface Styling &#038; Scripting for WebKit Mobile Jens Arps (our storage expert) &#8211; The hitchhiker&#8217;s guide to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jsconf.eu/2010/">JSConf</a> is just around the corner and all the JavaScript geeks are meeting there. We from uxebu are going there too, of course :). We are going to give <a href="http://jsconf.eu/2010/speakers.html">four cool talks</a></p>
<ul>
<li><a href="http://twitter.com/void_0">David Aurelio</a> (of <a href="http://static.uxebu.com/~david/touchscroll/">TouchScroll</a> fame) &#8211; Interface Styling &#038; Scripting for WebKit Mobile</li>
<li><a href="http://twitter.com/jensarps">Jens Arps</a> (our <a href="http://jensarps.de/">storage expert</a>) &#8211; The hitchhiker&#8217;s guide to client side persistent data storage</li>
<li><a href="http://twitter.com/tobeytailor">Tobias Schneider</a> (the uncomparable <a href="http://wiki.github.com/tobeytailor/gordon/">Gordon</a> author) &#8211; Not your Mother&#8217;s JavaScript!</li>
<li><a href="http://twitter.com/nonken">Nikolai Onken</a> (a Dojo senior) &#8211; Robotic JavaScript</li>
</ul>
<p>and if you think you have something as cool as what you will see at JSConf you should contact us and we should talk about working together. We at uxebu are putting fun in the job first, actually we are trying to have fun all day and just call that work. Family and health are the top priorities in our company and the absolute base for doing a great job &#8230; oh and JavaScript is what we love, currently we are hacking it only on mobile (or as we like to name it &#8220;embedded&#8221;) devices. &#8220;Embedded&#8221; because we think JavaScript is not only hot on mobiles, but on TV&#8217;s in car dashboards and maybe even in your washing machine :)!? You know where we are going &#8230; are you as enthusiastic as we are? Come and talk to us at the JSConf<span id="more-1271"></span>, or if you have no ticket for JSConf yet give us enough reason to invite you there and get to know your geekiness :).<br />
Let&#8217;s rock the mobile/embedded world &#8230;<br />
Write us to <a href="mailto:contact@uxebu.com">contact@uxebu.com</a> or find us on twitter <a href="http://twitter.com/uxebu">@uxebu</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2010/09/18/uxebu-is-hiring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forgotten tricks for iPhones Safari</title>
		<link>http://uxebu.com/blog/2010/04/28/forgotten-tricks-for-iphones-safari/</link>
		<comments>http://uxebu.com/blog/2010/04/28/forgotten-tricks-for-iphones-safari/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 14:18:21 +0000</pubDate>
		<dc:creator>Nikolai Onken</dc:creator>
				<category><![CDATA[frontend engineering]]></category>
		<category><![CDATA[html5apps]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://uxebu.com/blog/?p=1171</guid>
		<description><![CDATA[Safari om the iPhone is an incredible powerful browser and comes with a whole bunch of features. Besides the amazing support for CSS3, a superfast rendering engine and great JavaScript support, there are a few hidden gems I want to explain in this (and maybe following) blogposts. If you are interested in mobile web development, [...]]]></description>
			<content:encoded><![CDATA[<p>Safari om the iPhone is an incredible powerful browser and comes with a whole bunch of features.<br />
Besides the amazing support for CSS3, a superfast rendering engine and great JavaScript support, there are a few hidden gems I want to explain in this (and maybe following) blogposts. If you are interested in mobile web development, maybe you will find a few features you haven&#8217;t seen before.</p>
<h2>Making your web app iPhone ready</h2>
<p>Note: <a href="http://static.uxebu.com/~nonken/a/safariGems">you can visit the example used in this blog post from your iPhone here.</a></p>
<p><object width="500" height="344"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=11241853&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=11241853&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="344"></embed></object><br />
<span id="more-1171"></span><br />
The most well-known and really most important meta tag you need to know about is the viewport meta-tag. It allows you to define the minimum and maximum zoom-level and whether or not the user is allowed to zoom into the view. You disable zooming by setting the minimum-scale to the same value as maximum-scale. At the same time you can define the viewport width and height by setting the &#8220;device-width&#8221; or &#8220;device-height&#8221; properties. If you have a website with a width of 960px and you want it to be zoomed in to fit exactly that width, all you need to do is to set width to 960. Since your website should run on several devices though with different resolutions it is not recommended to set an absolute width and instead use the predefined device-width and device-height values. This ensures that your viewport has exactly the size supported by the device.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>meta <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;viewport&quot;</span> content<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;width=device-width,minimum-scale=1.0,maximum-scale=1.0&quot;</span><span style="color: #339933;">/&gt;</span></div></td></tr></tbody></table></div>
<p>Now lets get to the juicy part. When creating an HTML5 app for the iPhone you can define an icon which you will see on the start screen of your iPhone. Once you set this meta tag, the user won&#8217;t be able to see a difference between a native application and a web application on your iPhones homescreen.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>link rel<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;apple-touch-icon&quot;</span> href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;/yourIcon.png&quot;</span><span style="color: #339933;">/&gt;</span></div></td></tr></tbody></table></div>
<p>To add even another level of detail you can define a startup screen for your application. This is especially useful when your application supports offline mode using cache manifests.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>link rel<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;apple-touch-startup-image&quot;</span> href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;/startupImage.png&quot;</span><span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>All of those features wouldn&#8217;t be complete if you couldn&#8217;t hide the browsers chrome once you start your application from the homescreen. To disable the chrome just insert following tag:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>meta <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;apple-mobile-web-app-capable&quot;</span> content<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;yes&quot;</span><span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>Now after you have added this meta tag you want to be able to differenciate between the user launching the app from the homescreen of the browser.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006600; font-style: italic;">// navigator.standalone</span><br />
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;standalone&quot;</span> <span style="color: #000066; font-weight: bold;">in</span> navigator<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">standalone</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Started from homescreen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Started in browser&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Not supporting standalone property&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Last but not least you can even control the look and feel of the status bar on the top. You can either use the default status bar or a black status bar or a semi translucent status bar:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>meta <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;apple-mobile-web-app-status-bar-style&quot;</span> content<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;black/default/black-translucent&quot;</span> <span style="color: #339933;">/&gt;</span></div></td></tr></tbody></table></div>
<p>These are the most important things you need to know to make a simple website be HTML5 app ready on your iPhone (note: this only works on the iPhone but won&#8217;t hurt other devices and platforms). A &#8220;normal&#8221; user won&#8217;t be able to differentiate between a native or a HTML5 app anymore. Do you know of similar features of other phones? Do you think we should standardize the discussed features? (Some are already). </p>
<p>If you need support getting your website or web application HTML5 app ready, feel free to <a href="http://uxebu.com/contact">contact us</a>.</p>
<p>Enjoy</p>
<h2>Dowload</h2>
<ul>
<li>
<a href="http://static.uxebu.com/~nonken/a/safariGems/safariGems.tgz">Source</a>
</li>
<li><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html">Docs</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2010/04/28/forgotten-tricks-for-iphones-safari/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

