Permalink
Browse files

Removing unnecessary encodeURIComponent and decodeURIComponent calls (f…

…ixes #6)
  • Loading branch information...
1 parent c2d24f5 commit 3be205df9d849f6d02f6fd356e0261fa6d3af42b @TrevorBurnham TrevorBurnham committed May 10, 2012
Showing with 14 additions and 14 deletions.
  1. +4 −4 jquery.preview.full.js
  2. +1 −1 jquery.preview.full.min.js
  3. +4 −4 jquery.preview.js
  4. +1 −1 jquery.preview.min.js
  5. +4 −4 src/preview.js
View
@@ -2160,8 +2160,8 @@ function Preview(elem, options) {
}
obj.image_url = v;
}
- else{
- v = obj.hasOwnProperty(n) && obj[n] ? encodeURIComponent(obj[n]): '';
+ else {
+ v = obj[n];
}
var d = {
@@ -2243,7 +2243,7 @@ function Preview(elem, options) {
// input that we should look for and compare values. If they are the
// same we will ignore.
var original_url = this.form.find('#id_original_url').val();
- if (original_url === encodeURIComponent(url)) {
+ if (original_url === url) {
return true;
}
@@ -2292,7 +2292,7 @@ function Preview(elem, options) {
function (i, e) {
var n = $(e).attr('name');
if (n !== undefined) {
- data[n] = decodeURIComponent($(e).val());
+ data[n] = $(e).val();
}
});
// Clears the Selector.

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -903,8 +903,8 @@ function Preview(elem, options) {
}
obj.image_url = v;
}
- else{
- v = obj.hasOwnProperty(n) && obj[n] ? encodeURIComponent(obj[n]): '';
+ else {
+ v = obj[n];
}
var d = {
@@ -986,7 +986,7 @@ function Preview(elem, options) {
// input that we should look for and compare values. If they are the
// same we will ignore.
var original_url = this.form.find('#id_original_url').val();
- if (original_url === encodeURIComponent(url)) {
+ if (original_url === url) {
return true;
}
@@ -1035,7 +1035,7 @@ function Preview(elem, options) {
function (i, e) {
var n = $(e).attr('name');
if (n !== undefined) {
- data[n] = decodeURIComponent($(e).val());
+ data[n] = $(e).val();
}
});
// Clears the Selector.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -181,8 +181,8 @@ function Preview(elem, options) {
}
obj.image_url = v;
}
- else{
- v = obj.hasOwnProperty(n) && obj[n] ? encodeURIComponent(obj[n]): '';
+ else {
+ v = obj[n];
}
var d = {
@@ -264,7 +264,7 @@ function Preview(elem, options) {
// input that we should look for and compare values. If they are the
// same we will ignore.
var original_url = this.form.find('#id_original_url').val();
- if (original_url === encodeURIComponent(url)) {
+ if (original_url === url) {
return true;
}
@@ -313,7 +313,7 @@ function Preview(elem, options) {
function (i, e) {
var n = $(e).attr('name');
if (n !== undefined) {
- data[n] = decodeURIComponent($(e).val());
+ data[n] = $(e).val();
}
});
// Clears the Selector.

0 comments on commit 3be205d

Please sign in to comment.