Commit a95b3a41 authored by Ilya Kirillov's avatar Ilya Kirillov

Рефакторинг функций связанных с совместным редактированием.

parent c50ad0a2
This diff is collapsed.
This diff is collapsed.
......@@ -672,6 +672,21 @@ CDocumentControllerBase.prototype.CanAddHyperlink = function(bCheckInHyperlink){
* @returns {?ParaHyperlink}
*/
CDocumentControllerBase.prototype.IsCursorInHyperlink = function(bCheckEnd){return false;};
/**
* Добавляем комментарий.
* @param Comment
*/
CDocumentControllerBase.prototype.AddComment = function(Comment){};
/**
* Проверяем, можно ли добавить комментарий.
* @returns {boolean}
*/
CDocumentControllerBase.prototype.CanAddComment = function(){return false;};
/**
* Получаем физическую позицию на странице для якоря по селекту.
* @returns {{X0: number, X1: number, Y: number, Page: number}}
*/
CDocumentControllerBase.prototype.GetSelectionAnchorPos = function(){return {X0 : 0, X1 : 0, Y : 0, Page : 0};};
/**
* Добавляем элемент в параграф.
......
......@@ -428,6 +428,39 @@ CDrawingsController.prototype.IsCursorInHyperlink = function(bCheckEnd)
{
return this.DrawingObjects.hyperlinkCheck(bCheckEnd);
};
CDrawingsController.prototype.AddComment = function(Comment)
{
if (true != this.DrawingObjects.isSelectedText())
{
var ParaDrawing = this.DrawingObjects.getMajorParaDrawing();
if (null != ParaDrawing)
{
var Paragraph = ParaDrawing.Parent;
Paragraph.Add_Comment2(Comment, ParaDrawing.Get_Id());
}
}
else
{
this.DrawingObjects.addComment(Comment);
}
};
CDrawingsController.prototype.CanAddComment = function()
{
if (true != this.DrawingObjects.isSelectedText())
return true;
else
return this.DrawingObjects.canAddComment();
};
CDrawingsController.prototype.GetSelectionAnchorPos = function()
{
var ParaDrawing = this.DrawingObjects.getMajorParaDrawing();
return {
X0 : ParaDrawing.GraphicObj.x,
Y : ParaDrawing.GraphicObj.y,
X1 : ParaDrawing.GraphicObj.x + ParaDrawing.GraphicObj.extX,
Page : ParaDrawing.PageNum
};
};
CDrawingsController.prototype.AddToParagraph = function(oItem, bRecalculate)
......
......@@ -1030,6 +1030,24 @@ CFootnotesController.prototype.IsCursorInHyperlink = function(bCheckEnd)
// TODO: Реализовать
return false;
};
CFootnotesController.prototype.AddComment = function(Comment)
{
// TODO: Реализовать
};
CFootnotesController.prototype.CanAddComment = function()
{
// TODO: Реализовать
};
CFootnotesController.prototype.GetSelectionAnchorPos = function()
{
// TODO: Реализовать
return {
X0 : 0,
Y : 0,
X1 : 0,
Page : 0
};
};
CFootnotesController.prototype.AddToParagraph = function(oItem, bRecalculate)
{
......
......@@ -364,7 +364,18 @@ CHdrFtrController.prototype.IsCursorInHyperlink = function(bCheckEnd)
{
return this.HdrFtr.Hyperlink_Check(bCheckEnd);
};
CHdrFtrController.prototype.AddComment = function(Comment)
{
this.HdrFtr.Add_Comment(Comment);
};
CHdrFtrController.prototype.CanAddComment = function()
{
return this.HdrFtr.CanAdd_Comment();
};
CHdrFtrController.prototype.GetSelectionAnchorPos = function()
{
return this.HdrFtr.Get_SelectionAnchorPos();
};
CHdrFtrController.prototype.AddToParagraph = function(oItem, bRecalculate)
......
......@@ -337,6 +337,18 @@ CLogicDocumentController.prototype.IsCursorInHyperlink = function(bCheckEnd)
{
return this.LogicDocument.controller_IsCursorInHyperlink(bCheckEnd);
};
CLogicDocumentController.prototype.AddComment = function(Comment)
{
this.LogicDocument.controller_AddComment(Comment);
};
CLogicDocumentController.prototype.CanAddComment = function()
{
return this.LogicDocument.controller_CanAddComment();
};
CLogicDocumentController.prototype.GetSelectionAnchorPos = function()
{
return this.LogicDocument.controller_GetSelectionAnchorPos();
};
CLogicDocumentController.prototype.AddToParagraph = function(oItem)
......
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