[DE] Change applying license.

This commit is contained in:
Julia Radzhabova 2017-11-22 16:32:43 +03:00
parent a90f108209
commit 82be952126

View file

@ -912,6 +912,8 @@ define([
if (me.appOptions.canBrandingExt)
Common.NotificationCenter.trigger('document:ready', 'main');
me.applyLicense();
}
}, 50);
} else {
@ -933,12 +935,24 @@ define([
Common.Gateway.sendInfo({mode:me.appOptions.isEdit?'edit':'view'});
$(document).on('contextmenu', _.bind(me.onContextMenu, me));
},
onLicenseChanged: function(params) {
var licType = params.asc_getLicenseType();
if (licType !== undefined && (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.Users) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') {
this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers;
}
if (this._isDocReady)
this.applyLicense();
},
applyLicense: function() {
if (this._state.licenseWarning) {
this.disableEditing(true);
Common.NotificationCenter.trigger('api:disconnect');
value = Common.localStorage.getItem("de-license-warning");
var value = Common.localStorage.getItem("de-license-warning");
value = (value!==null) ? parseInt(value) : 0;
var now = (new Date).getTime();
if (now - value > 86400000) {
@ -963,13 +977,6 @@ define([
}
},
onLicenseChanged: function(params) {
var licType = params.asc_getLicenseType();
if ((licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.Users) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') {
this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers;
}
},
onOpenDocument: function(progress) {
var elem = document.getElementById('loadmask-text');
var proc = (progress.asc_getCurrentFont() + progress.asc_getCurrentImage())/(progress.asc_getFontsCount() + progress.asc_getImagesCount());