Some assembly required

This blog is about unimplemented ideas. At least until they get ticked off; I suppose a few eventually will have implementations too, but fresh posts never will. Because that's the primary purpose of this blog: keeping track of ideas I'd like to dive into, or problems I'd like to see solved. Feel free to join me in implementing, or further developing these ideas. I don't mind working solo, but it's a whole lot more fun working in concert!

Tuesday, November 15, 2005

Fixing Blogger's post editor's keybindings

The Blogger post editor has rather nice Ctrl+B / Ctrl+I key bindings for making the current selection bold / italic. Unfortunately they generate <span style="font-weight:bold;"> and <span style="font-style:italic;"> abhorrations instead of proper HTML <b> and <i>tags. Let's make a Greasemonkey script to fix that, shall we?

5 Comments:

Blogger Singpolyma said...

I would point out that the blogger post editor buttons themselves generate the same span tags that the shortcut keys do.

 
Blogger Singpolyma said...

Would you happen to know of a regexps in javascript tutorial you could refer me to? I seem to have mostly got the expressions themselves matching, but i'd like to know how to include elements that matched the wildcards i the replacement string...

 
Blogger Johan Sundström said...

Interesting; I never actually tried them. :-) That might mean... ...yes. It's dead simple fixing it. Using this scriptlet, for instance: javascript:Textbar.Bold=function(){ this.wrapSelection('<b>','</b>'); };Textbar.Italic=function(){ this.wrapSelection('<i>','</i>'); };void 0.

Thanks. :-) Regarding regexps, I'm not quite sure about good tutorials, but perhaps this one is useful? I very warmly recommend David Flanagan's Javascript: the Definitive Guide, otherwise. It's not online, but it's great, and that covers the regexp bits too. All except the kitchen sink, which in this case would be XMLHttpRequest.

 
Blogger Singpolyma said...

The shortcut keys are tied directly to the buttons? Well, that would definately make it simpler :)

Thanks for the info regarding the regexps too :)

 
Blogger Hans Persson said...

I'd say that the Blogger post editor has horrible key bindings that collide with standard Emacs key bindings, and that's evil.

 

Post a Comment ...in a popup window

Backlinks:

Create a Link

« Home