<?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>geek.de.nz &#187; JavaScript</title>
	<atom:link href="http://www.thheuer.com/Pakistan/programming/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thheuer.com</link>
	<description>Dance of the geek - New Zealand - Germany - DEutschland</description>
	<lastBuildDate>Sat, 04 Feb 2012 02:06:53 +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>jQuery Plugin &#8211; Image Radio buttons</title>
		<link>http://www.thheuer.com/2011/10/jquery-plugins-image-radio-buttons/</link>
		<comments>http://www.thheuer.com/2011/10/jquery-plugins-image-radio-buttons/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 04:38:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.thheuer.com/?p=129</guid>
		<description><![CDATA[At work I&#8217;ve written this jQuery plugin. It&#8217;s only 2KB big and turns your normal radio buttons into images, you can set any images you like for src, checked and hover. Simply attach the configuration to your html input field as the class attribute as a JavaScript like object. I know you might want to [...]]]></description>
			<content:encoded><![CDATA[<p>At work I&#8217;ve written this jQuery plugin. It&#8217;s only 2KB big and turns your normal radio buttons into images, you can set any images you like for src, checked and hover. Simply attach the configuration to your html input field as the class attribute as a JavaScript like object. I know you might want to attach a class to your radio buttons, but this is how far it currently is.</p>
<p>Here an example:</p>
<p><iframe width="600" height="300" src="/jquery-plugins/imageradio/"></iframe></p>
<p><a href="/jquery-plugins/imageradio/jquery.imageradio.js" title="Download Source" target="_blank">Get the JavaScript code</a><br />
<a href="/jquery-plugins/imageradio/" title="Download Source" target="_blank">Get the HTML/JavaScript code</a></p>
<p>Edit: Just found <a href="http://screwdefaultbuttons.com/" target="_blank">this</a> which seems to make this plugin obsolete. <img src='http://www.thheuer.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  Wish I would have found this earlier&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thheuer.com/2011/10/jquery-plugins-image-radio-buttons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Concepts</title>
		<link>http://www.thheuer.com/2010/08/javascript-concepts/</link>
		<comments>http://www.thheuer.com/2010/08/javascript-concepts/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 10:03:13 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ihostnz.com/blog/?p=31</guid>
		<description><![CDATA[Having learned JavaScript mainly by doing, it was quite late that I figured out some important details. Please comment if you think or know that I&#8217;m wrong. The arguments array as well as the caller instance are universal variables inside every JavaScript function. The names are self-explanatory. An anonymous function inside another function keeps the [...]]]></description>
			<content:encoded><![CDATA[<p>Having learned JavaScript mainly by doing, it was quite late that I figured out some important details. Please comment if you think or know that I&#8217;m wrong.</p>
<p>The arguments array as well as the caller instance are universal variables inside every JavaScript function. The names are self-explanatory.<br />
An anonymous function inside another function keeps the variables in scope as in:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> somefunction <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>arg1<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> avar1 <span style="color: #339933;">=</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>  
  object.<span style="color: #660066;">onclick</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>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'arg1='</span> <span style="color: #339933;">+</span> arg1 <span style="color: #339933;">+</span> <span style="color: #3366CC;">' avar1='</span> <span style="color: #339933;">+</span> avar1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
somefunction<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Foo'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// &quot;arg1=Foo avar1=10&quot; when object is clicked on</span></pre></div></div>

<p>So this means that the scope of the function defines what variables can be accessed within it, even after the function call has finished.</p>
<p>Another part I always found confusing in JavaScript is the &#8220;this&#8221;-keyword, but that might have to be the topic of another post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thheuer.com/2010/08/javascript-concepts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GeoExt and OpenLayers &#8211; Zoom Mode</title>
		<link>http://www.thheuer.com/2010/08/geoext-and-openlayers-zoom-mode/</link>
		<comments>http://www.thheuer.com/2010/08/geoext-and-openlayers-zoom-mode/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 04:14:20 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ihostnz.com/blog/?p=18</guid>
		<description><![CDATA[Just playing around with GeoExt and OpenLayers, I figured out how to easily change the control to a zoom rectangle with minimal changes: First create the normal and the custom control with: var inZoom = false; var navigation = new OpenLayers.Control.Navigation&#40;&#41;; var ZoomBoxNav = OpenLayers.Class&#40;OpenLayers.Control.Navigation, &#123; zoomBoxKeyMask: null // this ensures that a box is [...]]]></description>
			<content:encoded><![CDATA[<p>Just playing around with GeoExt and OpenLayers, I figured out how to easily change the control to a zoom rectangle with minimal changes:</p>
<p>First create the normal and the custom control with:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> inZoom <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> navigation <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> OpenLayers.<span style="color: #660066;">Control</span>.<span style="color: #660066;">Navigation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> ZoomBoxNav <span style="color: #339933;">=</span> OpenLayers.<span style="color: #003366; font-weight: bold;">Class</span><span style="color: #009900;">&#40;</span>OpenLayers.<span style="color: #660066;">Control</span>.<span style="color: #660066;">Navigation</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
 zoomBoxKeyMask<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #006600; font-style: italic;">// this ensures that a box is always drawn</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> zoomBox <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> ZoomBoxNav<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Then all you need is a button or better Action object, which adds the appropriate control to the map:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> toggleRectZoom <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>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>inZoom<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    map.<span style="color: #660066;">addControl</span><span style="color: #009900;">&#40;</span>navigation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    map.<span style="color: #660066;">removeControl</span><span style="color: #009900;">&#40;</span>zoomBox<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    inZoom <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
    map.<span style="color: #660066;">addControl</span><span style="color: #009900;">&#40;</span>zoomBox<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    map.<span style="color: #660066;">removeControl</span><span style="color: #009900;">&#40;</span>navigation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    inZoom <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
zoomButton <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GeoExt.<span style="color: #660066;">Action</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  text<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Zoom Mode'</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>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>inZoom<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      zoomButton.<span style="color: #660066;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Zoom Mode'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
      zoomButton.<span style="color: #660066;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Pan Mode'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    toggleRectZoom<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;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
toolBar <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">Toolbar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  items<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> zoomButton <span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
mapPanel <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GeoExt.<span style="color: #660066;">MapPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  border<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
  region<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;center&quot;</span><span style="color: #339933;">,</span>
  <span style="color: #006600; font-style: italic;">// we do not want all overlays, to try the OverlayLayerContainer</span>
  map<span style="color: #339933;">:</span> map<span style="color: #339933;">,</span>
  center<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">172.1569825</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">42.6109735</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
  zoom<span style="color: #339933;">:</span> <span style="color: #CC0000;">6</span><span style="color: #339933;">,</span>
  layers<span style="color: #339933;">:</span> myLayers<span style="color: #339933;">,</span>
  tbar<span style="color: #339933;">:</span> toolBar
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.thheuer.com/2010/08/geoext-and-openlayers-zoom-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thoughts on JavaScript compilers</title>
		<link>http://www.thheuer.com/2010/07/thoughts-on-javascript-compilers/</link>
		<comments>http://www.thheuer.com/2010/07/thoughts-on-javascript-compilers/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 09:35:14 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ihostnz.com/blog/?p=13</guid>
		<description><![CDATA[I think JavaScript compilers sort of defeat the purpose of a programming language. I can understand that you would want to compress JavaScript to save download time on the client side. However, it seems strange to me that another programming language writes code in another, higher level language. If the JavaScript you write is good [...]]]></description>
			<content:encoded><![CDATA[<p>I think JavaScript compilers sort of defeat the purpose of a programming language. I can understand that you would want to compress JavaScript to save download time on the client side. However, it seems strange to me that another programming language writes code in another, higher level language. If the JavaScript you write is good and not highly redundant, another PL wont be able to generate it. The only place where it seems useful to me is when creating variables&#8217; values like a count or an array of file names or similar. However, generating JavaScript from PHP or any other server side language seems to defeat the purpose of reusable code. You can in fact write highly re-usable code in JavaScript, it supports inheritance etc and libraries like jQuery make it highly compact. When it comes to deployment though, it is beneficial to have a script running that compresses the JavaScript.</p>
<p>Anyway, let me know your thoughts in a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thheuer.com/2010/07/thoughts-on-javascript-compilers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

