⬆️ ⬇️

MooTools 1.3

image

image

Here is the long-awaited release of MooTools 1.3. I'll tell you a little about the changes in the framework itself, and in its "environment". There are a lot of differences between versions 1.2 and 1.3, but first things first.



The first thing to say, is that there is an assembly of version 1.3, which is 100% compatible with 1.2, you are not afraid to be updated.



Slick


And so, about the differences. The most tasty thing in the new version is the new css selector engine Slick. It is completely independent of MooTools, can be used separately. It is “izkarobki” supports all imaginable and inconceivable selectors / pseudo-selectors, and if you find this and not enough, do not worry, you can always create a new one.

Examples of use outside MooTools:

Slick.search(document, "div > p.moo:not(.foo)"); //   () ,       ,       ,  null.     ,  . Slick.find(document, "div > p.moo:not(.foo)"); //    ,     ,      Slick.match(node, "p.moo"); //    node   Slick.contains(node, node2); //    node2  node 


Inside MooTools, the same selectors are used as usual.



And now concisely:



API changes


Core




And



Browser detection




Array




Function




Element




Using Slick to create new elements has become easier:

 new Element("input", {"id": "someID", "class": "someClass1", "disabled": true}); //  new Element("input#someID.someClass1[disabled=true]"); //  


New opportunities




Environment




Packager


Packager was developed for project management. It works as follows: you create code, create a special comment at the beginning of each file, where you specify the name, author, dependencies, etc., also create a configuration file for the package (project), where you specify the name, description, list of participants in the assembly files, etc., packager works from the terminal:

 $ packager register /path/to/project $ packager build ProjectName/* > myproject.js 


When assembling takes into account external dependencies. By external, I mean dependencies on other projects that are also registered in Packager. The stuff is very convenient, I have been using for my projects for six months already.

')

Summary


In general, about a third of the code was rewritten. There are also a lot of changes in MooTools More, for example, there is support for pseudo-selectors for events, for example:

 element.addEvent('click:once', function(){}); //       element.addEvent('click:relay(.some-selector)', function(){}); //      element.addEvent('keydown:keys(ctrl+s)', function(){}); //     


The next big release is MooTools 2 (now for sure).

Repositories:

MooTools Core

MooTools More

Slick

Packager

Source: https://habr.com/ru/post/106014/



All Articles