mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
Code refactoring
Fixed owncloud password encoder/decoder (#291) Fixed ckeditor in ownCloud iframe (Closes #302) Release commit
This commit is contained in:
parent
7a374ebe03
commit
06274c6a7c
112 changed files with 2667 additions and 1862 deletions
70
dev/Settings/Admin/Licensing.js
Normal file
70
dev/Settings/Admin/Licensing.js
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko'),
|
||||
moment = require('moment'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function LicensingAdminSetting()
|
||||
{
|
||||
this.licensing = Data.licensing;
|
||||
this.licensingProcess = Data.licensingProcess;
|
||||
this.licenseValid = Data.licenseValid;
|
||||
this.licenseExpired = Data.licenseExpired;
|
||||
this.licenseError = Data.licenseError;
|
||||
this.licenseTrigger = Data.licenseTrigger;
|
||||
|
||||
this.adminDomain = ko.observable('');
|
||||
this.subscriptionEnabled = ko.observable(!!Settings.settingsGet('SubscriptionEnabled'));
|
||||
|
||||
this.licenseTrigger.subscribe(function () {
|
||||
if (this.subscriptionEnabled())
|
||||
{
|
||||
require('App/Admin').reloadLicensing(true);
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
|
||||
LicensingAdminSetting.prototype.onBuild = function ()
|
||||
{
|
||||
if (this.subscriptionEnabled())
|
||||
{
|
||||
require('App/Admin').reloadLicensing(false);
|
||||
}
|
||||
};
|
||||
|
||||
LicensingAdminSetting.prototype.onShow = function ()
|
||||
{
|
||||
this.adminDomain(Settings.settingsGet('AdminDomain'));
|
||||
};
|
||||
|
||||
LicensingAdminSetting.prototype.showActivationForm = function ()
|
||||
{
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Activate'));
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
LicensingAdminSetting.prototype.licenseExpiredMomentValue = function ()
|
||||
{
|
||||
var
|
||||
iTime = this.licenseExpired(),
|
||||
oDate = moment.unix(iTime)
|
||||
;
|
||||
|
||||
return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')');
|
||||
};
|
||||
|
||||
module.exports = LicensingAdminSetting;
|
||||
|
||||
}());
|
||||
Loading…
Add table
Add a link
Reference in a new issue