1
0
mirror of https://github.com/moparisthebest/mail synced 2024-08-13 16:43:47 -04:00
mail/src/js/controller/add-account.js

67 lines
1.9 KiB
JavaScript
Raw Normal View History

2014-01-27 12:50:13 -05:00
define(function(require) {
'use strict';
var appCtrl = require('js/app-controller');
2014-01-27 12:50:13 -05:00
var AddAccountCtrl = function($scope, $location) {
$scope.connectToGoogle = function() {
// test for oauth support
if (appCtrl._auth._oauth.isSupported()) {
// fetches the email address from the chrome identity api
appCtrl._auth.getOAuthToken(function(err) {
if (err) {
return $scope.onError(err);
}
$location.path('/login-set-credentials').search({
provider: 'gmail'
});
$scope.$apply();
});
return;
}
2014-01-27 12:50:13 -05:00
// use normal user/password login
$location.path('/login-set-credentials').search({
provider: 'gmail'
2014-01-27 12:50:13 -05:00
});
};
$scope.connectToYahoo = function() {
$location.path('/login-set-credentials').search({
provider: 'yahoo'
});
};
$scope.connectToTonline = function() {
$location.path('/login-set-credentials').search({
provider: 'tonline'
});
};
$scope.connectToOutlook = function() {
$location.path('/login-set-credentials').search({
provider: 'outlook'
});
};
2014-09-05 13:51:36 -04:00
$scope.connectToGmx = function() {
$location.path('/login-set-credentials').search({
provider: 'gmx'
});
};
2014-09-08 12:12:04 -04:00
$scope.connectToWebde = function() {
$location.path('/login-set-credentials').search({
provider: 'webde'
});
};
$scope.connectOther = function() {
$location.path('/login-set-credentials').search({
provider: 'custom'
});
};
2014-01-27 12:50:13 -05:00
};
return AddAccountCtrl;
});