Commit 5f3640cb authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Добавил при отправке сообщений флаг clear (очистки предыдущего списка сообщений)

bug #28773

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61475 954022d7-b5bf-4e40-9824-e11837661b57
parent 0929f1ca
......@@ -35,7 +35,7 @@
var t = this;
this._CoAuthoringApi.onAuthParticipantsChanged = function (e, count) {t.callback_OnAuthParticipantsChanged(e, count);};
this._CoAuthoringApi.onParticipantsChanged = function (e, count) {t.callback_OnParticipantsChanged(e, count);};
this._CoAuthoringApi.onMessage = function (e) {t.callback_OnMessage(e);};
this._CoAuthoringApi.onMessage = function (e, clear) {t.callback_OnMessage(e, clear);};
this._CoAuthoringApi.onLocksAcquired = function (e) {t.callback_OnLocksAcquired(e);};
this._CoAuthoringApi.onLocksReleased = function (e, bChanges) {t.callback_OnLocksReleased(e, bChanges);};
this._CoAuthoringApi.onLocksReleasedEnd = function () {t.callback_OnLocksReleasedEnd();};
......@@ -166,9 +166,9 @@
this.onParticipantsChanged(e, count);
};
CDocsCoApi.prototype.callback_OnMessage = function (e) {
CDocsCoApi.prototype.callback_OnMessage = function (e, clear) {
if (this.onMessage)
this.onMessage(e);
this.onMessage(e, clear);
};
CDocsCoApi.prototype.callback_OnLocksAcquired = function (e) {
......@@ -523,9 +523,9 @@
}
};
DocsCoApi.prototype._onMessages = function (data) {
DocsCoApi.prototype._onMessages = function (data, clear) {
if (data["messages"] && this.onMessage)
this.onMessage(data["messages"]);
this.onMessage(data["messages"], clear);
};
DocsCoApi.prototype._onGetLock = function (data) {
......@@ -795,6 +795,7 @@
//if (this.ownedLockBlocks && this.ownedLockBlocks.length > 0) {
// this._onPreviousLocks(data["locks"], this.ownedLockBlocks);
//}
this._onMessages(data, true);
this._onGetLock(data);
return;
}
......@@ -811,7 +812,7 @@
this._onSetIndexUser(this._indexUser = data['indexUser']);
this._userId = this._user.asc_getId() + this._indexUser;
this._onMessages(data);
this._onMessages(data, false);
this._onGetLock(data);
// Применения изменений пользователя
......@@ -910,7 +911,7 @@
var type = dataObject.type;
switch (type) {
case 'auth' : t._onAuth(dataObject); break;
case 'message' : t._onMessages(dataObject); break;
case 'message' : t._onMessages(dataObject, false); break;
case 'getLock' : t._onGetLock(dataObject); break;
case 'releaseLock' : t._onReleaseLock(dataObject); break;
case 'connectState' : t._onConnectionStateChanged(dataObject); break;
......
......@@ -1539,7 +1539,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
}
this.CoAuthoringApi.onParticipantsChanged = function (e, count) { t.handlers.trigger("asc_onParticipantsChanged", e, count); };
this.CoAuthoringApi.onAuthParticipantsChanged = function (e, count) { t.handlers.trigger("asc_onAuthParticipantsChanged", e, count); };
this.CoAuthoringApi.onMessage = function (e) { t.handlers.trigger("asc_onCoAuthoringChatReceiveMessage", e); };
this.CoAuthoringApi.onMessage = function (e, clear) { t.handlers.trigger("asc_onCoAuthoringChatReceiveMessage", e, clear); };
this.CoAuthoringApi.onConnectionStateChanged = function (e) { t.handlers.trigger("asc_onConnectionStateChanged", e); };
this.CoAuthoringApi.onLocksAcquired = function (e) {
if (2 != e["state"]) {
......
......@@ -273,8 +273,8 @@ asc_docs_api.prototype._coAuthoringInit = function () {
var t = this;
this.CoAuthoringApi.onParticipantsChanged = function (e, count) { t.asc_fireCallback("asc_onParticipantsChanged", e, count); };
this.CoAuthoringApi.onAuthParticipantsChanged = function (e, count) { t.asc_fireCallback("asc_onAuthParticipantsChanged", e, count); };
this.CoAuthoringApi.onMessage = function (e) { t.asc_fireCallback( "asc_onCoAuthoringChatReceiveMessage", e ); };
this.CoAuthoringApi.onConnectionStateChanged = function (e) { t.asc_fireCallback( "asc_onConnectionStateChanged", e ); };
this.CoAuthoringApi.onMessage = function (e, clear) { t.asc_fireCallback( "asc_onCoAuthoringChatReceiveMessage", e, clear); };
this.CoAuthoringApi.onConnectionStateChanged = function (e) { t.asc_fireCallback( "asc_onConnectionStateChanged", e); };
this.CoAuthoringApi.onLocksAcquired = function (e) {
if (2 != e["state"]) {
......
......@@ -2140,8 +2140,10 @@ $(document).ready(function(){
if ( Count > 0 )
g_oToolBox.Activate_Users();
});
editor.asc_registerCallback("asc_onCoAuthoringChatReceiveMessage", function(messages){
editor.asc_registerCallback("asc_onCoAuthoringChatReceiveMessage", function(messages, clear){
var messagesElement = $('#messagesView');
if (clear)
messagesElement.empty();
for (var message in messages)
messagesElement.append("<div>" + messages[message].user + ": " + messages[message].message + "</div>");
});
......
......@@ -1273,7 +1273,7 @@ asc_docs_api.prototype._coAuthoringInit = function()
t.asc_fireCallback("asc_onParticipantsChanged", e, CountEditUsers);
};
this.CoAuthoringApi.onAuthParticipantsChanged = function (e, count) { t.asc_fireCallback("asc_onAuthParticipantsChanged", e, count); };
this.CoAuthoringApi.onMessage = function (e, count) { t.asc_fireCallback("asc_onCoAuthoringChatReceiveMessage", e); };
this.CoAuthoringApi.onMessage = function (e, clear) { t.asc_fireCallback("asc_onCoAuthoringChatReceiveMessage", e, clear); };
this.CoAuthoringApi.onConnectionStateChanged = function (e) { t.asc_fireCallback("asc_onConnectionStateChanged", e); };
this.CoAuthoringApi.onLocksAcquired = function (e)
{
......
......@@ -3285,10 +3285,12 @@ $(".colorWatch").mouseover(function(){
if ( Count > 0 )
g_oToolBox.Activate_Users();
});
editor.asc_registerCallback("asc_onCoAuthoringChatReceiveMessage", function(messages){
var messagesElement = $('#messagesView');
for (var message in messages)
messagesElement.append("<div>" + messages[message].user + ": " + messages[message].message + "</div>");
editor.asc_registerCallback("asc_onCoAuthoringChatReceiveMessage", function(messages, clear){
var messagesElement = $('#messagesView');
if (clear)
messagesElement.empty();
for (var message in messages)
messagesElement.append("<div>" + messages[message].user + ": " + messages[message].message + "</div>");
});
editor.asc_registerCallback("asc_onDocumentContentReady", function(participants)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment