Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
070642df
Commit
070642df
authored
Jun 01, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented flag whether to display resolved comments.
parent
49793a36
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
37 deletions
+68
-37
word/Editor/Comments.js
word/Editor/Comments.js
+17
-1
word/Editor/Document.js
word/Editor/Document.js
+7
-2
word/Editor/Paragraph.js
word/Editor/Paragraph.js
+42
-32
word/api.js
word/api.js
+2
-2
No files found.
word/Editor/Comments.js
View file @
070642df
...
...
@@ -469,6 +469,13 @@ CComment.prototype.GetData = function()
{
return
this
.
Data
;
};
CComment
.
prototype
.
IsSolved
=
function
()
{
if
(
this
.
Data
)
return
this
.
Data
.
IsSolved
();
return
false
;
};
var
comments_NoComment
=
0
;
var
comments_NonActiveComment
=
1
;
...
...
@@ -478,7 +485,8 @@ function CComments()
{
this
.
Id
=
AscCommon
.
g_oIdCounter
.
Get_NewId
();
this
.
m_bUse
=
false
;
// Используются ли комментарии
this
.
m_bUse
=
false
;
// Используются ли комментарии
this
.
m_bUseSolved
=
false
;
// Использовать ли разрешенные комментарии
this
.
m_aComments
=
{};
// ассоциативный массив
this
.
m_sCurrent
=
null
;
// текущий комментарий
...
...
@@ -629,6 +637,14 @@ CComments.prototype.GetAllComments = function()
{
return
this
.
m_aComments
;
};
CComments
.
prototype
.
SetUseSolved
=
function
(
isUse
)
{
this
.
m_bUseSolved
=
isUse
;
};
CComments
.
prototype
.
IsUseSolved
=
function
()
{
return
this
.
m_bUseSolved
;
};
//----------------------------------------------------------------------------------------------------------------------
// Класс для работы внутри параграфа
...
...
word/Editor/Document.js
View file @
070642df
...
...
@@ -7242,7 +7242,7 @@ CDocument.prototype.OnMouseUp = function(e, X, Y, PageIndex)
var
Type
=
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
?
comment_type_HdrFtr
:
comment_type_Common
);
// Проверяем не попали ли мы в комментарий
var
Comment
=
this
.
Comments
.
Get_ByXY
(
PageIndex
,
X
,
Y
,
Type
);
if
(
null
!=
Comment
)
if
(
null
!=
Comment
&&
(
this
.
Comments
.
IsUseSolved
()
||
!
Comment
.
IsSolved
())
)
{
var
Comment_PageNum
=
Comment
.
m_oStartInfo
.
PageNum
;
var
Comment_Y
=
Comment
.
m_oStartInfo
.
Y
;
...
...
@@ -8849,15 +8849,20 @@ CDocument.prototype.Show_Comment = function(Id)
this
.
Api
.
sync_HideComment
();
}
};
CDocument
.
prototype
.
Show_Comments
=
function
()
CDocument
.
prototype
.
Show_Comments
=
function
(
isShowSolved
)
{
if
(
false
!==
isShowSolved
)
isShowSolved
=
true
;
this
.
Comments
.
Set_Use
(
true
);
this
.
Comments
.
SetUseSolved
(
isShowSolved
);
this
.
DrawingDocument
.
ClearCachePages
();
this
.
DrawingDocument
.
FirePaint
();
};
CDocument
.
prototype
.
Hide_Comments
=
function
()
{
this
.
Comments
.
Set_Use
(
false
);
this
.
Comments
.
SetUseSolved
(
false
);
this
.
Comments
.
Set_Current
(
null
);
this
.
DrawingDocument
.
ClearCachePages
();
this
.
DrawingDocument
.
FirePaint
();
...
...
word/Editor/Paragraph.js
View file @
070642df
...
...
@@ -1445,12 +1445,13 @@ Paragraph.prototype.Internal_Draw_3 = function(CurPage, pGraphics, Pr)
var
DocumentComments
=
editor
.
WordControl
.
m_oLogicDocument
.
Comments
;
var
Page_abs
=
this
.
Get_AbsolutePage
(
CurPage
);
var
DrawComm
=
(
DocumentComments
.
Is_Use
()
&&
true
!=
editor
.
isViewMode
);
var
DrawFind
=
editor
.
WordControl
.
m_oLogicDocument
.
SearchEngine
.
Selection
;
var
DrawColl
=
(
undefined
===
pGraphics
.
RENDERER_PDF_FLAG
?
false
:
true
);
var
DrawMMFields
=
(
this
.
LogicDocument
&&
true
===
this
.
LogicDocument
.
Is_HightlightMailMergeFields
()
?
true
:
false
);
var
DrawComm
=
(
DocumentComments
.
Is_Use
()
&&
true
!=
editor
.
isViewMode
);
var
DrawFind
=
editor
.
WordControl
.
m_oLogicDocument
.
SearchEngine
.
Selection
;
var
DrawColl
=
(
undefined
===
pGraphics
.
RENDERER_PDF_FLAG
?
false
:
true
);
var
DrawMMFields
=
(
this
.
LogicDocument
&&
true
===
this
.
LogicDocument
.
Is_HightlightMailMergeFields
()
?
true
:
false
);
var
DrawSolvedComments
=
(
DocumentComments
.
IsUseSolved
()
&&
true
!=
editor
.
isViewMode
);
PDSH
.
Reset
(
this
,
pGraphics
,
DrawColl
,
DrawFind
,
DrawComm
,
DrawMMFields
,
this
.
Get_EndInfoByPage
(
CurPage
-
1
));
PDSH
.
Reset
(
this
,
pGraphics
,
DrawColl
,
DrawFind
,
DrawComm
,
DrawMMFields
,
this
.
Get_EndInfoByPage
(
CurPage
-
1
)
,
DrawSolvedComments
);
var
StartLine
=
_Page
.
StartLine
;
var
EndLine
=
_Page
.
EndLine
;
...
...
@@ -12559,9 +12560,10 @@ function CParagraphDrawStateHightlights()
this
.
Shd
=
new
CParaDrawingRangeLines
();
this
.
MMFields
=
new
CParaDrawingRangeLines
();
this
.
DrawComments
=
true
;
this
.
Comments
=
[];
this
.
CommentsFlag
=
comments_NoComment
;
this
.
DrawComments
=
true
;
this
.
DrawSolvedComments
=
true
;
this
.
Comments
=
[];
this
.
CommentsFlag
=
comments_NoComment
;
this
.
SearchCounter
=
0
;
...
...
@@ -12577,7 +12579,7 @@ function CParagraphDrawStateHightlights()
CParagraphDrawStateHightlights
.
prototype
=
{
Reset
:
function
(
Paragraph
,
Graphics
,
DrawColl
,
DrawFind
,
DrawComments
,
DrawMMFields
,
PageEndInfo
)
Reset
:
function
(
Paragraph
,
Graphics
,
DrawColl
,
DrawFind
,
DrawComments
,
DrawMMFields
,
PageEndInfo
,
DrawSolvedComments
)
{
this
.
Paragraph
=
Paragraph
;
this
.
Graphics
=
Graphics
;
...
...
@@ -12590,11 +12592,13 @@ CParagraphDrawStateHightlights.prototype =
this
.
SearchCounter
=
0
;
this
.
DrawComments
=
DrawComments
;
if
(
null
!==
PageEndInfo
)
this
.
Comments
=
PageEndInfo
.
Comments
;
else
this
.
Comments
=
[];
this
.
DrawComments
=
DrawComments
;
this
.
DrawSolvedComments
=
DrawSolvedComments
;
if
(
null
!==
PageEndInfo
)
this
.
Comments
=
PageEndInfo
.
Comments
;
else
this
.
Comments
=
[];
this
.
Check_CommentsFlag
();
},
...
...
@@ -12619,30 +12623,36 @@ CParagraphDrawStateHightlights.prototype =
AddComment
:
function
(
Id
)
{
if
(
true
===
this
.
DrawComments
)
{
this
.
Comments
.
push
(
Id
);
if
(
!
this
.
DrawComments
)
return
;
this
.
Check_CommentsFlag
();
}
var
oComment
=
AscCommon
.
g_oTableId
.
Get_ById
(
Id
);
if
(
!
oComment
||
(
!
this
.
DrawSolvedComments
&&
oComment
.
IsSolved
()))
return
;
this
.
Comments
.
push
(
Id
);
this
.
Check_CommentsFlag
();
},
Remove_Comment
:
function
(
Id
)
{
if
(
true
===
this
.
DrawComments
)
{
var
CommentsLen
=
this
.
Comments
.
length
;
for
(
var
CurPos
=
0
;
CurPos
<
CommentsLen
;
CurPos
++
)
{
if
(
this
.
Comments
[
CurPos
]
===
Id
)
{
this
.
Comments
.
splice
(
CurPos
,
1
);
break
;
}
}
if
(
!
this
.
DrawComments
)
return
;
this
.
Check_CommentsFlag
();
}
var
oComment
=
AscCommon
.
g_oTableId
.
Get_ById
(
Id
);
if
(
!
oComment
||
(
!
this
.
DrawSolvedComments
&&
oComment
.
IsSolved
()))
return
;
for
(
var
nIndex
=
0
,
nCount
=
this
.
Comments
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
if
(
this
.
Comments
[
nIndex
]
===
Id
)
{
this
.
Comments
.
splice
(
nIndex
,
1
);
break
;
}
}
this
.
Check_CommentsFlag
();
},
Check_CommentsFlag
:
function
()
...
...
word/api.js
View file @
070642df
...
...
@@ -5300,12 +5300,12 @@ background-repeat: no-repeat;\
};
asc_docs_api
.
prototype
.
asc_showComments
=
function
()
asc_docs_api
.
prototype
.
asc_showComments
=
function
(
isShowSolved
)
{
if
(
null
==
this
.
WordControl
.
m_oLogicDocument
)
return
;
this
.
WordControl
.
m_oLogicDocument
.
Show_Comments
();
this
.
WordControl
.
m_oLogicDocument
.
Show_Comments
(
isShowSolved
);
};
asc_docs_api
.
prototype
.
asc_hideComments
=
function
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment