sketchfab / vanilla-plugin

Embed Sketchfab models in your Vanilla Forum
GNU General Public License v2.0
1 stars 2 forks source link

Plugin only works with InputFormatter = 'Html' #2

Open linc opened 9 years ago

linc commented 9 years ago

Might consider adding support for other formats, especially Wysiwyg. Currently in Wysiwyg mode, the prompt submits and nothing happens because the text is inserted into the hidden text box instead of the iframe.

pierreant-p commented 9 years ago

@linc thx for the feedback. What is the complexity to implement this? /cc @arthurjamain Do you have working examples of what you suggest?

linc commented 9 years ago

To support Wysiwyg, I think you'd just need to target the iframe instead of the BodyBox for the insert. I think Markdown actually allows Html so I bet that's already working. BBCode it might not be possible to support because I'm not sure there's a way to get a rel attribute thru that parser currently.

So the biggest challenge here is probably detecting if we're in Wysiwyg mode (and, if so, target the iframe instead). I was having a think about it and whether it would be necessary to add the InputFormatter setting to the gdn.meta data so it's available to Javascript as something easy to check. Might have a look in there if there's already something that signals that. If not we could put that in core, I think. I don't wanna see you needing to do weird incantations to determine what mode you're in like trying to find an iframe on the page or something.