Closed madppiper closed 7 years ago
It's not possible to customize all classes because it cost a lot of weight and Trumbowyg is light. So, sorry but no :/
This need a complete rewrite of Trumbowyg. I didn't have the time for that for the moment. Maybe in 2017 or 2018.
Thanks for the quick response, Alex.
Just out of curiosity. Wouldn't it be possible to replace the classes you are currently hardcoding with trumbowyg.o.* defaults, as you commonly do with other aspects of the software? We could then easily set these in our custom implementations. Like I mentioned, the html itself is not really a huge concern (and I can understand the reasoning that this would take it a step too far), but setting the classes would become quite handy and doesn't seem as big of a deal in comparison. In particular for the icons and the modal, this seems to be quite the bugger...
For buttons, there is already a class option in each btnDef: https://github.com/Alex-D/Trumbowyg/blob/develop/src/trumbowyg.js#L699
So you can add your owns.
You can disable SVG icons: http://alex-d.github.io/Trumbowyg/documentation.html#svg-icons
In combination of these two configurations, you should be able to use custom icon set base on any code you want.
For modals, it's hardcoded for transitions, fullscreen and other things like that.
I wasn't aware that one could override the class in the btnDef. That is definately helpful - thanks!
As for modals - currently, I am simply restyling the classes you deliver. Which works fine for the moment, but like I mentioned comes with limitations. My biggest problem really was that when using the modal, it would come with a preset size & position, on top of broken buttons that derived from our theme button styles (not to mention that openModalInsert can not be used outside of the forced form usecase). I could fix the buttons by adding specific styles to the themes (thus overriding the original theme), while working with openModal, but had I wanted to use it for more, I would have had to override all of the original css. Being able to set the classes would simplify this by alot.
Anyway, perhaps just meant as a suggestion - either way, you are doing a great job with Trumbowyg and you consider myself a fan.
Hey everyone,
I wanted to share a little success-story and also ask a general question. First a few positive remarks: we implemented a custom plugin, which hooks into trumbowyg and builds an image gallery based on our software. The user can select an image, which will then get inserted into the editor quite nicely. We implemented this for images, audio files, video and so on. I am attaching a screenshot here, for all that are intested:
So far so good. During development, however, we noticed that it is difficult, if not impossible, to modify the html & more importantly the html classes Trumbowyg uses to generate the editor. This isn't a problem at first, but can become limiting, once you need to implement the editor in your own application. Our software, for instance, supports various themes (foundation css, bootstrap and other frameworks are being used). Therefore it is sometimes crucial to be able to set specific html classes. It may also sometimes simply be desired to rely on the framework specific utilities to generate a modal - just to be in line with the overall styling. At yet another ocassion, we wanted to rely on the custom icon-set our themes come with (like many we use font-awesome for alot of it).
I was hence wondering, if it would be possible to update trumbowyg so that custom css classes can be set as overrides for either the modal, or the menu generating code.
Thanks & Regards, Paul