mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 19:49:20 +03:00
Removed: twitter, google, dropbox, facebook, owncloud, modernizr from JavaScript
This commit is contained in:
parent
e8d38a6870
commit
4468d5bd22
60 changed files with 7 additions and 4152 deletions
|
|
@ -1,105 +0,0 @@
|
|||
import _ from '_';
|
||||
import ko from 'ko';
|
||||
|
||||
import { SaveSettingsStep, Magics } from 'Common/Enums';
|
||||
import { settingsSaveHelperSimpleFunction, trim, boolToAjax } from 'Common/Utils';
|
||||
|
||||
import SocialStore from 'Stores/Social';
|
||||
|
||||
import Remote from 'Remote/Admin/Ajax';
|
||||
|
||||
class SocialAdminSettings {
|
||||
constructor() {
|
||||
this.googleEnable = SocialStore.google.enabled;
|
||||
this.googleEnableAuth = SocialStore.google.capa.auth;
|
||||
this.googleEnableAuthGmail = SocialStore.google.capa.authGmail;
|
||||
this.googleEnableDrive = SocialStore.google.capa.drive;
|
||||
this.googleEnablePreview = SocialStore.google.capa.preview;
|
||||
|
||||
this.googleEnableRequireClientSettings = SocialStore.google.require.clientSettings;
|
||||
this.googleEnableRequireApiKey = SocialStore.google.require.apiKeySettings;
|
||||
|
||||
this.googleClientID = SocialStore.google.clientID;
|
||||
this.googleClientSecret = SocialStore.google.clientSecret;
|
||||
this.googleApiKey = SocialStore.google.apiKey;
|
||||
|
||||
this.googleTrigger1 = ko.observable(SaveSettingsStep.Idle);
|
||||
this.googleTrigger2 = ko.observable(SaveSettingsStep.Idle);
|
||||
this.googleTrigger3 = ko.observable(SaveSettingsStep.Idle);
|
||||
|
||||
this.facebookSupported = SocialStore.facebook.supported;
|
||||
this.facebookEnable = SocialStore.facebook.enabled;
|
||||
this.facebookAppID = SocialStore.facebook.appID;
|
||||
this.facebookAppSecret = SocialStore.facebook.appSecret;
|
||||
|
||||
this.facebookTrigger1 = ko.observable(SaveSettingsStep.Idle);
|
||||
this.facebookTrigger2 = ko.observable(SaveSettingsStep.Idle);
|
||||
|
||||
this.twitterEnable = SocialStore.twitter.enabled;
|
||||
this.twitterConsumerKey = SocialStore.twitter.consumerKey;
|
||||
this.twitterConsumerSecret = SocialStore.twitter.consumerSecret;
|
||||
|
||||
this.twitterTrigger1 = ko.observable(SaveSettingsStep.Idle);
|
||||
this.twitterTrigger2 = ko.observable(SaveSettingsStep.Idle);
|
||||
|
||||
this.dropboxEnable = SocialStore.dropbox.enabled;
|
||||
this.dropboxApiKey = SocialStore.dropbox.apiKey;
|
||||
|
||||
this.dropboxTrigger1 = ko.observable(SaveSettingsStep.Idle);
|
||||
}
|
||||
|
||||
onBuild() {
|
||||
_.delay(() => {
|
||||
const f1 = settingsSaveHelperSimpleFunction(this.facebookTrigger1, this),
|
||||
f2 = settingsSaveHelperSimpleFunction(this.facebookTrigger2, this),
|
||||
f3 = settingsSaveHelperSimpleFunction(this.twitterTrigger1, this),
|
||||
f4 = settingsSaveHelperSimpleFunction(this.twitterTrigger2, this),
|
||||
f5 = settingsSaveHelperSimpleFunction(this.googleTrigger1, this),
|
||||
f6 = settingsSaveHelperSimpleFunction(this.googleTrigger2, this),
|
||||
f7 = settingsSaveHelperSimpleFunction(this.googleTrigger3, this),
|
||||
f8 = settingsSaveHelperSimpleFunction(this.dropboxTrigger1, this);
|
||||
|
||||
this.facebookEnable.subscribe((value) => {
|
||||
if (this.facebookSupported()) {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'FacebookEnable': boolToAjax(value)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.facebookAppID.subscribe((value) => {
|
||||
if (this.facebookSupported()) {
|
||||
Remote.saveAdminConfig(f1, {
|
||||
'FacebookAppID': trim(value)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.facebookAppSecret.subscribe((value) => {
|
||||
if (this.facebookSupported()) {
|
||||
Remote.saveAdminConfig(f2, {
|
||||
'FacebookAppSecret': trim(value)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.twitterEnable.subscribe(Remote.saveAdminConfigHelper('TwitterEnable', boolToAjax));
|
||||
this.twitterConsumerKey.subscribe(Remote.saveAdminConfigHelper('TwitterConsumerKey', trim, f3));
|
||||
this.twitterConsumerSecret.subscribe(Remote.saveAdminConfigHelper('TwitterConsumerSecret', trim, f4));
|
||||
|
||||
this.googleEnable.subscribe(Remote.saveAdminConfigHelper('GoogleEnable', boolToAjax));
|
||||
this.googleEnableAuth.subscribe(Remote.saveAdminConfigHelper('GoogleEnableAuth', boolToAjax));
|
||||
this.googleEnableAuthGmail.subscribe(Remote.saveAdminConfigHelper('GoogleEnableAuthGmail', boolToAjax));
|
||||
this.googleEnableDrive.subscribe(Remote.saveAdminConfigHelper('GoogleEnableDrive', boolToAjax));
|
||||
this.googleEnablePreview.subscribe(Remote.saveAdminConfigHelper('GoogleEnablePreview', boolToAjax));
|
||||
this.googleClientID.subscribe(Remote.saveAdminConfigHelper('GoogleClientID', trim, f5));
|
||||
this.googleClientSecret.subscribe(Remote.saveAdminConfigHelper('GoogleClientSecret', trim, f6));
|
||||
this.googleApiKey.subscribe(Remote.saveAdminConfigHelper('GoogleApiKey', trim, f7));
|
||||
|
||||
this.dropboxEnable.subscribe(Remote.saveAdminConfigHelper('DropboxEnable', boolToAjax));
|
||||
this.dropboxApiKey.subscribe(Remote.saveAdminConfigHelper('DropboxApiKey', trim, f8));
|
||||
}, Magics.Time50ms);
|
||||
}
|
||||
}
|
||||
|
||||
export { SocialAdminSettings, SocialAdminSettings as default };
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
import SocialStore from 'Stores/Social';
|
||||
|
||||
import { getApp } from 'Helper/Apps/User';
|
||||
|
||||
import { command } from 'Knoin/Knoin';
|
||||
|
||||
class SocialUserSettings {
|
||||
constructor() {
|
||||
this.googleEnable = SocialStore.google.enabled;
|
||||
this.googleEnableAuth = SocialStore.google.capa.auth;
|
||||
this.googleEnableAuthGmail = SocialStore.google.capa.authGmail;
|
||||
this.googleEnableDrive = SocialStore.google.capa.drive;
|
||||
this.googleEnablePreview = SocialStore.google.capa.preview;
|
||||
|
||||
this.googleActions = SocialStore.google.loading;
|
||||
this.googleLoggined = SocialStore.google.loggined;
|
||||
this.googleUserName = SocialStore.google.userName;
|
||||
|
||||
this.facebookEnable = SocialStore.facebook.enabled;
|
||||
|
||||
this.facebookActions = SocialStore.facebook.loading;
|
||||
this.facebookLoggined = SocialStore.facebook.loggined;
|
||||
this.facebookUserName = SocialStore.facebook.userName;
|
||||
|
||||
this.twitterEnable = SocialStore.twitter.enabled;
|
||||
|
||||
this.twitterActions = SocialStore.twitter.loading;
|
||||
this.twitterLoggined = SocialStore.twitter.loggined;
|
||||
this.twitterUserName = SocialStore.twitter.userName;
|
||||
}
|
||||
|
||||
@command((self) => !self.googleLoggined() && !self.googleActions())
|
||||
connectGoogleCommand() {
|
||||
if (!this.googleLoggined()) {
|
||||
getApp().googleConnect();
|
||||
}
|
||||
}
|
||||
|
||||
@command()
|
||||
disconnectGoogleCommand() {
|
||||
getApp().googleDisconnect();
|
||||
}
|
||||
|
||||
@command((self) => !self.facebookLoggined() && !self.facebookActions())
|
||||
connectFacebookCommand() {
|
||||
if (!this.facebookLoggined()) {
|
||||
getApp().facebookConnect();
|
||||
}
|
||||
}
|
||||
|
||||
@command()
|
||||
disconnectFacebookCommand() {
|
||||
getApp().facebookDisconnect();
|
||||
}
|
||||
|
||||
@command((self) => !self.twitterLoggined() && !self.twitterActions())
|
||||
connectTwitterCommand() {
|
||||
if (!this.twitterLoggined()) {
|
||||
getApp().twitterConnect();
|
||||
}
|
||||
}
|
||||
|
||||
@command()
|
||||
disconnectTwitterCommand() {
|
||||
getApp().twitterDisconnect();
|
||||
}
|
||||
}
|
||||
|
||||
export { SocialUserSettings, SocialUserSettings as default };
|
||||
Loading…
Add table
Add a link
Reference in a new issue