You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to add "class" in the submenu of Insert. I managed to do that by changing the code in jsoneditor.min.js (adding it to the submenu of Insert)
, { // THIS HAS BEEN CHANGED
text: "Class",
className: "jsoneditor-type-object",
title: r.class,
click: function() {
i._onInsertBefore("", {})
} //
now some of the things I dont understand how to do (from most important to least):
Change the function that happens when i click on it (as in inserting a class), inserting a class in my example would be to insert an object that has 2 objects in it already (2 empty strings) of module and path. example:
It would create a new instance of a class object (the values of the fields would be empty at first).
From what i saw it calls the function _onInsertBefore so i tried to find the implementation of the function and found this: (line 5927 when unminified)
n.prototype._onInsertBefore = function(e, t, i) { var r = this.editor.getSelection(), o = new n(this.editor, { field: void 0 != e ? e : "", value: void 0 != t ? t : "", type: i }); o.expand(!0), this.parent.insertBefore(o, this), this.editor.highlighter.unhighlight(), o.focus("field"); var s = this.editor.getSelection(); this.editor._onAction("insertBeforeNodes", { nodes: [o], beforeNode: this, parent: this.parent, oldSelection: r, newSelection: s }) }
but not really sure what exactly needs to be changed in order to do what I want to do.
How do I change the icon? I dont understand how each element gets a different icon in the code.
Any chance for some guidance? (I hope I made it clear enough)
The text was updated successfully, but these errors were encountered:
I would like to add "class" in the submenu of Insert. I managed to do that by changing the code in jsoneditor.min.js (adding it to the submenu of Insert)
now some of the things I dont understand how to do (from most important to least):
It would create a new instance of a class object (the values of the fields would be empty at first).
From what i saw it calls the function
_onInsertBefore
so i tried to find the implementation of the function and found this: (line 5927 when unminified)n.prototype._onInsertBefore = function(e, t, i) { var r = this.editor.getSelection(), o = new n(this.editor, { field: void 0 != e ? e : "", value: void 0 != t ? t : "", type: i }); o.expand(!0), this.parent.insertBefore(o, this), this.editor.highlighter.unhighlight(), o.focus("field"); var s = this.editor.getSelection(); this.editor._onAction("insertBeforeNodes", { nodes: [o], beforeNode: this, parent: this.parent, oldSelection: r, newSelection: s }) }
but not really sure what exactly needs to be changed in order to do what I want to do.
Any chance for some guidance? (I hope I made it clear enough)
The text was updated successfully, but these errors were encountered: