Announcing MooTools More 1.3

Written By Arian Stolwijk, on Friday, October 29th 2010, 8:41am

We hereby announce the immediate availability of MooTools More 1.3.0.1. We have updated all of MooTools More’s code to work with the recently released Core 1.3 without 1.2 compatibility. Besides the API update, 1.3 improves stability and introduces some awesome new features.

Awesome new features? What awesome new features?

Events.Pseudos, wait, this isn’t happening!

MooTools Core 1.3 includes our new selector engine Slick. One of Slick’s components is Slick.Parser. Slick.Parser parses a CSS selector to an object representation of the selector, called a “Slick object”. Since our Event Delegation already uses such a CSS style notation for defining events, i.e. click:relay, we decided to take this to the next level: Events.Pseudos and Element.Event.Pseudos. I’ll show you an example of how it works:

document.addEvent('keydown:keys(shift+c)', function(){
    alert('You pressed the shift and c keys!');
});

We append an event pseudo, :keys to the existing event name, to get custom events. This doesn’t only work for Element events, but for the Class event system, the Events mixin, as well. Currently we’ve implemented the pseudo events :once for both Events as Element.Event and :keys and :relay for Element.Event.

Locale, localizzazione, Lokalisierung, localización, локализация

For 1.3 we’ve rewritten MooTools.lang to Locale. It’s now more powerful and has a much better API. A big thanks to our community as well! A lot of people helped us improve translations for their native languages.

A simple example looks like:

Locale.use('nl-NL');
Locale.get('Ping.stop'); // w00fz, kun je alsjeblieft stoppen met pingen

However, the real cpower of the new Locale is its inheritance abilities. For example, if you take Portuguese, it’s used in several countries around the world, like in Brazil. Brazilian Portuguese is slightly different, but has many similarities. Now instead of recreating a whole Locale Set file, you can now inherit the Portuguese translations and overwrite only the values that are different.

Locale.define('pt-BR', 'ping', {
    // ... key-value pairs
}).inherit('pt-PT');

Another awesome thing is the new Locale.Set.From function which right now allows you to create Locale Sets from a JSON string. The plan is to extend this in the future to support other data formats. This function will make it easier to share translations between server and client side: you can do a Request to your server, and pass the responseText to Locale.Set.From right away.

Number.format

Because Localization is more than just converting strings to other languages, we added Number.Format to MooTools More. Just like our Date.format works for dates, Number.format lets you format numbers in various formats.

(101).formatCurrency(); // € 101,00

HtmlTable

HtmlTable has received a lot of attention. Its API is a little more useful now, but there are numerous features added including the ability to select multiple rows with shift and ctrl, keyboard support, and more robust sortability controls.

Notable changes in 1.3

  • A total of 105 tickets closed for 1.3.0.1 (first 65 tickets here, 28 tickets here, and another 12 here)
  • Hash has been deprecated in 1.3 Core. But fear not! More 1.3 provides Hash now.
  • Hash.Extras are now also available as Object.Extras
  • Event Delegation now supports the mouseenter and mouseleave events
  • Log.js has been removed. Use this or this or just console.log and friends.
  • Like myElement.get(‘tween’, options) Fx Classes in More don’t support the second argument of Element.get anymore either. You can find more information in the Update Wiki Page
  • EcmaScript 5 array methods Array:reduce and Array:reduceRight are added to Array.Extras
  • Date.parse now follows the UNIX specification of strftime.
  • Full changelog for 1.3 (Note that changes that we also applied for 1.2.5.1 will be listed under 1.2.5.1)

Testing

Like Core and Slick we have moved More to use our new Specs Runner. We tried to cover as much as possible in the Specs. However, More contains a lot of UI components that are very difficult to test with the Specs. Therefore we have new UI tests, which are basically HTML pages with JavaScript and CSS. You can run the tests with mootools-test-runner (Python + Django) or mootools-ui-runner (PHP)

MooTools 1.2.5.1

Together with this 1.3 release we also release MooTools More 1.2.5.1, which is an update for the 1.2 branch for the people who are not (yet) able to upgrade to 1.3. It has the improved stability of 1.3 and some new features.

Notable changes in 1.2.5.1

  • There are 65 tickets closed since the previous 1.2.4.4. release.
  • All optimizations and updates done to existing code in 1.3.0.1 are applied on the 1.2.5.1 branch as well
  • Depender.js is no more, use Packager or Depender on the server side.
  • Full changelog for 1.2.5.1

Get It NAOW, with a smile!

13 Responses to “Announcing MooTools More 1.3”

  1. Rolf says:

    First, lol. Just d/l it without even thinking about it how fresh the release actually was/is. Thanks for the hard work to the team, so far I didn’t have much problems with the pre-releases etc. NICE

  2. Thomas Aylott says:

    Congratulations to the MooTools More team for this epic release!

  3. André says:

    Really great! thx a lot :o)

  4. A. Gideonse says:

    I had a problem using the new MooTools 1.3 version (with compatibility) and I could not find good documentation about this backwards compatibility issue. After I found out what has been changed in the behavior of Request.JSON, I created a blog to help other people out: http://weblog.scanyours.com/2010/10/29/howto-backwards-compatibility-for-request-json-in-mootools-1-3/ . Hopefully this helps some people to use this great library!

  5. Luis Merino says:

    Congratulations to everyone. It’s been a long way, months of planning and decision making.. and meet-ups! Can’t wait to start porting a couple of major projects :)

  6. gonchuki says:

    awww, so bad I’m trapped in a jQuery project at this moment. I would have loved to use all the new goodies of Events.Pseudos, Locale and then some for this project (maybe even HtmlTable). congrats to everyone on the job done :)

  7. mayc says:

    I found 2 bugs in Swiff of Mootools Core 1.3

    1: the extend function of Array is no longer exist,should use the append method

    2: in “initialize”, the var id is dup with “id” of the closure.

  8. Arian says:

    @mayc: Thanks for noticing, but this is already fixed for the upcoming release of Core.

  9. cpojer says:

    I am so happy about the insane amount of power! that you can get from this release :)

  10. deos says:

    awesome guys, thank you very much for your hard work! but a stupid question: does more 1.3 work with core 1.2?

  11. Référencement says:

    Thanks for the update ! I will try it on my website.

  12. Coco says:

    Well, seems like a really good release :)

    Keep up the good work !

  13. Teisines paslaugos says:

    awesome guys, thank you very much for your hard work! but a stupid question: does more 1.3 work with core