Quicktags Update

Note: The seperate Quicktags toolbar is not supported. Please use the full toolbox script, or hack it any way you like. The remainder of this post remains for posterity only. • I’ve combined my two quicktags scripts into one, it now has an (optional) argument to the edToolbar(); function. If you pass it the argument of ‘Link’, then it will render the toolbar as a series of <a href="javascript:..."> links, rather than the buttons that it defaults to. You can get it from here. Or use the code <script type="text/javascript" src="http://schinckel.net/images/quicktags.jpg> </script> <script type="text/javascript">edToolbar(); </script> in your page, where you want the toolbar to appear, and <script type="text/javascript"> edCanvas = document.getElementById('comment'); </script> after the TextBox you are using to have comments in (make sure it’s id is comment, or change the second script.

Instant Preview in Mozilla Browsers

I’ve noticed that the Preview code that both the WordPress Dash, and my Comment Preview uses (okay, I stole it from there!) is really slow - read as unusable in Instant Preview mode - under Mozilla browsers (on Mac, at least). There is a noticeable lag between typing and the characters appearing on the screen, in the Text Box, let alone in the Preview Box. I wonder if it would be possible to rewrite the script so that it wasn’t onkeyup, but every 5 seconds, or something like that. Or possibly make it so it doesn’t redraw the whole lot? Perhaps the best would be that it only redraws when keys have been pressed, but not in the last 3 seconds. I’m not sure if any of these can actually be done!

Gravatar Weirdness

I’ve come across a couple of issues with Gravatars recently: they don’t always show. And the weird bit is if I play around with the &size=xx part, different gravatars work. And the ones that did display no longer do…

<img src="http://www.gravatar.com/avatar.php?gravatar_id=ff3502050b3b1b00cb6c810d5c41ffc9&size=48"alt="" /><img src="http://www.gravatar.com/avatar.php?gravatar_id=ff3502050b3b1b00cb6c810d5c41ffc9&size=49"alt="" />
<img src="http://www.gravatar.com/avatar.php?gravatar_id=833bfbcc9940cfcf0af6def751c23b05&size=34" alt="" /><img src="http://www.gravatar.com/avatar.php?gravatar_id=833bfbcc9940cfcf0af6def751c23b05&size=39" alt="" />
<img src="http://www.gravatar.com/avatar.php?gravatar_id=faee9dd9ddfedbbc82b61aaa6ee1e1fb&size=50" alt="" /><img src="http://www.gravatar.com/avatar.php?gravatar_id=faee9dd9ddfedbbc82b61aaa6ee1e1fb&size=45" alt="" />

Strange. And it’s not limited to my site, either, I noticed it on the Official Gravatar Forums. I assume that means it might be fixed soon.

Edit: That’s crap. The images in the bottom two pairs used to have one that worked, now they both appear grey!

**Edit 2: **Now both of the middle ones, and one of the bottom ones are all working!

Homer Loves Homer

Saw this on Drunkenblog, just had to snaffle and post it here. Homer loves Homer

Choosy Post Display

Someone on the Blogsome Forums wanted to be able to have the main page only display posts from a certain category. To do this, edit your post.html file, and add the following right at the start: {capture name=in_cat}{in_category category='1'}{/capture} {if $smarty.server.REQUEST_URI != '/' || $smarty.capture.in_cat == '1'} Then, right at the end, add {/if} If you are wanting a category other than the default one to be the only one shown on your front page, look up the category id in the dash, and replace the ‘1’ in the first line with this number. This could easily be extended to get a sticky-post setup. I’ll do that later tonight, when I’m drunk. Just to make it a challenge. Happy 30th Sam.

Autofill Acronyms in Comments

I created (or rather modified) some code to allow for quicktags, so commenters can have bold, italic and code text, amongst other features. I also added in abbr and acronym tags, just for fun. Today, I made this even more kick-ass. If you select some text, and click on abbr or acronym, and there is a valid acronym in the list in the script, it autofills the definition in the dialog for you. I got rather excited after doing this. But, I’m a nerd. • Note: The seperate Quicktags toolbar is not supported. Please use the full toolbox script, or hack it any way you like. The remainder of this post remains for posterity only. • Anyway, you can get the button version here, and the CSS link version here. Remember to Right-click and download, rather than just clicking on them.

Comment Preview Fix

One thing is missing from my Comment Preview script: when you click on the link button you get a window to enter the link URI, I need to implement the equivalent for the acronym/abbr. Actually, I can probably autofill most of the acronyms. That would be cool. And maybe get the code added back into the one that is used for the WordPress Dash.

Automation of XHTML Cleanup

I use SubEthaEdit all of the time, and the feature I like just about most is the Copy As XHTML ⇧⌘C. This will create some nice marked up text that accurately represents what SubEthaEdit looks like - it takes your current syntax styling layout and creates is as XHTML. There are a couple of issues, at least with Blogsome. Firstly, for some reason Blogsome needs all style tags inside the block to use ‘, not “. I think it might be to do with the fact it is a <pre> block. I did notice it was screwing with some double-quotes on another script I was posting. My other hassle is that the syntax highlighting isn’t quite right for AppleScript: it doesn’t take into account terms used from applications, so sometimes the wrong colour appear. I will write an Automator action that grabs the XHTML from SubEthaEdit, replaces " with ‘, and pastes it into the current active text box, I think. I also started using Convert Script To Markup Code - don’t recall where I found this, but it does a much better job of marking up the text from Script Editor, and everything looks much nicer.

Gravatars not loading

I’ve noticed some commenters Gravatars are not loading, including mine. Some of them are, but I don’t know why. I haven’t been able to log into Gravatar.com to see what’s going on. Oh, and Jake, I think there’s a problem with document.commentform on your site, and I cannot submit a comment.

GPGMail causes Mail.app to Crash

Not that I get a lot of PGP encrypted email, but I had GPGMail installed, and I upgraded to Tiger (I missed the chance to do an Archive & Install, apparently - they hid that a bit too well). Mail complained on startup that GPGMail wouldn’t run, but apparently it still was trying to render the emails through it, as every email I tried to view caused Mail.app to crash. A cursory inspection of the Crash Report told me this was the cause. Disabling it fixed it alright.