Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ The jQuery Unobtrusive Validation library complements jQuery Validation by addin

This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo.

`jquery.validate.unobtrusive.min.js` must be kept up to date with `jquery.validate.unobtrusive.js`, this can easily be done by running `gulp` before commiting.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

committing

4 changes: 3 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ var gulp = require("gulp"),

gulp.task("minifyJS", function () {
gulp.src(["jquery.validate.unobtrusive.js"], { base: "." })
.pipe(uglify())
.pipe(uglify({
preserveComments: 'license'
}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest("."));
});
Expand Down
2 changes: 1 addition & 1 deletion jquery.validate.unobtrusive.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

function escapeAttributeValue(value) {
// As mentioned on http://api.jquery.com/category/selectors/
return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\\\$1");
return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we're sure that reverting this line doesn't break anything? What was it trying to fix, and why did we think this fix was correct at the time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was trying to fix #33. The actual problem there was what I commented a little bit ago, that his data-val-for was subtly wrong. My best bet for why we thought it was correct at the time is basically that I was testing the wrong stuff. I think I had hand-wrote his html into my test app and in doing so inadvertently fixed the typo, and my test app was probably also serving the un-updated *.min.js.

Lessons for me: 1. Always repro and fix in the same setup 2. As much as possible, verify that the code I changed is actually getting run.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood!

}

function getModelPrefix(fieldName) {
Expand Down
4 changes: 2 additions & 2 deletions jquery.validate.unobtrusive.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.