Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

update the doc

  • Loading branch information...
commit 90a2d95fb68597b972c72fe62b0091a8d0f1a0a0 1 parent e59cf62
authored January 03, 2012 ericz committed January 16, 2012
BIN  doc/jsdoc/.DS_Store
Binary file not shown
26  doc/jsdoc/files.html
@@ -2,7 +2,7 @@
2 2
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 3
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 4
 	<head>
5  
-		<meta http-equiv="content-type" content="text/html; charset=utf8" />
  5
+		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 6
 		
7 7
 		<title>JsDoc Reference - File Index</title>
8 8
 		<meta name="generator" content="JsDoc Toolkit" />
@@ -207,7 +207,7 @@ <h1 class="classTitle">File Index</h1>
207 207
 			
208 208
 			
209 209
 			<div>
210  
-				<h2><a href="symbols/src/flotype_now_lib_fileServer.js.html">../flotype/now/lib/fileServer.js</a></h2>
  210
+				<h2><a href="symbols/src/now_lib_fileServer.js.html">../../../now/lib/fileServer.js</a></h2>
211 211
 				
212 212
 				<dl>
213 213
 					
@@ -219,7 +219,7 @@ <h1 class="classTitle">File Index</h1>
219 219
 			<hr />
220 220
 			
221 221
 			<div>
222  
-				<h2><a href="symbols/src/flotype_now_lib_function.js.html">../flotype/now/lib/function.js</a></h2>
  222
+				<h2><a href="symbols/src/now_lib_function.js.html">../../../now/lib/function.js</a></h2>
223 223
 				
224 224
 				<dl>
225 225
 					
@@ -231,7 +231,7 @@ <h1 class="classTitle">File Index</h1>
231 231
 			<hr />
232 232
 			
233 233
 			<div>
234  
-				<h2><a href="symbols/src/flotype_now_lib_group.js.html">../flotype/now/lib/group.js</a></h2>
  234
+				<h2><a href="symbols/src/now_lib_group.js.html">../../../now/lib/group.js</a></h2>
235 235
 				
236 236
 				<dl>
237 237
 					
@@ -243,7 +243,7 @@ <h1 class="classTitle">File Index</h1>
243 243
 			<hr />
244 244
 			
245 245
 			<div>
246  
-				<h2><a href="symbols/src/flotype_now_lib_handlers.js.html">../flotype/now/lib/handlers.js</a></h2>
  246
+				<h2><a href="symbols/src/now_lib_handlers.js.html">../../../now/lib/handlers.js</a></h2>
247 247
 				
248 248
 				<dl>
249 249
 					
@@ -255,7 +255,7 @@ <h1 class="classTitle">File Index</h1>
255 255
 			<hr />
256 256
 			
257 257
 			<div>
258  
-				<h2><a href="symbols/src/flotype_now_lib_now.js.html">../flotype/now/lib/now.js</a></h2>
  258
+				<h2><a href="symbols/src/now_lib_now.js.html">../../../now/lib/now.js</a></h2>
259 259
 				
260 260
 				<dl>
261 261
 					
@@ -267,7 +267,7 @@ <h1 class="classTitle">File Index</h1>
267 267
 			<hr />
268 268
 			
269 269
 			<div>
270  
-				<h2><a href="symbols/src/flotype_now_lib_nowUtil.js.html">../flotype/now/lib/nowUtil.js</a></h2>
  270
+				<h2><a href="symbols/src/now_lib_nowUtil.js.html">../../../now/lib/nowUtil.js</a></h2>
271 271
 				
272 272
 				<dl>
273 273
 					
@@ -279,7 +279,7 @@ <h1 class="classTitle">File Index</h1>
279 279
 			<hr />
280 280
 			
281 281
 			<div>
282  
-				<h2><a href="symbols/src/flotype_now_lib_proxy.js.html">../flotype/now/lib/proxy.js</a></h2>
  282
+				<h2><a href="symbols/src/now_lib_proxy.js.html">../../../now/lib/proxy.js</a></h2>
283 283
 				
284 284
 				<dl>
285 285
 					
@@ -291,7 +291,7 @@ <h1 class="classTitle">File Index</h1>
291 291
 			<hr />
292 292
 			
293 293
 			<div>
294  
-				<h2><a href="symbols/src/flotype_now_lib_scopeTable.js.html">../flotype/now/lib/scopeTable.js</a></h2>
  294
+				<h2><a href="symbols/src/now_lib_scopeTable.js.html">../../../now/lib/scopeTable.js</a></h2>
295 295
 				
296 296
 				<dl>
297 297
 					
@@ -303,7 +303,7 @@ <h1 class="classTitle">File Index</h1>
303 303
 			<hr />
304 304
 			
305 305
 			<div>
306  
-				<h2><a href="symbols/src/flotype_now_lib_server.js.html">../flotype/now/lib/server.js</a></h2>
  306
+				<h2><a href="symbols/src/now_lib_server.js.html">../../../now/lib/server.js</a></h2>
307 307
 				
308 308
 				<dl>
309 309
 					
@@ -315,7 +315,7 @@ <h1 class="classTitle">File Index</h1>
315 315
 			<hr />
316 316
 			
317 317
 			<div>
318  
-				<h2><a href="symbols/src/flotype_now_lib_support.js.html">../flotype/now/lib/support.js</a></h2>
  318
+				<h2><a href="symbols/src/now_lib_support.js.html">../../../now/lib/support.js</a></h2>
319 319
 				
320 320
 				<dl>
321 321
 					
@@ -327,7 +327,7 @@ <h1 class="classTitle">File Index</h1>
327 327
 			<hr />
328 328
 			
329 329
 			<div>
330  
-				<h2><a href="symbols/src/flotype_now_lib_user.js.html">../flotype/now/lib/user.js</a></h2>
  330
+				<h2><a href="symbols/src/now_lib_user.js.html">../../../now/lib/user.js</a></h2>
331 331
 				
332 332
 				<dl>
333 333
 					
@@ -342,7 +342,7 @@ <h1 class="classTitle">File Index</h1>
342 342
 		</div>
343 343
 		<div class="fineprint" style="clear:both">
344 344
 			
345  
-			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Tue Aug 16 2011 17:09:04 GMT-0700 (PDT)
  345
+			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Tue Jan 03 2012 15:53:12 GMT-0800 (PST)
346 346
 		</div>
347 347
 	</body>
348 348
 </html>
4  doc/jsdoc/index.html
@@ -2,7 +2,7 @@
2 2
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 3
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 4
 	<head>
5  
-		<meta http-equiv="content-type" content="text/html; charset=utf8" />
  5
+		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 6
 		
7 7
 		<title>JsDoc Reference - Index</title>
8 8
 		<meta name="generator" content="JsDoc Toolkit" />
@@ -256,7 +256,7 @@ <h1 class="classTitle">Class Index</h1>
256 256
 		</div>
257 257
 		<div class="fineprint" style="clear:both">
258 258
 			
259  
-			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Tue Aug 16 2011 17:09:04 GMT-0700 (PDT)
  259
+			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Tue Jan 03 2012 15:53:12 GMT-0800 (PST)
260 260
 		</div>
261 261
 	</body>
262 262
 </html>
BIN  doc/jsdoc/symbols/.DS_Store
Binary file not shown
BIN  doc/jsdoc/symbols/.User#user.html.swp
Binary file not shown
6  doc/jsdoc/symbols/Group#now.html
@@ -2,7 +2,7 @@
2 2
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 3
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 4
 	<head>
5  
-		<meta http-equiv="content-type" content="text/html; charset=utf8" />
  5
+		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 6
 		<meta name="generator" content="JsDoc Toolkit" />
7 7
 		
8 8
 		<title>JsDoc Reference - Group#now</title>
