1.3.2
This commit is contained in:
Родитель
c5b19bf5a7
Коммит
510844b19d
|
@ -1,3 +1,7 @@
|
|||
== 1.3.2
|
||||
|
||||
Fix problem with select elements introduced in 1.3.1
|
||||
|
||||
== 1.3.1
|
||||
|
||||
* Refactor for consistency / readability
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
var Braintree = {
|
||||
sjcl: sjcl,
|
||||
version: "1.3.1"
|
||||
version: "1.3.2"
|
||||
};
|
||||
|
||||
Braintree.generateAesKey = function () {
|
||||
|
@ -93,10 +93,10 @@ Braintree.EncryptionClient = function (publicKey) {
|
|||
for (i = 0; i < children.length; i++) {
|
||||
child = children[i];
|
||||
|
||||
if (child.children.length > 0) {
|
||||
found = found.concat(findInputs(child));
|
||||
} else if (child.attributes["data-encrypted-name"]) {
|
||||
if (child.attributes["data-encrypted-name"]) {
|
||||
found.push(child);
|
||||
} else if (child.children.length > 0) {
|
||||
found = found.concat(findInputs(child));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ describe("Braintree#form", function() {
|
|||
"<input type='text' data-encrypted-name='credit-card-cvv' value='cvv' />" +
|
||||
"<input type='text' name='card-holder-first-name' value='bob' />" +
|
||||
"<input name='expiration-month' value ='May'/>" +
|
||||
"<select data-encrypted-name='expiration-year'><option value='2013'>2013</option></select>" +
|
||||
"<div id ='foo'>" +
|
||||
" <input data-encrypted-name ='credit-card-expiration-date' class='encrypted' value ='May'/>" +
|
||||
"</div>" +
|
||||
|
@ -47,6 +48,11 @@ describe("Braintree#form", function() {
|
|||
expect($('input[name="credit-card-expiration-date"]')).toHaveValue('encrypted May');
|
||||
});
|
||||
|
||||
it("encrypts <select> input fields", function() {
|
||||
this.braintree.encryptForm('braintree_form');
|
||||
expect($('input[name="expiration-year"]')).toHaveValue('encrypted 2013');
|
||||
});
|
||||
|
||||
it("does not encrypt fields without encrypted class", function() {
|
||||
this.braintree.encryptForm('braintree_form');
|
||||
expect($('input[name="card-holder-first-name"]')).toHaveValue("bob");
|
||||
|
|
Загрузка…
Ссылка в новой задаче