SamePlace: what now?

Some have asked what the next steps for xmpp4moz and SamePlace are going to be. Here are some things that will receive energy and attention in the coming weeks:

  • An alpha of TabShare will be released shortly. TabShare will allow sharing a tab with a contact or a chat room for co-browsing.
  • A standalone version of SamePlace is in the works. For an idea of what it will look like… (skin, pardon, feathers adapted from Songbird):


Of course, if you’d like to suggest other directions, feel free to share your ideas on the forum!

SamePlace Suite 0.5.0 released: XHTML input, drag and drop images from web pages, and more

SamePlace Suite, version 0.5.0, is available.

If you are running Firefox 2.0, grab the all-in-one package:

If you are running Firefox 1.5 or Flock, please install the individual packages:

What’s new for users

  • SamePlace: XHTML→plain text conversion. When you write something in bold, something in italic, or send a link to an image, contacts with a client that does not support XHTML will see *something in bold*, _something in italic_, and (image: http://www.site.com/link_to_the_image.png).
  • SamePlace: Input area starts one row tall and grows as you write more.
  • xmpp4moz: Whitespaces are periodically sent to server to help keep the connection alive through picky firewalls.

Already in 0.5.0rc1:

  • SamePlace: Support for XHTML-IM. Images and styled text can also be dragged from web pages into conversation.
  • SamePlace: Added wizard to configure an account on first run.
  • SamePlace: Flashing taskbar on incoming messages.
  • JabBar: Added “Send link to…” menu to quickly send the URL of the current page to a contact.
  • JabBar: Added the “boss key” to toggle the toolbar quickly (Shift+F12).
  • xmpp4moz: Better support for UTF-8.
  • Hybrid web/IM applications: A preview of Tratto, a collaborative SVG editor, is online: http://apps.sameplace.cc/unstable/tratto/tratto.xul

What’s new for developers

  • SamePlace: Chat application now includes accurate HTML→well formed XHTML conversion that operates via DOM traversal/reconstruction instead of (hacky) regular expressions.

Already in 0.5.0rc1:

  • SamePlace: Split the chat application into several reusable modules.
  • SamePlace: Refactored contact list into reusable component.
  • xmpp4moz: Abstracted TCP socket transport to pave the way for other kinds of transport (e.g. HTTP).
  • xmpp4moz: Channels report events about the status of underlying transport.
  • xmpp4moz: Added component for data forms (XEP-0004).

Usual notice from the Help-Wanted department

We are looking for testers, especially on Mac and Windows platforms (see http://dev.hyperstruct.net/xmpp4moz/wiki/DocUsingTestingBranch for how to track the testing packages), and for HTML/CSS/graphic artists, to provide a user-oriented site along with the current developer-oriented one. Drop us a mail if you or anyone you know would like to help!

LibrieX released: turning e-book readers into platforms with High Tinkering Potential

This has been sitting on my hard disk for a while. So, with some help from a winter evening cold enough that staying home and writing documentation becomes something to be looked forward to, here it is:

LibrieX (or Librié, eXtended) is a toolkit that turns the Librié E-book Reader
into a platform with High Tinkering Potential.  Highlights are a way to establish
TCP/IP connection with a host machine and a preliminary port of the Nano-X graphic
server.

More information can be found on the project home page.

seethrough: a simple XML/XHTML templating system for Erlang

Speaking of winter evenings, a couple of weeks ago over Christmas I spent a few hours whipping together a simple templating system for Erlang.

Today I took another couple of hours to put it under version control and to add some ideas I found in ZPT, a similar system (hat tip to Jérôme for pointing it out).

This is how it works: you start with an XHTML (or any XML) file with some extra attributes thrown in and properly namespaced:


<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:e="http://dev.hyperstruct.net/seethrough">
  <head>
    <title e:content="title"/>
  </head>
  <body>
    <h1 e:content="title"/>

    <h2><span e:replace="subtitle"/></h2>

    <table>
      <thead>
        <tr>
          <th>Address</th>
          <th>Name</th>
        </tr>
      </thead>
      <tbody>
        <tr e:repeat="crew">
          <td e:content="address"/>
          <td e:content="name"/>
        </tr>
      </tbody>
    </table>
  </body>
</html>

Since it is a valid document, even designers can load it into their WYSIWYG editors and be happy.

Next, you pass the file name along with an environment (a list of key/value tuples) to apply_template/2:


seethrough:apply_template("test.html",
    [{title, "Space"},
     {subtitle, {mymod, get_subtitle, []}},
     {crew, {mymod, get_crew, []}}])).

Given such input and such environment:

  • <h1 e:content="title"/> will be replaced by <h1>Space</h1>.
  • <span e:replace="subtitel"/> will be replaced by the result of mymod:get_subtitle/0.
  • <tr e:repeat="crew">...</tr> will be repeated as many times as there are elements in the (list-)result of mymod:get_crew/0.

Here is the output:


<?xml version="1.0"?>
<html xmlns:e="http://dev.hyperstruct.net/seethrough"
      xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Space</title>
  </head>
  <body>
    <h1>Space</h1>

    <h2>The last frontier...</h2>

    <table>
      <thead>
        <tr>
          <th>Address</th>
          <th>Name</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>kirk@enterprise.glx</td>
          <td>Jim</td>
        </tr><tr>
          <td>spock@enterprise.glx</td>
          <td>Spock</td>
        </tr><tr>
          <td>mccoy@enterprise.glx</td>
          <td>Doc</td>
        </tr>
      </tbody>
    </table>
  </body>
</html>

Only a tiny part of ZPT (basically, what is needed in the above example) is mirrored so far. While I will bring more of it in, since it is obviously well designed, this will not be a port, partly because Erlang is not Python and there might be other good design choices around the corner, partly because I spent some time generating XHTML in Erlang the usual way ({body, [], [{p, [], [...]}], gen_table(...)}) and while it might not be the most familiar thing in the world, dealing with XML generation as function composition is fascinating and it would be nice to bring that into the picture.

The code is available at http://repo.hyperstruct.net/seethrough.

Update 13/01: Nevow XML Templates provide more excellent inspiration.

Update 17/01: The <attr> tag á la Nevow has been added (it affects attributes of the parent element). A project page is also available at http://hyperstruct.net/projects/seethrough, please see that for an updated example of template processing.

Update 13/02: Now with sub-templates and cache-ready.

Give presentations over the web in real time with SamePlace and S5

S5Share is a little script that lets you give S5 presentations over the web with Firefox and SamePlace.

Typical flow:

  1. the audience gathers in a chat room;
  2. the presenter tells the URL of the presentation;
  3. the audience loads the page, clicks a bookmarklet to turn it into a shared presentation, and tells SamePlace to “connect” the page to the chat room;
  4. from now on, when presenter changes slide, slide changes on the audience’s browser, too.

No need to modify existing presentations. Just copy the S5Share bookmarklet in the bookmarks toolbar and click it when you want to share a presentation with contacts or chat rooms.

The commented source of s5share.js is available here (88 lines).

Update: s5share.js can now also be included in the presentation by adding <script src="s5share.js" type="text/javascript"></script> to the HTML source. It will detect whether it is running in the usual (stand-alone) mode or if the presentation is being shared, and act accordingly.