Labelize: a jQuery plugin for making big honking labels

Labelize is a handy jQuery plugin that lets you give input-containing elements <label/> like properties, so that clicking on the container activates the input inside. The goal? To improve usability by giving hard-to-click input elements like radio buttons and checkboxes generous target areas. Surprisingly, this can’t be done with a <label/> element alone—if you want it supported in IE6, that is.

Say we have the following markup:

<div class="myLabel">
  <input type="checkbox"/>
</div>

To make the “myLabel” div become a label-like container for the checkbox its holding, we simply do the following:

<script>
  $('.myLabel').labelize()
</script>

That’s it! Now if we click anywhere on “myLabel”, the checkbox is clicked—and its onclick() event is fired too. Huzzah.

If you’d like to see the plugin in action, I’ve whipped up a quick project page with some working examples. Please have a look and let me know what you think.

Rogers starts re-directing DNS misses

Beginning some time this past week, Rogers, the largest ISP in Canada, starting re-routing missed DNS hits to their own branded Yahoo-search page. Not only is this totally unhelpful and full of irrelevent ads (no, I do not want a Chatelaine subscription, thanks), it also re-writes the attempted URL in your browser’s address bar – making efforts to correct the typo you made a total pain in the ass.

Here’s the explanation from the about page:

These search results were provided because the domain name you entered into the address bar is either improperly formatted, currently unavailable, nonexistent, or part of a key word search. Rogers Supported Search Results is a service designed to enhance your web surfing experience by eliminating many of the error pages you encounter as you surf.

Thankfully, Rogers lets you disable these “helpful” search result pages. Except, they’re not really disabled. Instead of showing you the search results page, you get a mocked up IE-style 404 error served to you by Rogers. Meaning, the URL is still being clobbered.

Between this and the web content tampering fiasco from earlier this year, I’m about done with Rogers. But since I’m moving in a few months, I’ll have to maintain this abusive relationship until then.

Update: This is now being covered on Slashdot.

Fun with Yahoo Pipes

In the middle of some recent web-based wanderlust, I found myself toying around with Yahoo Pipes, the aggregate web feed builder. Released earlier this year and still in beta, Pipes’ slick Javascript-based GUI lets you drag-and-drop feed sources, user inputs, and operators (like sort, filter, search and replace), and pipe them out to a single output – a consumable web feed. In case it’s not obvious, Pipes is inspired by Unix-style pipelines.

My first creation is a “Pipe” titled FreshFriends. It’s an aggregated feed of FreshBooks employees’ personal blogs. This took me about 30 minutes to create, most of which was spent tracking down everyone’s feed URLs.

Afterwards, I built a classifieds search feed that aggregates local Craigslist and Kijiji listings. I happen to be on the lookout for a used Settlers of Catan board game (don’t ask), so I created this feed to receive new listings directly in my feed reader. The Pipe is generalized so that you can create your own customized feed by changing the supplied search params, including minimum and maximum prices, and location.

Aside from my own creations, there’s also some really cool stuff in the public Pipe browser. I’ve subscribed to one that cleans up Penny Arcade comic feeds to include only comic entries, and scrape the comic image directly into the feed (normally you have to click an embedded link to view the image). No more senseless and artist-supporting ad views!

Long story short, Yahoo Pipes is a nifty – and useful – tool. It makes a lot of mundane scripting tasks fun, and combined with handy source cloning tools, easily shareable too.

API Podcast from SXSW Is Up

It’s kind of old news now, but my SXSW Interactive panel presentation, Developer Friendly Web Service APIs, is available in podcast form on the SXSW website. Once again, it features Carl Mercier of Defensio, Avi Bryant from DabbleDB, Leah Culver from Pownce, Ari Steinberg of Facebook. Topics covered include ideal request and response formats, strategies for reducing API changes, request throttling, and more.

You can listen to the podcast here.

Looking to get involved next year? SXSW has begun taking panel submissions for 2009.

Bare bones date picker for Merb

I’ve been fooling around with Merb these past few months. Can’t say I’ve created anything of consequence, but along the way I’d written this simple date picker, and thought I’d share it.

Used inside a form_for block, it creates 3 separate drop-downs for year, month, and day from a Time object.

Example:

<% form_for @person %>

  <%= date_control :birthdate, :label => 'Birthdate' %>

<% end %>

	

Note: This should be run against Merb 0.9.3.