Skip to content

Commit

Permalink
Change validation error message for minLength: 1 to be "Value require…
Browse files Browse the repository at this point in the history
…d". #158
  • Loading branch information
jdorn committed Jun 30, 2014
1 parent 40d1674 commit 5287b68
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "json-editor",
"version": "0.6.18",
"version": "0.6.19",
"authors": [
"Jeremy Dorn <[email protected]>"
],
Expand Down
14 changes: 10 additions & 4 deletions dist/jsoneditor.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*! JSON Editor v0.6.18 - JSON Schema -> HTML Editor
/*! JSON Editor v0.6.19 - JSON Schema -> HTML Editor
* By Jeremy Dorn - https://github.com/jdorn/json-editor/
* Released under the MIT license
*
* Date: 2014-06-26
* Date: 2014-06-29
*/

/**
Expand Down Expand Up @@ -931,11 +931,11 @@ JSONEditor.Validator = Class.extend({

// `minLength`
if(schema.minLength) {
if((value+"").length < schema.minLength) {
if((value+"").length < schema.minLength) {
errors.push({
path: path,
property: 'minLength',
message: this.translate('error_minLength', [schema.minLength])
message: this.translate((schema.minLength===1?'error_notempty':'error_minLength'), [schema.minLength])
});
}
}
Expand Down Expand Up @@ -5863,6 +5863,8 @@ JSONEditor.defaults.themes.bootstrap3 = JSONEditor.AbstractTheme.extend({
label.style.fontSize = '14px';
group.style.marginTop = '0';
group.appendChild(label);
input.style.position = 'relative';
input.style.float = 'left';
}
else {
group.className += ' form-group';
Expand Down Expand Up @@ -6656,6 +6658,10 @@ JSONEditor.defaults.languages.en = {
* When a property is not set
*/
error_notset: "Property must be set",
/**
* When a string must not be empty
*/
error_notempty: "Value required",
/**
* When a value is not one of the enumerated values
*/
Expand Down
8 changes: 4 additions & 4 deletions dist/jsoneditor.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ JSONEditor.defaults.languages.en = {
* When a property is not set
*/
error_notset: "Property must be set",
/**
* When a string must not be empty
*/
error_notempty: "Value required",
/**
* When a value is not one of the enumerated values
*/
Expand Down
4 changes: 2 additions & 2 deletions src/intro.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*! JSON Editor v0.6.18 - JSON Schema -> HTML Editor
/*! JSON Editor v0.6.19 - JSON Schema -> HTML Editor
* By Jeremy Dorn - https://github.com/jdorn/json-editor/
* Released under the MIT license
*
* Date: 2014-06-26
* Date: 2014-06-29
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,11 @@ JSONEditor.Validator = Class.extend({

// `minLength`
if(schema.minLength) {
if((value+"").length < schema.minLength) {
if((value+"").length < schema.minLength) {
errors.push({
path: path,
property: 'minLength',
message: this.translate('error_minLength', [schema.minLength])
message: this.translate((schema.minLength===1?'error_notempty':'error_minLength'), [schema.minLength])
});
}
}
Expand Down

0 comments on commit 5287b68

Please sign in to comment.