Skip to content

Commit

Permalink
Fix issue jondavidjohn#17 - Tweak fix, update project build script to…
Browse files Browse the repository at this point in the history
… use uglify-js rather than uglify to fix minification bug
  • Loading branch information
joe-campiondigital-mo committed Dec 20, 2017
1 parent 81728ae commit fcfc395
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dist/payform.js: src/payform.coffee
$(BIN)coffee -c --no-header -o dist/ src/payform.coffee

dist/payform.min.js: dist/payform.js
$(BIN)uglify -s dist/payform.js -o dist/payform.min.js
$(BIN)uglifyjs dist/payform.js -o dist/payform.min.js

dist/jquery.payform.js: src/jquery.payform.coffee
$(BIN)browserify \
Expand All @@ -17,7 +17,7 @@ dist/jquery.payform.js: src/jquery.payform.coffee
src/jquery.payform.coffee > dist/jquery.payform.js

dist/jquery.payform.min.js: dist/jquery.payform.js
$(BIN)uglify -s dist/jquery.payform.js -o dist/jquery.payform.min.js
$(BIN)uglifyjs dist/jquery.payform.js -o dist/jquery.payform.min.js

watch: build
$(BIN)watch 'make build' src
Expand Down
6 changes: 3 additions & 3 deletions dist/jquery.payform.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i
};
reFormatCardNumber = function(e) {
var cursor;
if (e.target === "") {
if (e.target.value === "") {
return;
}
cursor = _getCaretPos(e.target);
Expand Down Expand Up @@ -316,7 +316,7 @@ var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i
};
reFormatExpiry = function(e) {
var cursor;
if (e.target === "") {
if (e.target.value === "") {
return;
}
cursor = _getCaretPos(e.target);
Expand Down Expand Up @@ -385,7 +385,7 @@ var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i
};
reFormatCVC = function(e) {
var cursor;
if (e.target === "") {
if (e.target.value === "") {
return;
}
cursor = _getCaretPos(e.target);
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.payform.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/payform.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
};
reFormatCardNumber = function(e) {
var cursor;
if (e.target === "") {
if (e.target.value === "") {
return;
}
cursor = _getCaretPos(e.target);
Expand Down Expand Up @@ -286,7 +286,7 @@
};
reFormatExpiry = function(e) {
var cursor;
if (e.target === "") {
if (e.target.value === "") {
return;
}
cursor = _getCaretPos(e.target);
Expand Down Expand Up @@ -355,7 +355,7 @@
};
reFormatCVC = function(e) {
var cursor;
if (e.target === "") {
if (e.target.value === "") {
return;
}
cursor = _getCaretPos(e.target);
Expand Down
2 changes: 1 addition & 1 deletion dist/payform.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
"watch": "make watch"
},
"devDependencies": {
"coffee-script": "~1.9.0",
"watch": "~0.13.0",
"uglify": "~0.1.1",
"mocha": "~2.1.0",
"browserify": "~8.1.3",
"bundle-collapser": "~1.1.1",
"coffee-script": "~1.9.0",
"coffeeify": "~1.0.0",
"bundle-collapser": "~1.1.1"
"mocha": "~2.1.0",
"uglify-js": "^3.2.2",
"watch": "~0.13.0"
}
}
6 changes: 3 additions & 3 deletions src/payform.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
# Format Card Number

reFormatCardNumber = (e) ->
if e.target is ""
if e.target.value is ""
return
cursor = _getCaretPos(e.target)
e.target.value = payform.formatCardNumber(e.target.value)
Expand Down Expand Up @@ -260,7 +260,7 @@
# Format Expiry

reFormatExpiry = (e) ->
if e.target is ""
if e.target.value is ""
return
cursor = _getCaretPos(e.target)
e.target.value = payform.formatCardExpiry(e.target.value)
Expand Down Expand Up @@ -314,7 +314,7 @@
# Format CVC

reFormatCVC = (e) ->
if e.target is ""
if e.target.value is ""
return
cursor = _getCaretPos(e.target)
e.target.value = replaceFullWidthChars(e.target.value).replace(/\D/g, '')[0...4]
Expand Down

0 comments on commit fcfc395

Please sign in to comment.