Archive for March, 2008|Monthly archive page
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:
- 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.
- 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;
- Remove the “modal=yes,” (include the comma).
- 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.
Emacs and the Modern Desktop
I’ve been using GNU Emacs, an over-featured text editor for Unix-like systems, off and on since 1989. It has a somewhat primitive interface (at least for those who, like me, are accustomed to a mouse and menu-driven interface), and several quirks that are indicative of its pre-Mac and pre-Windows origin (for example, to find a string in a file, you use CTRL+S for “search” instead of CTRL+F for “find”, and the cursor is mysteriously called “point” in all the documentation). But it can’t be beat for the breadth of file editing tasks it handles well; from DNS Zone Files to Apache configuration files to shell scripts to Windows INI files to XML to source code for just about any programming language you care to name (even Ada!), it can syntax-highlight them all, and in many cases provide additional commands that make editing easier.
Its versatility and power – not to mention its essential “Free as in Speech” nature – has allowed it to survive over the years and function well as both a terminal application and a GUI application on many different platforms. But as the graphical capabilities of Linux workstations have evolved, especially in the last five years or so, Emacs hasn’t kept up. It has always been the odd window out on my desktop, with jagged fonts worthy of a early-to-mid-90’s Sun workstation and a Motif-ish scrollbar to match.
Fortunately, a few changes have been made on the “bleeding edge” that allows Emacs to use the same text rendering techniques that most other Linux desktop applications have been using for years, and a fellow named Alexandre Vassalotti has made Ubuntu packages of Emacs with this new feature, making installation a snap.
One problem I had with this tutorial is that he relies on setting the default font for text using X Resources. Since the new “pretty Emacs” is an alpha version, there’s always the possibility of something not working correctly, and so I keep both the new version and a “stable” version installed. Unfortunately, the older version uses a different naming convention for fonts, and since the X Resource Database setting affects both versions, his configuration suggestion doesn’t work for me.
I set the default font programmatically through the initialization file (“.emacs”), which is written in a programming language called Emacs Lisp. I accomplish this by setting an element in a List data structure called “default-frame-alist”, and I needed to find a way to set that element based on what version of Emacs was running. In Java, this would look something like:
AlistElement fontspec;
if(Emacs.getVersion().indexOf(“23”) > 0)
{
// Use new-style font name
fontspec = new AlistElement(“font”, “Liberation Mono-10”);
}
else
{
fontspec = new AlistElement(“font”, “7x13”);
}
defaultFontAlist.add(fontspec);
After shaking off some cobwebs (if you use Emacs enough to want to customize it, you can’t help but pick up a little bit of Lisp along the way), I figured out the the “if/else” part, but how to manipulate the alist (which is called an “Association List,” similar to a Java Map) was a bit tougher. But I stumbled upon someone who had a similar problem of adding things to an alist, and he suggested using the lisp push function. So my final Lisp code looked like this:
(if (not (eq (string-match "23" (emacs-version)) nil))
(push '(font . "Liberation Mono-8") default-frame-alist)
(push '(font . "7x13") default-frame-alist))
The Shrinking Bedtime Routine
It’s been nearly a year since we’ve instituted a steady bedtime routine with our 17-month old son, in a desperate attempt to get him to sleep through the night. (Luckily, he’s been doing that for about five months now, starting right after he turned a year old.) Over time, it’s become the highlight of my day, especially on non-telecommuting days when I don’t get a lot of time with him. The routine goes like this:
-
Bathtime
-
Read On the Day You Were Born, by Debra Frasier
-
Read Goodnight Moon, by Margaret Wise Brown (“Pictures by Clement Hurd”)
-
Play the 13-song, 57 minute “Baby Shutdown Mix”, sing along with it, and put him in the crib when he’s nearly asleep.
When we first started, most nights I’d put him down towards the very end of the mix; then I started putting him on a bed after the fifth song, stop singing, and cuddle him until he fell asleep. A few months later, and it was the third song (“Lullaby” by the Dixie Chicks). And then directly into the crib after the third song, regardless of whether he was anywhere near being asleep.
Recently, I’ve cut out he second song, and I think I might have to cut it down to just “Lullaby” very soon. Through most of the singing, he’s getting quite talky and wiggly, and last night he was saying “nigh nigh, nigh nigh” well before it was time put him down, which I think roughly translates to “that’s nice, Dad, put me down already.” I know that this will have to end sometime; I don’t think it would be healthy if we were still doing this when he’s 16. I just wasn’t expecting it to be so soon.
Spam of the Day
It’s amazing people fall for things like this:
From: "Yahoo Customer Care" <security-center@yahoo.com> Reply-To: <ycustomercare40@yahoo.com> Date: Fri, 7 Mar 2008 19:36:56 +0100 Subject: Yahoo Warning!!! Unused Account Removal Confirm Your Account !!! The All-New Yahoo! You Must Be A Part Of It To Avoid Your Yahoo Account To Be Closed The All-New Yahoo! Mail Beta Is: * Faster: Fewer steps to get things done. * Easier: Drag & drop organization. * Effortless: Automatically checks email for you. Yahoo Image> With the all-new Yahoo! Mail Beta you can Fill the Informations Below To Verify Your Account ,PleaseThis For Your Benefit. Read Below To Understand More. Yahoo User Due to the congestion in all Yahoo users and removal of all unused Yahoo Accounts, Yahoo would be shutting down all unused Accounts, You will have to confirm your E-mail by filling out your Login Information below after clicking the reply button, or your account will be suspended within 24 hours for security reasons. * Username: ................................. * Password: ................................... * Date of Birth: ................................ * Country Or Territory: ................................. After following the instructions in the sheet, your account will not be interrupted and will continue as normal. Thanks for your attention to this request. We apologize for any inconveniences. Warning!!! Account owner that refuses to update his/her account after two weeks of receiving this warning will lose his or her account permanently. Filter Yahoo! Mail No virus found in this outgoing message Checked by PC Tools AntiVirus (4.0.0.25 - 10.061.003). http://www.pctools.com/free-antivirus/
They don’t even bother with giving you a nice HTML form so they can steal your password; apparently they expect you to dither around with formatting a reply. And then there’s the broken English, which makes it even more obvious.
Ironically enough, this got past both past both Yahoo’s and Thunderbird’s spam filters. Maybe it was for my entertainment.
Comments (2)
Leave a Comment
Leave a Comment



