Ticket #382 (closed Bug: worksforme)

Opened 7 years ago

Last modified 3 years ago

Extra <p> using embeds in Firefox

Reported by: alfonsoml Owned by:
Priority: Normal Milestone:
Component: General Version: SVN (FCKeditor) - Retired
Keywords: Firefox Cc: slurms@…, macadames@…, riceball

Description

Switch to source mode and paste

<p><embed width="200" height="100" menu="true" loop="true" play="true" src="test.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></p>

Switch to WYSIWYG and back to Source and there's an extra <p>&nbsp</p> at the beggining and at the end.

present in Firefox 2.0.3.
IE 6 and Opera work properly.

Attachments

Media.zip (23.9 KB) - added by alfonsoml 7 years ago.
adjusted the way to get paths
mediaPlugin.zip (24.2 KB) - added by riceball 7 years ago.
the media parameters are done. use the new inject(AOP) architecture to hack! more security now.

Change History

comment:1 Changed 7 years ago by alfonsoml

Hi Fred,

After a flash insertion, and multiple switch between "source" and "wysiwyg" mode, some unwanted lines like this have been added before and after the embed tag:

&lt;p>&nbsp;&lt;/p>

Bye

Jean-mat -- Moved from SF. Original poster: Jean-mat Grimaldi - Ingeniweb - macadames

comment:2 Changed 7 years ago by alfonsoml

I noticed this as well. Although it only seems to happen in firefox


Moved from SF. Original poster: slurms

comment:3 Changed 7 years ago by alfonsoml

  • Cc slurms@…, macadames@… added

comment:4 follow-up: ↓ 5 Changed 7 years ago by silver09

It seems to happen in IE as well and not only for <embed> tags but many others such as <image> <span> etc to name a few.

Is there a quick work around for this?

comment:5 in reply to: ↑ 4 Changed 7 years ago by alfonsoml

Replying to silver09:

It seems to happen in IE as well and not only for <embed> tags but many others such as <image> <span> etc to name a few.

Is there a quick work around for this?

Do you really have the problem that new sets of <p>&nbsp</p> appear at the start and the end of the contents?

Or is just that the elements are moved into a block container? (p in this case according to the setting in fckconfig.js for the EnterMode)

comment:6 Changed 7 years ago by silver09

Thanks for that. It's the EnterMode setting.

I propose that maybe it could be different settings. One being a config for enter mode and the other being a config for moving elements into a block container.

comment:7 follow-up: ↓ 8 Changed 7 years ago by fredck

As in #350, the problem is that <embed> is an inline element in IE, while in Firefox it is a block element. This is at least the impression I have by navigating to Firefox's DOM after loading that HTML. The <embed> is thrown out of <p>.

Should we take the same approach and make <embed> a <block> element?

comment:8 in reply to: ↑ 7 Changed 7 years ago by alfonsoml

Replying to fredck:

As in #350, the problem is that <embed> is an inline element in IE, while in Firefox it is a block element. This is at least the impression I have by navigating to Firefox's DOM after loading that HTML. The <embed> is thrown out of <p>.

Should we take the same approach and make <embed> a <block> element?

I've tried and it doesn't work. As soon as the content is loaded the innerHtml of the body is:

<p />
<embed ... />
<p />

So I think that the solution would be something like it's done for HR in IE, but I've tried to do it and can't get the embeds in the documentProcessor with getElementsByTagName although in a simple test page works correctly and also with getElementsByTagNameNS

comment:9 Changed 7 years ago by riceball

the simplest workaround is that change the FCKConfig.EnterMode to "br" in your editor config file.

the complex fixed bug way is rewrite the Flash plugin, hacked into the FCKConfig.ProtectedSource.Protect and FCKConfig.ProtectedSource.Revert to protected the embed element.

I have writen a Media plugin to do so, wraps the object and embed element, supports the windows media, real media, quick time, flash and shockwave. only left thing to do is that how to show the parameters of all kinds of media. the parameters class is done.

if anybody needs, i would glad to share it.

