I am using ckeditor with ckeditor- WYSIWYG and the embed functionality no longer works (I was using Fckeditor before).

Currently, upon embedding, it no longer makes a lightbox, but instead fills the whole screen with what was a pop-up such that you can't exit out. Most importantly, I can't get the embed to function.

Comments

jvieille’s picture

Interested by this feature.
Any follow-up?

jvieille’s picture

+1

jvieille’s picture

+1

mrangryfish’s picture

+1

jvieille’s picture

This issue is still there, but only preventing the use of the embed button in the ckeditor editing area.
What is possible is embedding in raw text and then switching to rich text: the image will be there

bejam’s picture

Is this a matter of changing a few tags in the embed function to recognise "cckeditor" instead of "fckeditor"? It would be good if someone managed to get this working as fck has been replaced with ck. The workaround is not so acceptable for average users who will have a meltdown if they see the raw html.

mrangryfish’s picture

I've got part way there. It now adds the [file xyz] text into the ckeditor without having to switch to plain text mode. It doesn't actually show the thumbnail/video etc in the ckeditor yet.. or put the embed file into a button in ckeditor. But someone might appreciate this:

in jquery-fieldselection.js add:

			if (typeof(CKEDITOR.instances) != 'undefined' && typeof(CKEDITOR.instances['edit-body']) != 'undefined') {
				var editor = CKEDITOR.instances['edit-body'];
				var e = editor.getData();
			} else {
				var e = (this.jquery) ? this[0] : this;				
			}

In file_embed.js, in the two if/else areas that check for the wysiwyg editor type, add:

    }
		else if (typeof(CKEDITOR.instances) != 'undefined' && typeof(CKEDITOR.instances['edit-body']) != 'undefined') {
			var editor = CKEDITOR.instances['edit-body'];
      Drupal.file_embedPopup(this.href, translate.popupTitle);

and



	}
  else if (typeof(CKEDITOR.instances) != 'undefined' && typeof(CKEDITOR.instances['edit-body']) != 'undefined') {
	  try {
			var editor = CKEDITOR.instances['edit-body'];
			editor.insertText(content);
	                Drupal.file_embedInsertIndex = null;
	  } catch(e) {}

If I make the wysiwyg ckeditor button or make the embedded files show the actual file content in the editor I'll figure out how to make a patch and add it here. Thought this was worth contributing in the mean time for others. This is my first use of ckeditor javascript api so there may be more 'correct' solutions. For example using the wysiwyg api (2.0) module itself would be cleaner.

Cheers,
Christiaan Kortekaas

mrangryfish’s picture

I got the file embed ckeditor button and full wysiwyg integration working nicely now too. I'll try and send it to the fileframework maintainers when I get a chance. The above code bits are a bit different now too that I understand the CKEditor API better.

Equinger’s picture

Thanks for your work mrangryfish! Contributing your newest code would be great. Thanks, again!

johanneshahn’s picture

Version: 6.x-1.0-alpha5 » 6.x-1.x-dev

one up

johanneshahn’s picture

Status: Active » Closed (fixed)

inserted code from mrangryfish
this works fine with latest ckeditor module 4 drupal from http://ckeditor.com/download

jvieille’s picture

Status: Closed (fixed) » Needs work

Still the same: you can embed only in raw text mode.
One would expect that the embedding would apply in rich text mode, at the place the cursor is, but nothing happens in these conditions.
Ideally, a CK Editor button would be fantastic.

johanneshahn’s picture

Status: Needs work » Postponed (maintainer needs more info)

Hi
Can u try it with the new version from today?
Just forgot to write that

And would u write a new Issue then 4 the Button

Best regards
Johannes

jvieille’s picture

Status: Postponed (maintainer needs more info) » Fixed

Now it is OK!

johanneshahn’s picture

Status: Fixed » Closed (fixed)

ok,
can u create a new issue for ckeditor button?

jvieille’s picture

It is there
http://drupal.org/node/1494736

You will be granted the "Best Drupal Maintainer" Award , keeping begging for feature requests!
sorry, seems not to exist yet :(

johanneshahn’s picture

hi jvieille,
thanx for that really nice post.
i never heard before.

ill do my best :D, u do not have to begging.

greetz johannes