Let me elaborate …
Most people who regularly use the Drupal.org issue queues will probably (or hopefully) be familiar with Dreditor, Daniel Kudwien's incredibly useful user script which streamlines the UI, helps you to easily review patches and also contains autocompletion for HTML typed in textareas on the site.
That last part would of course also be useful for any other site which lets you enter (possibly filtered) HTML code anywhere, and especially since I started this blog I've really missed this functionality here regularly. I don't like WYSIWYG – I can handle HTML and don't need a eager but incompetent ghostwriter for it; but having to explicitly type the complete syntax is just a drag.
So, seeing as others might also be glad about that, I decided to publish it here. I also got rid of all Drupal.org-specific extensions, to make the code smaller and easier to review.
Also, I added all other HTML tags that could be useful in site content (not
<head> or the like), since Dreditor only contained the ones allowed on Drupal.org. If I missed some, or you'd like some formatted differently (I didn't take the time to format all block elements to include line breaks in the autocompletion), just edit the script's source code yourself, it should be pretty self-explanatory. All the tag completion settings are in
Drupal.dreditor.syntaxAutocomplete.prototype.suggestions.html, and pretty straight-forward.
Since I changed as little as possible, the script still depends on Drupal being installed on the site, so you'd need more adaptions to make it run on others as well. What's more, I think the main problem was that the original Dreditor script is of course meant for Drupal 6 (since that's what Drupal.org runs) – so my changes were probably (I'm only guessing here) "porting" the script to Drupal 7. I'm therefore not sure if it will run on D6 sites anymore. I'm only using it on this site, and haven't got the time to develop this further to make it work on other sites as well.
The Script Itself
So, without further ado, here it is:
(I don't know about other browsers, but if you just click the link in Firefox (and have Greasemonkey active) you'll be immediately prompted to install the script. While I of course guarantee there's nothing fishy with it (as long as I haven't been hacked), you might want to look at the source code first, just to be sure. Good practice on the internet, after all.)
And by the way, the script is of course released under license GPL v2 or later – since it's based on code lying on Drupal.org, there wouldn't be a way around that in any case.
Anyways, I hope this helps a few others. Have fun!
Image credit: screenshot by myself