[Desktop] Show/hide protect settings depending on sdk settings (use isSignatureSupport, isProtectionSupport)
This commit is contained in:
parent
33f7e7cbc5
commit
2a254a88d0
|
@ -87,15 +87,14 @@ define([
|
||||||
if (api) {
|
if (api) {
|
||||||
this.api = api;
|
this.api = api;
|
||||||
|
|
||||||
if (this.appConfig.isDesktopApp && this.appConfig.isOffline) {
|
if (this.appConfig.isPasswordSupport)
|
||||||
this.api.asc_registerCallback('asc_onDocumentPassword', _.bind(this.onDocumentPassword, this));
|
this.api.asc_registerCallback('asc_onDocumentPassword', _.bind(this.onDocumentPassword, this));
|
||||||
if (this.appConfig.canProtect) {
|
if (this.appConfig.isSignatureSupport) {
|
||||||
Common.NotificationCenter.on('protect:sign', _.bind(this.onSignatureRequest, this));
|
Common.NotificationCenter.on('protect:sign', _.bind(this.onSignatureRequest, this));
|
||||||
Common.NotificationCenter.on('protect:signature', _.bind(this.onSignatureClick, this));
|
Common.NotificationCenter.on('protect:signature', _.bind(this.onSignatureClick, this));
|
||||||
this.api.asc_registerCallback('asc_onSignatureClick', _.bind(this.onSignatureSign, this));
|
this.api.asc_registerCallback('asc_onSignatureClick', _.bind(this.onSignatureSign, this));
|
||||||
this.api.asc_registerCallback('asc_onUpdateSignatures', _.bind(this.onApiUpdateSignatures, this));
|
this.api.asc_registerCallback('asc_onUpdateSignatures', _.bind(this.onApiUpdateSignatures, this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
|
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -65,7 +65,7 @@ define([
|
||||||
function setEvents() {
|
function setEvents() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
if ( me.appConfig.isDesktopApp && me.appConfig.isOffline ) {
|
if (me.appConfig.isPasswordSupport) {
|
||||||
this.btnsAddPwd.concat(this.btnsChangePwd).forEach(function(button) {
|
this.btnsAddPwd.concat(this.btnsChangePwd).forEach(function(button) {
|
||||||
button.on('click', function (b, e) {
|
button.on('click', function (b, e) {
|
||||||
me.fireEvent('protect:password', [b, 'add']);
|
me.fireEvent('protect:password', [b, 'add']);
|
||||||
|
@ -81,8 +81,9 @@ define([
|
||||||
this.btnPwd.menu.on('item:click', function (menu, item, e) {
|
this.btnPwd.menu.on('item:click', function (menu, item, e) {
|
||||||
me.fireEvent('protect:password', [menu, item.value]);
|
me.fireEvent('protect:password', [menu, item.value]);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (me.appConfig.canProtect) {
|
if (me.appConfig.isSignatureSupport) {
|
||||||
if (this.btnSignature.menu)
|
if (this.btnSignature.menu)
|
||||||
this.btnSignature.menu.on('item:click', function (menu, item, e) {
|
this.btnSignature.menu.on('item:click', function (menu, item, e) {
|
||||||
me.fireEvent('protect:signature', [item.value, false]);
|
me.fireEvent('protect:signature', [item.value, false]);
|
||||||
|
@ -95,7 +96,6 @@ define([
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ define([
|
||||||
var filter = Common.localStorage.getKeysFilter();
|
var filter = Common.localStorage.getKeysFilter();
|
||||||
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
|
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
|
||||||
|
|
||||||
if ( this.appConfig.isDesktopApp && this.appConfig.isOffline ) {
|
if ( this.appConfig.isPasswordSupport ) {
|
||||||
this.btnAddPwd = new Common.UI.Button({
|
this.btnAddPwd = new Common.UI.Button({
|
||||||
cls: 'btn-toolbar x-huge icon-top',
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
iconCls: 'btn-ic-protect',
|
iconCls: 'btn-ic-protect',
|
||||||
|
@ -131,8 +131,8 @@ define([
|
||||||
menu: true,
|
menu: true,
|
||||||
visible: false
|
visible: false
|
||||||
});
|
});
|
||||||
|
}
|
||||||
if (this.appConfig.canProtect) {
|
if (this.appConfig.isSignatureSupport) {
|
||||||
this.btnSignature = new Common.UI.Button({
|
this.btnSignature = new Common.UI.Button({
|
||||||
cls: 'btn-toolbar x-huge icon-top',
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
iconCls: 'btn-ic-signature',
|
iconCls: 'btn-ic-signature',
|
||||||
|
@ -142,7 +142,7 @@ define([
|
||||||
if (!this.btnSignature.menu)
|
if (!this.btnSignature.menu)
|
||||||
this.btnsInvisibleSignature.push(this.btnSignature);
|
this.btnsInvisibleSignature.push(this.btnSignature);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||||
},
|
},
|
||||||
|
@ -159,7 +159,8 @@ define([
|
||||||
(new Promise(function (accept, reject) {
|
(new Promise(function (accept, reject) {
|
||||||
accept();
|
accept();
|
||||||
})).then(function(){
|
})).then(function(){
|
||||||
if ( config.isDesktopApp && config.isOffline) {
|
if ( config.canProtect) {
|
||||||
|
if ( config.isPasswordSupport) {
|
||||||
me.btnAddPwd.updateHint(me.hintAddPwd);
|
me.btnAddPwd.updateHint(me.hintAddPwd);
|
||||||
me.btnPwd.updateHint(me.hintPwd);
|
me.btnPwd.updateHint(me.hintPwd);
|
||||||
|
|
||||||
|
@ -177,7 +178,7 @@ define([
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
}
|
||||||
if (me.btnSignature) {
|
if (me.btnSignature) {
|
||||||
me.btnSignature.updateHint((me.btnSignature.menu) ? me.hintSignature : me.txtInvisibleSignature);
|
me.btnSignature.updateHint((me.btnSignature.menu) ? me.hintSignature : me.txtInvisibleSignature);
|
||||||
me.btnSignature.menu && me.btnSignature.setMenu(
|
me.btnSignature.menu && me.btnSignature.setMenu(
|
||||||
|
@ -206,9 +207,9 @@ define([
|
||||||
getPanel: function () {
|
getPanel: function () {
|
||||||
this.$el = $(_.template(template)( {} ));
|
this.$el = $(_.template(template)( {} ));
|
||||||
|
|
||||||
if ( this.appConfig.isDesktopApp && this.appConfig.isOffline ) {
|
if ( this.appConfig.canProtect ) {
|
||||||
this.btnAddPwd.render(this.$el.find('#slot-btn-add-password'));
|
this.btnAddPwd && this.btnAddPwd.render(this.$el.find('#slot-btn-add-password'));
|
||||||
this.btnPwd.render(this.$el.find('#slot-btn-change-password'));
|
this.btnPwd && this.btnPwd.render(this.$el.find('#slot-btn-change-password'));
|
||||||
this.btnSignature && this.btnSignature.render(this.$el.find('#slot-btn-signature'));
|
this.btnSignature && this.btnSignature.render(this.$el.find('#slot-btn-signature'));
|
||||||
}
|
}
|
||||||
return this.$el;
|
return this.$el;
|
||||||
|
|
|
@ -1096,8 +1096,9 @@ define([
|
||||||
this.appOptions.forcesave = this.appOptions.canForcesave;
|
this.appOptions.forcesave = this.appOptions.canForcesave;
|
||||||
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
|
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
|
||||||
this.appOptions.trialMode = params.asc_getLicenseMode();
|
this.appOptions.trialMode = params.asc_getLicenseMode();
|
||||||
this.appOptions.isProtectSupport = true; // remove in 5.2
|
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
|
||||||
this.appOptions.canProtect = this.appOptions.isProtectSupport && this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
|
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isProtectionSupport();
|
||||||
|
this.appOptions.canProtect = (this.appOptions.isSignatureSupport || this.appOptions.isPasswordSupport);
|
||||||
this.appOptions.canEditContentControl = (this.permissions.modifyContentControl!==false);
|
this.appOptions.canEditContentControl = (this.permissions.modifyContentControl!==false);
|
||||||
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
|
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
|
||||||
this.appOptions.canFillForms = (this.permissions.fillForms===undefined) ? this.appOptions.isEdit : this.permissions.fillForms;
|
this.appOptions.canFillForms = (this.permissions.fillForms===undefined) ? this.appOptions.isEdit : this.permissions.fillForms;
|
||||||
|
@ -1197,7 +1198,7 @@ define([
|
||||||
|
|
||||||
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
||||||
|
|
||||||
if (this.appOptions.isDesktopApp && this.appOptions.isOffline)
|
if (this.appOptions.canProtect)
|
||||||
application.getController('Common.Controllers.Protection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
application.getController('Common.Controllers.Protection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
||||||
|
|
||||||
var viewport = this.getApplication().getController('Viewport').getView('Viewport');
|
var viewport = this.getApplication().getController('Viewport').getView('Viewport');
|
||||||
|
|
|
@ -2728,7 +2728,7 @@ define([
|
||||||
me.toolbar.btnPaste.$el.detach().appendTo($box);
|
me.toolbar.btnPaste.$el.detach().appendTo($box);
|
||||||
me.toolbar.btnCopy.$el.removeClass('split');
|
me.toolbar.btnCopy.$el.removeClass('split');
|
||||||
|
|
||||||
if ( config.isProtectSupport && config.isOffline ) {
|
if ( config.canProtect ) {
|
||||||
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
|
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
|
||||||
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
|
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
|
||||||
|
|
||||||
|
|
|
@ -1946,7 +1946,7 @@ define([
|
||||||
this.viewModeMenu = new Common.UI.Menu({
|
this.viewModeMenu = new Common.UI.Menu({
|
||||||
initMenu: function (value) {
|
initMenu: function (value) {
|
||||||
var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties())),
|
var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties())),
|
||||||
signGuid = (value.imgProps && value.imgProps.value && me.mode.canProtect) ? value.imgProps.value.asc_getSignatureId() : undefined,
|
signGuid = (value.imgProps && value.imgProps.value && me.mode.isSignatureSupport) ? value.imgProps.value.asc_getSignatureId() : undefined,
|
||||||
signProps = (signGuid) ? me.api.asc_getSignatureSetup(signGuid) : null,
|
signProps = (signGuid) ? me.api.asc_getSignatureSetup(signGuid) : null,
|
||||||
isInSign = !!signProps && me._canProtect,
|
isInSign = !!signProps && me._canProtect,
|
||||||
canComment = !isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled;
|
canComment = !isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled;
|
||||||
|
@ -2432,7 +2432,7 @@ define([
|
||||||
menuImgCut.setDisabled(islocked || !cancopy);
|
menuImgCut.setDisabled(islocked || !cancopy);
|
||||||
menuImgPaste.setDisabled(islocked);
|
menuImgPaste.setDisabled(islocked);
|
||||||
|
|
||||||
var signGuid = (value.imgProps && value.imgProps.value && me.mode.canProtect) ? value.imgProps.value.asc_getSignatureId() : undefined,
|
var signGuid = (value.imgProps && value.imgProps.value && me.mode.isSignatureSupport) ? value.imgProps.value.asc_getSignatureId() : undefined,
|
||||||
isInSign = !!signGuid;
|
isInSign = !!signGuid;
|
||||||
menuSignatureEditSign.setVisible(isInSign);
|
menuSignatureEditSign.setVisible(isInSign);
|
||||||
menuSignatureEditSetup.setVisible(isInSign);
|
menuSignatureEditSetup.setVisible(isInSign);
|
||||||
|
|
|
@ -244,7 +244,7 @@ define([
|
||||||
applyMode: function() {
|
applyMode: function() {
|
||||||
this.miPrint[this.mode.canPrint?'show':'hide']();
|
this.miPrint[this.mode.canPrint?'show':'hide']();
|
||||||
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
|
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
|
||||||
this.miProtect[(this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) ?'show':'hide']();
|
this.miProtect[this.mode.canProtect ?'show':'hide']();
|
||||||
this.miProtect.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
|
this.miProtect.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
|
||||||
this.miRecent[this.mode.canOpenRecent?'show':'hide']();
|
this.miRecent[this.mode.canOpenRecent?'show':'hide']();
|
||||||
this.miNew[this.mode.canCreateNew?'show':'hide']();
|
this.miNew[this.mode.canCreateNew?'show':'hide']();
|
||||||
|
@ -284,7 +284,7 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) {
|
if (this.mode.canProtect) {
|
||||||
// this.$el.find('#fm-btn-back').hide();
|
// this.$el.find('#fm-btn-back').hide();
|
||||||
this.panels['protect'] = (new DE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
|
this.panels['protect'] = (new DE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
|
||||||
this.panels['protect'].setMode(this.mode);
|
this.panels['protect'].setMode(this.mode);
|
||||||
|
|
|
@ -1179,7 +1179,8 @@ define([
|
||||||
this.btnDeletePwd.render(this.$el.find('#fms-btn-delete-pwd'));
|
this.btnDeletePwd.render(this.$el.find('#fms-btn-delete-pwd'));
|
||||||
this.btnDeletePwd.on('click', _.bind(this.closeMenu, this));
|
this.btnDeletePwd.on('click', _.bind(this.closeMenu, this));
|
||||||
|
|
||||||
this.cntPassword = $('#id-fms-view-pwd');
|
this.cntPassword = $('#id-fms-password');
|
||||||
|
this.cntPasswordView = $('#id-fms-view-pwd');
|
||||||
|
|
||||||
this.btnAddInvisibleSign = protection.getButton('signature');
|
this.btnAddInvisibleSign = protection.getButton('signature');
|
||||||
this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign'));
|
this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign'));
|
||||||
|
@ -1208,7 +1209,8 @@ define([
|
||||||
|
|
||||||
setMode: function(mode) {
|
setMode: function(mode) {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.cntSignature.toggleClass('hidden', !this.mode.canProtect);
|
this.cntSignature.toggleClass('hidden', !this.mode.isSignatureSupport);
|
||||||
|
this.cntPassword.toggleClass('hidden', !this.mode.isPasswordSupport);
|
||||||
},
|
},
|
||||||
|
|
||||||
setApi: function(o) {
|
setApi: function(o) {
|
||||||
|
@ -1269,7 +1271,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
updateEncrypt: function() {
|
updateEncrypt: function() {
|
||||||
this.cntPassword.toggleClass('hidden', this.btnAddPwd.isVisible());
|
this.cntPasswordView.toggleClass('hidden', this.btnAddPwd.isVisible());
|
||||||
},
|
},
|
||||||
|
|
||||||
strProtect: 'Protect Document',
|
strProtect: 'Protect Document',
|
||||||
|
|
|
@ -195,7 +195,7 @@ define([
|
||||||
this.mergeSettings = new DE.Views.MailMergeSettings();
|
this.mergeSettings = new DE.Views.MailMergeSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode && mode.canProtect) {
|
if (mode && mode.isSignatureSupport) {
|
||||||
this.btnSignature = new Common.UI.Button({
|
this.btnSignature = new Common.UI.Button({
|
||||||
hint: this.txtSignatureSettings,
|
hint: this.txtSignatureSettings,
|
||||||
asctype: Common.Utils.documentSettingsType.Signature,
|
asctype: Common.Utils.documentSettingsType.Signature,
|
||||||
|
|
|
@ -860,8 +860,9 @@ define([
|
||||||
this.appOptions.forcesave = this.appOptions.canForcesave;
|
this.appOptions.forcesave = this.appOptions.canForcesave;
|
||||||
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
|
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
|
||||||
this.appOptions.trialMode = params.asc_getLicenseMode();
|
this.appOptions.trialMode = params.asc_getLicenseMode();
|
||||||
this.appOptions.isProtectSupport = true; // remove in 5.2
|
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
|
||||||
this.appOptions.canProtect = this.appOptions.isProtectSupport && this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
|
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isProtectionSupport();
|
||||||
|
this.appOptions.canProtect = (this.appOptions.isSignatureSupport || this.appOptions.isPasswordSupport);
|
||||||
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
|
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
|
||||||
|
|
||||||
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
|
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
|
||||||
|
@ -940,7 +941,7 @@ define([
|
||||||
|
|
||||||
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
||||||
|
|
||||||
if (me.appOptions.isDesktopApp && me.appOptions.isOffline)
|
if (me.appOptions.canProtect)
|
||||||
application.getController('Common.Controllers.Protection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
application.getController('Common.Controllers.Protection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
||||||
|
|
||||||
var viewport = this.getApplication().getController('Viewport').getView('Viewport');
|
var viewport = this.getApplication().getController('Viewport').getView('Viewport');
|
||||||
|
|
|
@ -2018,7 +2018,7 @@ define([
|
||||||
me.toolbar.btnPaste.$el.detach().appendTo($box);
|
me.toolbar.btnPaste.$el.detach().appendTo($box);
|
||||||
me.toolbar.btnCopy.$el.removeClass('split');
|
me.toolbar.btnCopy.$el.removeClass('split');
|
||||||
|
|
||||||
if ( config.isProtectSupport && config.isOffline ) { // don't add protect panel to toolbar
|
if ( config.canProtect ) { // don't add protect panel to toolbar
|
||||||
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
|
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
|
||||||
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
|
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
|
||||||
if ($panel)
|
if ($panel)
|
||||||
|
|
|
@ -240,7 +240,7 @@ define([
|
||||||
applyMode: function() {
|
applyMode: function() {
|
||||||
this.miPrint[this.mode.canPrint?'show':'hide']();
|
this.miPrint[this.mode.canPrint?'show':'hide']();
|
||||||
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
|
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
|
||||||
this.miProtect[(this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) ?'show':'hide']();
|
this.miProtect[this.mode.canProtect ?'show':'hide']();
|
||||||
this.miProtect.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
|
this.miProtect.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
|
||||||
this.miRecent[this.mode.canOpenRecent?'show':'hide']();
|
this.miRecent[this.mode.canOpenRecent?'show':'hide']();
|
||||||
this.miNew[this.mode.canCreateNew?'show':'hide']();
|
this.miNew[this.mode.canCreateNew?'show':'hide']();
|
||||||
|
@ -280,13 +280,13 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.mode.isDesktopApp && this.mode.isOffline) {
|
if (this.mode.isDesktopApp && this.mode.isOffline)
|
||||||
this.$el.find('#fm-btn-create, #fm-btn-back, #fm-btn-create+.devider').hide();
|
this.$el.find('#fm-btn-create, #fm-btn-back, #fm-btn-create+.devider').hide();
|
||||||
if (this.mode.isEdit) {
|
|
||||||
|
if (this.mode.canProtect) {
|
||||||
this.panels['protect'] = (new PE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
|
this.panels['protect'] = (new PE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
|
||||||
this.panels['protect'].setMode(this.mode);
|
this.panels['protect'].setMode(this.mode);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (this.mode.canHelp) {
|
if (this.mode.canHelp) {
|
||||||
this.panels['help'] = ((new PE.Views.FileMenuPanels.Help({menu: this})).render());
|
this.panels['help'] = ((new PE.Views.FileMenuPanels.Help({menu: this})).render());
|
||||||
|
|
|
@ -938,7 +938,8 @@ define([
|
||||||
this.btnDeletePwd.render(this.$el.find('#fms-btn-delete-pwd'));
|
this.btnDeletePwd.render(this.$el.find('#fms-btn-delete-pwd'));
|
||||||
this.btnDeletePwd.on('click', _.bind(this.closeMenu, this));
|
this.btnDeletePwd.on('click', _.bind(this.closeMenu, this));
|
||||||
|
|
||||||
this.cntPassword = $('#id-fms-view-pwd');
|
this.cntPassword = $('#id-fms-password');
|
||||||
|
this.cntPasswordView = $('#id-fms-view-pwd');
|
||||||
|
|
||||||
this.btnAddInvisibleSign = protection.getButton('signature');
|
this.btnAddInvisibleSign = protection.getButton('signature');
|
||||||
this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign'));
|
this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign'));
|
||||||
|
@ -967,7 +968,8 @@ define([
|
||||||
|
|
||||||
setMode: function(mode) {
|
setMode: function(mode) {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.cntSignature.toggleClass('hidden', !this.mode.canProtect);
|
this.cntSignature.toggleClass('hidden', !this.mode.isSignatureSupport);
|
||||||
|
this.cntPassword.toggleClass('hidden', !this.mode.isPasswordSupport);
|
||||||
},
|
},
|
||||||
|
|
||||||
setApi: function(o) {
|
setApi: function(o) {
|
||||||
|
@ -1022,7 +1024,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
updateEncrypt: function() {
|
updateEncrypt: function() {
|
||||||
this.cntPassword.toggleClass('hidden', this.btnAddPwd.isVisible());
|
this.cntPasswordView.toggleClass('hidden', this.btnAddPwd.isVisible());
|
||||||
},
|
},
|
||||||
|
|
||||||
strProtect: 'Protect Presentation',
|
strProtect: 'Protect Presentation',
|
||||||
|
|
|
@ -899,8 +899,9 @@ define([
|
||||||
(typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
|
(typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
|
||||||
this.appOptions.forcesave = this.appOptions.canForcesave;
|
this.appOptions.forcesave = this.appOptions.canForcesave;
|
||||||
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
|
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
|
||||||
this.appOptions.isProtectSupport = true; // remove in 5.2
|
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport() && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
|
||||||
this.appOptions.canProtect = this.appOptions.isProtectSupport && this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport() && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
|
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isProtectionSupport() && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
|
||||||
|
this.appOptions.canProtect = (this.appOptions.isSignatureSupport || this.appOptions.isPasswordSupport);
|
||||||
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
|
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
|
||||||
|
|
||||||
if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge) {
|
if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge) {
|
||||||
|
@ -1004,7 +1005,7 @@ define([
|
||||||
|
|
||||||
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
||||||
|
|
||||||
if (me.appOptions.isDesktopApp && me.appOptions.isOffline)
|
if (me.appOptions.canProtect)
|
||||||
application.getController('Common.Controllers.Protection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
application.getController('Common.Controllers.Protection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
|
||||||
|
|
||||||
if (statusbarController) {
|
if (statusbarController) {
|
||||||
|
|
|
@ -3107,7 +3107,7 @@ define([
|
||||||
me.toolbar.btnPaste.$el.detach().appendTo($box);
|
me.toolbar.btnPaste.$el.detach().appendTo($box);
|
||||||
me.toolbar.btnCopy.$el.removeClass('split');
|
me.toolbar.btnCopy.$el.removeClass('split');
|
||||||
|
|
||||||
if ( config.isProtectSupport && config.isOffline ) {
|
if ( config.canProtect ) {
|
||||||
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
|
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
|
||||||
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
|
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
|
||||||
if ($panel)
|
if ($panel)
|
||||||
|
|
|
@ -229,7 +229,7 @@ define([
|
||||||
applyMode: function() {
|
applyMode: function() {
|
||||||
this.miPrint[this.mode.canPrint?'show':'hide']();
|
this.miPrint[this.mode.canPrint?'show':'hide']();
|
||||||
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
|
this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide']();
|
||||||
this.miProtect[(this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) ?'show':'hide']();
|
this.miProtect[this.mode.canProtect ?'show':'hide']();
|
||||||
this.miProtect.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
|
this.miProtect.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
|
||||||
this.miRecent[this.mode.canOpenRecent?'show':'hide']();
|
this.miRecent[this.mode.canOpenRecent?'show':'hide']();
|
||||||
this.miNew[this.mode.canCreateNew?'show':'hide']();
|
this.miNew[this.mode.canCreateNew?'show':'hide']();
|
||||||
|
@ -271,7 +271,7 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) {
|
if (this.mode.canProtect) {
|
||||||
this.panels['protect'] = (new SSE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
|
this.panels['protect'] = (new SSE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
|
||||||
this.panels['protect'].setMode(this.mode);
|
this.panels['protect'].setMode(this.mode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1399,7 +1399,8 @@ define([
|
||||||
this.btnDeletePwd.render(this.$el.find('#fms-btn-delete-pwd'));
|
this.btnDeletePwd.render(this.$el.find('#fms-btn-delete-pwd'));
|
||||||
this.btnDeletePwd.on('click', _.bind(this.closeMenu, this));
|
this.btnDeletePwd.on('click', _.bind(this.closeMenu, this));
|
||||||
|
|
||||||
this.cntPassword = $('#id-fms-view-pwd');
|
this.cntPassword = $('#id-fms-password');
|
||||||
|
this.cntPasswordView = $('#id-fms-view-pwd');
|
||||||
|
|
||||||
this.btnAddInvisibleSign = protection.getButton('signature');
|
this.btnAddInvisibleSign = protection.getButton('signature');
|
||||||
this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign'));
|
this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign'));
|
||||||
|
@ -1428,7 +1429,8 @@ define([
|
||||||
|
|
||||||
setMode: function(mode) {
|
setMode: function(mode) {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.cntSignature.toggleClass('hidden', !this.mode.canProtect);
|
this.cntSignature.toggleClass('hidden', !this.mode.isSignatureSupport);
|
||||||
|
this.cntPassword.toggleClass('hidden', !this.mode.isPasswordSupport);
|
||||||
},
|
},
|
||||||
|
|
||||||
setApi: function(o) {
|
setApi: function(o) {
|
||||||
|
@ -1489,7 +1491,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
updateEncrypt: function() {
|
updateEncrypt: function() {
|
||||||
this.cntPassword.toggleClass('hidden', this.btnAddPwd.isVisible());
|
this.cntPasswordView.toggleClass('hidden', this.btnAddPwd.isVisible());
|
||||||
},
|
},
|
||||||
|
|
||||||
strProtect: 'Protect Workbook',
|
strProtect: 'Protect Workbook',
|
||||||
|
|
Loading…
Reference in a new issue