Suggestion: Replace SCEditor with a non-jQuery Editor
See original GitHub issue@schmunk42 @germanbisurgi @marc7000 SCEditor has some problems with JSON-Editor (See #79) and requires jQuery. I suggest we replace it with another standalone WYSIWYG editor. (There’s a good list here https://github.com/JefMari/awesome-wysiwyg#standalone)
I recently did an experiment on creating an WYSIWYG JSON-Editor editor using Jodit, which supports both iframe
and contenteditable
modes.
Live test link here
This didn’t require any changes to the core or any other editors like src/string.js
(Which is where the SCEditor, ACE and SimpleMDE code are currently placed) as it just extends src/string.js
with the necessary code. So if Jodit lib is not present it will fallback to a standard string/textarea. And it can be configured using global config options and/or schema based options.
Using this method we also could move the ACE and SimpleMDE out of src/string.js
and place them in separate editors, making it possible to exclude them from build if needed.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top GitHub Comments
Using the same method as in my Jodit example, we could create a SCEditor editor too, but not include it in the official build. (Then if people want it instead of the non-jQuery editor, they can create their own custom build).
The method used in my Jodit examples also has a 2nd benefit, as it gets rid of the stupid
JSONEditor.plugins.blahblah
config option, and instead usesJSONEditor.defaults.options.blahblah
. (which can be overridden in the schema options if needed.)If we split out support for special editors in
src/string.js
it will be much easier to add new editors that extends it. And then we could split up the editors in “required” (string, number, boolean, integer, object, array etc.) and “optional” (SCEditor, ACE, SimpleMDE , Starrating, SignaturePad etc.), making it easier to create custom builds.Should we close this, as the changes is now available in https://github.com/json-editor/json-editor/tree/develop/2.x