diff --git a/public/views/buyAmazon.html b/public/views/buyAmazon.html
index efdcba473..1eb985b1a 100644
--- a/public/views/buyAmazon.html
+++ b/public/views/buyAmazon.html
@@ -49,7 +49,7 @@
min="0.01"
max="500"
ng-model="fiat"
- autocomplete="off" required>
+ autocomplete="off" ignore-mouse-wheel required>
USD
diff --git a/public/views/buyAndSell.html b/public/views/buyAndSell.html
index 597a8c73c..03e1e09c9 100644
--- a/public/views/buyAndSell.html
+++ b/public/views/buyAndSell.html
@@ -2,7 +2,7 @@
Buy and sell
@@ -10,11 +10,11 @@
-
+
-
+
diff --git a/public/views/includes/menu-toggle.html b/public/views/includes/menu-toggle.html
deleted file mode 100644
index dcb1b5cff..000000000
--- a/public/views/includes/menu-toggle.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/public/views/tab-home.html b/public/views/tab-home.html
index 1b1d41471..22683a023 100644
--- a/public/views/tab-home.html
+++ b/public/views/tab-home.html
@@ -61,7 +61,7 @@
+ ui-sref="wallet.details({'walletId': item.id})">
{{item.name || item.id}}
@@ -81,20 +81,17 @@
Next steps
- -
+
-
BitPay Card
- -
+
-
Buy and Sell
- -
+
-
Gift Cards
-
- bla bla
-
diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js
index a7ab420f9..7ee23f697 100644
--- a/src/js/controllers/tab-send.js
+++ b/src/js/controllers/tab-send.js
@@ -1,6 +1,6 @@
'use strict';
-angular.module('copayApp.controllers').controller('tabSendController', function($scope, $ionicModal, $log, $timeout, addressbookService, profileService, configService, lodash, $state, walletService) {
+angular.module('copayApp.controllers').controller('tabSendController', function($scope, $ionicModal, $log, $timeout, addressbookService, profileService, lodash, $state, walletService) {
var originalList;
diff --git a/src/js/directives/directives.js b/src/js/directives/directives.js
index b095dda5c..285df5fd4 100644
--- a/src/js/directives/directives.js
+++ b/src/js/directives/directives.js
@@ -1,22 +1,6 @@
'use strict';
-
-function selectText(element) {
- var doc = document;
- if (doc.body.createTextRange) { // ms
- var range = doc.body.createTextRange();
- range.moveToElementText(element);
- range.select();
- } else if (window.getSelection) {
- var selection = window.getSelection();
- var range = doc.createRange();
- range.selectNodeContents(element);
- selection.removeAllRanges();
- selection.addRange(range);
-
- }
-}
angular.module('copayApp.directives')
- .directive('validAddress', ['$rootScope', 'bitcore',
+ .directive('validAddress', ['$rootScope', 'bitcore',
function($rootScope, bitcore) {
return {
require: 'ngModel',
@@ -24,10 +8,6 @@ angular.module('copayApp.directives')
var URI = bitcore.URI;
var Address = bitcore.Address
var validator = function(value) {
- var networkName = attrs.networkName;
-
- if (!networkName)
- throw 'validAddress should provide network name';
// Regular url
if (/^https?:\/\//.test(value)) {
@@ -37,13 +17,14 @@ angular.module('copayApp.directives')
// Bip21 uri
if (/^bitcoin:/.test(value)) {
- var uri, isAddressValid;
+ var uri, isAddressValidLivenet, isAddressValidTestnet;
var isUriValid = URI.isValid(value);
if (isUriValid) {
uri = new URI(value);
- isAddressValid = Address.isValid(uri.address.toString(), networkName)
+ isAddressValidLivenet = Address.isValid(uri.address.toString(), 'livenet')
+ isAddressValidTestnet = Address.isValid(uri.address.toString(), 'testnet')
}
- ctrl.$setValidity('validAddress', isUriValid && isAddressValid);
+ ctrl.$setValidity('validAddress', isUriValid && (isAddressValidLivenet || isAddressValidTestnet));
return value;
}
@@ -53,34 +34,13 @@ angular.module('copayApp.directives')
}
// Regular Address
- ctrl.$setValidity('validAddress', Address.isValid(value, networkName));
+ var regularAddressLivenet = Address.isValid(value, 'livenet');
+ var regularAddressTestnet = Address.isValid(value, 'testnet');
+ ctrl.$setValidity('validAddress', (regularAddressLivenet || regularAddressTestnet));
return value;
};
- ctrl.$parsers.unshift(validator);
- ctrl.$formatters.unshift(validator);
- }
- };
- }
- ])
- .directive('validUrl', [
-
- function() {
- return {
- require: 'ngModel',
- link: function(scope, elem, attrs, ctrl) {
- var validator = function(value) {
- // Regular url
- if (/^https?:\/\//.test(value)) {
- ctrl.$setValidity('validUrl', true);
- return value;
- } else {
- ctrl.$setValidity('validUrl', false);
- return value;
- }
- };
-
ctrl.$parsers.unshift(validator);
ctrl.$formatters.unshift(validator);
}
@@ -143,23 +103,6 @@ angular.module('copayApp.directives')
}
};
})
- .directive('loading', function() {
- return {
- restrict: 'A',
- link: function($scope, element, attr) {
- var a = element.html();
- var text = attr.loading;
- element.on('click', function() {
- element.html(' ' + text + '...');
- });
- $scope.$watch('loading', function(val) {
- if (!val) {
- element.html(a);
- }
- });
- }
- }
- })
.directive('ngFileSelect', function() {
return {
link: function($scope, el) {
@@ -187,147 +130,6 @@ angular.module('copayApp.directives')
};
}
])
- .directive('highlightOnChange', function() {
- return {
- restrict: 'A',
- link: function(scope, element, attrs) {
- scope.$watch(attrs.highlightOnChange, function(newValue, oldValue) {
- element.addClass('highlight');
- setTimeout(function() {
- element.removeClass('highlight');
- }, 500);
- });
- }
- }
- })
- .directive('checkStrength', function() {
- return {
- replace: false,
- restrict: 'EACM',
- require: 'ngModel',
- link: function(scope, element, attrs) {
-
- var MIN_LENGTH = 8;
- var MESSAGES = ['Very Weak', 'Very Weak', 'Weak', 'Medium', 'Strong', 'Very Strong'];
- var COLOR = ['#dd514c', '#dd514c', '#faa732', '#faa732', '#16A085', '#16A085'];
-
- function evaluateMeter(password) {
- var passwordStrength = 0;
- var text;
- if (password.length > 0) passwordStrength = 1;
- if (password.length >= MIN_LENGTH) {
- if ((password.match(/[a-z]/)) && (password.match(/[A-Z]/))) {
- passwordStrength++;
- } else {
- text = ', add mixed case';
- }
- if (password.match(/\d+/)) {
- passwordStrength++;
- } else {
- if (!text) text = ', add numerals';
- }
- if (password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)) {
- passwordStrength++;
- } else {
- if (!text) text = ', add punctuation';
- }
- if (password.length > 12) {
- passwordStrength++;
- } else {
- if (!text) text = ', add characters';
- }
- } else {
- text = ', that\'s short';
- }
- if (!text) text = '';
-
- return {
- strength: passwordStrength,
- message: MESSAGES[passwordStrength] + text,
- color: COLOR[passwordStrength]
- }
- }
-
- scope.$watch(attrs.ngModel, function(newValue, oldValue) {
- if (newValue && newValue !== '') {
- var info = evaluateMeter(newValue);
- scope[attrs.checkStrength] = info;
- }
- });
- }
- };
- })
- .directive('showFocus', function($timeout) {
- return function(scope, element, attrs) {
- scope.$watch(attrs.showFocus,
- function(newValue) {
- $timeout(function() {
- newValue && element[0].focus();
- });
- }, true);
- };
- })
- .directive('match', function() {
- return {
- require: 'ngModel',
- restrict: 'A',
- scope: {
- match: '='
- },
- link: function(scope, elem, attrs, ctrl) {
- scope.$watch(function() {
- return (ctrl.$pristine && angular.isUndefined(ctrl.$modelValue)) || scope.match === ctrl.$modelValue;
- }, function(currentValue) {
- ctrl.$setValidity('match', currentValue);
- });
- }
- };
- })
- .directive('clipCopy', function() {
- return {
- restrict: 'A',
- scope: {
- clipCopy: '=clipCopy'
- },
- link: function(scope, elm) {
- // TODO this does not work (FIXME)
- elm.attr('tooltip', 'Press Ctrl+C to Copy');
- elm.attr('tooltip-placement', 'top');
-
- elm.bind('click', function() {
- selectText(elm[0]);
- });
- }
- };
- })
- .directive('menuToggle', function() {
- return {
- restrict: 'E',
- replace: true,
- templateUrl: 'views/includes/menu-toggle.html'
- }
- })
- .directive('logo', function() {
- return {
- restrict: 'E',
- scope: {
- width: "@",
- negative: "="
- },
- controller: function($scope) {
- $scope.logo_url = $scope.negative ? 'img/logo-negative.svg' : 'img/logo.svg';
- },
- replace: true,
- template: '
'
- }
- })
- .directive('availableBalance', function() {
- return {
- restrict: 'E',
- replace: true,
- templateUrl: 'views/includes/available-balance.html'
- }
- })
.directive('ignoreMouseWheel', function($rootScope, $timeout) {
return {
restrict: 'A',
diff --git a/src/sass/main.scss b/src/sass/main.scss
index b18dc6db2..98f4b1235 100644
--- a/src/sass/main.scss
+++ b/src/sass/main.scss
@@ -1045,3 +1045,13 @@ input[type="number"] {
.calculator .button-calc .columns { padding: 20px; }
.calculator .header-calc { top: 18%; }
}
+
+/* Turn Off Number Input Spinners */
+
+input[type=number] {
+ &::-webkit-inner-spin-button, &::-webkit-outer-spin-button {
+ -webkit-appearance: none;
+ margin: 0;
+ }
+}
+