Well, it’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’s also quasi-3d, but whatever). It uses Prototype and Scriptaculous and is available on Github here.
It’s something I actually needed to write for work over a year and a half ago – can you imagine?
Merry Christmas to all from everyone at Nodeta!
Here’s the thing with chrismassy icons!
The free Christmas icons can be found from here.
Posted in JavaScript Tags: JavaScript — Leave a Comment »

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’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 simple git commands:
% mkdir -p ~/Library/Application\ Support/Textmate/Bundles
% cd ~/Library/Application\ Support/Textmate/Bundles
% git clone git://github.com/lautis/ruby-on-rails-tmbundle.git "Ruby on Rails.tmbundle"
% git clone git://github.com/lautis/ruby-tmbundle.git "Ruby.tmbundle"
% osascript -e 'tell app "TextMate" to reload bundles'
Now, the keyboard shortcut
gets you the page for the current word from APIdock.

Posted in APIdock, JavaScript, Rails, Rails-doc, Ruby, Uncategorized Tags: APIdock, Rails, Ruby — 8 Comments »

Rails-doc.org’s first release, tagged Sylvester (1.0), is now published live. Check it out and sign up to post notes.
The first release includes two main features:
- lightning-fast keyword search with weighted sorting
- community based notes inline with the documentation
Many other features are included already in this release. Amongst the most important is showing of
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.
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.
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.
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.
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.
A technical writer from Italy, called Fabio Cevasco, was kind enough to write an early review. Check it out, if you’d like to read a more extensive first look.
Posted in JavaScript, Rails, Rails-doc Tags: new app rails documentation — 11 Comments »
We’ve been feeling sorry because we didn’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 day:

Go and get it! The super-fast JavaScript interpreter is going to enable lots of new possibilities in web UIs. I’m really looking forward to see stuff like SproutCore used in different kinds of applications.
PS. The upcoming Rails-doc.org JavaScript search is already going to benefit from the upgrade. ;)
Posted in JavaScript, Rails-doc Tags: firefox, iphone, JavaScript — Leave a Comment »
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:
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 before
.
Did you notice that? “Invoked when a request completes and its status code is undefined…” What on earth!? After some googling, I found out that this is no new discovery and that there’s more to this problem than you’d think.
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.
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.
There has been a few suggested patches (1) (2) (3) (4), and the status quo will hopefully change soon.
In the meantime, you can solve the problem in at least these ways:
- Use the on0 callback (that’s “on”-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.
- Forget all the different completion-related onXXXX callbacks and simply only use the onComplete and manually check if the status code pleases you – something along the lines of this:
new Ajax.Request("/path", {
onComplete: function(response) {
if (response.status==200)
alert('Very successful!');
else
alert('Far less successful');
}
});
Posted in JavaScript Tags: AJAX, JavaScript, Prototype — Leave a Comment »