Released v5.5.5

This commit is contained in:
jos 2016-05-24 19:54:56 +02:00
parent c8de51d03f
commit f084180730
8 changed files with 99 additions and 89 deletions

View File

@ -3,7 +3,7 @@
https://github.com/josdejong/jsoneditor https://github.com/josdejong/jsoneditor
## not yet released, version 5.5.5 ## 2016-05-24, version 5.5.5
- Fixed #298: Switch mode button disappears when switching from text/code to - Fixed #298: Switch mode button disappears when switching from text/code to
tree/form/view mode when the JSON contained errors. tree/form/view mode when the JSON contained errors.

View File

@ -24,8 +24,8 @@
* Copyright (c) 2011-2016 Jos de Jong, http://jsoneditoronline.org * Copyright (c) 2011-2016 Jos de Jong, http://jsoneditoronline.org
* *
* @author Jos de Jong, <wjosdejong@gmail.com> * @author Jos de Jong, <wjosdejong@gmail.com>
* @version 5.5.4 * @version 5.5.5
* @date 2016-05-22 * @date 2016-05-24
*/ */
(function webpackUniversalModuleDefinition(root, factory) { (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object') if(typeof exports === 'object' && typeof module === 'object')
@ -4103,9 +4103,11 @@ return /******/ (function(modules) { // webpackBootstrap
var node = this; var node = this;
var path = []; var path = [];
while (node) { while (node) {
var field = (!node.parent || node.parent.type != 'array') var field = !node.parent
? node.field ? undefined // do not add an (optional) field name of the root node
: node.index; : (node.parent.type != 'array')
? node.field
: node.index;
if (field !== undefined) { if (field !== undefined) {
path.unshift(field); path.unshift(field);
@ -5285,8 +5287,17 @@ return /******/ (function(modules) { // webpackBootstrap
this.dom.checkbox.checked = this.value; this.dom.checkbox.checked = this.value;
} }
//If the node has an enum property and it is editable lets create the select element else {
else if (this.enum && this.editable.value) { // cleanup checkbox when displayed
if (this.dom.tdCheckbox) {
this.dom.tdCheckbox.parentNode.removeChild(this.dom.tdCheckbox);
delete this.dom.tdCheckbox;
delete this.dom.checkbox;
}
}
if (this.enum && this.editable.value) {
// create select box when this node has an enum object
if (!this.dom.select) { if (!this.dom.select) {
this.dom.select = document.createElement('select'); this.dom.select = document.createElement('select');
this.id = this.field + "_" + new Date().getUTCMilliseconds(); this.id = this.field + "_" + new Date().getUTCMilliseconds();
@ -5314,35 +5325,31 @@ return /******/ (function(modules) { // webpackBootstrap
this.dom.tdSelect.className = 'jsoneditor-tree'; this.dom.tdSelect.className = 'jsoneditor-tree';
this.dom.tdSelect.appendChild(this.dom.select); this.dom.tdSelect.appendChild(this.dom.select);
this.dom.tdValue.parentNode.insertBefore(this.dom.tdSelect, this.dom.tdValue); this.dom.tdValue.parentNode.insertBefore(this.dom.tdSelect, this.dom.tdValue);
}
//If the enum is inside a composite type display both the simple input and the dropdown field // If the enum is inside a composite type display
if(this.schema !== undefined && ( // both the simple input and the dropdown field
!this.schema.hasOwnProperty("oneOf") && if(this.schema && (
!this.schema.hasOwnProperty("anyOf") && !this.schema.hasOwnProperty("oneOf") &&
!this.schema.hasOwnProperty("anyOf") && !this.schema.hasOwnProperty("anyOf") &&
!this.schema.hasOwnProperty("allOf")) !this.schema.hasOwnProperty("allOf"))
) { ) {
this.valueFieldHTML = this.dom.tdValue.innerHTML; this.valueFieldHTML = this.dom.tdValue.innerHTML;
this.dom.tdValue.style.visibility = 'hidden'; this.dom.tdValue.style.visibility = 'hidden';
this.dom.tdValue.innerHTML = ''; this.dom.tdValue.innerHTML = '';
} else { } else {
delete this.valueFieldHTML; delete this.valueFieldHTML;
}
} }
} }
else { else {
// cleanup checkbox when displayed // cleanup select box when displayed
if (this.dom.tdCheckbox) { if (this.dom.tdSelect) {
this.dom.tdCheckbox.parentNode.removeChild(this.dom.tdCheckbox); this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect);
delete this.dom.tdCheckbox; delete this.dom.tdSelect;
delete this.dom.checkbox; delete this.dom.select;
} else if (this.dom.tdSelect) { this.dom.tdValue.innerHTML = this.valueFieldHTML;
this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect); this.dom.tdValue.style.visibility = '';
delete this.dom.tdSelect; delete this.valueFieldHTML;
delete this.dom.select;
this.dom.tdValue.innerHTML = this.valueFieldHTML;
this.dom.tdValue.style.visibility = '';
delete this.valueFieldHTML;
} }
} }
@ -8079,8 +8086,6 @@ return /******/ (function(modules) { // webpackBootstrap
// create mode box // create mode box
if (this.options && this.options.modes && this.options.modes.length) { if (this.options && this.options.modes && this.options.modes.length) {
this.modeSwitcher = new ModeSwitcher(this.menu, this.options.modes, this.options.mode, function onSwitch(mode) { this.modeSwitcher = new ModeSwitcher(this.menu, this.options.modes, this.options.mode, function onSwitch(mode) {
me.modeSwitcher.destroy();
// switch mode and restore focus // switch mode and restore focus
me.setMode(mode); me.setMode(mode);
me.modeSwitcher.focus(); me.modeSwitcher.focus();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

73
dist/jsoneditor.js vendored
View File

@ -24,8 +24,8 @@
* Copyright (c) 2011-2016 Jos de Jong, http://jsoneditoronline.org * Copyright (c) 2011-2016 Jos de Jong, http://jsoneditoronline.org
* *
* @author Jos de Jong, <wjosdejong@gmail.com> * @author Jos de Jong, <wjosdejong@gmail.com>
* @version 5.5.4 * @version 5.5.5
* @date 2016-05-22 * @date 2016-05-24
*/ */
(function webpackUniversalModuleDefinition(root, factory) { (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object') if(typeof exports === 'object' && typeof module === 'object')
@ -12002,9 +12002,11 @@ return /******/ (function(modules) { // webpackBootstrap
var node = this; var node = this;
var path = []; var path = [];
while (node) { while (node) {
var field = (!node.parent || node.parent.type != 'array') var field = !node.parent
? node.field ? undefined // do not add an (optional) field name of the root node
: node.index; : (node.parent.type != 'array')
? node.field
: node.index;
if (field !== undefined) { if (field !== undefined) {
path.unshift(field); path.unshift(field);
@ -13184,8 +13186,17 @@ return /******/ (function(modules) { // webpackBootstrap
this.dom.checkbox.checked = this.value; this.dom.checkbox.checked = this.value;
} }
//If the node has an enum property and it is editable lets create the select element else {
else if (this.enum && this.editable.value) { // cleanup checkbox when displayed
if (this.dom.tdCheckbox) {
this.dom.tdCheckbox.parentNode.removeChild(this.dom.tdCheckbox);
delete this.dom.tdCheckbox;
delete this.dom.checkbox;
}
}
if (this.enum && this.editable.value) {
// create select box when this node has an enum object
if (!this.dom.select) { if (!this.dom.select) {
this.dom.select = document.createElement('select'); this.dom.select = document.createElement('select');
this.id = this.field + "_" + new Date().getUTCMilliseconds(); this.id = this.field + "_" + new Date().getUTCMilliseconds();
@ -13213,35 +13224,31 @@ return /******/ (function(modules) { // webpackBootstrap
this.dom.tdSelect.className = 'jsoneditor-tree'; this.dom.tdSelect.className = 'jsoneditor-tree';
this.dom.tdSelect.appendChild(this.dom.select); this.dom.tdSelect.appendChild(this.dom.select);
this.dom.tdValue.parentNode.insertBefore(this.dom.tdSelect, this.dom.tdValue); this.dom.tdValue.parentNode.insertBefore(this.dom.tdSelect, this.dom.tdValue);
}
//If the enum is inside a composite type display both the simple input and the dropdown field // If the enum is inside a composite type display
if(this.schema !== undefined && ( // both the simple input and the dropdown field
!this.schema.hasOwnProperty("oneOf") && if(this.schema && (
!this.schema.hasOwnProperty("anyOf") && !this.schema.hasOwnProperty("oneOf") &&
!this.schema.hasOwnProperty("anyOf") && !this.schema.hasOwnProperty("anyOf") &&
!this.schema.hasOwnProperty("allOf")) !this.schema.hasOwnProperty("allOf"))
) { ) {
this.valueFieldHTML = this.dom.tdValue.innerHTML; this.valueFieldHTML = this.dom.tdValue.innerHTML;
this.dom.tdValue.style.visibility = 'hidden'; this.dom.tdValue.style.visibility = 'hidden';
this.dom.tdValue.innerHTML = ''; this.dom.tdValue.innerHTML = '';
} else { } else {
delete this.valueFieldHTML; delete this.valueFieldHTML;
}
} }
} }
else { else {
// cleanup checkbox when displayed // cleanup select box when displayed
if (this.dom.tdCheckbox) { if (this.dom.tdSelect) {
this.dom.tdCheckbox.parentNode.removeChild(this.dom.tdCheckbox); this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect);
delete this.dom.tdCheckbox; delete this.dom.tdSelect;
delete this.dom.checkbox; delete this.dom.select;
} else if (this.dom.tdSelect) { this.dom.tdValue.innerHTML = this.valueFieldHTML;
this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect); this.dom.tdValue.style.visibility = '';
delete this.dom.tdSelect; delete this.valueFieldHTML;
delete this.dom.select;
this.dom.tdValue.innerHTML = this.valueFieldHTML;
this.dom.tdValue.style.visibility = '';
delete this.valueFieldHTML;
} }
} }
@ -15978,8 +15985,6 @@ return /******/ (function(modules) { // webpackBootstrap
// create mode box // create mode box
if (this.options && this.options.modes && this.options.modes.length) { if (this.options && this.options.modes && this.options.modes.length) {
this.modeSwitcher = new ModeSwitcher(this.menu, this.options.modes, this.options.mode, function onSwitch(mode) { this.modeSwitcher = new ModeSwitcher(this.menu, this.options.modes, this.options.mode, function onSwitch(mode) {
me.modeSwitcher.destroy();
// switch mode and restore focus // switch mode and restore focus
me.setMode(mode); me.setMode(mode);
me.modeSwitcher.focus(); me.modeSwitcher.focus();

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.5.4", "version": "5.5.5",
"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": [