Archive for May, 2007

Mootorial updated for Mootools 1.1

Mootools 1.1 was released a few weeks ago and I’ve finally finished re-writing the Mootorial. You’ll find executable examples of nearly every function and class found in the library. Just as before, it’s a wiki (a wikitorial?) so you can jump in and fix typos or add clarity where you think it needs it.

In addition to this update we’ve tidied up some of our libraries (in particular the Element extensions) and tested them for compatibility with Mootools 1.1. You can download these files from our SVN server, view the examples of them in action, and look through the docs. | Read the rest »

CNET code now uses Mootools 1.1

The CNET libraries have, until recently, required that you download a version of Mootools from our svn repository or use the dev version of Mootools. This was before Mootools 1.1 released, and it had some dependencies on code that wasn’t in 1.0.

As Mootools 1.1 is now out, you should download it from Mootools.net. I’ve removed Mootools from our SVN so now the only thing there is our code. You’ll find clientside.moo.v1.1.packed.js in the /cat directory; this is a copy of ALL of Mootools 1.1 + ALL of our code. It’s a big file, but it’s complete if you just want to fool around with it.

CNET javascript update (r90)

I released a lot of code today including a bug fix that was probably pestering any of you with r87.

  • product.picker.js now has no picklets; these are in the implementations/picklets directory
  • ProductPicker now detects if there is no doctyp and, if not, sets the position of the picker to be fixed (no IE6 support)
  • small docs update in element.cnet.js
  • added new picklet: CNETProductPicker_PricePath
  • added new picklet: NewsStoryPicker_Path
  • new file: clipboard.js (allows you to insert text into the OS clipboard)
  • new file: html.table.js (automates building html tables)
  • new file: element.forms.js (for managing text inputs - get selected text information, insert content around selection, etc.)
  • fixed an error in stickyWinHTML (ie reserves “class” for member names)
  • converted window.onDomReady references to window.addEvent(’domready’..
  • updated css for stickyWin.js to avoid namespace conflicts with the css class “clearfix”

| Read the rest »

Sorting javascript arrays

Bas Wenneker has a nice little article over at solutoire.com on sorting javascript arrays. The docs over at Mozilla on Array.sort demonstrate the same stuff, but Bas's article is a quick read that's worth it if you ever see yourself working with data this way.

JavaScript:
objectArray.sort(callbackFunc);

/**
 * After sorting the objectArray will be like this:
 * [
 *  {firstname: 'Will',  lastname: 'Brown',   age: 28},
 *  {firstname: 'John',  lastname: 'Doe', age: 25},
 *  {firstname: 'Marie',     lastname: 'Doe',    age: 28},
 *  {firstname: 'Sarah',     lastname: 'Doe',    age: 25},
 *  {firstname: 'James',     lastname: 'White',  age: 28},
 *  {firstname: 'George',    lastname: 'Williams',  age: 25}
 * ]
 */

drag to resize


Mootools 1.1 hits the shelves

Woot. Mootools 1.1 is out and it's awesome. Mootools r87 was the first stable release of the framework (end of Nov. of 06). Mootools 1.0 came out (r241) at the end of Jan. and was a huge improvement, adding functionality, documentation (I wrote those, thank you very much), and numerous bug fixes.

There's a reason 1.1 has been 4 months in the making. Really, this is the first FULL release of the framework if you ask me. 1.0 signaled the point where the API stopped changing, so most of your code written for 1.0 will work fine with 1.1, but 1.1 has so much polish. 1.1 is revision 565.

Numerous bugs are fixed, lots of new functionality is added, and the thing is blazing fast.

Expect to see a new Mootorial soon. We'll also be updating our own code to 1.1. So far, it looks like all our stuff works fine with it, but we haven't tested thoroughly yet.

Congrats to Valerio and everyone else who put a lot of work into this.

new: Element.pin

Here's a little Mootools extension that you might find useful. I'm using it my StickyWin classes to allow the user to "pin" it in place so it won't move if they scroll.

JavaScript:
$('fxTarget').pin()
$('fxTarget').pin()

drag to resize


Execute the example, then scroll. That's it. You can unpin it if you like:

JavaScript:
$('fxTarget').unpin()
$('fxTarget').unpin()

drag to resize


(note, in this example because of the way my little fxTarget helper works, unpin will break the drag behavior, but that won't happen in other instances).

I've added .pin and .unpin to StickyWin, too.

Categories

Archives

Links and whatnot