Skip to content

Commit

Permalink
Released v5.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed May 24, 2016
1 parent c8de51d commit f084180
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 89 deletions.
2 changes: 1 addition & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
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
tree/form/view mode when the JSON contained errors.
Expand Down
73 changes: 39 additions & 34 deletions dist/jsoneditor-minimalist.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* Copyright (c) 2011-2016 Jos de Jong, http://jsoneditoronline.org
*
* @author Jos de Jong, <[email protected]>
* @version 5.5.4
* @date 2016-05-22
* @version 5.5.5
* @date 2016-05-24
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
Expand Down Expand Up @@ -4103,9 +4103,11 @@ return /******/ (function(modules) { // webpackBootstrap
var node = this;
var path = [];
while (node) {
var field = (!node.parent || node.parent.type != 'array')
? node.field
: node.index;
var field = !node.parent
? undefined // do not add an (optional) field name of the root node
: (node.parent.type != 'array')
? node.field
: node.index;

if (field !== undefined) {
path.unshift(field);
Expand Down Expand Up @@ -5285,8 +5287,17 @@ return /******/ (function(modules) { // webpackBootstrap

this.dom.checkbox.checked = this.value;
}
//If the node has an enum property and it is editable lets create the select element
else if (this.enum && this.editable.value) {
else {
// 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) {
this.dom.select = document.createElement('select');
this.id = this.field + "_" + new Date().getUTCMilliseconds();
Expand Down Expand Up @@ -5314,35 +5325,31 @@ return /******/ (function(modules) { // webpackBootstrap
this.dom.tdSelect.className = 'jsoneditor-tree';
this.dom.tdSelect.appendChild(this.dom.select);
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(this.schema !== undefined && (
!this.schema.hasOwnProperty("oneOf") &&
!this.schema.hasOwnProperty("anyOf") &&
!this.schema.hasOwnProperty("anyOf") &&
!this.schema.hasOwnProperty("allOf"))
) {
this.valueFieldHTML = this.dom.tdValue.innerHTML;
this.dom.tdValue.style.visibility = 'hidden';
this.dom.tdValue.innerHTML = '';
} else {
delete this.valueFieldHTML;
}
// If the enum is inside a composite type display
// both the simple input and the dropdown field
if(this.schema && (
!this.schema.hasOwnProperty("oneOf") &&
!this.schema.hasOwnProperty("anyOf") &&
!this.schema.hasOwnProperty("allOf"))
) {
this.valueFieldHTML = this.dom.tdValue.innerHTML;
this.dom.tdValue.style.visibility = 'hidden';
this.dom.tdValue.innerHTML = '';
} else {
delete this.valueFieldHTML;
}
}
else {
// cleanup checkbox when displayed
if (this.dom.tdCheckbox) {
this.dom.tdCheckbox.parentNode.removeChild(this.dom.tdCheckbox);
delete this.dom.tdCheckbox;
delete this.dom.checkbox;
} else if (this.dom.tdSelect) {
this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect);
delete this.dom.tdSelect;
delete this.dom.select;
this.dom.tdValue.innerHTML = this.valueFieldHTML;
this.dom.tdValue.style.visibility = '';
delete this.valueFieldHTML;
// cleanup select box when displayed
if (this.dom.tdSelect) {
this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect);
delete this.dom.tdSelect;
delete this.dom.select;
this.dom.tdValue.innerHTML = this.valueFieldHTML;
this.dom.tdValue.style.visibility = '';
delete this.valueFieldHTML;
}
}

Expand Down Expand Up @@ -8079,8 +8086,6 @@ return /******/ (function(modules) { // webpackBootstrap
// create mode box
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) {
me.modeSwitcher.destroy();

// switch mode and restore focus
me.setMode(mode);
me.modeSwitcher.focus();
Expand Down
2 changes: 1 addition & 1 deletion dist/jsoneditor-minimalist.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/jsoneditor-minimalist.min.js

Large diffs are not rendered by default.

73 changes: 39 additions & 34 deletions dist/jsoneditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* Copyright (c) 2011-2016 Jos de Jong, http://jsoneditoronline.org
*
* @author Jos de Jong, <[email protected]>
* @version 5.5.4
* @date 2016-05-22
* @version 5.5.5
* @date 2016-05-24
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
Expand Down Expand Up @@ -12002,9 +12002,11 @@ return /******/ (function(modules) { // webpackBootstrap
var node = this;
var path = [];
while (node) {
var field = (!node.parent || node.parent.type != 'array')
? node.field
: node.index;
var field = !node.parent
? undefined // do not add an (optional) field name of the root node
: (node.parent.type != 'array')
? node.field
: node.index;

if (field !== undefined) {
path.unshift(field);
Expand Down Expand Up @@ -13184,8 +13186,17 @@ return /******/ (function(modules) { // webpackBootstrap

this.dom.checkbox.checked = this.value;
}
//If the node has an enum property and it is editable lets create the select element
else if (this.enum && this.editable.value) {
else {
// 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) {
this.dom.select = document.createElement('select');
this.id = this.field + "_" + new Date().getUTCMilliseconds();
Expand Down Expand Up @@ -13213,35 +13224,31 @@ return /******/ (function(modules) { // webpackBootstrap
this.dom.tdSelect.className = 'jsoneditor-tree';
this.dom.tdSelect.appendChild(this.dom.select);
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(this.schema !== undefined && (
!this.schema.hasOwnProperty("oneOf") &&
!this.schema.hasOwnProperty("anyOf") &&
!this.schema.hasOwnProperty("anyOf") &&
!this.schema.hasOwnProperty("allOf"))
) {
this.valueFieldHTML = this.dom.tdValue.innerHTML;
this.dom.tdValue.style.visibility = 'hidden';
this.dom.tdValue.innerHTML = '';
} else {
delete this.valueFieldHTML;
}
// If the enum is inside a composite type display
// both the simple input and the dropdown field
if(this.schema && (
!this.schema.hasOwnProperty("oneOf") &&
!this.schema.hasOwnProperty("anyOf") &&
!this.schema.hasOwnProperty("allOf"))
) {
this.valueFieldHTML = this.dom.tdValue.innerHTML;
this.dom.tdValue.style.visibility = 'hidden';
this.dom.tdValue.innerHTML = '';
} else {
delete this.valueFieldHTML;
}
}
else {
// cleanup checkbox when displayed
if (this.dom.tdCheckbox) {
this.dom.tdCheckbox.parentNode.removeChild(this.dom.tdCheckbox);
delete this.dom.tdCheckbox;
delete this.dom.checkbox;
} else if (this.dom.tdSelect) {
this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect);
delete this.dom.tdSelect;
delete this.dom.select;
this.dom.tdValue.innerHTML = this.valueFieldHTML;
this.dom.tdValue.style.visibility = '';
delete this.valueFieldHTML;
// cleanup select box when displayed
if (this.dom.tdSelect) {
this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect);
delete this.dom.tdSelect;
delete this.dom.select;
this.dom.tdValue.innerHTML = this.valueFieldHTML;
this.dom.tdValue.style.visibility = '';
delete this.valueFieldHTML;
}
}

Expand Down Expand Up @@ -15978,8 +15985,6 @@ return /******/ (function(modules) { // webpackBootstrap
// create mode box
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) {
me.modeSwitcher.destroy();

// switch mode and restore focus
me.setMode(mode);
me.modeSwitcher.focus();
Expand Down
2 changes: 1 addition & 1 deletion dist/jsoneditor.map

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions dist/jsoneditor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsoneditor",
"version": "5.5.4",
"version": "5.5.5",
"main": "./index",
"description": "A web-based tool to view, edit, format, and validate JSON",
"tags": [
Expand Down

0 comments on commit f084180

Please sign in to comment.