Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow RichTextWidget to accept TinyMCE init options #130
My only suggestion beyond what's here is whether the existing TinyMCE-specific options on the widget (height, width, theme, skin) should be made to be defined as part of the
This seems to be a fundamentally solid pull request. I like the idea of ditching width, height, et al from the standard signature and making 'options' the standard way to pass all of those. I think the code can actually remain exactly as it is. The docs can be updated to reflect the 'preferred' API. The documentation for the options parameter should include documentation on the most common parameters with the link out to TinyMCE docs for extended options. Common options should include, as a minimum, the parameters which currently have their own args in the widget. Keeping the code the same and just updating the docs preserves backwards compatibility as well as sensible defaults, but allows us to publish our preferred API. Any interest in taking on the docs changes?
Actually, thinking about this again, the way the defaults are being supplied needs to be rethought, otherwise there's two sources of defaults (eg those hard-coded in the template, and those as now-deprecated class attributes which are still in the template) and then yet another source of options being the
That's confusing as heck in my opinion so I propose the given changes - full backwards compatibility is maintained for class attributes:
So, anyone who is still using class-level attributes (or old templates with class level attributes) will see those continue to function, all the defaults are in one place, and all overrides are in one place. Makes sense to me.
Tests included and fully documented.