Skip to content

Commit

Permalink
Convert to using a directive instead of regex
Browse files Browse the repository at this point in the history
jshint updates

Rename usock_exception
  • Loading branch information
hoffmabc committed May 31, 2015
1 parent 0ea077a commit b39e8d5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
11 changes: 5 additions & 6 deletions html/directives/validateBitcoinAddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ angular.module('app').directive("validateBitcoinAddress", function() {
link: function(scope, ele, attrs, ctrl) {

ctrl.$parsers.unshift(function(value) {
if(value){
// test and set the validity after update.
var valid = window.bitcoinAddress.validate(value);
ctrl.$setValidity('validateBitcoinAddress', valid);
}

// test and set the validity after update.
var valid = window.bitcoinAddress.validate(value);
ctrl.$setValidity('validateBitcoinAddress', valid);

// if it's valid, return the value to the model,
// otherwise return undefined.
Expand All @@ -25,6 +24,6 @@ angular.module('app').directive("validateBitcoinAddress", function() {


}
}
};

});
2 changes: 1 addition & 1 deletion html/partials/modal/viewOrder.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h3>Shipping & Payment</h3>
<strong>Where would you like payment sent to? </strong>
</div>
<div class="col-sm-7 {{releasePaymentForm.bitcoinPaymentAddress.$invalid ? 'has-error' : ''}}">
<input type="text" required data-ng-pattern="/^[a-zA-Z0-9\-]+$/" data-ng-maxlength="35" data-ng-minlength="26" class="form-control text" name="bitcoinPaymentAddress" data-ng-model="Market.modalOrder.paymentAddress" placeholder="Enter a Bitcoin address"/>
<input type="text" required validate-bitcoin-address class="form-control text" name="bitcoinPaymentAddress" data-ng-model="Market.modalOrder.paymentAddress" placeholder="Enter a Bitcoin address"/>
</div>
</div>
<div class="row" style="margin-top:10px;">
Expand Down
2 changes: 1 addition & 1 deletion html/vendors/bitcoinAddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -4303,4 +4303,4 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ }
/******/ ])
});
;
;
4 changes: 2 additions & 2 deletions node/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,8 @@ def get_ticker():
usock = urllib2.urlopen(url)
data = usock.read()
usock.close()
except Exception as e:
self.log.error('Cannot retrieve ticker info: %s', e.message)
except Exception as usock_exception:
self.log.error('Cannot retrieve ticker info: %s', usock_exception.message)
return

self.send_to_client(None, {
Expand Down

0 comments on commit b39e8d5

Please sign in to comment.