fonini / ckeditor-youtube-plugin

CKEditor Plugin to embed Youtube videos.
https://fonini.github.io/youtube-plugin-for-ckeditor-4.html
Do What The F*ck You Want To Public License
51 stars 61 forks source link

Make responsive resets itself #33

Closed 0x1ad2 closed 9 years ago

0x1ad2 commented 9 years ago

Dear Fonini,

If I select the Make Responsive (ignore width and height, fit to width) option in de Embed Youtube Video dialog it inserts a video with width:100%; so that's good but when I save my page and load the content in CKeditor for a second time the width get resetted to the defined value.

To illustrate it I've made a screencap

Screencap

Note: the refresh is pretty fast so you might not notice it

0x1ad2 commented 9 years ago

@fonini any progress on this issue?

fonini commented 9 years ago

Hi Dennis, unfortunatelly I do not have time to look into this issue right now :(

0x1ad2 commented 9 years ago

Ah that's unfortunate is there a way we could fix this issue ourselves?

fonini commented 9 years ago

I really don't know how to fix this issue. You can try to read the "style" attribute when you're editing the video and ignore the default width and height. I think that involves lots of code changes.

0x1ad2 commented 9 years ago

Could I write some JavaScript for that?

fonini commented 9 years ago

Found the problem! When you check the "Responsive video" option, the video is wrapped by a DIV. CKEditor removes that div. A quick fix would by you set config.allowedContent = true; on your config.js file. I'll look at my ACF rules to prevent this.

0x1ad2 commented 9 years ago

Ah that worked thanks a lot and good luck fixing the ACF rules!

GerrGIT commented 9 years ago

It can be fixed by changing allowedContent rules on line 14 of plugin.js into: 'div{}; iframe{}[!width,!height,!src,!frameborder,!allowfullscreen]; object param[*]' I'm new into Git, but i've made a pull request. Hope I did it right, but i'm open for feedback.