Monday, February 23, 2009

Blog editor development diary thing

Okay, so my initial fumblings with the blog editor have failed. But I've learnt some important and interesting things along the way, which should make what I'm trying to do next much better. It means more work for me, but it should make it less like a slapped-together, hacked about bit of sample code and more like something that I'm happy to share.


Having spent a bit of time over the weekend looking at editor components, I've decide I'm going to use NicEdit as the basis for things. Although not as mature as other editor components like FCKeditor, Xinha, TinyMCE et al, it's small, fast and has a couple of neat features that I can use further along the development. Firstly, it has a plugin in development that produces XHTML code (something important to me - I want <em> and <strong> tags, not styled <span> tags) - it's not perfect, and the other editors have better ones, but it's incredibly lean and should be good enough. Secondly, and more importantly in the long run, it isn't restricted to replacing textarea boxes with its own textarea-like surface. It can make any <div> editable (or <span> or <p>), as you can see in this demo, and that would be ideal for snagging the CSS from a site so that the text you're editing appears exactly as it will when it's published. Real WYSIWYG, just like Live Writer does.


So, it's not quite back to the drawing board, because I've got an actual idea of how to develop things now (as opposed to just hacking away with a code machete).


The other thing I need to do is try and figure out how to get an AIR app to provide a valid API key to Google - but first things first, this is going to be an online editor. I'll tackle that further along the line.

Thursday, February 19, 2009

A first test of my blog editor

A little project-ette begins

I've moaned on and on about the lack of decent blog editing software on Linux. Having used Windows Live Writer, I know how good the best is, and the Linux offerings don't even come close. Oh, for a cross-platform blog editor...

Well, it's about time I ponied up and did something. Seeing as I live and work in a flurry of Adobe multimedia technology, I'm going to stick to technology I know - a bit. What I'm going to attempt to do is get Google's sample application, blog.press, working in Adobe AIR. And to add some spice to the top, try and replace the plain text box (that I'm currently typing this into) with something a bit sexier, like FCKEditor or TinyMCE or something.

Note that I say "attempt", "try" and "know a bit" because I'm going to actually be using things I've barely touched before. I'm a Flash developer, but I'm going to be doing all this with Javascript. Mainly because the editor lives in HTML and Google have Javascript libraries for accessing Blogger, but also because I fancy trying doing something different. I've also got a really good (and free!) e-book about AIR from Adobe aimed at HTML/Javascript peeps as opposed to Flash peeps, and it seems to make sense to me.

It might all go terribly wrong, and this might be the last you hear about this experimental project, but this is what I'm going to be trying during my lunchtimes. If it works out, it'll be - hooray - my first open source project. And people with far more experience can point and laugh at my ham-fisted hackings.