Merge branch 'master' of github.com:bitpay/copay into feature/copay-shell

This commit is contained in:
Gordon Hall 2014-06-04 10:16:39 -04:00
commit 60cda70f72
38 changed files with 108 additions and 258 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copay.addresses').controller('AddressesController',
angular.module('copayApp.controllers').controller('AddressesController',
function($scope, $rootScope, $timeout, controllerUtils) {
$scope.loading = false;
var w = $rootScope.wallet;

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copay.backup').controller('BackupController',
angular.module('copayApp.controllers').controller('BackupController',
function($scope, $rootScope, $location, $window, $timeout, $modal) {
$scope.title = 'Backup';

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copay.footer').controller('FooterController', function($rootScope, $sce, $scope, $http) {
angular.module('copayApp.controllers').controller('FooterController', function($rootScope, $sce, $scope, $http) {
if (config.themes && Array.isArray(config.themes) && config.themes[0]) {
$scope.themes = config.themes;

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copay.header').controller('HeaderController',
angular.module('copayApp.controllers').controller('HeaderController',
function($scope, $rootScope, $location, $notification, $http, walletFactory, controllerUtils) {
$scope.menu = [
{

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copay.import').controller('ImportController',
angular.module('copayApp.controllers').controller('ImportController',
function($scope, $rootScope, walletFactory, controllerUtils, Passphrase) {
$scope.title = 'Import a backup';
var reader = new FileReader();

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copay.send').controller('SendController',
angular.module('copayApp.controllers').controller('SendController',
function($scope, $rootScope, $window, $location, $timeout) {
$scope.title = 'Send';
$scope.loading = false;
@ -93,7 +93,7 @@ angular.module('copay.send').controller('SendController',
//alert(JSON.stringify(qrcode.process(context)));
qrcode.decode();
} catch (e) {
console.log('error decoding QR: '+e);
// error decoding QR
}
}, 1500);
};
@ -135,7 +135,6 @@ angular.module('copay.send').controller('SendController',
};
var _videoError = function(err) {
console.log('Video Error: ' + JSON.stringify(err));
_scanStop();
};
@ -143,7 +142,6 @@ angular.module('copay.send').controller('SendController',
_scanStop();
var str = (data.indexOf('bitcoin:') === 0) ? data.substring(8) : data;
console.log('QR code detected: ' + str);
$scope.$apply(function() {
$scope.address = str;
});

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copay.settings').controller('SettingsController',
angular.module('copayApp.controllers').controller('SettingsController',
function($scope, $rootScope, $window, $location) {
$scope.title = 'Settings';

View file

@ -32,7 +32,7 @@ var valid_pairs = {
'1,12': 489
};
angular.module('copay.setup').controller('SetupController',
angular.module('copayApp.controllers').controller('SetupController',
function($scope, $rootScope, $location, $timeout, walletFactory, controllerUtils, Passphrase) {
$rootScope.videoInfo = {};

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copay.signin').controller('SigninController',
angular.module('copayApp.controllers').controller('SigninController',
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase) {
var cmp = function(o1, o2){
var v1 = o1.show.toLowerCase(), v2 = o2.show.toLowerCase();
@ -21,13 +21,16 @@ angular.module('copay.signin').controller('SigninController',
$scope.loading = true;
var password = form.openPassword.$modelValue;
console.log('## Obtaining passphrase...');
Passphrase.getBase64Async(password, function(passphrase){
console.log('## Passphrase obtained');
var w = walletFactory.open($scope.selectedWalletId, { passphrase: passphrase});
var w, errMsg;
try{
var w = walletFactory.open($scope.selectedWalletId, { passphrase: passphrase});
} catch (e){
errMsg = e.message;
};
if (!w) {
$scope.loading = $scope.failure = false;
$rootScope.$flashMessage = { message: 'Wrong password', type: 'error'};
$rootScope.$flashMessage = { message: errMsg || 'Wrong password', type: 'error'};
$rootScope.$digest();
return;
}

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copay.transactions').controller('TransactionsController',
angular.module('copayApp.controllers').controller('TransactionsController',
function($scope, $rootScope, $timeout, controllerUtils) {
$scope.title = 'Transactions';
@ -54,7 +54,6 @@ angular.module('copay.transactions').controller('TransactionsController',
$rootScope.txAlertCount = 0;
var w = $rootScope.wallet;
w.sendTx(ntxid, function(txid) {
console.log('[transactions.js.68:txid:] SENTTX CALLBACK',txid); //TODO
$rootScope.$flashMessage = txid
? {type:'success', message: 'Transaction broadcasted. txid: ' + txid}
: {type:'error', message: 'There was an error sending the Transaction'}
@ -90,7 +89,6 @@ angular.module('copay.transactions').controller('TransactionsController',
$scope.getTransactions = function(cb) {
var w =$rootScope.wallet;
if (w) {
console.log('### Querying last transactions...'); //TODO
var addresses = w.getAddressesStr();
if (addresses.length > 0) {
return w.blockchain.getTransactions(addresses, cb);