fix copayers

This commit is contained in:
Matias Alejo Garcia 2016-08-17 13:16:06 -03:00
commit 3cb0676815
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
30 changed files with 786 additions and 177 deletions

View file

@ -14,7 +14,6 @@
<!-- <body ng&#45;cloak class="ng&#45;cloak"> -->
<body >
<ion-nav-bar class="bar-stable"></ion-nav-bar>
<ion-nav-view name="main"></ion-nav-view>
<script src="lib/ionic.bundle.min.js"></script>

View file

@ -65,16 +65,15 @@
<div class="item item-icon-right">
Add Memo
Add Description (not yet working...)
<i class="icon ion-ios-arrow-right size-21"></i>
</div>
</div>
<div class="card">
<div class="item item-text-wrap item-icon-right" ng-click="cancel()">
Slide to complete
<i class="icon ion-ios-arrow-thin-right size-21"></i>
</div>
<button class="item button button-full button-positive" ng-click="approve()">
Approve
</button>
</div>
</ion-content>

View file

@ -1,7 +1,17 @@
<ion-view ng-controller="copayersController">
<ion-nav-title>{{wallet.name}}</ion-nav-title>
<ion-nav-bar class="bar-stable">
<ion-nav-title>{{wallet.name}}</ion-nav-title>
<ion-nav-buttons side="primary">
<button class="button" href ui-sref="tabs.home">
<i class="ion-arrow-left-c"></i> Back
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-buttons side="primary">
<button class="button" href ui-sref="tabs.home">

View file

@ -1,13 +1,13 @@
<ion-view ng-controller="preferencesController" cache-view="false" ng-init="init()">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Wallet Settings</ion-nav-title>
<ion-nav-buttons side="primary">
 <button class="button" href ui-sref="walletDetails">
 <button class="button" href ui-sref="wallet.details">
     <i class="ion-arrow-left-c"></i> Back
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content class="has-header">
<ion-content class="has-header" ng-controller="preferencesController" cache-view="false" ng-init="init()">
<div class="list">
<div class="item item-divider">
Preferences
@ -15,7 +15,7 @@
<div class="item item-icon-right" href ui-sref="preferencesAlias">
<span translate>Wallet Name</span>
<span class="item-note">
{{index.alias||index.walletName}}
{{alias||walletName}}
</span>
<i class="icon ion-ios-arrow-right"></i>
</div>
@ -38,7 +38,7 @@
</span>
</div>
<div class="item item-icon-right" href ui-sref="preferencesColor">
<span ng-style="{'color':index.backgroundColor}">&block;</span>
<span ng-style="{'color': backgroundColor}">&block;</span>
<span translate>Wallet Color</span>
<span class="item-note">
{{index.alias||index.walletName}}

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="preferencesAbout" cache-view="false">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>About Copay</ion-nav-title>
<ion-nav-buttons side="primary">
@ -7,7 +7,7 @@
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<ion-content ng-controller="preferencesAbout" cache-view="false">
<div class="item item-divider">
Release information
</div>

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="preferencesAliasController" cache-view="false">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Alias</ion-nav-title>
<ion-nav-buttons side="primary">
@ -7,7 +7,7 @@
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content class="has-header">
<ion-content class="has-header" ng-controller="preferencesAliasController" cache-view="false">
<form name="aliasForm" ng-submit="save(aliasForm)" novalidate>
<label class="item item-input item-stacked-label">
<span class="input-label" transalate>Alias for {{walletName}}</span>

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="preferencesAltCurrencyController" cache-view="false" ng-init="init()">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Alternative Currency</ion-nav-title>
<ion-nav-buttons side="primary">
@ -7,7 +7,7 @@
   </button>
 </ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<ion-content ng-controller="preferencesAltCurrencyController" ng-init="init()" cache-view="false">
