<?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>Nodeta &#187; JavaScript</title>
	<atom:link href="http://blog.nodeta.fi/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nodeta.fi</link>
	<description>on Rails</description>
	<lastBuildDate>Mon, 06 Sep 2010 13:14:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>2D Fisheye with JavaScript</title>
		<link>http://blog.nodeta.fi/2009/12/21/2d-fisheye-with-javascript/</link>
		<comments>http://blog.nodeta.fi/2009/12/21/2d-fisheye-with-javascript/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 07:00:24 +0000</pubDate>
		<dc:creator>Mikael Roos</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.nodeta.fi/?p=36</guid>
		<description><![CDATA[



			#fisheye_example {
position: absolute;
}
#fisheye_example div {
				position: absolute;
			}

Well, it&#8217;s almost Christmas! With the holidays getting closer, I went through some dusty files and stumbled upon an oldie but goodie: a 2-dimensional fish eye element (technically it&#8217;s also quasi-3d, but whatever). It uses Prototype and Scriptaculous and is available on Github here.
 It&#8217;s something I actually needed to [...]]]></description>
			<content:encoded><![CDATA[<p><script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js" type="text/javascript"></script><br />
<script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.1/scriptaculous.js" type="text/javascript"></script><br />
<script src="http://livedo.org/fishy-eye-2d/src/fisheye2d.js" type="text/javascript"></script></p>
<style type="text/css">
			#fisheye_example {
position: absolute;</p>
<p>}
#fisheye_example div {
				position: absolute;
			}</p>
</style>
<p>Well, it&#8217;s almost Christmas! With the holidays getting closer, I went through some dusty files and stumbled upon an oldie but goodie: a 2-dimensional fish eye element (technically it&#8217;s also quasi-3d, but whatever). It uses Prototype and Scriptaculous and is available on Github <a href="http://github.com/livedo/fishy-eye-2d">here</a>.</p>
<p> It&#8217;s something I actually needed to write for work over a year and a half ago &#8211; can you imagine?
</p>
<h2>Merry Christmas to all from everyone at Nodeta!</h2>
<p>
<strong>Here&#8217;s the thing with chrismassy icons!</strong>
</p>
<div id="fe_container" style="position: absolute; width: 550px; height: 550px">
<div id="fisheye_example" style="position: absolute;width: 420px; height: 420px; text-align: center;">
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/011.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/012.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/013.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/014.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/015.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/016.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/017.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/018.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/019.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/020.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/021.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/022.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/023.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/035.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/029.png" /></div>
<div><img style="width: 80%;height:80%;margin-top: 10%;" src="http://livedo.org/xmas_icons/039.png" /></div>
</div>
</div>
<div style="height: 450px"></div>
<p>
The free Christmas icons can be found from <a href="http://design.oneter.com/archives/crystal-christmas-transparent-png-icon.shtml">here</a>.
</p>
<p><script type="text/javascript">
var fe = new FishEye2D('fe_container',{scaleSize: 80, minimumSize: 85, onClick: function(event) { alert('Merry Christmas!'); } });
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nodeta.fi/2009/12/21/2d-fisheye-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>APIdock in Textmate</title>
		<link>http://blog.nodeta.fi/2009/02/23/apidock-in-textmate/</link>
		<comments>http://blog.nodeta.fi/2009/02/23/apidock-in-textmate/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 17:21:16 +0000</pubDate>
		<dc:creator>Mikael Roos</dc:creator>
				<category><![CDATA[APIdock]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rails-doc]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nodeta.fi/?p=77</guid>
		<description><![CDATA[
First came Vim, and next Gaizka added APIdock integration to Emacs. Now perhaps the biggest favorite of most Ruby and Rails developers, myself included: Textmate! Courtesy of one of Nodeta&#8217;s own, Ville Lautanala aka Lautis, you can get the Textmate bundles with APIdock goodness for Ruby and Rails from github with just a couple of [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://blog.nodeta.fi/wp-content/uploads/2009/02/textmate-bundle.png'><img src="http://blog.nodeta.fi/wp-content/uploads/2009/02/textmate-bundle-300x114.png" alt="" title="Textmate with APIdock" width="300" height="114" style="float: right; margin: 1em;" /></a></p>
<p>First came <a href="http://blog.nodeta.fi/2009/02/19/apidock-vim-integration/">Vim</a>, and next <a href="http://github.com/gaizka">Gaizka</a> added <a href="http://github.com/gaizka/misc-scripts/blob/3a60c2cd41ba1e331e4fa6539d0c70b522a64dd4/dot-emacs/rails-apidock.el">APIdock integration to Emacs</a>. Now perhaps the biggest favorite of most Ruby and Rails developers, myself included: Textmate! Courtesy of one of Nodeta&#8217;s own, <a href="http://github.com/lautis">Ville Lautanala aka Lautis</a>, you can get the Textmate bundles with APIdock goodness for <a href="http://github.com/lautis/ruby-tmbundle/tree">Ruby</a> and <a href="http://github.com/lautis/ruby-on-rails-tmbundle/tree">Rails</a> from github with just a couple of simple git commands:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:100%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">% mkdir -p ~/Library/Application\ Support/Textmate/Bundles<br />
% cd ~/Library/Application\ Support/Textmate/Bundles<br />
% git clone git://github.com/lautis/ruby-on-rails-tmbundle.git &quot;Ruby on Rails.tmbundle&quot;<br />
% git clone git://github.com/lautis/ruby-tmbundle.git &quot;Ruby.tmbundle&quot;<br />
% osascript -e 'tell app &quot;TextMate&quot; to reload bundles'</div></div>
<p>Now, the keyboard shortcut</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:100%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Control+h</div></div>
<p>gets you the page for the current word from APIdock.</p>
<p><img src="http://blog.nodeta.fi/wp-content/uploads/2009/02/apidock-textmate.png" alt="" title="APIdock Textmate Integration" class="alignnone size-medium wp-image-79" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nodeta.fi/2009/02/23/apidock-in-textmate/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Rails-doc.org out now!</title>
		<link>http://blog.nodeta.fi/2008/06/20/rails-doc-org-out-now/</link>
		<comments>http://blog.nodeta.fi/2008/06/20/rails-doc-org-out-now/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 21:21:39 +0000</pubDate>
		<dc:creator>Mikael Roos</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rails-doc]]></category>
		<category><![CDATA[new app rails documentation]]></category>

		<guid isPermaLink="false">http://blog.nodeta.fi/?p=30</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p style="border: 0px solid #000; text-align: center;"><a href="http://rails-doc.org"><br />
