Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warn about callback fn when switching from js to json config #180

Merged
merged 3 commits into from Mar 6, 2024

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Feb 28, 2024

Description

When defining options for a CKEditor configuration in JavaScript, it’s possible to use callbacks. Callback functions don’t translate to JSON, so when you switch from JS to JSON, some of your config might get silently lost.

When switching from JS to JSON editor, check if the config contains any functions, and if it does, show a confirmation prompt before switching. If the user chooses to proceed, translate the JS config to JSON (and lose callbacks). If they cancel the switch, keep the config as it was.

Screen.Recording.2024-02-28.at.13.58.29.mov

Related issues

#152

[ci skip]
@brandonkelly brandonkelly merged commit 16ccbfa into main Mar 6, 2024
@brandonkelly brandonkelly deleted the bugfix/152-js-config-warn-about-functions branch March 6, 2024 17:50
@brandonkelly
Copy link
Member

Perfect solution!

@realjoshharrison
Copy link

Brilliant! Thanks @i-just 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants