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 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. Thanks @hachichaud.
- Fixed #461: Urls opening twice on Firefox and Safari. - 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 * Copyright (c) 2011-2017 Jos de Jong, http://jsoneditoronline.org
* *
* @author Jos de Jong, <wjosdejong@gmail.com> * @author Jos de Jong, <wjosdejong@gmail.com>
* @version 5.9.5 * @version 5.9.6
* @date 2017-08-26 * @date 2017-09-16
*/ */
(function webpackUniversalModuleDefinition(root, factory) { (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object') 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 //Locating the schema of the node and checking for any enum type
if(this.editor && this.editor.options) { if(this.editor && this.editor.options) {
// find the part of the json schema matching this nodes path // 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) { if (this.schema) {
this.enum = Node._findEnum(this.schema); this.enum = Node._findEnum(this.schema);
} }
@ -6206,18 +6208,35 @@ return /******/ (function(modules) { // webpackBootstrap
*/ */
Node._findSchema = function (schema, path) { Node._findSchema = function (schema, path) {
var childSchema = schema; var childSchema = schema;
var foundSchema = childSchema;
for (var i = 0; i < path.length && childSchema; i++) { var allSchemas = schema.oneOf || schema.anyOf || schema.allOf;
var key = path[i]; if (!allSchemas) {
if (typeof key === 'string' && childSchema.properties) { allSchemas = [schema];
childSchema = childSchema.properties[key] || null
}
else if (typeof key === 'number' && childSchema.items) {
childSchema = childSchema.items
}
} }
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; break;
case 'click': 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)) { if (util.isUrl(this.value)) {
event.preventDefault();
window.open(this.value, '_blank'); window.open(this.value, '_blank');
} }
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

47
dist/jsoneditor.js vendored
View File

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

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", "name": "jsoneditor",
"version": "5.9.5", "version": "5.9.6",
"main": "./index", "main": "./index",
"description": "A web-based tool to view, edit, format, and validate JSON", "description": "A web-based tool to view, edit, format, and validate JSON",
"tags": [ "tags": [