From c25e7eb00f891df3645637c8c7e0663ad933207e Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Fri, 28 Mar 2014 11:17:46 -0400 Subject: [PATCH 1/6] rename cosign -> copay We got a cease & desist letter for the name "cosign". We are renaming to copay, which does not have any relevant trademarks registered and for which we own the domain name copay.io. --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index bac19d810..518fd6aac 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "cosign", + "name": "copay", "version": "0.0.1", "description": "A multisignature wallet", "repository": { "type": "git", - "url": "git://github.com/bitpay/cosign.git" + "url": "git://github.com/bitpay/copay.git" }, "keywords": [ "wallet", @@ -15,9 +15,9 @@ "author": "", "license": "MIT", "bugs": { - "url": "https://github.com/bitpay/cosign/issues" + "url": "https://github.com/bitpay/copay/issues" }, - "homepage": "https://github.com/bitpay/cosign", + "homepage": "https://github.com/bitpay/copay", "devDependencies": { "grunt-cli": "~0.1.13", "karma": "~0.12.1", From 4168a67b815b199b1b01a37a72bbcd108e29c591 Mon Sep 17 00:00:00 2001 From: Bechi Date: Fri, 28 Mar 2014 12:32:29 -0300 Subject: [PATCH 2/6] header + navbar --- css/main.css | 47 +++++++++++++++++++++++++++++++++++++++++++++++ index.html | 40 +++++++++++++++++++++++++++++++--------- 2 files changed, 78 insertions(+), 9 deletions(-) diff --git a/css/main.css b/css/main.css index e69de29bb..3bfc0ee84 100644 --- a/css/main.css +++ b/css/main.css @@ -0,0 +1,47 @@ +* { + font-family: 'Ubuntu', Helvetica, sans-serif !important; +} + +body { + background: #F5F5F5; +} + +.top-bar-section li:not(.has-form) a:not(.button) { + line-height: 60px; + background: #FAE448; +} + +.top-bar-section li.active:not(.has-form) a:not(.button) { + line-height: 60px; + background: #f5f5f5; + color: #111; + font-weight: 700; +} + +.top-bar-section li.active:not(.has-form) a:not(.button):hover, .top-bar-section li:not(.has-form) a:not(.button):hover { + background: #111; + color: white; +} + +.top-bar-section ul li>a { + color: #111; + text-transform: uppercase; + font-weight: 100; + font-size: 0.9rem; +} + +.header { + background: #111; + margin: 0!important; + overflow: hidden; + color: white; +} + +.header-content { + padding: 1.5rem; +} + +.header h1, h5 { + color: #fff; +} + diff --git a/index.html b/index.html index 5fef686d4..65bacef28 100644 --- a/index.html +++ b/index.html @@ -7,22 +7,44 @@ cosign - Multisignature Wallet + -
-
-

cosign

- +
+
+
+

Copay

+
+
Company Funds
+

4.324 BTC +

+
+ +
-
+
+ - @@ -196,7 +212,7 @@ - + diff --git a/js/app.js b/js/app.js index 1889b53ba..56fc11cde 100644 --- a/js/app.js +++ b/js/app.js @@ -11,7 +11,7 @@ angular.module('copay',[ 'copay.backup', 'copay.network', 'copay.signin', - 'copay.join' + 'copay.peer' ]); angular.module('copay.header', []); @@ -21,5 +21,5 @@ angular.module('copay.send', []); angular.module('copay.backup', []); angular.module('copay.network', []); angular.module('copay.signin', []); -angular.module('copay.join', []); +angular.module('copay.peer', []); diff --git a/js/config.js b/js/config.js index d124cc2f2..3793d88bd 100644 --- a/js/config.js +++ b/js/config.js @@ -18,6 +18,9 @@ angular .when('/join/:id', { templateUrl: 'join.html' }) + .when('/peer', { + templateUrl: 'peer.html' + }) .when('/transactions', { templateUrl: 'transactions.html' }) diff --git a/js/controllers/header.js b/js/controllers/header.js index 80faae040..d6956a62e 100644 --- a/js/controllers/header.js +++ b/js/controllers/header.js @@ -1,10 +1,10 @@ 'use strict'; angular.module('copay.header').controller('HeaderController', - function($scope, $rootScope, $location) { + function($scope, $rootScope, $location, Network) { $scope.menu = [{ 'title': 'Home', - 'link': '#/' + 'link': '#/home' }, { 'title': 'Transactions', 'link': '#/transactions' @@ -16,6 +16,10 @@ angular.module('copay.header').controller('HeaderController', 'link': '#/backup' }]; + if (!$rootScope.peerId) { + $location.path('signin'); + } + $scope.isActive = function(item) { if (item.link.replace('#','') == $location.path()) { return true; @@ -29,7 +33,7 @@ angular.module('copay.header').controller('HeaderController', $scope.signout = function() { $rootScope.isLogged = false; - + Network.disconnect(); $location.path('signin'); }; }); diff --git a/js/controllers/home.js b/js/controllers/home.js index 54a2356e4..f75a35af8 100644 --- a/js/controllers/home.js +++ b/js/controllers/home.js @@ -6,6 +6,10 @@ angular.module('copay.home').controller('HomeController', $scope.oneAtATime = true; + if (!$rootScope.peerId) { + $location.path('signin'); + } + $scope.addrs = [ { addrStr: 'n3zUqNR7Bbbc4zJhPVj1vG2Lx66K3Xhzvb'}, { addrStr: 'my9wnLwwUrwpNfEgSrWY62ymEGf1edKf4J'} diff --git a/js/controllers/join.js b/js/controllers/join.js deleted file mode 100644 index 88d19932d..000000000 --- a/js/controllers/join.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -angular.module('copay.join').controller('JoinController', - function($scope, $rootScope, $routeParams, Network) { - - $scope.connectionId = $routeParams.id; - $scope.copayers = []; - - $scope.init = function() { - console.log('-------- init --------'); - console.log($rootScope.peerId); - $scope.copayers.push($rootScope.peerId); - - Network.connect($scope.connectionId, function(copayer) { - console.log('----- join connect --------'); - console.log(copayer); - $scope.copayers.push(copayer); - $scope.$digest(); - }); - }; - }); diff --git a/js/controllers/peer.js b/js/controllers/peer.js new file mode 100644 index 000000000..b86e6c1dc --- /dev/null +++ b/js/controllers/peer.js @@ -0,0 +1,13 @@ +'use strict'; + +angular.module('copay.peer').controller('PeerController', + function($scope, $rootScope, $location, $routeParams, Network) { + + $scope.init = function() { + Network.connect($rootScope.connectionId, function(copayer) { + console.log(copayer); + console.log($rootScope.copayers); + }); + }; + }); + diff --git a/js/controllers/send.js b/js/controllers/send.js index 913bff704..737b04af8 100644 --- a/js/controllers/send.js +++ b/js/controllers/send.js @@ -3,4 +3,9 @@ angular.module('copay.send').controller('SendController', function($scope, $rootScope, $location) { $scope.title = 'Send'; + + if (!$rootScope.peerId) { + $location.path('signin'); + } + }); diff --git a/js/controllers/signin.js b/js/controllers/signin.js index ae2a89e51..731e03e73 100644 --- a/js/controllers/signin.js +++ b/js/controllers/signin.js @@ -2,23 +2,36 @@ angular.module('copay.signin').controller('SigninController', function($scope, $rootScope, $location, Network) { + $scope.loading = false; $rootScope.peerId = null; - $scope.peerReady = false; - - // Init peer - Network.init(function(pid) { - $rootScope.peerId = pid; - $rootScope.$digest(); - - $scope.peerReady = true; - $scope.$digest(); - }); + $rootScope.copayers = []; + + $scope.create = function() { + $scope.loading = true; + Network.init(function(pid) { + $rootScope.copayers.push(pid); + $location.path('peer'); + }); + }; $scope.join = function(cid) { - console.log('------- join --------'); - console.log(cid); + $scope.loading = true; + $rootScope.connectionId = cid; + Network.init(function(pid) { + + console.log('------- join --------'); + console.log(pid); + + $rootScope.copayers.push(pid); + + Network.connect(cid, function(copayer) { + console.log('----- join master --------'); + console.log(copayer); + $rootScope.copayers.push(copayer); + + $location.path('peer'); + }); + }); - var pid = cid || $rootScope.peerId; - $location.path('join/' + pid); }; }); diff --git a/js/controllers/transactions.js b/js/controllers/transactions.js index 7a2af271d..1af4cf9a6 100644 --- a/js/controllers/transactions.js +++ b/js/controllers/transactions.js @@ -6,6 +6,10 @@ angular.module('copay.transactions').controller('TransactionsController', $scope.oneAtATime = true; + if (!$rootScope.peerId) { + $location.path('signin'); + } + $scope.txsinput = [ { fromAddr: "n3zUqNR7Bbbc4zJhPVj1vG2Lx66K3Xhzvb", diff --git a/js/services/network.js b/js/services/network.js index 4a610709c..a94948400 100644 --- a/js/services/network.js +++ b/js/services/network.js @@ -6,14 +6,15 @@ angular.module('copay.network') return 2; }; }) - .factory('Network', function() { + .factory('Network', function($rootScope) { var peer; var connectedPeers = {}; var _onConnect = function(c, cb) { if (c.label === 'wallet') { var a = peer.connections[c.peer][0]; - console.log(peer.connections[c.peer]); + console.log(peer.connections[c.peer][0]); + console.log(a); a.send('------ origin recived -------'); c.on('data', function(data) { @@ -43,7 +44,12 @@ angular.module('copay.network') debug: 3 }); - peer.on('open', cb); + peer.on('open', function() { + $rootScope.peerId = peer.id; + $rootScope.peerReady = true; + cb(peer.id); + $rootScope.$digest(); + }); }; var _connect = function(pid, cb) { @@ -59,17 +65,18 @@ angular.module('copay.network') }); c.on('open', function() { - c.send('-------oopen-------'); + c.send('-------open-------'); }); c.on('data', function(data) { if (data) - console.log(data); + console.log('Data:' + data); }); c.on('error', function(err) { console.error(err); }); + cb(c.peer); }; var _sendTo = function(pid, data) { @@ -81,10 +88,17 @@ angular.module('copay.network') console.log(data); }; + var _disconnect = function() { + peer.disconnect(); + peer.destroy(); + console.log('Disconnected and destroyed connection'); + } + return { init: _init, connect: _connect, - sendTo: _sendTo + sendTo: _sendTo, + disconnect: _disconnect } }); From 6d146f436f7c4f8b0072c98cffa0e5badb1df376 Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Mon, 31 Mar 2014 12:10:11 -0400 Subject: [PATCH 6/6] Change tabs to spaces in CSS --- css/main.css | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/css/main.css b/css/main.css index bdf1ccfa9..00a68a3bd 100644 --- a/css/main.css +++ b/css/main.css @@ -1,49 +1,49 @@ * { - font-family: Helvetica, sans-serif !important; + font-family: Helvetica, sans-serif !important; } body { - background: #F5F5F5; + background: #F5F5F5; } .top-bar-section li:not(.has-form) a:not(.button) { - line-height: 60px; - background: #FAE448; + line-height: 60px; + background: #FAE448; } .top-bar-section li.active:not(.has-form) a:not(.button) { - line-height: 60px; - background: #f5f5f5; - color: #111; - font-weight: 700; + line-height: 60px; + background: #f5f5f5; + color: #111; + font-weight: 700; } .top-bar-section li.active:not(.has-form) a:not(.button):hover, .top-bar-section li:not(.has-form) a:not(.button):hover { - background: #111; - color: white; + background: #111; + color: white; } .top-bar-section ul li>a { - color: #111; - text-transform: uppercase; - font-weight: 100; - font-size: 0.9rem; + color: #111; + text-transform: uppercase; + font-weight: 100; + font-size: 0.9rem; } .header { - background: #111; - color: white; + background: #111; + color: white; overflow: hidden; margin-bottom: 30px; } .header-content { - padding: 1.5rem; - overflow: hidden; + padding: 1.5rem; + overflow: hidden; } .header h1, h5 { - color: #fff; + color: #fff; } .size-12 { font-size: 12px; }