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

Improved editor for Ace settings #207

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ruslan-Aleev
Copy link
Contributor

What does it do ?

Called MODx.ux.Ace.replaceComponent() which gives MODX tag and syntax highlighting.

The only oddity is that when saving, 2 values are given in value, because MODx.ux.Ace.replaceComponent() seems to create a new editor but not remove the old one. And I had to add $value = $value[1]; to fix it. Maybe @Mark-H can give a better fix.

Before:
cc_before

After:
cc_after

Related issue(s)/PR(s)

N/A

@sebastian-marinescu
Copy link
Contributor

sebastian-marinescu commented Sep 4, 2023

The idea is extremely nice, I love it!!! 🚀

But for my use-cases (CSS/JS), using text/html isn't helping my users.
Ideally we should give the admin the possibility to choose from all available mime-types.

What do you think?

@Ruslan-Aleev
Copy link
Contributor Author

Yes, it would be convenient to set the mme-type either manually, or load it with a list from MODx.ux.Ace.mimeTypes.
If you have the time and opportunity - add a fix to this PR.

@sebastian-marinescu
Copy link
Contributor

I'm thinking this could be a hard-coded list of all that mimeTypes, but it would need to be in a dropdown or something.
I will look into it in the near future 👍

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.

2 participants