@@ -226,7 +226,7 @@ <h1 class="classTitle">
226 226
 context of each individual user in the group.
227 227
 				
228 228
 				
229  
-					<br /><i>Defined in: </i> <a href="../symbols/src/flotype_now_lib_group.js.html">group.js</a>.
  229
+					<br /><i>Defined in: </i> <a href="../symbols/src/now_lib_group.js.html">group.js</a>.
230 230
 				
231 231
 			</p>
232 232
 
@@ -316,7 +316,7 @@ <h1 class="classTitle">
316 316
 <!-- ============================== footer ================================= -->
317 317
 		<div class="fineprint" style="clear:both">
318 318
 			
319  
-			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Aug 16 2011 17:09:04 GMT-0700 (PDT)
  319
+			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Jan 03 2012 15:53:12 GMT-0800 (PST)
320 320
 		</div>
321 321
 	</body>
322 322
 </html>
6  doc/jsdoc/symbols/Group.html
@@ -2,7 +2,7 @@
2 2
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 3
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 4
 	<head>
5  
-		<meta http-equiv="content-type" content="text/html; charset=utf8" />
  5
+		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 6
 		<meta name="generator" content="JsDoc Toolkit" />
7 7
 		
8 8
 		<title>JsDoc Reference - Group</title>
@@ -224,7 +224,7 @@ <h1 class="classTitle">
224 224
      users. Each group has its own <a href="../symbols/Group%23now.html">Group#now</a> namespace.
225 225
 				
226 226
 				
227  
-					<br /><i>Defined in: </i> <a href="../symbols/src/flotype_now_lib_group.js.html">group.js</a>.
  227
+					<br /><i>Defined in: </i> <a href="../symbols/src/now_lib_group.js.html">group.js</a>.
228 228
 				
229 229
 			</p>
230 230
 
@@ -1016,7 +1016,7 @@ <h1 class="classTitle">
1016 1016
 <!-- ============================== footer ================================= -->
1017 1017
 		<div class="fineprint" style="clear:both">
1018 1018
 			
1019  
-			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Aug 16 2011 17:09:04 GMT-0700 (PDT)
  1019
+			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Jan 03 2012 15:53:12 GMT-0800 (PST)
1020 1020
 		</div>
1021 1021
 	</body>
1022 1022
 </html>
6  doc/jsdoc/symbols/User#now.html
@@ -2,7 +2,7 @@
2 2
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 3
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 4
 	<head>
5  
-		<meta http-equiv="content-type" content="text/html; charset=utf8" />
  5
+		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 6
 		<meta name="generator" content="JsDoc Toolkit" />
7 7
 		
8 8
 		<title>JsDoc Reference - User#now</title>
@@ -225,7 +225,7 @@ <h1 class="classTitle">
225 225
 only be executed for the current user.
226 226
 				
227 227
 				
228  
-					<br /><i>Defined in: </i> <a href="../symbols/src/flotype_now_lib_user.js.html">user.js</a>.
  228
+					<br /><i>Defined in: </i> <a href="../symbols/src/now_lib_user.js.html">user.js</a>.
229 229
 				
230 230
 			</p>
231 231
 
@@ -324,7 +324,7 @@ <h1 class="classTitle">
324 324
 <!-- ============================== footer ================================= -->
325 325
 		<div class="fineprint" style="clear:both">
326 326
 			
327  
-			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Aug 16 2011 17:09:04 GMT-0700 (PDT)
  327
+			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Jan 03 2012 15:53:12 GMT-0800 (PST)
328 328
 		</div>
329 329
 	</body>
330 330
 </html>
6  doc/jsdoc/symbols/User#user.html
@@ -2,7 +2,7 @@
2 2
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 3
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 4
 	<head>
5  
-		<meta http-equiv="content-type" content="text/html; charset=utf8" />
  5
+		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 6
 		<meta name="generator" content="JsDoc Toolkit" />
7 7
 		
8 8
 		<title>JsDoc Reference - User#user</title>
@@ -225,7 +225,7 @@ <h1 class="classTitle">
225 225
 connected user.
226 226
 				
227 227
 				
228  
-					<br /><i>Defined in: </i> <a href="../symbols/src/flotype_now_lib_user.js.html">user.js</a>.
  228
+					<br /><i>Defined in: </i> <a href="../symbols/src/now_lib_user.js.html">user.js</a>.
229 229
 				
230 230
 			</p>
231 231
 
@@ -405,7 +405,7 @@ <h1 class="classTitle">
405 405
 <!-- ============================== footer ================================= -->
406 406
 		<div class="fineprint" style="clear:both">
407 407
 			
408  
-			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Aug 16 2011 17:09:04 GMT-0700 (PDT)
  408
+			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Jan 03 2012 15:53:12 GMT-0800 (PST)
409 409
 		</div>
410 410
 	</body>
411 411
 </html>
6  doc/jsdoc/symbols/User.html
@@ -2,7 +2,7 @@
2 2
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 3
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 4
 	<head>
5  
-		<meta http-equiv="content-type" content="text/html; charset=utf8" />
  5
+		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 6
 		<meta name="generator" content="JsDoc Toolkit" />
7 7
 		
8 8
 		<title>JsDoc Reference - User</title>
@@ -227,7 +227,7 @@ <h1 class="classTitle">
227 227
 and <a href="../symbols/User%23user.html">User#user</a> namespaces.
228 228
 				
229 229
 				
230  
-					<br /><i>Defined in: </i> <a href="../symbols/src/flotype_now_lib_user.js.html">user.js</a>.
  230
+					<br /><i>Defined in: </i> <a href="../symbols/src/now_lib_user.js.html">user.js</a>.
231 231
 				
232 232
 			</p>
233 233
 
@@ -458,7 +458,7 @@ <h1 class="classTitle">
458 458
 <!-- ============================== footer ================================= -->
459 459
 		<div class="fineprint" style="clear:both">
460 460
 			
461  
-			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Aug 16 2011 17:09:04 GMT-0700 (PDT)
  461
+			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Jan 03 2012 15:53:12 GMT-0800 (PST)
462 462
 		</div>
463 463
 	</body>
464 464
 </html>
53  doc/jsdoc/symbols/_global_.html
@@ -2,7 +2,7 @@
2 2
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 3
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 4
 	<head>
5  
-		<meta http-equiv="content-type" content="text/html; charset=utf8" />
  5
+		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 6
 		<meta name="generator" content="JsDoc Toolkit" />
7 7
 		
8 8
 		<title>JsDoc Reference - _global_</title>
@@ -254,6 +254,17 @@ <h1 class="classTitle">
254 254
 							</td>
255 255
 						</tr>
256 256
 					
  257
+						<tr>
  258
+							<td class="attributes">&nbsp;</td>
  259
+							<td class="nameDescription">
  260
+								<div class="fixedFont">
  261
+								<b><a href="../symbols/_global_.html#util">util</a></b>
  262
+								</div>
  263
+								<div class="description">NowUtil: an assorted collection of general-purpose functions used
  264
+in NowJS.</div>
  265
+							</td>
  266
+						</tr>
  267
+					
257 268
 					</tbody>
258 269
 				</table>
259 270
 				
@@ -353,7 +364,33 @@ <h1 class="classTitle">
353 364
 trigger the store function to be called.
354 365
 						
355 366
 							<br />
356  
-							<i>Defined in: </i> <a href="../symbols/src/flotype_now_lib_proxy.js.html">proxy.js</a>.
  367
+							<i>Defined in: </i> <a href="../symbols/src/now_lib_proxy.js.html">proxy.js</a>.
  368
+						
  369
+						
  370
+					</div>
  371
+					
  372
+					
  373
+
  374
+						
  375
+						
  376
+						
  377
+						
  378
+
  379
+					<hr />
  380
+				
  381
+					<a name="util"> </a>
  382
+					<div class="fixedFont">
  383
