So, I keep making vague references to some cool things I want to work on. Well, rather than staying cagey and in some lame sort of stealth mode - here's an early release, because I want to get some of it out of my head and onto the web.

Last summer, in a fit of manic love for XOXO, I started writing a browser-based outliner. I got busy and had to leave it for awhile, but kept meaning to get back to it. A few months ago, I totally rewrote that code to correct some memory leaks, streamline some things, and generally employ a few more of the tricks I've learned since last July. It's still got some work to go.

The idea I think is most cool about this outliner is that it uses the browser's own data structures in the DOM to both represent and display the outline data. But, this code doesn't offer any way to get edited outlines into or out of the browser's DOM. Pointless editing of statically-served XOXO outlines as a demo was all I had.

In fact, back in July, Tantek Çelik mentioned my XOXO outline experiment on and mused: 'Imagine what you could do with some AJAX to "autosave" this XOXO outline to the server, and allow multiple users to edit different subpoints simultaneously.' Hold that thought, because I think I'm about to get a bit closer to that goal.

The OPML Community Server has a very simple, yet useful API for managing and transferring files via XML-RPC. In a lot of ways, I think it's competition for the Atom Publishing Protocol. But, say - did you know that you can do XML-RPC from a browser via AJAX? Well, that particular implementation is a bit old and seems buggy, so I've started gutting it and rewriting it myself. So, I can call the OPML Community Server API from a browser - now I need a way to turn in-browser outlines into data I can ship around with the API.

Well, that's where this next piece of the puzzle comes in: JavaScript functions to convert between XOXO and OPML data and browser DOM structures.

So, I've got the pieces in code to go round trip from XOXO and OPML data on a server; to a browser's DOM where it can be edited by way of a JavaScript-driven UI; and back to the server again. These parts aren't welded together in any form remotely close to finished, but hopefully that's what I'll get around to doing under the project I've named XoxoOutliner. In my own carefully controlled conditions, I've been able to load up, edit, and save outlines on my own barely-functional OpmlServer - as well as on itself.

What's all this mean? Well, if I never get a chance to actually finish this, maybe someone can make use of the parts I've linked to here. Otherwise, it could soon mean direct in-browser editing of OPML outlines and blogs with OPML Community Server integration. Combine that with the OPML Editor's ability to synch up with changed files, and you can edit while you're away and later bring that content back into the more fully-capable desktop application. (Thanks to Amyloo for pointing me toward that particular trick!)

Don't hold your breath on my account, though: I'm in pretty much over my head with work at the moment, so this post is more or less an escape pod for my ideas in case I don't quite make it out of this hole. Feel free to steal the pieces.

Archived Comments

  • go les... sounds very cool.

  • Does sound cool. A kind-of feature request. I'd very much like to try out your code with the blog backend I'm now using. But I don't really fancy writing code to support XML-RPC when a POST should be enough, also I don't really have any need for the OPML. So I'd be very grateful if you could somehow add hooks, or at least indicate in the code where to snip the bits I wouldn't need.

  • Danny: Sure - one of the next APIs I was thinking of tackling once I'd found a good implementation of it was the APP. All the parts are there in rough form, I think. There's a method XoxoOutliner.Conversions.fromDOMtoXOXO(ele) that takes a UL or OL node from the DOM and attempts to serialize it as XOXO, stripping out all the crud injected to manage the UI.

    So, maybe data = XoxoOutliner.Conversions.fromDOMtoXOXO($('outline1')) will get you an XOXO string for the first outline on the page, depending on what ID it has. ('outline1' is auto-assigned if none already given)

    You should be able to then make a POST request with XMLHttpRequest using that data as the body, or whatever your API requires. HAving not yet had a chance to try it, of course, it probably needs some work yet

  • Excellent, thanks Les.