Show comments in view mode (hints, left panel, advanced settings in the File menu)
This commit is contained in:
parent
1153d9a803
commit
f621e671eb
|
@ -179,6 +179,50 @@ define([
|
||||||
doLayout: function() {
|
doLayout: function() {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
changeLayout: function(items) {
|
||||||
|
var panel, resizer, stretch = false;
|
||||||
|
this.panels = [];
|
||||||
|
items.forEach(function(item) {
|
||||||
|
item.el instanceof HTMLElement && (item.el = $(item.el));
|
||||||
|
panel = _.extend(new LayoutPanel(), item);
|
||||||
|
if ( panel.stretch ) {
|
||||||
|
stretch = true;
|
||||||
|
panel.rely = false;
|
||||||
|
panel.resize = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.panels.push(panel);
|
||||||
|
|
||||||
|
if (panel.resize) {
|
||||||
|
resizer = {
|
||||||
|
isresizer : true,
|
||||||
|
minpos : panel.resize.min||0,
|
||||||
|
maxpos : panel.resize.max||0,
|
||||||
|
fmin : panel.resize.fmin,
|
||||||
|
fmax : panel.resize.fmax,
|
||||||
|
behaviour : panel.behaviour,
|
||||||
|
index : this.splitters.length,
|
||||||
|
offset : panel.resize.offset || 0
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!stretch) {
|
||||||
|
panel.resize.el =
|
||||||
|
resizer.el = panel.el.after('<div class="layout-resizer after"></div>').next();
|
||||||
|
this.panels.push(resizer);
|
||||||
|
} else {
|
||||||
|
panel.resize.el =
|
||||||
|
resizer.el = panel.el.before('<div class="layout-resizer before"></div>').prev();
|
||||||
|
this.panels.splice(this.panels.length - 1, 0, resizer);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.splitters.push({resizer:resizer});
|
||||||
|
|
||||||
|
panel.resize.hidden && resizer.el.hide();
|
||||||
|
Common.Gateway.on('processmouse', this.resize.eventStop);
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
|
},
|
||||||
|
|
||||||
getElementHeight: function(el) {
|
getElementHeight: function(el) {
|
||||||
return parseInt(el.css('height'));
|
return parseInt(el.css('height'));
|
||||||
},
|
},
|
||||||
|
|
|
@ -194,6 +194,10 @@ define([
|
||||||
setMode: function(mode) {
|
setMode: function(mode) {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.isModeChanged = true; // change show-comment mode from/to hint mode using canComments flag
|
this.isModeChanged = true; // change show-comment mode from/to hint mode using canComments flag
|
||||||
|
if (!this.mode.canComments) {
|
||||||
|
this.view.changeLayout(mode);
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
//
|
//
|
||||||
|
@ -1188,6 +1192,7 @@ define([
|
||||||
hideAddReply : !_.isUndefined(this.hidereply) ? this.hidereply : (this.showPopover ? true : false),
|
hideAddReply : !_.isUndefined(this.hidereply) ? this.hidereply : (this.showPopover ? true : false),
|
||||||
scope : this.view,
|
scope : this.view,
|
||||||
editable : this.mode.canEditComments || (data.asc_getUserId() == this.currentUserId),
|
editable : this.mode.canEditComments || (data.asc_getUserId() == this.currentUserId),
|
||||||
|
hint : !this.mode.canComments,
|
||||||
groupName : (groupname && groupname.length>1) ? groupname[1] : null
|
groupName : (groupname && groupname.length>1) ? groupname[1] : null
|
||||||
});
|
});
|
||||||
if (comment) {
|
if (comment) {
|
||||||
|
@ -1403,12 +1408,12 @@ define([
|
||||||
if ('none' !== panel.css('display')) {
|
if ('none' !== panel.css('display')) {
|
||||||
this.view.txtComment.focus();
|
this.view.txtComment.focus();
|
||||||
}
|
}
|
||||||
if (this.view.needRender)
|
|
||||||
this.updateComments(true);
|
|
||||||
else if (this.view.needUpdateFilter)
|
|
||||||
this.onUpdateFilter(this.view.needUpdateFilter);
|
|
||||||
this.view.update();
|
|
||||||
}
|
}
|
||||||
|
if (this.view.needRender)
|
||||||
|
this.updateComments(true);
|
||||||
|
else if (this.view.needUpdateFilter)
|
||||||
|
this.onUpdateFilter(this.view.needUpdateFilter);
|
||||||
|
this.view.update();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<% if (quote!==null && quote!=='') { %>
|
<% if (quote!==null && quote!=='') { %>
|
||||||
<div class="user-quote"><%=scope.getFixedQuote(quote)%></div>
|
<div class="user-quote"><%=scope.getFixedQuote(quote)%></div>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (!editText) { %>
|
<% if (!editText || hint) { %>
|
||||||
<div class="user-message" data-can-copy="true"><%=scope.pickLink(comment)%></div>
|
<div class="user-message" data-can-copy="true"><%=scope.pickLink(comment)%></div>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<div class="inner-edit-ct">
|
<div class="inner-edit-ct">
|
||||||
|
@ -24,20 +24,22 @@
|
||||||
|
|
||||||
<% if (replys.length) { %>
|
<% if (replys.length) { %>
|
||||||
<div class="reply-arrow img-commonctrl"></div>
|
<div class="reply-arrow img-commonctrl"></div>
|
||||||
<% _.each(replys, function (item) { %>
|
<% _.each(replys, function (item, index) { %>
|
||||||
<div class="reply-item-ct">
|
<div class="reply-item-ct" <% if (hint && index==replys.length-1) { %>style="padding-bottom: 0;" <% } %>;>
|
||||||
<div class="user-name">
|
<div class="user-name">
|
||||||
<div class="color" style="display: inline-block; background-color: <% if (item.get("usercolor")!==null) { %><%=item.get("usercolor")%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getUserName(item.get("username")) %>
|
<div class="color" style="display: inline-block; background-color: <% if (item.get("usercolor")!==null) { %><%=item.get("usercolor")%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getUserName(item.get("username")) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-date"><%=item.get("date")%></div>
|
<div class="user-date"><%=item.get("date")%></div>
|
||||||
<% if (!item.get("editText")) { %>
|
<% if (!item.get("editText")) { %>
|
||||||
<div class="user-message" data-can-copy="true"><%=scope.pickLink(item.get("reply"))%></div>
|
<div class="user-message" data-can-copy="true"><%=scope.pickLink(item.get("reply"))%></div>
|
||||||
|
<% if (!hint) { %>
|
||||||
<div class="btns-reply-ct">
|
<div class="btns-reply-ct">
|
||||||
<% if (item.get("editable")) { %>
|
<% if (item.get("editable")) { %>
|
||||||
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
||||||
<% } %>
|
<% } %>
|
||||||
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<%}%>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<div class="inner-edit-ct">
|
<div class="inner-edit-ct">
|
||||||
<textarea class="msg-reply textarea-fix user-select" maxlength="maxCommLength"><%=item.get("reply")%></textarea>
|
<textarea class="msg-reply textarea-fix user-select" maxlength="maxCommLength"><%=item.get("reply")%></textarea>
|
||||||
|
@ -51,7 +53,7 @@
|
||||||
|
|
||||||
<!-- add reply button -->
|
<!-- add reply button -->
|
||||||
|
|
||||||
<% if (!showReply) { %>
|
<% if (!showReply && !hint) { %>
|
||||||
<% if (replys.length) { %>
|
<% if (replys.length) { %>
|
||||||
<label class="user-reply" style="margin-left: 20px; margin-top: 5px;" role="presentation" tabindex="-1">textAddReply</label>
|
<label class="user-reply" style="margin-left: 20px; margin-top: 5px;" role="presentation" tabindex="-1">textAddReply</label>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
|
@ -61,7 +63,7 @@
|
||||||
|
|
||||||
<!-- edit buttons -->
|
<!-- edit buttons -->
|
||||||
|
|
||||||
<% if (!editText && !lock) { %>
|
<% if (!editText && !lock && !hint) { %>
|
||||||
<div class="edit-ct">
|
<div class="edit-ct">
|
||||||
<% if (editable) { %>
|
<% if (editable) { %>
|
||||||
<div class="btn-edit img-commonctrl"></div>
|
<div class="btn-edit img-commonctrl"></div>
|
||||||
|
|
|
@ -549,6 +549,17 @@ define([
|
||||||
this.autoHeightTextBox();
|
this.autoHeightTextBox();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
changeLayout: function(mode) {
|
||||||
|
if (!mode.canComments) {
|
||||||
|
var add = $('.new-comment-ct', this.el),
|
||||||
|
to = $('.add-link-ct', this.el),
|
||||||
|
msgs = $('.messages-ct', this.el);
|
||||||
|
add.hide(); to.hide();
|
||||||
|
msgs.addClass('stretch');
|
||||||
|
this.layout.changeLayout([{el: msgs[0], rely: false, stretch: true}]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
updateLayout: function () {
|
updateLayout: function () {
|
||||||
var container = $('#comments-box', this.el), add = $('.new-comment-ct', this.el);
|
var container = $('#comments-box', this.el), add = $('.new-comment-ct', this.el);
|
||||||
if (add.css('display') !== 'none') {
|
if (add.css('display') !== 'none') {
|
||||||
|
@ -561,6 +572,7 @@ define([
|
||||||
autoHeightTextBox: function () {
|
autoHeightTextBox: function () {
|
||||||
var me = this, domTextBox = null, lineHeight = 0, minHeight = 44;
|
var me = this, domTextBox = null, lineHeight = 0, minHeight = 44;
|
||||||
var textBox = $('#comment-msg-new', this.el);
|
var textBox = $('#comment-msg-new', this.el);
|
||||||
|
if (textBox.length<1) return;
|
||||||
|
|
||||||
function updateTextBoxHeight() {
|
function updateTextBoxHeight() {
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,10 @@
|
||||||
height: 300px;
|
height: 300px;
|
||||||
border-bottom: 1px solid @gray-dark;
|
border-bottom: 1px solid @gray-dark;
|
||||||
|
|
||||||
|
&.stretch {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
.ps-scrollbar-y-rail {
|
.ps-scrollbar-y-rail {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
|
|
@ -188,8 +188,8 @@ define([
|
||||||
createDelayedElements: function() {
|
createDelayedElements: function() {
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
if ( this.mode.canCoAuthoring ) {
|
if ( this.mode.canCoAuthoring ) {
|
||||||
this.leftMenu.btnComments[(this.mode.canComments && !this.mode.isLightVersion) ? 'show' : 'hide']();
|
this.leftMenu.btnComments[(this.mode.canViewComments && !this.mode.isLightVersion) ? 'show' : 'hide']();
|
||||||
if (this.mode.canComments)
|
if (this.mode.canViewComments)
|
||||||
this.leftMenu.setOptionsPanel('comment', this.getApplication().getController('Common.Controllers.Comments').getView());
|
this.leftMenu.setOptionsPanel('comment', this.getApplication().getController('Common.Controllers.Comments').getView());
|
||||||
|
|
||||||
this.leftMenu.btnChat[(this.mode.canChat && !this.mode.isLightVersion) ? 'show' : 'hide']();
|
this.leftMenu.btnChat[(this.mode.canChat && !this.mode.isLightVersion) ? 'show' : 'hide']();
|
||||||
|
@ -406,7 +406,7 @@ define([
|
||||||
Common.Utils.InternalSettings.set("de-settings-livecomment", value);
|
Common.Utils.InternalSettings.set("de-settings-livecomment", value);
|
||||||
var resolved = Common.localStorage.getBool("de-settings-resolvedcomment");
|
var resolved = Common.localStorage.getBool("de-settings-resolvedcomment");
|
||||||
Common.Utils.InternalSettings.set("de-settings-resolvedcomment", resolved);
|
Common.Utils.InternalSettings.set("de-settings-resolvedcomment", resolved);
|
||||||
if (this.mode.canComments && this.leftMenu.panelComments.isVisible())
|
if (this.mode.canViewComments && this.leftMenu.panelComments.isVisible())
|
||||||
value = resolved = true;
|
value = resolved = true;
|
||||||
(value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments();
|
(value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments();
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
|
@ -653,7 +653,7 @@ define([
|
||||||
if (value && this.leftMenu._state.pluginIsRunning) {
|
if (value && this.leftMenu._state.pluginIsRunning) {
|
||||||
this.leftMenu.panelPlugins.show();
|
this.leftMenu.panelPlugins.show();
|
||||||
if (this.mode.canCoAuthoring) {
|
if (this.mode.canCoAuthoring) {
|
||||||
this.mode.canComments && this.leftMenu.panelComments['hide']();
|
this.mode.canViewComments && this.leftMenu.panelComments['hide']();
|
||||||
this.mode.canChat && this.leftMenu.panelChat['hide']();
|
this.mode.canChat && this.leftMenu.panelChat['hide']();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -751,7 +751,7 @@ define([
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case 'comments':
|
case 'comments':
|
||||||
if (this.mode.canCoAuthoring && this.mode.canComments && !this.mode.isLightVersion) {
|
if (this.mode.canCoAuthoring && this.mode.canViewComments && !this.mode.isLightVersion) {
|
||||||
Common.UI.Menu.Manager.hideAll();
|
Common.UI.Menu.Manager.hideAll();
|
||||||
this.leftMenu.showMenu('comments');
|
this.leftMenu.showMenu('comments');
|
||||||
this.getApplication().getController('Common.Controllers.Comments').onAfterShow();
|
this.getApplication().getController('Common.Controllers.Comments').onAfterShow();
|
||||||
|
|
|
@ -1112,6 +1112,7 @@ define([
|
||||||
this.appOptions.canSendEmailAddresses = this.appOptions.canLicense && this.editorConfig.canSendEmailAddresses && this.appOptions.canEdit && this.appOptions.canCoAuthoring;
|
this.appOptions.canSendEmailAddresses = this.appOptions.canLicense && this.editorConfig.canSendEmailAddresses && this.appOptions.canEdit && this.appOptions.canCoAuthoring;
|
||||||
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view');
|
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view');
|
||||||
this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
|
this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
|
||||||
|
this.appOptions.canViewComments = 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.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.canEditStyles = this.appOptions.canLicense && this.appOptions.canEdit;
|
||||||
this.appOptions.canPrint = (this.permissions.print !== false);
|
this.appOptions.canPrint = (this.permissions.print !== false);
|
||||||
|
@ -1204,12 +1205,11 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
applyModeEditorElements: function() {
|
applyModeEditorElements: function() {
|
||||||
if (this.appOptions.canComments || this.appOptions.isEdit) {
|
/** coauthoring begin **/
|
||||||
/** coauthoring begin **/
|
this.contComments.setMode(this.appOptions);
|
||||||
this.contComments.setMode(this.appOptions);
|
this.contComments.setConfig({config: this.editorConfig}, this.api);
|
||||||
this.contComments.setConfig({config: this.editorConfig}, this.api);
|
/** coauthoring end **/
|
||||||
/** coauthoring end **/
|
|
||||||
}
|
|
||||||
if (this.appOptions.isEdit) {
|
if (this.appOptions.isEdit) {
|
||||||
var me = this,
|
var me = this,
|
||||||
application = this.getApplication(),
|
application = this.getApplication(),
|
||||||
|
|
|
@ -401,7 +401,7 @@ define([
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
$('tr.coauth', this.el)[mode.isEdit && mode.canCoAuthoring ? 'show' : 'hide']();
|
$('tr.coauth', this.el)[mode.isEdit && mode.canCoAuthoring ? 'show' : 'hide']();
|
||||||
$('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide']();
|
$('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide']();
|
||||||
$('tr.comments', this.el)[mode.canCoAuthoring && (mode.isEdit || mode.canComments) ? 'show' : 'hide']();
|
$('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide']();
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -216,7 +216,7 @@ define([
|
||||||
onCoauthOptions: function(e) {
|
onCoauthOptions: function(e) {
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
if (this.mode.canCoAuthoring) {
|
if (this.mode.canCoAuthoring) {
|
||||||
if (this.mode.canComments) {
|
if (this.mode.canViewComments) {
|
||||||
if (this.btnComments.pressed && this.btnComments.$el.hasClass('notify'))
|
if (this.btnComments.pressed && this.btnComments.$el.hasClass('notify'))
|
||||||
this.btnComments.$el.removeClass('notify');
|
this.btnComments.$el.removeClass('notify');
|
||||||
this.panelComments[this.btnComments.pressed?'show':'hide']();
|
this.panelComments[this.btnComments.pressed?'show':'hide']();
|
||||||
|
@ -288,7 +288,7 @@ define([
|
||||||
this.$el.width(SCALE_MIN);
|
this.$el.width(SCALE_MIN);
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
if (this.mode.canCoAuthoring) {
|
if (this.mode.canCoAuthoring) {
|
||||||
if (this.mode.canComments) {
|
if (this.mode.canViewComments) {
|
||||||
this.panelComments['hide']();
|
this.panelComments['hide']();
|
||||||
if (this.btnComments.pressed)
|
if (this.btnComments.pressed)
|
||||||
this.fireEvent('comments:hide', this);
|
this.fireEvent('comments:hide', this);
|
||||||
|
|
|
@ -182,8 +182,8 @@ define([
|
||||||
createDelayedElements: function() {
|
createDelayedElements: function() {
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
if ( this.mode.canCoAuthoring ) {
|
if ( this.mode.canCoAuthoring ) {
|
||||||
this.leftMenu.btnComments[(this.mode.canComments && !this.mode.isLightVersion) ? 'show' : 'hide']();
|
this.leftMenu.btnComments[(this.mode.canViewComments && !this.mode.isLightVersion) ? 'show' : 'hide']();
|
||||||
if (this.mode.canComments)
|
if (this.mode.canViewComments)
|
||||||
this.leftMenu.setOptionsPanel('comment', this.getApplication().getController('Common.Controllers.Comments').getView('Common.Views.Comments'));
|
this.leftMenu.setOptionsPanel('comment', this.getApplication().getController('Common.Controllers.Comments').getView('Common.Views.Comments'));
|
||||||
|
|
||||||
this.leftMenu.btnChat[(this.mode.canChat && !this.mode.isLightVersion) ? 'show' : 'hide']();
|
this.leftMenu.btnChat[(this.mode.canChat && !this.mode.isLightVersion) ? 'show' : 'hide']();
|
||||||
|
@ -631,7 +631,7 @@ define([
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case 'comments':
|
case 'comments':
|
||||||
if (this.mode.canCoAuthoring && this.mode.canComments && !this.mode.isLightVersion && (!previewPanel || !previewPanel.isVisible()) && !this._state.no_slides) {
|
if (this.mode.canCoAuthoring && this.mode.canViewComments && !this.mode.isLightVersion && (!previewPanel || !previewPanel.isVisible()) && !this._state.no_slides) {
|
||||||
Common.UI.Menu.Manager.hideAll();
|
Common.UI.Menu.Manager.hideAll();
|
||||||
this.leftMenu.showMenu('comments');
|
this.leftMenu.showMenu('comments');
|
||||||
this.getApplication().getController('Common.Controllers.Comments').onAfterShow();
|
this.getApplication().getController('Common.Controllers.Comments').onAfterShow();
|
||||||
|
|
|
@ -876,6 +876,7 @@ define([
|
||||||
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
|
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
|
||||||
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view');
|
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view');
|
||||||
this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
|
this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
|
||||||
|
this.appOptions.canViewComments = 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.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.canPrint = (this.permissions.print !== false);
|
||||||
this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename;
|
this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename;
|
||||||
|
@ -940,15 +941,13 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
applyModeEditorElements: function(prevmode) {
|
applyModeEditorElements: function(prevmode) {
|
||||||
if (this.appOptions.canComments || this.appOptions.isEdit) {
|
/** coauthoring begin **/
|
||||||
/** coauthoring begin **/
|
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
||||||
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
if (commentsController) {
|
||||||
if (commentsController) {
|
commentsController.setMode(this.appOptions);
|
||||||
commentsController.setMode(this.appOptions);
|
commentsController.setConfig({config: this.editorConfig, sdkviewname: '#id_main_parent'}, this.api);
|
||||||
commentsController.setConfig({config: this.editorConfig, sdkviewname: '#id_main_parent'}, this.api);
|
|
||||||
}
|
|
||||||
/** coauthoring end **/
|
|
||||||
}
|
}
|
||||||
|
/** coauthoring end **/
|
||||||
if (this.appOptions.isEdit) {
|
if (this.appOptions.isEdit) {
|
||||||
var me = this,
|
var me = this,
|
||||||
application = this.getApplication(),
|
application = this.getApplication(),
|
||||||
|
|
|
@ -218,7 +218,7 @@ define([
|
||||||
onCoauthOptions: function(e) {
|
onCoauthOptions: function(e) {
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
if (this.mode.canCoAuthoring) {
|
if (this.mode.canCoAuthoring) {
|
||||||
if (this.mode.canComments) {
|
if (this.mode.canViewComments) {
|
||||||
if (this.btnComments.pressed && this.btnComments.$el.hasClass('notify'))
|
if (this.btnComments.pressed && this.btnComments.$el.hasClass('notify'))
|
||||||
this.btnComments.$el.removeClass('notify');
|
this.btnComments.$el.removeClass('notify');
|
||||||
this.panelComments[this.btnComments.pressed?'show':'hide']();
|
this.panelComments[this.btnComments.pressed?'show':'hide']();
|
||||||
|
@ -274,7 +274,7 @@ define([
|
||||||
this.$el.width(SCALE_MIN);
|
this.$el.width(SCALE_MIN);
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
if (this.mode.canCoAuthoring) {
|
if (this.mode.canCoAuthoring) {
|
||||||
if (this.mode.canComments) {
|
if (this.mode.canViewComments) {
|
||||||
this.panelComments['hide']();
|
this.panelComments['hide']();
|
||||||
if (this.btnComments.pressed)
|
if (this.btnComments.pressed)
|
||||||
this.fireEvent('comments:hide', this);
|
this.fireEvent('comments:hide', this);
|
||||||
|
|
|
@ -980,7 +980,7 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me.permissions.isEdit || me.permissions.canComments) {
|
if (me.permissions.isEdit || me.permissions.canViewComments) {
|
||||||
if (index_comments && !this.popupmenu) {
|
if (index_comments && !this.popupmenu) {
|
||||||
data = dataarray[index_comments - 1];
|
data = dataarray[index_comments - 1];
|
||||||
if (!commentTip.editCommentId && commentTip.moveCommentId != data.asc_getCommentIndexes()[0]) {
|
if (!commentTip.editCommentId && commentTip.moveCommentId != data.asc_getCommentIndexes()[0]) {
|
||||||
|
@ -1015,7 +1015,7 @@ define([
|
||||||
|
|
||||||
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
||||||
if (commentsController) {
|
if (commentsController) {
|
||||||
if (this.permissions.canCoAuthoring && this.permissions.canComments)
|
if (this.permissions.canCoAuthoring && this.permissions.canViewComments)
|
||||||
setTimeout(function() {commentsController.onApiHideComment(true);}, 200);
|
setTimeout(function() {commentsController.onApiHideComment(true);}, 200);
|
||||||
else
|
else
|
||||||
commentsController.onApiHideComment(true);
|
commentsController.onApiHideComment(true);
|
||||||
|
|
|
@ -189,8 +189,8 @@ define([
|
||||||
createDelayedElements: function() {
|
createDelayedElements: function() {
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
if ( this.mode.canCoAuthoring ) {
|
if ( this.mode.canCoAuthoring ) {
|
||||||
this.leftMenu.btnComments[(this.mode.canComments && !this.mode.isLightVersion) ? 'show' : 'hide']();
|
this.leftMenu.btnComments[(this.mode.canViewComments && !this.mode.isLightVersion) ? 'show' : 'hide']();
|
||||||
if (this.mode.canComments)
|
if (this.mode.canViewComments)
|
||||||
this.leftMenu.setOptionsPanel('comment', this.getApplication().getController('Common.Controllers.Comments').getView('Common.Views.Comments'));
|
this.leftMenu.setOptionsPanel('comment', this.getApplication().getController('Common.Controllers.Comments').getView('Common.Views.Comments'));
|
||||||
|
|
||||||
this.leftMenu.btnChat[(this.mode.canChat && !this.mode.isLightVersion) ? 'show' : 'hide']();
|
this.leftMenu.btnChat[(this.mode.canChat && !this.mode.isLightVersion) ? 'show' : 'hide']();
|
||||||
|
@ -349,7 +349,7 @@ define([
|
||||||
var resolved = Common.localStorage.getBool("sse-settings-resolvedcomment");
|
var resolved = Common.localStorage.getBool("sse-settings-resolvedcomment");
|
||||||
Common.Utils.InternalSettings.set("sse-settings-resolvedcomment", resolved);
|
Common.Utils.InternalSettings.set("sse-settings-resolvedcomment", resolved);
|
||||||
|
|
||||||
if (this.mode.canComments && this.leftMenu.panelComments.isVisible())
|
if (this.mode.canViewComments && this.leftMenu.panelComments.isVisible())
|
||||||
value = resolved = true;
|
value = resolved = true;
|
||||||
(value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments();
|
(value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments();
|
||||||
|
|
||||||
|
@ -713,7 +713,7 @@ define([
|
||||||
if (!state && this.leftMenu._state.pluginIsRunning) {
|
if (!state && this.leftMenu._state.pluginIsRunning) {
|
||||||
this.leftMenu.panelPlugins.show();
|
this.leftMenu.panelPlugins.show();
|
||||||
if (this.mode.canCoAuthoring) {
|
if (this.mode.canCoAuthoring) {
|
||||||
this.mode.canComments && this.leftMenu.panelComments['hide']();
|
this.mode.canViewComments && this.leftMenu.panelComments['hide']();
|
||||||
this.mode.canChat && this.leftMenu.panelChat['hide']();
|
this.mode.canChat && this.leftMenu.panelChat['hide']();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -818,7 +818,7 @@ define([
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case 'comments':
|
case 'comments':
|
||||||
if (this.mode.canCoAuthoring && this.mode.canComments && !this.mode.isLightVersion) {
|
if (this.mode.canCoAuthoring && this.mode.canViewComments && !this.mode.isLightVersion) {
|
||||||
Common.UI.Menu.Manager.hideAll();
|
Common.UI.Menu.Manager.hideAll();
|
||||||
this.leftMenu.showMenu('comments');
|
this.leftMenu.showMenu('comments');
|
||||||
this.getApplication().getController('Common.Controllers.Comments').onAfterShow();
|
this.getApplication().getController('Common.Controllers.Comments').onAfterShow();
|
||||||
|
|
|
@ -902,6 +902,7 @@ define([
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? (this.permissions.edit !== false) : this.permissions.comment) && (this.editorConfig.mode !== 'view');
|
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? (this.permissions.edit !== false) : this.permissions.comment) && (this.editorConfig.mode !== 'view');
|
||||||
this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
|
this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
|
||||||
|
this.appOptions.canViewComments = 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.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
|
||||||
this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename;
|
this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename;
|
||||||
this.appOptions.trialMode = params.asc_getLicenseMode();
|
this.appOptions.trialMode = params.asc_getLicenseMode();
|
||||||
|
@ -1001,19 +1002,17 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
applyModeEditorElements: function(prevmode) {
|
applyModeEditorElements: function(prevmode) {
|
||||||
if (this.appOptions.canComments || this.appOptions.isEdit) {
|
/** coauthoring begin **/
|
||||||
/** coauthoring begin **/
|
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
||||||
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
if (commentsController) {
|
||||||
if (commentsController) {
|
commentsController.setMode(this.appOptions);
|
||||||
commentsController.setMode(this.appOptions);
|
commentsController.setConfig({
|
||||||
commentsController.setConfig({
|
config : this.editorConfig,
|
||||||
config : this.editorConfig,
|
sdkviewname : '#ws-canvas-outer',
|
||||||
sdkviewname : '#ws-canvas-outer',
|
hintmode : true},
|
||||||
hintmode : true},
|
this.api);
|
||||||
this.api);
|
|
||||||
}
|
|
||||||
/** coauthoring end **/
|
|
||||||
}
|
}
|
||||||
|
/** coauthoring end **/
|
||||||
|
|
||||||
if (this.appOptions.isEdit) {
|
if (this.appOptions.isEdit) {
|
||||||
var me = this,
|
var me = this,
|
||||||
|
@ -1623,7 +1622,7 @@ define([
|
||||||
if (!this.appOptions.isEditMailMerge && !this.appOptions.isEditDiagram && window.editor_elements_prepared) {
|
if (!this.appOptions.isEditMailMerge && !this.appOptions.isEditDiagram && window.editor_elements_prepared) {
|
||||||
this.application.getController('Statusbar').selectTab(index);
|
this.application.getController('Statusbar').selectTab(index);
|
||||||
|
|
||||||
if (this.appOptions.canComments && !this.dontCloseDummyComment) {
|
if (this.appOptions.canViewComments && !this.dontCloseDummyComment) {
|
||||||
Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + this.api.asc_getWorksheetId(index)], false ); // hide popover
|
Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + this.api.asc_getWorksheetId(index)], false ); // hide popover
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,9 +267,9 @@ define([
|
||||||
me.header.mnuitemFreezePanes.hide();
|
me.header.mnuitemFreezePanes.hide();
|
||||||
menu.items[5].hide();
|
menu.items[5].hide();
|
||||||
menu.items[7].hide();
|
menu.items[7].hide();
|
||||||
if (!config.canComments) { // show advanced settings for editing and commenting mode
|
if (!config.canViewComments) { // show advanced settings for editing and commenting mode
|
||||||
mnuitemAdvSettings.hide();
|
// mnuitemAdvSettings.hide();
|
||||||
menu.items[9].hide();
|
// menu.items[9].hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -255,8 +255,8 @@ define([
|
||||||
this.miAccess[(!this.mode.isOffline && this.document&&this.document.info&&(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 ||
|
this.miAccess[(!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.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length))?'show':'hide']();
|
||||||
|
|
||||||
this.miSettings[(this.mode.isEdit || this.mode.canComments)?'show':'hide']();
|
// this.miSettings[(this.mode.isEdit || this.mode.canViewComments)?'show':'hide']();
|
||||||
this.miSettings.$el.prev()[(this.mode.isEdit || this.mode.canComments)?'show':'hide']();
|
// this.miSettings.$el.prev()[(this.mode.isEdit || this.mode.canViewComments)?'show':'hide']();
|
||||||
|
|
||||||
this.mode.canBack ? this.$el.find('#fm-btn-back').show().prev().show() :
|
this.mode.canBack ? this.$el.find('#fm-btn-back').show().prev().show() :
|
||||||
this.$el.find('#fm-btn-back').hide().prev().hide();
|
this.$el.find('#fm-btn-back').hide().prev().hide();
|
||||||
|
|
|
@ -746,7 +746,7 @@ define([
|
||||||
this.lblAutosave.text(this.textAutoRecover);
|
this.lblAutosave.text(this.textAutoRecover);
|
||||||
}
|
}
|
||||||
$('tr.forcesave', this.el)[mode.canForcesave ? 'show' : 'hide']();
|
$('tr.forcesave', this.el)[mode.canForcesave ? 'show' : 'hide']();
|
||||||
$('tr.comments', this.el)[mode.canCoAuthoring && (mode.isEdit || mode.canComments) ? 'show' : 'hide']();
|
$('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide']();
|
||||||
$('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring? 'show' : 'hide']();
|
$('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring? 'show' : 'hide']();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ define([
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
onCoauthOptions: function(e) {
|
onCoauthOptions: function(e) {
|
||||||
if (this.mode.canCoAuthoring) {
|
if (this.mode.canCoAuthoring) {
|
||||||
if (this.mode.canComments) {
|
if (this.mode.canViewComments) {
|
||||||
if (this.btnComments.pressed && this.btnComments.$el.hasClass('notify'))
|
if (this.btnComments.pressed && this.btnComments.$el.hasClass('notify'))
|
||||||
this.btnComments.$el.removeClass('notify');
|
this.btnComments.$el.removeClass('notify');
|
||||||
this.panelComments[this.btnComments.pressed?'show':'hide']();
|
this.panelComments[this.btnComments.pressed?'show':'hide']();
|
||||||
|
@ -247,7 +247,7 @@ define([
|
||||||
this.$el.width(SCALE_MIN);
|
this.$el.width(SCALE_MIN);
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
if (this.mode.canCoAuthoring) {
|
if (this.mode.canCoAuthoring) {
|
||||||
if (this.mode.canComments) {
|
if (this.mode.canViewComments) {
|
||||||
this.panelComments['hide']();
|
this.panelComments['hide']();
|
||||||
if (this.btnComments.pressed)
|
if (this.btnComments.pressed)
|
||||||
this.fireEvent('comments:hide', this);
|
this.fireEvent('comments:hide', this);
|
||||||
|
|
Loading…
Reference in a new issue