Commit cda028bf authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

В asc_CUser добавил цвет пользователя.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55577 954022d7-b5bf-4e40-9824-e11837661b57
parent 286b7cec
...@@ -640,10 +640,8 @@ ...@@ -640,10 +640,8 @@
if (participants) { if (participants) {
var tmpUser, countEditUsers = 0; var tmpUser, countEditUsers = 0;
for (var i = 0; i < participants.length; ++i) { for (var i = 0; i < participants.length; ++i) {
tmpUser = new asc_user (); tmpUser = new asc_user(participants[i]);
tmpUser.asc_setId (participants[i]["id"]); this._participants.push(tmpUser);
tmpUser.asc_setUserName (participants[i]["username"]);
this._participants.push (tmpUser);
// Считаем число всех пользователей (и тех кто просматривает тоже) // Считаем число всех пользователей (и тех кто просматривает тоже)
++countEditUsers; ++countEditUsers;
} }
...@@ -666,10 +664,7 @@ ...@@ -666,10 +664,7 @@
DocsCoApi.prototype._onConnectionStateChanged = function (data) { DocsCoApi.prototype._onConnectionStateChanged = function (data) {
var userStateChanged = null; var userStateChanged = null;
if (undefined !== data["state"] && this.onConnectionStateChanged) { if (undefined !== data["state"] && this.onConnectionStateChanged) {
userStateChanged = new asc_user(); userStateChanged = new asc_user(data);
userStateChanged.asc_setId(data["id"]);
userStateChanged.asc_setUserName(data["username"]);
userStateChanged.asc_setState(data["state"]);
this.onConnectionStateChanged(userStateChanged); this.onConnectionStateChanged(userStateChanged);
} }
}; };
......
"use strict"; /* docscoapicommon.js * * Author: Alexander.Trofimov * Date: 09.11.12 */( /** * @param {Window} window * @param {undefined} undefined */ function (window, undefined) { /* * Import * ----------------------------------------------------------------------------- */ var asc = window["Asc"] ? window["Asc"] : (window["Asc"] = {}); var prot; /** * Класс user для совместного редактирования/просмотра документа * ----------------------------------------------------------------------------- * * @constructor * @memberOf Asc */ function asc_CUser () { if ( !(this instanceof asc_CUser) ) { return new asc_CUser(); } this.id = null; // уникальный id - пользователя this.userName = null; // имя пользователя this.state = undefined; // состояние (true - подключен, false - отключился) return this; } asc_CUser.prototype = { constructor: asc_CUser, asc_getId: function () { return this.id; }, asc_getUserName: function () { return this.userName; }, asc_getState: function () { return this.state; }, asc_setId: function (val) { this.id = val; }, asc_setUserName: function (val) { this.userName = val; }, asc_setState: function (val) { this.state = val; } }; /* * Export * ----------------------------------------------------------------------------- */ window["Asc"]["asc_CUser"] = window["Asc"].asc_CUser = asc_CUser; prot = asc_CUser.prototype; prot["asc_getId"] = prot.asc_getId; prot["asc_getUserName"] = prot.asc_getUserName; prot["asc_getState"] = prot.asc_getState; prot["asc_setId"] = prot.asc_setId; prot["asc_setUserName"] = prot.asc_setUserName; prot["asc_setState"] = prot.asc_setState; } )(window); "use strict"; /* docscoapicommon.js * * Author: Alexander.Trofimov * Date: 09.11.12 */( /** * @param {Window} window * @param {undefined} undefined */ function (window, undefined) { /* * Import * ----------------------------------------------------------------------------- */ var asc = window["Asc"] ? window["Asc"] : (window["Asc"] = {}); var prot; /** * Класс user для совместного редактирования/просмотра документа * ----------------------------------------------------------------------------- * * @constructor * @memberOf Asc */ function asc_CUser (val) { if ( !(this instanceof asc_CUser) ) { return new asc_CUser(val); } this.id = null; // уникальный id - пользователя this.userName = null; // имя пользователя this.state = undefined; // состояние (true - подключен, false - отключился) this.color = null; // цвет пользователя this._setUser(val); return this; } asc_CUser.prototype = { constructor: asc_CUser, _setUser: function (val) { if (val) { this.id = val["id"]; this.userName = val["username"]; this.color = val["color"]; this.state = val["state"]; } }, asc_getId: function () { return this.id; }, asc_getUserName: function () { return this.userName; }, asc_getState: function () { return this.state; }, asc_getColor: function () { return this.color; } }; /* * Export * ----------------------------------------------------------------------------- */ window["Asc"]["asc_CUser"] = window["Asc"].asc_CUser = asc_CUser; prot = asc_CUser.prototype; prot["asc_getId"] = prot.asc_getId; prot["asc_getUserName"] = prot.asc_getUserName; prot["asc_getState"] = prot.asc_getState; prot["asc_getColor"] = prot.asc_getColor; } )(window);
\ No newline at end of file \ No newline at end of file
......
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