+					
  384
+					
  385
+					<b>util</b>
  386
+					
  387
+					</div>
  388
+					<div class="description">
  389
+						NowUtil: an assorted collection of general-purpose functions used
  390
+in NowJS.
  391
+						
  392
+							<br />
  393
+							<i>Defined in: </i> <a href="../symbols/src/now_lib_nowUtil.js.html">nowUtil.js</a>.
357 394
 						
358 395
 						
359 396
 					</div>
@@ -386,7 +423,7 @@ <h1 class="classTitle">
386 423
 						
387 424
 						
388 425
 							<br />
389  
-							<i>Defined in: </i> <a href="../symbols/src/flotype_now_lib_fileServer.js.html">fileServer.js</a>.
  426
+							<i>Defined in: </i> <a href="../symbols/src/now_lib_fileServer.js.html">fileServer.js</a>.
390 427
 						
391 428
 						
392 429
 					</div>
@@ -437,7 +474,7 @@ <h1 class="classTitle">
437 474
 						
438 475
 						
439 476
 							<br />
440  
-							<i>Defined in: </i> <a href="../symbols/src/flotype_now_lib_fileServer.js.html">fileServer.js</a>.
  477
+							<i>Defined in: </i> <a href="../symbols/src/now_lib_fileServer.js.html">fileServer.js</a>.
441 478
 						
442 479
 						
443 480
 					</div>
@@ -482,7 +519,7 @@ <h1 class="classTitle">
482 519
 						
483 520
 						
484 521
 							<br />
485  
-							<i>Defined in: </i> <a href="../symbols/src/flotype_now_lib_now.js.html">now.js</a>.
  522
+							<i>Defined in: </i> <a href="../symbols/src/now_lib_now.js.html">now.js</a>.
486 523
 						
487 524
 						
488 525
 					</div>
@@ -510,7 +547,7 @@ <h1 class="classTitle">
510 547
 						
511 548
 						
512 549
 							<br />
513  
-							<i>Defined in: </i> <a href="../symbols/src/flotype_now_lib_scopeTable.js.html">scopeTable.js</a>.
  550
+							<i>Defined in: </i> <a href="../symbols/src/now_lib_scopeTable.js.html">scopeTable.js</a>.
514 551
 						
515 552
 						
516 553
 					</div>
@@ -549,7 +586,7 @@ <h1 class="classTitle">
549 586
 						
550 587
 						
551 588
 							<br />
552  
-							<i>Defined in: </i> <a href="../symbols/src/flotype_now_lib_fileServer.js.html">fileServer.js</a>.
  589
+							<i>Defined in: </i> <a href="../symbols/src/now_lib_fileServer.js.html">fileServer.js</a>.
553 590
 						
554 591
 						
555 592
 					</div>
@@ -607,7 +644,7 @@ <h1 class="classTitle">
607 644
 <!-- ============================== footer ================================= -->
608 645
 		<div class="fineprint" style="clear:both">
609 646
 			
610  
-			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Aug 16 2011 17:09:04 GMT-0700 (PDT)
  647
+			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Jan 03 2012 15:53:12 GMT-0800 (PST)
611 648
 		</div>
612 649
 	</body>
613 650
 </html>
110  doc/jsdoc/symbols/nowjs.html
@@ -2,7 +2,7 @@
2 2
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 3
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 4
 	<head>
5  
-		<meta http-equiv="content-type" content="text/html; charset=utf8" />
  5
+		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 6
 		<meta name="generator" content="JsDoc Toolkit" />
7 7
 		
8 8
 		<title>JsDoc Reference - nowjs</title>
@@ -223,7 +223,7 @@ <h1 class="classTitle">
223 223
 				
224 224
 				
225 225
 				
226  
-					<br /><i>Defined in: </i> <a href="../symbols/src/flotype_now_lib_now.js.html">now.js</a>.
  226
+					<br /><i>Defined in: </i> <a href="../symbols/src/now_lib_now.js.html">now.js</a>.
227 227
 				
228 228
 			</p>
229 229
 
@@ -308,6 +308,15 @@ <h1 class="classTitle">
308 308
 							</td>
309 309
 						</tr>
310 310
 					
  311
+						<tr>
  312
+							<td class="attributes">&nbsp;</td>
  313
+							<td class="nameDescription">
  314
+								<div class="fixedFont"><b><a href="../symbols/nowjs.html#removeGroup">removeGroup</a></b>(name)
  315
+								</div>
  316
+								<div class="description">Removes all traces of a group.</div>
  317
+							</td>
  318
+						</tr>
  319
+					
311 320
 					</tbody>
312 321
 				</table>
313 322
 				
@@ -377,6 +386,15 @@ <h1 class="classTitle">
377 386
 							</td>
378 387
 						</tr>
379 388
 					
  389
+						<tr>
  390
+							<td class="attributes">&nbsp;</td>
  391
+							<td class="nameDescription">
  392
+								<div class="fixedFont"><b><a href="../symbols/nowjs.html#event:removegroup">removegroup</a></b>(group)
  393
+								</div>
  394
+								<div class="description">Called when a group is removed.</div>
  395
+							</td>
  396
+						</tr>
  397
+					
380 398
 					</tbody>
381 399
 				</table>
382 400
 				
@@ -612,6 +630,46 @@ <h1 class="classTitle">
612 630
 						
613 631
 						
614 632
 
  633
+					<hr />
  634
+				
  635
+					<a name="removeGroup"> </a>
  636
+					<div class="fixedFont">
  637
+					
  638
+					<span class="light">{<a href="../symbols/Group.html">Group</a>}</span>
  639
+					<b>removeGroup</b>(name)
  640
+					
  641
+					</div>
  642
+					<div class="description">
  643
+						Removes all traces of a group.
  644
+						
  645
+						
  646
+					</div>
  647
+					
  648
+					
  649
+					
  650
+					<pre class="code">var new_group = nowjs.getGroup('a new group');</pre>
  651
+					
  652
+					
  653
+					
  654
+						
  655
+							<dl class="detailList">
  656
+							<dt class="heading">Parameters:</dt>
  657
+							
  658
+								<dt>
  659
+									<span class="light fixedFont">{String}</span> <b>name</b>
  660
+									
  661
+								</dt>
  662
+								<dd>The name of the group to be retrieved.</dd>
  663
+							
  664
+							</dl>
  665
+						
  666
+						
  667
+						
  668
+						
  669
+						
  670
+						
  671
+						
  672
+
615 673
 					
616 674
 				
617 675
 			
@@ -797,8 +855,8 @@ <h1 class="classTitle">
797 855
 					
798 856
 					
799 857
 					
