Categories
JavaScript

Flickr DHTML: first looks

Flickr recently pulled its use of Flash in some of the pages and replaced it with DHTML (Dynamic HTML). If you’re not familiar with DHTML, it’s a mix of scripting language and underlying page ‘object’ model’ used to modify the appearance or behavior of the page without having to reload it from the server.

I was pleased to see this move, not the least because Catarina used the word “DHTML” to describe the technology used rather than the newer, hipper, AJAX. Doing so tied this effort into previous uses of the associated technologies: this, in turn, linked this new effort to a rich set of *existing tutorials, libraries, examples, books, and articles that are being missed when people searched using the newer terminology.

An additional reason I’m pleased is, of course, the fact that much of the functionality at the site is now no longer restricted to having Flash installed — something that prevented the page from ‘degrading gracefully’ with non-Flash enabled browsers.

Focusing specifically on each individual photo page, I like the fact that much of the photo annotating capabilities are now available for ‘in-place’ editing: capabilities such as adding a photo to a set, sending to a group, or blogging the picture. The sets and groups loaded a bit slowly at times, and I wonder if pre-loaded, or on-demand, client-side caching couldn’t be used to help this along a bit. Regardless, it’s much simpler now to use these functions without having to go to separate pages.

I also enjoyed that the Flickr folks didn’t try to obscure the JavaScript so we could look at the DHTML used; in particular seeing the interface between the new DHTML connecting with the existing API to handle much of the photo toolbar functionality (such as Send to Groups and Add to Set). I also appreciated the humor present in this script, when seeing the ‘george’ and ‘catarina’ objects. After all, if we can’t have fun with our work, what’s the point?

The new functionality is great, but returning to the original issue of ‘degrading gracefully’ what happens at Flickr when you turn off JavaScript? To test this, I turned off JS in my Firefox browser, and then accessed one of my photo pages; creating a snapshot of the page to use as reference in this discussion.


First, prominantly displayed in the page is a message (1):

To take full advantage of Flickr, you should use a JavaScript-enabled browser and install the latest version of the Macromedia Flash Player.

There isn’t anything wrong with letting people know there is an advanced script enabled interface to the page, but to do so in such a prominant manner disrupts the flow of the page. Making an assumption that people viewing the page don’t have JavaScript enabled for a specific reason–because they’re using a screen reader or they’ve had problems with JS in the past–also means assuming folks know they’re not going to be able to access the goodies. The message about an advanced interface should be placed in a less prominant place; certainly not between the photo title and the photo.

The positioning of messages such as this doesn’t necessarily imply that the page isn’t degrading gracefully. However, displaying a non-working toolbar (2) does impact on the overall positive effect of the page. If you turn off JavaScript, and try to click any of the buttons above the image, nothing happens. There are few things more disruptive to a page than to provide a button or functional icon that cannot be accessed.

Rather than display non-working buttons or icons, a more graceful approach would be to test to see if JavaScript is enabled at the server, and then output link-based alternatives (with or without associated graphics) for those functions that can be accomplished using more traditional web techniques. From the existing toolbar and from what I know of the API, this means including links to pages that allow a person to send to a group, add to a set, access a page with all sizes, delete the photo, and blog the photo.

The only item that would most likely be dropped is add a note, unless this can be managed using text-based coordinates (showing the photo layed out on a grid and having the person intuit and input where the note box would begin). Even the rotate image capability could be emulated using server-side graphics utilities and a hypertext link.

The Flickr developers could also use existing client-side techniques to test for JavaScript and either display the JS-enabled toolbar or a HTML links-based toolbar. There’s a tag, <noscript> that will display different page contents if JavaScript isn’t enabled. Used in combination with enclosing the script in HTML comments should ensure that the page works equally well in all user agents/browsers.

(Which approach to use–testing at the server or the client–is based on other factors, but both work equally well to ensure the page functions effectively for all readers.)

This testing for whether script is enabled could also be used for the functionality to add tags. Right now with Flickr, if you have a JS-enabled browser, there’s an option associated with the Tag grouping (3) that allows the user to add tags directly in the page. For non-JS user agents, adding a link to a second page for editing tags provides the same option even if the behavior isn’t exactly the same. It is true that this and other options are available lower down in the edit grouping (6); but there’s no harm in putting a link ‘in context’, rather than force the person to have to search around for the capability.

