<?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>The Blog of Clint Andrew Hall &#187; Idea</title>
	<atom:link href="http://www.clintandrewhall.com/blog/category/idea/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.clintandrewhall.com/blog</link>
	<description>Welcome to my corner of the web, where I post my ponderings, pictures and pontifications.</description>
	<lastBuildDate>Tue, 31 Aug 2010 20:27:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Create Your Own Google Chrome &#8220;App&#8221;</title>
		<link>http://www.clintandrewhall.com/blog/2010/07/create-your-own-google-chrome-app/</link>
		<comments>http://www.clintandrewhall.com/blog/2010/07/create-your-own-google-chrome-app/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 05:29:49 +0000</pubDate>
		<dc:creator>Clint</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Idea]]></category>

		<guid isPermaLink="false">http://www.clintandrewhall.com/blog/?p=115</guid>
		<description><![CDATA[I was reading LifeHacker and came across a post regarding how to enable Google Apps in Chrome.  Curious, I dug into the extensions and noticed... well, they're pretty simple.  So I decided to create my own for Facebook]]></description>
			<content:encoded><![CDATA[<p>I was reading LifeHacker and came across <a href="http://lifehacker.com/5587455/try-out-three-early-web-apps-from-the-chrome-web-store-now?skyline=true&amp;s=i" target="_blank">this post</a> regarding how to enable Google Apps in Chrome.  Curious, I dug into the extensions and noticed&#8230; well, they&#8217;re pretty simple.  So I decided to create my own.<br />
<span id="more-115"></span><br />
I decided to create one for Facebook.  It only took me five minutes:</p>
<div id="attachment_116" class="wp-caption alignnone" style="width: 594px"><a href="http://www.clintandrewhall.com/blog/wp-content/uploads/2010/07/Screen-shot-2010-07-16-at-12.18.35-AM.jpg"><img class="size-full wp-image-116" title="Chrome &quot;New Tab&quot; Page" src="http://www.clintandrewhall.com/blog/wp-content/uploads/2010/07/Screen-shot-2010-07-16-at-12.18.35-AM.jpg" alt="Chrome &quot;New Tab&quot; Page" width="584" height="269" /></a><p class="wp-caption-text">The Chrome &quot;New Tab&quot; page with Facebook added...</p></div>
<p>The LifeHacker post contains all the details regarding how to enable apps in the latest Chromium builds.  All you need to do is copy the contents of one of the manifest.json files in one of the apps bundled with Chrome:</p>
<p><code> </code></p>
<p><code></p>
<pre>{
  "name": "Google Calendar",
  "version": "1.3",
  "permissions": [ "notifications" ],
  "icons": {
    "128": "128.png",
    "24": "24.png",
    "32": "32.png",
    "48": "48.png"
  },
  "app": {
    "urls": [
      "*://www.google.com/calendar/"
    ],
    "browse_urls": [
      "https://www.google.com/accounts/"
    ],
    "launch": {
      "container": "tab",
      "web_url": "https://www.google.com/calendar/"
    }
  }
}</pre>
<p></code></p>
<p>and substitute your own values and icons:<br />
<code> </code></p>
<p><code></p>
<pre>{
  "name": "Facebook",
  "version": "0.1",
  "permissions": [  ],
  "icons": {
    "128": "128.png",
    "24": "24.png",
    "32": "32.png",
    "48": "48.png"
  },
  "app": {
    "urls": [
      "*://www.facebook.com/"
    ],
    "browse_urls": [
      "https://www.facebook.com/profile.php"
    ],
    "launch": {
      "container": "tab",
      "web_url": "http://www.facebook.com"
    }
  }
}</pre>
<p></code></p>
<p>If you&#8217;re interested, you can download my ZIP file here, <a href="http://www.clintandrewhall.com/blog/wp-content/uploads/2010/07/facebook-chrome-app.zip">facebook-chrome-app</a>, then follow the same instructions to enable it in your own Chrome browser.</p>
<p>See? Easy&#8230; happy hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clintandrewhall.com/blog/2010/07/create-your-own-google-chrome-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Window, No In-source Event</title>
		<link>http://www.clintandrewhall.com/blog/2009/10/new-window-no-in-source-event/</link>
		<comments>http://www.clintandrewhall.com/blog/2009/10/new-window-no-in-source-event/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 17:31:24 +0000</pubDate>
		<dc:creator>Clint</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Idea]]></category>

		<guid isPermaLink="false">http://www.clintandrewhall.com/blog/?p=88</guid>
		<description><![CDATA[I was prompted by this Twitter post to cross-post an old blog entry of mine. Having JavaScript events in-source binds you to whatever JavaScript method (and it&#8217;s signature) you&#8217;ve specified, not to mention breaking the tenets of Progressive Enhancement. When wishing to launch an anchor&#8217;s href into a new window while using a STRICT doctype, [...]]]></description>
			<content:encoded><![CDATA[<p><em>I was prompted by <a href="http://twitter.com/scriptandstyle/statuses/4605668102">this</a> Twitter post to cross-post an old blog entry of mine.</em></p>
<p>Having JavaScript events in-source binds you to whatever JavaScript method (and it&#8217;s signature) you&#8217;ve specified, not to mention breaking the tenets of Progressive Enhancement.  When wishing to launch an anchor&#8217;s <code>href</code> into a new window while using a <code>STRICT</code> doctype, using <code>window.popup</code> is the only real option, (as the <code>target</code> attribute is invalid in this case).  Looking at the <a title="W3C specification for Anchor Tags" href="http://www.w3.org/TR/html401/struct/links.html#h-12.2">W3C specification for anchors</a>, the following could be a solution.<br />
<span id="more-88"></span></p>
<h3>Problem Statement</h3>
<p>Recently, a navigation header in one of our solutions had a requirement that all links within its boundary needed to launch their content into a new window, thereby not disturbing any the current page.  Since the <code>target</code> attribute is not an option, this can be accomplished by the <code>window.popup</code> method, a fairly standard method within browsers.  This meant either the call itself would have to be embedded into the anchor, or a surrogate method.  In either case, JavaScript events would have to appear in source:<br />
<code><br />
&lt;a href="http://www.google.com" onclick="window.popup(this.href); return false;"&gt;Link 1&lt;/a&gt;<br />
&lt;a href="http://www.google.com" onclick="return MyNamespace.popup(this);"&gt;Link 2&lt;/a&gt;<br />
</code></p>
<h4>Problem: Obligations Introduced</h4>
<p>The trouble is that whenever script is included in source, it means that you are thereby <em>contractually bound</em> to offer the same method, with the same signature&#8230; regardless of circumstance.  To give a stronger example, suppose I have the following code:</p>
<pre><code>    &lt;div id="navigation"&gt;
        Some content
    &lt;/div&gt;
    &lt;script type="text/javascript"&gt;
        var myAccordion = new Accordion("navigation")
    &lt;/script&gt;
</code></pre>
<p>I am now bound by two things:</p>
<ol>
<li>I must include an <code>Accordion</code> object, even if I don&#8217;t need it or if I want to use a different object based on platform (e.g. iPhone).</li>
<li>I must provide the same API as the <code>Accordion</code> object, because there is a global var called <code>myAccordion</code>, which could be referenced elsewhere.</li>
</ol>
<p>I can still swap out the JavaScript files, but those files <em>must</em> have an object that meet these requirements.</p>
<h4>Solution: Progressive Enhancement through Abstraction</h4>
<p>It would be far easier if the same markup <em>externalized</em> these specifics and applied event handlers through script:</p>
<pre><code>    &lt;div id="navigation"&gt;
        Some content
    &lt;/div&gt;
    &lt;script type="text/javascript"&gt;
        MyNamespace.setup({
            navigation : "navigation"
        });
    &lt;/script&gt;
</code></pre>
<p>In this case, an API is defined within a generic namespace object called <code>MyNamepsace</code>.  The script block invokes <code>setup</code>, which takes (in this case, which may be overkill) a JSON structure defining the objects or parameters to be used in setup.</p>
<p>This kind of generic abstraction allows us to swap out not only the CSS but also the JavaScript depending on capability or browser.</p>
<h3>Proposed Solution: Using the <code>rel</code> Attribute</h3>
<p>In the spec, the <a href="http://www.w3.org/TR/html401/struct/links.html#adef-rel">rel</a> attribute is described as:</p>
<blockquote><p>This attribute describes the relationship from the current document to the anchor specified by the <a class="noxref" href="http://www.w3.org/TR/html401/struct/links.html#adef-href"><samp class="ainst">href</samp></a> attribute. The value of this attribute is a space-separated list of link types.</p></blockquote>
<p>The spec also says that the value of the <code>rel</code> attribute should be one or more of a set of <code>link-types</code>, but this portion of the spec states:</p>
<blockquote><p>Authors may wish to define <span class="index-inst" title="link  type::profiles for new"><a name="idx-link_type-2">additional link types</a></span> not described in this specification. If they do so, they should use a <a href="http://www.w3.org/TR/html401/struct/global.html#profiles">profile</a> to cite the conventions used to define the link types. Please see the <a class="noxref" href="http://www.w3.org/TR/html401/struct/global.html#adef-profile"><samp class="ainst"> profile</samp></a> attribute of the <a class="noxref" href="http://www.w3.org/TR/html401/struct/global.html#edef-HEAD"><samp class="einst">HEAD</samp></a> element for more details.</p></blockquote>
<h3>The Proposal</h3>
<p>Since the goal is to use JavaScript to &#8220;pop&#8221; the new window, we need to identify which anchors &#8220;pop&#8221; their content to a new window, leaving the current document intact.  By creating a <code>rel</code> attribute that specifies this, along with the necessary profile, JavaScript methods could distinguish those anchors from other anchors, thus allowing the popup event handlers to be applied.</p>
<h4>Creating a new profile</h4>
<p>In order to create a new link type, we need<sup>[<a href="#ref1">1</a>]</sup> to create<sup>[<a href="#ref2">2</a>]</sup> a profile.</p>
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
&lt;head&gt;
    &lt;title&gt;Cerner XHTML Profile&lt;/title&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;dl class="profile"&gt;
    &lt;dt id="rel"&gt;rel&lt;/dt&gt;
    &lt;dd&gt;
        &lt;dl&gt;
            &lt;dt id="forked"&gt;forked&lt;/dt&gt;
            &lt;dd&gt;
                Refers to a location that should be, if possible, launched
                into a new window or process without disturbing the
                current page or content.
            &lt;/dd&gt;
        &lt;/dl&gt;
    &lt;/dd&gt;
&lt;/dl&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h4>Using the Profile</h4>
<p>Then, we would use the new link-type defined in the profile for any anchor we&#8217;d want &#8220;popped&#8221; into a new window, (or, indeed, whatever other action we choose, based on platform).</p>
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
&lt;head profile="http://deploymentserver/contextroot/profile.html"&gt;
.
.
.
&lt;ul id="links"&gt;
    &lt;li&gt;&lt;a href="http://www.cerner.com/" rel="forked"&gt;Launch Cerner.com&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.google.com/"&gt;Go to Google.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
.
.
.
&lt;script type="text/javascript"&gt;
    // Example script; should be namespaced, etc.
    var list = document.getElementById("links"), list.getElementsByTagName("A"),
        event = function() {
            // Process the event for the link, (e.g. popup, alert, redirect, etc).
            alert("Forked page.");
        };

    for(var i = 0; i &lt; links.length; i++) {
        var link = links[i], rel = link.rel;

        if(rel.length &lt;= 0) {
            continue;
        }

        var rels = rel.split(" ");

        for(var a = 0; a &lt; rels.length; a++) {
            var l = rels[a];

            if(l == "forked")) {
                link.onclick = function() {
                    return false;
                };
                // Use my established attachEvent method; it has an EventCache
                // to avoid memory leaks, etc, but is beyond the scope of this post.
                Util.attachEvent(link, "click", event);
                continue;
            };
        }
    }
&lt;/script&gt;</pre>
<h3>References</h3>
<ol>
<li>W3C, <a href="http://www.w3.org/TR/html401/types.html#type-links"><code>link-type</code> Specification</a></li>
<li>Tantek Çelik, <a href="http://gmpg.org/xmdp/">XHTML Meta Data Profiles</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.clintandrewhall.com/blog/2009/10/new-window-no-in-source-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Elements in JavaScript, (any good?)</title>
		<link>http://www.clintandrewhall.com/blog/2009/03/creating-elements-in-javascript-any-good/</link>
		<comments>http://www.clintandrewhall.com/blog/2009/03/creating-elements-in-javascript-any-good/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 21:50:05 +0000</pubDate>
		<dc:creator>Clint</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Idea]]></category>

		<guid isPermaLink="false">http://www.clintandrewhall.com/blog/?p=76</guid>
		<description><![CDATA[I&#8217;ve been playing around with a couple of ideas for JavaScript methods, thought I&#8217;d get some feedback. The following link is a code snippet in PasteBin that shows the methods and a quick test: http://pastebin.com/f7b68ab19 Basically, the two I wrote and that I&#8217;m evaluating are: Create Element This method caches a created element instance in [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with a couple of ideas for JavaScript methods, thought I&#8217;d get some feedback.</p>
<p>The following link is a code snippet in PasteBin that shows the methods and a quick test:</p>
<p><a title="PasteBin Code Snippet" href="http://pastebin.com/f7b68ab19">http://pastebin.com/f7b68ab19</a></p>
<p>Basically, the two I wrote and that I&#8217;m evaluating are:</p>
<dl>
<dt>Create Element</dt>
<dd>This method caches a created element instance in an array.  In some browsers, like Firefox, this method is marginally faster; I&#8217;m thinking the array access is hindering it from being even faster.</dd>
<dt>Create Element with Properties</dt>
<dd>This method basically allows you to set attributes using a JSON object. Nothing fancy, but the developers like it. I&#8217;m concerned about the speed of the loop, and developers have been asking about how to set the runtime style.  Since <code>element.style</code> is, of course, not settable, I&#8217;d have to either expose a second parameter, or allow a more complex object and write more logic, (assuming I decide to support it).
</dd>
</dl>
<p>I&#8217;d love some advice&#8230; here&#8217;s what I don&#8217;t want:</p>
<blockquote><p>Just use jQuery / Prototype / my framework!</p></blockquote>
<p>That kind of defeats the purpose of this exercise! <img src='http://www.clintandrewhall.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.clintandrewhall.com/blog/2009/03/creating-elements-in-javascript-any-good/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dear Google Maps</title>
		<link>http://www.clintandrewhall.com/blog/2005/05/dear-google-maps/</link>
		<comments>http://www.clintandrewhall.com/blog/2005/05/dear-google-maps/#comments</comments>
		<pubDate>Fri, 20 May 2005 18:54:59 +0000</pubDate>
		<dc:creator>Clint</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Idea]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://www.clintandrewhall.com/blog/1969/12/dear-google-maps/</guid>
		<description><![CDATA[Kansas City closed the Paseo Bridge, which is my lifeline to and from work, for 9 months! Google Maps tells me that this is the best route, but knowing that bridge is out, shouldn&#8217;t I be able to tell Google that? I decided to ask them&#8230; My letter to Google Maps went like this: Recently, [...]]]></description>
			<content:encoded><![CDATA[<p>Kansas City closed the <a href="http://maps.google.com/maps?q=I-29+and+Front+Street,+Kansas+City,+MO&#038;hl=en">Paseo Bridge</a>, which is my lifeline to and from work, for <strong>9 months</strong>!</p>
<p>Google Maps <em>tells</em> me that this is the best route, but knowing that bridge is out, shouldn&#8217;t I be able to tell Google that? I decided to ask them&#8230;</p>
<p><span id="more-22"></span>My letter to Google Maps went like this:</p>
<blockquote><p>Recently, a bridge went out in Kansas City, which was on the best route to my office. Now the bridge will be out for 6-9 months.I think it would be awesome if you were able to allow someone to divert away from a certain turn in your directions due to a circumstance.</p>
<p>For example, map out directions from my office to my home:</p>
<p>(address removed) to (address removed)</p>
<p>Step 5 is impossible to take, because the bridge south of there is out. Notice that there are four other nearby bridges. Although there are many detours set up by the city, I&#8217;m sure there are better ways to go given my starting position.</p>
<p>It would be awesome if I could click on a step and click &#8220;Divert&#8221; and have the map shift to avoid that step or steps. No other map system in the world has such a feature.</p>
<p>What do you think?</p>
<p>Thanks,</p>
<p>Clint Hall</p>
</blockquote>
<p>I&#8217;ll let you know what they say. <img src='http://www.clintandrewhall.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />
<p>
<p><!--ea05f08fb2957295fb9ec8a09e158e6f-->
</p>
<p><!--67329e65dd596773c42ef4c4db07e893--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.clintandrewhall.com/blog/2005/05/dear-google-maps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Real Clout&#8230;</title>
		<link>http://www.clintandrewhall.com/blog/2005/05/real-clout/</link>
		<comments>http://www.clintandrewhall.com/blog/2005/05/real-clout/#comments</comments>
		<pubDate>Mon, 16 May 2005 22:56:59 +0000</pubDate>
		<dc:creator>Clint</dc:creator>
				<category><![CDATA[Idea]]></category>
		<category><![CDATA[Industry]]></category>

		<guid isPermaLink="false">http://www.clintandrewhall.com/blog/1969/12/real-clout/</guid>
		<description><![CDATA[Want to know what power is? Power is getting people to change their web server configurations to support your new beta experiment. Gotta tip my hat to Google&#8230; they really have clout. It&#8217;s amazing to me&#8230; Google comes out with a Web Accelerator that basically caches the page to their server like static content, which [...]]]></description>
			<content:encoded><![CDATA[<p>Want to know what power is? Power is getting people to <a href="http://37signals.com/svn/archives2/google_web_accelerator_hey_not_so_fast_an_alert_for_web_app_designers.php">change their web server configurations </a>to support your new <em>beta experiment</em>. Gotta tip my hat to Google&#8230; they really have clout.</p>
<p>It&#8217;s amazing to me&#8230; Google comes out with a Web Accelerator that basically caches the page to their server like static content, which isn&#8217;t really new, and releases it as a beta. Oh, and they also only give it out to a limited number of people.</p>
<p>Next thing you know, you&#8217;ve got people out there seeing that the service doesn&#8217;t work on HTTPS connections, and <em>they</em> change?! I mean, wow.</p>
<p>I think the real reason that this is happening is because Google is really effin&#8217; smart. The concept of remote page caching is, like I said, not that new&#8230; Sprint PCS did it, Earthlink does server-side compression and caching, so why is Google&#8217;s so popular? Because &#8220;they&#8217;re Google?&#8221; Nope. It&#8217;s because they&#8217;re the first service to actually put a quantifiable number as to how much time you&#8217;ve &#8220;saved.&#8221;</p>
<p>People like numbers and results. People don&#8217;t trust something if it simply proclaims itself to be what you want. It&#8217;s smart, and once again, I&#8217;m privately jealous of Google, it&#8217;s clout and it&#8217;s brilliance.</p>
<p>Damn.
</p>
<p><!--6d755b69b6747906c12687978c72830a--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.clintandrewhall.com/blog/2005/05/real-clout/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
