Merge pull request #265 from ONLYOFFICE/feature/remove-comments
Feature/remove comments
This commit is contained in:
commit
f18a08837f
|
@ -710,7 +710,7 @@ define([
|
|||
this.caption = caption;
|
||||
|
||||
if (this.rendered) {
|
||||
var captionNode = this.cmpEl.find('button:first > .caption').addBack().filter('button > .caption');
|
||||
var captionNode = this.cmpEl.find('.caption');
|
||||
|
||||
if (captionNode.length > 0) {
|
||||
captionNode.text(caption);
|
||||
|
|
|
@ -126,6 +126,9 @@ define([
|
|||
'comment:closeEditing': _.bind(this.closeEditing, this),
|
||||
'comment:disableHint': _.bind(this.disableHint, this),
|
||||
'comment:addDummyComment': _.bind(this.onAddDummyComment, this)
|
||||
},
|
||||
'Common.Views.ReviewChanges': {
|
||||
'comment:removeComments': _.bind(this.onRemoveComments, this)
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -180,7 +183,7 @@ define([
|
|||
this.api.asc_registerCallback('asc_onAddComments', _.bind(this.onApiAddComments, this));
|
||||
this.api.asc_registerCallback('asc_onRemoveComment', _.bind(this.onApiRemoveComment, this));
|
||||
this.api.asc_registerCallback('asc_onChangeComments', _.bind(this.onChangeComments, this));
|
||||
this.api.asc_registerCallback('asc_onRemoveComments', _.bind(this.onRemoveComments, this));
|
||||
this.api.asc_registerCallback('asc_onRemoveComments', _.bind(this.onApiRemoveComments, this));
|
||||
this.api.asc_registerCallback('asc_onChangeCommentData', _.bind(this.onApiChangeCommentData, this));
|
||||
this.api.asc_registerCallback('asc_onLockComment', _.bind(this.onApiLockComment, this));
|
||||
this.api.asc_registerCallback('asc_onUnLockComment', _.bind(this.onApiUnLockComment, this));
|
||||
|
@ -233,6 +236,11 @@ define([
|
|||
this.api.asc_removeComment(id);
|
||||
}
|
||||
},
|
||||
onRemoveComments: function (type) {
|
||||
if (this.api) {
|
||||
this.api.asc_RemoveAllComments(type=='my' || !this.mode.canEditComments, type=='current');// 1 param = true if remove only my comments, 2 param - remove current comments
|
||||
}
|
||||
},
|
||||
onResolveComment: function (uid) {
|
||||
var t = this,
|
||||
reply = null,
|
||||
|
@ -725,7 +733,7 @@ define([
|
|||
|
||||
this.updateComments(true);
|
||||
},
|
||||
onRemoveComments: function (data) {
|
||||
onApiRemoveComments: function (data) {
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
this.onApiRemoveComment(data[i], true);
|
||||
}
|
||||
|
|
|
@ -69,6 +69,10 @@ define([
|
|||
'FileMenu': {
|
||||
'settings:apply': this.applySettings.bind(this)
|
||||
},
|
||||
'LeftMenu': {
|
||||
'comments:show': _.bind(this.commentsShowHide, this, 'show'),
|
||||
'comments:hide': _.bind(this.commentsShowHide, this, 'hide')
|
||||
},
|
||||
'Common.Views.ReviewChanges': {
|
||||
'reviewchange:accept': _.bind(this.onAcceptClick, this),
|
||||
'reviewchange:reject': _.bind(this.onRejectClick, this),
|
||||
|
@ -695,7 +699,9 @@ define([
|
|||
if (state !== me.view.btnChat.pressed)
|
||||
me.view.turnChat(state);
|
||||
});
|
||||
|
||||
}
|
||||
if (me.view && me.view.btnCommentRemove) {
|
||||
me.view.btnCommentRemove.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -774,6 +780,12 @@ define([
|
|||
});
|
||||
},
|
||||
|
||||
commentsShowHide: function(mode) {
|
||||
if (!this.view) return;
|
||||
var value = Common.Utils.InternalSettings.get(this.view.appPrefix + "settings-livecomment");
|
||||
(value!==undefined) && this.view.btnCommentRemove && this.view.btnCommentRemove.setDisabled(mode != 'show' && !value);
|
||||
},
|
||||
|
||||
textInserted: '<b>Inserted:</b>',
|
||||
textDeleted: '<b>Deleted:</b>',
|
||||
textParaInserted: '<b>Paragraph Inserted</b> ',
|
||||
|
|
|
@ -64,6 +64,7 @@ define([
|
|||
'<div class="separator long sharing"/>' +
|
||||
'<div class="group">' +
|
||||
'<span class="btn-slot text x-huge slot-comment"></span>' +
|
||||
'<span class="btn-slot text x-huge" id="slot-comment-remove"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long comments"/>' +
|
||||
'<div class="group">' +
|
||||
|
@ -161,6 +162,16 @@ define([
|
|||
this.btnChat && this.btnChat.on('click', function (btn, e) {
|
||||
me.fireEvent('collaboration:chat', [btn.pressed]);
|
||||
});
|
||||
|
||||
if (this.btnCommentRemove) {
|
||||
this.btnCommentRemove.on('click', function (e) {
|
||||
me.fireEvent('comment:removeComments', ['current']);
|
||||
});
|
||||
|
||||
this.btnCommentRemove.menu.on('item:click', function (menu, item, e) {
|
||||
me.fireEvent('comment:removeComments', [item.value]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -291,6 +302,15 @@ define([
|
|||
});
|
||||
}
|
||||
|
||||
if ( this.appConfig.canCoAuthoring && this.appConfig.canComments ) {
|
||||
this.btnCommentRemove = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
caption: this.txtCommentRemove,
|
||||
split: true,
|
||||
iconCls: 'btn-rem-comment'
|
||||
});
|
||||
}
|
||||
|
||||
var filter = Common.localStorage.getKeysFilter();
|
||||
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
|
||||
|
||||
|
@ -397,6 +417,28 @@ define([
|
|||
me.turnCoAuthMode((value===null || parseInt(value) == 1) && !(config.isDesktopApp && config.isOffline) && config.canCoAuthoring);
|
||||
}
|
||||
|
||||
if (me.btnCommentRemove) {
|
||||
var items = [
|
||||
{
|
||||
caption: config.canEditComments ? me.txtCommentRemCurrent : me.txtCommentRemMyCurrent,
|
||||
value: 'current'
|
||||
},
|
||||
{
|
||||
caption: me.txtCommentRemMy,
|
||||
value: 'my'
|
||||
}
|
||||
];
|
||||
if (config.canEditComments)
|
||||
items.push({
|
||||
caption: me.txtCommentRemAll,
|
||||
value: 'all'
|
||||
});
|
||||
me.btnCommentRemove.setMenu(
|
||||
new Common.UI.Menu({items: items})
|
||||
);
|
||||
me.btnCommentRemove.updateHint([me.tipCommentRemCurrent, me.tipCommentRem]);
|
||||
}
|
||||
|
||||
var separator_sharing = !(me.btnSharing || me.btnCoAuthMode) ? me.$el.find('.separator.sharing') : '.separator.sharing',
|
||||
separator_comments = !(config.canComments && config.canCoAuthoring) ? me.$el.find('.separator.comments') : '.separator.comments',
|
||||
separator_review = !(config.canReview || config.canViewReview) ? me.$el.find('.separator.review') : '.separator.review',
|
||||
|
@ -448,6 +490,7 @@ define([
|
|||
this.btnCoAuthMode && this.btnCoAuthMode.render(this.$el.find('#slot-btn-coauthmode'));
|
||||
this.btnHistory && this.btnHistory.render(this.$el.find('#slot-btn-history'));
|
||||
this.btnChat && this.btnChat.render(this.$el.find('#slot-btn-chat'));
|
||||
this.btnCommentRemove && this.btnCommentRemove.render(this.$el.find('#slot-comment-remove'));
|
||||
|
||||
return this.$el;
|
||||
},
|
||||
|
@ -561,6 +604,7 @@ define([
|
|||
}
|
||||
}, this);
|
||||
this.btnChat && this.btnChat.setDisabled(state);
|
||||
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state);
|
||||
},
|
||||
|
||||
onLostEditRights: function() {
|
||||
|
@ -609,7 +653,14 @@ define([
|
|||
txtFinalCap: 'Final',
|
||||
txtOriginalCap: 'Original',
|
||||
strFastDesc: 'Real-time co-editing. All changes are saved automatically.',
|
||||
strStrictDesc: 'Use the \'Save\' button to sync the changes you and others make.'
|
||||
strStrictDesc: 'Use the \'Save\' button to sync the changes you and others make.',
|
||||
txtCommentRemove: 'Remove',
|
||||
tipCommentRemCurrent: 'Remove current comments',
|
||||
tipCommentRem: 'Remove comments',
|
||||
txtCommentRemCurrent: 'Remove Current Comments',
|
||||
txtCommentRemMyCurrent: 'Remove My Current Comments',
|
||||
txtCommentRemMy: 'Remove My Comments',
|
||||
txtCommentRemAll: 'Remove All Comments'
|
||||
}
|
||||
}()), Common.Views.ReviewChanges || {}));
|
||||
|
||||
|
|
|
@ -533,7 +533,8 @@
|
|||
.button-normal-icon(btn-caption, 76, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-calculation, 80, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-scale, 81, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-symbol, 84, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-rem-comment, 83, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-symbol, 84, @toolbar-big-icon-size);
|
||||
|
||||
[applang=ru] {
|
||||
.btn-toolbar {
|
||||
|
|
|
@ -467,6 +467,7 @@ define([
|
|||
if (this.mode.canViewComments && this.leftMenu.panelComments.isVisible())
|
||||
value = resolved = true;
|
||||
(value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments();
|
||||
this.getApplication().getController('Common.Controllers.ReviewChanges').commentsShowHide(value ? 'show' : 'hide');
|
||||
/** coauthoring end **/
|
||||
|
||||
value = Common.localStorage.getItem("de-settings-fontrender");
|
||||
|
|
|
@ -2914,6 +2914,8 @@ define([
|
|||
btn.on('click', function (btn, e) {
|
||||
Common.NotificationCenter.trigger('app:comment:add', 'toolbar');
|
||||
});
|
||||
if (btn.cmpEl.closest('#review-changes-panel').length>0)
|
||||
btn.setCaption(me.toolbar.capBtnAddComment);
|
||||
}, this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2335,6 +2335,7 @@ define([
|
|||
textEditWatermark: 'Custom Watermark',
|
||||
textRemWatermark: 'Remove Watermark',
|
||||
tipWatermark: 'Edit watermark',
|
||||
capBtnAddComment: 'Add Comment',
|
||||
capBtnInsSymbol: 'Symbol',
|
||||
tipInsertSymbol: 'Insert symbol'
|
||||
}
|
||||
|
|
|
@ -253,6 +253,13 @@
|
|||
"Common.Views.ReviewChanges.txtSpelling": "Spell Checking",
|
||||
"Common.Views.ReviewChanges.txtTurnon": "Track Changes",
|
||||
"Common.Views.ReviewChanges.txtView": "Display Mode",
|
||||
"Common.Views.ReviewChanges.txtCommentRemove": "Remove",
|
||||
"Common.Views.ReviewChanges.tipCommentRemCurrent": "Remove current comments",
|
||||
"Common.Views.ReviewChanges.tipCommentRem": "Remove comments",
|
||||
"Common.Views.ReviewChanges.txtCommentRemCurrent": "Remove Current Comments",
|
||||
"Common.Views.ReviewChanges.txtCommentRemMyCurrent": "Remove My Current Comments",
|
||||
"Common.Views.ReviewChanges.txtCommentRemMy": "Remove My Comments",
|
||||
"Common.Views.ReviewChanges.txtCommentRemAll": "Remove All Comments",
|
||||
"Common.Views.ReviewChangesDialog.textTitle": "Review Changes",
|
||||
"Common.Views.ReviewChangesDialog.txtAccept": "Accept",
|
||||
"Common.Views.ReviewChangesDialog.txtAcceptAll": "Accept All Changes",
|
||||
|
@ -2056,6 +2063,7 @@
|
|||
"DE.Views.TextArtSettings.textTemplate": "Template",
|
||||
"DE.Views.TextArtSettings.textTransform": "Transform",
|
||||
"DE.Views.TextArtSettings.txtNoBorders": "No Line",
|
||||
"DE.Views.Toolbar.capBtnAddComment": "Add Comment",
|
||||
"DE.Views.Toolbar.capBtnBlankPage": "Blank Page",
|
||||
"DE.Views.Toolbar.capBtnColumns": "Columns",
|
||||
"DE.Views.Toolbar.capBtnComment": "Comment",
|
||||
|
|
|
@ -2188,6 +2188,8 @@ define([
|
|||
btn.on('click', function (btn, e) {
|
||||
Common.NotificationCenter.trigger('app:comment:add', 'toolbar');
|
||||
});
|
||||
if (btn.cmpEl.closest('#review-changes-panel').length>0)
|
||||
btn.setCaption(me.toolbar.capBtnAddComment);
|
||||
}, this);
|
||||
this.toolbar.lockToolbar(PE.enumLock.noSlides, this._state.no_slides, { array: this.btnsComment });
|
||||
}
|
||||
|
|
|
@ -1688,6 +1688,7 @@ define([
|
|||
capBtnSlideNum: 'Slide Number',
|
||||
capBtnDateTime: 'Date & Time',
|
||||
textListSettings: 'List Settings',
|
||||
capBtnAddComment: 'Add Comment',
|
||||
capBtnInsSymbol: 'Symbol',
|
||||
tipInsertSymbol: 'Insert symbol'
|
||||
}
|
||||
|
|
|
@ -184,6 +184,13 @@
|
|||
"Common.Views.ReviewChanges.txtSpelling": "Spell Checking",
|
||||
"Common.Views.ReviewChanges.txtTurnon": "Track Changes",
|
||||
"Common.Views.ReviewChanges.txtView": "Display Mode",
|
||||
"Common.Views.ReviewChanges.txtCommentRemove": "Remove",
|
||||
"Common.Views.ReviewChanges.tipCommentRemCurrent": "Remove current comments",
|
||||
"Common.Views.ReviewChanges.tipCommentRem": "Remove comments",
|
||||
"Common.Views.ReviewChanges.txtCommentRemCurrent": "Remove Current Comments",
|
||||
"Common.Views.ReviewChanges.txtCommentRemMyCurrent": "Remove My Current Comments",
|
||||
"Common.Views.ReviewChanges.txtCommentRemMy": "Remove My Comments",
|
||||
"Common.Views.ReviewChanges.txtCommentRemAll": "Remove All Comments",
|
||||
"Common.Views.ReviewPopover.textAdd": "Add",
|
||||
"Common.Views.ReviewPopover.textAddReply": "Add Reply",
|
||||
"Common.Views.ReviewPopover.textCancel": "Cancel",
|
||||
|
@ -1672,6 +1679,7 @@
|
|||
"PE.Views.TextArtSettings.txtPapyrus": "Papyrus",
|
||||
"PE.Views.TextArtSettings.txtWood": "Wood",
|
||||
"PE.Views.Toolbar.capAddSlide": "Add Slide",
|
||||
"PE.Views.Toolbar.capBtnAddComment": "Add Comment",
|
||||
"PE.Views.Toolbar.capBtnComment": "Comment",
|
||||
"PE.Views.Toolbar.capBtnDateTime": "Date & Time",
|
||||
"PE.Views.Toolbar.capBtnInsHeader": "Header/Footer",
|
||||
|
|
|
@ -367,6 +367,7 @@ define([
|
|||
if (this.mode.canViewComments && this.leftMenu.panelComments.isVisible())
|
||||
value = resolved = true;
|
||||
(value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments();
|
||||
this.getApplication().getController('Common.Controllers.ReviewChanges').commentsShowHide(value ? 'show' : 'hide');
|
||||
|
||||
value = Common.localStorage.getBool("sse-settings-r1c1");
|
||||
Common.Utils.InternalSettings.set("sse-settings-r1c1", value);
|
||||
|
|
|
@ -3258,6 +3258,8 @@ define([
|
|||
btn.on('click', function (btn, e) {
|
||||
Common.NotificationCenter.trigger('app:comment:add', 'toolbar', me.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType() != Asc.c_oAscSelectionType.RangeCells);
|
||||
});
|
||||
if (btn.cmpEl.closest('#review-changes-panel').length>0)
|
||||
btn.setCaption(me.toolbar.capBtnAddComment);
|
||||
}, this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2531,6 +2531,7 @@ define([
|
|||
textHeight: 'Height',
|
||||
textWidth: 'Width',
|
||||
textMorePages: 'More pages',
|
||||
capBtnAddComment: 'Add Comment',
|
||||
capBtnInsSymbol: 'Symbol',
|
||||
tipInsertSymbol: 'Insert symbol'
|
||||
}, SSE.Views.Toolbar || {}));
|
||||
|
|
|
@ -178,6 +178,13 @@
|
|||
"Common.Views.ReviewChanges.txtSpelling": "Spell Checking",
|
||||
"Common.Views.ReviewChanges.txtTurnon": "Track Changes",
|
||||
"Common.Views.ReviewChanges.txtView": "Display Mode",
|
||||
"Common.Views.ReviewChanges.txtCommentRemove": "Remove",
|
||||
"Common.Views.ReviewChanges.tipCommentRemCurrent": "Remove current comments",
|
||||
"Common.Views.ReviewChanges.tipCommentRem": "Remove comments",
|
||||
"Common.Views.ReviewChanges.txtCommentRemCurrent": "Remove Current Comments",
|
||||
"Common.Views.ReviewChanges.txtCommentRemMyCurrent": "Remove My Current Comments",
|
||||
"Common.Views.ReviewChanges.txtCommentRemMy": "Remove My Comments",
|
||||
"Common.Views.ReviewChanges.txtCommentRemAll": "Remove All Comments",
|
||||
"Common.Views.ReviewPopover.textAdd": "Add",
|
||||
"Common.Views.ReviewPopover.textAddReply": "Add Reply",
|
||||
"Common.Views.ReviewPopover.textCancel": "Cancel",
|
||||
|
@ -2206,6 +2213,7 @@
|
|||
"SSE.Views.TextArtSettings.txtNoBorders": "No Line",
|
||||
"SSE.Views.TextArtSettings.txtPapyrus": "Papyrus",
|
||||
"SSE.Views.TextArtSettings.txtWood": "Wood",
|
||||
"SSE.Views.Toolbar.capBtnAddComment": "Add Comment",
|
||||
"SSE.Views.Toolbar.capBtnComment": "Comment",
|
||||
"SSE.Views.Toolbar.capBtnInsHeader": "Header/Footer",
|
||||
"SSE.Views.Toolbar.capBtnMargins": "Margins",
|
||||
|
|
Loading…
Reference in a new issue