800  
-					<pre class="code">nowjs.on('newgroup', function (name) {
801  
-  console.log('You have successfully created the group `' + name + '`');
  858
+					<pre class="code">nowjs.on('newgroup', function (group) {
  859
+  console.log('You have successfully created the group `' + group.groupName + '`');
802 860
 });</pre>
803 861
 					
804 862
 					
@@ -822,6 +880,48 @@ <h1 class="classTitle">
822 880
 						
823 881
 						
824 882
 
  883
+					<hr />
  884
+				
  885
+					<a name="event:removegroup"> </a>
  886
+					<div class="fixedFont">
  887
+					
  888
+					
  889
+					<b>removegroup</b>(group)
  890
+					
  891
+					</div>
  892
+					<div class="description">
  893
+						Called when a group is removed.
  894
+						
  895
+						
  896
+					</div>
  897
+					
  898
+					
  899
+					
  900
+					<pre class="code">nowjs.on('removegroup', function (group) {
  901
+  console.log('Group `' + group.groupName + '` eliminated from existence.');
  902
+});</pre>
  903
+					
  904
+					
  905
+					
  906
+						
  907
+							<dl class="detailList">
  908
+							<dt class="heading">Parameters:</dt>
  909
+							
  910
+								<dt>
  911
+									<span class="light fixedFont">{<a href="../symbols/Group.html">Group</a>}</span> <b>group</b>
  912
+									
  913
+								</dt>
  914
+								<dd>The group removed by <a href="../symbols/nowjs.html#getGroup">nowjs#getGroup</a>.</dd>
  915
+							
  916
+							</dl>
  917
+						
  918
+						
  919
+						
  920
+						
  921
+						
  922
+						
  923
+						
  924
+
825 925
 					
826 926
 				
827 927
 			
@@ -833,7 +933,7 @@ <h1 class="classTitle">
833 933
 <!-- ============================== footer ================================= -->
834 934
 		<div class="fineprint" style="clear:both">
835 935
 			
836  
-			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Aug 16 2011 17:09:04 GMT-0700 (PDT)
  936
+			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Jan 03 2012 15:53:12 GMT-0800 (PST)
837 937
 		</div>
838 938
 	</body>
839 939
 </html>
BIN  doc/jsdoc/symbols/src/.DS_Store
Binary file not shown
136  doc/jsdoc/symbols/src/now_lib_fileServer.js.html
... ...
@@ -0,0 +1,136 @@
  1
+<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
  2
+	.KEYW {color: #933;}
  3
+	.COMM {color: #bbb; font-style: italic;}
  4
+	.NUMB {color: #393;}
  5
+	.STRN {color: #393;}
  6
+	.REGX {color: #339;}
  7
+	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
  8
+	</style></head><body><pre><span class='line'>  1</span> <span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">require</span><span class="PUNC">(</span><span class="STRN">'fs'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  9
+<span class='line'>  2</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nowUtil</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">require</span><span class="PUNC">(</span><span class="STRN">'./nowUtil'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">nowUtil</span><span class="PUNC">;</span><span class="WHIT">
  10
+<span class='line'>  3</span> </span><span class="COMM">//redirect the client/now.js to ../dist/now.min.js</span><span class="WHIT">
  11
+<span class='line'>  4</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">clientNow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'/dist/now.js'</span><span class="PUNC">;</span><span class="WHIT">
  12
+<span class='line'>  5</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fileCache</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  13
+<span class='line'>  6</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nowFileCache</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  14
+<span class='line'>  7</span> 
  15
+<span class='line'>  8</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">defaultListeners</span><span class="PUNC">;</span><span class="WHIT">
  16
+<span class='line'>  9</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">server</span><span class="PUNC">;</span><span class="WHIT">
  17
+<span class='line'> 10</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">;</span><span class="WHIT">
  18
+<span class='line'> 11</span> 
  19
+<span class='line'> 12</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">handleResponse</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">serveFile</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">generateClientLibs</span><span class="PUNC">;</span><span class="WHIT">
  20
+<span class='line'> 13</span> 
  21
+<span class='line'> 14</span> </span><span class="NAME">exports.wrapServer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">httpServer</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">serverOptions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  22
+<span class='line'> 15</span> </span><span class="WHIT">  </span><span class="NAME">server</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">httpServer</span><span class="PUNC">;</span><span class="WHIT">
  23
+<span class='line'> 16</span> </span><span class="WHIT">  </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">serverOptions</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">client</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  24
+<span class='line'> 17</span> </span><span class="WHIT">  </span><span class="NAME">options.client</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">JSON.stringify</span><span class="PUNC">(</span><span class="NAME">options.client</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  25
+<span class='line'> 18</span> 
  26
+<span class='line'> 19</span> </span><span class="WHIT">  </span><span class="NAME">defaultListeners</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">server.listeners</span><span class="PUNC">(</span><span class="STRN">'request'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  27
+<span class='line'> 20</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">serverOptions.autoHost</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  28
+<span class='line'> 21</span> </span><span class="WHIT">    </span><span class="NAME">server.removeAllListeners</span><span class="PUNC">(</span><span class="STRN">'request'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  29
+<span class='line'> 22</span> </span><span class="WHIT">    </span><span class="NAME">server.on</span><span class="PUNC">(</span><span class="STRN">'request'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">handleResponse</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  30
+<span class='line'> 23</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
  31
+<span class='line'> 24</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  32
+<span class='line'> 25</span> 
  33
+<span class='line'> 26</span> </span><span class="COMM">// Called upon http server request</span><span class="WHIT">
  34
+<span class='line'> 27</span> </span><span class="NAME">handleResponse</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">request</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">response</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  35
+<span class='line'> 28</span> </span><span class="WHIT">  </span><span class="COMM">// Handle only GET requests for /nowjs/* files. Pass all other requests through</span><span class="WHIT">
  36
+<span class='line'> 29</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
  37
+<span class='line'> 30</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">request.method</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'GET'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  38
+<span class='line'> 31</span> 
  39
+<span class='line'> 32</span> </span><span class="WHIT">    </span><span class="COMM">// Detect if request involves the now.js file</span><span class="WHIT">
  40
+<span class='line'> 33</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">request.url.split</span><span class="PUNC">(</span><span class="STRN">'?'</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'/nowjs/now.js'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  41
+<span class='line'> 34</span> </span><span class="WHIT">      </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  42
+<span class='line'> 35</span> </span><span class="WHIT">        </span><span class="NAME">serveFile</span><span class="PUNC">(</span><span class="NAME">__dirname</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">clientNow</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">request</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">response</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  43
+<span class='line'> 36</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> 
  44
+<span class='line'> 37</span>       </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">)</span><span class="WHIT"> 
  45
+<span class='line'> 38</span>       </span><span class="PUNC">{</span><span class="WHIT">
  46
+<span class='line'> 39</span> </span><span class="WHIT">        </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="STRN">"/client/now.js not found, while serving file"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  47
+<span class='line'> 40</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
  48
+<span class='line'> 41</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  49
+<span class='line'> 42</span> </span><span class="WHIT">      
  50
+<span class='line'> 43</span>     </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  51
+<span class='line'> 44</span> </span><span class="WHIT">      </span><span class="COMM">// Make sure default listeners are still handled</span><span class="WHIT">
  52
+<span class='line'> 45</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">defaultListeners</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  53
+<span class='line'> 46</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowUtil.hasProperty</span><span class="PUNC">(</span><span class="NAME">defaultListeners</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  54
+<span class='line'> 47</span> </span><span class="WHIT">          </span><span class="NAME">defaultListeners</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">call</span><span class="PUNC">(</span><span class="NAME">server</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">request</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">response</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  55
+<span class='line'> 48</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
  56
+<span class='line'> 49</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
  57
+<span class='line'> 50</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
  58
+<span class='line'> 51</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  59
+<span class='line'> 52</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">defaultListeners</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  60
+<span class='line'> 53</span> </span><span class="WHIT">      </span><span class="COMM">// Make sure default listeners are still handled</span><span class="WHIT">
  61
+<span class='line'> 54</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowUtil.hasProperty</span><span class="PUNC">(</span><span class="NAME">defaultListeners</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  62
+<span class='line'> 55</span> </span><span class="WHIT">        </span><span class="NAME">defaultListeners</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">call</span><span class="PUNC">(</span><span class="NAME">server</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">request</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">response</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  63
+<span class='line'> 56</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
  64
+<span class='line'> 57</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
  65
+<span class='line'> 58</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
  66
+<span class='line'> 59</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  67
+<span class='line'> 60</span> 
  68
+<span class='line'> 61</span> </span><span class="COMM">// Actually serve the file</span><span class="WHIT">
  69
+<span class='line'> 62</span> </span><span class="NAME">serveFile</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">filename</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">request</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">response</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  70
+<span class='line'> 63</span> </span><span class="WHIT">  </span><span class="COMM">// Write file from cache if possible</span><span class="WHIT">
  71
+<span class='line'> 64</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowUtil.hasProperty</span><span class="PUNC">(</span><span class="NAME">fileCache</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">filename</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  72
+<span class='line'> 65</span> </span><span class="WHIT">    </span><span class="NAME">response.writeHead</span><span class="PUNC">(</span><span class="NUMB">200</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  73
+<span class='line'> 66</span> </span><span class="WHIT">    </span><span class="NAME">response.write</span><span class="PUNC">(</span><span class="NAME">fileCache</span><span class="PUNC">[</span><span class="NAME">filename</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  74
+<span class='line'> 67</span> </span><span class="WHIT">    </span><span class="NAME">response.end</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  75
+<span class='line'> 68</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  76
+<span class='line'> 69</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">filename.indexOf</span><span class="PUNC">(</span><span class="STRN">'/now.js'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  77
+<span class='line'> 70</span> 
  78
+<span class='line'> 71</span> </span><span class="WHIT">      </span><span class="COMM">// Write file from cache if possible</span><span class="WHIT">
  79
+<span class='line'> 72</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowUtil.hasProperty</span><span class="PUNC">(</span><span class="NAME">nowFileCache</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">request.headers.host</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  80
+<span class='line'> 73</span> 
  81
+<span class='line'> 74</span> </span><span class="WHIT">        </span><span class="COMM">// Write file from cache</span><span class="WHIT">
  82
+<span class='line'> 75</span> </span><span class="WHIT">        </span><span class="NAME">response.writeHead</span><span class="PUNC">(</span><span class="NUMB">200</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">'Content-Type'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'text/javascript'</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  83
+<span class='line'> 76</span> </span><span class="WHIT">        </span><span class="NAME">response.write</span><span class="PUNC">(</span><span class="NAME">nowFileCache</span><span class="PUNC">[</span><span class="NAME">request.headers.host</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">now</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  84
+<span class='line'> 77</span> </span><span class="WHIT">        </span><span class="NAME">response.end</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  85
+<span class='line'> 78</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  86
+<span class='line'> 79</span> </span><span class="WHIT">        </span><span class="COMM">// Determine hostname / port if not given in options</span><span class="WHIT">
  87
+<span class='line'> 80</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">host</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">request.headers.host.split</span><span class="PUNC">(</span><span class="STRN">':'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  88
+<span class='line'> 81</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hostServer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">[</span><span class="STRN">'host'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">host</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
  89
+<span class='line'> 82</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hostPort</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">  </span><span class="NAME">options</span><span class="PUNC">[</span><span class="STRN">'port'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">host</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">'80'</span><span class="PUNC">;</span><span class="WHIT">
  90
+<span class='line'> 83</span> 
  91
+<span class='line'> 84</span> </span><span class="WHIT">        </span><span class="COMM">// Call generate client libs, which takes the desired host/port and executes callback with two parts of now.js as parameters</span><span class="WHIT">
  92
+<span class='line'> 85</span> </span><span class="WHIT">        </span><span class="NAME">generateClientLibs</span><span class="PUNC">(</span><span class="NAME">hostServer</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">hostPort</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowText</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  93
+<span class='line'> 86</span> 
  94
+<span class='line'> 87</span> </span><span class="WHIT">          </span><span class="COMM">// Write to client</span><span class="WHIT">
  95
+<span class='line'> 88</span> </span><span class="WHIT">          </span><span class="NAME">response.writeHead</span><span class="PUNC">(</span><span class="NUMB">200</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">'Content-Type'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'text/javascript'</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  96
+<span class='line'> 89</span> </span><span class="WHIT">          </span><span class="NAME">response.write</span><span class="PUNC">(</span><span class="NAME">nowText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  97
+<span class='line'> 90</span> </span><span class="WHIT">          </span><span class="NAME">response.end</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  98
+<span class='line'> 91</span> 
  99
+<span class='line'> 92</span> </span><span class="WHIT">          </span><span class="COMM">// Add to cache</span><span class="WHIT">
  100
+<span class='line'> 93</span> </span><span class="WHIT">          </span><span class="NAME">nowFileCache</span><span class="PUNC">[</span><span class="NAME">request.headers.host</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">now</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">nowText</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  101
+<span class='line'> 94</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  102
+<span class='line'> 95</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
  103
+<span class='line'> 96</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  104
+<span class='line'> 97</span> </span><span class="WHIT">      </span><span class="COMM">// For any other filename, read file and server (not cached)</span><span class="WHIT">
  105
+<span class='line'> 98</span> </span><span class="WHIT">      </span><span class="NAME">fs.readFile</span><span class="PUNC">(</span><span class="NAME">filename</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  106
+<span class='line'> 99</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">text</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data.toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  107
+<span class='line'>100</span> </span><span class="WHIT">        </span><span class="NAME">response.writeHead</span><span class="PUNC">(</span><span class="NUMB">200</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  108
+<span class='line'>101</span> </span><span class="WHIT">        </span><span class="NAME">response.write</span><span class="PUNC">(</span><span class="NAME">text</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  109
+<span class='line'>102</span> </span><span class="WHIT">        </span><span class="NAME">response.end</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  110
+<span class='line'>103</span> </span><span class="WHIT">        </span><span class="NAME">fileCache</span><span class="PUNC">[</span><span class="NAME">filename</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">;</span><span class="WHIT">
  111
+<span class='line'>104</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  112
+<span class='line'>105</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
  113
+<span class='line'>106</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
  114
+<span class='line'>107</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  115
+<span class='line'>108</span> 
  116
+<span class='line'>109</span> </span><span class="COMM">// Takes host and port and call callback with now.js as parameter</span><span class="WHIT">
  117
+<span class='line'>110</span> </span><span class="NAME">generateClientLibs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hostServer</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">hostPort</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  118
+<span class='line'>111</span> </span><span class="WHIT">  </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  119
+<span class='line'>112</span> </span><span class="WHIT">    </span><span class="NAME">fs.readFile</span><span class="PUNC">(</span><span class="NAME">__dirname</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">clientNow</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  120
+<span class='line'>113</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nowText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data.toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  121
+<span class='line'>114</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">initString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.scope</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.now = nowInitialize("'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
  122
+<span class='line'>115</span> </span><span class="WHIT">          </span><span class="PUNC">(</span><span class="NAME">options.protocol</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT">  </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">options.protocol</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">':'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
  123
+<span class='line'>116</span> </span><span class="WHIT">          </span><span class="STRN">'//'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hostServer</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">':'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hostPort</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'", '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">options.client</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">');\n'</span><span class="PUNC">;</span><span class="WHIT">
  124
+<span class='line'>117</span> </span><span class="WHIT">      </span><span class="NAME">nowText</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">initString</span><span class="PUNC">;</span><span class="WHIT">
  125
+<span class='line'>118</span> 
  126
+<span class='line'>119</span> </span><span class="WHIT">      </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">nowText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  127
+<span class='line'>120</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  128
+<span class='line'>121</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
  129
+<span class='line'>122</span> </span><span class="WHIT">    </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="STRN">"/client/now.js not found while reading file"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  130
+<span class='line'>123</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
  131
+<span class='line'>124</span> </span><span class="WHIT">  
  132
+<span class='line'>125</span>   </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  133
+<span class='line'>126</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  134
+<span class='line'>127</span> 
  135
+<span class='line'>128</span> </span><span class="NAME">exports.generateClientLibs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">generateClientLibs</span><span class="PUNC">;</span><span class="WHIT">
  136
+<span class='line'>129</span> </span></pre></body></html>
59  doc/jsdoc/symbols/src/now_lib_function.js.html
... ...
@@ -0,0 +1,59 @@
  1
+<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
  2
+	.KEYW {color: #933;}
  3
+	.COMM {color: #bbb; font-style: italic;}
  4
+	.NUMB {color: #393;}
  5
+	.STRN {color: #393;}
  6
+	.REGX {color: #339;}
  7
+	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
  8
+	</style></head><body><pre><span class='line'>  1</span> <span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nowUtil</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">require</span><span class="PUNC">(</span><span class="STRN">'./nowUtil'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">nowUtil</span><span class="PUNC">;</span><span class="WHIT">
  9
+<span class='line'>  2</span> 
  10
+<span class='line'>  3</span> </span><span class="NAME">exports.init</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowjs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  11
+<span class='line'>  4</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  12
+<span class='line'>  5</span> </span><span class="WHIT">    </span><span class="NAME">multicall</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  13
+<span class='line'>  6</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">args</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nowUtil.clone</span><span class="PUNC">(</span><span class="NAME">Array.prototype</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  14
+<span class='line'>  7</span> </span><span class="WHIT">      </span><span class="NAME">nowjs.emit</span><span class="PUNC">(</span><span class="STRN">'multicall'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  15
+<span class='line'>  8</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
  16
+<span class='line'>  9</span> 
  17
+<span class='line'> 10</span> </span><span class="WHIT">    </span><span class="NAME">remotecall</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  18
+<span class='line'> 11</span> </span><span class="WHIT">      </span><span class="COMM">// Coerce arguments to an array.</span><span class="WHIT">
  19
+<span class='line'> 12</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">args</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nowUtil.clone</span><span class="PUNC">(</span><span class="NAME">Array.prototype</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  20
+<span class='line'> 13</span> </span><span class="WHIT">      </span><span class="COMM">// Find functions in the args, and store functions in</span><span class="WHIT">
  21
+<span class='line'> 14</span> </span><span class="WHIT">      </span><span class="COMM">// closure table and serialize functions.</span><span class="WHIT">
  22
+<span class='line'> 15</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">closureId</span><span class="PUNC">;</span><span class="WHIT">
  23
+<span class='line'> 16</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ii</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">args.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">ii</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  24
+<span class='line'> 17</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  25
+<span class='line'> 18</span> </span><span class="WHIT">          </span><span class="NAME">closureId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'closure_'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'_'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">nowUtil.generateRandomString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  26
+<span class='line'> 19</span> </span><span class="WHIT">          </span><span class="NAME">nowjs.closures</span><span class="PUNC">[</span><span class="NAME">closureId</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
  27
+<span class='line'> 20</span> </span><span class="WHIT">          </span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">fqn</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">closureId</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  28
+<span class='line'> 21</span> </span><span class="WHIT">          </span><span class="NAME">setTimeout</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  29
+<span class='line'> 22</span> </span><span class="WHIT">            </span><span class="NAME">nowjs.closures</span><span class="PUNC">[</span><span class="NAME">closureId</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nowUtil.noop</span><span class="PUNC">;</span><span class="WHIT">
  30
+<span class='line'> 23</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nowjs.options.closureTimeout</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  31
+<span class='line'> 24</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
  32
+<span class='line'> 25</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
  33
+<span class='line'> 26</span> </span><span class="WHIT">      </span><span class="COMM">// On the next tick, send the remoteCall request</span><span class="WHIT">
  34
+<span class='line'> 27</span> </span><span class="WHIT">      </span><span class="NAME">this.socket.emit</span><span class="PUNC">(</span><span class="STRN">'rfc'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">fqn</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.fqn</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  35
+<span class='line'> 28</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
  36
+<span class='line'> 29</span> </span><span class="WHIT">    </span><span class="NAME">closurecall</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
  37
+<span class='line'> 30</span> </span><span class="WHIT">    </span><span class="COMM">// Coerce arguments to an array.</span><span class="WHIT">
  38
+<span class='line'> 31</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">args</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
  39
+<span class='line'> 32</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ii</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arguments.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">ii</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  40
+<span class='line'> 33</span> </span><span class="WHIT">        </span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
  41
+<span class='line'> 34</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
  42
+<span class='line'> 35</span> </span><span class="WHIT">      </span><span class="COMM">// Find functions in the args, and store functions usin</span><span class="WHIT">
  43
+<span class='line'> 36</span> </span><span class="WHIT">      </span><span class="COMM">// closure table and serialize functions.</span><span class="WHIT">
  44
+<span class='line'> 37</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">closureId</span><span class="PUNC">;</span><span class="WHIT">
  45
+<span class='line'> 38</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ii</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">args.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">ii</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  46
+<span class='line'> 39</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  47
+<span class='line'> 40</span> </span><span class="WHIT">          </span><span class="NAME">closureId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'closure_'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'_'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">nowUtil.generateRandomString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  48
+<span class='line'> 41</span> </span><span class="WHIT">          </span><span class="NAME">nowjs.closures</span><span class="PUNC">[</span><span class="NAME">closureId</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
  49
+<span class='line'> 42</span> </span><span class="WHIT">          </span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">fqn</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">closureId</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  50
+<span class='line'> 43</span> </span><span class="WHIT">          </span><span class="NAME">setTimeout</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  51
+<span class='line'> 44</span> </span><span class="WHIT">            </span><span class="NAME">nowjs.closures</span><span class="PUNC">[</span><span class="NAME">closureId</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nowUtil.noop</span><span class="PUNC">;</span><span class="WHIT">
  52
+<span class='line'> 45</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nowjs.options.closureTimeout</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  53
+<span class='line'> 46</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
  54
+<span class='line'> 47</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
  55
+<span class='line'> 48</span> </span><span class="WHIT">      </span><span class="NAME">this.socket.write</span><span class="PUNC">(</span><span class="NAME">JSON.stringify</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">type</span><span class="PUNC">:</span><span class="STRN">'closurecall'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fqn</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.fqn</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  56
+<span class='line'> 49</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
  57
+<span class='line'> 50</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  58
+<span class='line'> 51</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  59
+<span class='line'> 52</span> </span></pre></body></html>
342  doc/jsdoc/symbols/src/now_lib_group.js.html
... ...
@@ -0,0 +1,342 @@
  1
+<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
  2
+	.KEYW {color: #933;}
  3
+	.COMM {color: #bbb; font-style: italic;}
  4
+	.NUMB {color: #393;}
  5
+	.STRN {color: #393;}
  6
+	.REGX {color: #339;}
  7
+	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
  8
+	</style></head><body><pre><span class='line'>  1</span> <span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">EventEmitter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">require</span><span class="PUNC">(</span><span class="STRN">'events'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">EventEmitter</span><span class="PUNC">;</span><span class="WHIT">
  9
+<span class='line'>  2</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nowUtil</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">require</span><span class="PUNC">(</span><span class="STRN">'./nowUtil'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">nowUtil</span><span class="PUNC">;</span><span class="WHIT">
  10
+<span class='line'>  3</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">Proxy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">require</span><span class="PUNC">(</span><span class="STRN">'./proxy'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  11
+<span class='line'>  4</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ScopeTable</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">require</span><span class="PUNC">(</span><span class="STRN">'./scopeTable'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">ScopeTable</span><span class="PUNC">;</span><span class="WHIT">
  12
+<span class='line'>  5</span> 
  13
+<span class='line'>  6</span> </span><span class="NAME">exports.initialize</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowjs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  14
+<span class='line'>  7</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">require</span><span class="PUNC">(</span><span class="STRN">'./function'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">init</span><span class="PUNC">(</span><span class="NAME">nowjs</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  15
+<span class='line'>  8</span> 
  16
+<span class='line'>  9</span> </span><span class="WHIT">  </span><span class="COMM">/**
  17
+<span class='line'> 10</span>    * @name Group
  18
+<span class='line'> 11</span> 
  19
+<span class='line'> 12</span>    * @class Represents a group containing some subset of all
  20
+<span class='line'> 13</span>      users. Each group has its own {@link Group#now} namespace.
  21
+<span class='line'> 14</span> 
  22
+<span class='line'> 15</span>    * @property {String} groupName The name associated with the group.
  23
+<span class='line'> 16</span>    * @see nowjs#getGroup
  24
+<span class='line'> 17</span>    * @see Group#now
  25
+<span class='line'> 18</span>    */</span><span class="WHIT">
  26
+<span class='line'> 19</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">Group</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">groupName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  27
+<span class='line'> 20</span> </span><span class="WHIT">    </span><span class="COMM">// all users in the group</span><span class="WHIT">
  28
+<span class='line'> 21</span> </span><span class="WHIT">    </span><span class="NAME">this.users</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  29
+<span class='line'> 22</span> 
  30
+<span class='line'> 23</span> </span><span class="WHIT">    </span><span class="NAME">this.groupName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">groupName</span><span class="PUNC">;</span><span class="WHIT">
  31
+<span class='line'> 24</span> 
  32
+<span class='line'> 25</span> </span><span class="WHIT">    </span><span class="NAME">this.excludes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  33
+<span class='line'> 26</span> </span><span class="WHIT">    </span><span class="COMM">/**
  34
+<span class='line'> 27</span>      * @name Group#now
  35
+<span class='line'> 28</span>      * @namespace The now namespace for this particular group. Actions
  36
+<span class='line'> 29</span>      * to this namespace affect all users that are members of the
  37
+<span class='line'> 30</span>      * group. All functions that are called will be called in the
  38
+<span class='line'> 31</span>      * context of each individual user in the group.
  39
+<span class='line'> 32</span> 
  40
+<span class='line'> 33</span>      * @example everyone.now.prop = 42;
  41
+<span class='line'> 34</span>      * @example everyone.now.func = function () {
  42
+<span class='line'> 35</span>      *  console.log('hello!');
  43
+<span class='line'> 36</span>      * };
  44
+<span class='line'> 37</span>      */</span><span class="WHIT">
  45
+<span class='line'> 38</span> </span><span class="WHIT">    </span><span class="NAME">this.now</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Proxy.wrap</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  46
+<span class='line'> 39</span> </span><span class="WHIT">    </span><span class="COMM">// group scope table</span><span class="WHIT">
  47
+<span class='line'> 40</span> </span><span class="WHIT">    </span><span class="NAME">this.scopeTable</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ScopeTable</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  48
+<span class='line'> 41</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  49
+<span class='line'> 42</span> 
  50
+<span class='line'> 43</span> </span><span class="WHIT">  </span><span class="NAME">Group.prototype.__proto__</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">EventEmitter.prototype</span><span class="PUNC">;</span><span class="WHIT">
  51
+<span class='line'> 44</span> 
  52
+<span class='line'> 45</span> </span><span class="WHIT">  </span><span class="COMM">/**
  53
+<span class='line'> 46</span>    * @name count
  54
+<span class='line'> 47</span>    * @function
  55
+<span class='line'> 48</span>    * @memberOf Group#
  56
+<span class='line'> 49</span> 
  57
+<span class='line'> 50</span>    * @description Used to find the cardinality of the group (how
  58
+<span class='line'> 51</span>    * many users it contains).
  59
+<span class='line'> 52</span> 
  60
+<span class='line'> 53</span>    * @param {Function} callback Called with a Number corresponding to
  61
+<span class='line'> 54</span>    * the group's user count.
  62
+<span class='line'> 55</span> 
  63
+<span class='line'> 56</span>    * @example everyone.count(function (ct) {
  64
+<span class='line'> 57</span>    *   console.log(ct);
  65
+<span class='line'> 58</span>    * });
  66
+<span class='line'> 59</span>    */</span><span class="WHIT">
  67
+<span class='line'> 60</span> </span><span class="WHIT">  </span><span class="NAME">Group.prototype.count</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  68
+<span class='line'> 61</span> </span><span class="WHIT">    </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">Object.keys</span><span class="PUNC">(</span><span class="NAME">this.users</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  69
+<span class='line'> 62</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  70
+<span class='line'> 63</span> 
  71
+<span class='line'> 64</span> </span><span class="WHIT">  </span><span class="COMM">/**
  72
+<span class='line'> 65</span>    * @name getUsers
  73
+<span class='line'> 66</span>    * @function
  74
+<span class='line'> 67</span>    * @memberOf Group#
  75
+<span class='line'> 68</span> 
  76
+<span class='line'> 69</span>    * @description Used to retrieve a list of the client IDs
  77
+<span class='line'> 70</span>    * corresponding to all users in the group.
  78
+<span class='line'> 71</span> 
  79
+<span class='line'> 72</span>    * @param {Function} callback Called with an Array of Strings
  80
+<span class='line'> 73</span>    * corresponding to the client IDs of all users in the group.
  81
+<span class='line'> 74</span> 
  82
+<span class='line'> 75</span>    * @example everyone.getUsers(function (users) {
  83
+<span class='line'> 76</span>    *   for (var i = 0; i &lt; users.length; i++) console.log(users[i]);
  84
+<span class='line'> 77</span>    * });
  85
+<span class='line'> 78</span> 
  86
+<span class='line'> 79</span>    * @see nowjs#getClient
  87
+<span class='line'> 80</span>    */</span><span class="WHIT">
  88
+<span class='line'> 81</span> </span><span class="WHIT">  </span><span class="NAME">Group.prototype.getUsers</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  89
+<span class='line'> 82</span> </span><span class="WHIT">    </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">Object.keys</span><span class="PUNC">(</span><span class="NAME">this.users</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  90
+<span class='line'> 83</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  91
+<span class='line'> 84</span> 
  92
+<span class='line'> 85</span> </span><span class="WHIT">  </span><span class="COMM">/**
  93
+<span class='line'> 86</span>    * @name connected
  94
+<span class='line'> 87</span>    * @function
  95
+<span class='line'> 88</span>    * @memberOf Group#
  96
+<span class='line'> 89</span>    * @deprecated As of 0.7.0. Use nowjs:connect instead.
  97
+<span class='line'> 90</span>    */</span><span class="WHIT">
  98
+<span class='line'> 91</span> </span><span class="WHIT">  </span><span class="NAME">Group.prototype.connected</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  99
+<span class='line'> 92</span> </span><span class="WHIT">    </span><span class="NAME">nowjs.on</span><span class="PUNC">(</span><span class="STRN">'connect'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  100
+<span class='line'> 93</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  101
+<span class='line'> 94</span> 
  102
+<span class='line'> 95</span> </span><span class="WHIT">  </span><span class="COMM">/**
  103
+<span class='line'> 96</span>    * @name disconnected
  104
+<span class='line'> 97</span>    * @function
  105
+<span class='line'> 98</span>    * @memberOf Group#
  106
+<span class='line'> 99</span>    * @deprecated As of 0.7.0. Use nowjs:disconnect instead.
  107
+<span class='line'>100</span>    */</span><span class="WHIT">
  108
+<span class='line'>101</span> </span><span class="WHIT">  </span><span class="NAME">Group.prototype.disconnected</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  109
+<span class='line'>102</span> </span><span class="WHIT">    </span><span class="NAME">nowjs.on</span><span class="PUNC">(</span><span class="STRN">'disconnect'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  110
+<span class='line'>103</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  111
+<span class='line'>104</span> 
  112
+<span class='line'>105</span> </span><span class="WHIT">  </span><span class="COMM">/**
  113
+<span class='line'>106</span>    * @name addUser
  114
+<span class='line'>107</span>    * @function
  115
+<span class='line'>108</span>    * @memberOf Group#
  116
+<span class='line'>109</span>    * @description Adds the user identified by clientId to this group.
  117
+<span class='line'>110</span> 
  118
+<span class='line'>111</span>    * @param {String} clientId The client ID associated with the target
  119
+<span class='line'>112</span>    * user.
  120
+<span class='line'>113</span> 
  121
+<span class='line'>114</span>    * @example everyone.addUser('1234567890');
  122
+<span class='line'>115</span>    */</span><span class="WHIT">
  123
+<span class='line'>116</span> </span><span class="WHIT">  </span><span class="NAME">Group.prototype.addUser</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">clientId</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  124
+<span class='line'>117</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
  125
+<span class='line'>118</span> </span><span class="WHIT">    </span><span class="NAME">this.hasClient</span><span class="PUNC">(</span><span class="NAME">clientId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hasClient</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  126
+<span class='line'>119</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hasClient</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  127
+<span class='line'>120</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
  128
+<span class='line'>121</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
  129
+<span class='line'>122</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.excludes</span><span class="PUNC">[</span><span class="NAME">clientId</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  130
+<span class='line'>123</span> </span><span class="WHIT">        </span><span class="NAME">self.excludes</span><span class="PUNC">[</span><span class="NAME">clientId</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
  131
+<span class='line'>124</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
  132
+<span class='line'>125</span> </span><span class="WHIT">      </span><span class="NAME">nowjs.getClient</span><span class="PUNC">(</span><span class="NAME">clientId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  133
+<span class='line'>126</span> </span><span class="WHIT">        </span><span class="COMM">// Scoping note: `self` refers to the group, `this` refers to</span><span class="WHIT">
  134
+<span class='line'>127</span> </span><span class="WHIT">        </span><span class="COMM">// the new client.</span><span class="WHIT">
  135
+<span class='line'>128</span> </span><span class="WHIT">        </span><span class="NAME">self.users</span><span class="PUNC">[</span><span class="NAME">this.user.clientId</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
  136
+<span class='line'>129</span> </span><span class="WHIT">        </span><span class="NAME">this.groups</span><span class="PUNC">[</span><span class="NAME">self.groupName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">;</span><span class="WHIT">
  137
+<span class='line'>130</span> 
  138
+<span class='line'>131</span> </span><span class="WHIT">        </span><span class="COMM">// Send the client any new variables that it does not already have</span><span class="WHIT">
  139
+<span class='line'>132</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">toSend</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  140
+<span class='line'>133</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Object.keys</span><span class="PUNC">(</span><span class="NAME">self.scopeTable.data</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  141
+<span class='line'>134</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">;</span><span class="WHIT">
  142
+<span class='line'>135</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ll</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">keys.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">ll</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  143
+<span class='line'>136</span> </span><span class="WHIT">          </span><span class="NAME">key</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">keys</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
  144
+<span class='line'>137</span> </span><span class="WHIT">          </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.scopeTable.get</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  145
+<span class='line'>138</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">nowUtil.noop</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">Array.isArray</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
  146
+<span class='line'>139</span> </span><span class="WHIT">              </span><span class="PUNC">!</span><span class="NAME">nowUtil.hasProperty</span><span class="PUNC">(</span><span class="NAME">this.scopeTable.data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">key</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  147
+<span class='line'>140</span> </span><span class="WHIT">            </span><span class="NAME">toSend</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nowUtil.getValOrFqn</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">key</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  148
+<span class='line'>141</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT">
  149
+<span class='line'>142</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
  150
+<span class='line'>143</span> 
  151
+<span class='line'>144</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.isSuperGroup</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">nowUtil.isEmptyObj</span><span class="PUNC">(</span><span class="NAME">toSend</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  152
+<span class='line'>145</span> </span><span class="WHIT">          </span><span class="NAME">this.socket.emit</span><span class="PUNC">(</span><span class="STRN">'rv'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">toSend</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  153
+<span class='line'>146</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
  154
+<span class='line'>147</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">user</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nowUtil.clone</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">'_events'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">self._events</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  155
+<span class='line'>148</span> 
  156
+<span class='line'>149</span> </span><span class="WHIT">        </span><span class="COMM">/**
  157
+<span class='line'>150</span>          * @name Group#join
  158
+<span class='line'>151</span>          * @event
  159
+<span class='line'>152</span>          * @description Called in the context of a user who has just been
  160
+<span class='line'>153</span>          * added to the group.
  161
+<span class='line'>154</span> 
  162
+<span class='line'>155</span>          * @example everyone.on('join', function () {
  163
+<span class='line'>156</span>          *   otherGroup.addUser(this.user.clientId);
  164
+<span class='line'>157</span>          * });
  165
+<span class='line'>158</span>          */</span><span class="WHIT">
  166
+<span class='line'>159</span> </span><span class="WHIT">        </span><span class="NAME">self.emit.call</span><span class="PUNC">(</span><span class="NAME">user</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'join'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  167
+<span class='line'>160</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  168
+<span class='line'>161</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  169
+<span class='line'>162</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
  170
+<span class='line'>163</span> 
  171
+<span class='line'>164</span> </span><span class="WHIT">  </span><span class="COMM">/**
  172
+<span class='line'>165</span>    * @name removeUser
  173
+<span class='line'>166</span>    * @function
  174
+<span class='line'>167</span>    * @memberOf Group#
  175
+<span class='line'>168</span>    * @version 0.7.0
  176
+<span class='line'>169</span>    * @description Removes the user identified by clientId from this group.
  177
+<span class='line'>170</span> 
  178
+<span class='line'>171</span>    * @param {String} clientId The client ID associated with the target
  179
+<span class='line'>172</span>    * user.
  180
+<span class='line'>173</span> 
  181
+<span class='line'>174</span>    * @example otherGroup.removeUser('1234567890');
  182
+<span class='line'>175</span>    */</span><span class="WHIT">
  183
+<span class='line'>176</span> </span><span class="WHIT">  </span><span class="NAME">Group.prototype.removeUser</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">clientId</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  184
+<span class='line'>177</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
  185
+<span class='line'>178</span> </span><span class="WHIT">    </span><span class="NAME">this.hasClient</span><span class="PUNC">(</span><span class="NAME">clientId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hasClient</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  186
+<span class='line'>179</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">hasClient</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
  187
+<span class='line'>180</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
  188
+<span class='line'>181</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
  189
+<span class='line'>182</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">user</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nowUtil.clone</span><span class="PUNC">(</span><span class="NAME">self.users</span><span class="PUNC">[</span><span class="NAME">clientId</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">'_events'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">self._events</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
  190
+<span class='line'>183</span> 
  191
+<span class='line'>184</span> </span><span class="WHIT">      </span><span class="COMM">/**
  192
+<span class='line'>185</span>        * @name Group#leave
  193
+<span class='line'>186</span>        * @event
  194
+<span class='line'>187</span>        * @version 0.7.0
  195
+<span class='line'>188</span>        * @description Called in the context of a user who has just been
  196
+<span class='line'>189</span>        * removed from the group.
  197
+<span class='line'>190</span> 
  198
+<span class='line'>191</span>        * @example otherGroup.on('leave', function () {
  199
+<span class='line'>192</span>        *   // Store the context, i.e. the user who has just left.
  200
+<span class='line'>193</span>        *   var self = this;
  201
+<span class='line'>194</span>        *   // Check that the user is still connected to the server.
  202
+<span class='line'>195</span>        *   everyone.hasClient(this.user.clientId, function (bool) {
  203
+<span class='line'>196</span>        *     if (bool) {
  204
+<span class='line'>197</span>        *       // Send parting words to the client.
  205
+<span class='line'>198</span>        *       this.now.receive('SERVER', 'Goodbye. I'll miss you dearly.');
  206
+<span class='line'>199</span>        *     }
  207
+<span class='line'>200</span>        *   });
  208
+<span class='line'>201</span>        * });
  209
+<span class='line'>202</span>        */</span><span class="WHIT">
  210
+<span class='line'>203</span> </span><span class="WHIT">      &l