Commit fa40c6ca authored by Alexander.Trofimov's avatar Alexander.Trofimov

add light support

parent 70c46c57
......@@ -113,12 +113,15 @@ AscCommon.baseEditorsApi.prototype._onCheckLicenseEnd = function(err, res) {
this.licenseResult = {err: err, res: res};
this._onEndPermissions();
};
AscCommon.baseEditorsApi.prototype._onEndPermissions = function() {
AscCommon.baseEditorsApi.prototype._onEndPermissions = function () {
if (this.isOnFirstConnectEnd && this.isOnLoadLicense) {
var oResult = new AscCommon.asc_CAscEditorPermissions();
if (null !== this.licenseResult) {
oResult.asc_setCanLicense(g_oLicenseResult.Success === this.licenseResult);
oResult.asc_setCanBranding(g_oLicenseResult.Error !== this.licenseResult); // Для тех, у кого есть лицензия, branding доступен
var type = this.licenseResult['type'];
oResult.asc_setCanLicense(g_oLicenseResult.Success === type);
oResult.asc_setCanBranding(g_oLicenseResult.Error !== type); // Для тех, у кого есть лицензия, branding доступен
oResult.asc_setCanBranding(g_oLicenseResult.Error !== type); // Для тех, у кого есть лицензия, branding доступен
oResult.asc_setIsLight(this.licenseResult['light']);
}
this.sendEvent('asc_onGetEditorPermissions', oResult);
}
......
......@@ -113,7 +113,9 @@
* @constructor
* @memberOf Asc
*/
function asc_CAscEditorPermissions (settings) {
function asc_CAscEditorPermissions(settings) {
this.canLicense = false;
this.isLight = false;
this.canCoAuthoring = true;
this.canReaderMode = true;
this.canBranding = false;
......@@ -122,20 +124,18 @@
this.isAnalyticsEnable = false;
return this;
}
asc_CAscEditorPermissions.prototype = {
constructor: asc_CAscEditorPermissions,
asc_getCanLicense: function(){ return this.canLicense; },
asc_CAscEditorPermissions.prototype.asc_getCanLicense = function(){ return this.canLicense; };
asc_CAscEditorPermissions.prototype.asc_getCanCoAuthoring = function(){ return this.canCoAuthoring; };
asc_CAscEditorPermissions.prototype.asc_getCanReaderMode = function(){ return this.canReaderMode; };
asc_CAscEditorPermissions.prototype.asc_getCanBranding = function(){ return this.canBranding; };
asc_CAscEditorPermissions.prototype.asc_getIsAutosaveEnable = function(){ return this.isAutosaveEnable; };
asc_CAscEditorPermissions.prototype.asc_getAutosaveMinInterval = function(){ return this.AutosaveMinInterval; };
asc_CAscEditorPermissions.prototype.asc_getIsAnalyticsEnable = function(){ return this.isAnalyticsEnable; };
asc_CAscEditorPermissions.prototype.asc_getIsLight = function(){ return this.isLight; };
asc_getCanCoAuthoring: function(){ return this.canCoAuthoring; },
asc_getCanReaderMode: function(){ return this.canReaderMode; },
asc_getCanBranding: function(){ return this.canBranding; },
asc_getIsAutosaveEnable: function(){ return this.isAutosaveEnable; },
asc_getAutosaveMinInterval: function(){ return this.AutosaveMinInterval; },
asc_getIsAnalyticsEnable: function(){ return this.isAnalyticsEnable; },
asc_setCanLicense: function(v){ this.canLicense = v; },
asc_setCanBranding: function(v){ this.canBranding = v; }
};
asc_CAscEditorPermissions.prototype.asc_setCanLicense = function(v){ this.canLicense = v; };
asc_CAscEditorPermissions.prototype.asc_setCanBranding = function(v){ this.canBranding = v; };
asc_CAscEditorPermissions.prototype.asc_setIsLight = function(v){ this.isLight = v; };
/** @constructor */
function asc_ValAxisSettings()
......@@ -2306,6 +2306,7 @@
prot["asc_getIsAutosaveEnable"] = prot.asc_getIsAutosaveEnable;
prot["asc_getAutosaveMinInterval"] = prot.asc_getAutosaveMinInterval;
prot["asc_getIsAnalyticsEnable"] = prot.asc_getIsAnalyticsEnable;
prot["asc_getIsLight"] = prot.asc_getIsLight;
window["AscCommon"].asc_ValAxisSettings = asc_ValAxisSettings;
prot = asc_ValAxisSettings.prototype;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment