question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
pmk65commented, Jul 2, 2019

I would not drop the support completely for 1.x releases, we can consider that for a 2.x along with a more generic way to add your own editors.

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 uses JSONEditor.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.

1reaction
pmk65commented, Jul 31, 2019

Should we close this, as the changes is now available in https://github.com/json-editor/json-editor/tree/develop/2.x

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to find and replace text in CKEditor using Javascript?
try this editor = CKEDITOR.instances.fck; //fck is just my instance name you will need to replace that with yours var edata = editor....
Read more >
Does CKEditor has callback function when editor is created?
Hi, I try to add onBlur event using jQuery to CKEditor. When document.ready(), I replace CKEditor. After that I search for iFrame inside ......
Read more >
CKEditor + JQuery to load content [Solved + Code]
What I am trying to do is have a list of links and have the same editor update them. My code currently works...
Read more >
CKEditor on JQuery UI Modal Dialog - Cannot Type in Editor
The only problem is that I cannot type in the editor at all. I have looked at the various suggestions. Some have suggested...
Read more >
Monitor CKEditor instance for changes
I'm using this JQuery to monitor for changes to the fields on the page: $("input, select, textarea) .change(function() { isDirty = 'True'; }...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found