Fix angular bootstrap errors

This commit is contained in:
Tankred Hase 2014-11-20 22:53:30 +01:00
parent 7eeff8ec75
commit 198118571f
9 changed files with 31 additions and 21 deletions

View File

@ -54,7 +54,7 @@ var app = angular.module('mail', [
'woAppConfig', 'woAppConfig',
'woDirectives', 'woDirectives',
'woUtil', 'woUtil',
'woCrypto,', 'woCrypto',
'woServices', 'woServices',
'woEmail', 'woEmail',
'navigation', 'navigation',

View File

@ -12,10 +12,13 @@ var INIT_DISPLAY_LEN = 20,
NOTIFICATION_INBOX_TIMEOUT = 5000; NOTIFICATION_INBOX_TIMEOUT = 5000;
var MailListCtrl = function($scope, $routeParams, statusDisplay, notification, email, keychain, dialog) { var MailListCtrl = function($scope, $routeParams, statusDisplay, notification, email, keychain, dialog) {
// //
// Init // Init
// //
$scope.state.mailList = {};
/** /**
* Gathers unread notifications to be cancelled later * Gathers unread notifications to be cancelled later
*/ */

View File

@ -104,8 +104,7 @@ var NavigationCtrl = function($scope, $routeParams, $location, account, email, o
} }
// get pointer to account/folder/message tree on root scope // get pointer to account/folder/message tree on root scope
$scope.$root.account = email._account; $scope.$root.account = account.list()[0];
// TODO: $scope.accounts = account.list();
// set notificatio handler for sent messages // set notificatio handler for sent messages
outbox.onSent = sentNotification; outbox.onSent = sentNotification;

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
var ngModule = angular.module('woServices'); var ngModule = angular.module('woEmail');
ngModule.service('account', Account); ngModule.service('account', Account);
module.exports = Account; module.exports = Account;
@ -61,9 +61,11 @@ Account.prototype.init = function(options, callback) {
// Pre-Flight check: initialize and prepare user's local database // Pre-Flight check: initialize and prepare user's local database
function prepareDatabase() { function prepareDatabase() {
self._accountStore.init(options.emailAddress, function(err) { try {
if (err) { self._accountStore.init(options.emailAddress);
return callback(err); } catch (err) {
callback(err);
return;
} }
// Migrate the databases if necessary // Migrate the databases if necessary
@ -74,7 +76,6 @@ Account.prototype.init = function(options, callback) {
prepareKeys(); prepareKeys();
}); });
});
} }
// retrieve keypair fom devicestorage/cloud, refresh public key if signup was incomplete before // retrieve keypair fom devicestorage/cloud, refresh public key if signup was incomplete before

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
var ngModule = angular.module('woServices'); var ngModule = angular.module('woEmail');
ngModule.service('email', Email); ngModule.service('email', Email);
module.exports = Email; module.exports = Email;
@ -57,7 +57,9 @@ function Email(keychain, pgp, accountStore, pgpbuilder, mailreader, dialog) {
this._pgpbuilder = pgpbuilder; this._pgpbuilder = pgpbuilder;
this._mailreader = mailreader; this._mailreader = mailreader;
this.onError = dialog.error; this.onError = function(err) {
dialog.error(err);
};
} }

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('woEmail', ['woAppConfig', 'woUtil', 'woServices']); angular.module('woEmail', ['woAppConfig', 'woUtil', 'woServices', 'woCrypto']);
require('./mailreader'); require('./mailreader');
require('./pgpbuilder'); require('./pgpbuilder');

View File

@ -4,7 +4,7 @@ var mailreader = require('mailreader');
var config = require('../app-config').config; var config = require('../app-config').config;
mailreader.startWorker(config.workerPath + '/mailreader-parser-worker.min.js'); mailreader.startWorker(config.workerPath + '/mailreader-parser-worker.min.js');
var ngModule = angular.module('woServices'); var ngModule = angular.module('woEmail');
ngModule.factory('mailreader', function() { ngModule.factory('mailreader', function() {
return mailreader; return mailreader;
}); });

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
var ngModule = angular.module('woServices'); var ngModule = angular.module('woEmail');
ngModule.service('outbox', Outbox); ngModule.service('outbox', Outbox);
module.exports = Outbox; module.exports = Outbox;

View File

@ -1,4 +1,9 @@
'use strict'; 'use strict';
var ngModule = angular.module('woServices'); var PgpBuilder = require('pgpbuilder');
ngModule.service('pgpbuilder', require('pgpbuilder')); var instance = new PgpBuilder();
var ngModule = angular.module('woEmail');
ngModule.factory('pgpbuilder', function() {
return instance;
});