<ion-radio ng-repeat="altCurrency in altCurrencyList" ng-value="altCurrency.isoCode" ng-model="currentCurrency"
ng-click="save(altCurrency)">{{altCurrency.name}}
</ion-radio>

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="preferencesBwsUrlController" cache-view="false">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Wallet Service URL</ion-nav-title>
<ion-nav-buttons side="primary">
@ -7,7 +7,7 @@
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content class="has-header">
<ion-content class="has-header" ng-controller="preferencesBwsUrlController" cache-view="false">
<form name="settingsBwsUrlForm" ng-submit="save(settingsBwsUrlForm)" novalidate>
<label class="item item-input item-stacked-label">
<span class="input-label" transalate>Wallet Service URL</span><a ng-click="resetDefaultUrl()" translate> Set default url</a>

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="preferencesColorController" cache-view="false">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Color</ion-nav-title>
<ion-nav-buttons side="primary">
@ -7,7 +7,7 @@
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content class="has-header">
<ion-content class="has-header" ng-controller="preferencesColorController" cache-view="false">
<ion-radio ng-repeat="c in colorList" ng-value="c" ng-model="currentColor" ng-click="save(c)">
<span ng-style="{'color': c}">&block;</span>
</ion-radio>

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="preferencesDeleteWalletController" cache-view="false">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Delete Wallet</ion-nav-title>
<ion-nav-buttons side="primary">
@ -7,7 +7,7 @@
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content class="has-header">
<ion-content class="has-header" ng-controller="preferencesDeleteWalletController" cache-view="false">
<div translate>Warning!</div>
<div translate>Permanently delete this wallet. THIS ACTION CANNOT BE REVERSED</div>
<div class="right" ng-style="{'color':index.backgroundColor}" ng-show="!isDeletingWallet">

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="preferencesDeleteWordsController" cache-view="false">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Delete Recovery Phrase</ion-nav-title>
<ion-nav-buttons side="primary">
@ -7,7 +7,7 @@
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content class="has-header">
<ion-content class="has-header" ng-controller="preferencesDeleteWordsController" cache-view="false">
<div ng-show="!deleted">
<div ng-show="error">
{{error|translate}}

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="preferencesEmailController" cache-view="false">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Email Notifications</ion-nav-title>
<ion-nav-buttons side="primary">
@ -7,7 +7,7 @@
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content class="has-header">
<ion-content class="has-header" ng-controller="preferencesEmailController" cache-view="false">
<form name="emailForm" ng-submit="save(emailForm)" novalidate>
<label class="item item-input item-stacked-label">
<span class="input-label" transalate>Email for wallet notifications</span>

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="preferencesFeeController" cache-view="false" ng-init="init()">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Preferences fee</ion-nav-title>
<ion-nav-buttons side="primary">
@ -8,7 +8,7 @@
 </ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<ion-content ng-controller="preferencesFeeController" cache-view="false" ng-init="init()">
<div ng-show="loading">
<ion-spinner class="spinner-dark" icon="lines">Loading...</ion-spinner>
</div>

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="preferencesHistory" cache-view="false" ng-init="index.updatingTxHistory ? null : csvHistory()">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Transaction History</ion-nav-title>
<ion-nav-buttons side="primary">
@ -7,7 +7,7 @@
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content class="has-header">
<ion-content class="has-header" ng-controller="preferencesHistory" cache-view="false" ng-init="index.updatingTxHistory ? null : csvHistory()">
<div class="item item-divider"></div>
<div class="item" ng-show="csvReady && !index.isCordova" ng-csv="csvContent" csv-header="csvHeader" filename="Copay-{{index.alias || index.walletName}}.csv">
<span translate>Export to file</span>

View file

@ -1,5 +1,5 @@
<ion-view ng-controller="preferencesInformation" cache-view="false" ng-init="init()">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Wallet Information</ion-nav-title>
<ion-nav-buttons side="primary">
@ -8,7 +8,7 @@
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content class="has-header">
<ion-content class="has-header" ng-controller="preferencesInformation" cache-view="false" ng-init="init()">
<div class="list">
<div class="item item-divider">
Wallet Information

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="preferencesLanguageController" ng-init="init()" cache-view="false">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Languages</ion-nav-title>
<ion-nav-buttons side="primary">
@ -7,7 +7,7 @@
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<ion-content ng-controller="preferencesLanguageController" ng-init="init()" cache-view="false">
<ion-radio ng-repeat="lang in availableLanguages" ng-value="lang.isoCode" ng-model="currentLanguage"
ng-click="save(lang.isoCode)">{{lang.name}}
</ion-radio>

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="preferencesLogs" ng-init="init()" cache-view="false">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Session log</ion-nav-title>
<ion-nav-buttons side="primary">
@ -7,7 +7,7 @@
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<ion-content ng-controller="preferencesLogs" ng-init="init()" cache-view="false">
<button ng-show="isCordova" ng-click="logs.sendLogs()"><i class="fi-mail"></i>
<span translate>Send by email</span>
</button>

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="preferencesUnitController" ng-init="init()" cache-view="false">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Unit</ion-nav-title>
<ion-nav-buttons side="primary">
@ -7,7 +7,7 @@
   </button>
  </ion-nav-buttons>
