Disable protection feature.

This commit is contained in:
Julia Radzhabova 2018-04-28 13:25:41 +03:00
parent 3e6aa9b8f7
commit 3d6ebf252c
11 changed files with 23 additions and 20 deletions

View file

@ -87,7 +87,7 @@ define([
if (api) {
this.api = api;
if (this.appConfig.isDesktopApp && this.appConfig.isOffline) {
if (this.appConfig.isProtectSupport && this.appConfig.isDesktopApp && this.appConfig.isOffline) {
this.api.asc_registerCallback('asc_onDocumentPassword', _.bind(this.onDocumentPassword, this));
if (this.appConfig.canProtect) {
Common.NotificationCenter.on('protect:sign', _.bind(this.onSignatureRequest, this));

View file

@ -65,7 +65,7 @@ define([
function setEvents() {
var me = this;
if ( me.appConfig.isDesktopApp && me.appConfig.isOffline ) {
if ( me.appConfig.isProtectSupport && me.appConfig.isDesktopApp && me.appConfig.isOffline ) {
this.btnsAddPwd.concat(this.btnsChangePwd).forEach(function(button) {
button.on('click', function (b, e) {
me.fireEvent('protect:password', [b, 'add']);
@ -116,7 +116,7 @@ define([
var filter = Common.localStorage.getKeysFilter();
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
if ( this.appConfig.isDesktopApp && this.appConfig.isOffline ) {
if ( this.appConfig.isProtectSupport && this.appConfig.isDesktopApp && this.appConfig.isOffline ) {
this.btnAddPwd = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-ic-protect',
@ -159,7 +159,7 @@ define([
(new Promise(function (accept, reject) {
accept();
})).then(function(){
if ( config.isDesktopApp && config.isOffline) {
if ( config.isProtectSupport && config.isDesktopApp && config.isOffline) {
me.btnAddPwd.updateHint(me.hintAddPwd);
me.btnPwd.updateHint(me.hintPwd);
@ -206,7 +206,7 @@ define([
getPanel: function () {
this.$el = $(_.template(template)( {} ));
if ( this.appConfig.isDesktopApp && this.appConfig.isOffline ) {
if ( this.appConfig.isProtectSupport && this.appConfig.isDesktopApp && this.appConfig.isOffline ) {
this.btnAddPwd.render(this.$el.find('#slot-btn-add-password'));
this.btnPwd.render(this.$el.find('#slot-btn-change-password'));
this.btnSignature && this.btnSignature.render(this.$el.find('#slot-btn-signature'));

View file

@ -1088,7 +1088,8 @@ define([
this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
this.appOptions.isProtectSupport = false; // remove in 5.2
this.appOptions.canProtect = this.appOptions.isProtectSupport && this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
if ( this.appOptions.isLightVersion ) {
this.appOptions.canUseHistory =
@ -1179,7 +1180,7 @@ define([
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
if (this.appOptions.isDesktopApp && this.appOptions.isOffline)
if (this.appOptions.isProtectSupport && this.appOptions.isDesktopApp && this.appOptions.isOffline)
application.getController('Common.Controllers.Protection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
var viewport = this.getApplication().getController('Viewport').getView('Viewport');

View file

@ -2717,7 +2717,7 @@ define([
me.toolbar.btnPaste.$el.detach().appendTo($box);
me.toolbar.btnCopy.$el.removeClass('split');
if ( config.isOffline ) {
if ( config.isProtectSupport && config.isOffline ) {
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();

View file

@ -243,7 +243,7 @@ define([
applyMode: function() {
this.miPrint[this.mode.canPrint?'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.isProtectSupport && this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) ?'show':'hide']();
this.miProtect.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
this.miRecent[this.mode.canOpenRecent?'show':'hide']();
this.miNew[this.mode.canCreateNew?'show':'hide']();
@ -280,7 +280,7 @@ define([
}
}
if (this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) {
if (this.mode.isProtectSupport && this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) {
// this.$el.find('#fm-btn-back').hide();
this.panels['protect'] = (new DE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
this.panels['protect'].setMode(this.mode);

View file

@ -852,7 +852,8 @@ define([
this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
this.appOptions.isProtectSupport = false; // remove in 5.2
this.appOptions.canProtect = this.appOptions.isProtectSupport && this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
if (this.appOptions.canBranding)
@ -928,7 +929,7 @@ define([
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
if (me.appOptions.isDesktopApp && me.appOptions.isOffline)
if (me.appOptions.isProtectSupport && me.appOptions.isDesktopApp && me.appOptions.isOffline)
application.getController('Common.Controllers.Protection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
var viewport = this.getApplication().getController('Viewport').getView('Viewport');

View file

@ -2009,7 +2009,7 @@ define([
me.toolbar.btnPaste.$el.detach().appendTo($box);
me.toolbar.btnCopy.$el.removeClass('split');
if ( config.isOffline ) {
if ( config.isProtectSupport && config.isOffline ) {
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
if ($panel)

View file

@ -238,7 +238,7 @@ define([
applyMode: function() {
this.miPrint[this.mode.canPrint?'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.isProtectSupport && this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) ?'show':'hide']();
this.miProtect.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
this.miRecent[this.mode.canOpenRecent?'show':'hide']();
this.miNew[this.mode.canCreateNew?'show':'hide']();
@ -275,7 +275,7 @@ define([
}
}
if (this.mode.isDesktopApp && this.mode.isOffline) {
if (this.mode.isProtectSupport && this.mode.isDesktopApp && this.mode.isOffline) {
this.$el.find('#fm-btn-create, #fm-btn-back, #fm-btn-create+.devider').hide();
if (this.mode.isEdit) {
this.panels['protect'] = (new PE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();

View file

@ -896,7 +896,8 @@ define([
(typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport() && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
this.appOptions.isProtectSupport = false; // remove in 5.2
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.applyModeCommonElements();
this.applyModeEditorElements();
@ -992,7 +993,7 @@ define([
reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
if (me.appOptions.isDesktopApp && me.appOptions.isOffline)
if (me.appOptions.isProtectSupport && me.appOptions.isDesktopApp && me.appOptions.isOffline)
application.getController('Common.Controllers.Protection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
if (statusbarController) {

View file

@ -2976,7 +2976,7 @@ define([
me.toolbar.btnPaste.$el.detach().appendTo($box);
me.toolbar.btnCopy.$el.removeClass('split');
if ( config.isOffline ) {
if ( config.isProtectSupport && config.isOffline ) {
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
var $panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
if ($panel)

View file

@ -227,7 +227,7 @@ define([
applyMode: function() {
this.miPrint[this.mode.canPrint?'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.isProtectSupport && this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) ?'show':'hide']();
this.miProtect.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide']();
this.miRecent[this.mode.canOpenRecent?'show':'hide']();
this.miNew[this.mode.canCreateNew?'show':'hide']();
@ -266,7 +266,7 @@ define([
}
}
if (this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) {
if (this.mode.isProtectSupport && this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) {
this.panels['protect'] = (new SSE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
this.panels['protect'].setMode(this.mode);
}