mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 14:37:02 +03:00
es5 -> es2015 (last stage)
Signature plugin fixes Add view decorator A large number of fixes
This commit is contained in:
parent
e88c193334
commit
17669b7be0
153 changed files with 21193 additions and 21115 deletions
|
|
@ -1,103 +1,103 @@
|
|||
|
||||
var ko = require('ko');
|
||||
import window from 'window';
|
||||
import ko from 'ko';
|
||||
import $ from '$';
|
||||
import * as Settings from 'Storage/Settings';
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SocialStore()
|
||||
class SocialStore
|
||||
{
|
||||
this.google = {};
|
||||
this.twitter = {};
|
||||
this.facebook = {};
|
||||
this.dropbox = {};
|
||||
constructor() {
|
||||
this.google = {};
|
||||
this.twitter = {};
|
||||
this.facebook = {};
|
||||
this.dropbox = {};
|
||||
|
||||
// Google
|
||||
this.google.enabled = ko.observable(false);
|
||||
// Google
|
||||
this.google.enabled = ko.observable(false);
|
||||
|
||||
this.google.clientID = ko.observable('');
|
||||
this.google.clientSecret = ko.observable('');
|
||||
this.google.apiKey = ko.observable('');
|
||||
this.google.clientID = ko.observable('');
|
||||
this.google.clientSecret = ko.observable('');
|
||||
this.google.apiKey = ko.observable('');
|
||||
|
||||
this.google.loading = ko.observable(false);
|
||||
this.google.userName = ko.observable('');
|
||||
this.google.loading = ko.observable(false);
|
||||
this.google.userName = ko.observable('');
|
||||
|
||||
this.google.loggined = ko.computed(function() {
|
||||
return '' !== this.google.userName();
|
||||
}, this);
|
||||
this.google.loggined = ko.computed(() => '' !== this.google.userName());
|
||||
|
||||
this.google.capa = {};
|
||||
this.google.capa.auth = ko.observable(false);
|
||||
this.google.capa.authFast = ko.observable(false);
|
||||
this.google.capa.drive = ko.observable(false);
|
||||
this.google.capa.preview = ko.observable(false);
|
||||
this.google.capa = {};
|
||||
this.google.capa.auth = ko.observable(false);
|
||||
this.google.capa.authFast = ko.observable(false);
|
||||
this.google.capa.drive = ko.observable(false);
|
||||
this.google.capa.preview = ko.observable(false);
|
||||
|
||||
this.google.require = {};
|
||||
this.google.require.clientSettings = ko.computed(function() {
|
||||
return this.google.enabled() && (this.google.capa.auth() || this.google.capa.drive());
|
||||
}, this);
|
||||
this.google.require = {};
|
||||
this.google.require.clientSettings = ko.computed(
|
||||
() => this.google.enabled() && (this.google.capa.auth() || this.google.capa.drive()));
|
||||
|
||||
this.google.require.apiKeySettings = ko.computed(function() {
|
||||
return this.google.enabled() && this.google.capa.drive();
|
||||
}, this);
|
||||
this.google.require.apiKeySettings = ko.computed(() => this.google.enabled() && this.google.capa.drive());
|
||||
|
||||
// Facebook
|
||||
this.facebook.enabled = ko.observable(false);
|
||||
this.facebook.appID = ko.observable('');
|
||||
this.facebook.appSecret = ko.observable('');
|
||||
this.facebook.loading = ko.observable(false);
|
||||
this.facebook.userName = ko.observable('');
|
||||
this.facebook.supported = ko.observable(false);
|
||||
// Facebook
|
||||
this.facebook.enabled = ko.observable(false);
|
||||
this.facebook.appID = ko.observable('');
|
||||
this.facebook.appSecret = ko.observable('');
|
||||
this.facebook.loading = ko.observable(false);
|
||||
this.facebook.userName = ko.observable('');
|
||||
this.facebook.supported = ko.observable(false);
|
||||
|
||||
this.facebook.loggined = ko.computed(function() {
|
||||
return '' !== this.facebook.userName();
|
||||
}, this);
|
||||
this.facebook.loggined = ko.computed(() => '' !== this.facebook.userName());
|
||||
|
||||
// Twitter
|
||||
this.twitter.enabled = ko.observable(false);
|
||||
this.twitter.consumerKey = ko.observable('');
|
||||
this.twitter.consumerSecret = ko.observable('');
|
||||
this.twitter.loading = ko.observable(false);
|
||||
this.twitter.userName = ko.observable('');
|
||||
// Twitter
|
||||
this.twitter.enabled = ko.observable(false);
|
||||
this.twitter.consumerKey = ko.observable('');
|
||||
this.twitter.consumerSecret = ko.observable('');
|
||||
this.twitter.loading = ko.observable(false);
|
||||
this.twitter.userName = ko.observable('');
|
||||
|
||||
this.twitter.loggined = ko.computed(function() {
|
||||
return '' !== this.twitter.userName();
|
||||
}, this);
|
||||
this.twitter.loggined = ko.computed(() => '' !== this.twitter.userName());
|
||||
|
||||
// Dropbox
|
||||
this.dropbox.enabled = ko.observable(false);
|
||||
this.dropbox.apiKey = ko.observable('');
|
||||
// Dropbox
|
||||
this.dropbox.enabled = ko.observable(false);
|
||||
this.dropbox.apiKey = ko.observable('');
|
||||
}
|
||||
|
||||
populate() {
|
||||
this.google.enabled(!!Settings.settingsGet('AllowGoogleSocial'));
|
||||
this.google.clientID(Settings.settingsGet('GoogleClientID'));
|
||||
this.google.clientSecret(Settings.settingsGet('GoogleClientSecret'));
|
||||
this.google.apiKey(Settings.settingsGet('GoogleApiKey'));
|
||||
|
||||
this.google.capa.auth(!!Settings.settingsGet('AllowGoogleSocialAuth'));
|
||||
this.google.capa.authFast(!!Settings.settingsGet('AllowGoogleSocialAuthFast'));
|
||||
this.google.capa.drive(!!Settings.settingsGet('AllowGoogleSocialDrive'));
|
||||
this.google.capa.preview(!!Settings.settingsGet('AllowGoogleSocialPreview'));
|
||||
|
||||
this.facebook.enabled(!!Settings.settingsGet('AllowFacebookSocial'));
|
||||
this.facebook.appID(Settings.settingsGet('FacebookAppID'));
|
||||
this.facebook.appSecret(Settings.settingsGet('FacebookAppSecret'));
|
||||
this.facebook.supported(!!Settings.settingsGet('SupportedFacebookSocial'));
|
||||
|
||||
this.twitter.enabled = ko.observable(!!Settings.settingsGet('AllowTwitterSocial'));
|
||||
this.twitter.consumerKey = ko.observable(Settings.settingsGet('TwitterConsumerKey'));
|
||||
this.twitter.consumerSecret = ko.observable(Settings.settingsGet('TwitterConsumerSecret'));
|
||||
|
||||
this.dropbox.enabled(!!Settings.settingsGet('AllowDropboxSocial'));
|
||||
this.dropbox.apiKey(Settings.settingsGet('DropboxApiKey'));
|
||||
}
|
||||
|
||||
appendDropbox() {
|
||||
if (!window.Dropbox && this.dropbox.enabled() && this.dropbox.apiKey())
|
||||
{
|
||||
if (!window.document.getElementById('dropboxjs'))
|
||||
{
|
||||
const script = window.document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.src = 'https://www.dropbox.com/static/api/2/dropins.js';
|
||||
$(script).attr('id', 'dropboxjs').attr('data-app-key', this.dropbox.apiKey());
|
||||
|
||||
window.document.body.appendChild(script);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SocialStore.prototype.google = {};
|
||||
SocialStore.prototype.twitter = {};
|
||||
SocialStore.prototype.facebook = {};
|
||||
SocialStore.prototype.dropbox = {};
|
||||
|
||||
SocialStore.prototype.populate = function()
|
||||
{
|
||||
var Settings = require('Storage/Settings');
|
||||
|
||||
this.google.enabled(!!Settings.settingsGet('AllowGoogleSocial'));
|
||||
this.google.clientID(Settings.settingsGet('GoogleClientID'));
|
||||
this.google.clientSecret(Settings.settingsGet('GoogleClientSecret'));
|
||||
this.google.apiKey(Settings.settingsGet('GoogleApiKey'));
|
||||
|
||||
this.google.capa.auth(!!Settings.settingsGet('AllowGoogleSocialAuth'));
|
||||
this.google.capa.authFast(!!Settings.settingsGet('AllowGoogleSocialAuthFast'));
|
||||
this.google.capa.drive(!!Settings.settingsGet('AllowGoogleSocialDrive'));
|
||||
this.google.capa.preview(!!Settings.settingsGet('AllowGoogleSocialPreview'));
|
||||
|
||||
this.facebook.enabled(!!Settings.settingsGet('AllowFacebookSocial'));
|
||||
this.facebook.appID(Settings.settingsGet('FacebookAppID'));
|
||||
this.facebook.appSecret(Settings.settingsGet('FacebookAppSecret'));
|
||||
this.facebook.supported(!!Settings.settingsGet('SupportedFacebookSocial'));
|
||||
|
||||
this.twitter.enabled = ko.observable(!!Settings.settingsGet('AllowTwitterSocial'));
|
||||
this.twitter.consumerKey = ko.observable(Settings.settingsGet('TwitterConsumerKey'));
|
||||
this.twitter.consumerSecret = ko.observable(Settings.settingsGet('TwitterConsumerSecret'));
|
||||
|
||||
this.dropbox.enabled(!!Settings.settingsGet('AllowDropboxSocial'));
|
||||
this.dropbox.apiKey(Settings.settingsGet('DropboxApiKey'));
|
||||
};
|
||||
|
||||
module.exports = new SocialStore();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue