Archive for January, 2007

Mootools r.83 cheat sheat

January 12th, 2007 by Aaron N.

Just this morning I was pinging Valerio (author of Mootools) about a cheat sheet for Mootools after Snook posted his updated cheat sheet for Prototype 1.5. Funny thing; Snook posted a Mootools cheat sheet yesterday and it just hadn’t gotten to my inbox yet. Go Snook! I’m going to add this to our cvs library along with all our other docs and whatnot.

In the same vein as the Prototype Cheat Sheet, I decided to go through and detail the Mootools library, as well. In comparison to Prototype, Mootools is definitely smaller and it’s obvious they’ve put more focus on interactivity and decent DOM traversing.

I’ve colour-coded this one to match the four main categories that are in the download section of the web site and within the documentation. This way, it should hopefully be clearer when trying to compare against the two.

In going through things, I noticed that the documentation for Mootools isn’t bad but spelling mistakes and what not have meant that a couple features aren’t actually detailed in the documentation.

Anyways, for you Mootool luvin’ fans, here are the cheat sheets:

My version of easy form validation

January 4th, 2007 by Aaron N.

I thought about the form validator that I refactored and posted about the other day for a bit and decided I wasn’t happy with all it did. Specifically, I wanted to be able to do more with the validation and more with the messaging. I also thought I could improve on the core functionality a little.

So I rewrote it entirely and borrowed heavily from it to come up with my own version. This version works almost the same way as the previous one with a few differences:

  • the transition is smoother
  • error messages have access to more information about the element they evaluate
  • tests can have conditions specific to individual elements

It still uses css class names, now you can give each field some specific conditions.

You can now see this in action, download the script, and see the docs in our wikitorial.

Really Easy Field Validation with Mootools

January 2nd, 2007 by Aaron N.

UPDATE: this file is deprecated. See the validator script in our common code in the wiki.

Back in May I posted, er, recycled a post from Ajaxian about really easy field validation using Prototype (and Scriptaculous). I really liked this concept of field validation and, as I move through my current project of rewriting all the javascript on Download.com (pity me), I ran into a few validation tasks that made me think back to this post.

So I rolled up my sleeves and dove in to the code from Dexagogo and refactored it to work with Mootools, which is what we’re using as the foundation framework for our javascript efforts here at CNET (and to which I contribute).

I’ll post more about this later, but really there’s not much to post. The Documentation page at Dexagogo pretty much says it all – it’s the same functionality and the same API. I can’t really take any credit for this; it’s all Dexagogo’s magic.

Update: I left a few console.log statements in this when I posted it which broke it for some of you. It’s fixed now.
Download the script | Demo

Why I re-post things from Ajaxian and others

January 1st, 2007 by Aaron N.

There’s a comment on a recent post I made of Ajaxian’s predictions for 07 from a nice fellow by the name of Steve that reads as follows:

Aaron, I would imagine that the majority of people who read your blog also read Ajaxian. I can understand aggregating interesting posts from across the web and adding one’s own commentary, etc., but seriously, your blog is little more than a mirror of a random selection of Ajaxian posts. On the other hand, I’m actually interested in the occasional stuff you write that isn’t ripped wholesale from Ajaxian.

Read the rest of this entry »