Comparing version 0.3.2 to 0.4.0
@@ -639,7 +639,7 @@ (function (root, factory) { | ||
this.reset(protocol[1], protocol[2], protocol[3]); | ||
this.clientState = STATE_READY; | ||
this.ready(); | ||
this.sendToServer(); | ||
} else if (messageType === PROTOCOL_DELTA_SINCE) { | ||
this.receiveChange(protocol); | ||
this.clientState = STATE_READY; | ||
this.ready(); | ||
this.sendToServer(); | ||
@@ -677,2 +677,6 @@ } else if (messageType === PROTOCOL_DELTA) { | ||
}, | ||
ready: function() { | ||
this.clientState = STATE_READY; | ||
this.emit('ready', {}); | ||
}, | ||
// Emit change / localChange events using their proper formats. | ||
@@ -679,0 +683,0 @@ // eventName: either 'change' or 'localChange'. |
{ | ||
"name": "canop", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"description": "Convergent algorithm for collaborative text.", | ||
@@ -5,0 +5,0 @@ "main": "canop.js", |
@@ -28,2 +28,3 @@ `canop` | ||
client.emit('syncing'); | ||
client.once('ready', function() {…}); | ||
@@ -37,4 +38,5 @@ client.get(['some']); // 'data' | ||
// Also, connected is signaled when a node joins or leaves. | ||
client.signal({ name: 'Grace', focus: ['some'], sel: [[9,9]] }); | ||
client.signal({connectred: true, name: 'Grace', focus: ['some'], sel: [[9,9]]}); | ||
client.clientCount // Number of clients currently connected. | ||
client.signalFromClient[clientId] // aggregate of a client’s signals | ||
@@ -151,2 +153,3 @@ // This event has the following keys: | ||
- Readonly clients | ||
- Textarea adapter | ||
@@ -153,0 +156,0 @@ - Customizable UI sync debouncing |
@@ -184,2 +184,3 @@ (function(exports, undefined) { | ||
this.clientSelectionWidgets[clientId] || []; | ||
var signals = this.canopClient.signalFromClient[clientId]; | ||
@@ -189,4 +190,3 @@ // Clear existing widgets. | ||
for (var i = 0; i < widgets.length; i++) { | ||
var widget = widgets[i]; | ||
widget.clear(); | ||
widgets[i].clear(); | ||
} | ||
@@ -200,3 +200,3 @@ | ||
// TODO: use a signaled name instead of the clientId. | ||
var widgets = this.addSelection(selection, clientId); | ||
var widgets = this.addSelection(selection, signals.name || clientId); | ||
this.clientSelectionWidgets[clientId] = | ||
@@ -203,0 +203,0 @@ this.clientSelectionWidgets[clientId].concat(widgets); |
Sorry, the diff of this file is not supported yet
253042
19
1765
158