23 December 2006

Keep Current Date/Time On Posts #

Update (05/04): Thanks to Phydeaux3 for stepping in. Some people were complaining on Consuming Experience about the script breaking the post editor buttons. These have now been fixed.

Update: Thanks to Improbulus for reminding me about this. I have now fixed the script to auto check the box when you’re editing unpublished drafts. I don’t know how stable my method is though, so if it doesn’t work for you, or breaks under any condtition, please let me know!

This script breaks Blogger’s inbuilt Spell–check. I think it has something to do with the repeating check for the time. I’ll look more into it and try and come up with a fix. In the meantime, this will be a good opportunity to try out Firefox’s wonderful spell check :)

Blogger Beta doesn’t fix this still, so I had to take things into my own hands! I missed the functionality of the original by Jasper, which broke in the new post editor. Hence, I have redone it to do the same thing, but now for Beta. Except a few known bugs, it works quite well! :)

For Beta!

It works the same way. A little toggle checkbox will show up right at the bottom of the post options box. It’ll be auto–checked for you if you’re starting a new post. However, I couldn’t figure out how to check for difference between editing a published post and an unpublished post, hence couldn’t create conditions to auto–check the checkbox. It’s a minor glitch which shouldn’t be a problem for most people. Just check it, and it’ll update your date and time! :)

As an added feature, it also keeps your post options open for you by default, as compared to the Blogger default of having to click the ‘Post Options’ link :)

I'm not very sure if the date formats differ depending on what you set as your time zone. The favonian format is MM/DD and rest of us follow a DD/MM format. If you see a discrepancy, please let me know, and I’ll make the necessary changes! As usual, any bugs or glitches can be reported here! I’ll get back to you as soon as I can!

Toodles :)

User script

Keep Current Date/Time on posts
All my userscripts


Improbulus said...

Fab Aditya, thank you so much!

One request - for me the main issue is that I do lots of draft posts and save them to carry on with another day. So it's most useful for me to have the box auto-checked on draft posts, to make sure they've got the time of publishing not initial creation, rather than to have it autochecked on a new post I'm publishing immediately. Because I often do forget to check the box after creating a new post. And I've noticed that when you check the box on a draft post and save it, then open the draft, it's become unchecked. Is there any way please to tweak it keep the box always checked, except when editing an already-published post?

Jasper had I think figured out the differences between published & unpublished posts so that the box wouldn't be automatically checked when you were editing a published one. My Javascript knowledge is pretty minimal but could you figure it out from his code? Or is New Blogger working so differently that that is no longer possible?


Aditya said...

I had thought about that little glitch when I was going to release this, but I had my exams coming up (college can be hard!), so I didn't pay much attention to it. I know what you mean with the drafts habit.

Jasper didn't figure out the difference, but I figured out what Jasper did. Unfortunately, that script will not work for the new Blogger, but I could use the same concept and rework my script.

I'll release the reworked script soon enough! Thanks for dropping by :)

Improbulus said...

Thanks very much for the reworking Aditya! Hope your exams went OK?

Have tried the new version and it seems to work great, but of course will let you know if anything crops up on the date format front.


Kato said...

I found your script the other day... I was hoping someone would write this for the new blogger. Seems to work well except for one problem: when this script it active, it breaks Blogger's spell-check (the spell check pops up an error box). Just thought I'd let you know.

Improbulus said...

Thanks for uploading the updated version that cures the problem with the new version of Greasemonkey, Aditya.

Kirk's fix for the Blogger toolbar problem has also sorted out the spellcheck issue, on my system anyway. Two birds with one stone!

Robert said...

I like your script. There is one draw back. It inserts the date in US format. Since my bloggers settings use the Dutch format (e.g. dd-mm-yy instead of mm/dd/yy) Blogger will show an error re. illegal date formatting.

Aditya said...

I've fixed it :) I think it's a fixed format now, to DD/MM/YYYY. I've changed the script to that.