mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Code refactoring
This commit is contained in:
parent
345e7c58af
commit
8cf8b94d39
103 changed files with 664 additions and 659 deletions
|
|
@ -12,14 +12,14 @@
|
|||
Utils = require('Common/Utils'),
|
||||
Links = require('Common/Links'),
|
||||
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote')
|
||||
Data = require('Storage/User/Data'),
|
||||
Remote = require('Storage/User/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AccountsAppSetting()
|
||||
function AccountsUserSetting()
|
||||
{
|
||||
this.accounts = Data.accounts;
|
||||
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
]});
|
||||
}
|
||||
|
||||
AccountsAppSetting.prototype.addNewAccount = function ()
|
||||
AccountsUserSetting.prototype.addNewAccount = function ()
|
||||
{
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/AddAccount'));
|
||||
};
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
/**
|
||||
* @param {AccountModel} oAccountToRemove
|
||||
*/
|
||||
AccountsAppSetting.prototype.deleteAccount = function (oAccountToRemove)
|
||||
AccountsUserSetting.prototype.deleteAccount = function (oAccountToRemove)
|
||||
{
|
||||
if (oAccountToRemove && oAccountToRemove.deleteAccess())
|
||||
{
|
||||
|
|
@ -86,7 +86,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
require('App/App').accountsAndIdentities();
|
||||
require('App/User').accountsAndIdentities();
|
||||
}
|
||||
|
||||
}, oAccountToRemove.email);
|
||||
|
|
@ -94,6 +94,6 @@
|
|||
}
|
||||
};
|
||||
|
||||
module.exports = AccountsAppSetting;
|
||||
module.exports = AccountsUserSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -10,13 +10,13 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Remote = require('Storage/App/Remote')
|
||||
Remote = require('Storage/User/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function ChangePasswordAppSetting()
|
||||
function ChangePasswordUserSetting()
|
||||
{
|
||||
this.changeProcess = ko.observable(false);
|
||||
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
this.onChangePasswordResponse = _.bind(this.onChangePasswordResponse, this);
|
||||
}
|
||||
|
||||
ChangePasswordAppSetting.prototype.onHide = function ()
|
||||
ChangePasswordUserSetting.prototype.onHide = function ()
|
||||
{
|
||||
this.changeProcess(false);
|
||||
this.currentPassword('');
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
this.currentPassword.error(false);
|
||||
};
|
||||
|
||||
ChangePasswordAppSetting.prototype.onChangePasswordResponse = function (sResult, oData)
|
||||
ChangePasswordUserSetting.prototype.onChangePasswordResponse = function (sResult, oData)
|
||||
{
|
||||
this.changeProcess(false);
|
||||
this.passwordMismatch(false);
|
||||
|
|
@ -116,6 +116,6 @@
|
|||
}
|
||||
};
|
||||
|
||||
module.exports = ChangePasswordAppSetting;
|
||||
module.exports = ChangePasswordUserSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -6,14 +6,14 @@
|
|||
var
|
||||
ko = require('ko'),
|
||||
|
||||
Remote = require('Storage/App/Remote'),
|
||||
Data = require('Storage/App/Data')
|
||||
Remote = require('Storage/User/Remote'),
|
||||
Data = require('Storage/User/Data')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function ContactsAppSetting()
|
||||
function ContactsUserSetting()
|
||||
{
|
||||
this.contactsAutosave = Data.contactsAutosave;
|
||||
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
}, this);
|
||||
}
|
||||
|
||||
ContactsAppSetting.prototype.onBuild = function ()
|
||||
ContactsUserSetting.prototype.onBuild = function ()
|
||||
{
|
||||
Data.contactsAutosave.subscribe(function (bValue) {
|
||||
Remote.saveSettings(null, {
|
||||
|
|
@ -51,6 +51,6 @@
|
|||
});
|
||||
};
|
||||
|
||||
module.exports = ContactsAppSetting;
|
||||
module.exports = ContactsUserSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function FiltersAppSetting()
|
||||
function FiltersUserSetting()
|
||||
{
|
||||
this.filters = ko.observableArray([]);
|
||||
this.filters.loading = ko.observable(false);
|
||||
|
|
@ -22,13 +22,13 @@
|
|||
});
|
||||
}
|
||||
|
||||
FiltersAppSetting.prototype.deleteFilter = function (oFilter)
|
||||
FiltersUserSetting.prototype.deleteFilter = function (oFilter)
|
||||
{
|
||||
this.filters.remove(oFilter);
|
||||
Utils.delegateRunOnDestroy(oFilter);
|
||||
};
|
||||
|
||||
FiltersAppSetting.prototype.addFilter = function ()
|
||||
FiltersUserSetting.prototype.addFilter = function ()
|
||||
{
|
||||
var
|
||||
FilterModel = require('Model/Filter')
|
||||
|
|
@ -38,6 +38,6 @@
|
|||
require('View/Popup/Filter'), [new FilterModel()]);
|
||||
};
|
||||
|
||||
module.exports = FiltersAppSetting;
|
||||
module.exports = FiltersUserSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -10,16 +10,16 @@
|
|||
Utils = require('Common/Utils'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/App/Data'),
|
||||
Cache = require('Storage/App/Cache'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
Data = require('Storage/User/Data'),
|
||||
Cache = require('Storage/User/Cache'),
|
||||
Remote = require('Storage/User/Remote'),
|
||||
Local = require('Storage/Local')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function FoldersAppSetting()
|
||||
function FoldersUserSetting()
|
||||
{
|
||||
this.foldersListError = Data.foldersListError;
|
||||
this.folderList = Data.folderList;
|
||||
|
|
@ -89,7 +89,7 @@
|
|||
this.useImapSubscribe = !!Settings.settingsGet('UseImapSubscribe');
|
||||
}
|
||||
|
||||
FoldersAppSetting.prototype.folderEditOnEnter = function (oFolder)
|
||||
FoldersUserSetting.prototype.folderEditOnEnter = function (oFolder)
|
||||
{
|
||||
var
|
||||
sEditName = oFolder ? Utils.trim(oFolder.nameForEdit()) : ''
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_RENAME_FOLDER'));
|
||||
}
|
||||
|
||||
require('App/App').folders();
|
||||
require('App/User').folders();
|
||||
|
||||
}, oFolder.fullNameRaw, sEditName);
|
||||
|
||||
|
|
@ -121,7 +121,7 @@
|
|||
oFolder.edited(false);
|
||||
};
|
||||
|
||||
FoldersAppSetting.prototype.folderEditOnEsc = function (oFolder)
|
||||
FoldersUserSetting.prototype.folderEditOnEsc = function (oFolder)
|
||||
{
|
||||
if (oFolder)
|
||||
{
|
||||
|
|
@ -129,22 +129,22 @@
|
|||
}
|
||||
};
|
||||
|
||||
FoldersAppSetting.prototype.onShow = function ()
|
||||
FoldersUserSetting.prototype.onShow = function ()
|
||||
{
|
||||
Data.foldersListError('');
|
||||
};
|
||||
|
||||
FoldersAppSetting.prototype.createFolder = function ()
|
||||
FoldersUserSetting.prototype.createFolder = function ()
|
||||
{
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/FolderCreate'));
|
||||
};
|
||||
|
||||
FoldersAppSetting.prototype.systemFolder = function ()
|
||||
FoldersUserSetting.prototype.systemFolder = function ()
|
||||
{
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/FolderSystem'));
|
||||
};
|
||||
|
||||
FoldersAppSetting.prototype.deleteFolder = function (oFolderToRemove)
|
||||
FoldersUserSetting.prototype.deleteFolder = function (oFolderToRemove)
|
||||
{
|
||||
if (oFolderToRemove && oFolderToRemove.canBeDeleted() && oFolderToRemove.deleteAccess() &&
|
||||
0 === oFolderToRemove.privateMessageCountAll())
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_DELETE_FOLDER'));
|
||||
}
|
||||
|
||||
require('App/App').folders();
|
||||
require('App/User').folders();
|
||||
|
||||
}, oFolderToRemove.fullNameRaw);
|
||||
|
||||
|
|
@ -193,7 +193,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
FoldersAppSetting.prototype.subscribeFolder = function (oFolder)
|
||||
FoldersUserSetting.prototype.subscribeFolder = function (oFolder)
|
||||
{
|
||||
Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
||||
Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, true);
|
||||
|
|
@ -201,7 +201,7 @@
|
|||
oFolder.subScribed(true);
|
||||
};
|
||||
|
||||
FoldersAppSetting.prototype.unSubscribeFolder = function (oFolder)
|
||||
FoldersUserSetting.prototype.unSubscribeFolder = function (oFolder)
|
||||
{
|
||||
Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
||||
Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, false);
|
||||
|
|
@ -209,6 +209,6 @@
|
|||
oFolder.subScribed(false);
|
||||
};
|
||||
|
||||
module.exports = FoldersAppSetting;
|
||||
module.exports = FoldersUserSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -12,14 +12,14 @@
|
|||
Globals = require('Common/Globals'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote')
|
||||
Data = require('Storage/User/Data'),
|
||||
Remote = require('Storage/User/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function GeneralAppSetting()
|
||||
function GeneralUserSetting()
|
||||
{
|
||||
this.mainLanguage = Data.mainLanguage;
|
||||
this.mainMessagesPerPage = Data.mainMessagesPerPage;
|
||||
|
|
@ -55,12 +55,12 @@
|
|||
this.isAnimationSupported = Globals.bAnimationSupported;
|
||||
}
|
||||
|
||||
GeneralAppSetting.prototype.toggleLayout = function ()
|
||||
GeneralUserSetting.prototype.toggleLayout = function ()
|
||||
{
|
||||
this.layout(Enums.Layout.NoPreview === this.layout() ? Enums.Layout.SidePreview : Enums.Layout.NoPreview);
|
||||
};
|
||||
|
||||
GeneralAppSetting.prototype.onBuild = function ()
|
||||
GeneralUserSetting.prototype.onBuild = function ()
|
||||
{
|
||||
var self = this;
|
||||
|
||||
|
|
@ -158,16 +158,16 @@
|
|||
}, 50);
|
||||
};
|
||||
|
||||
GeneralAppSetting.prototype.onShow = function ()
|
||||
GeneralUserSetting.prototype.onShow = function ()
|
||||
{
|
||||
Data.desktopNotifications.valueHasMutated();
|
||||
};
|
||||
|
||||
GeneralAppSetting.prototype.selectLanguage = function ()
|
||||
GeneralUserSetting.prototype.selectLanguage = function ()
|
||||
{
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Languages'));
|
||||
};
|
||||
|
||||
module.exports = GeneralAppSetting;
|
||||
module.exports = GeneralUserSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -11,14 +11,14 @@
|
|||
Utils = require('Common/Utils'),
|
||||
HtmlEditor = require('Common/HtmlEditor'),
|
||||
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote')
|
||||
Data = require('Storage/User/Data'),
|
||||
Remote = require('Storage/User/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function IdentitiesAppSetting()
|
||||
function IdentitiesUserSetting()
|
||||
{
|
||||
this.editor = null;
|
||||
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
*
|
||||
* @return {string}
|
||||
*/
|
||||
IdentitiesAppSetting.prototype.formattedAccountIdentity = function ()
|
||||
IdentitiesUserSetting.prototype.formattedAccountIdentity = function ()
|
||||
{
|
||||
var
|
||||
sDisplayName = this.displayName.peek(),
|
||||
|
|
@ -110,12 +110,12 @@
|
|||
return '' === sDisplayName ? sEmail : '"' + Utils.quoteName(sDisplayName) + '" <' + sEmail + '>';
|
||||
};
|
||||
|
||||
IdentitiesAppSetting.prototype.addNewIdentity = function ()
|
||||
IdentitiesUserSetting.prototype.addNewIdentity = function ()
|
||||
{
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'));
|
||||
};
|
||||
|
||||
IdentitiesAppSetting.prototype.editIdentity = function (oIdentity)
|
||||
IdentitiesUserSetting.prototype.editIdentity = function (oIdentity)
|
||||
{
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'), [oIdentity]);
|
||||
};
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
/**
|
||||
* @param {IdentityModel} oIdentityToRemove
|
||||
*/
|
||||
IdentitiesAppSetting.prototype.deleteIdentity = function (oIdentityToRemove)
|
||||
IdentitiesUserSetting.prototype.deleteIdentity = function (oIdentityToRemove)
|
||||
{
|
||||
if (oIdentityToRemove && oIdentityToRemove.deleteAccess())
|
||||
{
|
||||
|
|
@ -140,13 +140,13 @@
|
|||
this.identities.remove(fRemoveFolder);
|
||||
|
||||
Remote.identityDelete(function () {
|
||||
require('App/App').accountsAndIdentities();
|
||||
require('App/User').accountsAndIdentities();
|
||||
}, oIdentityToRemove.id);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
IdentitiesAppSetting.prototype.onFocus = function ()
|
||||
IdentitiesUserSetting.prototype.onFocus = function ()
|
||||
{
|
||||
if (!this.editor && this.signatureDom())
|
||||
{
|
||||
|
|
@ -172,7 +172,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
IdentitiesAppSetting.prototype.onBuild = function (oDom)
|
||||
IdentitiesUserSetting.prototype.onBuild = function (oDom)
|
||||
{
|
||||
var self = this;
|
||||
|
||||
|
|
@ -228,6 +228,6 @@
|
|||
}, 50);
|
||||
};
|
||||
|
||||
module.exports = IdentitiesAppSetting;
|
||||
module.exports = IdentitiesUserSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -11,14 +11,14 @@
|
|||
Utils = require('Common/Utils'),
|
||||
HtmlEditor = require('Common/HtmlEditor'),
|
||||
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote')
|
||||
Data = require('Storage/User/Data'),
|
||||
Remote = require('Storage/User/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function IdentityAppSetting()
|
||||
function IdentityUserSetting()
|
||||
{
|
||||
this.editor = null;
|
||||
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
}
|
||||
|
||||
IdentityAppSetting.prototype.onFocus = function ()
|
||||
IdentityUserSetting.prototype.onFocus = function ()
|
||||
{
|
||||
if (!this.editor && this.signatureDom())
|
||||
{
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
IdentityAppSetting.prototype.onBuild = function ()
|
||||
IdentityUserSetting.prototype.onBuild = function ()
|
||||
{
|
||||
var self = this;
|
||||
_.delay(function () {
|
||||
|
|
@ -98,6 +98,6 @@
|
|||
}, 50);
|
||||
};
|
||||
|
||||
module.exports = IdentityAppSetting;
|
||||
module.exports = IdentityUserSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -11,13 +11,13 @@
|
|||
|
||||
kn = require('Knoin/Knoin'),
|
||||
|
||||
Data = require('Storage/App/Data')
|
||||
Data = require('Storage/User/Data')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function OpenPGPAppSetting()
|
||||
function OpenPgpUserSetting()
|
||||
{
|
||||
this.openpgpkeys = Data.openpgpkeys;
|
||||
this.openpgpkeysPublic = Data.openpgpkeysPublic;
|
||||
|
|
@ -38,17 +38,17 @@
|
|||
]});
|
||||
}
|
||||
|
||||
OpenPGPAppSetting.prototype.addOpenPgpKey = function ()
|
||||
OpenPgpUserSetting.prototype.addOpenPgpKey = function ()
|
||||
{
|
||||
kn.showScreenPopup(require('View/Popup/AddOpenPgpKey'));
|
||||
};
|
||||
|
||||
OpenPGPAppSetting.prototype.generateOpenPgpKey = function ()
|
||||
OpenPgpUserSetting.prototype.generateOpenPgpKey = function ()
|
||||
{
|
||||
kn.showScreenPopup(require('View/Popup/NewOpenPgpKey'));
|
||||
};
|
||||
|
||||
OpenPGPAppSetting.prototype.viewOpenPgpKey = function (oOpenPgpKey)
|
||||
OpenPgpUserSetting.prototype.viewOpenPgpKey = function (oOpenPgpKey)
|
||||
{
|
||||
if (oOpenPgpKey)
|
||||
{
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
/**
|
||||
* @param {OpenPgpKeyModel} oOpenPgpKeyToRemove
|
||||
*/
|
||||
OpenPGPAppSetting.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
|
||||
OpenPgpUserSetting.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
|
||||
{
|
||||
if (oOpenPgpKeyToRemove && oOpenPgpKeyToRemove.deleteAccess())
|
||||
{
|
||||
|
|
@ -82,11 +82,11 @@
|
|||
Data.openpgpKeyring.store();
|
||||
}
|
||||
|
||||
require('App/App').reloadOpenPgpKeys();
|
||||
require('App/User').reloadOpenPgpKeys();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = OpenPGPAppSetting;
|
||||
module.exports = OpenPgpUserSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -10,13 +10,13 @@
|
|||
Globals = require('Common/Globals'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Remote = require('Storage/App/Remote')
|
||||
Remote = require('Storage/User/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SecurityAppSetting()
|
||||
function SecurityUserSetting()
|
||||
{
|
||||
this.processing = ko.observable(false);
|
||||
this.clearing = ko.observable(false);
|
||||
|
|
@ -46,37 +46,37 @@
|
|||
this.onSecretResult = _.bind(this.onSecretResult, this);
|
||||
}
|
||||
|
||||
SecurityAppSetting.prototype.showSecret = function ()
|
||||
SecurityUserSetting.prototype.showSecret = function ()
|
||||
{
|
||||
this.secreting(true);
|
||||
Remote.showTwoFactorSecret(this.onSecretResult);
|
||||
};
|
||||
|
||||
SecurityAppSetting.prototype.hideSecret = function ()
|
||||
SecurityUserSetting.prototype.hideSecret = function ()
|
||||
{
|
||||
this.viewSecret('');
|
||||
this.viewBackupCodes('');
|
||||
this.viewUrl('');
|
||||
};
|
||||
|
||||
SecurityAppSetting.prototype.createTwoFactor = function ()
|
||||
SecurityUserSetting.prototype.createTwoFactor = function ()
|
||||
{
|
||||
this.processing(true);
|
||||
Remote.createTwoFactor(this.onResult);
|
||||
};
|
||||
|
||||
SecurityAppSetting.prototype.enableTwoFactor = function ()
|
||||
SecurityUserSetting.prototype.enableTwoFactor = function ()
|
||||
{
|
||||
this.processing(true);
|
||||
Remote.enableTwoFactor(this.onResult, this.viewEnable());
|
||||
};
|
||||
|
||||
SecurityAppSetting.prototype.testTwoFactor = function ()
|
||||
SecurityUserSetting.prototype.testTwoFactor = function ()
|
||||
{
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/TwoFactorTest'));
|
||||
};
|
||||
|
||||
SecurityAppSetting.prototype.clearTwoFactor = function ()
|
||||
SecurityUserSetting.prototype.clearTwoFactor = function ()
|
||||
{
|
||||
this.viewSecret('');
|
||||
this.viewBackupCodes('');
|
||||
|
|
@ -86,14 +86,14 @@
|
|||
Remote.clearTwoFactor(this.onResult);
|
||||
};
|
||||
|
||||
SecurityAppSetting.prototype.onShow = function ()
|
||||
SecurityUserSetting.prototype.onShow = function ()
|
||||
{
|
||||
this.viewSecret('');
|
||||
this.viewBackupCodes('');
|
||||
this.viewUrl('');
|
||||
};
|
||||
|
||||
SecurityAppSetting.prototype.onResult = function (sResult, oData)
|
||||
SecurityUserSetting.prototype.onResult = function (sResult, oData)
|
||||
{
|
||||
this.processing(false);
|
||||
this.clearing(false);
|
||||
|
|
@ -139,7 +139,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
SecurityAppSetting.prototype.onSecretResult = function (sResult, oData)
|
||||
SecurityUserSetting.prototype.onSecretResult = function (sResult, oData)
|
||||
{
|
||||
this.secreting(false);
|
||||
|
||||
|
|
@ -155,12 +155,12 @@
|
|||
}
|
||||
};
|
||||
|
||||
SecurityAppSetting.prototype.onBuild = function ()
|
||||
SecurityUserSetting.prototype.onBuild = function ()
|
||||
{
|
||||
this.processing(true);
|
||||
Remote.getTwoFactor(this.onResult);
|
||||
};
|
||||
|
||||
module.exports = SecurityAppSetting;
|
||||
module.exports = SecurityUserSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -6,11 +6,11 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SocialAppSetting()
|
||||
function SocialUserSetting()
|
||||
{
|
||||
var
|
||||
Utils = require('Common/Utils'),
|
||||
Data = require('Storage/App/Data')
|
||||
Data = require('Storage/User/Data')
|
||||
;
|
||||
|
||||
this.googleEnable = Data.googleEnable;
|
||||
|
|
@ -34,43 +34,43 @@
|
|||
this.connectGoogle = Utils.createCommand(this, function () {
|
||||
if (!this.googleLoggined())
|
||||
{
|
||||
require('App/App').googleConnect();
|
||||
require('App/User').googleConnect();
|
||||
}
|
||||
}, function () {
|
||||
return !this.googleLoggined() && !this.googleActions();
|
||||
});
|
||||
|
||||
this.disconnectGoogle = Utils.createCommand(this, function () {
|
||||
require('App/App').googleDisconnect();
|
||||
require('App/User').googleDisconnect();
|
||||
});
|
||||
|
||||
this.connectFacebook = Utils.createCommand(this, function () {
|
||||
if (!this.facebookLoggined())
|
||||
{
|
||||
require('App/App').facebookConnect();
|
||||
require('App/User').facebookConnect();
|
||||
}
|
||||
}, function () {
|
||||
return !this.facebookLoggined() && !this.facebookActions();
|
||||
});
|
||||
|
||||
this.disconnectFacebook = Utils.createCommand(this, function () {
|
||||
require('App/App').facebookDisconnect();
|
||||
require('App/User').facebookDisconnect();
|
||||
});
|
||||
|
||||
this.connectTwitter = Utils.createCommand(this, function () {
|
||||
if (!this.twitterLoggined())
|
||||
{
|
||||
require('App/App').twitterConnect();
|
||||
require('App/User').twitterConnect();
|
||||
}
|
||||
}, function () {
|
||||
return !this.twitterLoggined() && !this.twitterActions();
|
||||
});
|
||||
|
||||
this.disconnectTwitter = Utils.createCommand(this, function () {
|
||||
require('App/App').twitterDisconnect();
|
||||
require('App/User').twitterDisconnect();
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = SocialAppSetting;
|
||||
module.exports = SocialUserSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -13,14 +13,14 @@
|
|||
Utils = require('Common/Utils'),
|
||||
Links = require('Common/Links'),
|
||||
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote')
|
||||
Data = require('Storage/User/Data'),
|
||||
Remote = require('Storage/User/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function ThemesAppSetting()
|
||||
function ThemesUserSetting()
|
||||
{
|
||||
var self = this;
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
}, this);
|
||||
}
|
||||
|
||||
ThemesAppSetting.prototype.onBuild = function ()
|
||||
ThemesUserSetting.prototype.onBuild = function ()
|
||||
{
|
||||
var sCurrentTheme = Data.theme();
|
||||
this.themesObjects(_.map(Data.themes(), function (sTheme) {
|
||||
|
|
@ -127,6 +127,6 @@
|
|||
}));
|
||||
};
|
||||
|
||||
module.exports = ThemesAppSetting;
|
||||
module.exports = ThemesUserSetting;
|
||||
|
||||
}());
|
||||
Loading…
Add table
Add a link
Reference in a new issue