Professional JavaScript Frameworks is a real book!

Introducing Professional JavaScript Frameworks, my first multi-author book project and the result of almost 2 years’ writing, editing, revising, and cat herding. The author roster changed a few times in the process, as did the editorial oversight, but finally the thing’s hitting shelves.

This one’s been a long time coming, but it’s finally sitting in my grubby little hands:

My contribution to this book includes all of the material from The Concise Guide to Dojo, plus a second concise guide worth of material on the MooTools JS framework. In addition to my work, you can find the work of Ara Pehlivanian on YUI, Scott Koon on Prototype, and Harley Jones on ExtJS.

HTML5 drag and drop in Firefox 3.5

Oh hey, look! It’s another blog post—and this one is cross-posted on hacks.mozilla.com. I won’t say this is the start of a renewed blogging habit, but let’s see what happens.

Drag and drop is one of the most fundamental interactions afforded by graphical user interfaces. In one gesture, it allows users to pair the selection of an object with the execution of an action, often including a second object in the operation. It’s a simple yet powerful UI concept used to support copying, list reordering, deletion (ala the Trash / Recycle Bin), and even the creation of link relationships.

Since it’s so fundamental, offering drag and drop in web applications has been a no-brainer ever since browsers first offered mouse events in DHTML. But, although mousedown, mousemove, and mouseup made it possible, the implementation has been limited to the bounds of the browser window. Additionally, since these events refer only to the object being dragged, there’s a challenge to find the subject of the drop when the interaction is completed.

Of course, that doesn’t prevent most modern JavaScript frameworks from abstracting away most of the problems and throwing in some flourishes while they’re at it. But, wouldn’t it be nice if browsers offered first-class support for drag and drop, and maybe even extended it beyond the window sandbox?

As it turns out, this very wish is answered by the HTML 5 specification section on new drag-and-drop events, and Firefox 3.5 includes an implementation of those events.

If you want to jump straight to the code, I’ve put together some simple demos of the new events.

I’ve even scratched an itch of my own and built the beginnings of an outline editor, where every draggable element is also a drop target—of which there could be dozens to hundreds in a complex document, something that gave me some minor hair-tearing moments in the past while trying to make do with plain old mouse events.

And, all the above can be downloaded or cloned from a GitHub repository I’ve created especially for this article—which continues after the jump.

Read More »

I (used to) like rev=”canonical”

Update 4/14: So, I liked rev="canonical", but I like the notion of pages offering sets of alternative URLs better. There are enough cracks in the case for rev="canonical" to stop caring about it and instead focus on the notion behind it. However it’s expressed—is it rel="shortlink" now?—the final remaining things I’d like to see are:

  • An more generalized scope for alternate URL choices asserted by publishers, not just URL shortening. Other criteria beyond character length include ease of entry on mobile devices (eg. short, but also simple, maybe mostly numeric), ease of verbal mention (eg. billboards, postcards, etc).

  • HTTP headers are great where available—hooray for HEAD—but it still needs to be in the page for publishers who can’t set custom headers.

  • Microformats are great, but I’d rather not parse a whole page to the footer to lift out the desired URLs.

  • Don’t panic. Have fun.

And with that, I’m going to try coming up with other things to write about so this blog doesn’t stay dormant. The rest of this entry remains unedited below…

Read More »

7 facts about me

So, it finally happened—I’ve been tagged by Stephen Donner. I’ve not been one to follow memes in this blog, but this one’s been going around the Mozillasphere for awhile now and has been kind of interesting. I’m half-tempted to bookmark and tag all the entries I’ve caught so far. Anyway, the rules:

  1. Link to your original tagger(s) and list these rules in your post.
  2. Share seven facts about yourself in the post.
  3. Tag seven people at the end of your post by leaving their names and the links to their blogs.
  4. Let them know they’ve been tagged.

Now, for your random facts, after the jump:

Read More »

Tags do work (for me, at least)

For the “too long; didn’t read” crowd:

  • I’ve been using a lot of tags on Delicious over a relatively long time, so they seem very useful to me.
  • Delicious encourages the use of tags through UI convention and tool usage patterns, whereas Flickr presents no particular bias toward collecting tags from users.
  • Since title and description attract more contribution effort from users on Flickr than on Delicious, it’s natural that search over those fields will be more productive than for tags.
  • Search on Delicious doesn’t have access to the complete text of the bookmarked resource, and often tags will contain information missing from the supplied title or description.
  • All told, tags on Delicious are more essential than tags on Flickr.
  • In conclusion, I think Do Tags Work? misses the value of tags, as I know them, by focusing on Flickr.

Of course, I don’t really care what this means for folksonomy and the rest of Web 2.0—tags work for me on Delicious. So, I suspect this means I’m not entirely opposed to the sentiment in Do Tags Work?, because I don’t think tags work everywhere their use is attempted.

The rest of this entry elaborates on the above.

Read More »

Enter the LizardFeeder

The Mozilla Tree

The Mozilla Tree

Behind Firefox is Mozilla, and behind Mozilla is a community. And the Mozilla community acts a lot like an ecosystem, which can be visualized as a kind of living tree—not to confused with the mozilla-central tree. Oh yeah, and Mozilla is the name of both a Foundation and a Corporation.

Confused yet? If not, then we should talk so you can explain it to me, because it all looks pretty tangly and intertwingled to me. Nonetheless, it seems to work, and produces a good chunk of my favorite software and technologies.

