Skip to content

Commit 0291ac7

Browse files
committed
Merge pull request #511 from Knockout-Contrib/issue-488
Change project structure
2 parents 56b3468 + b4b1a66 commit 0291ac7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+511
-8406
lines changed

Dist/Knockout-Validation.nuspec

Lines changed: 0 additions & 17 deletions
This file was deleted.

Dist/knockout.validation.min.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

Dist/knockout.validation.min.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

Lib/knockout-latest.debug.js

Lines changed: 0 additions & 5299 deletions
This file was deleted.

Src/ko.validation.start.frag

Lines changed: 0 additions & 27 deletions
This file was deleted.

Tests/Qunit/jquery-2.1.1.intellisense.js

Lines changed: 0 additions & 2670 deletions
This file was deleted.

bower.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
{
22
"name": "knockout-validation",
33
"description": "A KnockoutJS Plugin for model and property validation",
4-
"main": "Dist/knockout.validation.js",
4+
"main": "dist/knockout.validation.js",
55
"license": "MIT",
66
"ignore": [
77
"**/.*",
88
"node_modules",
9-
"Lib",
10-
"Src",
11-
"Scripts",
12-
"Tests",
9+
"src",
10+
"test",
1311
"gruntfile.js"
1412
],
1513
"keywords": [
Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,28 @@
99
/*globals require: false, exports: false, define: false, ko: false */
1010

1111
(function (factory) {
12-
// Module systems magic dance.
13-
14-
if (typeof require === "function" && typeof exports === "object" && typeof module === "object") {
15-
// CommonJS or Node: hard-coded dependency on "knockout"
16-
factory(require("knockout"), exports);
17-
} else if (typeof define === "function" && define["amd"]) {
18-
// AMD anonymous module with hard-coded dependency on "knockout"
19-
define(["knockout", "exports"], factory);
20-
} else {
21-
// <script> tag: use the global `ko` object, attaching a `mapping` property
22-
factory(ko, ko.validation = {});
23-
}
12+
// Module systems magic dance.
13+
14+
if (typeof require === "function" && typeof exports === "object" && typeof module === "object") {
15+
// CommonJS or Node: hard-coded dependency on "knockout"
16+
factory(require("knockout"), exports);
17+
} else if (typeof define === "function" && define["amd"]) {
18+
// AMD anonymous module with hard-coded dependency on "knockout"
19+
define(["knockout", "exports"], factory);
20+
} else {
21+
// <script> tag: use the global `ko` object, attaching a `mapping` property
22+
factory(ko, ko.validation = {});
23+
}
2424
}(function ( ko, exports ) {
2525

26-
if (typeof (ko) === 'undefined') { throw 'Knockout is required, please ensure it is loaded before loading this validation plug-in'; }
26+
if (typeof (ko) === 'undefined') {
27+
throw new Error('Knockout is required, please ensure it is loaded before loading this validation plug-in');
28+
}
2729

28-
// create our namespace object
29-
ko.validation = exports;
30+
// create our namespace object
31+
ko.validation = exports;
3032

31-
var kv = ko.validation,
33+
var kv = ko.validation,
3234
koUtils = ko.utils,
3335
unwrap = koUtils.unwrapObservable,
3436
forEach = koUtils.arrayForEach,
@@ -781,8 +783,8 @@ function minMaxValidatorFactory(validatorName) {
781783
regex = /^(\d{4})-W(\d{2})$/;
782784
valMatches = val.match(regex);
783785
if (valMatches === null) {
784-
throw "Invalid value for " + validatorName + " attribute for week input. Should look like " +
785-
"'2000-W33' http://www.w3.org/TR/html-markup/input.week.html#input.week.attrs.min";
786+
throw new Error("Invalid value for " + validatorName + " attribute for week input. Should look like " +
787+
"'2000-W33' http://www.w3.org/TR/html-markup/input.week.html#input.week.attrs.min");
786788
}
787789
comparisonValueMatches = comparisonValue.match(regex);
788790
// If no regex matches were found, validation fails
@@ -805,8 +807,8 @@ function minMaxValidatorFactory(validatorName) {
805807
regex = /^(\d{4})-(\d{2})$/;
806808
valMatches = val.match(regex);
807809
if (valMatches === null) {
808-
throw "Invalid value for " + validatorName + " attribute for month input. Should look like " +
809-
"'2000-03' http://www.w3.org/TR/html-markup/input.month.html#input.month.attrs.min";
810+
throw new Error("Invalid value for " + validatorName + " attribute for month input. Should look like " +
811+
"'2000-03' http://www.w3.org/TR/html-markup/input.month.html#input.month.attrs.min");
810812
}
811813
comparisonValueMatches = comparisonValue.match(regex);
812814
// If no regex matches were found, validation fails

dist/knockout.validation.min.js

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/knockout.validation.min.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)