</ion-nav-bar class="bar-stable">
<ion-content>
<ion-content ng-controller="preferencesUnitController" ng-init="init()" cache-view="false">
<ion-radio ng-repeat="unit in unitList" ng-value="unit.code" ng-model="currentUnit"
ng-click="save(unit)">{{unit.shortName}}
</ion-radio>

View file

@ -1,5 +1,8 @@
<ion-view view-title="Home">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Home</ion-nav-title>
</ion-nav-bar>
<ion-content class="padding home" ng-controller="tabHomeController">
<a href="#/add"><i class="ion-ios-plus-outline right"></i></a>
<h2>Wallets </h2>
@ -8,7 +11,7 @@
<li ng-show="wallets[0]"
ng-repeat="item in wallets track by $index" class="item item-icon-left"
menu-toggle href ui-sref="walletDetails({'walletId': item.id})">
menu-toggle href ui-sref="wallet.details({'walletId': item.id})">
<i class="icon ion-briefcase size-21" ng-style="{'color':item.color}"></i>
{{item.name || item.id}}
<span ng-show="item.n > 1" class="text-gray">

View file

@ -1,6 +1,6 @@
<ion-view ng-controller="tabReceiveController" cache-view="false">
<ion-view>
<ion-nav-title>Receive</ion-nav-title>
<ion-content ng-init="init()">
<ion-content ng-controller="tabReceiveController" ng-init="init()" cache-view="false">
<div class="text-center m30v" ng-click="copyToClipboard(addr, $event)" ng-show="addr" >
<qrcode size="220" data="bitcoin:{{addr}}" ng-show="addr"></qrcode>
@ -34,7 +34,7 @@ Error: {{addrError}}
</div>
</div>
<div ng-show="!incomplete">
<div class="item item-icon-left" ng-click="shareAddress(addr)" ng-show="isCordova && addr" ng-disabled="generatingAddress">
<i class="icon ion-ios-upload-outline"></i>

View file

@ -1,6 +1,6 @@
<ion-view ng-controller="tabSettingsController" cache-view="false" ng-init="init()">
<ion-view>
<ion-nav-title>Global Settings</ion-nav-title>
<ion-content class="has-header">
<ion-content class="has-header" ng-controller="tabSettingsController" cache-view="false" ng-init="init()">
<div class="item item-divider">
</div>
<div class="list">

View file

@ -1,4 +1,4 @@
<ion-view ng-controller="termOfUseController" cache-view="false">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Terms of Use</ion-nav-title>
<ion-nav-buttons side="primary">
@ -7,7 +7,7 @@
   </button>
  </ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<ion-content ng-controller="termOfUseController" cache-view="false">
<p>
<div ng-include="'views/includes/terms.html'"></div>
</p>

View file

@ -1,4 +1,4 @@
<ion-view cache-view="false">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Translators</ion-nav-title>
<ion-nav-buttons side="primary">

View file

@ -1,19 +1,21 @@
<ion-view ng-controller="walletDetailsController">
<ion-nav-bar class="bar-stable">
<ion-nav-title>{{wallet.name}}</ion-nav-title>
<ion-nav-title>{{wallet.name}}</ion-nav-title>
<ion-nav-buttons side="primary">
<button class="button" href ui-sref="tabs.home">
<i class="ion-arrow-left-c"></i> Back
</button>
</ion-nav-buttons>
<ion-nav-buttons side="secondary">
<button class="button button-icon icon ion-ios-settings" href ui-sref="preferences"></button>
</ion-nav-buttons>
<ion-nav-buttons side="primary">
<button class="button" href ui-sref="tabs.home">
<i class="ion-arrow-left-c"></i> Back
</button>
</ion-nav-buttons>
<ion-nav-buttons side="secondary">
<button class="button button-icon icon ion-ios-settings" href ui-sref="wallet.preferences"></button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content delegate-handle="my-handle" overflow-scroll="true">
<button class="button button-icon icon ion-ios-settings" href ui-sref="wallet.preferences"></button>
<div ng-show="!wallet">
No Wallet
@ -25,7 +27,7 @@
<div ng-show="!wallet.isComplete()">
Wallet Incomplete.
<a href ui-sref="copayers({'walletId': wallet.id})" class="button">
<a href ui-sref="wallet.copayers" class="button">
Wait for Copayers
</a>
</div>

