mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 21:49:21 +03:00
Code refactoring
This commit is contained in:
parent
345e7c58af
commit
8cf8b94d39
103 changed files with 664 additions and 659 deletions
76
dev/Settings/User/Social.js
Normal file
76
dev/Settings/User/Social.js
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SocialUserSetting()
|
||||
{
|
||||
var
|
||||
Utils = require('Common/Utils'),
|
||||
Data = require('Storage/User/Data')
|
||||
;
|
||||
|
||||
this.googleEnable = Data.googleEnable;
|
||||
|
||||
this.googleActions = Data.googleActions;
|
||||
this.googleLoggined = Data.googleLoggined;
|
||||
this.googleUserName = Data.googleUserName;
|
||||
|
||||
this.facebookEnable = Data.facebookEnable;
|
||||
|
||||
this.facebookActions = Data.facebookActions;
|
||||
this.facebookLoggined = Data.facebookLoggined;
|
||||
this.facebookUserName = Data.facebookUserName;
|
||||
|
||||
this.twitterEnable = Data.twitterEnable;
|
||||
|
||||
this.twitterActions = Data.twitterActions;
|
||||
this.twitterLoggined = Data.twitterLoggined;
|
||||
this.twitterUserName = Data.twitterUserName;
|
||||
|
||||
this.connectGoogle = Utils.createCommand(this, function () {
|
||||
if (!this.googleLoggined())
|
||||
{
|
||||
require('App/User').googleConnect();
|
||||
}
|
||||
}, function () {
|
||||
return !this.googleLoggined() && !this.googleActions();
|
||||
});
|
||||
|
||||
this.disconnectGoogle = Utils.createCommand(this, function () {
|
||||
require('App/User').googleDisconnect();
|
||||
});
|
||||
|
||||
this.connectFacebook = Utils.createCommand(this, function () {
|
||||
if (!this.facebookLoggined())
|
||||
{
|
||||
require('App/User').facebookConnect();
|
||||
}
|
||||
}, function () {
|
||||
return !this.facebookLoggined() && !this.facebookActions();
|
||||
});
|
||||
|
||||
this.disconnectFacebook = Utils.createCommand(this, function () {
|
||||
require('App/User').facebookDisconnect();
|
||||
});
|
||||
|
||||
this.connectTwitter = Utils.createCommand(this, function () {
|
||||
if (!this.twitterLoggined())
|
||||
{
|
||||
require('App/User').twitterConnect();
|
||||
}
|
||||
}, function () {
|
||||
return !this.twitterLoggined() && !this.twitterActions();
|
||||
});
|
||||
|
||||
this.disconnectTwitter = Utils.createCommand(this, function () {
|
||||
require('App/User').twitterDisconnect();
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = SocialUserSetting;
|
||||
|
||||
}());
|
||||
Loading…
Add table
Add a link
Reference in a new issue