Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re organised patterns object so it works in IE8 when minified #25

Merged
merged 2 commits into from
Jul 13, 2014
Merged

Re organised patterns object so it works in IE8 when minified #25

merged 2 commits into from
Jul 13, 2014

Conversation

krishandley
Copy link

Fixes this issue #22 where the minified version in IE8 was getting this error n.patterns.validate is null or not an object

@stefanzweifel
Copy link

Works as expected.
👍 for merging.

@macek
Copy link
Owner

macek commented Jul 10, 2014

Thanks for the pull request and the feedback. I'll check into this soon.

We'll have to update this test to ensure that modifying one of the patterns results in proper functionality.

As a bonus, we could build the tests to prove that Hyphen Notation and Dot Notation work reliably.

Hyphen Notation

$.extend(FormSerializer.patterns, {
  validate: /^[a-z][a-z0-9_-]*(?:\[(?:\d*|[a-z0-9_]+)\])*$/i,
  key:      /[a-z0-9_-]+|(?=\[\])/gi,
  named:    /^[a-z0-9_-]+$/i
});

Dot Notation

$.extend(FormSerializer.patterns, {
  validate: /^[a-z][a-z0-9_]*(?:\.[a-z0-9_]+)*(?:\[\])?$/i
});

I've been really bogged down these last couple weeks, so if someone wants to knockout those tests, I'll be happy to merge this in.

If not, I can try to get to it this upcoming week.

@macek macek added fix labels Jul 10, 2014
@krishandley
Copy link
Author

I've added a couple of tests to check that extending the patterns works, and I've also manually tested the pattern extending for hyphens using the uglified version and it still seems to work fine in IE8.

@macek
Copy link
Owner

macek commented Jul 10, 2014

@krishandley, thanks a bunch for hacking up a couple tests for this.

I'm glad to know that pattern overriding still works.

My IE8 virtual machine isn't working for some reason, would you mind verifying that this branch works okay in IE8?

https://github.com/macek/jquery-serialize-object/tree/ie8_minify_fix

@krishandley
Copy link
Author

The minified file from that branch works fine in IE8 :)

@macek macek merged commit 3f46750 into macek:master Jul 13, 2014
@macek
Copy link
Owner

macek commented Jul 13, 2014

Thanks again for the help, @krishandley. Make sure to grab the latest 2.3.0 for use with IE8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants