Open Ruslan-Aleev opened 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?
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.
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 👍
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:
After:
Related issue(s)/PR(s)
N/A