The same applies to the photo navigation (5). The links to the next and previous photos are missing from the non-JS enabled experience, and I’m not quite sure why. the photos above the navigation link are are basically the same type of functionality, and show with both the JS and non-JS enabled browser. Not providing next and prev links to traverse the photo stream seems to be more of an accident than intent — this one isn’t DHTML dependent as far as I can see.

Finally, the last item is the slideshow (4). For those browsers so equipped, the current slideshow remains Flash-enabled. Right now in non-JS browsers, the link to the slideshow does work, but clicking it takes you to an empty page. I am making an assumption that a non-JS enabled slideshow is in the works and that’s why the link is still present. However, if a non-JS enabled slideshow is not in the works, this link should be removed–no need to demonstrate to folks what they’re missing.

(A Javascript-enabled slideshow would also be nice, as an alternative to those who enable script, but don’t allow Flash–though I realize that Flash is most likely better suited to this effect. But it seems a pity to stop when the company is on a DHTML roll.)

All in all, Flickr’s move to DHTML is a good one, and the interface is very clean and intuitive. Even these items mentioned in this post (other than the slideshow) are minor and, if the organization is so inclined, easily corrected. I also appreciate being able to see under the covers, so to speak, and looking through the Flickr JavaScript gave me an idea of how I can mix Flickr’s API into one of my existing DHTML applications. Nice to know that my old skills now have new uses.

(Thanks to Doug and Karl for the heads up on this.)

*Disclaimer: I wrote a book on DHTML in 1998, as well as having written several articles and tutorials on the subject. I’ve also created several DHTML script libraries, and hundreds of DHTML applications and examples.

To the best of my knowledge, I’ve never once created an AJAX library or application.

Categories
Web

Have I mentioned

how much I love brilliantly executed satire?

Ladies and gentlemen, I give you Web 1.0! Please do not let the excitement go to your heads so much that you piss your pants. Or if you, do it in someone else’s garage.

Categories
Technology Weblogging

Security Assured

The security problem I mentioned in the last post does NOT impact on Wordform — huzzah! However, I did some good feedback about other areas of concern, so I will be making some modifications to ensure the application is as secure as possible — including making sure the metadata forms are only called from within the existing administrative interface. Ahem.

Still a lot of work to do, and I’m finishing up a PHP API for hire, so don’t expect release until next week. As soon, as possible–I promise.

Categories
Plants

Haiku of gardens and pillows

I have a secret fetish for gardens and anytime I’m feeling stressed, I spend time out at the Botanical Gardens, Tower Grove, or Shaw. However, when I’m constrained to the house by weather or heat or the need to finish work, I make do with garden weblogs. I’m not sure why, but these weblogs almost invariably sooth and relax me; whether they’re showing photos of a new flower, or talking about pest control–human or insect, doesn’t matter.

It’s easy to find garden weblogs thanks to Sheila Lennon’s list of garden weblogs. But don’t stop there–Sheila also links the most unusual and interesting material weekly, such as this idea for what I can do with Zoë, my cute furball, when she goes on to her rewards.

Cute doesn’t always come furry, though; Bill from Prairie Point has been posting photos of flowers from his garden, including some lovely lantana but I’m more partial to his new armadillo. I don’t know why, but I adore armadillos. Probably make a lousy pillow.

Could make a good lunchbox. Great place to put my BLTs for hiking trips.

Of course BLTs (my favorite sandwich) require tomatoes. Don from Hands in the Dirt and I have been talking about tomatoes and the unfortunate fact that the only tomatoes I have access to here in St. Louis are those I buy in the supermarket. My budget did not allow for the necessary expenditure of pots to start my patio garden, so this year, tomatoes come in baggies.

There’s a haiku in that, I think:

Tomato ripen
framed in plastic sheet
Peel off small label

The Bookish Gardener writes about a Japanese garden in Illinois I hope to visit in the near future, since it’s only about 4 hours away. In the same post, she lists some sites that provide garden photos for people to annotate with haiku, providing several photos of her own for those who indulge in the muse.

