Commit 7b64d9cd authored by Ilya.Kirillov's avatar Ilya.Kirillov

Сделано, чтобы чужой курсор и чужие флажки были всегда темные.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66135 954022d7-b5bf-4e40-9824-e11837661b57
parent 8db388e0
...@@ -2067,6 +2067,8 @@ function CDrawingCollaborativeTarget() ...@@ -2067,6 +2067,8 @@ function CDrawingCollaborativeTarget()
this.HtmlElementX = 0; this.HtmlElementX = 0;
this.HtmlElementY = 0; this.HtmlElementY = 0;
this.Color = null;
this.Style = ""; this.Style = "";
} }
CDrawingCollaborativeTarget.prototype = CDrawingCollaborativeTarget.prototype =
...@@ -2086,7 +2088,21 @@ CDrawingCollaborativeTarget.prototype = ...@@ -2086,7 +2088,21 @@ CDrawingCollaborativeTarget.prototype =
var oUser = _drawing_doc.m_oWordControl.m_oApi.CoAuthoringApi.getUser(this.Id); var oUser = _drawing_doc.m_oWordControl.m_oApi.CoAuthoringApi.getUser(this.Id);
var nColor = oUser ? oUser.asc_getColorValue() : null; var nColor = oUser ? oUser.asc_getColorValue() : null;
var oColor = (null !== nColor ? new CDocumentColor( (nColor >> 16) & 0xFF, (nColor >> 8) & 0xFF, nColor & 0xFF ) : new CDocumentColor( 191, 255, 199 )); var oColor = (null !== nColor ? new CDocumentColor( (nColor >> 16) & 0xFF, (nColor >> 8) & 0xFF, nColor & 0xFF ) : new CDocumentColor( 191, 255, 199 ));
this.Style ="rgb(" + oColor.r + "," + oColor.g + "," + oColor.b + ")";
var Y = Math.max(0, Math.min(255, 0.299 * oColor.r + 0.587 * oColor.g + 0.114 * oColor.b));
var Cb = Math.max(0, Math.min(255, 128 - 0.168736 * oColor.r - 0.331264 * oColor.g + 0.5 * oColor.b));
var Cr = Math.max(0, Math.min(255, 128 + 0.5 * oColor.r - 0.418688 * oColor.g - 0.081312 * oColor.b));
if (Y > 63)
Y = 63;
var R = Math.max(0, Math.min(255, Y + 1.402 * (Cr - 128))) | 0;
var G = Math.max(0, Math.min(255, Y - 0.34414 * (Cb - 128) - 0.71414 * (Cr - 128))) | 0;
var B = Math.max(0, Math.min(255, Y + 1.772 * (Cb - 128) )) | 0;
this.Color = new CDocumentColor(R, G, B);
this.Style ="rgb(" + R + "," + G + "," + B + ")";
} }
// 2) определяем размер // 2) определяем размер
...@@ -6935,6 +6951,17 @@ function CDrawingDocument() ...@@ -6935,6 +6951,17 @@ function CDrawingDocument()
} }
} }
}; };
this.Collaborative_GetTargetColor = function(UserId)
{
for (var i = 0; i < this.CollaborativeTargets.length; i++)
{
if (UserId == this.CollaborativeTargets[i].Id)
return this.CollaborativeTargets[i].Color;
}
return null;
};
} }
function CStyleImage(_name, _ind, _type, _uiPriority) function CStyleImage(_name, _ind, _type, _uiPriority)
......
...@@ -415,12 +415,12 @@ CWordCollaborativeEditing.prototype.Show_ForeignCursorLabel = function(UserId) ...@@ -415,12 +415,12 @@ CWordCollaborativeEditing.prototype.Show_ForeignCursorLabel = function(UserId)
var PageIndex = Cursor.PageIndex; var PageIndex = Cursor.PageIndex;
var TextTransform = Cursor.Paragraph.Get_ParentTextTransform(); var TextTransform = Cursor.Paragraph.Get_ParentTextTransform();
var User = Api.CoAuthoringApi.getUser(UserId); var Color = DrawingDocument.Collaborative_GetTargetColor(UserId);
var nColor = User ? User.asc_getColorValue() : null; if (!Color)
var oColor = (null !== nColor ? new CDocumentColor((nColor >> 16) & 0xFF, (nColor >> 8) & 0xFF, nColor & 0xFF) : new CDocumentColor(191, 255, 199)); return;
var Coords = DrawingDocument.ConvertCoordsToCursorWR(X, Y, PageIndex, TextTransform); var Coords = DrawingDocument.ConvertCoordsToCursorWR(X, Y, PageIndex, TextTransform);
Api.sync_ShowForeignCursorLabel(UserId, Coords.X, Coords.Y, oColor); Api.sync_ShowForeignCursorLabel(UserId, Coords.X, Coords.Y, Color);
if (Cursor.ShowId) if (Cursor.ShowId)
clearTimeout(Cursor.ShowId); clearTimeout(Cursor.ShowId);
......
...@@ -5084,8 +5084,11 @@ asc_docs_api.prototype.sync_ShowForeignCursorLabel = function(UserId, X, Y, Colo ...@@ -5084,8 +5084,11 @@ asc_docs_api.prototype.sync_ShowForeignCursorLabel = function(UserId, X, Y, Colo
MMData.Type = c_oAscMouseMoveDataTypes.LockedObject; MMData.Type = c_oAscMouseMoveDataTypes.LockedObject;
MMData.UserId = UserId; MMData.UserId = UserId;
MMData.LockedObjectType = c_oAscMouseMoveLockedObjectType.Common; MMData.LockedObjectType = c_oAscMouseMoveLockedObjectType.Common;
MMData.Color = new CColor(Color.r, Color.g, Color.b, 255);
this.sync_MouseMoveCallback(MMData); this.sync_MouseMoveCallback(MMData);
this.sync_MouseMoveEndCallback(); this.sync_MouseMoveEndCallback();
//this.asc_fireCallback("asc_onShowForeignCursorLabel", UserId, X, Y, new CColor(Color.r, Color.g, Color.b, 255));
}; };
asc_docs_api.prototype.sync_HideForeignCursorLabel = function(UserId) asc_docs_api.prototype.sync_HideForeignCursorLabel = function(UserId)
{ {
...@@ -5095,6 +5098,8 @@ asc_docs_api.prototype.sync_HideForeignCursorLabel = function(UserId) ...@@ -5095,6 +5098,8 @@ asc_docs_api.prototype.sync_HideForeignCursorLabel = function(UserId)
MMData.Type = c_oAscMouseMoveDataTypes.Common; MMData.Type = c_oAscMouseMoveDataTypes.Common;
this.sync_MouseMoveCallback(MMData); this.sync_MouseMoveCallback(MMData);
this.sync_MouseMoveEndCallback(); this.sync_MouseMoveEndCallback();
//this.asc_fireCallback("asc_onHideForeignCursorLabel", UserId);
}; };
asc_docs_api.prototype.asc_setChartTranslate = function(translate) { asc_docs_api.prototype.asc_setChartTranslate = function(translate) {
this.chartTranslate = translate; this.chartTranslate = translate;
......
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