diff --git a/tutorial.html b/tutorial.html
index 1abb4d4..b34ff68 100644
--- a/tutorial.html
+++ b/tutorial.html
@@ -37,7 +37,7 @@
- Create an application in your SDK client
- - Download cosmopolite via the links at left. Unpack it into a "cosmopolite" subdirectory of your local application
+ - 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.
- Add a cosmopolite include to your app.yaml file:
includes:
@@ -72,10 +72,11 @@
- url: /test.html
static_files: test.html
upload: test.html
- - Have it create a cosmopolite instance and send a message to it:
+
- 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 (from above) up and subscribed (to testsubject) in one browser tab
+ - 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!
@@ -95,7 +96,7 @@ cosmo.sendMessage('testsubject', 'test message');
Subscribe to a subject
- - Change your test script:
+
- Change test.html:
var callbacks = {
onMessage: function(msg) {
alert(msg['message']);
@@ -103,7 +104,7 @@ cosmo.sendMessage('testsubject', 'test message');
};
var cosmo = new Cosmopolite(callbacks);
cosmo.subscribe('testsubject');
- - Load (or re-load) the test page
+ - 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
@@ -113,7 +114,7 @@ cosmo.subscribe('testsubject');
- 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 your test script:
+
- Change test.html:
var cosmo = new Cosmopolite();
cosmo.subscribe('testsubject', 1).then(function() {
var msg = cosmo.getLastMessage('testsubject');
@@ -127,10 +128,10 @@ cosmo.subscribe('testsubject', 1).then(function() {
- 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 your test script:
+
- 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.
+ - Load the test page and watch the debug page; you should see the pin.
- Close the test page, and the pin disappears.