View mode with commenting (permissions.comments = true).
This commit is contained in:
parent
33f79ba24c
commit
00fb06281e
|
@ -750,14 +750,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);
|
||||
}
|
||||
|
||||
|
@ -813,12 +814,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) {
|
||||
|
|
|
@ -166,7 +166,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());
|
||||
|
||||
|
@ -623,7 +623,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();
|
||||
|
|
|
@ -968,8 +968,9 @@ define([
|
|||
this.appOptions.canHistoryRestore= this.editorConfig.canHistoryRestore && !!this.permissions.changeHistory;
|
||||
this.appOptions.canUseMailMerge= this.appOptions.canLicense && this.appOptions.canEdit && !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;
|
||||
|
@ -1007,16 +1008,16 @@ define([
|
|||
this.updatePlugins(this.plugins, true);
|
||||
|
||||
this.applyModeCommonElements();
|
||||
if ( this.appOptions.isEdit ) {
|
||||
this.applyModeEditorElements();
|
||||
} else {
|
||||
this.applyModeEditorElements();
|
||||
|
||||
if ( !this.appOptions.isEdit ) {
|
||||
Common.NotificationCenter.trigger('app:face', this.appOptions);
|
||||
|
||||
this.hidePreloader();
|
||||
this.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
|
||||
}
|
||||
|
||||
this.api.asc_setViewMode(!this.appOptions.isEdit);
|
||||
this.api.asc_setViewMode(!this.appOptions.isEdit && !this.appOptions.canComments);
|
||||
this.api.asc_LoadDocument();
|
||||
},
|
||||
|
||||
|
@ -1060,6 +1061,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(),
|
||||
|
@ -1071,10 +1078,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)
|
||||
|
|
|
@ -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');
|
||||
|
@ -1818,9 +1818,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();
|
||||
|
|
|
@ -111,14 +111,14 @@ define([
|
|||
template: _.template([
|
||||
'<table><tbody>',
|
||||
/** coauthoring begin **/
|
||||
'<tr class="coauth">',
|
||||
'<tr class="comments">',
|
||||
'<td class="left"><label><%= scope.txtLiveComment %></label></td>',
|
||||
'<td class="right"><div id="fms-chb-live-comment"/></td>',
|
||||
'</tr>','<tr class="divider coauth"></tr>',
|
||||
'<tr class="coauth">',
|
||||
'</tr>','<tr class="divider comments"></tr>',
|
||||
'<tr class="comments">',
|
||||
'<td class="left"></td>',
|
||||
'<td class="right"><div id="fms-chb-resolved-comment"/></td>',
|
||||
'</tr>','<tr class="divider coauth"></tr>',
|
||||
'</tr>','<tr class="divider comments"></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 **/
|
||||
},
|
||||
|
||||
|
|
|
@ -159,7 +159,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'));
|
||||
|
||||
|
@ -505,7 +505,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();
|
||||
|
|
|
@ -744,8 +744,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);
|
||||
|
@ -766,17 +767,16 @@ define([
|
|||
this.updatePlugins(this.plugins, true);
|
||||
|
||||
this.applyModeCommonElements();
|
||||
this.applyModeEditorElements();
|
||||
|
||||
if ( this.appOptions.isEdit ) {
|
||||
this.applyModeEditorElements();
|
||||
} else {
|
||||
if ( !this.appOptions.isEdit ) {
|
||||
Common.NotificationCenter.trigger('app:face', this.appOptions);
|
||||
|
||||
this.hidePreloader();
|
||||
this.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||
}
|
||||
|
||||
this.api.asc_setViewMode(!this.appOptions.isEdit);
|
||||
this.api.asc_setViewMode(!this.appOptions.isEdit && !this.appOptions.canComments);
|
||||
this.api.asc_LoadDocument();
|
||||
},
|
||||
|
||||
|
@ -817,6 +817,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(),
|
||||
|
@ -828,13 +837,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');
|
||||
|
|
|
@ -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');
|
||||
|
@ -1714,9 +1714,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: [
|
||||
|
|
|
@ -239,7 +239,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 **/
|
||||
|
@ -254,17 +254,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;
|
||||
},
|
||||
|
||||
|
@ -560,7 +561,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();
|
||||
|
@ -952,7 +953,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]) {
|
||||
|
@ -994,7 +995,9 @@ define([
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (me.permissions.isEdit) {
|
||||
if (index_locked) {
|
||||
data = dataarray[index_locked-1];
|
||||
|
||||
|
@ -1484,9 +1487,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);
|
||||
|
|
|
@ -166,7 +166,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'));
|
||||
|
||||
|
@ -671,7 +671,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();
|
||||
|
|
|
@ -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});
|
||||
|
@ -766,8 +766,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();
|
||||
|
||||
|
@ -796,15 +797,16 @@ define([
|
|||
this._state.licenseWarning = !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) && (licType===Asc.c_oLicenseResult.Connections) && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
|
||||
|
||||
this.applyModeCommonElements();
|
||||
if ( this.appOptions.isEdit ) {
|
||||
this.applyModeEditorElements();
|
||||
} else {
|
||||
this.applyModeEditorElements();
|
||||
|
||||
if ( !this.appOptions.isEdit ) {
|
||||
Common.NotificationCenter.trigger('app:face', this.appOptions);
|
||||
|
||||
this.hidePreloader();
|
||||
this.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
|
||||
}
|
||||
|
||||
this.api.asc_setViewMode(!this.appOptions.isEdit && !this.appOptions.canComments);
|
||||
this.api.asc_setViewMode(!this.appOptions.isEdit);
|
||||
(this.appOptions.isEditMailMerge || this.appOptions.isEditDiagram) ? this.api.asc_LoadEmptyDocument() : this.api.asc_LoadDocument();
|
||||
},
|
||||
|
@ -874,46 +876,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();
|
||||
rightmenuController.getView('RightMenu').setMode(me.appOptions).setApi(me.api);
|
||||
|
|
|
@ -2852,9 +2852,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));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -212,8 +212,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();
|
||||
|
|
|
@ -439,14 +439,14 @@ define([
|
|||
template: _.template([
|
||||
'<table class="main"><tbody>',
|
||||
/** coauthoring begin **/
|
||||
'<tr class="coauth">',
|
||||
'<tr class="comments">',
|
||||
'<td class="left"><label><%= scope.txtLiveComment %></label></td>',
|
||||
'<td class="right"><div id="fms-chb-live-comment"/></td>',
|
||||
'</tr>','<tr class="divider coauth"></tr>',
|
||||
'<tr class="coauth">',
|
||||
'</tr>','<tr class="divider comments"></tr>',
|
||||
'<tr class="comments">',
|
||||
'<td class="left"></td>',
|
||||
'<td class="right"><div id="fms-chb-resolved-comment"/></td>',
|
||||
'</tr>','<tr class="divider coauth"></tr>',
|
||||
'</tr>','<tr class="divider comments"></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>',
|
||||
|
@ -670,13 +670,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.coauth', this.el)[mode.canCoAuthoring && mode.isEdit ? 'show' : 'hide']();
|
||||
$('tr.comments', this.el)[mode.canCoAuthoring && mode.canComments ? 'show' : 'hide']();
|
||||
$('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring? 'show' : 'hide']();
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue