fix conflicts
This commit is contained in:
commit
f1257d054c
49 changed files with 1015 additions and 755 deletions
|
|
@ -2,35 +2,34 @@
|
|||
|
||||
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;
|
||||
}
|
||||
else {
|
||||
$scope.themes = ['default'];
|
||||
if (config.themes && Array.isArray(config.themes) && config.themes[0]) {
|
||||
$scope.themes = config.themes;
|
||||
} else {
|
||||
$scope.themes = ['default'];
|
||||
}
|
||||
|
||||
$scope.theme = 'css/tpl-' + $scope.themes[0] + '.css';
|
||||
|
||||
$scope.change_theme = function(name) {
|
||||
$scope.theme = 'css/tpl-' + name + '.css';
|
||||
};
|
||||
$scope.version = copay.version;
|
||||
|
||||
$scope.getVideoURL = function(copayer) {
|
||||
if (config.disableVideo) return;
|
||||
|
||||
var vi = $rootScope.videoInfo[copayer]
|
||||
if (!vi) return;
|
||||
|
||||
if ($rootScope.wallet.getOnlinePeerIDs().indexOf(copayer) === -1) {
|
||||
// peer disconnected, remove his video
|
||||
delete $rootScope.videoInfo[copayer]
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.theme = 'css/tpl-' + $scope.themes[0] + '.css';
|
||||
|
||||
$scope.change_theme = function(name) {
|
||||
$scope.theme = 'css/tpl-' + name + '.css';
|
||||
};
|
||||
$scope.version = copay.version;
|
||||
|
||||
$scope.getVideoURL = function(copayer) {
|
||||
if (config.disableVideo) return;
|
||||
|
||||
var vi = $rootScope.videoInfo[copayer]
|
||||
if (!vi) return;
|
||||
|
||||
if ($rootScope.wallet.getOnlinePeerIDs().indexOf(copayer) === -1) {
|
||||
// peer disconnected, remove his video
|
||||
delete $rootScope.videoInfo[copayer]
|
||||
return;
|
||||
}
|
||||
|
||||
var encoded = vi.url;
|
||||
var url = decodeURI(encoded);
|
||||
var trusted = $sce.trustAsResourceUrl(url);
|
||||
return trusted;
|
||||
};
|
||||
});
|
||||
var encoded = vi.url;
|
||||
var url = decodeURI(encoded);
|
||||
var trusted = $sce.trustAsResourceUrl(url);
|
||||
return trusted;
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
angular.module('copayApp.controllers').controller('HeaderController',
|
||||
function($scope, $rootScope, $location, notification, $http, controllerUtils) {
|
||||
$scope.menu = [
|
||||
{
|
||||
$scope.menu = [{
|
||||
'title': 'Addresses',
|
||||
'icon': 'fi-address-book',
|
||||
'link': '#/addresses'
|
||||
|
|
@ -21,15 +20,27 @@ angular.module('copayApp.controllers').controller('HeaderController',
|
|||
'link': '#/backup'
|
||||
}];
|
||||
|
||||
$http.get('https://api.github.com/repos/bitpay/copay/tags').success(function(data){
|
||||
var toInt = function (s) { return parseInt(s); };
|
||||
$scope.getNumber = function(num) {
|
||||
return new Array(num);
|
||||
}
|
||||
|
||||
$http.get('https://api.github.com/repos/bitpay/copay/tags').success(function(data) {
|
||||
var toInt = function(s) {
|
||||
return parseInt(s);
|
||||
};
|
||||
var latestVersion = data[0].name.replace('v', '').split('.').map(toInt);
|
||||
var currentVersion = copay.version.split('.').map(toInt);
|
||||
if (currentVersion[0] < latestVersion[0]){
|
||||
$scope.updateVersion = {class: 'error', version:data[0].name};
|
||||
if (currentVersion[0] < latestVersion[0]) {
|
||||
$scope.updateVersion = {
|
||||
class: 'error',
|
||||
version: data[0].name
|
||||
};
|
||||
} else if (currentVersion[0] == latestVersion[0] && currentVersion[1] < latestVersion[1]) {
|
||||
$scope.updateVersion = {class: 'info', version:data[0].name};
|
||||
}
|
||||
$scope.updateVersion = {
|
||||
class: 'info',
|
||||
version: data[0].name
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
$rootScope.unitName = config.unitName;
|
||||
|
|
@ -55,7 +66,7 @@ angular.module('copayApp.controllers').controller('HeaderController',
|
|||
$rootScope.$watch('receivedFund', function(receivedFund) {
|
||||
if (receivedFund) {
|
||||
var currentAddr;
|
||||
for(var i=0;i<$rootScope.addrInfos.length;i++) {
|
||||
for (var i = 0; i < $rootScope.addrInfos.length; i++) {
|
||||
var addrinfo = $rootScope.addrInfos[i];
|
||||
if (addrinfo.address.toString() == receivedFund[1] && !addrinfo.isChange) {
|
||||
currentAddr = addrinfo.address.toString();
|
||||
|
|
@ -79,12 +90,12 @@ angular.module('copayApp.controllers').controller('HeaderController',
|
|||
|
||||
|
||||
$scope.isActive = function(item) {
|
||||
if (item.link && item.link.replace('#','') == $location.path()) {
|
||||
if (item.link && item.link.replace('#', '') == $location.path()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
$scope.signout = function() {
|
||||
logout();
|
||||
$scope.clearFlashMessage();
|
||||
|
|
@ -93,7 +104,7 @@ angular.module('copayApp.controllers').controller('HeaderController',
|
|||
$scope.refresh = function() {
|
||||
var w = $rootScope.wallet;
|
||||
w.connectToAll();
|
||||
if ($rootScope.addrInfos.length > 0 ) {
|
||||
if ($rootScope.addrInfos.length > 0) {
|
||||
controllerUtils.updateBalance(function() {
|
||||
$rootScope.$digest();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,11 +5,14 @@ angular.module('copayApp.controllers').controller('ImportController',
|
|||
$scope.title = 'Import a backup';
|
||||
var reader = new FileReader();
|
||||
var _importBackup = function(encryptedObj) {
|
||||
Passphrase.getBase64Async($scope.password, function(passphrase){
|
||||
Passphrase.getBase64Async($scope.password, function(passphrase) {
|
||||
walletFactory.import(encryptedObj, passphrase, function(err, w) {
|
||||
if (err) {
|
||||
$scope.loading = false;
|
||||
$rootScope.$flashMessage = { message: err.errMsg || 'Wrong password', type: 'error'};
|
||||
$rootScope.$flashMessage = {
|
||||
message: err.errMsg || 'Wrong password',
|
||||
type: 'error'
|
||||
};
|
||||
$rootScope.$digest();
|
||||
return;
|
||||
}
|
||||
|
|
@ -43,7 +46,10 @@ angular.module('copayApp.controllers').controller('ImportController',
|
|||
$scope.import = function(form) {
|
||||
if (form.$invalid) {
|
||||
$scope.loading = false;
|
||||
$rootScope.$flashMessage = { message: 'There is an error in the form. Please, try again', type: 'error'};
|
||||
$rootScope.$flashMessage = {
|
||||
message: 'There is an error in the form. Please, try again',
|
||||
type: 'error'
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -53,7 +59,10 @@ angular.module('copayApp.controllers').controller('ImportController',
|
|||
|
||||
if (!backupFile && !backupText) {
|
||||
$scope.loading = false;
|
||||
$rootScope.$flashMessage = { message: 'Please, select your backup file or paste the text', type: 'error'};
|
||||
$rootScope.$flashMessage = {
|
||||
message: 'Please, select your backup file or paste the text',
|
||||
type: 'error'
|
||||
};
|
||||
$scope.loading = false;
|
||||
return;
|
||||
}
|
||||
|
|
@ -62,8 +71,7 @@ angular.module('copayApp.controllers').controller('ImportController',
|
|||
|
||||
if (backupFile) {
|
||||
reader.readAsBinaryString(backupFile);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
_importBackup(backupText);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
$scope.submitForm = function(form) {
|
||||
if (form.$invalid) {
|
||||
$rootScope.$flashMessage = {
|
||||
message: 'You can not send a proposal transaction. Please, try again',
|
||||
message: 'Unable to send a transaction proposal. Please, try again',
|
||||
type: 'error'
|
||||
};
|
||||
return;
|
||||
|
|
@ -207,7 +207,7 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
templateUrl: 'addressBookModal.html',
|
||||
windowClass: 'tiny',
|
||||
controller: function($scope, $modalInstance) {
|
||||
|
||||
|
||||
$scope.submitAddressBook = function(form) {
|
||||
if (form.$invalid) {
|
||||
$rootScope.$flashMessage = {
|
||||
|
|
@ -254,4 +254,8 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
});
|
||||
};
|
||||
|
||||
$scope.topAmount = function() {
|
||||
var maxSat = ($rootScope.availableBalance * config.unitToSatoshi).toFixed(0) - bitcore.TransactionBuilder.FEE_PER_1000B_SAT;
|
||||
$scope.amount = maxSat / config.unitToSatoshi;
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ angular.module('copayApp.controllers').controller('SetupController',
|
|||
|
||||
var updateRCSelect = function(n) {
|
||||
$scope.requiredCopayers = (valid_pairs[[parseInt(n / 2 + 1), n]] > 0 || config.networkName === 'testnet') ?
|
||||
parseInt(n / 2 + 1) : 1;
|
||||
parseInt(n / 2 + 1) : 1;
|
||||
$scope.RCValues = [];
|
||||
for (var m = 1; m <= n; m++) {
|
||||
if (valid_pairs[[m, n]] > 0 || config.networkName === 'testnet') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue