resolved upstream merge

This commit is contained in:
Gordon Hall 2014-06-02 17:16:37 -04:00
commit 5e707ca411
6 changed files with 85 additions and 30 deletions

1
.gitignore vendored
View file

@ -40,7 +40,6 @@ lib/*
!lib/socket.io.js !lib/socket.io.js
js/copayBundle.js js/copayBundle.js
config.js
webapp/copay-webapp webapp/copay-webapp
webapp/download webapp/download

View file

@ -1,9 +1,8 @@
[![Build Status](https://secure.travis-ci.org/bitpay/copay.png)](http://travis-ci.org/bitpay/copay) [![Build Status](https://secure.travis-ci.org/bitpay/copay.png)](http://travis-ci.org/bitpay/copay)
Copay # Copay
=====
Installation: ## Installation:
``` ```
git clone https://github.com/bitpay/copay.git git clone https://github.com/bitpay/copay.git
@ -21,7 +20,6 @@ Build Copay:
npm install npm install
bower install bower install
grunt shell --target=dev grunt shell --target=dev
cp config.template.js config.js
``` ```
Open Copay: Open Copay:
@ -31,6 +29,8 @@ npm start
Then visit localhost:3000 in your browser. Then visit localhost:3000 in your browser.
## Running copay
To run on a different port: To run on a different port:
``` ```
PORT=3001 npm start PORT=3001 npm start
@ -45,9 +45,10 @@ PORT=3004 npm start
PORT=3005 npm start PORT=3005 npm start
``` ```
To open n different instances just run: To open n different instances more easily, just run:
``` ```
node launch.js n n=5
node launch.js $n &
``` ```
To require Copay as a module for use within you application: To require Copay as a module for use within you application:
@ -59,8 +60,14 @@ require('copay').start(3000, function(location) {
``` ```
About Copay
=========== ## Configuration
Default configuration can be found in the config.js file.
See config.js for more info on configuration options.
# About Copay
General General
------- -------

View file

@ -1,26 +1,44 @@
'use strict'; 'use strict';
var defaultConfig = { var defaultConfig = {
// livenet or testnet
networkName: 'testnet', networkName: 'testnet',
// wallet limits
limits: {
totalCopayers: 12,
mPlusN: 100
},
// network layer (PeerJS) config
network: { network: {
// key: 'lwjd5qra8257b9', //Copay API key for public PeerJS server // Use this to run your own local PeerJS server
// This is for running local peerJs with params: ./peerjs -p 10009 -k 'sdfjhwefh' // with params: ./peerjs -p 10009 -k '6d6d751ea61e26f2'
//key: 'sdfjhwefh', /*
//host: 'localhost', key: '6d6d751ea61e26f2',
//port: 10009, host: 'localhost',
//path: '/', port: 10009,
// path: '/',
key: 'satoshirocks', // api key for the peerjs server */
host: '162.242.219.26', // peerjs server
// Use this to connect to bitpay's PeerJS server
key: 'satoshirocks',
host: '162.242.219.26',
port: 80, port: 80,
path: '/', path: '/',
// other PeerJS config
maxPeers: 15, maxPeers: 15,
debug: 3, debug: 3,
// Network encryption config
sjclParams: { sjclParams: {
salt: 'mjuBtGybi/4=', // choose your own salt (base64) salt: 'mjuBtGybi/4=', // choose your own salt (base64)
iter: 1000, iter: 1000,
mode: 'ccm', mode: 'ccm',
ts: parseInt(64), ts: parseInt(64),
}, },
// PeerJS internal config object
config: { config: {
'iceServers': [ 'iceServers': [
// Pass in STUN and TURN servers for maximum network compatibility // Pass in STUN and TURN servers for maximum network compatibility
@ -78,28 +96,35 @@ var defaultConfig = {
] ]
} }
}, },
limits: {
totalCopayers: 12, // wallet default config
mPlusN: 100
},
wallet: { wallet: {
requiredCopayers: 2, requiredCopayers: 2,
totalCopayers: 3, totalCopayers: 3,
spendUnconfirmed: 1, spendUnconfirmed: 1,
verbose: 1, verbose: 1,
}, },
// blockchain service API config
blockchain: { blockchain: {
host: 'test.insight.is', host: 'test.insight.is',
port: 3001 port: 3001
}, },
// socket service API config
socket: { socket: {
host: 'test.insight.is', host: 'test.insight.is',
port: 3001 port: 3001
}, },
// local encryption/security config
passphrase: { passphrase: {
iterations: 100, iterations: 100,
storageSalt: 'mjuBtGybi/4=', storageSalt: 'mjuBtGybi/4=',
}, },
// theme list
themes: ['default'], themes: ['default'],
verbose: 1, verbose: 1,
}; };

View file