I can’t do haiku to save my soul, but I liked the following from the photo/haiku site:

summery garden
there is no answer
sober up

There is something about a summer garden, especially at night that is intoxicating — sober up, indeed. I wouldn’t marry a man for his money, but I might for his garden.

Actually, I could be easily seduced in a garden at night, especially if plied with fresh tomatoes. No, better yet: fresh peaches. You bite into the fruit still warm from the day’s sun, and the juice drips delicately over your soft summer frock. You notice the spots, and pull it down from your shoulder to wash the sticky juice from the light, gauzy fabric; using the water at the fountain that plays oh so softly in the background. As you’re focused on the cool water, flowing like champagne across your fingers, arms slip up from behind and…

Whoa! Where did that come from! Think of tech, Shelley. Think of tech.

I don’t have any fresh garden photos, but I do have some of Zoë, the once and future pillow, helping me make the bed; I’m posting them in case you might be inspired to write some haiku. No prizes for best effort, though.

Well, okay: you’ll get a copy of one of my books, autographed by yours truly, with its own RDF-inspired haiku in the front. You’ll have to pay for shipping, though.

No, you can’t have a Zoë pillow.

Speaking of making your pet into a pillow, Christine at Big Pink Cookie points to a Target illustration of how to perfectly fold a fitted sheet. I was moved to demonstrate my own sheet folding technique as follows:

To better understand the complexity of this fold, you also need to see the reverse side:

If you are so moved in your quest for one of my books with genuine hand lettered, barely legible RDF haiku inside, you may also use the photos of the sheets as inspiration.

When placed into the linen closet in the hallway, said sheets are then shoved towards the back, using brute force, among the bunches of equally folded towels. Luckily, there is no photo of this arrangement, as there is a line drawn between what I will and will not put into a weblog entry–and pictures of my linen closet most assuredly fit into ‘not weblog’.

Speaking of which, Stephanie Klein wrote a post To Blog or Not that began with:

Reasons not to blog:

* Stalkers who love you
* Stalkers who hate you
* Bi-polar stalkers who can’t make up their minds but stalk you just the same

Loved it.

Though not a stalker, over at Feministe, Lauren opened her weblog to a new permanent co-blogger, Jill Filipovic. Even though Jill doesn’t like donuts–how can you not like donuts? I mean woman, Krispy Kremes!–I’m looking forward to reading her posts.

An interesting move of Lauren’s: to bring in a permanent co-blogger for what is, or was, a personal weblog. I couldn’t do it with Burningbird–this weblog is probably the most personal thing I still have in my life. It would be like sharing my toothbrush with another person. Or having a threesome.

On the other hand…

Think of tech, Shelley. Focus on tech.

Gardens on a summer night and hidden bowers scented with lavender and peach…and Zoë the once and future pillow, helping me make the bed with my perfectly folded, flower-accented sheets, as I tell her dirty jokes.

There’s this farmer’s daughter and a traveling weblogger who wants to show her his podcast…

Categories
JavaScript Technology

Ajax the Manly Tech

Seems that O’Reilly has had another one of its invite-only summits, but this time about Ajax. If you’ve missed hearing about Ajax, it’s the web development equivalent of tags (as taxonomy) and metaformats (as semantics). This is part of the technology that makes America, well, America.

A new twist, though: As you can see from the list of attendees, Ajax is the new manly-man technology. Or if you prefer, stud muffin technology.

Hey! Hey! Hey, hey, hey!
Macho, macho tech (macho tech)
I’ve got to be, a macho tech
Macho, macho tech
I’ve got to be a macho! Ow….

Macho, macho tech
I’ve got to be, a macho tech
Macho, macho tech (yeah, yeah)
I’ve got to be a macho!

What’s the tech equivalent of butt cracks and belching? Oh, yeah! XmlHttpRequest and Javascript!

Normally I would be all up in arms about the absolutely abysmal ratio of women to men, except we’re talking about Ajax. What did one statement from this summit say? Ajax is to traditional Web, what IM is to Email. Nice and catchy, except I can think of a better analogy: Ajax is to traditional Web, what Miller Lite is to beer.

Macho, macho tech. I want to be a macho tech…