Active
Project:
Wysiwyg
Version:
6.x-2.0
Component:
Editor - FCKeditor
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Mar 2010 at 21:36 UTC
Updated:
16 Mar 2010 at 22:23 UTC
After reviewing the latest stable version of this module I found that it was missing support for the FCKEditor dialog windows. I have created a patch which make the openDialog of a FCKEditor instance open the native FCK dialog,
| Comment | File | Size | Author |
|---|---|---|---|
| fckeditor-2.6.js_.patch | 1.04 KB | jdubbwya |
Comments
Comment #1
twodThe dialog will open, yes. But will it be usable? FCKeditor requires that a special function is called from the dialog when it's done loading or the throbber/progress-bar overlay won't be removed. I think there was another issue about this as well, but I don't remember atm.
Comment #2
jdubbwya commentedYes, this patch makes the dialog usable, because it references the native FCK object that is used to open dialogs
Comment #3
twodThe dialog opens, but the overlay with the progress bar never goes away, so the contents of the dialog are not visible.
See "Retrieving an Editor Instance" on http://docs.cksource.com/FCKeditor_2.x/Developers_Guide/JavaScript_API. The code in window.parent.InnerDialogLoaded() is responsible for removing that overlay and must be called when the dialog page is done loading.
I only know of one module which uses the openDialog method, Image Assist, and it already has code specialized to work only with TinyMCE (and so, it wouldn't really need that method as it could use TinyMCE's API directly). openDialog is really meant for use by editor-independent "Drupal plugins" which don't have their own way of opening dialogs and we've decided not to go via the editor APIs in the future simply because it got too complicated. Instead we'll rely on another module like Dialog API for this.
We did discuss implementing dialogs via the FCKeditor API in order to get Image Assist working with this editor as it's one of the more popular ones and "third-party dialog support" is on hold for Wysiwyg 3.x. It required changes to both Wysiwyg (something like your patch) and Image Assist (to remove the TinyMCE-specific code) because we did not want to put more editor-specific code in IA. I made a draft for that, similar to your patch, which had IA call something like Drupal.wysiwyg.instances[...].dialogLoaded(dialogWindowReference) (which would be defined in Drupal.wysiwyg.editor.instance.dialogLoaded()) so that the editor implementation itself could take care of calling the InnerDialogLoaded() function (or the equivalent for other editors).
If you can show how a module like Image Assist (others count as well) can use the FCKeditor dialog with this patch, without needing to use FCKeditor's API directly, I would definitely support it as it would fill a gap until we have cross-editor dialog support.