How to Use MooTools Element Methods in an iFrame Element

Ever create an iFrame and wanted to use MooTools Elements methods in them, but you couldn\’t? One solution is to add a <script> element whose src attribute points to a MooTools JavaScript file. Instead of doing that, you could just use the MooTools that is loaded in the parent page! Continue reading How to Use MooTools Element Methods in an iFrame Element

Dedupe an Array with MooTools

shanebo asked on IRC today:

twhat is ze cleanest way to remove duplicate items from an array

I wrote a few solutions until I got what I think is a fairly quick and short snippet to remove duplicate items in an array. It\’s really basic. There are probably a few cases this doesn\’t cover.. such as objects with different ordered items but containing the same contents. I also didn\’t test these solutions for their performance. Continue reading Dedupe an Array with MooTools

Sorry, I\’ve Been Lazy

If you\’re reading this, then I really appreciate that you\’ve stuck around. I\’ve been a little lazy, you see. I haven\’t posted in a long while, obviously. This and that happened and then I just lacked the motivation to post.

But hey, something happened and I\’m back in the game. 😀

A little update: I\’m now employed at Fitbit Inc. I left in March 2012. What made me do it? Lots of changes were going on that triggered my curiosity about the world beyond.

Things that haven\’t changed: I\’m still passionate about MooTools.

Anyways, I\’ve got a few things to share. So I\’ll start with this much. Stay tuned, if you\’d like. 🙂

-Garrick-

Date.now!

Here\’s a little cool snippet I picked up from MDN. It\’s how to implement the Date.now method in browsers that don\’t currently support it. The method returns a number value in milliseconds from 1 January 1970 00:00:00 UTC till now.

if (!Date.now) {
  Date.now = function now() {
    return +(new Date);
  };
}

MooTools Core Has Your (Element.NativeEvents) Back

While scanning through MooTools-Core code the other day, I came across Element.NativeEvents and forgot what the value in each property meant. I remember asking MooTools-Core devs about it probably three to four times. You may be wondering \”What\’s the point?\” Well, let me tell you. Continue reading MooTools Core Has Your (Element.NativeEvents) Back

MooTools Core 1.3.2 and More 1.3.2.1

MooTools just released an update to their Core and More libs. They are mostly fixes but More also comes with a brand new and shiny new Utility class called Tables!

Changes (and I quote!) to Core

  • Fixed Slick bug with ~div-like selectors
  • Fixed MooTools in the Node.js environment
  • Fixed an exception in DOMReady in Chrome when the page with MooTools was in an IFrame
  • Fixed setOpacity for very small numbers in IE
  • Fixed an exception in FireFox 4 when MooTools tried to overwrite document.head
  • Added the possibility to create elements with boolean values with an selector, e.g. new Element(\’input[checked]\’);

Changes to More (that I also quote):

  • Rewritten Element.Position which solved some issues
  • Added Table, as described above
  • Ironed out some Event Delegation issues
  • Additional fixes can be found at the Lighthouse for 1.3.2.1

Yay, MooTools developers! You guys are seriously stepping up with a quicker release. In the words of my friend David Walsh: MooTools FTW!

MooTools Core 1.3.1 and More 1.3.1.1

A post long overdue.. but that\’s besides the point. The MooTools Dev team released MooTools Core 1.3.1 and More 1.3.1.1!

Changes (and I quote!)

  • Lots (and by that I mean LOTS) of documentation improvements, clarifications and cleanups
  • Updated Slick to 1.1.5 and improved the speed of our Slick selector engine
  • Added delegation support for submit, focus, blur, reset, change and select events in MooTools More
  • If available the native JSON methods are now used in JSON.decode and JSON.encode
  • Multiple Pseudos click:relay(a):once (demo)
  • Two new pseudo events: :throttle and :pause
  • Added String.truncate to String.Extras in More
  • More than two hundred changes to increase the stability of both Core & More

MooTools Dev, you\’ve been quite awesome. Keep up the great work!