Category: Prototype



Feast on slides: How Custom Events Will Save the Universe, a talk I gave yesterday at TXJS. (Travel can be fun, but you can’t beat conferences held where you live.)



Thomas Fuchs just pushed out the alpha 5 release of scripty2. This is the first release to include the small handful of UI controls I’ve been writing. The controls are designed to be compatible with jQuery UI’s Theme API — meaning that, for instance, a theme built with ThemeRoller could be dropped into a site using scripty2, and vice-versa. More to come!



The “Configurable” pattern

If you don’t know about Raphaël, you’d better ask somebody. It provides a vector drawing API that works in all major browsers (by abstracting between SVG and VML).
I’ve been working on a JavaScript charting library called Krang. Krang is designed to take a data set and produce any chart (line chart, pie chart, bar



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



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!



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!



PDoc: inline documentation for Prototype

As 2008 turns into 2009, it’s past time to dust off some dormant projects in the Prototype realm. I’ve been playing around with PDoc for the first time since April in an effort to get it ready for the next major Prototype release.
Wait — have I not talked about PDoc yet? How is that possible?



Auto-format Tweets

Used on my “About” page.

(function() {  
  var USERNAMES = /@([A-Za-z0-9_]*)\b/;
  var URLS      = /https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.]*(\?\S+)?)?)?/;
  function getInnerText(element) {
    element = $(element);
    return element.innerText && !window.opera ? element.innerText :
     element.innerHTML.stripScripts().unescapeHTML().replace(/[\n\r\s]+/g, ' ');
  function linkifyTweet(li) {
    var html = li.innerHTML, text = getInnerText(li);

    text.scan(URLS, function(match) {
      html = html.sub(match[0], '<a href="#{0}">#{0}');
    html = html.gsub(USERNAMES, '<a href="{1}/">#{0}');
  function init() {
    $('twitter').select('li > span.tweet').each(linkifyTweet);

  document.observe('dom:loaded', init);  





Pseudo-custom events in Prototype 1.6

One major goal of frameworks is to minimize the amount of code branching an individual developer has to do. Usually that means the framework does the branching itself, then builds around it an API that will work in all major browsers. By that metric, support for custom events in Prototype 1.6 might be our biggest

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