modmore / ClientConfig

ClientConfig is a MODX Revolution Extra to allow clients to maintain settings in a user friendly way.
https://docs.modmore.com/en/Open_Source/ClientConfig/index.html
MIT License
28 stars 27 forks source link

Improved editor for Ace settings #207

Open Ruslan-Aleev opened 1 year ago

Ruslan-Aleev commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 👍