<?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>JavaScript Joy</title>
	<atom:link href="http://jsjoy.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://jsjoy.com/blog</link>
	<description>Musings on JavaScript, Web Applications, and all things technology</description>
	<lastBuildDate>Sun, 13 May 2012 23:52:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Making an iOS springboard shortcut that redirects</title>
		<link>http://jsjoy.com/blog/228/making-an-ios-springboard-shortcut-that-redirects?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=making-an-ios-springboard-shortcut-that-redirects</link>
		<comments>http://jsjoy.com/blog/228/making-an-ios-springboard-shortcut-that-redirects#comments</comments>
		<pubDate>Sun, 13 May 2012 23:52:04 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[IOS]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://jsjoy.com/blog/?p=228</guid>
		<description><![CDATA[When a URL redirects you do not have the opportunity to bookmark the original URL or put the original URL into a springboard shortcut. Here is how you can accomplish that feat. 1. Open safari 2. Navigate to a webpage (any page, it doesn&#8217;t matter) 3. Hit the &#8220;New Bookmark&#8221; button, select &#8220;Add Bookmark&#8221; You [...]]]></description>
			<content:encoded><![CDATA[<p>When a URL redirects you do not have the opportunity to bookmark the original URL or put the original URL into a springboard shortcut. Here is how you can accomplish that feat.</p>
<p>1. Open safari<br />
2. Navigate to a webpage (any page, it doesn&#8217;t matter)<br />
3. Hit the &#8220;New Bookmark&#8221; button, select &#8220;Add Bookmark&#8221;<br />
You will NOT be able to edit the URL here. Just press the Save button<br />
4. Hit the &#8220;Bookmarks&#8221; button, and hit the Edit button<br />
5. Next hit the small arrow on the right side of the bookmark you want to become your desired bookmark<br />
6. Edit the URL to the desired destination<br />
You now have a bookmark to the desired URL<br />
7. Go to settings, turn on airplane mode<br />
8. Open Safari, hit &#8220;Bookmarks&#8221;, and select your new bookmark<br />
9. Now hit the &#8220;New Bookmark&#8221; button and select &#8220;Add to Home Screen&#8221;<br />
10. Enter a title, the icon will be white, but don&#8217;t worry it will change when you navigate there for the first time<br />
11. Turn off airplane mode<br />
12. Enjoy your redirectable URL springboard shortcut!!</p>
]]></content:encoded>
			<wfw:commentRss>http://jsjoy.com/blog/228/making-an-ios-springboard-shortcut-that-redirects/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ext4 Image Viewer</title>
		<link>http://jsjoy.com/blog/211/ext4-image-viewer?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ext4-image-viewer</link>
		<comments>http://jsjoy.com/blog/211/ext4-image-viewer#comments</comments>
		<pubDate>Mon, 20 Feb 2012 05:59:16 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jsjoy.com/blog/?p=211</guid>
		<description><![CDATA[This is a basic Image Viewer I wrote a while back. Maybe it will be useful for someone. Includes drag scroll &#038; zoom support. It has pretty good cross browser support, but I didn&#8217;t test thoroughly as it was just a play app I used to learn some Ext4. Live Demo Page]]></description>
			<content:encoded><![CDATA[<p>This is a basic Image Viewer I wrote a while back. Maybe it will be useful for someone. Includes drag scroll &#038; zoom support. It has pretty good cross browser support, but I didn&#8217;t test thoroughly as it was just a play app I used to learn some Ext4.</p>
<p><a href="http://jsjoy.com/js/imageViewer/">Live Demo Page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jsjoy.com/blog/211/ext4-image-viewer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple PHP Comet example</title>
		<link>http://jsjoy.com/blog/197/simple-php-comet-example?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=simple-php-comet-example</link>
		<comments>http://jsjoy.com/blog/197/simple-php-comet-example#comments</comments>
		<pubDate>Thu, 21 Apr 2011 13:22:36 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[comet]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://jsjoy.com/blog/?p=197</guid>
		<description><![CDATA[This is a simple iframe-based PHP Comet example. Additional work must be done to be able to build up and tear-down connections, but the effect is solid. This is a quick and dirty method without having to use heavy feature detection to determine if xhr readystate 3 is available. References: Even Faster Web Sites by [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple iframe-based PHP Comet example. Additional work must be done to be able to build up and tear-down connections, but the effect is solid. This is a quick and dirty method without having to use heavy feature detection to determine if xhr readystate 3 is available.</p>
<p>References:<br />
<a href="http://stevesouders.com/efws/">Even Faster Web Sites</a> by Steve Souders<br />
<a href="http://www.zeitoun.net/articles/comet_and_php/start">http://www.zeitoun.net/articles/comet_and_php/start</a><br />
<a href="http://cometdaily.com/2007/11/18/ie-activexhtmlfile-transport-part-ii/">http://cometdaily.com/2007/11/18/ie-activexhtmlfile-transport-part-ii/</a></p>
<p>frontEnd.html:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Comet demo&lt;/title&gt;
	&lt;style type=&quot;text/css&quot;&gt;
    	.hiddenIframe {
    		position:absolute;
    		top:0px;
    		left:0px;
    		display:block;
    		z-index:-999;
    		visibility:hidden;
		}
	&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;content&quot;&gt;The server time will be shown here&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&nbsp;
	var content = document.getElementById('content');
	var dumpText = function(text){
		content.innerHTML = content.innerHTML + '&lt;BR&gt;'+ text;
	}
&lt;/script&gt;
&lt;iframe src=&quot;backEnd.php&quot; class=&quot;hiddenIframe&quot;&gt;&lt;/iframe&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>backEnd.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*
Simple COMET script tested to work with IE6, IE8, IE9, Chrome 5, Chrome 10, Firefox 3.6.16, Firefox 4, Safari 5, Opera 11
*/</span>
&nbsp;
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Cache-Control: no-cache, must-revalidate&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Expires: Mon, 26 Jul 1997 05:00:00 GMT&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Turn of Apache output compression</span>
<span style="color: #666666; font-style: italic;">// Necessary if you have gzip setup in your httpd.conf (e.g. LoadModule deflate_module modules/mod_deflate.so)</span>
<span style="color: #990000;">apache_setenv</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'no-gzip'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'zlib.output_compression'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Disable all PHP output buffering</span>
<span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'output_buffering'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Off'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'implicit_flush'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ob_implicit_flush</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$level</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ob_get_level</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$level</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #990000;">ob_end_flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//Flush all levels of the buffer to start</span>
&nbsp;
<span style="color: #990000;">error_reporting</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">E_ALL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Comet php backend&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
	var dumpText = window.parent.dumpText;
&lt;/script&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000088;">$startTime</span> <span style="color: #339933;">=</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$maxLoopTime</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #000088;">$startTime</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$maxLoopTime</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;script type=&quot;text/javascript&quot;&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;dumpText(&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">');'</span><span style="color: #339933;">.</span><span style="color: #990000;">str_repeat</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//500 characters of padding</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/script&gt;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  	<span style="color: #000088;">$randSleep</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mt_rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100000</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2000000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//sleep between 100 ms and 2 seconds</span>
	<span style="color: #990000;">usleep</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$randSleep</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;script type=&quot;text/javascript&quot;&gt;dumpText(&quot;Output Finished&quot;);&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://jsjoy.com/blog/197/simple-php-comet-example/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>ExtJs4 Component References</title>
		<link>http://jsjoy.com/blog/190/extjs4-component-references?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=extjs4-component-references</link>
		<comments>http://jsjoy.com/blog/190/extjs4-component-references#comments</comments>
		<pubDate>Sun, 03 Apr 2011 17:58:15 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Ext JS Demos]]></category>
		<category><![CDATA[ExtJs4 ref]]></category>

		<guid isPermaLink="false">http://jsjoy.com/blog/?p=190</guid>
		<description><![CDATA[Ext4 has replaced the "ref" method of referencing components with a supposedly much more powerful mechanism called Ext.ComponentQuery. While it may be more powerful, I've never been a fan of internal selector engines. For example, John Resig details the technical side of a Twitter performance issue related to a change in the jquery selector engine. [...]]]></description>
			<content:encoded><![CDATA[<p>
Ext4 has replaced the "ref" method of referencing components with a supposedly much more powerful mechanism called Ext.ComponentQuery. While it may be more powerful, I've never been a fan of internal selector engines.
</p>
<p>
For example, John Resig details the <a href="http://ejohn.org/blog/learning-from-twitter/">technical side</a> of a Twitter <a href="http://www.dustindiaz.com/about-that-slowness-on-twitter/">performance issue</a> related to a change in the jquery selector engine. So I argue- why even bother with a selector engine if you don't need it.
</p>
<p>
The best thing about ref is that involves no querying whatsoever, the references are saved immediately, and can be utilized immediately with no performance penalty. While Ext.ComponentQuery probably has a very negligible performance penalty, it is always a good idea to make your javascript as fast as possible.
</p>
<p>
Here I introduce the new version of Ext.ux.componentReference.js compatible with ExtJs4. This doesn't seem to be a catch-all because it doesn't work with toolbars as well as the old version did, but I will look into that when the final version of ExtJs4 comes out.
</p>
<p>
Ext4.ux.componentReference.js


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">AbstractComponent</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">onAdded</span> <span style="color: #339933;">=</span> Ext.<span style="color: #003366; font-weight: bold;">Function</span>.<span style="color: #660066;">createSequence</span><span style="color: #009900;">&#40;</span>Ext.<span style="color: #660066;">AbstractComponent</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">onAdded</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>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">refO</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">itemId</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">refO</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">itemId</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span> 
    <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ownerCt</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ownerCt</span>.<span style="color: #660066;">refO</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">itemId</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ownerCt</span>.<span style="color: #660066;">refO</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">itemId</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span> 
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">refO</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">refO</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ownerCt</span>.<span style="color: #660066;">refO</span><span style="color: #339933;">;</span> 
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


</p>]]></content:encoded>
			<wfw:commentRss>http://jsjoy.com/blog/190/extjs4-component-references/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE9 + ClearType = Blurry Web Apps</title>
		<link>http://jsjoy.com/blog/180/ie9-cleartype-blurry-web-apps?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ie9-cleartype-blurry-web-apps</link>
		<comments>http://jsjoy.com/blog/180/ie9-cleartype-blurry-web-apps#comments</comments>
		<pubDate>Mon, 14 Feb 2011 17:55:01 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[IE9 Beta]]></category>

		<guid isPermaLink="false">http://jsjoy.com/blog/?p=180</guid>
		<description><![CDATA[The first thing I noticed with the latest IE9 beta (9.0.7930.16406) was that somehow cleartype was enabled. This was particularly surprising because the first thing I do after a fresh Windows install is disable cleartype. Luckily, for my operating system, I can disable cleartype, so I immediately began searching for the option in IE9. I [...]]]></description>
			<content:encoded><![CDATA[<p>The first thing I noticed with the latest IE9 beta (9.0.7930.16406) was that somehow cleartype was enabled. This was particularly surprising because the first thing I do after a fresh Windows install is disable cleartype. Luckily, for my operating system, I can disable cleartype, so I immediately began searching for the option in IE9. I found the option: Options > Advanced  > Multimedia section > &#8220;Always use ClearType for HTML&#8221;, but it was already unchecked.</p>
<p>That&#8217;s right, the current IE9 beta has cleartype <strong>permanently enabled!</strong></p>
<p>For anyone who runs a monitors at the native resolution, this causes text to look blurry. If you have a high DPI monitor (such as on my notebook) the effect is even worse!</p>
<p>The most interesting aspect of this issue, is the fact that when I enable ClearType in my operating system and view the same page in firefox, it still looks better than in the IE9 beta.</p>
<p>For small text, this is a killer. Take a look at this example of a web app rendered in Firefox without cleartype, IE9, and finally Firefox with ClearType enabled on the operating system:<br />
 <img src="http://jsjoy.com/blog/wp-content/uploads/2011/02/IE9-Cleartype-vs-Firefox.png" alt="Firefox vs IE9 with cleartype" /></p>
<p>This is apparently not the first time this has happened either. <a href="http://social.msdn.microsoft.com/forums/en-US/wpf/thread/1c8d8627-a527-4d5e-8ae3-575867e7ea47/">Windows Presentation Foundation had similar issues with &#8220;broken&#8221; cleartype.</a></p>
<p>I really hope that Microsoft doesn&#8217;t force this blurry type on me with IE9&#8242;s final release. Even with the prospect of a fixed version of cleartype on the horizon al a WPF, I would still greatly prefer the ability to disable ClearType altogether.</p>
]]></content:encoded>
			<wfw:commentRss>http://jsjoy.com/blog/180/ie9-cleartype-blurry-web-apps/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Pseudo Zoom Quilt with Javascript</title>
		<link>http://jsjoy.com/blog/169/pseudo-quilt-zoom-with-javascript?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pseudo-quilt-zoom-with-javascript</link>
		<comments>http://jsjoy.com/blog/169/pseudo-quilt-zoom-with-javascript#comments</comments>
		<pubDate>Tue, 21 Dec 2010 20:16:00 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://jsjoy.com/blog/?p=169</guid>
		<description><![CDATA[I saw a post on Reddit where a someone was wondering if you could create something similar to Zoom Quilt with HTML5 and JavaScript. It doesn't require HTML5, but it can easily be done with some simple JQuery. This is even IE6 compatible to boot! View the Full Size Demo Here]]></description>
			<content:encoded><![CDATA[I saw a <a href="http://www.reddit.com/r/programming/comments/epd71/is_something_like_zoomquilt_possible_in_just/">post on Reddit</a> where a someone was wondering if you could create something similar to <a href="http://zoomquilt2.madmindworx.com/zoomquilt2.swf">Zoom Quilt</a> with HTML5 and JavaScript. It doesn't require HTML5, but it can easily be done with some simple JQuery. This is even IE6 compatible to boot!<BR>
<BR>
<a href="http://jsjoy.com/js/ZoomQuiltJQuery">View the Full Size Demo Here</a><BR>
<BR>
<style type="text/css">
.bodyBodyBox {
	width:800px;
	height:600px;
	position:relative;
}
.bodyBox {
	width:800px;
	height:600px;
	position:absolute;
	left:-300px;
	overflow:hidden;
}
.imgBox {
	width:800px; height:600px; display: block; position:absolute;
}
.z10 {
	z-index: -20;
}
.z20 {
	z-index: -10;
}
.preload {
	display: block;
	z-index: -99;
	visibility: hidden;
	width:1px;
	height:1px;
	position:fixed;
	top: -50px;
	left: -50px;
}
</style>
<script type="text/javascript" src="/js/ZoomQuiltJQuery/jquery-1.4.4.js"></script>
<script type="text/javascript">
currentImage = -1;
imageCount = 87;
imagePath = '/js/ZoomQuiltJQuery/images/';
imageExt = '.jpg';
animationDelay = 3000;
img1 = '';
img2 = '';

defaultInnerImgProperties = {
	top: '150px'
	,left: '200px'
	,height: '300px'
	,width: '400px'
}
defaultOuterImgProperties = {
	top: '0px'
	,left: '0px'
	,height: '600px'
	,width: '800px'
}

function attachPreloadImage(img){
	var imgEl = document.createElement('img');
	imgEl.src = img;
	imgEl.className = 'preload';
	document.body.appendChild(imgEl);
}

function preloadImages(){
	while(currentImage < imageCount){
		attachPreloadImage(getNextImage());
	}
	currentImage = -1;
	
	img1 = document.getElementById('img1');
	img2 = document.getElementById('img2');
	
	img1.setAttribute('src', getNextImage());
	img2.setAttribute('src', getNextImage());
	
	$(img2).css(defaultInnerImgProperties);
	$(img1).css(defaultOuterImgProperties);
	
	setTimeout('startAnimation()',animationDelay);
}

function getNextImage(){
	currentImage++;
	var thisImg = '0' + currentImage;
	return imagePath + thisImg.substr(thisImg.length - 2, 2) + imageExt;
}

function flipImages(){
	
	$(img1).removeClass('z10');
	$(img1).addClass('z20');
	
	$(img2).removeClass('z20');
	$(img2).addClass('z10');
	
	var tempImg = img1;
	img1 = img2;
	img2 = tempImg;
}

function nextImage(){
	if(currentImage > 86 ){
		currentImage = -1;
	}
	flipImages();
	img2.setAttribute('src', getNextImage());
	$(img2).css(defaultInnerImgProperties);
	startAnimation();
}

function startAnimation(){
	$(img1).animate({
		width:1600
		,height:1200
		,left:-400
		,top:-300
	},2000,'linear');
	
	$(img2).animate({
		width:800
		,height:600
		,left:0
		,top:0
	},2000,'linear',nextImage);
}

$(document).ready(function() {
	preloadImages();
});
</script>
<div class="bodyBodyBox">
<div class="bodyBox">
	<img src="/js/ZoomQuiltJQuery/images/s.gif" id="img1" class="imgBox z10">
	<img src="/js/ZoomQuiltJQuery/images/s.gif" id="img2" class="imgBox z20">
</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://jsjoy.com/blog/169/pseudo-quilt-zoom-with-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dealing with references to components</title>
		<link>http://jsjoy.com/blog/123/dealing-with-references-to-components?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dealing-with-references-to-components</link>
		<comments>http://jsjoy.com/blog/123/dealing-with-references-to-components#comments</comments>
		<pubDate>Sat, 09 Oct 2010 02:47:24 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Ext JS Demos]]></category>
		<category><![CDATA[ExtJs]]></category>

		<guid isPermaLink="false">http://jsjoy.com/blog/?p=123</guid>
		<description><![CDATA[NOTE: I also created an Ext4 compatible version of this! Keeping track of components in a large web apps gets harder as both the components and web apps grow. One issue with large components is that any individual piece of the component may need to be aware of other child or sibling pieces. An example [...]]]></description>
			<content:encoded><![CDATA[NOTE: <a href="http://jsjoy.com/blog/190/extjs4-component-references">I also created an Ext4 compatible version of this!</a><BR>
<BR>
Keeping track of components in a large web apps gets harder as both the components and web apps grow. One issue with large components is that any individual piece of the component may need to be aware of other child or sibling pieces. An example of this would be if you have a save button in your component and when it is clicked, a text field must have its value validated before the save action takes place. The save button needs to be able to easily access the text field. I will demonstrate a simple and easy way to keep track of all of your components and child components with a small extension I created called Ext.ux.componentReference.<BR>
<BR>
<a href="http://www.rahulsingla.com/blog/2010/07/maintaining-component-references-in-extjsext-net-applications-part-i">Rahul Singla has a great breakdown of the abilities provided by Ext</a> to save component references. Rahul also <a href="http://www.rahulsingla.com/blog/2010/07/maintaining-component-references-in-extjsext-net-applications-part-ii">provides a solution</a> that this extension is loosely based from.<BR>
<BR>
<blockquote style="padding-left: 35px;"><b>id</b> is almost always the least preferable option. You need to make sure manually that all items on the page whose ids are explicitly set by you are unique, which becomes quite difficult to ensure as the size and number of developers on the project increase.<BR>
<BR>
<b>itemId</b> allows you to specify an id which is scoped locally for the container of the Component. However, if you have many deeply nested containers and components, getting your hands to a component considerably down in the hierarchy from a container listener function pretty up again becomes troublesome.<BR>
<BR>
<b>ref</b> allows you to place a named reference to the Component along Container axis, and again requires you to navigate between container/component axis, which becomes complex as nesting increases. Moreover, the approach is unmaintainable if you later need to introduce an extra Container, which would force you to update all named ref instances placed below the new container added, as well as update javascript all over which used these named references.</blockquote><BR>
<BR>
As Rahul states, the <strong>id approach</strong> is the least attractive method for referencing a component. Id values are defined globally throughout any given web page. If you need two of the same component on the same web page, you will have two components which share the same id values. This will cause issues because one id value will reference multiple components of different component instances.<BR>
<BR>
The <strong>itemId approach</strong> is better because you have a localized identity value that can be referenced easily if you are aware of the component hierarchy.<BR>
<BR>
The <strong>ref approach</strong> is the most flexible because you are able to place a reference in the parent component of your choosing using the '../../' notation, but this and the itemId approach both suffer from the same drawback in that they require knowledge of the parent component or component hierarchy.<BR>
<BR>
Now I would like to introduce my approach, which I call <strong>Ext.ux.componentReference</strong>. Create a javascript file named Ext.ux.componentReference.js and place this code into it:<BR>
<BR>
<style type="text/css">
/*
	These CSS overrides are ONLY required for WORDPRESS!
*/
.postContent table {
	margin: 0;
}
.postContent th, .postContent td {
	padding: 0;
	border: 0 none;
}
pre {
	background: none;
        font-style: normal;
}
</style>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">Component</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">initComponent</span> <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">Component</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">initComponent</span>.<span style="color: #660066;">createSequence</span><span style="color: #009900;">&#40;</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>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">refO</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">itemId</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">refO</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">itemId</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span> 
    <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ownerCt</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ownerCt</span>.<span style="color: #660066;">refO</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">itemId</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ownerCt</span>.<span style="color: #660066;">refO</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">itemId</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span> 
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">refO</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">refO</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ownerCt</span>.<span style="color: #660066;">refO</span><span style="color: #339933;">;</span> 
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<BR>
<BR>
Now with some comments:<BR>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">Component</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">initComponent</span> <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">Component</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">initComponent</span>.<span style="color: #660066;">createSequence</span><span style="color: #009900;">&#40;</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>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">refO</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">itemId</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//does the reference object and itemId exist?</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">refO</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">itemId</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//save reference to component</span>
    <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ownerCt</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ownerCt</span>.<span style="color: #660066;">refO</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//does owner have a reference object set?</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">itemId</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//is the itemId set?</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ownerCt</span>.<span style="color: #660066;">refO</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">itemId</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//save reference to component</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">refO</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//if the reference object is not set here, copy the parents down the component hierarchy</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">refO</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">ownerCt</span>.<span style="color: #660066;">refO</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//save reference to owner container's reference object so you can easily nest references very deep</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>



<BR>
Upon instantiation of any component, this function will now be called before the component's  initComponent function. You can read about how this works in the <a href="http://dev.sencha.com/deploy/dev/docs/?class=Function">Ext Documentation under function -> createSequence</a>. If any component (or it's parent) has the property "refO" (which must point to an object), any component (or it's children) with the property "itemId" will have a reference saved in "refO".<BR>
<BR>
Here is an example:<BR>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;html&gt;
&lt;body&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/inc/js/ext-3.2.1/resources/css/ext-all.css&quot;&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/inc/js/ext-3.2.1/adapter/ext/ext-base-debug.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/inc/js/ext-3.2.1/ext-all-debug.js&quot;&gt;&lt;/script&gt;
&nbsp;
&lt;script type=&quot;text/javascript&quot; src=&quot;/inc/js/Ext.ux.referenceObject.js&quot;&gt;&lt;/script&gt; 
&nbsp;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
Ext.<span style="color: #660066;">BLANK_IMAGE_URL</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'/inc/img/s.gif'</span><span style="color: #339933;">;</span>
&nbsp;
testPanel <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>Ext.<span style="color: #660066;">Panel</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
	panelRef<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
	<span style="color: #339933;">,</span>initComponent<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>
&nbsp;
		Ext.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>
		  	title<span style="color: #339933;">:</span><span style="color: #3366CC;">'Test Panel'</span>
		  	<span style="color: #339933;">,</span>refO<span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">panelRef</span>
                        <span style="color: #339933;">,</span>frame<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span>
                        <span style="color: #339933;">,</span>width<span style="color: #339933;">:</span><span style="color: #CC0000;">200</span>
                        <span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #CC0000;">200</span>
                        <span style="color: #339933;">,</span>layout<span style="color: #339933;">:</span><span style="color: #3366CC;">'absolute'</span>
		  	<span style="color: #339933;">,</span>items<span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span>
		  		xtype<span style="color: #339933;">:</span><span style="color: #3366CC;">'button'</span>
		  		<span style="color: #339933;">,</span>text<span style="color: #339933;">:</span><span style="color: #3366CC;">'Button 1'</span>
		  		<span style="color: #339933;">,</span>itemId<span style="color: #339933;">:</span><span style="color: #3366CC;">'button1'</span>
		  		<span style="color: #339933;">,</span>x<span style="color: #339933;">:</span><span style="color: #CC0000;">20</span>
		  		<span style="color: #339933;">,</span>y<span style="color: #339933;">:</span><span style="color: #CC0000;">10</span>
		  		<span style="color: #339933;">,</span>icon<span style="color: #339933;">:</span><span style="color: #3366CC;">'/inc/img/disk.png'</span>
		  		<span style="color: #339933;">,</span>scope<span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">this</span>
		  		<span style="color: #339933;">,</span>handler<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>
		  			Ext.<span style="color: #660066;">Msg</span>.<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button 1 Clicked!'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'The path to the icon of this button 2 is: '</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">panelRef</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'button2'</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">icon</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		  		<span style="color: #009900;">&#125;</span>
		  	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>
		  		xtype<span style="color: #339933;">:</span><span style="color: #3366CC;">'button'</span>
		  		<span style="color: #339933;">,</span>text<span style="color: #339933;">:</span><span style="color: #3366CC;">'Button 2'</span>
		  		<span style="color: #339933;">,</span>itemId<span style="color: #339933;">:</span><span style="color: #3366CC;">'button2'</span>
                                <span style="color: #339933;">,</span>x<span style="color: #339933;">:</span><span style="color: #CC0000;">20</span>
                                <span style="color: #339933;">,</span>y<span style="color: #339933;">:</span><span style="color: #CC0000;">50</span>
		  		<span style="color: #339933;">,</span>icon<span style="color: #339933;">:</span><span style="color: #3366CC;">'/inc/img/tick.png'</span>
		  		<span style="color: #339933;">,</span>scope<span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">this</span>
		  		<span style="color: #339933;">,</span>handler<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>
		  			Ext.<span style="color: #660066;">Msg</span>.<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button 2 Clicked!'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'The path to the icon of this button 1 is: '</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">panelRef</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'button1'</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">icon</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		  		<span style="color: #009900;">&#125;</span>
		  	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
		  	<span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">Button</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
				text<span style="color: #339933;">:</span><span style="color: #3366CC;">'Button 3'</span>
				<span style="color: #339933;">,</span>refO<span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">panelRef</span>
				<span style="color: #339933;">,</span>itemId<span style="color: #339933;">:</span><span style="color: #3366CC;">'button3'</span>
				<span style="color: #339933;">,</span>x<span style="color: #339933;">:</span><span style="color: #CC0000;">20</span>
				<span style="color: #339933;">,</span>y<span style="color: #339933;">:</span><span style="color: #CC0000;">90</span>
				<span style="color: #339933;">,</span>icon<span style="color: #339933;">:</span><span style="color: #3366CC;">'/inc/img/cross.png'</span>
				<span style="color: #339933;">,</span>scope<span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">this</span>
				<span style="color: #339933;">,</span>handler<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>
					Ext.<span style="color: #660066;">Msg</span>.<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button 3 Clicked!'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'The path to the icon of this button 2 is: '</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">panelRef</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'button2'</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">icon</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
		  	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
		  	<span style="color: #009900;">&#93;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		testPanel.<span style="color: #660066;">superclass</span>.<span style="color: #660066;">initComponent</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
Ext.<span style="color: #660066;">onReady</span><span style="color: #009900;">&#40;</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>
&nbsp;
  testPanelInstance <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> testPanel<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  	renderTo<span style="color: #339933;">:</span>document.<span style="color: #660066;">body</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>


<BR>
<BR>
While the result is unimpressive, the effect is powerful.<BR>
<link rel="stylesheet" type="text/css" href="/inc/js/ext-3.2.1/resources/css/ext-all.css">
<script type="text/javascript" src="/inc/js/ext-3.2.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/inc/js/ext-3.2.1/ext-all.js"></script>

<script type="text/javascript" src="/inc/js/Ext.ux.referenceObject.js"></script> 
<script type="text/javascript">

Ext.BLANK_IMAGE_URL = '/inc/img/s.gif';

testPanel = Ext.extend(Ext.Panel, {
	panelRef: {}
	,initComponent:function(){
		
		Ext.apply(this,{
		  	title:'Test Panel'
		  	,refO:this.panelRef
                        ,frame:true
                        ,width:200
                        ,height:200
                        ,layout:'absolute'
		  	,items:[{
		  		xtype:'button'
		  		,text:'Button 1'
		  		,itemId:'button1'
		  		,x:20
		  		,y:10
		  		,icon:'/inc/img/disk.png'
		  		,scope:this
		  		,handler:function(){
		  			Ext.Msg.alert('Button 1 Clicked!','The path to the icon of this button 2 is: '+this.panelRef['button2'].icon);
		  		}
		  	},{
		  		xtype:'button'
		  		,text:'Button 2'
		  		,itemId:'button2'
                                ,x:20
                                ,y:50
		  		,icon:'/inc/img/tick.png'
		  		,scope:this
		  		,handler:function(){
		  			Ext.Msg.alert('Button 2 Clicked!','The path to the icon of this button 1 is: '+this.panelRef['button1'].icon);
		  		}
		  	},
		  	new Ext.Button({
		  		text:'Button 3'
				,refO:this.panelRef
		  		,itemId:'button3'
                                ,x:20
                                ,y:90
		  		,icon:'/inc/img/cross.png'
		  		,scope:this
		  		,handler:function(){
		  			Ext.Msg.alert('Button 3 Clicked!','The path to the icon of this button 2 is: '+this.panelRef['button2'].icon);
		  		}
		  	})
		  	]
		});
		testPanel.superclass.initComponent.call(this);
	}

});

Ext.onReady(function(){

  testPanelInstance = new testPanel({
  	renderTo:'componentReferenceExample'
  });

});
</script>
<div id="componentReferenceExample"></div><BR>
<BR>
In this example we are referencing the 'icon' property of button1 from button2 and vice versa. Because the variable "this.panelRef" is now in scope within the entire testPanel component, this task becomes trivial.]]></content:encoded>
			<wfw:commentRss>http://jsjoy.com/blog/123/dealing-with-references-to-components/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Copying Files from a network Share to a Droid X</title>
		<link>http://jsjoy.com/blog/103/copying-files-from-a-network-share-to-a-droid-x?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=copying-files-from-a-network-share-to-a-droid-x</link>
		<comments>http://jsjoy.com/blog/103/copying-files-from-a-network-share-to-a-droid-x#comments</comments>
		<pubDate>Sun, 01 Aug 2010 01:34:35 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Droid Guides]]></category>
		<category><![CDATA[Droid X]]></category>

		<guid isPermaLink="false">http://jsjoy.com/blog/?p=103</guid>
		<description><![CDATA[I will show you how to copy files from a windows file share to/from a Verizon/Motorolla Droid X. 1) Click the app launcher button 2) Open the &#8220;Files&#8221; app 3) Select &#8220;Shared folders&#8221; 4) Add Server if you don&#8217;t have one setup. If you are already setup, click the server. 5) Browse to the file [...]]]></description>
			<content:encoded><![CDATA[<p>I will show you how to copy files from a windows file share to/from a Verizon/Motorolla Droid X.</p>
<p><img src="/copying-files-from-computer-to-droid/01.png"><br />
1) Click the app launcher button</p>
<p><img src="/copying-files-from-computer-to-droid/02.png"><br />
2) Open the &#8220;Files&#8221; app</p>
<p><img src="/copying-files-from-computer-to-droid/03.png"><br />
3) Select &#8220;Shared folders&#8221;</p>
<p><img src="/copying-files-from-computer-to-droid/04.png"><br />
4) Add Server if you don&#8217;t have one setup. If you are already setup, click the server.</p>
<p><img src="/copying-files-from-computer-to-droid/05.png"><br />
5) Browse to the file or folder you want to copy to your droid and long press on it.</p>
<p><img src="/copying-files-from-computer-to-droid/06.png"><br />
6) Select &#8220;Copy&#8221;</p>
<p><img src="/copying-files-from-computer-to-droid/07.png"><br />
7) NOTICE the &#8220;Paste here&#8221; button is available. Don&#8217;t press it yet!</p>
<p><img src="/copying-files-from-computer-to-droid/08.png"><br />
 <img src='http://jsjoy.com/blog/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Press the back button until you see &#8220;Phone files&#8221;. Select it!</p>
<p><img src="/copying-files-from-computer-to-droid/09.png"><br />
9) If you want, create a &#8220;New folder&#8221;.</p>
<p><img src="/copying-files-from-computer-to-droid/10.png"><br />
10) If you are creating a folder, enter the name, click OK.</p>
<p><img src="/copying-files-from-computer-to-droid/11.png"><br />
11) Press the &#8220;Paste here&#8221; button</p>
<p><img src="/copying-files-from-computer-to-droid/12.png"><br />
12) You will see the file copy indicator appear in the notification bar. Pull down the notifications area to see the individial file copy progress.</p>
<p><img src="/copying-files-from-computer-to-droid/13.png"><br />
After the last file is copied the file or folder you just copied will show up!</p>
]]></content:encoded>
			<wfw:commentRss>http://jsjoy.com/blog/103/copying-files-from-a-network-share-to-a-droid-x/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing PHP Gearman module on Ubuntu 10.4 (Lucid)</title>
		<link>http://jsjoy.com/blog/84/installing-gearman-on-ubuntu-10-4-lucid?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-gearman-on-ubuntu-10-4-lucid</link>
		<comments>http://jsjoy.com/blog/84/installing-gearman-on-ubuntu-10-4-lucid#comments</comments>
		<pubDate>Mon, 19 Jul 2010 04:21:15 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gearman]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://jsjoy.com/blog/?p=84</guid>
		<description><![CDATA[Linux is really crazy. I&#8217;m used to Windows. On windows, I download a program, and run it. If it doesn&#8217;t work- the program is broken. Maybe I can download a newer/older version, but for all intents and purposes that is all there is to it. But with Linux- you can usually get something to work, [...]]]></description>
			<content:encoded><![CDATA[<p>Linux is really crazy. I&#8217;m used to Windows. On windows, I download a program, and run it. If it doesn&#8217;t work- the program is broken. Maybe I can download a newer/older version, but for all intents and purposes that is all there is to it. But with Linux- you can usually get something to work, but it takes a lot of time and sleuthing. I definitely prefer the windows workflow. But hey- it&#8217;s free as in freedom, right?</p>
<p>I was trying to install the <a href="http://pecl.php.net/package/gearman">PHP Gearman module</a>, but I kept getting compilation errors. Here is how I fixed it!</p>
<p><a href="http://gearman.org">Gearman</a> is a distributed job system written and released by the good folks at <a href="http://danga.com/gearman/">Danga Interactive</a>. (They also made <a href="http://memcached.org/">memcache</a>). I setup a blank Ubuntu server and I wanted to test it out, but it didn&#8217;t go so well.</p>
<p>Here is the standard procedure:<br />
apt-get update<br />
apt-get install php5-cli php5-dev pear<br />
apt-get install <a href="http://packages.ubuntu.com/lucid/gearman-job-server">gearman-job-server</a> <a href="http://packages.ubuntu.com/lucid/libgearman2">libgearman2</a> <a href="http://packages.ubuntu.com/lucid/libgearman-dev">libgearman-dev</a> <a href="http://packages.ubuntu.com/lucid/gearman-tools">gearman-tools</a><br />
pecl install &#8220;channel://pecl.php.net/gearman-0.7.0&#8243;</p>
<p>Usually the pecl command magically compiles php modules, but this time it did not.</p>
<p><strong><br />
</strong></p>
<h1><strong> This post details doing the following:</strong></h1>
<h1><strong> 1) Install the libevent-dev libuuid-dev packages</strong></h1>
<h1><strong> 2) Modify a libuuid files for some changes made to debian regarding .la files</strong></h1>
<h1><strong> 3) Install the gearman repositories for apt to download the latest version of libgearman</strong></h1>
<p><strong><br />
</strong></p>
<p>First I had some missing dependencies.</p>
<p>pecl install &#8220;channel://pecl.php.net/gearman-0.7.0&#8243;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
running: make<br />
/bin/bash /var/tmp/pear-build-root/gearman-0.6.0/libtool &#8211;mode=compile cc  -I.<br />
-I/tmp/pear/temp/gearman -DPHP_ATOM_INC -I/var/tmp/pear-build-root/gearman-0.6.0/include<br />
-I/var/tmp/pear-build-root/gearman-0.6.0/main -I/tmp/pear/temp/gearman -I/usr/include/php5<br />
-I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext<br />
-I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -Wall   -c<br />
/tmp/pear/temp/gearman/php_gearman.c -o php_gearman.lo<br />
libtool: compile:  cc -I. -I/tmp/pear/temp/gearman -DPHP_ATOM_INC<br />
-I/var/tmp/pear-build-root/gearman-0.6.0/include -I/var/tmp/pear-build-root/gearman-0.6.0/main<br />
-I/tmp/pear/temp/gearman -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM<br />
-I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g<br />
-O2 -Wall -c /tmp/pear/temp/gearman/php_gearman.c  -fPIC -DPIC -o .libs/php_gearman.o<br />
In file included from /tmp/pear/temp/gearman/php_gearman.c:24:<br />
/usr/include/libgearman/gearman.h:28:19: error: event.h: No such file or directory<br />
make: *** [php_gearman.lo] Error 1<br />
ERROR: `make&#8217; failed<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>so I needed to install the event and uuid libs:<br />
apt-get install libevent-dev uuid-dev</p>
<p>pecl install &#8220;channel://pecl.php.net/gearman-0.7.0&#8243;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
running: make<br />
/bin/bash /var/tmp/pear-build-root/gearman-0.6.0/libtool &#8211;mode=compile cc  -I.<br />
-I/tmp/pear/temp/gearman -DPHP_ATOM_INC -I/var/tmp/pear-build-root/gearman-0.6.0/include<br />
-I/var/tmp/pear-build-root/gearman-0.6.0/main -I/tmp/pear/temp/gearman -I/usr/include/php5<br />
-I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext<br />
-I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -Wall   -c<br />
/tmp/pear/temp/gearman/php_gearman.c -o php_gearman.lo<br />
libtool: compile:  cc -I. -I/tmp/pear/temp/gearman -DPHP_ATOM_INC<br />
-I/var/tmp/pear-build-root/gearman-0.6.0/include -I/var/tmp/pear-build-root/gearman-0.6.0/main<br />
-I/tmp/pear/temp/gearman -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM<br />
-I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g<br />
-O2 -Wall -c /tmp/pear/temp/gearman/php_gearman.c  -fPIC -DPIC -o .libs/php_gearman.o<br />
/bin/bash /var/tmp/pear-build-root/gearman-0.6.0/libtool &#8211;mode=link cc -DPHP_ATOM_INC<br />
-I/var/tmp/pear-build-root/gearman-0.6.0/include -I/var/tmp/pear-build-root/gearman-0.6.0/main<br />
-I/tmp/pear/temp/gearman -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM<br />
-I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H<br />
-g -O2 -Wall   -o gearman.la -export-dynamic -avoid-version -prefer-pic -module -rpath<br />
/var/tmp/pear-build-root/gearman-0.6.0/modules  php_gearman.lo -lgearman<br />
libtool: link: cc -shared  .libs/php_gearman.o   /usr/lib/libgearman.so    -pthread -Wl,-soname<br />
-Wl,gearman.so -o .libs/gearman.so<br />
/bin/sed: can&#8217;t read /usr/lib/libuuid.la: No such file or directory<br />
libtool: link: `/usr/lib/libuuid.la&#8217; is not a valid libtool archive</p>
<p>so now that I have uuid, I&#8217;m still getting errors. <a href="http://mgribov.blogspot.com/2010/05/gearman-pecl-package-on-ubuntu-lucid.html">I found a great blog post that helped me with this error!</a></p>
<pre>After some googling, it turns out that .la files are now gone from many packages, as per this post on debian-devel list. Couldn't really find a good solution for this, so here it is:

Open /usr/lib/libgearman.la as root, and find a line that says:
dependency_libs=' -L/usr/lib /usr/lib/libuuid.la'

Replace it with:
dependency_libs=' -L/usr/lib -luuid'</pre>
<p>Now, it should work, right? AAAAAAAAALMOST, but not quite.</p>
<p>sudo pecl install &#8220;channel://pecl.php.net/gearman-0.7.0&#8243;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
running: make<br />
/bin/bash /var/tmp/pear-build-root/gearman-0.7.0/libtool &#8211;mode=compile cc  -I.<br />
-I/tmp/pear/temp/gearman -DPHP_ATOM_INC -I/var/tmp/pear-build-root/gearman-0.7.0/include<br />
-I/var/tmp/pear-build-root/gearman-0.7.0/main -I/tmp/pear/temp/gearman -I/usr/include/php5<br />
-I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext<br />
-I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -Wall   -c<br />
/tmp/pear/temp/gearman/php_gearman.c -o php_gearman.lo<br />
libtool: compile:  cc -I. -I/tmp/pear/temp/gearman -DPHP_ATOM_INC<br />
-I/var/tmp/pear-build-root/gearman-0.7.0/include -I/var/tmp/pear-build-root/gearman-0.7.0/main<br />
-I/tmp/pear/temp/gearman -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM<br />
-I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g<br />
-O2 -Wall -c /tmp/pear/temp/gearman/php_gearman.c  -fPIC -DPIC -o .libs/php_gearman.o<br />
In file included from /tmp/pear/temp/gearman/php_gearman.c:24:<br />
/usr/include/libgearman/gearman.h:28:19: error: event.h: No such file or directory<br />
/tmp/pear/temp/gearman/php_gearman.c: In function ‘zm_startup_gearman’:<br />
/tmp/pear/temp/gearman/php_gearman.c:4467: error: ‘GEARMAN_VERBOSE_NEVER’ undeclared (first use in<br />
this function)<br />
/tmp/pear/temp/gearman/php_gearman.c:4467: error: (Each undeclared identifier is reported only once<br />
/tmp/pear/temp/gearman/php_gearman.c:4467: error: for each function it appears in.)<br />
make: *** [php_gearman.lo] Error 1<br />
ERROR: `make&#8217; failed<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Next I found there is some kind of issue with libgearman in debian. <a href="https://launchpad.net/~gearman-developers/+archive/ppa">You have to install the latest version of gearman directly from the creators to fix this one.</a></p>
<p>Add the gearman sources to your /etc/sources.list file:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
deb http://ppa.launchpad.net/gearman-developers/ppa/ubuntu lucid main<br />
deb-src http://ppa.launchpad.net/gearman-developers/ppa/ubuntu lucid main<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Add their key so apt can verify their packages:<br />
sudo apt-key adv &#8211;keyserver keyserver.ubuntu.com &#8211;recv-keys 1C73E014</p>
<p>update apt and re-install all the gearman packages:<br />
apt-get update<br />
apt-get install gearman-job-server libgearman2 libgearman-dev gearman-tools</p>
<p>Rejoice!!</p>
<p>pecl install &#8220;channel://pecl.php.net/gearman-0.7.0&#8243;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
running: make<br />
/bin/bash /var/tmp/pear-build-root/gearman-0.7.0/libtool &#8211;mode=compile cc  -I. -I/tmp/pear/temp/gearman -DPHP_ATOM_INC -I/var/tmp/pear-build-root/gearman-0.7.0/include -I/var/tmp/pear-build-root/gearman-0.7.0/main -I/tmp/pear/temp/gearman -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -Wall   -c /tmp/pear/temp/gearman/php_gearman.c -o php_gearman.lo<br />
libtool: compile:  cc -I. -I/tmp/pear/temp/gearman -DPHP_ATOM_INC -I/var/tmp/pear-build-root/gearman-0.7.0/include -I/var/tmp/pear-build-root/gearman-0.7.0/main -I/tmp/pear/temp/gearman -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wall -c /tmp/pear/temp/gearman/php_gearman.c  -fPIC -DPIC -o .libs/php_gearman.o<br />
/bin/bash /var/tmp/pear-build-root/gearman-0.7.0/libtool &#8211;mode=link cc -DPHP_ATOM_INC -I/var/tmp/pear-build-root/gearman-0.7.0/include -I/var/tmp/pear-build-root/gearman-0.7.0/main -I/tmp/pear/temp/gearman -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -Wall   -o gearman.la -export-dynamic -avoid-version -prefer-pic -module -rpath /var/tmp/pear-build-root/gearman-0.7.0/modules  php_gearman.lo -lgearman<br />
libtool: link: cc -shared  .libs/php_gearman.o   /usr/lib/libgearman.so    -pthread -Wl,-soname -Wl,gearman.so -o .libs/gearman.so<br />
libtool: link: ( cd &#8220;.libs&#8221; &amp;&amp; rm -f &#8220;gearman.la&#8221; &amp;&amp; ln -s &#8220;../gearman.la&#8221; &#8220;gearman.la&#8221; )<br />
/bin/bash /var/tmp/pear-build-root/gearman-0.7.0/libtool &#8211;mode=install cp ./gearman.la /var/tmp/pear-build-root/gearman-0.7.0/modules<br />
libtool: install: cp ./.libs/gearman.so /var/tmp/pear-build-root/gearman-0.7.0/modules/gearman.so<br />
libtool: install: cp ./.libs/gearman.lai /var/tmp/pear-build-root/gearman-0.7.0/modules/gearman.la<br />
libtool: finish: PATH=&#8221;/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/sbin&#8221; ldconfig -n /var/tmp/pear-build-root/gearman-0.7.0/modules<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<strong>Libraries have been installed in:<br />
/var/tmp/pear-build-root/gearman-0.7.0/modules</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Now you just have to make sure that php.ini contains:</p>
<p>extension=gearman.so</p>
<p>If this saved you some time. Leave me a comment, and I&#8217;ll post more of my boring linux adventures!</p>
]]></content:encoded>
			<wfw:commentRss>http://jsjoy.com/blog/84/installing-gearman-on-ubuntu-10-4-lucid/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Ext JS and Canvas integration</title>
		<link>http://jsjoy.com/blog/62/ext-js-and-canvas-integration?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ext-js-and-canvas-integration</link>
		<comments>http://jsjoy.com/blog/62/ext-js-and-canvas-integration#comments</comments>
		<pubDate>Mon, 12 Jul 2010 16:19:53 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Ext JS Demos]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[ExtJs]]></category>

		<guid isPermaLink="false">http://jsjoy.com/blog/?p=62</guid>
		<description><![CDATA[Ext JS and Canvas can be used together very easily. One just needs to understand how Ext uses elements and how to gain access to the underlying DOM. Here is an example of a canvas element embedded in an Ext Panel: //draw function from https://developer.mozilla.org/en/Drawing_Graphics_with_Canvas function draw&#40;el&#41; &#123; var canvas = el; var ctx = [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css">
/* WordPress Arjuna Theme Ext CSS resets*/
/* fix Ext buttons */
.postContent th, .postContent td {
 border:0;
}
/* disable quote background image in pre tags*/
pre {
	background: none;
}
</style>
Ext JS and Canvas can be used together very easily. One just needs to understand how Ext uses elements and how to gain access to the underlying DOM.<BR>
<BR>
Here is an example of a canvas element embedded in an Ext Panel:<BR>
<BR>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//draw function from https://developer.mozilla.org/en/Drawing_Graphics_with_Canvas</span>
<span style="color: #003366; font-weight: bold;">function</span> draw<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> canvas <span style="color: #339933;">=</span> el<span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> ctx <span style="color: #339933;">=</span> canvas.<span style="color: #660066;">getContext</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;2d&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  ctx.<span style="color: #660066;">fillStyle</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;red&quot;</span><span style="color: #339933;">;</span>
&nbsp;
  ctx.<span style="color: #660066;">beginPath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  ctx.<span style="color: #660066;">moveTo</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">30</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">30</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  ctx.<span style="color: #660066;">lineTo</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">150</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">150</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  ctx.<span style="color: #660066;">bezierCurveTo</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">60</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">70</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">60</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">70</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">70</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">150</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  ctx.<span style="color: #660066;">lineTo</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">30</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">30</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  ctx.<span style="color: #660066;">fill</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
Ext.<span style="color: #660066;">BLANK_IMAGE_URL</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'/inc/js/ext-3.2.1/resources/images/default/s.gif'</span><span style="color: #339933;">;</span>
&nbsp;
Ext.<span style="color: #660066;">onReady</span><span style="color: #009900;">&#40;</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>
&nbsp;
canvasPanel <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">Panel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	title<span style="color: #339933;">:</span><span style="color: #3366CC;">'Ext JS Canvas Panel'</span>
	<span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #CC0000;">200</span>
	<span style="color: #339933;">,</span>width<span style="color: #339933;">:</span><span style="color: #CC0000;">400</span>
	<span style="color: #339933;">,</span>frame<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span>
	<span style="color: #006600; font-style: italic;">//,renderTo:'ext-canvas-container' //NOTICE: renderTo does not work because the var canvasPanel will not be available in the renderer yet</span>
	<span style="color: #339933;">,</span>items<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>
		xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'box'</span><span style="color: #339933;">,</span>
		autoEl<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>
			tag<span style="color: #339933;">:</span> <span style="color: #3366CC;">'canvas'</span>
			<span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #CC0000;">150</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #339933;">,</span>listeners<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>
			render<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>
				scope<span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">this</span>
				<span style="color: #339933;">,</span>fn<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>
					draw<span style="color: #009900;">&#40;</span>canvasPanel.<span style="color: #660066;">items</span>.<span style="color: #660066;">items</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">el</span>.<span style="color: #660066;">dom</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
canvasPanel.<span style="color: #660066;">render</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ext-canvas-container'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>



<div id="ext-canvas-container"></div>
<link rel="stylesheet" type="text/css" href="/inc/js/ext-3.2.1/resources/css/ext-all.css">
<script type="text/javascript" src="/inc/js/ext-3.2.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/inc/js/ext-3.2.1/ext-all.js"></script>
<script type="text/javascript">

//draw function from https://developer.mozilla.org/en/Drawing_Graphics_with_Canvas
function draw(el) {
  var canvas = el;
  var ctx = canvas.getContext("2d");

  ctx.fillStyle = "red";

  ctx.beginPath();
  ctx.moveTo(30, 30);
  ctx.lineTo(150, 150);
  ctx.bezierCurveTo(60, 70, 60, 70, 70, 150);
  ctx.lineTo(30, 30);
  ctx.fill();
}

Ext.BLANK_IMAGE_URL = '/inc/js/ext-3.2.1/resources/images/default/s.gif';

Ext.onReady(function(){

canvasPanel = new Ext.Panel({
	title:'Ext JS Canvas Panel'
	,height:200
	,width:400
	,frame:true
	//,renderTo:'ext-canvas-container' //NOTICE: renderTo does not work because the var canvasPanel will not be available in the renderer yet
	,items:{
		xtype: 'box',
		autoEl:{
			tag: 'canvas'
			,height:150
		}
		,listeners:{
			render:{
				scope:this
				,fn:function(){
					draw(canvasPanel.items.items[0].el.dom);
				}
			}
		}
	}
});
canvasPanel.render('ext-canvas-container');

});
</script>
<BR>
You can also do the same thing with an Ext style window using the Ext.Window class.<BR>
<BR>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">onReady</span><span style="color: #009900;">&#40;</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>
&nbsp;
	canvasWindow <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">Window</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
		title<span style="color: #339933;">:</span><span style="color: #3366CC;">'Ext JS Canvas Window'</span>
		<span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #CC0000;">200</span>
		<span style="color: #339933;">,</span>width<span style="color: #339933;">:</span><span style="color: #CC0000;">400</span>
		<span style="color: #339933;">,</span>items<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>
			xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'box'</span><span style="color: #339933;">,</span>
			autoEl<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>
				tag<span style="color: #339933;">:</span> <span style="color: #3366CC;">'canvas'</span>
				<span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #CC0000;">150</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #339933;">,</span>listeners<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>
				render<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>
					scope<span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">this</span>
					<span style="color: #339933;">,</span>fn<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>
						draw<span style="color: #009900;">&#40;</span>canvasWindow.<span style="color: #660066;">items</span>.<span style="color: #660066;">items</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">el</span>.<span style="color: #660066;">dom</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	canvasWindowButton <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">Panel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
		renderTo<span style="color: #339933;">:</span><span style="color: #3366CC;">'ext-canvas-window-button-container'</span>
		<span style="color: #339933;">,</span>frame<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span>
		<span style="color: #339933;">,</span>width<span style="color: #339933;">:</span><span style="color: #CC0000;">400</span>
		<span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #CC0000;">150</span>
		<span style="color: #339933;">,</span>items<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>
			xtype<span style="color: #339933;">:</span><span style="color: #3366CC;">'button'</span>
			<span style="color: #339933;">,</span>width<span style="color: #339933;">:</span><span style="color: #CC0000;">300</span>
			<span style="color: #339933;">,</span>text<span style="color: #339933;">:</span><span style="color: #3366CC;">'Launch Ext Canvas Window'</span>
			<span style="color: #339933;">,</span>handler<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>
				canvasWindow.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>




<div id="ext-canvas-window-button-container"></div>
<script type="text/javascript">
Ext.onReady(function(){

	canvasWindow = new Ext.Window({
		title:'Ext JS Canvas Window'
		,height:200
		,width:400
		,items:{
			xtype: 'box',
			autoEl:{
				tag: 'canvas'
				,height:150
			}
			,listeners:{
				render:{
					scope:this
					,fn:function(){
						draw(canvasWindow.items.items[0].el.dom);
					}
				}
			}
		}
	});

	canvasWindowButton = new Ext.Panel({
		renderTo:'ext-canvas-window-button-container'
		,frame:true
		,width:400
		,height:150
		,items:{
			xtype:'button'
			,width:300
			,text:'Launch Ext Canvas Window'
			,handler:function(){
				canvasWindow.show();
			}
		}
	});
});
</script>]]></content:encoded>
			<wfw:commentRss>http://jsjoy.com/blog/62/ext-js-and-canvas-integration/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

