From 34097feac487ba0ff1a6668e2cd7c649b77bd528 Mon Sep 17 00:00:00 2001 From: Darshan Shankar Date: Fri, 8 Apr 2011 20:54:29 -0700 Subject: [PATCH 1/3] Fixing 0.5.0 changes --- user_manual.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_manual.md b/user_manual.md index 6b1d0b2..8d26cd0 100644 --- a/user_manual.md +++ b/user_manual.md @@ -77,9 +77,9 @@ Calling `require('now')` on the server returns a reference to the NowJS module o var nowjs = require('now'); -In NowJS < 0.5.0, it was common practice to immediately chain an `initialize` call after requiring the module, rather than storing a reference to the module object. Such code would look like this: +In previous versions of NowJS, before 0.5.0, it was common practice to immediately chain an `initialize` call after requiring the module, rather than storing a reference to the module object. Such code would look like this: - var everyone = require('now').initialize(httpServer); + var everyone = require('now').initialize(httpServer); // pre 0.5.0 As of NowJS 0.5.0, it is strongly encouraged to break this up into two different calls, so that a reference to the NowJS module object can be stored, like this: From 382053c1258167dacccead0c74bb2b9c01ef5f91 Mon Sep 17 00:00:00 2001 From: Darshan Shankar Date: Fri, 8 Apr 2011 20:59:59 -0700 Subject: [PATCH 2/3] Further 0.5.0 updates --- user_manual.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_manual.md b/user_manual.md index 8d26cd0..2879258 100644 --- a/user_manual.md +++ b/user_manual.md @@ -135,7 +135,7 @@ Takes a user's socket.io sessionId string, which is available using `this.user.c Takes a user's socket.io client.sessionId string, which is available using `this.user.clientId` and removes that user to the group. Throws an error if `clientId` is not a valid sessionId. ####.now -A `now` namespace similar to `everyone.now`. Actions to this namespace affect all users that are members of the group. +A `now` namespace similar to `everyone.now`. Actions to this namespace affect all users that are members of the group. For example, actions on 'fooGroup.now' affect all users in the group 'fooGroup'. From 1051579b01081874b061d3f30367463dedac2caa Mon Sep 17 00:00:00 2001 From: Darshan Shankar Date: Fri, 8 Apr 2011 21:05:12 -0700 Subject: [PATCH 3/3] More 0.5.0 docs changes --- user_manual.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/user_manual.md b/user_manual.md index 2879258..c9c60f3 100644 --- a/user_manual.md +++ b/user_manual.md @@ -13,8 +13,9 @@ NowJS needs an instance of a node.js http server in order to communicate. If you var yourHttpServer = require('http').createServer(function(req, response){ /* Serve your static files */ }); yourHttpServer.listen(8080); -At the top of your code, place the following: -`var everyone = require("now").initialize(yourHttpServer);` +Using this http server, get NowJS and use it to get a reference to the 'everyone' object. + var nowjs = require('now'); + var everyone = nowjs.initialize(yourHttpServer); Setup on the client -------------------