mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Uploading and preparing the repository to the dev version.
Original unminified source code (dev folder - js, css, less) (fixes #6) Grunt build system Multiple identities correction (fixes #9) Compose html editor (fixes #12) New general settings - Loading Description New warning about default admin password Split general and login screen settings
This commit is contained in:
parent
afad45137e
commit
4cc2207513
846 changed files with 99453 additions and 2123 deletions
90
dev/Admin/Domains.js
Normal file
90
dev/Admin/Domains.js
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminDomains()
|
||||
{
|
||||
var oData = RL.data();
|
||||
|
||||
this.domains = oData.domains;
|
||||
this.domainsLoading = oData.domainsLoading;
|
||||
|
||||
this.iDomainForDeletionTimeout = 0;
|
||||
|
||||
this.visibility = ko.computed(function () {
|
||||
return oData.domainsLoading() ? 'visible' : 'hidden';
|
||||
}, this);
|
||||
|
||||
this.domainForDeletion = ko.observable(null).extend({'toggleSubscribe': [this,
|
||||
function (oPrev) {
|
||||
if (oPrev)
|
||||
{
|
||||
oPrev.deleteAccess(false);
|
||||
}
|
||||
}, function (oNext) {
|
||||
if (oNext)
|
||||
{
|
||||
oNext.deleteAccess(true);
|
||||
this.startDomainForDeletionTimeout();
|
||||
}
|
||||
}
|
||||
]});
|
||||
}
|
||||
|
||||
Utils.addSettingsViewModel(AdminDomains, 'AdminSettingsDomains', 'Domains', 'domains');
|
||||
|
||||
AdminDomains.prototype.startDomainForDeletionTimeout = function ()
|
||||
{
|
||||
var self = this;
|
||||
window.clearInterval(this.iDomainForDeletionTimeout);
|
||||
this.iDomainForDeletionTimeout = window.setTimeout(function () {
|
||||
self.domainForDeletion(null);
|
||||
}, 1000 * 3);
|
||||
};
|
||||
|
||||
AdminDomains.prototype.createDomain = function ()
|
||||
{
|
||||
kn.showScreenPopup(PopupsDomainViewModel);
|
||||
};
|
||||
|
||||
AdminDomains.prototype.deleteDomain = function (oDomain)
|
||||
{
|
||||
this.domains.remove(oDomain);
|
||||
RL.remote().domainDelete(_.bind(this.onDomainListChangeRequest, this), oDomain.name);
|
||||
};
|
||||
|
||||
AdminDomains.prototype.disableDomain = function (oDomain)
|
||||
{
|
||||
oDomain.disabled(!oDomain.disabled());
|
||||
RL.remote().domainDisable(_.bind(this.onDomainListChangeRequest, this), oDomain.name, oDomain.disabled());
|
||||
};
|
||||
|
||||
AdminDomains.prototype.onBuild = function (oDom)
|
||||
{
|
||||
var self = this;
|
||||
oDom
|
||||
.on('click', '.b-admin-domains-list-table .e-item .e-action', function () {
|
||||
var oDomainItem = ko.dataFor(this);
|
||||
if (oDomainItem)
|
||||
{
|
||||
RL.remote().domain(_.bind(self.onDomainLoadRequest, self), oDomainItem.name);
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
RL.reloadDomainList();
|
||||
};
|
||||
|
||||
AdminDomains.prototype.onDomainLoadRequest = function (sResult, oData)
|
||||
{
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
kn.showScreenPopup(PopupsDomainViewModel, [oData.Result]);
|
||||
}
|
||||
};
|
||||
|
||||
AdminDomains.prototype.onDomainListChangeRequest = function ()
|
||||
{
|
||||
RL.reloadDomainList();
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue