API Docs

The AWW plugin can be embedded into your application and provide an interactive whiteboard for your visitors.

There are two ways to embed AWW:

Components

AwwApp consists of three components:

  1. the canvas, client side UI, implemented as a jQuery plugin
  2. the realtime sharing service, implemented as a Node.js server, hosted
  3. the image post / save service, implemented as a Python server, hosted

The UI and the sharing service communicate using Nowjs. AwwApp has a concept of shared boards, where each board is separate. Boards are identified by an opaque string ID.

AwwApp uses url fragments to identify board IDs. For example, board ‘dc63a’ would have the url: http://example.com/yourpage#dc63a

If the current URL of the page has the url fragment and autoJoin is enabled (default), awwApp will automatically try to join the board identified by the fragment.

Embedding

The HTML boilerplate required is the same for all versions.

Page head

HTML canvas support is required. As IE doesn’t provide it natively, the open source excanvas plugin is used for emulation:

<!--[if IE]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
   <script src="http://static.awwapp.com/plugin/1.0/excanvas.min.js"></script>
<![endif]-->

Also, you’ll need jQuery:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>

AwwApp UI is one JavaScript file one CSS file, and a couple of images linked to from the CSS rules:

<link rel="stylesheet" type="text/css" href="http://static.awwapp.com/plugin/1.0/aww.css"/>
 <script type="text/javascript" src="http://static.awwapp.com/plugin/1.0/aww.min.js"></script>

That’s all that’s required for basic embed. For realtime collabration, you need to link to the nowjs endpoint as well:

<script type="text/javascript" src="http://awwapp.com:7000/nowjs/now.js"></script> 

Body

Provide a block HTML element occupying the space you want the whiteboard to fill. Then, initialise the awwCanvas plugin on it:

<div id="wrapper"></div> <script type="text/javascript">
  $(function() {
    var aww = $('#wrapper').awwCanvas({ apiKey: 'YOUR-API-KEY' });
    /* if the canvas can be resized */
    $(window).resize(function() {
        $('#wrapper').awwCanvas().resize();
    });
  });
</script>

The awwCanvas plugin has several options, described later in detail. A required option if you want to enable realtime collaboration is apiKey. If you don’t supply it, the whiteboard sharing option won’t be enabled.

Embed options

When initialising the awwCanvas plugin, you can set various options which modify the behaviour of the plugin. Here’s a full list:

awwCanvas methods

Once initialized, awwCanvas has several methods you can use.

Canvas methods

Image methods

Share methods