View file

@ -1,7 +1,20 @@
'use strict';
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, walletService, platformInfo, lodash, configService, go, rateService, $stateParams, $window, $state, $log, profileService, bitcore) {
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, walletService, platformInfo, lodash, configService, go, rateService, $stateParams, $window, $state, $log, profileService, bitcore, $ionicPopup) {
// An alert dialog
var showAlert = function(title, msg, cb) {
$log.warn(title + ":"+ msg);
var alertPopup = $ionicPopup.alert({
title: title,
template: msg
});
if (!cb) cb = function() {};
alertPopup.then(cb);
};
var unitToSatoshi;
@ -11,6 +24,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
var self = $scope.self;
var SMALL_FONT_SIZE_LIMIT = 13;
var LENGTH_EXPRESSION_LIMIT = 19;
var config;
$scope.init = function() {
console.log('[confirm.js.23:$scope:]',$stateParams); //TODO
@ -23,11 +37,12 @@ console.log('[confirm.js.23:$scope:]',$stateParams); //TODO
$scope.isCordova = platformInfo.isCordova;
var config = configService.getSync().wallet.settings;
$scope.unitName = config.unitName;
$scope.alternativeIsoCode = config.alternativeIsoCode;
config = configService.getSync().wallet;
unitToSatoshi = config.unitToSatoshi;
$scope.unitName = config.settings.unitName;
$scope.alternativeIsoCode = config.settings.alternativeIsoCode;
unitToSatoshi = config.settings.unitToSatoshi;
satToUnit = 1 / unitToSatoshi;
satToBtc = 1 / 100000000;
@ -40,112 +55,145 @@ console.log('[confirm.js.23:$scope:]',$stateParams); //TODO
$scope.setWallets(network);
$scope.alternativeAmount = toFiat($scope.toAmount);
unitDecimals = config.unitDecimals;
unitDecimals = config.settings.unitDecimals;
$scope.$on("$ionicSlides.slideChangeEnd", function(event, data) {
$scope.wallet = $scope.wallets[data.slider.activeIndex];
});
createTx($scope.toAddress, $scope.toAmount);
$timeout(function() {
$ionicScrollDelegate.resize();
}, 100);
};
var setSendError = function(msg) {
showAlert('Error creating transaction', msg);
};
var createTx = function(toAddress, toAmount, comment) {
//
var currentSpendUnconfirmed = config.spendUnconfirmed;
var send = function() {
if (!$scope._amount || !$scope._address) return;
var unitToSat = this.unitToSatoshi;
var currentSpendUnconfirmed = configWallet.spendUnconfirmed;
////
var wallet = $scope.wallet;
if (!wallet) {
$log.error('No wallet selected')
return;
};
var outputs = [];
this.resetError();
if (isCordova && this.isWindowsPhoneApp)
$rootScope.shouldHideMenuBar = true;
var form = $scope.sendForm;
var comment = form.comment.$modelValue;
var comment = $scope.comment;
var paypro = $scope.paypro;
// ToDo: use a credential's (or fc's) function for this
if (comment && !client.credentials.sharedEncryptingKey) {
if (comment && !wallet.credentials.sharedEncryptingKey) {
var msg = 'Could not add message to imported wallet without shared encrypting key';
$log.warn(msg);
return self.setSendError(gettext(msg));
return setSendError(gettext(msg));
}
if (form.amount.$modelValue * unitToSat > Number.MAX_SAFE_INTEGER) {
if (toAmount > Number.MAX_SAFE_INTEGER) {
var msg = 'Amount too big';
$log.warn(msg);
return self.setSendError(gettext(msg));
return setSendError(gettext(msg));
};
$timeout(function() {
var paypro = self._paypro;
var address, amount;
outputs.push({
'toAddress': toAddress,
'amount': toAmount,
'message': comment
});
address = form.address.$modelValue;
amount = parseInt((form.amount.$modelValue * unitToSat).toFixed(0));
var txp = {};
outputs.push({
'toAddress': address,
'amount': amount,
'message': comment
});
var txp = {};
if (!lodash.isEmpty(self.sendMaxInfo)) {
txp.sendMax = true;
txp.inputs = self.sendMaxInfo.inputs;
txp.fee = self.sendMaxInfo.fee;
} else {
txp.amount = amount;
}
txp.toAddress = address;
txp.outputs = outputs;
txp.message = comment;
txp.payProUrl = paypro ? paypro.url : null;
txp.excludeUnconfirmedUtxos = configWallet.spendUnconfirmed ? false : true;
txp.feeLevel = walletSettings.feeLevel || 'normal';
ongoingProcess.set('creatingTx', true);
walletService.createTx(client, txp, function(err, createdTxp) {
ongoingProcess.set('creatingTx', false);
if (err) {
return self.setSendError(err);
}
if (!client.canSign() && !client.isPrivKeyExternal()) {
$log.info('No signing proposal: No private key');
ongoingProcess.set('sendingTx', true);
walletService.publishTx(client, createdTxp, function(err, publishedTxp) {
ongoingProcess.set('sendingTx', false);
if (err) {
return self.setSendError(err);
}
self.resetForm();
go.walletHome();
var type = txStatus.notify(createdTxp);
$scope.openStatusModal(type, createdTxp, function() {
return $scope.$emit('Local/TxProposalAction');
});
});
// TODO
if (!lodash.isEmpty($scope.sendMaxInfo)) {
txp.sendMax = true;
txp.inputs = $scope.sendMaxInfo.inputs;
txp.fee = $scope.sendMaxInfo.fee;
} else {
$rootScope.$emit('Local/NeedsConfirmation', createdTxp, function(accept) {
if (accept) self.confirmTx(createdTxp);
else self.resetForm();
});
txp.amount = toAmount;
}
});
}, 100);
txp.toAddress = toAddress;
// txp.outputs = outputs;
txp.message = comment;
txp.payProUrl = paypro ? paypro.url : null;
txp.excludeUnconfirmedUtxos = config.spendUnconfirmed ? false : true;
txp.feeLevel = config.feeLevel || 'normal';
console.log('[confirm.js.100] creatingTx', wallet, txp); //TODO
walletService.createTx(wallet, txp, function(err, createdTxp) {
console.log('[confirm.js.102:createdTxp:]',err, createdTxp); //TODO
if (err) {
return setSendError(err);
}
$scope.fee = createdTxp.fee;
$scope.txp = createdTxp;
});
});
};
$scope.approve = function() {
var wallet = $scope.wallet;
var txp =$scope.txp;
if (!wallet) {
$log.error('No wallet selected')
return;
};
if (!txp) {
$log.error('No txp')
return;
};
if (!wallet.canSign() && !wallet.isPrivKeyExternal()) {
$log.info('No signing proposal: No private key');
// ongoingProcess.set('sendingTx', true);
walletService.publishTx(walelt, txp, function(err, publishedTxp) {
// ongoingProcess.set('sendingTx', false);
if (err) {
return setSendError(err);
}
// TODO
$state.transitionTo('tab.home');
// TODO
// var type = txStatus.notify(createdTxp);
// $scope.openStatusModal(type, createdTxp, function() {
// return $scope.$emit('Local/TxProposalAction');
// });
});
} else {
$rootScope.$emit('Local/NeedsConfirmation', txp, function(accept) {
if (accept) self.confirmTx(txp);
else self.resetForm();
});
}
};
function fromFiat(val) {
if (!rateService.isAvailable()) return;
return parseFloat((rateService.fromFiat(val, $scope.alternativeIsoCode) * satToUnit).toFixed(unitDecimals), 10);
};
function toFiat(val) {
if (!rateService.isAvailable()) return;
return parseFloat((rateService.toFiat(val * unitToSatoshi, $scope.alternativeIsoCode)).toFixed(2), 10);
};
@ -166,7 +214,10 @@ console.log('[confirm.js.23:$scope:]',$stateParams); //TODO
$scope.setWallets = function(network) {
$scope.wallets = profileService.getWallets({onlyComplete:true, network: network});
$scope.wallet = $scope.wallets[0];
};
});

View file

@ -1,11 +1,11 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesController',
function($scope, $rootScope, $timeout, $log, configService, profileService, fingerprintService, walletService) {
function($scope, $rootScope, $timeout, $log, $stateParams, configService, profileService, fingerprintService, walletService) {
var fc;
var config = configService.getSync();
console.log($stateParams);
var disableFocusListener = $rootScope.$on('Local/NewFocusedWalletReady', function() {
$scope.init();
});
@ -19,6 +19,11 @@ angular.module('copayApp.controllers').controller('preferencesController',
fc = profileService.focusedClient;
if (fc) {
$scope.backgroundColor = fc.color;
config.aliasFor = config.aliasFor || {};
$scope.walletName = fc.credentials.walletName;
$scope.alias = config.aliasFor[fc.credentials.walletId] || $scope.walletName;
$scope.encryptEnabled = walletService.isEncrypted(fc);
if (fc.isPrivKeyExternal)
$scope.externalSource = fc.getPrivKeyExternalSourceName() == 'ledger' ? 'Ledger' : 'Trezor';

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('tabHomeController',
function($rootScope, $timeout, $scope, lodash, profileService, walletService, configService ) {
function($rootScope, $timeout, $scope, $state, lodash, profileService, walletService, configService ) {
var self = this;
@ -34,4 +34,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
self.setWallets();
self.updateAllClients();
$scope.bitpayCardEnabled = true; // TODO
$state.transitionTo('confirm', {toAmount:555500, toAddress: 'mvfAwUJohJWibGzBZgAUGsDarsr4Z4NovU', toName: 'bla bla'});
});

View file

@ -84,8 +84,8 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
var wallet = profileService.getWallet($stateParams.walletId);
$scope.wallet = wallet;
if (wallet) {
profileService.setAndStoreFocus(wallet.id, function() {});
walletService.updateStatus(wallet, {}, function(err, status) {
if (err) {} // TODO
});

View file

@ -93,27 +93,43 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
}
})
.state('walletDetails', {
.state('wallet', {
url: '/wallet/{walletId}',
abstract: true,
needProfile: true,
views: {
'main': {
template: '<ui-view/>',
},
},
})
.state('wallet.details', {
url: '/details',
needProfile: true,
views: {
'main': {
templateUrl: 'views/walletDetails.html',
},
},
params: {
walletId: null,
},
templateUrl: 'views/walletDetails.html'
})
.state('walletHome', {
url: '/old',
.state('wallet.preferences', {
url: '/preferences',
needProfile: true,
views: {
'main': {
templateUrl: 'views/walletHome.html',
},
}
templateUrl: 'views/preferences.html'
})
.state('wallet.copayers', {
url: '/copayers',
needProfile: true,
cache: false,
templateUrl: 'views/copayers.html'
})
// OLD
// .state('walletHome', {
// url: '/old',
// needProfile: true,
// views: {
// 'main': {
// templateUrl: 'views/walletHome.html',
// },
// }
// })
.state('tabs', {
url: '/tabs',
cache: false,
@ -250,29 +266,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
},
}
})
.state('copayers', {
url: '/copayers',
needProfile: true,
cache: false,
views: {
'main': {
templateUrl: 'views/copayers.html'
},
},
params: {
walletId: null,
},
})
.state('preferences', {
url: '/preferences',
templateUrl: 'views/preferences.html',
needProfile: true,
views: {
'main': {
templateUrl: 'views/preferences.html',
},
}
})
.state('preferencesLanguage', {
url: '/preferencesLanguage',
needProfile: true,

View file

@ -4,6 +4,538 @@
*
*/
.walletHome h4.title {
padding: 0px 0 10px 15px;
margin: 5px 0 5px 0;
font-size: 16px;
}
.bitpay_card select {
margin: 5px 0 5px 0;
padding: 0 20px;
font-size: 16px;
width: auto;
border: none;
}
.bitpay_card select:focus {
background-color: transparent;
}
.preferences ul, .modal-content ul {
font-size: 14px;
background: white;
}
.preferences ul li {
padding: 16px 10px 16px 16px;
border-bottom: 1px solid #E9E9EC;
}
.addressbook-input, .disabled-input {
display: block;
margin-bottom: 1.5rem;
background-color: #E4E8EC;
padding-left: 0.5rem;
color: #2C3E50;
font-size: 13px;
height: 35px;
padding-top: 7px;
}
.alt-currency {
padding: 0.05rem 0.2rem;
border-radius: 2px;
font-size: 10px;
color: #fff;
font-weight: 700;
}
.sub-header {
background: #F1f3F5;
padding: 0.8rem;
overflow: hidden;
}
.status {
color: #FFFFFF;
background-color: #A02F23;
position: absolute;
left: 250px;
right: 0;
bottom: 0;
padding: 10px 1rem 10px 0.5rem;
z-index: 9;
font-size: 14px;
text-align: left;
line-height: 17px;
}
.status-first-line {
z-index: 9;
font-size: 16px;
}
.box-notification {
position: relative;
font-size: 12px;
padding: 0.5rem;
border-radius: 2px;
background: #FFFFFF;
.box-icon {
position: absolute;
top: 0;
left: 0;
color: white;
background-color: #1ABC9C;
padding: 0 0.5rem;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
height: 100%;
i {
position: relative;
top: 10%;
display: block;
}
&.error {
background-color: #ED4A43;
}
&.secondary {
background-color: #3498DB;
}
}
}
a.close-notification {
position: absolute;
top: -4px;
right: 10px;
font-size: 24px;
}
ul.tx-copayers {
background: #E4E8EC;
padding: 0.3rem 0.8rem;
margin-left: 0;
box-shadow: inset 0 1px 1px 0 rgba(10, 19, 28, 0.12);
border-radius: 0 0 3px 3px;
}
.tx-copayers li {
list-style: none;
padding: 0.3rem;
font-size: 12px;
&.bottom-line-copayers {
border-bottom: 1px solid #CAD2DA;
}
}
.last-transactions-content {
background: #fff;
padding: 0.8rem 1rem;
cursor: pointer;
border-bottom: 1px solid #E4E8EC;
}
.sign-action {
background: #E4E8EC;
width: 100%;
padding: 1rem;
text-align: center;
}
.icon-circle-active {
position: absolute;
bottom: 2px;
right: 2px;
}
.icon-sign {
padding: 0.2rem 0.3rem;
border-radius: 100%;
color: #fff;
font-size: 10px;
margin-top: 3px;
&.check {
background-color: #3FBC9C;
}
&.x {
background-color: #C0392B;
}
}
.circle-icon {
background: #fff;
border-radius: 100%;
padding: 1.5rem;
width: 80px;
height: 80px;
margin: 0 auto;
}
.date-message {
background-color: #213140;
border-radius: 3px;
font-size: 12px;
padding: 0.2rem 0.4rem;
color: #7A8C9E;
}
.input-note {
margin-top: -10px;
display: block;
margin-bottom: 1rem;
}
.send-note {
background-color: #F8F8FB;
padding: 10px;
span {
margin-bottom: 5px;
font-size: 12px;
color: #2C3E50;
}
}
.manage a {
text-transform: uppercase;
font-weight: 700;
color: #4B6178;
padding: 1.5rem 1rem;
display: block;
overflow: hidden;
span {
display: block;
margin-top: 8px;
float: left;
}
}
ul.manage li {
border-bottom: 1px solid #f1f3f5;
}
.manage a i.circle {
background-color: #4B6178;
width: 50px;
height: 50px;
padding: 0.65rem;
border-radius: 100%;
display: block;
font-size: 30px;
color: #fff;
float: left;
margin-right: 20px;
&.plus-fixed {
padding: 0.1rem 0.9rem;
}
}
.name-wallet {
font-size: 14px;
font-weight: 400;
padding-top: 0 !important;
line-height: 14px;
}
.release {
cursor: pointer;
cursor: hand;
background-color: #E9E9EC;
margin-top: -30px;
margin-bottom: 5px;
padding-top: 30px;
padding-bottom: 20px;
text-align: center;
text-color: #444;
span {
margin-left: 15px;
}
i {
margin-right: 15px;
}
}
.locked {
font-size: 11px;
color: #7A8C9E;
}
.tx-proposal i {
padding: .1rem .3rem;
background-color: #A5B2BF;
border-radius: 100%;
color: #fff;
&.active {
background-color: #A02F23;
}
}
.header-modal {
background: #fff;
width: 100%;
padding-top: 20px;
padding-bottom: 20px;
position: relative;
}
.ellipsis {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.wallet-selection.wallets {
background-color: #213140;
}
ul.wallet-selection.wallets {
margin: 0;
overflow: hidden;
}
.wallet-selection.wallets li {
overflow: hidden;
padding: 1rem;
a {
display: block;
}
}
.pointer {
cursor: pointer;
}
.icon-wallet {
display: block;
}
.walletHome .icon-wallet {
display: inline-block;
margin: 0;
vertical-align: baseline;
}
.secret {
overflow-wrap: break-word;
word-wrap: break-word;
text-align: center;
font-size: 14px;
margin: 10px;
}
.session-expired {
background: rgba(32, 48, 64, 0.9);
width: 100%;
height: 100%;
position: absolute;
color: #fff;
z-index: 999;
padding-top: 20%;
text-align: center;
padding-left: 10%;
padding-right: 10%;
}
.amount {
width: 100%;
text-align: center;
padding: 1.5rem 1rem 1.5rem 1rem;
color: #fff;
height: 150px;
margin-bottom: 25px;
}
.alternative-amount {
height: 25px;
text-align: center;
}
.wallet-info {
position: absolute;
top: inherit;
left: 10px;
bottom: 26px;
font-size: 20px;
color: #fff;
}
.camera-icon a {
background: #4B6178;
box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.5);
color: #fff;
display: block;
position: absolute;
padding: 15px 17px;
border-radius: 100%;
top: inherit;
right: 15px;
bottom: 2px;
line-height: 12px;
}
.send .camera-icon a {
top: inherit;
bottom: 0;
}
.popup-txsent {
position: absolute;
width: 100%;
height: 100%;
background: rgba(24, 44, 58, 0.9);
i {
font-size: 5rem;
color: #4A90E2;
border-radius: 100%;
border-color: #4A90E2;
border: 2px solid;
width: 150px;
height: 150px;
display: block;
text-align: center;
padding-top: 1rem;
}
}
.popup-txsigned i, .popup-txrejected i {
font-size: 5rem;
color: #4A90E2;
border-radius: 100%;
border-color: #4A90E2;
border: 2px solid;
width: 150px;
height: 150px;
display: block;
text-align: center;
padding-top: 1rem;
}
.payment-proposal-head {
color: #fff;
padding: 10px 10px 20px 10px;
text-align: center;
}
.payment-proposal-to {
width: 100%;
display: inline-block;
padding: 5px 15px;
background-color: rgba(0, 0, 0, 0.1);
i {
position: inherit;
left: 25px;
padding-right: 10px;
border-right: 1px solid;
border-color: rgba(255, 255, 255, 0.1);
font-size: 20px;
}
}
/* notifications */
.dr-notification-container {
position: absolute;
z-index: 10000;
width: 100%;
&.bottom {
bottom: 20px;
}
&.right {
right: 0;
}
&.left {
left: 20px;
}
&.top {
top: 45px;
}
&.center {
left: 50%;
margin-left: -190px;
}
}
.dr-notification-wrapper {
position: relative;
width: 100%;
margin: 0;
&.offline {
position: absolute;
top: 0px;
z-index: 2000;
opacity: 1.0 !important;
background-color: #2C3E50;
}
&.client-error {
position: absolute;
top: 45px;
z-index: 11;
}
}
.dr-notification-close-btn {
color: #A5B2BF;
border: 1px solid #A5B2BF;
border-radius: 100%;
display: inline-block;
padding: 0px 8px;
position: absolute;
right: 5px;
cursor: pointer;
z-index: 10;
margin: 14px 8px 0;
font-size: 20px;
}
.dr-notification-image {
float: left;
color: #fff;
text-align: center;
background-color: #213140;
width: 40px;
height: 40px;
font-size: 1.5rem;
border-radius: 100%;
margin: 0.6rem;
img {
margin: 15px;
max-width: 70px;
min-width: 48px;
}
}
.dr-notification-content {
line-height: 90%;
padding: 10px 50px 5px 60px;
}
.dr-notification-title {
color: #fff;
font-size: 12px;
margin-bottom: 0;
font-weight: 700;
}
.dr-notification {
background: rgba(44, 62, 80, 0.9);
box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.2);
width: 100%;
clear: both;
overflow: hidden;
border-radius: 0;
height: 60px;
}
.dr-notification-text {
font-size: 11px;
color: #fff;
}
// QR Code
@ -386,6 +918,18 @@
text-transform: lowercase;
}
.text-italic {
font-style: italic;
}
.text-light {
font-weight: 200;
}
.text-bold {
font-weight: 700;
}
/*
* Calculator
*/