2014-07-23 13:10:02 -07:00
|
|
|
'use strict';
|
|
|
|
|
2014-10-30 12:13:56 -07:00
|
|
|
angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, notification, controllerUtils, pluginManager, identityService, Compatibility) {
|
2014-09-02 21:25:08 -07:00
|
|
|
controllerUtils.redirIfLogged();
|
2014-10-30 08:06:48 -07:00
|
|
|
$scope.confirmedEmail = getParam('confirmed');
|
2014-10-30 12:13:56 -07:00
|
|
|
$scope.retreiving = false;
|
|
|
|
Compatibility.check($scope);
|
|
|
|
|
2014-10-01 04:35:17 -07:00
|
|
|
$scope.openProfile = function(form) {
|
2014-10-09 14:53:31 -07:00
|
|
|
if (form && form.$invalid) {
|
|
|
|
notification.error('Error', 'Please enter the required fields');
|
|
|
|
return;
|
|
|
|
}
|
2014-10-01 04:35:17 -07:00
|
|
|
$scope.loading = true;
|
2014-10-28 14:06:32 -07:00
|
|
|
identityService.open($scope, form);
|
2014-10-01 04:35:17 -07:00
|
|
|
}
|
2014-10-30 08:06:48 -07:00
|
|
|
|
|
|
|
function getParam(sname) {
|
|
|
|
var params = location.search.substr(location.search.indexOf("?") + 1);
|
|
|
|
var sval = "";
|
|
|
|
params = params.split("&");
|
|
|
|
// split param and value into individual pieces
|
|
|
|
for (var i = 0; i < params.length; i++) {
|
|
|
|
var temp = params[i].split("=");
|
|
|
|
if ([temp[0]] == sname) {
|
|
|
|
sval = temp[1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return sval;
|
|
|
|
}
|
2014-09-02 21:25:08 -07:00
|
|
|
});
|