Skip to content

Commit

Permalink
Merge pull request #49 from williamtroup/4.6.4
Browse files Browse the repository at this point in the history
4.6.4
  • Loading branch information
william-troup authored Dec 2, 2024
2 parents 0ba9cc0 + 38be44b commit 7a97758
Show file tree
Hide file tree
Showing 85 changed files with 269 additions and 186 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
JsonTree.js

[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=JsonTree.js%2C%20a%20free%20JavaScript%json%20treeview&url=https://github.com/williamtroup/JsonTree.js&hashtags=javascript,treeview,json)
[![npm](https://img.shields.io/badge/npmjs-v4.6.3-blue)](https://www.npmjs.com/package/jjsontree.js)
[![nuget](https://img.shields.io/badge/nuget-v4.6.3-purple)](https://www.nuget.org/packages/jJsonTree.js/)
[![npm](https://img.shields.io/badge/npmjs-v4.6.4-blue)](https://www.npmjs.com/package/jjsontree.js)
[![nuget](https://img.shields.io/badge/nuget-v4.6.4-purple)](https://www.nuget.org/packages/jJsonTree.js/)
[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/JsonTree.js/blob/main/LICENSE.txt)
[![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/JsonTree.js/discussions)
[![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://william-troup.com/)
</h1>

> <p align="center">🔗 A lightweight JavaScript library that generates customizable tree views to better visualize, and edit, JSON data.</p>
> <p align="center">v4.6.3</p>
> <p align="center">v4.6.4</p>
<br />
![JsonTree.js](docs/images/main.png)
Expand Down Expand Up @@ -173,8 +173,8 @@ Or, you can download the latest zipped up version [here](https://www.william-tro
Or, you can also use the following CDN links:

```markdown
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].3/dist/jsontree.min.js
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].3/dist/jsontree.js.min.css
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].4/dist/jsontree.min.js
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].4/dist/jsontree.js.min.css
```
<br>
<br>
Expand Down
10 changes: 5 additions & 5 deletions README_NUGET.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# JsonTree.js v4.6.3
# JsonTree.js v4.6.4

[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=JsonTree.js%2C%20a%20free%20JavaScript%json%20treeview&url=https://github.com/williamtroup/JsonTree.js&hashtags=javascript,treeview,json)
[![npm](https://img.shields.io/badge/npmjs-v4.6.3-blue)](https://www.npmjs.com/package/jjsontree.js)
[![nuget](https://img.shields.io/badge/nuget-v4.6.3-purple)](https://www.nuget.org/packages/jJsonTree.js/)
[![npm](https://img.shields.io/badge/npmjs-v4.6.4-blue)](https://www.npmjs.com/package/jjsontree.js)
[![nuget](https://img.shields.io/badge/nuget-v4.6.4-purple)](https://www.nuget.org/packages/jJsonTree.js/)
[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/JsonTree.js/blob/main/LICENSE.txt)
[![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/JsonTree.js/discussions)
[![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://william-troup.com/)
Expand Down Expand Up @@ -152,8 +152,8 @@ Or, you can download the latest zipped up version [here](https://www.william-tro
Or, you can also use the following CDN links:

```markdown
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].3/dist/jsontree.min.js
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].3/dist/jsontree.js.min.css
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].4/dist/jsontree.min.js
https://cdn.jsdelivr.net/gh/williamtroup/[email protected].4/dist/jsontree.js.min.css
```


Expand Down
29 changes: 16 additions & 13 deletions dist/jsontree.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ var ContextMenu;
e._currentView.currentContentColumns = [];
e._currentView.dataTypeCounts = {};
B(e, n);
const l = DomElement.create(e._currentView.element, "div", "contents");
const l = DomElement.create(e._currentView.element, "div", "contents jsontree-js-scroll-bars");
if (t) {
l.classList.add("page-switch");
}
Expand Down Expand Up @@ -1531,7 +1531,7 @@ var ContextMenu;
e._currentView.initialized = true;
}
function s(t, n, o, l, r, i, a) {
const s = DomElement.create(n, "div", i > 1 ? "contents-column-multiple" : "contents-column");
const s = DomElement.create(n, "div", i > 1 ? "contents-column-multiple jsontree-js-scroll-bars" : "contents-column jsontree-js-scroll-bars");
if (!Is.defined(t)) {
const t = DomElement.create(s, "div", "no-json");
DomElement.createWithHTML(t, "span", "no-json-text", e.text.noJsonToViewText);
Expand Down Expand Up @@ -1603,6 +1603,7 @@ var ContextMenu;
n._currentView.valueClickTimerId = 0;
n._currentView.editMode = true;
l.classList.add("editable");
l.classList.add("jsontree-js-scroll-bars");
l.setAttribute("contenteditable", "true");
l.setAttribute("draggable", "false");
l.innerText = JSON.stringify(Convert2.toJsonStringifyClone(o, e, n), n.events.onCopyJsonReplacer, n.jsonIndentSpaces);
Expand Down Expand Up @@ -1942,8 +1943,8 @@ var ContextMenu;
o.ondblclick = () => E(t);
}
if (t.sideMenu.enabled) {
const n = DomElement.createWithHTML(o, "button", "side-menu", e.text.sideMenuButtonSymbolText);
n.onclick = () => N(t);
const n = DomElement.createWithHTML(o, "button", "side-menu jsontree-js-scroll-bars", e.text.sideMenuButtonSymbolText);
n.onclick = () => j(t);
n.ondblclick = DomElement.cancelBubble;
ToolTip.add(n, t, e.text.sideMenuButtonText);
}
Expand Down Expand Up @@ -2049,7 +2050,7 @@ var ContextMenu;
}
function M(e) {
e._currentView.disabledBackground = DomElement.create(e._currentView.element, "div", "disabled-background");
e._currentView.disabledBackground.onclick = () => j(e);
e._currentView.disabledBackground.onclick = () => N(e);
}
function L(t) {
if (t.sideMenu.enabled) {
Expand All @@ -2076,10 +2077,10 @@ var ContextMenu;
ToolTip.add(n, t, e.text.importButtonText);
}
const l = DomElement.createWithHTML(o, "button", "close", e.text.closeButtonSymbolText);
l.onclick = () => j(t);
l.onclick = () => N(t);
ToolTip.add(l, t, e.text.closeButtonText);
if (Is.definedObject(t.data)) {
const e = DomElement.create(t._currentView.sideMenu, "div", "side-menu-contents");
const e = DomElement.create(t._currentView.sideMenu, "div", "side-menu-contents jsontree-js-scroll-bars");
H(e, t);
}
}
Expand All @@ -2089,19 +2090,19 @@ var ContextMenu;
n.type = "file";
n.accept = ".json";
n.multiple = true;
j(e);
N(e);
n.onchange = () => he(n.files, e, t);
n.click();
}
function N(e) {
function j(e) {
if (!e._currentView.sideMenu.classList.contains("side-menu-open")) {
e._currentView.sideMenu.classList.add("side-menu-open");
e._currentView.disabledBackground.style.display = "block";
ToolTip.hide(e);
ContextMenu.hide(e);
}
}
function j(t) {
function N(t) {
let n = false;
if (t._currentView.sideMenu.classList.contains("side-menu-open")) {
t._currentView.sideMenu.classList.remove("side-menu-open");
Expand Down Expand Up @@ -3019,6 +3020,7 @@ var ContextMenu;
t._currentView.valueClickTimerId = 0;
t._currentView.editMode = true;
l.classList.add("editable-name");
l.classList.add("jsontree-js-scroll-bars");
if (r) {
l.innerHTML = Arr.getIndexFromBrackets(o).toString();
} else {
Expand Down Expand Up @@ -3091,6 +3093,7 @@ var ContextMenu;
n._currentView.valueClickTimerId = 0;
n._currentView.editMode = true;
a.classList.add("editable");
a.classList.add("jsontree-js-scroll-bars");
a.setAttribute("contenteditable", "true");
if (Is.definedDate(r) && !n.includeTimeZoneInDates) {
a.innerText = JSON.stringify(r).replace(/['"]+/g, "");
Expand Down Expand Up @@ -3495,7 +3498,7 @@ var ContextMenu;
n.setAttribute("download", Ve(t));
n.click();
document.body.removeChild(n);
j(t);
N(t);
Z(t, e.text.exportedText);
Trigger.customEvent(t.events.onExport, t._currentView.element);
}
Expand Down Expand Up @@ -3542,7 +3545,7 @@ var ContextMenu;
C(l);
} else if (e.key === "Escape") {
e.preventDefault();
if (!j(l) && !o) {
if (!N(l) && !o) {
de(l);
}
}
Expand Down Expand Up @@ -3743,7 +3746,7 @@ var ContextMenu;
return e;
},
getVersion: function() {
return "4.6.3";
return "4.6.4";
}
};
(() => {
Expand Down
2 changes: 1 addition & 1 deletion dist/jsontree.esm.js.map

Large diffs are not rendered by default.

29 changes: 16 additions & 13 deletions dist/jsontree.js
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ var ContextMenu;
e._currentView.currentContentColumns = [];
e._currentView.dataTypeCounts = {};
B(e, n);
const l = DomElement.create(e._currentView.element, "div", "contents");
const l = DomElement.create(e._currentView.element, "div", "contents jsontree-js-scroll-bars");
if (t) {
l.classList.add("page-switch");
}
Expand Down Expand Up @@ -1533,7 +1533,7 @@ var ContextMenu;
e._currentView.initialized = true;
}
function s(t, n, o, l, r, i, a) {
const s = DomElement.create(n, "div", i > 1 ? "contents-column-multiple" : "contents-column");
const s = DomElement.create(n, "div", i > 1 ? "contents-column-multiple jsontree-js-scroll-bars" : "contents-column jsontree-js-scroll-bars");
if (!Is.defined(t)) {
const t = DomElement.create(s, "div", "no-json");
DomElement.createWithHTML(t, "span", "no-json-text", e.text.noJsonToViewText);
Expand Down Expand Up @@ -1605,6 +1605,7 @@ var ContextMenu;
n._currentView.valueClickTimerId = 0;
n._currentView.editMode = true;
l.classList.add("editable");
l.classList.add("jsontree-js-scroll-bars");
l.setAttribute("contenteditable", "true");
l.setAttribute("draggable", "false");
l.innerText = JSON.stringify(Convert2.toJsonStringifyClone(o, e, n), n.events.onCopyJsonReplacer, n.jsonIndentSpaces);
Expand Down Expand Up @@ -1944,8 +1945,8 @@ var ContextMenu;
o.ondblclick = () => E(t);
}
if (t.sideMenu.enabled) {
const n = DomElement.createWithHTML(o, "button", "side-menu", e.text.sideMenuButtonSymbolText);
n.onclick = () => N(t);
const n = DomElement.createWithHTML(o, "button", "side-menu jsontree-js-scroll-bars", e.text.sideMenuButtonSymbolText);
n.onclick = () => j(t);
n.ondblclick = DomElement.cancelBubble;
ToolTip.add(n, t, e.text.sideMenuButtonText);
}
Expand Down Expand Up @@ -2051,7 +2052,7 @@ var ContextMenu;
}
function M(e) {
e._currentView.disabledBackground = DomElement.create(e._currentView.element, "div", "disabled-background");
e._currentView.disabledBackground.onclick = () => j(e);
e._currentView.disabledBackground.onclick = () => N(e);
}
function L(t) {
if (t.sideMenu.enabled) {
Expand All @@ -2078,10 +2079,10 @@ var ContextMenu;
ToolTip.add(n, t, e.text.importButtonText);
}
const l = DomElement.createWithHTML(o, "button", "close", e.text.closeButtonSymbolText);
l.onclick = () => j(t);
l.onclick = () => N(t);
ToolTip.add(l, t, e.text.closeButtonText);
if (Is.definedObject(t.data)) {
const e = DomElement.create(t._currentView.sideMenu, "div", "side-menu-contents");
const e = DomElement.create(t._currentView.sideMenu, "div", "side-menu-contents jsontree-js-scroll-bars");
H(e, t);
}
}
Expand All @@ -2091,19 +2092,19 @@ var ContextMenu;
n.type = "file";
n.accept = ".json";
n.multiple = true;
j(e);
N(e);
n.onchange = () => he(n.files, e, t);
n.click();
}
function N(e) {
function j(e) {
if (!e._currentView.sideMenu.classList.contains("side-menu-open")) {
e._currentView.sideMenu.classList.add("side-menu-open");
e._currentView.disabledBackground.style.display = "block";
ToolTip.hide(e);
ContextMenu.hide(e);
}
}
function j(t) {
function N(t) {
let n = false;
if (t._currentView.sideMenu.classList.contains("side-menu-open")) {
t._currentView.sideMenu.classList.remove("side-menu-open");
Expand Down Expand Up @@ -3021,6 +3022,7 @@ var ContextMenu;
t._currentView.valueClickTimerId = 0;
t._currentView.editMode = true;
l.classList.add("editable-name");
l.classList.add("jsontree-js-scroll-bars");
if (r) {
l.innerHTML = Arr.getIndexFromBrackets(o).toString();
} else {
Expand Down Expand Up @@ -3093,6 +3095,7 @@ var ContextMenu;
n._currentView.valueClickTimerId = 0;
n._currentView.editMode = true;
a.classList.add("editable");
a.classList.add("jsontree-js-scroll-bars");
a.setAttribute("contenteditable", "true");
if (Is.definedDate(r) && !n.includeTimeZoneInDates) {
a.innerText = JSON.stringify(r).replace(/['"]+/g, "");
Expand Down Expand Up @@ -3497,7 +3500,7 @@ var ContextMenu;
n.setAttribute("download", Ve(t));
n.click();
document.body.removeChild(n);
j(t);
N(t);
Z(t, e.text.exportedText);
Trigger.customEvent(t.events.onExport, t._currentView.element);
}
Expand Down Expand Up @@ -3544,7 +3547,7 @@ var ContextMenu;
C(l);
} else if (e.key === "Escape") {
e.preventDefault();
if (!j(l) && !o) {
if (!N(l) && !o) {
de(l);
}
}
Expand Down Expand Up @@ -3745,7 +3748,7 @@ var ContextMenu;
return e;
},
getVersion: function() {
return "4.6.3";
return "4.6.4";
}
};
(() => {
Expand Down
44 changes: 37 additions & 7 deletions dist/jsontree.js.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7a97758

Please sign in to comment.