[DE] Added tab Collaboration.
This commit is contained in:
parent
c207a7c230
commit
32267aa6ab
|
@ -76,7 +76,8 @@ define([
|
|||
'reviewchange:delete': _.bind(this.onDeleteClick, this),
|
||||
'reviewchange:preview': _.bind(this.onBtnPreviewClick, this),
|
||||
'reviewchanges:view': _.bind(this.onReviewViewClick, this),
|
||||
'lang:document': _.bind(this.onDocLanguage, this)
|
||||
'lang:document': _.bind(this.onDocLanguage, this),
|
||||
'collaboration:coauthmode': _.bind(this.onCoAuthMode, this)
|
||||
},
|
||||
'Common.Views.ReviewChangesDialog': {
|
||||
'reviewchange:accept': _.bind(this.onAcceptClick, this),
|
||||
|
@ -519,6 +520,30 @@ define([
|
|||
return this._state.previewMode;
|
||||
},
|
||||
|
||||
onCoAuthMode: function(menu, item, e) {
|
||||
Common.localStorage.setItem("de-settings-coauthmode", item.value);
|
||||
|
||||
if (this.api) {
|
||||
this.api.asc_SetFastCollaborative(item.value==1);
|
||||
|
||||
var value = Common.localStorage.getItem(item.value ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict");
|
||||
if (value !== null)
|
||||
this.api.SetCollaborativeMarksShowType(value == 'all' ? Asc.c_oAscCollaborativeMarksShowType.All :
|
||||
value == 'none' ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges);
|
||||
else
|
||||
this.api.SetCollaborativeMarksShowType(item.value ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges);
|
||||
|
||||
value = Common.localStorage.getItem("de-settings-autosave");
|
||||
if (value===null && this.appConfig.customization && this.appConfig.customization.autosave===false)
|
||||
value = 0;
|
||||
value = (!item.value && value!==null) ? parseInt(value) : 1;
|
||||
|
||||
Common.localStorage.setItem("de-settings-autosave", value);
|
||||
this.api.asc_setAutoSaveGap(value);
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', this.view);
|
||||
},
|
||||
|
||||
disableEditing: function(disable) {
|
||||
var app = this.getApplication();
|
||||
app.getController('RightMenu').getView('RightMenu').clearSelection();
|
||||
|
@ -589,6 +614,7 @@ define([
|
|||
|
||||
applySettings: function(menu) {
|
||||
this.view && this.view.turnSpelling( Common.localStorage.getBool("de-settings-spellcheck", true) );
|
||||
this.view && this.view.turnCoAuthMode( Common.localStorage.getBool("de-settings-coauthmode", true) );
|
||||
},
|
||||
|
||||
synchronizeChanges: function() {
|
||||
|
@ -624,6 +650,10 @@ define([
|
|||
})).show();
|
||||
},
|
||||
|
||||
onLostEditRights: function() {
|
||||
this.view && this.view.onLostEditRights();
|
||||
},
|
||||
|
||||
textInserted: '<b>Inserted:</b>',
|
||||
textDeleted: '<b>Deleted:</b>',
|
||||
textParaInserted: '<b>Paragraph Inserted</b> ',
|
||||
|
|
|
@ -418,6 +418,11 @@ define([
|
|||
'<div class="group no-group-mask" style="padding-left: 0;">' +
|
||||
'<span id="slot-btn-spelling" class="btn-slot text x-huge"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long"/>' +
|
||||
'<div class="group">' +
|
||||
'<span id="slot-btn-sharing" class="btn-slot text x-huge"></span>' +
|
||||
'<span id="slot-btn-coauthmode" class="btn-slot text x-huge"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long comments"/>' +
|
||||
'<div class="group">' +
|
||||
'<span class="btn-slot text x-huge slot-comment"></span>' +
|
||||
|
@ -492,6 +497,14 @@ define([
|
|||
this.btnDocLang.on('click', function (btn, e) {
|
||||
me.fireEvent('lang:document', this);
|
||||
});
|
||||
|
||||
this.btnSharing && this.btnSharing.on('click', function (btn, e) {
|
||||
Common.NotificationCenter.trigger('collaboration:sharing');
|
||||
});
|
||||
|
||||
this.btnCoAuthMode && this.btnCoAuthMode.menu.on('item:click', function (menu, item, e) {
|
||||
me.fireEvent('collaboration:coauthmode', [menu, item]);
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -549,6 +562,23 @@ define([
|
|||
});
|
||||
}
|
||||
|
||||
if (!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length && this._readonlyRights!==true) {
|
||||
this.btnSharing = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-ic-sharing',
|
||||
caption: this.txtSharing
|
||||
});
|
||||
}
|
||||
|
||||
if (!this.appConfig.isOffline && this.appConfig.canCoAuthoring) {
|
||||
this.btnCoAuthMode = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-ic-reviewview',
|
||||
caption: this.txtCoAuthMode,
|
||||
menu: true
|
||||
});
|
||||
}
|
||||
|
||||
this.btnSetSpelling = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-ic-docspell',
|
||||
|
@ -662,6 +692,31 @@ define([
|
|||
me.btnDocLang.updateHint(me.tipSetDocLang);
|
||||
me.btnSetSpelling.updateHint(me.tipSetSpelling);
|
||||
|
||||
me.btnSharing && me.btnSharing.updateHint(me.tipSharing);
|
||||
if (me.btnCoAuthMode) {
|
||||
me.btnCoAuthMode.setMenu(
|
||||
new Common.UI.Menu({
|
||||
cls: 'ppm-toolbar',
|
||||
items: [
|
||||
{
|
||||
caption: me.strFast,
|
||||
checkable: true,
|
||||
toggleGroup: 'menuCoauthMode',
|
||||
checked: true,
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
caption: me.strStrict,
|
||||
checkable: true,
|
||||
toggleGroup: 'menuCoauthMode',
|
||||
checked: false,
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
}));
|
||||
me.btnCoAuthMode.updateHint(me.tipCoAuthMode);
|
||||
}
|
||||
|
||||
setEvents.call(me);
|
||||
});
|
||||
},
|
||||
|
@ -681,6 +736,9 @@ define([
|
|||
this.btnSetSpelling.render(this.$el.find('#slot-btn-spelling'));
|
||||
this.btnDocLang.render(this.$el.find('#slot-set-lang'));
|
||||
|
||||
this.btnSharing && this.btnSharing.render(this.$el.find('#slot-btn-sharing'));
|
||||
this.btnCoAuthMode && this.btnCoAuthMode.render(this.$el.find('#slot-btn-coauthmode'));
|
||||
|
||||
return this.$el;
|
||||
},
|
||||
|
||||
|
@ -758,6 +816,13 @@ define([
|
|||
}, this);
|
||||
},
|
||||
|
||||
turnCoAuthMode: function (fast) {
|
||||
if (this.btnCoAuthMode) {
|
||||
this.btnCoAuthMode.menu.items[0].setChecked(fast, true);
|
||||
this.btnCoAuthMode.menu.items[1].setChecked(!fast, true);
|
||||
}
|
||||
},
|
||||
|
||||
SetDisabled: function (state) {
|
||||
this.btnsSpelling && this.btnsSpelling.forEach(function(button) {
|
||||
if ( button ) {
|
||||
|
@ -771,6 +836,14 @@ define([
|
|||
}, this);
|
||||
},
|
||||
|
||||
onLostEditRights: function() {
|
||||
this._readonlyRights = true;
|
||||
if (!this.rendered)
|
||||
return;
|
||||
|
||||
this.btnSharing && this.btnSharing.setDisabled(true);
|
||||
},
|
||||
|
||||
txtAccept: 'Accept',
|
||||
txtAcceptCurrent: 'Accept current Changes',
|
||||
txtAcceptAll: 'Accept all Changes',
|
||||
|
@ -795,7 +868,13 @@ define([
|
|||
txtOriginal: 'All changes rejected (Preview)',
|
||||
tipReviewView: 'Select the way you want the changes to be displayed',
|
||||
tipAcceptCurrent: 'Accept current changes',
|
||||
tipRejectCurrent: 'Reject current changes'
|
||||
tipRejectCurrent: 'Reject current changes',
|
||||
txtSharing: 'Sharing',
|
||||
tipSharing: 'Manage document access rights',
|
||||
txtCoAuthMode: 'Co-editing Mode',
|
||||
tipCoAuthMode: 'Set co-editing mode',
|
||||
strFast: 'Fast',
|
||||
strStrict: 'Strict'
|
||||
}
|
||||
}()), Common.Views.ReviewChanges || {}));
|
||||
|
||||
|
|
|
@ -2839,7 +2839,7 @@ define([
|
|||
me.toolbar.render(_.extend({isCompactView: compactview}, config));
|
||||
|
||||
if ( config.isEdit ) {
|
||||
var tab = {action: 'review', caption: me.toolbar.textTabReview};
|
||||
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration};
|
||||
var $panel = DE.getController('Common.Controllers.ReviewChanges').createToolbarPanel();
|
||||
|
||||
if ( $panel ) {
|
||||
|
|
|
@ -861,6 +861,8 @@ define([
|
|||
});
|
||||
}
|
||||
|
||||
Common.NotificationCenter.on('collaboration:sharing', _.bind(this.changeAccessRights, this));
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
@ -2520,7 +2520,8 @@ define([
|
|||
capImgWrapping: 'Wrapping',
|
||||
capBtnComment: 'Comment',
|
||||
textColumnsCustom: 'Custom Columns',
|
||||
textSurface: 'Surface'
|
||||
textSurface: 'Surface',
|
||||
textTabCollaboration: 'Collaboration'
|
||||
}
|
||||
})(), DE.Views.Toolbar || {}));
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue