diff --git a/tutorial.html b/tutorial.html
index 5bfa73a..ce80bbe 100644
--- a/tutorial.html
+++ b/tutorial.html
@@ -26,15 +26,54 @@
Cosmopolite Tutorial
-AppEngine prerequisites
+Test cosmopolite
+
+ - Load the cosmopolite playground debug page.
+
- Subscribe to a subject testsubject
+ - Send a message to that subject; it should appear in the message list at right.
+
+
+Send a message to a subject
+
+ - Load the debug page.
+
- Subscribe to testsubject
+ - Load tutorial page #1
+ - Click Execute JavaScript, then click OK on the popup
+ - The debug page should show the message from the tutorial page
+
+
+Subscribe to a subject
+
+ - Load tutorial page #2
+ - Click Execute JavaScript, then click OK on the popup
+ - Use the debug page to send a message to testsubject
+ - The tutorial page should generate an alert popup
+
+
+Key/value store
+
+ - Cosmopolite can be used as a key/value store, with historical data and update notification
+ - When subscribing to a subject, you can request the most recent message for that subject
+ - Load tutorial page #3
+ - Click Execute JavaScript, then click OK on the popup
+ - The tutorial page should generate an alert popup showing the last message sent
+
+
+Pin a value
+
+ - Pins publish a message temporarily, until the source conncetion disconnects. This can be used for presence information
+ - Load the debug page.
+
- Subscribe to testsubject
+ - Load tutorial page #4
+ - Click Execute JavaScript, then click OK on the popup
+ - Watch the debug page; you should see the pin.
+ - Close tutorial page #4; the pin disappears from the debug page.
+
+
+Set up a local instance for further testing
- Download and install the Python AppEngine SDK
-
-
-Server-side setup
-
-
- Create an application in your SDK client
- Download cosmopolite via the links at left. Unpack it into your local application directory and rename the newly-created subdirectory to "cosmopolite"
- Create an app.yaml file for your application.
@@ -45,19 +84,6 @@
inbound_services:
- channel_presence
- Start the application in your SDK client
-
-
-Test cosmopolite
-
-
- - Access your local cosmopolite debug page (replace port if necessary): http://localhost:8080/cosmopolite/static/debug.html
- - Subscribe to a subject testsubject
- - Send a message to that subject; it should appear in the message list below
-
-
-Create a test page
-
-
- Create a test.html page at the top level of your application:
<html>
<head>
@@ -75,55 +101,7 @@ inbound_services:
static_files: test.html
upload: test.html
- Remove the mapping for main.app from app.yaml (if using the autogenerated file)
- - Edit test.html. Replace "// Subsequent script examples go here" with:
-
var cosmo = new Cosmopolite();
-cosmo.sendMessage('testsubject', 'test message');
- - Keep the debug page up and subscribed (to testsubject) in one browser tab
- - Load your test page
- - The debug page should show the message from the test page
- - You've written code that uses cosmopolite!
-
-
-Subscribe to a subject
-
-
- - Change test.html:
-
var callbacks = {
- onMessage: function(msg) {
- alert(msg['message']);
- },
-};
-var cosmo = new Cosmopolite(callbacks);
-cosmo.subscribe('testsubject');
- - Load (or re-load) the test page
- - Use the debug interface to send a message to testsubject
- - Your test page should generate an alert popup
-
-
-Key/value store
-
-
- - Cosmopolite can be used as a key/value store, with historical data and update notification
- - When subscribing to a subject, you can request the most recent message for that subject
- - Change test.html:
-
var cosmo = new Cosmopolite();
-cosmo.subscribe('testsubject', 1).then(function() {
- var msg = cosmo.getLastMessage('testsubject');
- alert(msg['message']);
-});
- - Your test page should generate an alert popup showing the last message sent
-
-
-Pin a value
-
-
- - Pins publish a message temporarily, until the source conncetion disconnects. This can be used for presence information
- - Open the debug interface and subscribe to testsubject
- - Change test.html:
-
var cosmo = new Cosmopolite();
-cosmo.pin('testsubject', 'browser is alive!');
- - Load the test page and watch the debug page; you should see the pin.
- - Close the test page, and the pin disappears.
+ - Retry the examples above using your new test page and your local debug page