<img style="border: 0px solid #000; margin-bottom: 1em" title="Rails-doc out now" src="http://blog.nodeta.fi/wp-content/uploads/2008/06/rd_sc11.jpg" alt="" </a></p>
<p><a href="http://rails-doc.org">Rails-doc.org</a>&#8217;s first release, tagged Sylvester (1.0), is now <strong>published live</strong>.  <a href="http://rails-doc.org">Check it out</a> and <a href="http://rails-doc.org/register">sign up</a> to post notes.</p>
<p>The first release includes two main features:</p>
<ol>
<li>lightning-fast keyword search with weighted sorting</li>
<li>community based notes inline with the documentation</li>
</ol>
<p>Many other features are included already in this release. Amongst the most important is showing of<br />
visual representations of the importance and relevance of classes/modules/methods initially based on the amount and complexity of their documentation. The formatting of the documentation has been improved vastly and it is now both easy to read and easy on the eye. The formatting also includes nice-looking syntax highlighting which is also used in code examples that you can give as a part of notes.
</p>
<p>Each page of documentation has a list of related methods and you can also move to namespaced parents and children. Class and instance methods are separated, so are public and private.</p>
<p>The search feature also includes keyboard controls. After typing in your search query you can move from on result to another by using the arrow keys and move to the chosen result by pressing return.</p>
<p>Notes can be thanked and so we can ensure that good notes are shown more prominently than not-so-great ones. We provide an RSS feed of good notes (notes that have been thanked a few times) for active developers who want to know everything about Rails.</p>
<p>Currently, only documentation for the most recent Rails release, 2.1 is included. The next big release, coming out in a couple of months, will include support for multiple versions of Rails and version handling/separation on class-module-method level.</p>
<p>A technical writer from Italy, called Fabio Cevasco, was kind enough to write an <a href="http://www.h3rald.com/articles/rails-doc-first-look">early review</a>. Check it out, if you&#8217;d like to read a more extensive first look.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nodeta.fi/2008/06/20/rails-doc-org-out-now/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>iPhone browser more popular than Internet Explorer</title>
		<link>http://blog.nodeta.fi/2008/06/17/iphone-browser-more-popular-than-internet-explorer/</link>
		<comments>http://blog.nodeta.fi/2008/06/17/iphone-browser-more-popular-than-internet-explorer/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 20:56:29 +0000</pubDate>
		<dc:creator>Otto Hilska</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Rails-doc]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://blog.nodeta.fi/?p=29</guid>
		<description><![CDATA[We&#8217;ve been feeling sorry because we didn&#8217;t pay much attention to rails-doc IE compatibility. Today I had a look at the server statistics, and it seems that even the iPhone browser is more popular than Internet Explorer. :) Good to see that Rails developers have such a good taste.
Anyways, today is the Firefox 3.0 download [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been feeling sorry because we didn&#8217;t pay much attention to rails-doc IE compatibility. Today I had a look at the server statistics, and it seems that even the iPhone browser is more popular than Internet Explorer. :) Good to see that Rails developers have such a good taste.</p>
<p>Anyways, today is the Firefox 3.0 download day:</p>
<p><a href="http://www.spreadfirefox.com/node&#038;id=0&#038;t=264"><img border="0" alt="Download Day" title="Download Day" src="http://www.spreadfirefox.com/files/images/affiliates_banners/dday_badge_fox.png"/></a></p>
<p>Go and get it! The super-fast JavaScript interpreter is going to enable lots of new possibilities in web UIs. I&#8217;m really looking forward to see stuff like <a href="http://www.sproutcore.com/">SproutCore</a> used in different kinds of applications.</p>
<p>PS. The upcoming <a href="http://rails-doc.org/">Rails-doc.org</a> JavaScript search is already going to benefit from the upgrade. ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nodeta.fi/2008/06/17/iphone-browser-more-popular-than-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Undefined success with Prototype</title>
		<link>http://blog.nodeta.fi/2008/04/15/undefined-success-with-prototype/</link>
		<comments>http://blog.nodeta.fi/2008/04/15/undefined-success-with-prototype/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 14:50:04 +0000</pubDate>
		<dc:creator>Mikael Roos</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Prototype]]></category>

		<guid isPermaLink="false">http://blog.nodeta.fi/?p=7</guid>
		<description><![CDATA[I noticed something really strange in the Prototype API today after a fellow developer came smirking to ask me why an export action seemed to quickly success after he had dropped the whole server. I tried to reproduce the situation and surely enough, the onSuccess callback ran when there effectively was no response. I immediately [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed something really strange in the Prototype API today after a fellow developer came smirking to ask me why an export action seemed to quickly success after he had dropped the whole server. I tried to reproduce the situation and surely enough, the onSuccess callback ran when there effectively was no response. I immediately perused the Prototype API documentation and to my amazement read this description for the onSuccess callback:</p>
<blockquote><p>Invoked when a request completes and its status code is undefined or belongs in the 2xy family. This is skipped if a code-specific callback is defined, and happens <em>before</em></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:100%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">onComplete</div></div>
<p>.</p>
</blockquote>
<p>Did you notice that? <strong>&#8220;Invoked when a request completes and its status code is undefined&#8230;&#8221;</strong> What on earth!? After some googling, I found out that this is <a href="http://dev.rubyonrails.org/ticket/4267">no new discovery</a> and that <a href="http://dev.rubyonrails.org/ticket/10191">there&#8217;s more to this problem</a> than you&#8217;d think.</p>
<p>Different browsers handle the situation differently, and so, what eventually ends up in the status field of the response object, varies greatly depending on the browser and the protocol. Since there is no standard XMLHTTPRequest, there is no standard behavior for a browser regarding what should be passed to the JavaScript response object. In the olden golden days of standard HTTP requests there of course is no problem because there just is no response.</p>
<p>Apparently, when a network problem occurs and no actual response is received, Firefox  and Opera (most versions) pass an undefined status with status code 0, IE passes its own proprietary status codes in the 1000-range and Webkit/Safari, in addition to the occasional status code of -1004 (!), also passes a status code of zero. Other problems are brought on by the use of file protocol.</p>
<p>There has been a few suggested patches <a href="http://dev.rubyonrails.org/ticket/4267">(1)</a> <a href="http://dev.rubyonrails.org/ticket/10191">(2)</a> <a href="http://dev.rubyonrails.org/ticket/10030">(3)</a> <a href="http://dev.rubyonrails.org/ticket/8259">(4)</a>, and the status quo will hopefully <a href="http://dev.rubyonrails.org/ticket/10191#comment:2">change soon</a>.</p>
<p>In the meantime, you can solve the problem in at least these ways:</p>
<ol>
<li>Use the on0 callback (that&#8217;s &#8220;on&#8221;-zero) to separately handle the cases when the browser passes a status code of zero to the AJAX Response object. The fired on0 will block the onSuccess from firing.</li>
<li>Forget all the different completion-related onXXXX callbacks and simply only use the onComplete and manually check if the status code pleases you &#8211; something along the lines of this:
<pre lang="javascript">
new Ajax.Request("/path", {
  onComplete: function(response) {
    if (response.status==200)
      alert('Very successful!');
    else
      alert('Far less successful');
  }
});</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.nodeta.fi/2008/04/15/undefined-success-with-prototype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