There are many efforts to track what’s going on—including planets and newsletters and bugzillas and wikis and repositories and tinderboxen. Some of these resources report on, or are driven by, the activity occurring in the others. Some are automated, and others are carefully stitched together by hand. None offer a full picture of what’s going on in the Mozilla galaxy in a way that’s casually comprehensible by a sane human being.

Of course, that’s not a slight against any of these sites or the people maintaining them—extracting an overview from such an organic phenomenon is neither easy nor straightforward. But, it might be fun to try.

As an infovore and avid practitioner of continuous partial attention, my first impulse is to reach for a firehose and stick my head into the stream. Relax, defocus, and try to let my pattern recognizers do their thing—sometimes those pattern recognizers are in my head, and sometimes they’re written in Python.

Firefox Victory Robot

Firefox Victory!

But, for Mozilla, I couldn’t find a stream of sufficient volume or completeness to satisfy me or my robots. Happily, though, my feeding urge found itself aligned with a project to discover the patterns of contribution in the Mozilla community and to find a way to thank the contributors responsible.

So, while we’re still working on the thank-you angle, allow me to introduce you to the Lizardfeeder. The LizardFeeder is a feed aggregator, whose source code is built atop Sam Ruby’s Planet Venus. The LizardFeeder pulls together and archives activity streams from a wide variety of Mozilla community sources. Beyond the usual human-readable pages produced by a blog-gathering Planet, the LizardFeeder accumulates statistical and historical data meant for consumption and analysis by robots.

At present, the only robot navigating the LizardFeeder archives is an AJAX-ified user interface that animates the firehose as a near real-time or time-lapsed stream of events scrolling by.

This is just meant as a conversation starter, though. I’m hoping to gather feedback and find more sources, as well as to entice creative community members to come up with more sophisticated visualizations of this data.

So, take a look, check it out, and let me know what you think!

Resolutions

So, after all that, I suppose the thing to do for a new year is to figure out what’s next, maybe compose some disposable resolutions for the coming months. Well, here are some off the top of my head:

  • Spend time with my lovely wife.
  • Eat less, move more.
  • Write more.
  • Be a valuable contributor at Mozilla.
  • Make a few new friends.
  • Spend time with friends.
  • Paint the front porch.
  • Treat the back deck.
  • Reseed the lawn.
  • Maybe grow a garden.
  • Maybe learn Haskell.

Note that most of what’s happened in my life over the past 3 years is missing from that list.

Three Years in Review

It’s been a busy 3 years or so.

Yes, this promises to be one of those posts I seem to keep writing. It’s not quite LiveJournal material, but it’ll be completely devoid of code or any notable geekery—so feel free to move along.

In late 2005 to early 2006, after a busy and stressful Autoshow season working at Organic, I finished a book on del.icio.us. Meanwhile, the girl and I prepared for a wedding and a honeymoon in San Francisco. Unexpectedly, I got offered a job at Yahoo! a month or so before getting married. We got married on June 9, 2006. We had a honeymoon in San Francisco. Then, less than a month after that, we moved to Santa Clara and I started at Yahoo! working on del.icio.us.

Three months after moving to Santa Clara, I got injured and lived in a Vicodin-fueled haze on the couch for a month or two. I limped around through to Spring 2007, back to work and occasionally trying to make it to geek events like SuperHappyDevHouse. At Yahoo!, we started complete ground-up rewrite work on Delicious 2 with a much expanded team. I went to Hack Day London, but couldn’t say much about Delicious. We continued working on Delicious 2 throughout the Summer of 2007.

My Dad passed away in August of 2007, and we flew back to Michigan to take care of things. From remote, at my Mom’s house in Michigan, I worked a little on Delicious 2. It seemed so close to launch, and I wanted distractions. Then, after a month or so back in CA, I started work on a new JavaScript book. Work on Delicious 2 trudged on. I took on more work for the JavaScript book. We didn’t go out much at all, and weren’t all that happy. The holidays were particularly hard.

Around that point, my wife and I got fed up with our state of affairs in the Bay Area and decided it was time for things to change. Having gotten injured and couch-bound right at the beginning probably didn’t help, but we never quite felt at home in California. I still have a lot of starry-eyed regard for the birthplace of Silicon Valley and all, but for us it’s maybe a better place to visit than to live.

In early 2008, my wife found us a wonderful house in Michigan. Work on Delicious 2 hadn’t yet completed, but I left Yahoo! anyway. I changed jobs twice in one month, finally landing at Mozilla. After 6 weeks or so of working from Mountain View, we left California and moved into our new house back in our home state. Relatives and old friends were suddenly thousands of miles closer, and we got out of the house more in the first 2 weeks than we had in the previous 2 years. Telecommuting for Mozilla presented me with a steep learning curve, but an undeniably great working arrangement.

Finally, more than half a year later, I’m still at Mozilla and they seem to like me there so far. Also, part of my work on the JavaScript book has made it to the shelves in the form of the Concise Guide to Dojo. This past summer, Delicious 2 finally launched—and though I’m sad not to have been there when the finish line was crossed, I still think leaving was the best decision for me and mine. We’ve settled into the new house, and I’ve been gradually trying to leave the hermitage to get into the happenings in the Ann Arbor / Detroit area, of which there seem to be an interestingly growing number.

And, that’s pretty much the past 3 years’ exhausting adventure so far… what’s next?