20030428 Monday April 28, 2003

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 in Roller at Apr 28 2003, 06:22:43 PM MDT 13 Comments

Comments:

Let me be the first to try these suckers out!

Posted by Matt Raible on April 28, 2003 at 06:23 PM MDT #

just checking !

Posted by Anonymous on April 28, 2003 at 07:04 PM MDT #

I know I'm probably just a little slow here, but why do you have to get or create an xml document? Why don't you just embed the comment in the <div> tag?

Posted by Paul Rivers on April 28, 2003 at 08:14 PM MDT #

That's pretty darn cool. When does it go into CVS?

Posted by Keith Sader on April 28, 2003 at 08:38 PM MDT #

Paul, I absolutely agree with you that this could be done a different way. However, it was easiest for me to simply mimic what Joe already did - rather than try something new. Please feel free to submit (or demonstrate) a different or improved way of doing this same thing.

Posted by Matt Raible on April 28, 2003 at 09:17 PM MDT #

Awesome work Matt! Sounds like we need to allow Roller user to set the content type for page templates. One question: does any of this stuff rely on features not found in Roller 0.9.7.1?

Posted by Dave Johnson on April 28, 2003 at 10:31 PM MDT #

I added documentation to the wiki and also committed all these changes to CVS. This stuff <em>does</em> rely on features outside of 0.9.7.1 - if you count the new macros I just committed.

Posted by Matt Raible on April 28, 2003 at 11:27 PM MDT #

test

Posted by 219.88.91.45 on December 11, 2004 at 01:18 PM MST #

dfg

Posted by dfg on January 12, 2005 at 04:52 AM MST #

Had to give this a test.

Posted by amy on January 21, 2005 at 12:51 AM MST #

test

Posted by carlos on April 16, 2005 at 08:16 AM MDT #

a good job done :)

Posted by Rajneesh Garg on November 14, 2005 at 06:11 AM MST #

When I submitted the form, the result was a blank page. I press browser's (IE 6 on W2k3 Server machine)refresh button, and then I could see it back.

Posted by Rajneesh Garg on November 14, 2005 at 06:12 AM MST #

Post a Comment:
  • HTML Syntax: Allowed
Click me to subscribe
Matt Raible is a Web Architect who enjoys developing applications with open source technologies. Contact me for rates.
« December 2008
SunMonTueWedThuFriSat
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
   
       
Today

Recent Entries

Tag Cloud