|
|
@@ -395,7 +395,8 @@ define([
|
|
|
doc_id: this.doc_id,
|
|
|
remote_doc_id: update != null ? update.doc : undefined,
|
|
|
wantToBeJoined: this.wantToBeJoined,
|
|
|
- update
|
|
|
+ update,
|
|
|
+ hasDoc: (this.doc != null)
|
|
|
})
|
|
|
|
|
|
if (
|
|
|
@@ -420,6 +421,9 @@ define([
|
|
|
(update != null ? update.doc : undefined) === this.doc_id &&
|
|
|
this.doc != null
|
|
|
) {
|
|
|
+ this.ide.pushEvent('received-update:processing', {
|
|
|
+ update
|
|
|
+ })
|
|
|
this.doc.processUpdateFromServer(update)
|
|
|
|
|
|
if (!this.wantToBeJoined) {
|
|
|
@@ -476,6 +480,10 @@ define([
|
|
|
callback = function(error) {}
|
|
|
}
|
|
|
if (this.doc != null) {
|
|
|
+ this.ide.pushEvent('joinDoc:existing', {
|
|
|
+ doc_id: this.doc_id,
|
|
|
+ version: this.doc.getVersion()
|
|
|
+ })
|
|
|
return this.ide.socket.emit(
|
|
|
'joinDoc',
|
|
|
this.doc_id,
|
|
|
@@ -496,6 +504,9 @@ define([
|
|
|
}
|
|
|
)
|
|
|
} else {
|
|
|
+ this.ide.pushEvent('joinDoc:new', {
|
|
|
+ doc_id: this.doc_id
|
|
|
+ })
|
|
|
return this.ide.socket.emit(
|
|
|
'joinDoc',
|
|
|
this.doc_id,
|
|
|
@@ -505,6 +516,10 @@ define([
|
|
|
return callback(error)
|
|
|
}
|
|
|
this.joined = true
|
|
|
+ this.ide.pushEvent('joinDoc:inited', {
|
|
|
+ doc_id: this.doc_id,
|
|
|
+ version
|
|
|
+ })
|
|
|
this.doc = new ShareJsDoc(
|
|
|
this.doc_id,
|
|
|
docLines,
|