Disable protection feature.
This commit is contained in:
parent
3e6aa9b8f7
commit
3d6ebf252c
|
@ -87,7 +87,7 @@ define([
|
||||||
if (api) {
|
if (api) {
|
||||||
this.api = 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));
|
this.api.asc_registerCallback('asc_onDocumentPassword', _.bind(this.onDocumentPassword, this));
|
||||||
if (this.appConfig.canProtect) {
|
if (this.appConfig.canProtect) {
|
||||||
Common.NotificationCenter.on('protect:sign', _.bind(this.onSignatureRequest, this));
|
Common.NotificationCenter.on('protect:sign', _.bind(this.onSignatureRequest, 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.isProtectSupport && me.appConfig.isDesktopApp && me.appConfig.isOffline ) {
|
||||||
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']);
|
||||||
|
@ -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.isProtectSupport && this.appConfig.isDesktopApp && this.appConfig.isOffline ) {
|
||||||
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',
|
||||||
|
@ -159,7 +159,7 @@ define([
|
||||||
(new Promise(function (accept, reject) {
|
(new Promise(function (accept, reject) {
|
||||||
accept();
|
accept();
|
||||||
})).then(function(){
|
})).then(function(){
|
||||||
if ( config.isDesktopApp && config.isOffline) {
|
if ( config.isProtectSupport && config.isDesktopApp && config.isOffline) {
|
||||||
me.btnAddPwd.updateHint(me.hintAddPwd);
|
me.btnAddPwd.updateHint(me.hintAddPwd);
|
||||||
me.btnPwd.updateHint(me.hintPwd);
|
me.btnPwd.updateHint(me.hintPwd);
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ define([
|
||||||
getPanel: function () {
|
getPanel: function () {
|
||||||
this.$el = $(_.template(template)( {} ));
|
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.btnAddPwd.render(this.$el.find('#slot-btn-add-password'));
|
||||||
this.btnPwd.render(this.$el.find('#slot-btn-change-password'));
|
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'));
|
||||||
|
|
|
@ -1088,7 +1088,8 @@ 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.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 ) {
|
if ( this.appOptions.isLightVersion ) {
|
||||||
this.appOptions.canUseHistory =
|
this.appOptions.canUseHistory =
|
||||||
|
@ -1179,7 +1180,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.isProtectSupport && this.appOptions.isDesktopApp && this.appOptions.isOffline)
|
||||||
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');
|
||||||
|
|
|
@ -2717,7 +2717,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.isOffline ) {
|
if ( config.isProtectSupport && config.isOffline ) {
|
||||||
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();
|
||||||
|
|
||||||
|
|
|
@ -243,7 +243,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.isProtectSupport && this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) ?'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,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.$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);
|
||||||
|
|
|
@ -852,7 +852,8 @@ 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.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');
|
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
|
||||||
if (this.appOptions.canBranding)
|
if (this.appOptions.canBranding)
|
||||||
|
@ -928,7 +929,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.isProtectSupport && me.appOptions.isDesktopApp && me.appOptions.isOffline)
|
||||||
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');
|
||||||
|
|
|
@ -2009,7 +2009,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.isOffline ) {
|
if ( config.isProtectSupport && config.isOffline ) {
|
||||||
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)
|
||||||
|
|
|
@ -238,7 +238,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.isProtectSupport && this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) ?'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']();
|
||||||
|
@ -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();
|
this.$el.find('#fm-btn-create, #fm-btn-back, #fm-btn-create+.devider').hide();
|
||||||
if (this.mode.isEdit) {
|
if (this.mode.isEdit) {
|
||||||
this.panels['protect'] = (new PE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
|
this.panels['protect'] = (new PE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
|
||||||
|
|
|
@ -896,7 +896,8 @@ 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.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.applyModeCommonElements();
|
||||||
this.applyModeEditorElements();
|
this.applyModeEditorElements();
|
||||||
|
@ -992,7 +993,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.isProtectSupport && me.appOptions.isDesktopApp && me.appOptions.isOffline)
|
||||||
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) {
|
||||||
|
|
|
@ -2976,7 +2976,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.isOffline ) {
|
if ( config.isProtectSupport && config.isOffline ) {
|
||||||
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
|
tab = {action: 'protect', caption: me.toolbar.textTabProtect};
|
||||||
var $panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
|
var $panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
|
||||||
if ($panel)
|
if ($panel)
|
||||||
|
|
|
@ -227,7 +227,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.isProtectSupport && this.mode.isEdit && this.mode.isDesktopApp && this.mode.isOffline) ?'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']();
|
||||||
|
@ -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'] = (new SSE.Views.FileMenuPanels.ProtectDoc({menu:this})).render();
|
||||||
this.panels['protect'].setMode(this.mode);
|
this.panels['protect'].setMode(this.mode);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue