Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
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
web-apps
Commits
746b2889
Commit
746b2889
authored
Jun 09, 2017
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
View mode with commenting (permissions.comments = true).
parent
57dc3304
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
107 additions
and
97 deletions
+107
-97
apps/common/main/lib/controller/Comments.js
apps/common/main/lib/controller/Comments.js
+7
-6
apps/documenteditor/main/app/controller/LeftMenu.js
apps/documenteditor/main/app/controller/LeftMenu.js
+2
-2
apps/documenteditor/main/app/controller/Main.js
apps/documenteditor/main/app/controller/Main.js
+10
-7
apps/documenteditor/main/app/view/DocumentHolder.js
apps/documenteditor/main/app/view/DocumentHolder.js
+6
-5
apps/documenteditor/main/app/view/FileMenuPanels.js
apps/documenteditor/main/app/view/FileMenuPanels.js
+5
-4
apps/presentationeditor/main/app/controller/LeftMenu.js
apps/presentationeditor/main/app/controller/LeftMenu.js
+2
-2
apps/presentationeditor/main/app/controller/Main.js
apps/presentationeditor/main/app/controller/Main.js
+13
-10
apps/presentationeditor/main/app/view/DocumentHolder.js
apps/presentationeditor/main/app/view/DocumentHolder.js
+6
-5
apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
+19
-15
apps/spreadsheeteditor/main/app/controller/LeftMenu.js
apps/spreadsheeteditor/main/app/controller/LeftMenu.js
+2
-2
apps/spreadsheeteditor/main/app/controller/Main.js
apps/spreadsheeteditor/main/app/controller/Main.js
+20
-27
apps/spreadsheeteditor/main/app/controller/Toolbar.js
apps/spreadsheeteditor/main/app/controller/Toolbar.js
+5
-3
apps/spreadsheeteditor/main/app/view/FileMenu.js
apps/spreadsheeteditor/main/app/view/FileMenu.js
+2
-2
apps/spreadsheeteditor/main/app/view/FileMenuPanels.js
apps/spreadsheeteditor/main/app/view/FileMenuPanels.js
+8
-7
No files found.
apps/common/main/lib/controller/Comments.js
View file @
746b2889
...
...
@@ -744,14 +744,15 @@ define([
if
(
this
.
mode
&&
!
this
.
mode
.
canComments
)
hint
=
true
;
if
(
this
.
getPopover
())
{
var
popover
=
this
.
getPopover
();
if
(
popover
)
{
this
.
clearDummyComment
();
if
(
this
.
isSelectedComment
&&
(
0
===
_
.
difference
(
this
.
uids
,
uids
).
length
))
{
//NOTE: click to sdk view ?
if
(
this
.
api
)
{
//this.view.txtComment.blur();
this
.
getPopover
()
.
commentsView
.
setFocusToTextBox
(
true
);
popover
.
commentsView
&&
popover
.
commentsView
.
setFocusToTextBox
(
true
);
this
.
api
.
asc_enableKeyEvents
(
true
);
}
...
...
@@ -807,12 +808,12 @@ define([
this
.
_dontScrollToComment
=
false
;
}
if
(
this
.
getPopover
()
.
isVisible
())
{
this
.
getPopover
()
.
hide
();
if
(
popover
.
isVisible
())
{
popover
.
hide
();
}
this
.
getPopover
()
.
setLeftTop
(
posX
,
posY
,
leftX
);
this
.
getPopover
()
.
show
(
animate
,
false
,
true
,
text
);
popover
.
setLeftTop
(
posX
,
posY
,
leftX
);
popover
.
show
(
animate
,
false
,
true
,
text
);
}
},
onApiHideComment
:
function
(
hint
)
{
...
...
apps/documenteditor/main/app/controller/LeftMenu.js
View file @
746b2889
...
...
@@ -158,7 +158,7 @@ define([
createDelayedElements
:
function
()
{
/** coauthoring begin **/
if
(
this
.
mode
.
canCoAuthoring
)
{
this
.
leftMenu
.
btnComments
[(
this
.
mode
.
isEdit
&&
this
.
mode
.
canComments
&&
!
this
.
mode
.
isLightVersion
)
?
'
show
'
:
'
hide
'
]();
this
.
leftMenu
.
btnComments
[(
this
.
mode
.
canComments
&&
!
this
.
mode
.
isLightVersion
)
?
'
show
'
:
'
hide
'
]();
if
(
this
.
mode
.
canComments
)
this
.
leftMenu
.
setOptionsPanel
(
'
comment
'
,
this
.
getApplication
().
getController
(
'
Common.Controllers.Comments
'
).
getView
(
'
Common.Views.Comments
'
));
...
...
@@ -596,7 +596,7 @@ define([
}
return
false
;
case
'
comments
'
:
if
(
this
.
mode
.
canCoAuthoring
&&
this
.
mode
.
isEdit
&&
this
.
mode
.
canComments
&&
!
this
.
mode
.
isLightVersion
)
{
if
(
this
.
mode
.
canCoAuthoring
&&
this
.
mode
.
canComments
&&
!
this
.
mode
.
isLightVersion
)
{
Common
.
UI
.
Menu
.
Manager
.
hideAll
();
this
.
leftMenu
.
showMenu
(
'
comments
'
);
this
.
getApplication
().
getController
(
'
Common.Controllers.Comments
'
).
onAfterShow
();
...
...
apps/documenteditor/main/app/controller/Main.js
View file @
746b2889
...
...
@@ -981,8 +981,9 @@ define([
this
.
appOptions
.
canHistoryRestore
=
this
.
editorConfig
.
canHistoryRestore
&&
!!
this
.
permissions
.
changeHistory
;
this
.
appOptions
.
canUseMailMerge
=
this
.
appOptions
.
canLicense
&&
this
.
appOptions
.
canEdit
&&
/*!this.appOptions.isDesktopApp*/
!
this
.
appOptions
.
isOffline
;
this
.
appOptions
.
canSendEmailAddresses
=
this
.
appOptions
.
canLicense
&&
this
.
editorConfig
.
canSendEmailAddresses
&&
this
.
appOptions
.
canEdit
&&
this
.
appOptions
.
canCoAuthoring
;
this
.
appOptions
.
canComments
=
(
licType
===
Asc
.
c_oLicenseResult
.
Success
||
licType
===
Asc
.
c_oLicenseResult
.
SuccessLimit
)
&&
!
((
typeof
(
this
.
editorConfig
.
customization
)
==
'
object
'
)
&&
this
.
editorConfig
.
customization
.
comments
===
false
);
this
.
appOptions
.
canChat
=
(
licType
===
Asc
.
c_oLicenseResult
.
Success
||
licType
===
Asc
.
c_oLicenseResult
.
SuccessLimit
)
&&
!
this
.
appOptions
.
isOffline
&&
!
((
typeof
(
this
.
editorConfig
.
customization
)
==
'
object
'
)
&&
this
.
editorConfig
.
customization
.
chat
===
false
);
this
.
appOptions
.
canComments
=
this
.
appOptions
.
canLicense
&&
(
this
.
permissions
.
comments
===
undefined
?
this
.
appOptions
.
isEdit
:
this
.
permissions
.
comments
);
this
.
appOptions
.
canComments
=
this
.
appOptions
.
canComments
&&
!
((
typeof
(
this
.
editorConfig
.
customization
)
==
'
object
'
)
&&
this
.
editorConfig
.
customization
.
comments
===
false
);
this
.
appOptions
.
canChat
=
this
.
appOptions
.
canLicense
&&
!
this
.
appOptions
.
isOffline
&&
!
((
typeof
(
this
.
editorConfig
.
customization
)
==
'
object
'
)
&&
this
.
editorConfig
.
customization
.
chat
===
false
);
this
.
appOptions
.
canEditStyles
=
this
.
appOptions
.
canLicense
&&
this
.
appOptions
.
canEdit
;
this
.
appOptions
.
canPrint
=
(
this
.
permissions
.
print
!==
false
);
this
.
appOptions
.
canRename
=
!!
this
.
permissions
.
rename
;
...
...
@@ -1012,7 +1013,7 @@ define([
this
.
applyModeCommonElements
();
this
.
applyModeEditorElements
();
this
.
api
.
asc_setViewMode
(
!
this
.
appOptions
.
isEdit
);
this
.
api
.
asc_setViewMode
(
!
this
.
appOptions
.
isEdit
&&
!
this
.
appOptions
.
canComments
);
this
.
api
.
asc_LoadDocument
();
if
(
!
this
.
appOptions
.
isEdit
)
{
...
...
@@ -1065,6 +1066,12 @@ define([
},
applyModeEditorElements
:
function
()
{
if
(
this
.
appOptions
.
canComments
||
this
.
appOptions
.
isEdit
)
{
/** coauthoring begin **/
this
.
contComments
.
setMode
(
this
.
appOptions
);
this
.
contComments
.
setConfig
({
config
:
this
.
editorConfig
},
this
.
api
);
/** coauthoring end **/
}
if
(
this
.
appOptions
.
isEdit
)
{
var
me
=
this
,
application
=
this
.
getApplication
(),
...
...
@@ -1076,10 +1083,6 @@ define([
fontsControllers
&&
fontsControllers
.
setApi
(
me
.
api
);
toolbarController
&&
toolbarController
.
setApi
(
me
.
api
);
/** coauthoring begin **/
me
.
contComments
.
setMode
(
me
.
appOptions
);
me
.
contComments
.
setConfig
({
config
:
me
.
editorConfig
},
me
.
api
);
/** coauthoring end **/
rightmenuController
&&
rightmenuController
.
setApi
(
me
.
api
);
if
(
reviewController
)
...
...
apps/documenteditor/main/app/view/DocumentHolder.js
View file @
746b2889
...
...
@@ -1540,7 +1540,7 @@ define([
this
.
mode
=
m
;
/** coauthoring begin **/
!
(
this
.
mode
.
canCoAuthoring
&&
this
.
mode
.
isEdit
&&
this
.
mode
.
canComments
)
!
(
this
.
mode
.
canCoAuthoring
&&
this
.
mode
.
canComments
)
?
Common
.
util
.
Shortcuts
.
suspendEvents
(
hkComments
)
:
Common
.
util
.
Shortcuts
.
resumeEvents
(
hkComments
);
/** coauthoring end **/
...
...
@@ -1725,7 +1725,7 @@ define([
/** coauthoring begin **/
addComment
:
function
(
item
,
e
,
eOpt
){
if
(
this
.
api
&&
this
.
mode
.
canCoAuthoring
&&
this
.
mode
.
isEdit
&&
this
.
mode
.
canComments
)
{
if
(
this
.
api
&&
this
.
mode
.
canCoAuthoring
&&
this
.
mode
.
canComments
)
{
this
.
suppressEditComplete
=
true
;
var
controller
=
DE
.
getController
(
'
Common.Controllers.Comments
'
);
...
...
@@ -1819,9 +1819,10 @@ define([
initMenu
:
function
(
value
)
{
var
isInChart
=
(
value
.
imgProps
&&
value
.
imgProps
.
value
&&
!
_
.
isNull
(
value
.
imgProps
.
value
.
get_ChartProperties
()));
menuViewUndo
.
setVisible
(
me
.
mode
.
isEdit
);
menuViewCopySeparator
.
setVisible
(
!
isInChart
&&
me
.
api
.
can_AddQuotedComment
()
!==
false
&&
me
.
mode
.
canCoAuthoring
&&
me
.
mode
.
canComments
&&
me
.
mode
.
isEdit
);
menuViewAddComment
.
setVisible
(
!
isInChart
&&
me
.
api
.
can_AddQuotedComment
()
!==
false
&&
me
.
mode
.
canCoAuthoring
&&
me
.
mode
.
canComments
&&
me
.
mode
.
isEdit
);
menuViewUndo
.
setVisible
(
me
.
mode
.
canCoAuthoring
&&
me
.
mode
.
canComments
);
menuViewUndo
.
setDisabled
(
/* !me.api.asc_canUndo()*/
);
menuViewCopySeparator
.
setVisible
(
!
isInChart
&&
me
.
api
.
can_AddQuotedComment
()
!==
false
&&
me
.
mode
.
canCoAuthoring
&&
me
.
mode
.
canComments
);
menuViewAddComment
.
setVisible
(
!
isInChart
&&
me
.
api
.
can_AddQuotedComment
()
!==
false
&&
me
.
mode
.
canCoAuthoring
&&
me
.
mode
.
canComments
);
menuViewAddComment
.
setDisabled
(
value
.
paraProps
&&
value
.
paraProps
.
locked
===
true
);
var
cancopy
=
me
.
api
&&
me
.
api
.
can_CopyCut
();
...
...
apps/documenteditor/main/app/view/FileMenuPanels.js
View file @
746b2889
...
...
@@ -111,14 +111,14 @@ define([
template
:
_
.
template
([
'
<table><tbody>
'
,
/** coauthoring begin **/
'
<tr class="co
auth
">
'
,
'
<tr class="co
mments
">
'
,
'
<td class="left"><label><%= scope.txtLiveComment %></label></td>
'
,
'
<td class="right"><div id="fms-chb-live-comment"/></td>
'
,
'
</tr>
'
,
'
<tr class="divider co
auth
"></tr>
'
,
'
<tr class="co
auth
">
'
,
'
</tr>
'
,
'
<tr class="divider co
mments
"></tr>
'
,
'
<tr class="co
mments
">
'
,
'
<td class="left"></td>
'
,
'
<td class="right"><div id="fms-chb-resolved-comment"/></td>
'
,
'
</tr>
'
,
'
<tr class="divider co
auth
"></tr>
'
,
'
</tr>
'
,
'
<tr class="divider co
mments
"></tr>
'
,
/** coauthoring end **/
'
<tr class="edit">
'
,
'
<td class="left"><label><%= scope.txtSpellCheck %></label></td>
'
,
...
...
@@ -337,6 +337,7 @@ define([
/** coauthoring begin **/
$
(
'
tr.coauth
'
,
this
.
el
)[
mode
.
isEdit
&&
mode
.
canCoAuthoring
?
'
show
'
:
'
hide
'
]();
$
(
'
tr.coauth.changes
'
,
this
.
el
)[
mode
.
isEdit
&&
!
mode
.
isOffline
&&
mode
.
canCoAuthoring
?
'
show
'
:
'
hide
'
]();
$
(
'
tr.comments
'
,
this
.
el
)[
mode
.
canCoAuthoring
&&
mode
.
canComments
?
'
show
'
:
'
hide
'
]();
/** coauthoring end **/
},
...
...
apps/presentationeditor/main/app/controller/LeftMenu.js
View file @
746b2889
...
...
@@ -155,7 +155,7 @@ define([
createDelayedElements
:
function
()
{
/** coauthoring begin **/
if
(
this
.
mode
.
canCoAuthoring
)
{
this
.
leftMenu
.
btnComments
[(
this
.
mode
.
isEdit
&&
this
.
mode
.
canComments
&&
!
this
.
mode
.
isLightVersion
)
?
'
show
'
:
'
hide
'
]();
this
.
leftMenu
.
btnComments
[(
this
.
mode
.
canComments
&&
!
this
.
mode
.
isLightVersion
)
?
'
show
'
:
'
hide
'
]();
if
(
this
.
mode
.
canComments
)
this
.
leftMenu
.
setOptionsPanel
(
'
comment
'
,
this
.
getApplication
().
getController
(
'
Common.Controllers.Comments
'
).
getView
(
'
Common.Views.Comments
'
));
...
...
@@ -494,7 +494,7 @@ define([
}
return
false
;
case
'
comments
'
:
if
(
this
.
mode
.
canCoAuthoring
&&
this
.
mode
.
isEdit
&&
this
.
mode
.
canComments
&&
!
this
.
mode
.
isLightVersion
&&
(
!
previewPanel
||
!
previewPanel
.
isVisible
())
&&
!
this
.
_state
.
no_slides
)
{
if
(
this
.
mode
.
canCoAuthoring
&&
this
.
mode
.
canComments
&&
!
this
.
mode
.
isLightVersion
&&
(
!
previewPanel
||
!
previewPanel
.
isVisible
())
&&
!
this
.
_state
.
no_slides
)
{
Common
.
UI
.
Menu
.
Manager
.
hideAll
();
this
.
leftMenu
.
showMenu
(
'
comments
'
);
this
.
getApplication
().
getController
(
'
Common.Controllers.Comments
'
).
onAfterShow
();
...
...
apps/presentationeditor/main/app/controller/Main.js
View file @
746b2889
...
...
@@ -751,8 +751,9 @@ define([
this
.
appOptions
.
isEdit
=
this
.
appOptions
.
canLicense
&&
this
.
appOptions
.
canEdit
&&
this
.
editorConfig
.
mode
!==
'
view
'
;
this
.
appOptions
.
canDownload
=
!
this
.
appOptions
.
nativeApp
&&
this
.
permissions
.
download
!==
false
;
this
.
appOptions
.
canAnalytics
=
params
.
asc_getIsAnalyticsEnable
();
this
.
appOptions
.
canComments
=
(
licType
===
Asc
.
c_oLicenseResult
.
Success
||
licType
===
Asc
.
c_oLicenseResult
.
SuccessLimit
)
&&
!
((
typeof
(
this
.
editorConfig
.
customization
)
==
'
object
'
)
&&
this
.
editorConfig
.
customization
.
comments
===
false
);
this
.
appOptions
.
canChat
=
(
licType
===
Asc
.
c_oLicenseResult
.
Success
||
licType
===
Asc
.
c_oLicenseResult
.
SuccessLimit
)
&&
!
this
.
appOptions
.
isOffline
&&
!
((
typeof
(
this
.
editorConfig
.
customization
)
==
'
object
'
)
&&
this
.
editorConfig
.
customization
.
chat
===
false
);
this
.
appOptions
.
canComments
=
this
.
appOptions
.
canLicense
&&
(
this
.
permissions
.
comments
===
undefined
?
this
.
appOptions
.
isEdit
:
this
.
permissions
.
comments
);
this
.
appOptions
.
canComments
=
this
.
appOptions
.
canComments
&&
!
((
typeof
(
this
.
editorConfig
.
customization
)
==
'
object
'
)
&&
this
.
editorConfig
.
customization
.
comments
===
false
);
this
.
appOptions
.
canChat
=
this
.
appOptions
.
canLicense
&&
!
this
.
appOptions
.
isOffline
&&
!
((
typeof
(
this
.
editorConfig
.
customization
)
==
'
object
'
)
&&
this
.
editorConfig
.
customization
.
chat
===
false
);
this
.
appOptions
.
canPrint
=
(
this
.
permissions
.
print
!==
false
);
this
.
appOptions
.
canRename
=
!!
this
.
permissions
.
rename
;
this
.
appOptions
.
canForcesave
=
this
.
appOptions
.
isEdit
&&
!
this
.
appOptions
.
isOffline
&&
(
typeof
(
this
.
editorConfig
.
customization
)
==
'
object
'
&&
!!
this
.
editorConfig
.
customization
.
forcesave
);
...
...
@@ -776,7 +777,7 @@ define([
this
.
applyModeCommonElements
();
this
.
applyModeEditorElements
();
this
.
api
.
asc_setViewMode
(
!
this
.
appOptions
.
isEdit
);
this
.
api
.
asc_setViewMode
(
!
this
.
appOptions
.
isEdit
&&
!
this
.
appOptions
.
canComments
);
this
.
api
.
asc_LoadDocument
();
...
...
@@ -826,6 +827,15 @@ define([
},
applyModeEditorElements
:
function
(
prevmode
)
{
if
(
this
.
appOptions
.
canComments
||
this
.
appOptions
.
isEdit
)
{
/** coauthoring begin **/
var
commentsController
=
this
.
getApplication
().
getController
(
'
Common.Controllers.Comments
'
);
if
(
commentsController
)
{
commentsController
.
setMode
(
this
.
appOptions
);
commentsController
.
setConfig
({
config
:
this
.
editorConfig
},
this
.
api
);
}
/** coauthoring end **/
}
if
(
this
.
appOptions
.
isEdit
)
{
var
me
=
this
,
application
=
this
.
getApplication
(),
...
...
@@ -837,13 +847,6 @@ define([
fontsControllers
&&
fontsControllers
.
setApi
(
me
.
api
);
toolbarController
&&
toolbarController
.
setApi
(
me
.
api
);
/** coauthoring begin **/
var
commentsController
=
application
.
getController
(
'
Common.Controllers.Comments
'
);
if
(
commentsController
)
{
commentsController
.
setMode
(
this
.
appOptions
);
commentsController
.
setConfig
({
config
:
me
.
editorConfig
},
me
.
api
);
}
/** coauthoring end **/
rightmenuController
&&
rightmenuController
.
setApi
(
me
.
api
);
var
viewport
=
this
.
getApplication
().
getController
(
'
Viewport
'
).
getView
(
'
Viewport
'
);
...
...
apps/presentationeditor/main/app/view/DocumentHolder.js
View file @
746b2889
...
...
@@ -1527,7 +1527,7 @@ define([
me
.
mode
=
mode
;
/** coauthoring begin **/
!
(
me
.
mode
.
canCoAuthoring
&&
me
.
mode
.
isEdit
&&
me
.
mode
.
canComments
)
!
(
me
.
mode
.
canCoAuthoring
&&
me
.
mode
.
canComments
)
?
Common
.
util
.
Shortcuts
.
suspendEvents
(
hkComments
)
:
Common
.
util
.
Shortcuts
.
resumeEvents
(
hkComments
);
/** coauthoring end **/
...
...
@@ -1609,7 +1609,7 @@ define([
/** coauthoring begin **/
addComment
:
function
(
item
,
e
,
eOpt
){
if
(
this
.
api
&&
this
.
mode
.
canCoAuthoring
&&
this
.
mode
.
isEdit
&&
this
.
mode
.
canComments
)
{
if
(
this
.
api
&&
this
.
mode
.
canCoAuthoring
&&
this
.
mode
.
canComments
)
{
this
.
suppressEditComplete
=
true
;
var
controller
=
PE
.
getController
(
'
Common.Controllers.Comments
'
);
...
...
@@ -1715,9 +1715,10 @@ define([
this
.
viewModeMenu
=
new
Common
.
UI
.
Menu
({
initMenu
:
function
(
value
)
{
menuViewUndo
.
setVisible
(
me
.
mode
.
isEdit
);
menuViewCopySeparator
.
setVisible
(
!
value
.
isChart
&&
me
.
api
.
can_AddQuotedComment
()
!==
false
&&
me
.
mode
.
canCoAuthoring
&&
me
.
mode
.
canComments
&&
me
.
mode
.
isEdit
);
menuViewAddComment
.
setVisible
(
!
value
.
isChart
&&
me
.
api
.
can_AddQuotedComment
()
!==
false
&&
me
.
mode
.
canCoAuthoring
&&
me
.
mode
.
canComments
&&
me
.
mode
.
isEdit
);
menuViewUndo
.
setVisible
(
me
.
mode
.
canCoAuthoring
&&
me
.
mode
.
canComments
);
menuViewUndo
.
setDisabled
(
/* !me.api.asc_canUndo()*/
);
menuViewCopySeparator
.
setVisible
(
!
value
.
isChart
&&
me
.
api
.
can_AddQuotedComment
()
!==
false
&&
me
.
mode
.
canCoAuthoring
&&
me
.
mode
.
canComments
);
menuViewAddComment
.
setVisible
(
!
value
.
isChart
&&
me
.
api
.
can_AddQuotedComment
()
!==
false
&&
me
.
mode
.
canCoAuthoring
&&
me
.
mode
.
canComments
);
menuViewAddComment
.
setDisabled
(
value
.
locked
);
},
items
:
[
...
...
apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
View file @
746b2889
...
...
@@ -240,7 +240,7 @@ define([
setMode
:
function
(
permissions
)
{
this
.
permissions
=
permissions
;
/** coauthoring begin **/
!
(
this
.
permissions
.
canCoAuthoring
&&
this
.
permissions
.
isEdit
&&
this
.
permissions
.
canComments
)
!
(
this
.
permissions
.
canCoAuthoring
&&
this
.
permissions
.
canComments
)
?
Common
.
util
.
Shortcuts
.
suspendEvents
(
this
.
hkComments
)
:
Common
.
util
.
Shortcuts
.
resumeEvents
(
this
.
hkComments
);
/** coauthoring end **/
...
...
@@ -255,17 +255,18 @@ define([
// this.api.asc_registerCallback('asc_onShowComment', this.wrapEvents.apiShowComment);
/** coauthoring end **/
this
.
api
.
asc_registerCallback
(
'
asc_onHyperlinkClick
'
,
_
.
bind
(
this
.
onApiHyperlinkClick
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onSetAFDialog
'
,
_
.
bind
(
this
.
onApiAutofilter
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onCoAuthoringDisconnect
'
,
_
.
bind
(
this
.
onApiCoAuthoringDisconnect
,
this
));
Common
.
NotificationCenter
.
on
(
'
api:disconnect
'
,
_
.
bind
(
this
.
onApiCoAuthoringDisconnect
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onEditCell
'
,
_
.
bind
(
this
.
onApiEditCell
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onLockDefNameManager
'
,
_
.
bind
(
this
.
onLockDefNameManager
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onSelectionChanged
'
,
_
.
bind
(
this
.
onSelectionChanged
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onEntriesListMenu
'
,
_
.
bind
(
this
.
onEntriesListMenu
,
this
));
// Alt + Down
this
.
api
.
asc_registerCallback
(
'
asc_onFormulaCompleteMenu
'
,
_
.
bind
(
this
.
onFormulaCompleteMenu
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onShowSpecialPasteOptions
'
,
_
.
bind
(
this
.
onShowSpecialPasteOptions
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onHideSpecialPasteOptions
'
,
_
.
bind
(
this
.
onHideSpecialPasteOptions
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onSelectionChanged
'
,
_
.
bind
(
this
.
onSelectionChanged
,
this
));
if
(
this
.
permissions
.
isEdit
===
true
)
{
this
.
api
.
asc_registerCallback
(
'
asc_onSetAFDialog
'
,
_
.
bind
(
this
.
onApiAutofilter
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onEditCell
'
,
_
.
bind
(
this
.
onApiEditCell
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onLockDefNameManager
'
,
_
.
bind
(
this
.
onLockDefNameManager
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onEntriesListMenu
'
,
_
.
bind
(
this
.
onEntriesListMenu
,
this
));
// Alt + Down
this
.
api
.
asc_registerCallback
(
'
asc_onFormulaCompleteMenu
'
,
_
.
bind
(
this
.
onFormulaCompleteMenu
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onShowSpecialPasteOptions
'
,
_
.
bind
(
this
.
onShowSpecialPasteOptions
,
this
));
this
.
api
.
asc_registerCallback
(
'
asc_onHideSpecialPasteOptions
'
,
_
.
bind
(
this
.
onHideSpecialPasteOptions
,
this
));
}
return
this
;
},
...
...
@@ -561,7 +562,7 @@ define([
},
onAddComment
:
function
(
item
)
{
if
(
this
.
api
&&
this
.
permissions
.
canCoAuthoring
&&
this
.
permissions
.
isEdit
&&
this
.
permissions
.
canComments
)
{
if
(
this
.
api
&&
this
.
permissions
.
canCoAuthoring
&&
this
.
permissions
.
canComments
)
{
var
controller
=
SSE
.
getController
(
'
Common.Controllers.Comments
'
),
cellinfo
=
this
.
api
.
asc_getCellInfo
();
...
...
@@ -953,7 +954,7 @@ define([
}
}
if
(
me
.
permissions
.
isEdit
)
{
if
(
me
.
permissions
.
isEdit
||
me
.
permissions
.
canComments
)
{
if
(
index_comments
&&
!
this
.
popupmenu
)
{
data
=
dataarray
[
index_comments
-
1
];
if
(
!
commentTip
.
editCommentId
&&
commentTip
.
moveCommentId
!=
data
.
asc_getCommentIndexes
()[
0
])
{
...
...
@@ -995,7 +996,9 @@ define([
}
}
}
}
if
(
me
.
permissions
.
isEdit
)
{
if
(
index_locked
)
{
data
=
dataarray
[
index_locked
-
1
];
...
...
@@ -1485,9 +1488,10 @@ define([
if
(
!
showMenu
&&
!
documentHolder
.
viewModeMenu
.
isVisible
())
return
;
documentHolder
.
menuViewUndo
.
setVisible
(
this
.
permissions
.
isEdit
);
documentHolder
.
menuViewCopySeparator
.
setVisible
(
iscellmenu
&&
!
iscelledit
&&
this
.
permissions
.
canCoAuthoring
&&
this
.
permissions
.
canComments
&&
this
.
permissions
.
isEdit
);
documentHolder
.
menuViewAddComment
.
setVisible
(
iscellmenu
&&
!
iscelledit
&&
this
.
permissions
.
canCoAuthoring
&&
this
.
permissions
.
canComments
&&
this
.
permissions
.
isEdit
);
documentHolder
.
menuViewUndo
.
setVisible
(
this
.
permissions
.
canCoAuthoring
&&
this
.
permissions
.
canComments
);
documentHolder
.
menuViewUndo
.
setDisabled
(
!
this
.
api
.
asc_getCanUndo
());
documentHolder
.
menuViewCopySeparator
.
setVisible
(
iscellmenu
&&
!
iscelledit
&&
this
.
permissions
.
canCoAuthoring
&&
this
.
permissions
.
canComments
);
documentHolder
.
menuViewAddComment
.
setVisible
(
iscellmenu
&&
!
iscelledit
&&
this
.
permissions
.
canCoAuthoring
&&
this
.
permissions
.
canComments
);
documentHolder
.
setMenuItemCommentCaptionMode
(
documentHolder
.
menuViewAddComment
,
cellinfo
.
asc_getComments
().
length
<
1
,
this
.
permissions
.
canEditComments
);
commentsController
&&
commentsController
.
blockPopover
(
true
);
documentHolder
.
menuViewAddComment
.
setDisabled
(
isCellLocked
||
isTableLocked
);
...
...
apps/spreadsheeteditor/main/app/controller/LeftMenu.js
View file @
746b2889
...
...
@@ -163,7 +163,7 @@ define([
createDelayedElements
:
function
()
{
/** coauthoring begin **/
if
(
this
.
mode
.
canCoAuthoring
)
{
this
.
leftMenu
.
btnComments
[(
this
.
mode
.
isEdit
&&
this
.
mode
.
canComments
&&
!
this
.
mode
.
isLightVersion
)
?
'
show
'
:
'
hide
'
]();
this
.
leftMenu
.
btnComments
[(
this
.
mode
.
canComments
&&
!
this
.
mode
.
isLightVersion
)
?
'
show
'
:
'
hide
'
]();
if
(
this
.
mode
.
canComments
)
this
.
leftMenu
.
setOptionsPanel
(
'
comment
'
,
this
.
getApplication
().
getController
(
'
Common.Controllers.Comments
'
).
getView
(
'
Common.Views.Comments
'
));
...
...
@@ -661,7 +661,7 @@ define([
}
return
false
;
case
'
comments
'
:
if
(
this
.
mode
.
canCoAuthoring
&&
this
.
mode
.
isEdit
&&
this
.
mode
.
canComments
&&
!
this
.
mode
.
isLightVersion
)
{
if
(
this
.
mode
.
canCoAuthoring
&&
this
.
mode
.
canComments
&&
!
this
.
mode
.
isLightVersion
)
{
Common
.
UI
.
Menu
.
Manager
.
hideAll
();
this
.
leftMenu
.
showMenu
(
'
comments
'
);
this
.
getApplication
().
getController
(
'
Common.Controllers.Comments
'
).
onAfterShow
();
...
...
apps/spreadsheeteditor/main/app/controller/Main.js
View file @
746b2889
...
...
@@ -422,7 +422,7 @@ define([
action
&&
this
.
setLongActionView
(
action
);
if
(
id
==
Asc
.
c_oAscAsyncAction
.
Save
)
{
this
.
toolbarView
.
synchronizeChanges
();
this
.
toolbarView
&&
this
.
toolbarView
.
synchronizeChanges
();
}
action
=
this
.
stackLongActions
.
get
({
type
:
Asc
.
c_oAscAsyncActionType
.
BlockInteraction
});
...
...
@@ -765,8 +765,9 @@ define([
/** coauthoring begin **/
this
.
appOptions
.
canCoAuthoring
=
!
this
.
appOptions
.
isLightVersion
;
/** coauthoring end **/
this
.
appOptions
.
canComments
=
(
licType
===
Asc
.
c_oLicenseResult
.
Success
||
licType
===
Asc
.
c_oLicenseResult
.
SuccessLimit
)
&&
!
((
typeof
(
this
.
editorConfig
.
customization
)
==
'
object
'
)
&&
this
.
editorConfig
.
customization
.
comments
===
false
);
this
.
appOptions
.
canChat
=
(
licType
===
Asc
.
c_oLicenseResult
.
Success
||
licType
===
Asc
.
c_oLicenseResult
.
SuccessLimit
)
&&
!
this
.
appOptions
.
isOffline
&&
!
((
typeof
(
this
.
editorConfig
.
customization
)
==
'
object
'
)
&&
this
.
editorConfig
.
customization
.
chat
===
false
);
this
.
appOptions
.
canComments
=
this
.
appOptions
.
canLicense
&&
(
this
.
permissions
.
comments
===
undefined
?
(
this
.
permissions
.
edit
!==
false
&&
this
.
editorConfig
.
mode
!==
'
view
'
)
:
this
.
permissions
.
comments
);
this
.
appOptions
.
canComments
=
this
.
appOptions
.
canComments
&&
!
((
typeof
(
this
.
editorConfig
.
customization
)
==
'
object
'
)
&&
this
.
editorConfig
.
customization
.
comments
===
false
);
this
.
appOptions
.
canChat
=
this
.
appOptions
.
canLicense
&&
!
this
.
appOptions
.
isOffline
&&
!
((
typeof
(
this
.
editorConfig
.
customization
)
==
'
object
'
)
&&
this
.
editorConfig
.
customization
.
chat
===
false
);
this
.
appOptions
.
canRename
=
!!
this
.
permissions
.
rename
;
this
.
appOptions
.
isTrial
=
params
.
asc_getTrial
();
...
...
@@ -797,7 +798,7 @@ define([
this
.
applyModeCommonElements
();
this
.
applyModeEditorElements
();
this
.
api
.
asc_setViewMode
(
!
this
.
appOptions
.
isEdit
);
this
.
api
.
asc_setViewMode
(
!
this
.
appOptions
.
isEdit
&&
!
this
.
appOptions
.
canComments
);
(
this
.
appOptions
.
isEditMailMerge
||
this
.
appOptions
.
isEditDiagram
)
?
this
.
api
.
asc_LoadEmptyDocument
()
:
this
.
api
.
asc_LoadDocument
();
if
(
!
this
.
appOptions
.
isEdit
)
{
...
...
@@ -871,46 +872,38 @@ define([
},
applyModeEditorElements
:
function
(
prevmode
)
{
if
(
this
.
appOptions
.
canComments
||
this
.
appOptions
.
isEdit
)
{
/** coauthoring begin **/
var
commentsController
=
this
.
getApplication
().
getController
(
'
Common.Controllers.Comments
'
);
if
(
commentsController
)
{
commentsController
.
setMode
(
this
.
appOptions
);
commentsController
.
setConfig
({
config
:
this
.
editorConfig
,
sdkviewname
:
'
#ws-canvas-outer
'
,
hintmode
:
true
},
this
.
api
);
}
/** coauthoring end **/
}
if
(
this
.
appOptions
.
isEdit
)
{
var
me
=
this
,
application
=
this
.
getApplication
(),
toolbarController
=
application
.
getController
(
'
Toolbar
'
),
statusbarController
=
application
.
getController
(
'
Statusbar
'
),
rightmenuController
=
application
.
getController
(
'
RightMenu
'
),
/** coauthoring begin **/
commentsController
=
application
.
getController
(
'
Common.Controllers.Comments
'
),
/** coauthoring end **/
fontsControllers
=
application
.
getController
(
'
Common.Controllers.Fonts
'
);
fontsControllers
=
application
.
getController
(
'
Common.Controllers.Fonts
'
);
fontsControllers
&&
fontsControllers
.
setApi
(
me
.
api
);
toolbarController
&&
toolbarController
.
setApi
(
me
.
api
);
// statusbarController && statusbarController.setApi(me.api);
if
(
commentsController
)
{
commentsController
.
setMode
(
this
.
appOptions
);
commentsController
.
setConfig
({
config
:
me
.
editorConfig
,
sdkviewname
:
'
#ws-canvas-outer
'
,
hintmode
:
true
},
me
.
api
);
}
rightmenuController
&&
rightmenuController
.
setApi
(
me
.
api
);
if
(
statusbarController
)
{
statusbarController
.
getView
(
'
Statusbar
'
).
changeViewMode
(
true
);
}
/** coauthoring begin **/
if
(
prevmode
==
'
view
'
)
{
if
(
commentsController
)
{
Common
.
NotificationCenter
.
trigger
(
'
comments:updatefilter
'
,{
property
:
'
uid
'
,
value
:
new
RegExp
(
'
^(doc_|sheet
'
+
this
.
api
.
asc_getActiveWorksheetId
()
+
'
_)
'
)});
}
}
/** coauthoring end **/
var
viewport
=
this
.
getApplication
().
getController
(
'
Viewport
'
).
getView
(
'
Viewport
'
);
viewport
.
applyEditorMode
();
...
...
apps/spreadsheeteditor/main/app/controller/Toolbar.js
View file @
746b2889
...
...
@@ -2711,9 +2711,11 @@ define([
},
applyFormulaSettings
:
function
()
{
var
formulas
=
this
.
toolbar
.
btnInsertFormula
.
menu
.
items
;
for
(
var
i
=
0
;
i
<
Math
.
min
(
4
,
formulas
.
length
);
i
++
)
{
formulas
[
i
].
setCaption
(
this
.
api
.
asc_getFormulaLocaleName
(
formulas
[
i
].
value
));
if
(
this
.
toolbar
.
rendered
)
{
var
formulas
=
this
.
toolbar
.
btnInsertFormula
.
menu
.
items
;
for
(
var
i
=
0
;
i
<
Math
.
min
(
4
,
formulas
.
length
);
i
++
)
{
formulas
[
i
].
setCaption
(
this
.
api
.
asc_getFormulaLocaleName
(
formulas
[
i
].
value
));
}
}
},
...
...
apps/spreadsheeteditor/main/app/view/FileMenu.js
View file @
746b2889
...
...
@@ -210,8 +210,8 @@ define([
this
.
items
[
10
][(
!
this
.
mode
.
isOffline
&&
this
.
document
&&
this
.
document
.
info
&&
(
this
.
document
.
info
.
sharingSettings
&&
this
.
document
.
info
.
sharingSettings
.
length
>
0
||
this
.
mode
.
sharingSettingsUrl
&&
this
.
mode
.
sharingSettingsUrl
.
length
))?
'
show
'
:
'
hide
'
]();
this
.
items
[
11
][
this
.
mode
.
isEdit
?
'
show
'
:
'
hide
'
]();
this
.
items
[
11
].
$el
.
find
(
'
+.devider
'
)[
this
.
mode
.
isEdit
?
'
show
'
:
'
hide
'
]();
this
.
items
[
11
][
(
this
.
mode
.
isEdit
||
this
.
mode
.
canComments
)
?
'
show
'
:
'
hide
'
]();
this
.
items
[
11
].
$el
.
find
(
'
+.devider
'
)[
(
this
.
mode
.
isEdit
||
this
.
mode
.
canComments
)
?
'
show
'
:
'
hide
'
]();
this
.
mode
.
canBack
?
this
.
$el
.
find
(
'
#fm-btn-back
'
).
show
().
prev
().
show
()
:
this
.
$el
.
find
(
'
#fm-btn-back
'
).
hide
().
prev
().
hide
();
...
...
apps/spreadsheeteditor/main/app/view/FileMenuPanels.js
View file @
746b2889
...
...
@@ -439,14 +439,14 @@ define([
template
:
_
.
template
([
'
<table class="main"><tbody>
'
,
/** coauthoring begin **/
'
<tr class="co
auth
">
'
,
'
<tr class="co
mments
">
'
,
'
<td class="left"><label><%= scope.txtLiveComment %></label></td>
'
,
'
<td class="right"><div id="fms-chb-live-comment"/></td>
'
,
'
</tr>
'
,
'
<tr class="divider co
auth
"></tr>
'
,
'
<tr class="co
auth
">
'
,
'
</tr>
'
,
'
<tr class="divider co
mments
"></tr>
'
,
'
<tr class="co
mments
">
'
,
'
<td class="left"></td>
'
,
'
<td class="right"><div id="fms-chb-resolved-comment"/></td>
'
,
'
</tr>
'
,
'
<tr class="divider co
auth
"></tr>
'
,
'
</tr>
'
,
'
<tr class="divider co
mments
"></tr>
'
,
'
<tr class="autosave">
'
,
'
<td class="left"><label id="fms-lbl-autosave"><%= scope.textAutoSave %></label></td>
'
,
'
<td class="right"><span id="fms-chb-autosave" /></td>
'
,
...
...
@@ -480,12 +480,12 @@ define([
'
<div><div id="fms-cmb-func-locale" style="display: inline-block; margin-right: 15px;"/>
'
,
'
<label id="fms-lbl-func-locale" style="vertical-align: middle;"><%= scope.strFuncLocaleEx %></label></div></td>
'
,
'
</tr>
'
,
'
<tr class="divider edit"></tr>
'
,
'
<tr>
'
,
'
<tr
class="edit"
>
'
,
'
<td class="left"><label><%= scope.strRegSettings %></label></td>
'
,
'
<td class="right">
'
,
'
<div><div id="fms-cmb-reg-settings" style="display: inline-block; margin-right: 15px;"/>
'
,
'
<label id="fms-lbl-reg-settings" style="vertical-align: middle;"></label></div></td>
'
,
'
</tr>
'
,
'
<tr class="divider"></tr>
'
,
'
</tr>
'
,
'
<tr class="divider
edit
"></tr>
'
,
'
<tr>
'
,
'
<td class="left"></td>
'
,
'
<td class="right"><button id="fms-btn-apply" class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>
'
,
...
...
@@ -668,13 +668,14 @@ define([
setMode
:
function
(
mode
)
{
this
.
mode
=
mode
;
$
(
'
tr.edit
'
,
this
.
el
)[
mode
.
isEdit
?
'
show
'
:
'
hide
'
]();
$
(
'
tr.autosave
'
,
this
.
el
)[
mode
.
isEdit
?
'
show
'
:
'
hide
'
]();
if
(
this
.
mode
.
isDesktopApp
&&
this
.
mode
.
isOffline
)
{
this
.
chAutosave
.
setCaption
(
this
.
strAutoRecover
);
this
.
lblAutosave
.
text
(
this
.
textAutoRecover
);
}
$
(
'
tr.forcesave
'
,
this
.
el
)[
mode
.
canForcesave
?
'
show
'
:
'
hide
'
]();
$
(
'
tr.co
auth
'
,
this
.
el
)[
mode
.
canCoAuthoring
&&
mode
.
isEdit
?
'
show
'
:
'
hide
'
]();
$
(
'
tr.co
mments
'
,
this
.
el
)[
mode
.
canCoAuthoring
&&
mode
.
canComments
?
'
show
'
:
'
hide
'
]();
$
(
'
tr.coauth.changes
'
,
this
.
el
)[
mode
.
isEdit
&&
!
mode
.
isOffline
&&
mode
.
canCoAuthoring
?
'
show
'
:
'
hide
'
]();
},
...
...
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