Released v5.9.6

This commit is contained in:
jos 2017-09-16 16:50:07 +02:00
parent 968e90edd0
commit 5d5b6473b6
8 changed files with 83 additions and 41 deletions

View File

@ -3,9 +3,9 @@
https://github.com/josdejong/jsoneditor
## not yet released, version 5.10.0
## 2017-09-16, version 5.9.6
- Display a dropdown for enums inside composite schemas.
- Fixed displaying a dropdown for enums inside composite schemas.
Thanks @hachichaud.
- Fixed #461: Urls opening twice on Firefox and Safari.

View File

@ -24,8 +24,8 @@
* Copyright (c) 2011-2017 Jos de Jong, http://jsoneditoronline.org
*
* @author Jos de Jong, <wjosdejong@gmail.com>
* @version 5.9.5
* @date 2017-08-26
* @version 5.9.6
* @date 2017-09-16
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
@ -6164,7 +6164,9 @@ return /******/ (function(modules) { // webpackBootstrap
//Locating the schema of the node and checking for any enum type
if(this.editor && this.editor.options) {
// find the part of the json schema matching this nodes path
this.schema = Node._findSchema(this.editor.options.schema, this.getPath());
this.schema = this.editor.options.schema
? Node._findSchema(this.editor.options.schema, this.getPath())
: null;
if (this.schema) {
this.enum = Node._findEnum(this.schema);
}
@ -6206,18 +6208,35 @@ return /******/ (function(modules) { // webpackBootstrap
*/
Node._findSchema = function (schema, path) {
var childSchema = schema;
var foundSchema = childSchema;
for (var i = 0; i < path.length && childSchema; i++) {
var key = path[i];
if (typeof key === 'string' && childSchema.properties) {
childSchema = childSchema.properties[key] || null
}
else if (typeof key === 'number' && childSchema.items) {
childSchema = childSchema.items
}
var allSchemas = schema.oneOf || schema.anyOf || schema.allOf;
if (!allSchemas) {
allSchemas = [schema];
}
return childSchema
for (var j = 0; j < allSchemas.length; j++) {
childSchema = allSchemas[j];
for (var i = 0; i < path.length && childSchema; i++) {
var key = path[i];
if (typeof key === 'string' && childSchema.properties) {
childSchema = childSchema.properties[key] || null;
if (childSchema) {
foundSchema = Node._findSchema(childSchema, path.slice(i, path.length));
}
}
else if (typeof key === 'number' && childSchema.items) {
childSchema = childSchema.items;
if (childSchema) {
foundSchema = Node._findSchema(childSchema, path.slice(i, path.length));
}
}
}
}
return foundSchema
};
/**
@ -6450,8 +6469,10 @@ return /******/ (function(modules) { // webpackBootstrap
break;
case 'click':
if (event.ctrlKey || !this.editable.value) {
if (event.ctrlKey && this.editable.value) {
// if read-only, we use the regular click behavior of an anchor
if (util.isUrl(this.value)) {
event.preventDefault();
window.open(this.value, '_blank');
}
}
@ -7513,7 +7534,7 @@ return /******/ (function(modules) { // webpackBootstrap
});
}
// create insert button
var insertSubmenu = [

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

49
dist/jsoneditor.js vendored
View File

@ -24,8 +24,8 @@
* Copyright (c) 2011-2017 Jos de Jong, http://jsoneditoronline.org
*
* @author Jos de Jong, <wjosdejong@gmail.com>
* @version 5.9.5
* @date 2017-08-26
* @version 5.9.6
* @date 2017-09-16
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
@ -14140,7 +14140,9 @@ return /******/ (function(modules) { // webpackBootstrap
//Locating the schema of the node and checking for any enum type
if(this.editor && this.editor.options) {
// find the part of the json schema matching this nodes path
this.schema = Node._findSchema(this.editor.options.schema, this.getPath());
this.schema = this.editor.options.schema
? Node._findSchema(this.editor.options.schema, this.getPath())
: null;
if (this.schema) {
this.enum = Node._findEnum(this.schema);
}
@ -14182,18 +14184,35 @@ return /******/ (function(modules) { // webpackBootstrap
*/
Node._findSchema = function (schema, path) {
var childSchema = schema;
var foundSchema = childSchema;
for (var i = 0; i < path.length && childSchema; i++) {
var key = path[i];
if (typeof key === 'string' && childSchema.properties) {
childSchema = childSchema.properties[key] || null
}
else if (typeof key === 'number' && childSchema.items) {
childSchema = childSchema.items
}
var allSchemas = schema.oneOf || schema.anyOf || schema.allOf;
if (!allSchemas) {
allSchemas = [schema];
}
return childSchema
for (var j = 0; j < allSchemas.length; j++) {
childSchema = allSchemas[j];
for (var i = 0; i < path.length && childSchema; i++) {
var key = path[i];
if (typeof key === 'string' && childSchema.properties) {
childSchema = childSchema.properties[key] || null;
if (childSchema) {
foundSchema = Node._findSchema(childSchema, path.slice(i, path.length));
}
}
else if (typeof key === 'number' && childSchema.items) {
childSchema = childSchema.items;
if (childSchema) {
foundSchema = Node._findSchema(childSchema, path.slice(i, path.length));
}
}
}
}
return foundSchema
};
/**
@ -14426,8 +14445,10 @@ return /******/ (function(modules) { // webpackBootstrap
break;
case 'click':
if (event.ctrlKey || !this.editable.value) {
if (event.ctrlKey && this.editable.value) {
// if read-only, we use the regular click behavior of an anchor
if (util.isUrl(this.value)) {
event.preventDefault();
window.open(this.value, '_blank');
}
}
@ -15489,7 +15510,7 @@ return /******/ (function(modules) { // webpackBootstrap
});
}
// create insert button
var insertSubmenu = [

2
dist/jsoneditor.map vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "jsoneditor",
"version": "5.9.5",
"version": "5.9.6",
"main": "./index",
"description": "A web-based tool to view, edit, format, and validate JSON",
"tags": [