Category: Development

Aug25

 

Panel audio from The Ajax Experience

I just discovered the existence of audio (and slides) for two of the sessions I was involved with at The Ajax Experience 2008, held in Boston last September.
Which is to say: I knew that audio existed, but didn’t know it was yet available anywhere.
The first was PPK’s main-hall session: Top 10 Cross-Browser Issues. This was

May23

 

Yesterday, Sunlight Labs announced Apps for America 2. The follow-up contest marks the recent launch of data.gov
by soliciting apps that find interesting ways to crunch that site’s numbers. (Not sure if I’ll enter yet; I haven’t had much time to see what data.gov has to offer.)

May8

 

InfoQ posted a “virtual panel” in which framework authors answer questions about HTML5. Thomas Fuchs and I, among others, answer questions about how (if?) HTML5 will make our lives easier, and what more we want out of JavaScript in the future.

Mar24

 

Dean Edwards explains how the standard “callback” pattern in JavaScript is too brittle for something like a “DOM ready” event. Prototype appears to be the one major library that handles this “correctly.” WIN!

Mar20

 

That SXSW panel I was on the other day (I am, um, awful at self-promotion, even on my own blog) has already been released via podcast, to my own astonishment. John Resig’s got the slides, so as soon as he posts them I’m sure we’ll find a way to synchronize them to this audio.

Feb19

 

Aren’t you annoyed at having to remember to declare your script tags in the correct order? Your dependency management solution has become tiresome. As I explain on the Prototype blog, we hope that Sprockets will become a natural part of how Prototype add-ons are distributed.

Jan21

 

Thomas and Amy apparently don’t have enough awesome stuff going on yet, so they’ve decided to release a book on JavaScript performance. Thomas tells me his findings have some implications for how we package Prototype & script.aculo.us.

Jan11

 

How to write a robust isArray. Faced with a long-standing problem, Juriy finds the solution by reading the spec. Let this be a lesson to all of us.

Jan8

 

Git has a redesigned homepage that boasts about the major open-source projects that use the up-and-coming DVCS. Prototype is one of them. Thanks, Scott!

Jan5

 

Code: Disabling text selection

Inspired by Thomas’s classic and event delegation.

/**
 *  Element.enableTextSelection(element, isEnabled)
 *  
 *  Enables or disables text selection within the given element.
 *  - element (Element): The element within which a dragging motion
 *    _should_ or _should not_ behave like text selection.
 *  - isEnabled (boolean): Whether to enable or disable text selection.
**/
(function() {
  var IGNORED_ELEMENTS = [];
  function _textSelectionHandler(event) {
    var element = Event.element(event);
    if (!element) return;
    for (var i = 0, node; node = IGNORED_ELEMENTS[i]; i++) {
      if (element === node || element.descendantOf(node)) {
        Event.stop(event);
        break;
      }
    }
  }
  
  if (document.attachEvent)
    document.onselectstart = _textSelectionHandler.bindAsEventListener(window);    
  else
    document.observe('mousedown', _textSelectionHandler);
    

  Element.addMethods({
    enableTextSelection: function(element, isEnabled) {
      if (isEnabled) {
        IGNORED_ELEMENTS = IGNORED_ELEMENTS.without(element);
      } else {
        if (!IGNORED_ELEMENTS.include(element))
          IGNORED_ELEMENTS.push(element);
      }
    }
  });
})();

Painfully Obvious was built with WordPress, Prototype, Slicehost, and other accoutrements. Colophon →