comment:10 Changed 7 years ago by fredck

riceball, your proposal seams interesting, and it would be the way to go. Feel free to attach your code to this ticket if you have something complete and working. Thanks!

comment:11 Changed 7 years ago by martinkou

Hi riceball,

I've tried integrating your plugin into our SVN code, but then I get the error "cFckMediaElementName is not defined" when I load the editor.

Your code looks very interesting though. If I'm not mistaken, it can be used to insert .rmvb, .wmv, .mov files in addition to just .swf. The aspect oriented programming trick in the Inject() function is cool. I feel it can be a really nice addition to FCKeditor if it can be made to work.

Changed 7 years ago by alfonsoml

adjusted the way to get paths

comment:12 Changed 7 years ago by alfonsoml

Hi Martin, I've tested the plugin and the problem (at least for me) is that it expects the plugin to be in the default directory. I've uploaded a version that is able to work even if it's placed in other locations.

comment:13 Changed 7 years ago by riceball

enh, yes, I uses the path FCKConfig.PluginsPath+ 'media/'. so the include file won't work if you change the directory name. thanks alfonsoml, I've changed it to FCK.Plugins.ItemsMedia?.Path.

the media player parameters is done. the media plugin is fined.

known bugs:

  1. [design view]the drag to resize media do not work in Firefox.

Changed 7 years ago by riceball

the media parameters are done. use the new inject(AOP) architecture to hack! more security now.

comment:14 Changed 7 years ago by riceball

here is the my MediaBroser and MediaUpload configs:

FCKConfig.MediaBrowser = true ; FCKConfig.MediaBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Media&Connector=../../connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ; FCKConfig.MediaBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; 70% ; FCKConfig.MediaBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; 70% ;

FCKConfig.MediaUpload = true ; FCKConfig.MediaUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=Media' ; FCKConfig.MediaUploadAllowedExtensions = ".(swf|fla|flv|wmv|mpg|mpeg|avi|qt|rm|rmvb|jpg|gif|jpeg|png)$" ; empty for all FCKConfig.MediaUploadDeniedExtensions = "" ; empty for no one

comment:15 Changed 7 years ago by fredck

riceball, before we attempt to use your nice contribution, I need you to electronically sign our CLA. Please contact me if you have any doubt regarding it. Thanks again.

comment:16 follow-up: ↓ 17 Changed 7 years ago by riceball

ok, no problem. I've signed. Could u give me a write permission on SVN to maintain the media plugin?

comment:17 in reply to: ↑ 16 Changed 7 years ago by fredck

  • Cc riceball added

Replying to riceball:

ok, no problem. I've signed. Could u give me a write permission on SVN to maintain the media plugin?

Thanks riceball. Let's see now how will the integration proceed (there is a chance that we'll no use your code though). If we include it in the trunk, I'll be happy to invite you to help maintaining it. I'm CCing you to be sure you will get notifications on changes in this ticket.

comment:18 Changed 6 years ago by drsskelkar

Persistent problem noticed even in IE7 and Safari, and other browsers that extra unwanted <p> get inserted around editor text when you switch back and forth between source view and WYSIWYG mode.

comment:19 Changed 6 years ago by robb

I hope this is the best place to ask (I couldn't seem to find anywhere better, but please feel free to redirect me if there is...)

I'm really keen to use this plugin, but can't get it to work properly. The button appears on my toolbar, and the dialogue box appears if I click the button.

However, all the OPTIONs in the SELECT menu are blank (in IE7) or "undefined" (in FF3). And Firefox's error console says:

Error: GetE is not defined
Source File: http://www.mydomain.com/drupal/sites/all/modules/fckeditor/plugins/Media/js/fck_media.js
Line: 245

Error: GetE is not defined
Source File: http://www.mydomain.com/drupal/sites/all/modules/fckeditor/plugins/Media/js/fck_media.js
Line: 364

Can anyone tell what's wrong?

Thanks,

Robb

comment:20 Changed 3 years ago by krst

  • Status changed from confirmed to closed
  • Resolution set to worksforme
Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy