Cool Comments have arrived!
I got the idea the cool comments you now see from Joe Hewitt. It wasn't too bad to implement, but there's still lots of quirks. Many of which you can see. The hardest part was figuring to implement XML loading in Mozilla. Joe is using the following method:
gMediaDoc = document.implementation.createDocument("", "media", null); gMediaDoc.addEventListener("load", onMediaLoaded, false); gMediaDoc.load(aURL);
Which works great when the file is on a filesystem, with a .xml extension. I couldn't get Roller to accept a .xml for my comment page's "link" attribute, so I had to resort to a lot of web research, and I came up with the following:
gMediaDoc = document.implementation.createDocument("", "", null); var xmlHttp = new XMLHttpRequest(); xmlHttp.overrideMimeType("text/xml"); xmlHttp.open("GET", aURL, false); xmlHttp.send(null); gMediaDoc.loadXML(xmlHttp.responseXML.xml); onMediaLoaded();
The loadXML method is provided by Erik Arvidsson's XML Extras. Thanks Erik! There's quite a bit of work to enable inline comments, but I promise to document a how to before it's released to the general public. Here's some problems I hope to fix before that.
- Alignment - it'd be nice if I could make the div in-line, so I could put a comments link as before - with other text on either side of it. Either that, or make it inherit the parent's text-alignment. It'd be cool if the pictures below had the comments link right below them.
- URL Prefix - I suppose I could pass in the context + username to solve this one. While it was working normally for me to use $userName/comments for the URL while developing this, I had to use "/page/rd/comments" on this site. I think it's something to do with the <base href="" /> being set.
- Loading - it takes a few seconds for the templates to load. If you click on the comments link before they've loaded, you'll get a JavaScript error, and be routed to the default comments page. The window's status bar will say "Done initializing comment templates..." when comments are ready for action.
- No Preview. I don't think this is a big deal, but it probably wouldn't be too hard to add.
- Missing label from "Remember Me" checkbox. I'm not sure why this is happening, but the text is there!
That's all the enhancements I can think of for now. Tell me what you think and feel free to give these suckers a test drive.
Update: Strange - I'm seeing some errors that I didn't earlier. In IE6/WinXP, I get a JavaScript error ["Access is Denied" error (Line 149, Char 5)]. Also, I can see the "Remember Information" label here, whereas I couldn't on the machine I implemented this on (Win2K/IE6). Strangely enough, Julie's machine is Windows 2000/IE6, and these errors occur on hers as well. Looks like I have a lot more work to do!
Posted by Matt Raible on April 29, 2003 at 12:23 AM MDT #
Posted by Anonymous on April 29, 2003 at 01:04 AM MDT #
Posted by Paul Rivers on April 29, 2003 at 02:14 AM MDT #
Posted by Keith Sader on April 29, 2003 at 02:38 AM MDT #
Posted by Matt Raible on April 29, 2003 at 03:17 AM MDT #
Posted by Dave Johnson on April 29, 2003 at 04:31 AM MDT #
Posted by Matt Raible on April 29, 2003 at 05:27 AM MDT #
Posted by 219.88.91.45 on December 11, 2004 at 08:18 PM MST #
Posted by dfg on January 12, 2005 at 11:52 AM MST #
Posted by amy on January 21, 2005 at 07:51 AM MST #
Posted by carlos on April 16, 2005 at 02:16 PM MDT #
Posted by Rajneesh Garg on November 14, 2005 at 01:11 PM MST #
Posted by Rajneesh Garg on November 14, 2005 at 01:12 PM MST #