mirror of
https://github.com/moparisthebest/mail
synced 2025-01-31 15:10:13 -05:00
Expose angular/common.js modules for util, app-config
This commit is contained in:
parent
1f5fa4ca41
commit
e6b22bd0a0
@ -1,9 +1,17 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var appCfg = {};
|
||||||
|
|
||||||
|
var ngModule = angular.module('mail');
|
||||||
|
ngModule.factory('appConfig', function() {
|
||||||
|
return appCfg;
|
||||||
|
});
|
||||||
|
exports = appCfg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global app configurations
|
* Global app configurations
|
||||||
*/
|
*/
|
||||||
exports.config = {
|
appCfg.config = {
|
||||||
cloudUrl: 'https://keys.whiteout.io',
|
cloudUrl: 'https://keys.whiteout.io',
|
||||||
privkeyServerUrl: 'https://keychain.whiteout.io',
|
privkeyServerUrl: 'https://keychain.whiteout.io',
|
||||||
adminUrl: 'https://admin-node.whiteout.io',
|
adminUrl: 'https://admin-node.whiteout.io',
|
||||||
@ -38,7 +46,7 @@ if (typeof chrome !== 'undefined' && chrome.runtime && chrome.runtime.getManifes
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setConfigParams(manifest) {
|
function setConfigParams(manifest) {
|
||||||
var cfg = exports.config;
|
var cfg = appCfg.config;
|
||||||
|
|
||||||
function getUrl(beginsWith) {
|
function getUrl(beginsWith) {
|
||||||
return _.find(manifest.permissions, function(permission) {
|
return _.find(manifest.permissions, function(permission) {
|
||||||
@ -57,7 +65,7 @@ function setConfigParams(manifest) {
|
|||||||
/**
|
/**
|
||||||
* Strings are maintained here
|
* Strings are maintained here
|
||||||
*/
|
*/
|
||||||
exports.string = {
|
appCfg.string = {
|
||||||
fallbackSubject: '(no subject)',
|
fallbackSubject: '(no subject)',
|
||||||
invitationSubject: 'Invitation to a private conversation',
|
invitationSubject: 'Invitation to a private conversation',
|
||||||
invitationMessage: 'Hi,\n\nI use Whiteout Mail to send and receive encrypted email. I would like to exchange encrypted messages with you as well.\n\nPlease install the Whiteout Mail application. This application makes it easy to read and write messages securely with PGP encryption applied.\n\nGo to the Whiteout Networks homepage to learn more and to download the application: https://whiteout.io\n\n',
|
invitationMessage: 'Hi,\n\nI use Whiteout Mail to send and receive encrypted email. I would like to exchange encrypted messages with you as well.\n\nPlease install the Whiteout Mail application. This application makes it easy to read and write messages securely with PGP encryption applied.\n\nGo to the Whiteout Networks homepage to learn more and to download the application: https://whiteout.io\n\n',
|
||||||
|
@ -253,7 +253,7 @@ ctrl.logout = function() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: move onConnect to emailDao
|
// TODO: move onConnect to Account service
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event that is called when the user agent goes online. This create new instances of the imap-client and pgp-mailer and connects to the mail server.
|
* Event that is called when the user agent goes online. This create new instances of the imap-client and pgp-mailer and connects to the mail server.
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
var ngModule = angular.module('woServices');
|
var ngModule = angular.module('woServices');
|
||||||
ngModule.service('mailConfig', MailConfig);
|
ngModule.service('mailConfig', MailConfig);
|
||||||
|
module.exports = MailConfig;
|
||||||
|
|
||||||
var cfg = require('../app-config').config;
|
function MailConfig($http, $q, appConfig) {
|
||||||
|
|
||||||
function MailConfig($http, $q) {
|
|
||||||
this._http = $http;
|
this._http = $http;
|
||||||
this._q = $q;
|
this._q = $q;
|
||||||
|
this._appConfig = appConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -20,7 +20,7 @@ MailConfig.prototype.get = function(emailAddress) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var url = cfg.settingsUrl + emailAddress.split('@')[1];
|
var url = this._appConfig.settingsUrl + emailAddress.split('@')[1];
|
||||||
return this._http.get(url).then(function(res) {
|
return this._http.get(url).then(function(res) {
|
||||||
return res.data;
|
return res.data;
|
||||||
});
|
});
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
var ngModule = angular.module('woServices');
|
var ngModule = angular.module('woServices');
|
||||||
ngModule.service('newsletter', Newsletter);
|
ngModule.service('newsletter', Newsletter);
|
||||||
|
module.exports = Newsletter;
|
||||||
|
|
||||||
function Newsletter($q) {
|
function Newsletter($q) {
|
||||||
this._q = $q;
|
this._q = $q;
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var ngModule = angular.module('woUtil');
|
||||||
|
ngModule.service('connectionDoctor', ConnectionDoctor);
|
||||||
|
module.exports = ConnectionDoctor;
|
||||||
|
|
||||||
var TCPSocket = require('tcp-socket'),
|
var TCPSocket = require('tcp-socket'),
|
||||||
appConfig = require('../app-config'),
|
appConfig = require('../app-config'),
|
||||||
cfg = appConfig.config,
|
cfg = appConfig.config,
|
||||||
@ -14,7 +18,7 @@ var TCPSocket = require('tcp-socket'),
|
|||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
var ConnectionDoctor = function() {};
|
function ConnectionDoctor() {}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -293,6 +297,4 @@ function createError(code, message, underlyingError) {
|
|||||||
error.underlyingError = underlyingError;
|
error.underlyingError = underlyingError;
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = ConnectionDoctor;
|
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
var ngModule = angular.module('woUtil');
|
var ngModule = angular.module('woUtil');
|
||||||
ngModule.service('dialog', Dialog);
|
ngModule.service('dialog', Dialog);
|
||||||
|
module.exports = Dialog;
|
||||||
|
|
||||||
function Dialog() {}
|
function Dialog() {}
|
||||||
|
|
||||||
|
@ -3,4 +3,5 @@
|
|||||||
angular.module('woUtil', []);
|
angular.module('woUtil', []);
|
||||||
|
|
||||||
require('./dialog');
|
require('./dialog');
|
||||||
|
require('./connection-doctor');
|
||||||
require('./update/update-handler');
|
require('./update/update-handler');
|
@ -4,7 +4,6 @@ var ngModule = angular.module('woUtil');
|
|||||||
ngModule.service('updateHandler', ['deviceStorage', 'deviceStorage', 'auth', UpdateHandler]);
|
ngModule.service('updateHandler', ['deviceStorage', 'deviceStorage', 'auth', UpdateHandler]);
|
||||||
module.exports = UpdateHandler;
|
module.exports = UpdateHandler;
|
||||||
|
|
||||||
|
|
||||||
var axe = require('axe-logger'),
|
var axe = require('axe-logger'),
|
||||||
cfg = require('../../app-config').config,
|
cfg = require('../../app-config').config,
|
||||||
updateV1 = require('./update-v1'),
|
updateV1 = require('./update-v1'),
|
||||||
|
Loading…
Reference in New Issue
Block a user