Archive for October, 2005

CSS text wrapping including liine breaks

Friday, October 21st, 2005

I have an html pre tag that I has text in it. I want the text to wrap if it extends past the bound of the box its in and I also want the ability to use linebreaks within the text. Try this out for yourself and you’ll see that it’s one or the other. Normal line breaks won’t work when using wrapping and normal html br tags won’t work either. So what’s the solution? I found this email which describes a css hack.

.wordwrap {
white-space: pre-wrap; /* css-3 should we be so lucky… */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 ?? */
white-space: -o-pre-wrap; /* Opera 7 ?? */
word-wrap: break-word; /* Internet Explorer 5.5+ */
_white-space: pre; /* IE only hack to re-specify in addition to
word-wrap */
}

Firefox delicious feeds (Feedlist)

Thursday, October 20th, 2005

I’ve recently run into the problem of syncing up my bookmarks. Sure there’s delicious but what about my RSS feeds I have bookmarked? I need a way to get my bookmarks from delicious and then agregate my bookmarked RSS feeds that are tagged with the “feed” tag. After a long search for something capable of such a task I found Bottomfeeder. I really was looking for something integrated into Firefox though. Then I pieced together a technique for doing just what I wanted.

I’ve been using a Firefox extension called Sage for feed reading for a few months. It cycles through live bookmarks you have in a certain bookmark folder. I found an extension called Foxylicious which will sync your delicious bookmarks to your local Firefox bookmarks. Then I point Sage to look at the “feeds” bookmark folder and do it’s thing.

Now I can bookmark my RSS feeds on delicious while I’m at work and go home and have the same feeds already to go for me. There’s some problems with this technique of course. First off, when Foxylicious syncs my bookmarks from delicious it deletes the local copy of the bookmarks and creates a new one. Sage is pointed to the deleted copy of the feeds folder so it doesn’t work. I have to go into Sage and tell it to use the new feeds folder instead.

Speaking in Tongues

Thursday, October 6th, 2005

techno.blog(”Dion”) has a hillarious description of Rails which I though I’d share here.

Ted thinks that Ruby is a love affair.

He is close. I can see how it is like trading in your middle-age wife for a new younger model. However, I don’t think that in this scenario many are going back to their original partners.

I came into this game with no framework experience so I feel I have a pretty objective stance. I must say that I’m a minx and get around but I do have my favorites. Ruby reminds me of Python and the two of them seem like sisters. Those two girls really know how to treat a man. Now take those two fat cow sisters, Java and C#. All favorites aside, sometimes you have to take one for the team.

Trac Wiki Comments

Thursday, October 6th, 2005

I really enjoy hacking Trac. I’ve just recently added commenting functionality to Trac wiki pages. I have two tabs at the top of every wiki page which I added in the wiki.cs template. They are similar to how Wikipedia does it. At the bottom of ever wiki page I have a “Add Comment” buttom which just triggers a JavaScript function that toggles the display of a hidden comment form and hides the original “Add Comment” button using onClick. You type your comment in and hit the newly displayed “Submit Comment” button which does something similar to the “Add to DS” button I added previously. It adds the comment along with the date and username to the Comments page. Here’s the Python code:


if addComment:
            self.perm.assert_permission (perm.WIKI_MODIFY)
            self.req.hdf.setValue('wiki.action', 'addComment')
            self.CommentPage = WikiPage(self.page.name + "Comments", version, self.perm, self.db)

            if self.CommentPage.text.startswith("describe"):
               self.CommentPage.set_content("\n== Comments ==\n\n" + " * " +
                             datetime.datetime.now().strftime("(%d/%m/%Y %H:%M:%S)") +
                             " " + author + " - " + comment + "\n")
            else:
               self.CommentPage.set_content(self.CommentPage.text + " * " +
                              datetime.datetime.now().strftime("(%d/%m/%Y %H:%M:%S)") +
                              " " + author + " - " + comment + "\n")
            self.CommentPage.commit(author, comment, self.req.remote_addr)
            self.req.redirect(self.env.href.wiki(self.page.name + "Comments"))

I’m not 100% sure this will work as is because of the line wrapping I had to do to make this post display nicely.