2005-05-29

Blogger keep current time on post user script

We all know Greasemonkey is cool. I've created a Blogger user script (0.3.1) which keeps the date and time of your post to the current date and time. Useful when you take some time to write a post or post a draft.

Screenshot

0.3.1

Keeps post and comment options visible all the time. These options disappeared when you previewed your post or switched from "Compose" to "Edit HTML". I hate the toggle option Blogger added some time ago, I want to see what I'm doing.

0.3

The checkbox will not be automatically checked when you edit a comment. Thanks to Improbulus for pointing out the post editing trap.

0.2

The checkbox will now be automatically checked for new and for draft posts.

Note: I've renamed the script. You'll have to uninstall the script called "Blogger enhancements" if you have the old version of the script installed.

0.1

Initial version.

2005-05-17

Pure CSS menu, Firefox 1.0.x and overflow auto

I'm working on a project where I wanted to use a pure CSS menu and overflow: auto float clearing. Due to a bug this can't be done in Firefox 1.0.x when the child ul of the menu overlaps the overflow: auto block. This bug is fixed in the nightly though, and I hope it will be fixed in 1.1 as well.

For my project I'm going to assume that the main content div will always be longer than the floating sidebar so I don't need to clear it.

There is a backup plan.

Update 2005-07-12: found a workaround.

2005-05-11

PNG-24 transparency in IE

I was doing some reading on PNG-24 transparency in IE. You could use a CSS hack to fix all image tags on your page. An ugly hack for an ugly browser:

* html img {
  filter: expression("progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ this.src +"')");
  padding: expression(this.src = 'trans.gif');
}

This still doesn't fix the background images in your style sheet. Too bad that this is the location for decorative images.

Update: You don't want to replace all images on your page. The same hack with PNG check:

* html img {
  filter: expression(this.src.match(/\.png$/i) ? "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ this.src +"')" : this.style.filter);
  padding: expression(this.src = (this.style.filter.match(/\.png/i) ? "trans.gif" : this.src));
}

Update 2: Ok, after IE kept crashing after focusing an input field I decided that it would be better to write a few lines of Javascript. I could use Dean Edwards IE 7, but I only need transparent PNG's at the moment. It has been a fun hack though.