Skip to the Main Content

Note:These pages make extensive use of the latest XHTML and CSS Standards. They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in Mozilla. My best suggestion (and you will thank me when surfing an ever-increasing number of sites on the web which have been crafted to use the new standards) is to upgrade to the latest version of your browser. If that's not possible, consider moving to the Standards-compliant and open-source Mozilla browser.

October 30, 2004

Trick or Treat

Bush and Kerry Pumpkins

It’s up to you …

Posted by distler at 11:17 PM | Permalink | Post a Comment

October 28, 2004

Roundup

Around the blogs:

  • Matt continues his excellent review of Lattice Gauge Theory, with a post on the classic paper of Lepage and MacKenzie.
  • Luboš blogs about the paper of Itzhaki and McGreevy that I discussed a while ago.
  • Urs is musing abut the n 3 degrees of freedom in the low-energy theory on n coincident M5-branes.
  • Sean writes about his new paper with Jennie Chen, on an attempt to explain why the initial state of the universe was one of low-entropy.

    I haven’t read their paper yet, but the idea is that our universe originated as a thermal fluctuation in an ambient de Sitter space, which then inflated. Personally, I’m sceptical that quantum gravity in (eternal) de Sitter space makes sense. Tout court, while there are certainly metastable de-Sitter-like solutions, I don’t think eternal de Sitter space exists as a solution to String Theory. But an approach like that of Carroll and Chen certainly has the advantage that one is not immediately plunged into the tangled thicket of quantum cosmology. Those discussions never go anywhere because, sooner or later, someone mentions “the wave function of the universe,” the physics-equivalent of Godwin’s Law, and all rational discussion comes to an end.

Posted by distler at 12:31 AM | Permalink | Followups (16)

October 26, 2004

Regime Change

I previously linked to Eminem’s searing new single, Mosh. Well, now the video has been released. Directed by Ian Inaba of Guerilla News Network, it take “shrill” to a whole new level.

Apparently, Mr. Mathers is seriously committed to Get-Out-the-Vote to “disarm this weapon of mass destruction that we call our president… for the present.” Amazing how 4 years of this Administration can turn even a bad-boy Rapper to Civics Lessons, albeit very, very angry ones.

Posted by distler at 11:55 PM | Permalink | Followups (6)

October 24, 2004

Accessible Popups

It’s been a while since I did a post about Web-Design, so here goes.

First, a disclaimer: while I am a proud owner of Joe Clark’s book (one of the two books on Web-Design that I own), that hardly qualifies me an expert on accessibility; you will probably find better advice from more knowledgeable sources elsewhere.

Anyway, for a variety of reason, including the fact that this precipitously cuts down on comment spam, the comment entry form is absent from the individual archive pages of this blog. Rather, it’s on its own dynamically-generated page and you need to follow a link to get to it. And, for reasons both æsthetic and practical, I decided that the comment-entry page should appear in a popup window1. The code I started with looked like this

<a href="..."
onclick="OpenComments(this.href); return false;"
title="Respond to comment by ...">Reply to this</a>

The OpenComments() function creates the popup window. This code degrades gracefully. If the user has Javascript disabled, following the link opens the comment-entry page in the current window.

That’s good, but it could be better. The onclick event handler only applies if the user is navigating with a mouse (or similar pointing device). What about users who, perhaps because of a disability, are using the keyboard (or similar device) for navigation? We can accommodate them, too, by adding an onkeypress event handler2

<a href="..."
onclick="OpenComments(this.href); return false;"
onkeypress="OpenComments(this.href); return false;"
title="Respond to comment by ...">Reply to this</a>

I’ve been using this code for a year and a half, with nary a complaint, but it does conceal a serious usability gotcha3.

Consider the following steps

  1. Click on a “Reply to this” link, opening a comment-entry popup window.
  2. Start filling out the comment-entry form.
  3. Click on the main window, to bring it to the front.
  4. Hit any key.

Since the “Reply to this” link in the main window still had focus, the onkeypress event handler interprets your hitting a key to be a request to reopen the comment-entry popup window. Poof! There goes the comment you were composing.

Oops!

I was certainly aware of the problem but, since none of my commenters ever complained, I never got around to thinking about how to fix it. Perhaps my commenters were too shy to point out the problem or perhaps it simply hasn’t affected them.

One of the endearing features of Luboš Motl is that he is not shy about such matters. When he encountered the bug, he promptly declared my comment system “unusable.” And that, finally, got me off my duff to fix it.

The fix is simple: make sure that, after creating the popup, you drop focus on the link

<a href="..."
onclick="OpenComments(this.href); this.blur(); return false;"
onkeypress="OpenComments(this.href); this.blur(); return false;"
title="Respond to comment by ...">Reply to this</a>

I’m gonna guess that this is almost alway the right thing to do when you use an onkeypress event handler. Not dropping focus will frequently lead to unexpected results.

Another Usability Glitch Remedied

While we’re on the subject of comment popups, there’s another usability issue with MovableType’s comment popups. They are all named “comments

function OpenComments (c) {
    window.open(c,
                    'comments',
                    'width=480,height=480,scrollbars=yes,status=yes');
}

So, you pop open a comment-entry window, start typing a comment, switch to another window, surf for a bit, absent-mindedly click on a comment link, … and wipe out the comment you had been composing.

Oops!

Since MT doesn’t actually use the name to do any fancy window manipulation, let’s make the name unique

function OpenComments (c) {
    window.open(c,
                    Math.round(Math.random()*10000),
                    'width=600,height=480,scrollbars=yes,resizable=yes,status=yes');
}

Now our comment-entry windows won’t stomp on anyone elses, or vice-versa.


1 I know there are some who insist that you must never popup a window, unbidden by the user. This post is not for them. It is a long-established convention, both on the Web and in GUI computer applications generally, that user input is solicited in a popup window or dialog box. I’m just following that convention. The “Don’t break the ‘Back’ button” mantra is of little relevance. In the midst of filling out the form, most users are afraid of hitting the ‘Back’ button, for fear of losing all their work.

To be on the safe side, however, I alway indicate that a link will open in a new (popup) window, by displaying a distinct cursor when you hover over the link.

2 There are “non-device-specific” event handlers which one could try to use in this context. But I could never get them to behave satisfactorily. Perhaps it’s the state of current browser support. In any case, onclick="..." onkeypress="..." covers just about any input device likely to be in use.

3 There are also accessibility problems with this technique, as presented here. Fortunately, those, too, are easily fixed.

Posted by distler at 1:10 AM | Permalink | Followups (6)