@ -73,6 +73,15 @@
</div> </div>
<div class="row" ng-if="updateVersion">
<div class="small-9 large-centered columns">
<div data-alert class="alert-box radius {{updateVersion}}">
A newer version of Copay is now available, please update your wallet to a latest version.
Please check <a href="http://www.copay.io">Copay.io</a>.
</div>
</div>
</div>
<div class="row" ng-if='$root.$flashMessage.message' notification> <div class="row" ng-if='$root.$flashMessage.message' notification>
<div class="small-8 large-centered columns"> <div class="small-8 large-centered columns">
<div data-alert class="alert-box radius {{$root.$flashMessage.type}}"> <div data-alert class="alert-box radius {{$root.$flashMessage.type}}">
@ -209,7 +218,7 @@
<h3>Join a Wallet in Creation</h3> <h3>Join a Wallet in Creation</h3>
<form name="joinForm" ng-submit="join(joinForm)" novalidate> <form name="joinForm" ng-submit="join(joinForm)" novalidate>
<input type="text" class="form-control" placeholder="Paste wallet secret here" name="connectionId" ng-model="connectionId" wallet-secret required> <input type="text" class="form-control" placeholder="Paste wallet secret here" name="connectionId" ng-model="connectionId" wallet-secret required>
<input type="password" class="form-control" placeholder="Choose your password" name="joinPassword" ng-model="joinPassword" check-strength="joinPassword" required> <input type="password" class="form-control" placeholder="Choose your password" name="joinPassword" ng-model="joinPassword" check-strength="passwordStrength" tooltip="Password strength: {{passwordStrength}}" tooltip-trigger="focus" required>
<input type="text" class="form-control" placeholder="Your name (optional)" name="nickname" ng-model="nickname"> <input type="text" class="form-control" placeholder="Your name (optional)" name="nickname" ng-model="nickname">
<button type="submit" class="button primary radius" ng-disabled="joinForm.$invalid || loading" loading="Joining">Join</button> <button type="submit" class="button primary radius" ng-disabled="joinForm.$invalid || loading" loading="Joining">Join</button>
</form> </form>
@ -300,7 +309,7 @@
<div class="small-12 medium-6 medium-centered large-6 large-centered columns m30v"> <div class="small-12 medium-6 medium-centered large-6 large-centered columns m30v">
<h6>Your Wallet Password<small>(doesn't need to be shared) Required</small></h6> <h6>Your Wallet Password<small>(doesn't need to be shared) Required</small></h6>
<input type="password" placeholder="Choose your password" class="form-control" <input type="password" placeholder="Choose your password" class="form-control"
ng-model="walletPassword" check-strength="walletPassword" required> ng-model="walletPassword" check-strength="passwordStrength" tooltip="Password strength: {{passwordStrength}}" tooltip-trigger="focus" required>
</div> </div>
<div class="small-12 medium-6 medium-centered large-6 large-centered columns m30v"> <div class="small-12 medium-6 medium-centered large-6 large-centered columns m30v">
<h6>Wallet name <small>Optional</small></h6> <h6>Wallet name <small>Optional</small></h6>
@ -725,6 +734,7 @@ on supported browsers please check <a href="http://www.webrtc.org/">http://www.w
<p class="text-center"><a href="#/">go back...</a></p> <p class="text-center"><a href="#/">go back...</a></p>
</script> </script>
<script src="config.js"></script> <script src="config.js"></script>
<script src="js/shell.js"></script> <script src="js/shell.js"></script>
<script src="lib/angular/angular.min.js"></script> <script src="lib/angular/angular.min.js"></script>

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copay.header').controller('HeaderController', angular.module('copay.header').controller('HeaderController',
function($scope, $rootScope, $location, $notification, walletFactory, controllerUtils) { function($scope, $rootScope, $location, $notification, $http, walletFactory, controllerUtils) {
$scope.menu = [ $scope.menu = [
{ {
'title': 'Addresses', 'title': 'Addresses',
@ -23,6 +23,18 @@ angular.module('copay.header').controller('HeaderController',
var beep = new Audio('sound/transaction.mp3'); var beep = new Audio('sound/transaction.mp3');
$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 = 'error';
} else if (currentVersion[0] == latestVersion[0] && currentVersion[1] < latestVersion[1]) {
$scope.updateVersion = 'info';
}
});
// Initialize alert notification (not show when init wallet) // Initialize alert notification (not show when init wallet)
$rootScope.txAlertCount = 0; $rootScope.txAlertCount = 0;
$rootScope.$watch('txAlertCount', function(txAlertCount) { $rootScope.$watch('txAlertCount', function(txAlertCount) {

View file

@ -124,7 +124,7 @@ angular.module('copay.directives')
return { return {
replace: false, replace: false,
restrict: 'EACM', restrict: 'EACM',
scope: { model: '=checkStrength' }, require: 'ngModel',
link: function(scope, element, attrs) { link: function(scope, element, attrs) {
var _grep = function(elems, callback, invert) { var _grep = function(elems, callback, invert) {
var callbackInverse, var callbackInverse,
@ -146,6 +146,7 @@ angular.module('copay.directives')
}; };
var strength = { var strength = {
messages: ['too weak', 'weak', 'weak', 'medium', 'strong'],
colors: ['#c0392b', '#e74c3c', '#d35400', '#f39c12', '#27ae60'], colors: ['#c0392b', '#e74c3c', '#d35400', '#f39c12', '#27ae60'],
mesureStrength: function (p) { mesureStrength: function (p) {
var _force = 0; var _force = 0;
@ -178,14 +179,15 @@ angular.module('copay.directives')
else if (s <= 40) { idx = 3; } else if (s <= 40) { idx = 3; }
else { idx = 4; } else { idx = 4; }
return { idx: idx + 1, col: this.colors[idx] }; return { idx: idx + 1, col: this.colors[idx], message: this.messages[idx] };
} }
}; };
scope.$watch('model', function (newValue, oldValue) { scope.$watch(attrs.ngModel, function (newValue, oldValue) {
if (newValue && newValue !== '') { if (newValue && newValue !== '') {
var c = strength.getColor(strength.mesureStrength(newValue)); var c = strength.getColor(strength.mesureStrength(newValue));
element.css({ 'border-color': c.col }) element.css({ 'border-color': c.col });
scope[attrs.checkStrength] = c.message;
} }
}); });
} }