This commit is contained in:
Gustavo Cortez 2014-07-07 18:13:26 -03:00
commit a1e5246727
44 changed files with 3762 additions and 365 deletions

View file

@ -33,7 +33,8 @@ angular.module('copayApp.controllers').controller('AddressesController',
$scope.addresses.push({
'address': addrinfo.addressStr,
'balance': $rootScope.balanceByAddr ? $rootScope.balanceByAddr[addrinfo.addressStr] : 0,
'isChange': addrinfo.isChange
'isChange': addrinfo.isChange,
'owned': addrinfo.owned
});
}
$scope.selectedAddr = $scope.addresses[0];

View file

@ -2,7 +2,7 @@
angular.module('copayApp.controllers').controller('BackupController',
function($scope, $rootScope, $location, $window, $timeout, $modal, backupService, walletFactory, controllerUtils) {
$scope.title = 'Backup';
$scope.title = 'Settings';
$scope.download = function() {
backupService.download($rootScope.wallet);

View file

@ -2,6 +2,8 @@
angular.module('copayApp.controllers').controller('FooterController', function($rootScope, $sce, $scope, $http) {
$scope.networkName = config.networkName;
if (config.themes && Array.isArray(config.themes) && config.themes[0]) {
$scope.themes = config.themes;
} else {

View file

@ -15,8 +15,8 @@ angular.module('copayApp.controllers').controller('HeaderController',
'icon': 'fi-arrow-right',
'link': '#/send'
}, {
'title': 'Backup',
'icon': 'fi-archive',
'title': 'Settings',
'icon': 'fi-wrench',
'link': '#/backup'
}];
@ -71,7 +71,9 @@ angular.module('copayApp.controllers').controller('HeaderController',
$rootScope.$watch('txAlertCount', function(txAlertCount) {
if (txAlertCount && txAlertCount > 0) {
notification.info('New Transaction', ($rootScope.txAlertCount == 1) ? 'You have a pending transaction proposal' : 'You have ' + $rootScope.txAlertCount + ' pending transaction proposals', txAlertCount);
notification.info('New Transaction', ($rootScope.txAlertCount == 1) ?
'You have a pending transaction proposal' :
'You have ' + $rootScope.txAlertCount + ' pending transaction proposals', txAlertCount);
}
});

View file

@ -75,10 +75,9 @@ angular.module('copayApp.controllers').controller('ImportController',
}
var backupFile = $scope.file;
var backupText = form.backupText.$modelValue;
var password = form.password.$modelValue;
if (!backupFile && !backupText) {
if (!backupFile) {
$scope.loading = false;
notification.error('Error', 'Please, select your backup file or paste the file contents');
$scope.loading = false;
@ -87,8 +86,6 @@ angular.module('copayApp.controllers').controller('ImportController',
if (backupFile) {
reader.readAsBinaryString(backupFile);
} else {
_importBackup(backupText);
}
}
};
});

View file

@ -23,6 +23,13 @@ angular.module('copayApp.controllers').controller('SendController',
return flag;
};
if ($rootScope.pendingPayment) {
var pp = $rootScope.pendingPayment;
$scope.address = pp.address;
var amount = pp.amount / config.unitToSatoshi * 100000000;
$scope.amount = amount;
}
// Detect protocol
$scope.isHttp = ($window.location.protocol.indexOf('http') === 0);
@ -61,6 +68,7 @@ angular.module('copayApp.controllers').controller('SendController',
$scope.loading = false;
});
}
$rootScope.pendingPayment = null;
});
// reset fields
@ -250,7 +258,7 @@ angular.module('copayApp.controllers').controller('SendController',
};
$scope.topAmount = function(form) {
$scope.amount = $scope.getAvailableAmount();
$scope.amount = $scope.getAvailableAmount();
form.amount.$pristine = false;
};
});

View file

@ -11,7 +11,7 @@ angular.module('copayApp.controllers').controller('SettingsController',
$scope.networkHost = config.network.host;
$scope.networkPort = config.network.port;
$scope.networkSecure = config.network.secure || false;
$scope.disableVideo = typeof config.disableVideo === undefined ? true : config.disableVideo;
$scope.disableVideo = typeof config.disableVideo === undefined ? true : config.disableVideo;
$scope.unitOpts = [{
name: 'Satoshis (100,000,000 satoshis = 1BTC)',
@ -73,6 +73,8 @@ angular.module('copayApp.controllers').controller('SettingsController',
unitToSatoshi: $scope.selectedUnit.value,
}));
$window.location.href = $window.location.origin + $window.location.pathname;
var target = ($window.location.origin !== 'null' ? $window.location.origin : '') + $window.location.pathname;
$window.location.href = target;
};
});

View file

@ -13,6 +13,10 @@ angular.module('copayApp.controllers').controller('SigninController',
$scope.selectedWalletId = $scope.wallets.length ? $scope.wallets[0].id : null;
$scope.openPassword = '';
if ($rootScope.pendingPayment) {
notification.info('Login Required', 'Please open wallet to complete payment');
}
$scope.open = function(form) {
if (form && form.$invalid) {
notification.error('Error', 'Please enter the required fields');

View file

@ -0,0 +1,17 @@
'use strict';
angular.module('copayApp.controllers').controller('UriPaymentController', function($rootScope, $scope, $routeParams, $timeout, $location) {
var data = decodeURIComponent($routeParams.data);
$rootScope.pendingPayment = copay.Structure.parseBitcoinURI($routeParams.data);
$scope.protocol = $rootScope.pendingPayment.protocol;
$scope.address = $rootScope.pendingPayment.address;
$scope.amount = $rootScope.pendingPayment.amount;
$scope.message = $rootScope.pendingPayment.message;
$timeout(function() {
$location.path('signin');
}, 1000);
});