From 59299df2e329cad86c43c7375f111bb950dd6d43 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Tue, 6 May 2014 11:42:09 -0300 Subject: [PATCH 1/4] Fix CSS for buttons --- css/tpl-default.css | 93 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 85 insertions(+), 8 deletions(-) diff --git a/css/tpl-default.css b/css/tpl-default.css index a08c5e5ad..479a19bb5 100644 --- a/css/tpl-default.css +++ b/css/tpl-default.css @@ -168,17 +168,94 @@ button.radius, .button.radius { border-radius: 5px; } -button.primary, button.secondary, button.primary:hover, button.secondary:hover {color: #fff !important;} +/* SECONDARY */ +button.secondary, +.button.secondary { + background-color: #1ABC9C; + color: #fff; +} +button.secondary:hover, +button.secondary:focus, +.button.secondary:hover, +.button.secondary:focus { + background-color: #16A085; + color: #e6e6e6; +} +button.disabled.secondary, +button[disabled].secondary, +.button.disabled.secondary, +.button[disabled].secondary, +button.disabled.secondary:hover, +button.disabled.secondary:focus, +button[disabled].secondary:hover, +button[disabled].secondary:focus, +.button.disabled.secondary:hover, +.button.disabled.secondary:focus, +.button[disabled].secondary:hover, +.button[disabled].secondary:focus { + background-color: #1ABC9C; + color: #E6E6E6; +} -button.primary { background-color: #E67E22; } -button.secondary { background-color: #1ABC9C !important; } -button.warning { background-color: #C0392A; } +/* PRIMARY */ +button.primary, +.button.primary { + background-color: #E67E22; + color: #fff; +} +button.primary:hover, +button.primary:focus, +.button.primary:hover, +.button.primary:focus { + background-color: #D86601; + color: #e6e6e6; +} +button.disabled.primary, +button[disabled].primary, +.button.disabled.primary, +.button[disabled].primary, +button.disabled.primary:hover, +button.disabled.primary:focus, +button[disabled].primary:hover, +button[disabled].primary:focus, +.button.disabled.primary:hover, +.button.disabled.primary:focus, +.button[disabled].primary:hover, +.button[disabled].primary:focus { + background-color: #E67E22; + color: #E6E6E6; +} -button.primary:hover { background-color: #D86601;} -button.secondary:hover { background-color: #16A085 !important;} -button.warning:hover { background-color: #82251A; } +/* WARNING */ +button.warning, +.button.warning { + background-color: #C0392A; + color: #fff; +} +button.warning:hover, +button.warning:focus, +.button.warning:hover, +.button.warning:focus { + background-color: #82251A; + color: #e6e6e6; +} +button.disabled.warning, +button[disabled].warning, +.button.disabled.warning, +.button[disabled].warning, +button.disabled.warning:hover, +button.disabled.warning:focus, +button[disabled].warning:hover, +button[disabled].warning:focus, +.button.disabled.warning:hover, +.button.disabled.warning:focus, +.button[disabled].warning:hover, +.button[disabled].warning:focus { + background-color: #C0392A; + color: #E6E6E6; +} -.text-gray { color: #999 !important;} +.text-gray { color: #999;} #footer { background: #2C3E50; From a4c16a94a595bb99a08e57e5c4f442ec9adf2fa3 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Tue, 6 May 2014 14:39:16 -0300 Subject: [PATCH 2/4] Signin page: * Swap places for "join" and "create/open" (#285). * Prevent the user not set the password and required fields (#280). --- css/main.css | 3 --- index.html | 42 +++++++++++++++++++++++----------------- js/controllers/signin.js | 36 ++++++++++++++++++++++------------ 3 files changed, 48 insertions(+), 33 deletions(-) diff --git a/css/main.css b/css/main.css index 6108e8a29..779713c4f 100644 --- a/css/main.css +++ b/css/main.css @@ -267,9 +267,6 @@ hr { margin: 2.25rem 0;} .lh {line-height: 0;} .oh {overflow:hidden;} .lh {line-height: 0;} -.signin input.ng-dirty.ng-invalid { - border: 2px red solid; -} .video-small { width: 80px; diff --git a/index.html b/index.html index 9994794a6..8d308e0d6 100644 --- a/index.html +++ b/index.html @@ -143,38 +143,44 @@
-
- -
-
+
+
+ +
diff --git a/js/controllers/signin.js b/js/controllers/signin.js index 04eedc1c7..6eee392b0 100644 --- a/js/controllers/signin.js +++ b/js/controllers/signin.js @@ -7,25 +7,37 @@ angular.module('copay.signin').controller('SigninController', $scope.selectedWalletId = $scope.wallets.length ? $scope.wallets[0].id : null; $scope.openPassword = ''; - $scope.create = function() { - $scope.loading = true; + $scope.create = function(form) { + if (form) { + if (form.$invalid) { + $rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'}; + return; + } - $rootScope.walletName = $scope.walletName; - $rootScope.walletPassword = $scope.createPassword; + $rootScope.walletName = form.walletName.$modelValue; + $rootScope.walletPassword = form.createPassword.$modelValue; + } $location.path('setup'); }; - $scope.open = function() { - if ($scope.openPassword != '') { - $scope.loading = true; - - var passphrase = Passphrase.getBase64($scope.openPassword); - var w = walletFactory.open($scope.selectedWalletId, { passphrase: passphrase}); - controllerUtils.startNetwork(w); + $scope.open = function(form) { + if (form.$invalid) { + $rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'}; + return; } + $scope.loading = true; + var password = form.openPassword.$modelValue; + + var passphrase = Passphrase.getBase64(password); + var w = walletFactory.open($scope.selectedWalletId, { passphrase: passphrase}); + controllerUtils.startNetwork(w); }; - $scope.join = function() { + $scope.join = function(form) { + if (form.$invalid) { + $rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'}; + return; + } $scope.loading = true; walletFactory.network.on('badSecret', function() { From ee6220ea0a5a4d9fa0d35653202f1a6a95f89ea5 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Tue, 6 May 2014 14:46:26 -0300 Subject: [PATCH 3/4] Fixes link and controller signin --- index.html | 2 +- js/controllers/signin.js | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 8d308e0d6..7f5ca539d 100644 --- a/index.html +++ b/index.html @@ -180,7 +180,7 @@
diff --git a/js/controllers/signin.js b/js/controllers/signin.js index 6eee392b0..4086e5424 100644 --- a/js/controllers/signin.js +++ b/js/controllers/signin.js @@ -8,20 +8,18 @@ angular.module('copay.signin').controller('SigninController', $scope.openPassword = ''; $scope.create = function(form) { - if (form) { - if (form.$invalid) { - $rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'}; - return; - } - - $rootScope.walletName = form.walletName.$modelValue; - $rootScope.walletPassword = form.createPassword.$modelValue; + if (form && form.$invalid) { + $rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'}; + return; } + + $rootScope.walletName = form.walletName.$modelValue; + $rootScope.walletPassword = form.createPassword.$modelValue; $location.path('setup'); }; $scope.open = function(form) { - if (form.$invalid) { + if (form && form.$invalid) { $rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'}; return; } @@ -34,7 +32,7 @@ angular.module('copay.signin').controller('SigninController', }; $scope.join = function(form) { - if (form.$invalid) { + if (form && form.$invalid) { $rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'}; return; } From ceb97b29e66e290996fe0665972ec4dd494736e0 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Tue, 6 May 2014 15:06:37 -0300 Subject: [PATCH 4/4] Password required when create new wallet (#284). --- index.html | 11 ++++++----- js/controllers/setup.js | 7 ++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 7f5ca539d..290761b4b 100644 --- a/index.html +++ b/index.html @@ -209,6 +209,7 @@ Creating new wallet...
+
@@ -232,27 +233,27 @@
-
Wallet Password
+
Wallet Password Required
-
Wallet name (optional)
+
Wallet name Optional
-
Your name (optional)
+
Your name Optional
- Go back
+
diff --git a/js/controllers/setup.js b/js/controllers/setup.js index 1da4404e4..bd5116dad 100644 --- a/js/controllers/setup.js +++ b/js/controllers/setup.js @@ -32,7 +32,12 @@ angular.module('copay.setup').controller('SetupController', updateRCSelect(tc); }); - $scope.create = function() { + $scope.create = function(form) { + if (form && form.$invalid) { + $rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'}; + return; + } + $scope.loading = true; var passphrase = Passphrase.getBase64($scope.walletPassword);