Archive for the ‘Geekery’ Category

Fixing MoinMoin for Firefox 3

I’ve been trying out the Firefox 3 betas lately, and have been impressed. But I’ve noticed a big problem with the WYSIWYG editor in the MoinMoin wiki (which runs a small wiki I have on my home network). When I try to click the “link” button on the toolbar, the ensuing popup window is completely blank, instead of showing a nice dialog box as it should. This also happens with any other popup dialog box in the editor. Since Firefox 3 will likely be the standard browser around the house when the next Ubuntu upgrade comes in April, this poses a problem.

So I decided to find out what was going on, and if there was anything I could do about it. The first round of Googling was not encouraging. MoinMoin uses FCKeditor to provide its WYSIWYG editing capability, but it uses very out-of-date version. The FCKeditor folks did a bunch of fixes for Firefox 3, but MoinMoin hasn’t updated their copy to pick up the changes.  There’s a bug report for the issue on the MoinMoin site, but there appeared to be no activity on fixing it. Attempting to simply replace MoinMoin’s copy of FCKeditor with the new version failed miserably; there was a JavaScript alert dialog on practically every keystroke, and with little knowledge of the underlying code, there was no way I could figure out the problem.

After doing some more digging into what the exact Firefox 3 incompatibility was, I found that Firefox has an issue with a window opened with the JavaScript flag “modal=yes”. Further, the discussion in the FCKeditor bug tracker pointed me to a patch that fixed the problem. Unfortunately, there has been quite a bit of refactoring in the codebase, and I couldn’t simply apply the patch to the copy MoinMoin has (the file mentioned doesn’t even exist in the MoinMoin version); I had to backport it. After looking around the directory tree in /usr/share/moin/htdocs/applets/FCKeditor, I was able to find a similar spot in the code, and make the change. Here are the steps:

  1. Fire up your favorite editor and open $MOIN_HOME/wiki/applets/FCKeditor/editor/js/fckeditorcode_gecko_2.js. If you’ve installed MoinMoin from an Ubuntu package, $MOIN_HOME/wiki is /usr/share/moin/htdocs.
  2. Search on the string modal=yes. It should be on a line that looks something like this:
    var J="location=no, menubar=no, toolbar=no, dependent=yes,
    dialog=yes, minimizable=no, modal=yes, alwaysRaised=yes"+",
    resizable="+(G?'yes':'no')+", width="+D+", height="+E+", top="+H+", left="+I;
  3. Remove the “modal=yes,” (include the comma).
  4. Clear your browser cache.

After that, I was able to edit my MoinMoin wiki with all the Firefox 3 goodness.

Update 3/21: The MoinMoin developers have checked in the fix, so this won’t be a problem in the next version (1.6.2) of MoinMoin!

Update 4/7: With the fix, the link editor now inserts invalid links.  We’re not done yet.


Power Searching for Thunderbird

The volume of my work email has gotten so huge that I no longer manually tag messages or add them to folders; it’s just too time-consuming, and dragging things to a simple “archive” folder when I’m done is about the only thing from having thousands of message in my Inbox. I’ve been relying on the built-in search capability of Thunderbird (for one account) and Outlook (for the other) to find things. While mostly serviceable, it could be much better, especially since I haven’t mastered the art of finding The Perfect Search Term. Via Lifehacker, I found a new extension for Thunderbird called “Seek” that adds some very interesting capabilities. I watched the screencast, and it looks promising. The Mozilla Messaging people might want to look at this sort of thing to help differentiate Thunderbird from the pack (not just Outlook, but also various webmail services). I look forward to trying this extension out soon.

Linky Linky

A week or two ago, I was having a conversation about the value of having WYSIWYG (ish) editors in wiki applications. One of the arguments against them was the risk of the users attempting to treat writing in a wiki the same way they approach a word processor, and becoming frustrated when they can’t (for example) make that heading 14 point Arial. (The absurdity of doing any serious writing without separating content from form is a rant for another time.) Forcing users to use wiki markup is presented as a way to tell inexperienced users hey, this is different from Word, and encourage them to approach writing differently.

One of the ways that writing in a wiki is different from writing in a word processor is that wiki pages are often expected to link elsewhere. Look at the average Wikipedia page and there will be several links per paragraph. Many people used to word processors, I’m told, don’t think to add links in their text, which struck me as odd.

But I’m accustomed to “linked writing” — I often put links in email, blog posts, and even in an offline journal composed in a word processor. Maybe it’s because I’ve been writing online for almost 15 years (yes, I had a web page in the Early Days), and the idea of adding links just seems natural. Or maybe I’m just a geek.

Life with the Dell Inspiron 1420n

Soon after it was unveiled, I ordered the 5.5 pound Dell Inspiron 1420n pre-installed with Ubuntu. It took almost three weeks to get here, probably owing to Dell’s recent supply chain problems, but luckily there were no further delays. I had heard some real horror stories about waiting much longer, and that would have really soured me on Dell, despite their new partnership with Ubuntu.

This is my fourth laptop that runs Linux, and as you’d expect, it was by far the best experience. There were some hiccups here and there, but in general things just work. That’s a very nice change from what I’ve become used to (especially with my previous HP laptop). Although I’ve enjoyed messing around to get things to work in the past, it’s not as much fun as it used to be, and my time for tinkering is much more limited these days.

Here is what I’ve noticed so far:

  • Compared to the behemoth HP, this thing is pretty darn light. Not as light as those dainty PowerBooks, but I believe that taking this laptop through an airport will be a much nicer experience.
  • Five hours of battery life. No, really.
  • The wireless would have worked out of the box had I remembered to add the new laptop to my wireless access point’s MAC filter list. Once I fixed that, it was smooth sailing. NetworkManager is really sweet when it works.
  • It took some coaxing to get the touchpad scrolling to work properly. Fortunately, it was well-documented.
  • During the first week, I had a few problems coming out of suspend where I had to forcibly power down. But I haven’t had any since, and I haven’t had any crashes with Hibernation.
  • The volume control buttons just work. As do the stop/play/forward/backward buttons, at least with Rhythmbox and Totem.
  • After resuming, the volume panel applet will crash. Fortunately, a little popup asks if you’d like to restart it when this happens. A bit annoying, but definitely manageable.
  • If you have multiple users’ sessions running at once and you suspend/hibernate, the touchpad may not work for particular users, or for any users. I haven’t figured out the exact behavior yet.

So far, so good. I’m very happy with this laptop.  Update: Starry Hope Productions  looked at the 1420n here; they’ve exercised a lot more things than I have (3D video, for example), but the review is mostly positive.  Fortunately, I have had a different experience with hibernate and suspend.

Thunderbird Discovery

For the longest time, I’ve been puzzled by the fonts I’d see in certain UTF-8 encoded HTML messages in Thunderbird. If the message didn’t specify fonts itself, i.e. the default font was to be used, the message would always display in DejaVu Serif, no matter how I set the default font in Thunderbird’s preferences. Because of this, I had been using DejaVu Serif as my default font. It’s a decent looking font, but it’s a bit on the large side, so I was forced to set font size smaller than I’d like.

The font selection dialog in the Preferences has an language/encoding selection drop down, which shows “Western” when you bring it up. Yesterday I had the bright idea to check if there was a selection for UTF-8/Unicode. There wasn’t, but there was a choice for “Other Languages.” So I tried changing the fonts for that, and the UTF-8 messages were displayed with that font. Problem solved.

But it would be nice if there was a way to set a default font for all languages/encodings.