Saturday Hack With Bespin

Published 2/14/09 8:29 PM

I swear I tried! But to be honest, I knew from the beginning it was going to be very hard to just keep that idea in a corner of my head and postpone its realization to an uncertain later future. Let me say it right away, Bespin, from the Mozilla Labs, is much more than just an awesome script editor in your browser! We could go as a far as saying that is it is yesterday's future of an ideal IDE taking shape today on the cloud and with latest in-browser technologies ;)The editor itself really is a huge thing. It feels so good to write with I knew I could not resist the terrible temptation to plug and make it available to edit XWiki's JavaScript and StyleSheets eXtensions. So I did. Let's be clear, it is a saturday afternoon Q&D hack, not a clean integration, but it does the job. I basically just removed or rewrote some bits in the Bespin.Server class to skip the communication with Bespin server and load and save XWiki's extensions instead, fired automatically a couple of events, et voila! Right now it supports only JavaScript eXtensions, but making it work with StyleSheet ones would be really easy. I only tested it on a recent snapshot of XWiki, but it should work fine with all recent versions. Of course, we can only experience it in browsers that support the canvas element.Here's how it will look in your wiki :bespinJSX1.png

When viewing an eXtension, a link to edit with Bespin Editor is provided

bespinJSX2.png

Two buttons when editing with Bespin Editor, one to save the current code, one to go back to the wiki

The XWiki extension is available here. It contains unmodified code from Bespin attached to a XWiki Document. The modified bits (Bespin.Server and Bespin.FileSystem classes) are in a JavaScript extension, human-readable directly from the archive. This extension is licensed under the Mozilla Public Licence, and all Bespin original code (that is, 99.99% of this extension) is the work of the Mozilla Labs Bespin Team.To use it, just add the following line in the wiki content of a XWiki document that contains a JavaScript eXtension :

#includeForm("XWiki.BespinEditorExtension")
Update: I have developed since this original hack a concrete Skin Editor Application, available for download on code.xwiki.org.

Really, the future is in a canvas!

http://www.gravatar.com/avatar/da3126e6a3ed97d39d351efada337a1c?s=50&d=retro

Guillaume Lerouge
said on 2009/02/15 18:12

That's cool stuff Jérôme :-)

I'm looking forward our teams using it when developing our next projects :-)

http://www.gravatar.com/avatar/8a7816a0e066c7977162f6ca4be4c4ff?s=50&d=retro

Margooqp
said on 2012/03/06 09:50

hermes birkin kelly bag Hermes Messenger bags, Replacement Hermes Dance shoes; <B/>http://www.hermesky.com>hermes replica</a></B> Reproduction Aftermarket clutches protect Kelly Piece of luggage, Birkin Bags, Courtyard Dress up party Baggage, Venice Bombay, Back pack their every one Wash rag Carriers On the net over at Hermeskings.internet  hermes ambre narguile <B/>http://www.hermesky.com>hermes birkin</a></B>

blog comments powered by Disqus