Thomas Fuchs
Hi, I'm Thomas Fuchs. I'm the author of Zepto.js, of script.aculo.us, and I'm a Ruby on Rails core alumnus. With Amy Hoy I'm building cheerful software, like Noko Time Tracking and Every Time Zone and write books like Retinafy.me.
   Want me to speak at your conference? Contact me!

Signal vs. Noise weblog on using script.aculo.us for Backpack

June 23rd, 2005

37signals’ Signal vs. Noise weblog writes on how drag and drop came to Backpack:

It’s never been easier to bring higher-level interactivity to your web apps.

Be sure to check out the video on how intuitively drag-and-drop integrates with Backpack!

On his personal weblog Loud thinking, David writes:

But the real reason this is a big deal is because the rocket science department has been put on leave. With the script.aculo.us Javascript library by Thomas Fuchs, that builds on the great Prototype library from Sam Stephenson, it’s silly easy to add advanced drag’n’drop to your Rails (or any) application.

By taking the complexity out of the ordeal, it becomes more accessible, less of a project, and more something you just do. Rails initial support for Ajax through Prototype had the same characteristics. Make it as easy as not to. And thus, Backpack was filled to the brim with Ajaxing goodies. Something it certainly wouldn’t have been if we were doing it old skool style with loads of custom Javascript build by experts.

So, the script.aculo.us Web 2.0 Javascript libraries will be included with the next release of Ruby on Rails!

To get the very latest releases of the libraries, point your browser to the instructions on how to access the SVN repository – hosted on the Ruby on Rails development site of course.

Next thing to come to a browser near you: Upload Progress

June 22nd, 2005

Sean Treadway has just updated the upload progress patch for Rails to include some nice new features and make it even easier to use than before. Read more about it on Sean’s weblog!

And be sure to check out the new how-to video! 🙂

script.aculo.us launched!

June 22nd, 2005

The Web is changing. The 30-year-old terminal-like technology it was originally is gradually giving way to new ways of doing things.

Web apps don’t have to stay behind the current graphical trends in ultra-rich-desktop-applications. And they don’t have to resort to fancy plug-ins that break usability and accessibility. Browsers and standards have reached a stage where advanced animations are finally possible to do with JavaScript.

In an attempt to consolidate into one place all the scripts that happened to come into existence over the last few months, I’ve finally managed to come up with this site. Hope you like it.

Visit script.aculo.us!

It’s coming soon to a browser near you…

June 19th, 2005

script.aculo.us

UPDATE 2005/06/21: Planned going online: TODAY!

Meanwhile, here is a great screenshot:

JavaScript drag-and-drop library maturing

June 19th, 2005

My JavaScript Drag-and-drop library extension for Prototype got some new features:

  • Sortables now work inside scrolled elements (demo page)
  • Sortables now accept an only parameter, to make only child elements with a specfic CSS class sortable, this way you can have non-sortable elements within your list or your floatables
  • Droppables now accept more than one CSS class when using accept.

Some other stuff that is on the TODO-List for a 1.0 release:

  • Make effects on dragging and dropping customizable (that is, make it completely override what happens when a drag starts and ends)
  • On Sortable, provide a way to give options to the underlying Draggables

You’ll find more, including some suggested features for a 2.0 release on the info page for the Drag-and-Drop extension.

Update: There seems to be some performance slowdown on Mozilla based browsers with the latest version. I’ve already made some optimizations, but more are needed. Please reports your findings on your browsers!

Fun stuff with Mac minis

June 16th, 2005

Besides doing serious projects (for food) I’m using some of my time for absolutely cool (IMHO) art projects, like this interactive 3D multimedia stuff.

The Mac minis came in handy because of their quite powerful 3D-acceleration. We attached an iSight for sound input, too.

One of the minis is now a development server, of course running Ruby on Rails.

Source code (for Processing) coming soon!

New FCGI gem released; fixes memory leaks

June 16th, 2005

If you aren’t running 0.8.6 of the Ruby FCGI bindings yet (which fixes a serious memory leak), head over to too-biased now!

Basically, the gem in the main gem repository has been updated, so you just have to do a

$ sudo gem install fcgi

to install the latest-and-greatest version. Be sure to uninstall any other versions of Ruby FCGI first.

ActiveRecord, eager loading, and SQL LIMIT/OFFSET

June 12th, 2005

The eager loading of associations that where first introduced in Rails 0.12.0 suffer from one drawback: It’s not possible to specify :limit or :offset on ActiveRecord’s find method.

Here’s a way to work around this, by using an SQL subquery to select the correct ids:


page = 1
per_page = 25
limit = "LIMIT #{per_page} OFFSET #{(page-1)*per_page}"
stuff = Sometable.find(:all,
  :conditions =>
     "sometable.id IN (SELECT id FROM sometable #{limit})",
  :include => [:someassoc, :someotherassoc])

This code works fine with PostgreSQL, as it is my database of choice. Your mileage with other databases may vary.

JavaScript Drag-and-Drop extension for Prototype hitting beta

June 9th, 2005

My JavaScript Drag-and-Drop extension for Prototype is finally declared beta!

Features:

  • Any element can be declared draggable and/or a drop target
  • Callbacks (onDrop, onHover)
  • Integrated CSS class change to add class drophover if hovering over an possible droptarget
  • Constraints (drag only vertically or horizontally)
  • Sortable lists (UL, OL)
  • Sortable float containers (DIV containing any sort of floating elements)
  • Easy to do sortable lists that also can drag-and-drop to another list
  • Sort order can be serialized to use with Prototype’s Ajax functions
  • Uses the Effect2 library for transparency and snap-back visual effects

There are some minor issues left, but feel free to start using this—please report any bugs or annoyances you hit!

Why I think Apple’s switch to Intel is great

June 7th, 2005

On Monday, Steve Jobs announced Apple will start using Intel microprocessors beginning in 2006.

Some Mac fans have criticised this move and already there are huge amounts of FUD on the net.

What those guys don’t realize is:

  • Your Mac will still look and feel the same. It’s just the processor that gets changed. Not the OS. Not the Hardware/Software integration that Apple is famous for.
  • Wine for Mac/Intel: run any Windows app under Mac OS X/Intel in its own window at native speed. Wine already works fine with x86 FreeBSD. I can’t emphasize this enough.
  • Free to exploit FreeBSD’s ability to run Linux apps ‘out-of-the-box’, including those who include x86 assembly.
  • Most old PowerPC apps will continue to work. All new programs will come as a univseral binary, optimized for both architectures (it’s two binaries in one package actually).

Also, one of the things that very much appeal to me is that Ruby will probably get a VM/just-in-time compiler for 2.0 and from looking at the source I gather it will be optimized towards x86 (first).