I extended the support for webfm_popup to work with ckeditor and tinymce (I'm not sure if tinymce maybe already worekd beforhand) when using the wysiwyg-Modul.

The wysiwyg-people are in the process of adapting ckeditor:#462146: Add editor: CKeditor
Some of the ideas/code is taken from here: #533168: Add support for CKeditor

Comments

nhck’s picture

StatusFileSize
new7.64 KB
nhck’s picture

StatusFileSize
new7.61 KB

appears there was an error in the last patch. Maybe someone wants to test this?

nhck’s picture

anyone?

cweagans’s picture

I'm walking out the door right now, but I may be able to take a look tonight sometime. If not, then for sure tomorrow.

nhck’s picture

Got around to test this?

tseven’s picture

Component: Miscellaneous » Code

Patch #2 doesn't work properly.

The patching of the .info file fails (not important). The patch is successful on the .js and module file.

The popup opens and displays the webfm file browsers but ignores all file/folder permissions (allows the user to view all files and folders even if he's doesn't have permission to do so) and there is no obvious way of selecting the image for insertion.

Right-clicking a file and choosing the "past link into editor" option doesn't work.

nhck’s picture

Ah interesting - thank you for taking the time and providing feedback Steven.

2 Side notes:
I was using Wysiwyg 3.x-dev: Libraries API, Chaos Tools Suite, jQuery UI 2.x, Popups API from their CVS (http://drupal.org/node/181465/cvs-instructions/HEAD)
and webfm from cvs.
also I was using Firefox 3.5

The Option "Paste link into Editor" must be removed for the popup I guess - the correct link to choose is "Send to rich text editor"

About the permission: Thats really strange since webfm_popup only includes webfm in a different way and doesn't change anything about webfm itself.

Maybe you can give a little more inside about which browser/versions of the modules you use - I will go look for the bugs then :-)

kwinters’s picture

I didn't have any luck before or after applying the patch, but the biggest issue is that the webfm tinymce button doesn't appear (I enabled Bold and the webfm plugins, but only Bold appears in the edit node form). Send to Rich Text Editor appears outside of the editor context, which probably shouldn't be true either (it's just going to error if you use it anywhere else, since it's not being used in a sub-window).

TinyMCE 3.2.5, WYSIWYG 6.x-2.0, WebFM Popup 6.x-2.11 in FF 3.5.3.

nhck’s picture

As I mentioned above you must be using WYSIWYG 3 - I didn't mention this in the first post, because I thought it was clear because of #462146: Add editor: CKeditor - sorry about that.

So please if you use the patch:

kwinters’s picture

Hmm, WYSIWYG 3 doesn't have any releases and (in all likelihood) won't until D7. So, even if it works many of us won't be able to use it.

nhck’s picture

Hmm, but there is a Drupal 6 Branch so maybe you still would like to give it to try. I've got WYSIWYG 3 in Production use also.

kwinters’s picture

There is a D6 branch, but that was started forever ago and probably won't be really done until the D7 release is finished. I wouldn't hold my breath on a good backport.

Although you could use devel in production, I try to avoid it.

Also, the usage statistics say 1400 people are using 6-3 and 28k are using 6-2. If it's reasonable to do so, 6-2 is definitely be the one to support.

nhck’s picture

You are probably right - maybe you can test for tinymce over here #591132: ImageBrowser not working for TinyMCE in WYSIWYG module and we can provide a unified patch that works for both, wyswyig 2 and 3 later on.

aiphes’s picture

i'm very interesting in this evolution because it would be a great thing to the both modules (wysiwyg and webfm)...i'll wait for this so...http://drupal.org/node/632166

stuen93’s picture

I'd be interested to see this work with drupal 6 as well. I would really like to get my users to start using WebFM but I don't see it happening on a wide scale until it is integrated with wysiwyg and tinymce.

jm.federico’s picture

for anyone interested in TinyMCE support using WYSIWYG 2.x branch, here is a patch for webfm_popup.js, replace the file with this.

What it fixes:
WebFM was sending the full path of the file to TinyMCE and we want it to send the WebFM path, which let us move files around with WebFM while not breaking links.

jm.federico’s picture

StatusFileSize
new2.05 KB

Sorry, missed the file.

jm.federico’s picture

StatusFileSize
new1.14 KB

Ok People,

Patch against 2.12
Works with Wysiwyg Module + Tinymce

robmilne’s picture

Status: Needs review » Fixed

In head

aiphes’s picture

I've just applied the patch but popup doesnt open with WYSIWYG + TinyMCE...whats wrong ?

jm.federico’s picture

You might need to enable webfm attachments in the node type you want:
/admin/content/node-type/YOURNODETYPE

Workflow settings: Webfm Attachements: Enable

Let me know if that fixes the issue

nhck’s picture

Status: Fixed » Needs review
StatusFileSize
new990 bytes

Whilst ckeditor in webfm_popup/webfm_popup.js adding support for it through webfm_popup/webfm_popup.module was forgotten? Attached a patch.

I can confirm the tinymce issue, but its very sporadic. (using TinyMCE 3.3.2 and Wysiwyg 6.x-2.1)

aiphes’s picture

i've abandoned wysiwyg for FCKeditor + Webfm...but i'll try your solution on future website i think

nhck’s picture

StatusFileSize
new9.49 KB

So I did some further clean up.
With this patch - editor integrations will have to provide the caller name in url thus the switch(). I think we need to do this in order to structure the code better. Right now - in webfm_popup.sendtocaller - we just kinda say: CKEDITOR? -> do this & bail out, tinymce? -> bail out, else? -> probably fckeditor. In order to support more editors - I am thinking of most of the editors wysiwyg supports - there needs to be a better structure.

I also improved the help and comments to reflect this. Furthermore I improved the naming of the tinymce caller. However I couldn't drill down to the problem pointed out in #20 - this must be due to a late loading.

robmilne’s picture

Thanks Niels for taking the time to understand the issue. I'll cut a new rev by next week with your patch.

wdouglascampbell’s picture

I was able to use this patch to make things work for me but with two additional modifications.

Currently, the webfm_popup module doesn't support non-clean URLs.

So I had to change:

  window.open(getBasePath() + 'webfm_popup?url=' + field_name + '&caller=tinymce', 'ImageBrowser',
    'width=750,height=500,toolbar=0,resizable=1,location=0,status=0,menubar=0,scrollbars=1');

to:

  window.open(getBasePath() + '/?q=webfm_popup&url=' + field_name + '&caller=tinymce', 'ImageBrowser',
    'width=750,height=500,toolbar=0,resizable=1,location=0,status=0,menubar=0,scrollbars=1');

Also, in IE the use of jQuery change() method doesn't work very well. I keep getting a JScript object expected error. I changed the three instances of calling the change() method to click() instead. I actually don't even think this line is needed since the function called by TinyMCE's javascript immediately returns when triggered by the input form item being changed.

Anyway, just thought I would share those in case others are still having problems with this patch.

nhck’s picture

Version: 6.x-2.11 » 6.x-2.x-dev
Status: Needs review » Fixed

#580556 by nhck, jm.federico, wdouglascampbell | kwinters, aiphes: Added Full support for ckeditor and tinymce through wysiwyg-api.

Finally committed this. Thanks everyone for working on it. Please get the dev-release and reopen if there are still problems.

Ah one more thing: the implementation for ckeditor and fckeditor changed, they must now pass along caller=EDITORNAME as an argument.

Thanks everyone for the hints and for bearing with me on this.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jauzah’s picture

Category: feature » bug
Status: Closed (fixed) » Needs review

the wysiwyg+tinymce integration still doesn't work, there is a bug in webfm_popup.js on line 76 ... you need to change
window.open(Drupal.settings.basePath + '/?q=webfm_popup&url=' + field_name + '&caller=tinymce', 'ImageBrowser',

to:
window.open(Drupal.settings.basePath + '?q=webfm_popup&url=' + field_name + '&caller=tinymce', 'ImageBrowser',

nhck’s picture

Status: Needs review » Needs work
jm.federico’s picture

Status: Needs work » Closed (fixed)

@jauzah

I'm closing this issue and opening a new one. #923256: extra "/" when openning wysiwyg popup

It just seems like it was a coding bug when changing the module to work when clean-urls is not enabled.