Commit Graph

1570 Commits

Author SHA1 Message Date
jos 55c4c91370 Publish v5.32.1 2019-03-28 20:17:11 +01:00
jos 4c5b19e7fa Update history 2019-03-28 19:51:42 +01:00
Adam Vigneaux 09ab92017c Fix JSON path parsing for array indices (#679)
* Switch JSON path tests to strict equality

The tests for `stringifyPath` and `parsePath` were using
[`assert.deepEqual`](https://nodejs.org/api/assert.html#assert_assert_deepequal_actual_expected_message),
which was causing the tests to pass when they should not have. Beyond
that, the `deepEqual` method is deprecated. The suggested replacement is
[`assert.deepStrictEqual`](https://nodejs.org/api/assert.html#assert_assert_deepstrictequal_actual_expected_message),
which causes the tests to fail where they should.

The difference between the two methods is the different between `==` and
`===`. `deepEqual` would coerce the input `"2"` to `2`, so the test was
passing even though the output was of the wrong type (string instead of
number).

* Coerce numeric indices to numbers in parsePath

This fixes a regression introduced in
3e7e1cebfd.
2019-03-28 19:49:36 +01:00
jos 560dd033ad Updated history 2019-03-21 21:29:38 +01:00
tobiasfriden 4763bdf293 Fixed using hyphens in the path of custom validation errors (#665)
* Fixed a bug where using hyphens in the path for custom validatons error didn't work

* Added closing bracket check and unit tests

* Automatically add brackets when path component contains hyphens

* use regexp to check if dot notation is safe
2019-03-21 21:27:17 +01:00
jos 0fbe7eee9a Publish v5.32.0 2019-03-20 17:46:49 +01:00
jos 3e7e1cebfd Fixed #676: JSON Paths containing array properties with a `]` not parsed correctly 2019-03-20 17:34:39 +01:00
jos 7c398aeef7 Update history. Fix JSON schema default value styling not working for `false` and `null`, and fixed the styling not updating when clicking a boolean checkbox (See #666) 2019-03-17 15:56:29 +01:00
Adam Vigneaux c79bea4eb8 Display schema defaults inline next to Nodes (#666)
* Display schema defaults inline next to Nodes

* Improve usability of schema default display

- When value is default, make it bold and set a tooltip
- When value is not default, display the default next to the value
- When value is default and is a select, show "Default" next to it
- Lighten the color of green used for values
  This increases the contrast between normal values and default values.

* Remove styling when value is the same as the schema default

This styling may have been confusing for some users and may not have
been applicable to all situations.

* Apply is-default and is-not-default classes to values

This allows the user to supply custom styling for these states.

To set styles for values that match the default value in the schema, use
the class `.jsoneditor-is-default`.

To set styles for values that _do not_ match the default value in the
schema, use the class `.jsoneditor-is-not-default`.

* Remove extra newline after schema examples in tooltip

* Move schema default display from inline to tooltip

This presents less opportunity for user confusion and is likely to be
more widely applicable.

* Add examples of schema metadata display

* Add documentation on styling
2019-03-17 15:39:00 +01:00
jos 7a2e89c329 Update history 2019-03-17 15:35:03 +01:00
jos 1d0870af36 Merge branch 'fix/schema-ref-examples' of https://github.com/AdamVig/jsoneditor into AdamVig-fix/schema-ref-examples 2019-03-17 15:31:23 +01:00
Adam Vigneaux 4f4a733fd6
Fix Node._findSchema bug when path is not present in schema
Previously, the function would return the wrong schema when it was
unable to find a path in the given schema.
2019-03-15 15:29:08 -04:00
jos 88972a62fc Publish v5.31.1 2019-03-14 21:22:07 +01:00
jos a01ff4a892 Fix missing polyfill on IE11 2019-03-14 21:21:19 +01:00
Adam Vigneaux f36cecdfde
Fix Node._findSchema schema reference support 2019-03-14 16:14:14 -04:00
Adam Vigneaux c0915548de
Add failing Node._findSchema schema reference test 2019-03-14 16:12:03 -04:00
DappWind 92fbe410a3 fix(i18b): fix Chinese translation error (#670) 2019-03-14 20:42:07 +01:00
Adam Vigneaux c93b8f1305
Add reproduction for schema ref examples bug 2019-03-14 11:27:28 -04:00
jos 1acd2d6116 Describe `onClassName` in the docs 2019-03-11 20:14:55 +01:00
jos 868dc38ceb Update history 2019-03-11 19:53:55 +01:00
adf0001 390afbdae0 Fix Chinese translation error (#668) 2019-03-11 19:52:46 +01:00
jos afead89e3b Publish `v5.31.0` 2019-03-10 17:56:47 +01:00
jos 829225849e Update history 2019-03-07 20:51:01 +01:00
jos 2dfde82197 Add examples to test_schema.html 2019-03-07 20:50:05 +01:00
Adam Vigneaux c8aeb1134d
Merge remote-tracking branch 'upstream/develop' into tooltip-examples 2019-03-04 16:15:14 -05:00
Adam Vigneaux 803563003c
Show examples from schema in field tooltip 2019-03-04 16:10:30 -05:00
Adam Vigneaux 03d019a554
Provide Navigator and allow locale override in test environment setup 2019-03-04 16:09:52 -05:00
jos a4d704f792 Publish `v5.30.0` 2019-03-02 10:51:50 +01:00
jos 03c833bad6 Update history 2019-03-02 10:31:01 +01:00
jos b5e9cfb34b Fix custom menu item in example 21 broken 2019-03-02 10:28:50 +01:00
jos 83b6c9a892 Update example 21 so it can run in IE11 2019-03-02 10:26:39 +01:00
jos 1857e80fcb Merge branch 'master' of https://github.com/RobAley/jsoneditor into RobAley-master 2019-03-02 10:18:49 +01:00
RobAley b83090d412
change path parameter to object 2019-02-25 16:14:49 +00:00
RobAley edca7a7a62
update oncreatemenu to change path to object 2019-02-25 16:05:54 +00:00
RobAley 74272397b4
change oncreatemenu path to object 2019-02-25 16:03:25 +00:00
RobAley b48f084cf5
Change oncreatemenu path to object 2019-02-25 16:02:35 +00:00
RobAley 43ac83520d
changed onCreateMenu path to object 2019-02-25 16:00:40 +00:00
RobAley b801affd9c
added onCreateMenu docs 2019-02-21 14:48:34 +00:00
RobAley 1c743bed1d
Add example for onCreateMenu 2019-02-21 14:32:20 +00:00
RobAley aec7308c78
Add call to onCreateMenu 2019-02-21 14:31:14 +00:00
RobAley aa577d2437
Add call to onCreateMenu 2019-02-21 14:26:37 +00:00
RobAley 981ce535d1
Change onCreateMenu to pass path rather than node 2019-02-21 14:23:40 +00:00
jos 8fc8e50bf1 Publish `v5.29.1` 2019-02-20 20:56:14 +01:00
jos 704a50d415 Fixed #661: JSONEditor broken on IE11 caused by duplicate JSON entries in a translation 2019-02-20 20:38:21 +01:00
RobAley 5d833d2131
Add call to options.onCreateMenu
to allow customisation of context menu items
2019-02-17 11:16:14 +00:00
RobAley 2bd4ca67af
Add onCreateMenu as valid option 2019-02-17 11:12:07 +00:00
jos df4673146f Publish `v5.29.0` 2019-02-16 14:12:53 +01:00
Adam Vigneaux f8279537d0 Fix Node._findSchema() (#651)
* Add test setup function for simulating browser globals

* Add tests for Node._findSchema

Some of the tests currently fail, which will be helpful in fixing the
incorrect behavior of the `_findSchema` function. The current failures
are:
- the last schema in the pattern properties object is always returned
- when pattern properties are present, wrong object schemas are returned

* Add schema-based tooltip to field names

Using the `title` and `description` properties from the schema, create
and set a tooltip on each field name. When the user hovers over a field
name, it will show the applicable information: title, description, both,
or neither, depending on what data is present in the schema.

* Remove redundant setting of field name title

* Remove accidental .only() from Node tests

* Fix Node._findSchema for pattern properties

The method now checks the key against the RegExp specified by the
pattern properties instead of always returning the last pattern property
in the object.

* Fix path used for recursive calls in Node._findSchema

* Add failing Node._findSchema tests for multi-level pattern properties

* Fix Node._findSchema for schemas with properties and patternProperties
2019-02-16 14:01:30 +01:00
jos 53a4f57dda Fix #657: `onClassName` throwing an error when a node is removed 2019-02-14 20:42:23 +01:00
jos c28cef0a9a Update history 2019-02-13 11:53:07 +01:00