Faye, Pusher, Browser-based Editors, Real-Time Collaboration

I watched a RailsCast  on FAYE a Rails/Rack Gem that lets you publish and subscribe across the web. Read abou FAYE here. Having a pub/sub Gem means is this: you can easily write a Rails app so that you can do something in one instance of a browser, and push the result very easily to another instance of a browser anywhere on the net.

OK, so what’s the big deal? The webcast example is a simple chat server. But the webcast got me thinking: what about using FAYE to create some kind of collaboration tool? Specifically, I’m enjoined from using Google Docs for collaboration at work (sucks!) but maybe I could create a simple Rails application that would do the same thing.

So I started researching JavaScript editor plugins that could do the job. I’d earlier found Aloha, which is an awesome looking editing plugin. My research took m in two directions. First: plugins for text collaboration—sharing a document with someone else and working on it together. Second plugins that could be used for code collaboration.

For text collaboration, aside from Aloha, there are TinyMCE and CKEditor. TinyMCE and CK are both incredibly full-featured Word-workalikes hosted on the Web. You can do everything there. All the formatting you want, plus embedding images and so on. So in theory I could create almost any document using one of them—going well beyond Google Docs limitations—and then provide some way for collaboration. The easiest thing would just be inline comments in a different color or something. A little harder would be some kind of parallel document. But it could be done.

Then I started looking at Source code editors. First, I found a Wikipedia article that compares Javascript-based source code editors. It’s got a list and then a feature comparison. I looked at a few. Then did some more searching, because the Wikipedia article seems badly out of date. But it did provide some clues.

If you’re going to have a source code editor, then you’d like it to look like the one that you use every day at your desk. For me it’s VIM. Most JS source editors seem to be EMacsy rather than VIMmy. But  there was one.

You can see the one and only VI work-alike editor here. Its source code is here. Sadly it does not work in Chrome, though I tested it in FFox 4 and in IE 9 and it works in both those place.  I found that there are some oddities in the way WebKit-based browsers handle keys that this editor needs, for example ESC. If you look at my post on Chrome Shortcuts you’ll see that there are various ESC mappings, and perhaps these interfere. The problem is solvable if you have the source code, which of course is available. Reference this article in StackOverflow, also this one.

I looked at a few others. EditArea has an unimpressive web presence. It seems to be a one-guy project. But it does a nifty job of rendering and editing as shown here.

Ace has a pretty cool editor, and they are building a Cloud-based IDE called Cloud9 based on it. It’s all open source. There are a couple of other IDE-like project based on it. Their demo is immature, but the project looks pretty comprehensive.

Code Mirror is a nice editor with bindings to lots of languages—for example C. They show line numbers along the side which is a nice feature.

WhsiHAT is a JS editor created by the folks at 37Signals who gave us rails. The project is hosted on GitHub.

Related articles

Enhanced by Zemanta

Comments

Popular Posts