Skip to content

Commit 5287b68

Browse files
committed
Change validation error message for minLength: 1 to be "Value required". #158
1 parent 40d1674 commit 5287b68

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "json-editor",
3-
"version": "0.6.18",
3+
"version": "0.6.19",
44
"authors": [
55
"Jeremy Dorn <[email protected]>"
66
],

dist/jsoneditor.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
/*! JSON Editor v0.6.18 - JSON Schema -> HTML Editor
1+
/*! JSON Editor v0.6.19 - JSON Schema -> HTML Editor
22
* By Jeremy Dorn - https://github.com/jdorn/json-editor/
33
* Released under the MIT license
44
*
5-
* Date: 2014-06-26
5+
* Date: 2014-06-29
66
*/
77

88
/**
@@ -931,11 +931,11 @@ JSONEditor.Validator = Class.extend({
931931

932932
// `minLength`
933933
if(schema.minLength) {
934-
if((value+"").length < schema.minLength) {
934+
if((value+"").length < schema.minLength) {
935935
errors.push({
936936
path: path,
937937
property: 'minLength',
938-
message: this.translate('error_minLength', [schema.minLength])
938+
message: this.translate((schema.minLength===1?'error_notempty':'error_minLength'), [schema.minLength])
939939
});
940940
}
941941
}
@@ -5863,6 +5863,8 @@ JSONEditor.defaults.themes.bootstrap3 = JSONEditor.AbstractTheme.extend({
58635863
label.style.fontSize = '14px';
58645864
group.style.marginTop = '0';
58655865
group.appendChild(label);
5866+
input.style.position = 'relative';
5867+
input.style.float = 'left';
58665868
}
58675869
else {
58685870
group.className += ' form-group';
@@ -6656,6 +6658,10 @@ JSONEditor.defaults.languages.en = {
66566658
* When a property is not set
66576659
*/
66586660
error_notset: "Property must be set",
6661+
/**
6662+
* When a string must not be empty
6663+
*/
6664+
error_notempty: "Value required",
66596665
/**
66606666
* When a value is not one of the enumerated values
66616667
*/

dist/jsoneditor.min.js

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

src/defaults.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ JSONEditor.defaults.languages.en = {
3333
* When a property is not set
3434
*/
3535
error_notset: "Property must be set",
36+
/**
37+
* When a string must not be empty
38+
*/
39+
error_notempty: "Value required",
3640
/**
3741
* When a value is not one of the enumerated values
3842
*/

src/intro.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
/*! JSON Editor v0.6.18 - JSON Schema -> HTML Editor
1+
/*! JSON Editor v0.6.19 - JSON Schema -> HTML Editor
22
* By Jeremy Dorn - https://github.com/jdorn/json-editor/
33
* Released under the MIT license
44
*
5-
* Date: 2014-06-26
5+
* Date: 2014-06-29
66
*/
77

88
/**

src/validator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,11 @@ JSONEditor.Validator = Class.extend({
444444

445445
// `minLength`
446446
if(schema.minLength) {
447-
if((value+"").length < schema.minLength) {
447+
if((value+"").length < schema.minLength) {
448448
errors.push({
449449
path: path,
450450
property: 'minLength',
451-
message: this.translate('error_minLength', [schema.minLength])
451+
message: this.translate((schema.minLength===1?'error_notempty':'error_minLength'), [schema.minLength])
452452
});
453453
}
454454
}

0 commit comments

Comments
 (0)