If I enter some text into my TinyMCE editor and then press the fullscreen button, it opens up an empty fullscreen editor, deleting all of my content.

Interestingly, if I start in the fullscreen editor, enter some text and then return to the normal editor, my text is preserved. Of course, if I press the fullscreen editor button again, the text is lost for good.

I've tried this with WYSIWYG 6.x-2.3 and 6.x-2.x-dev, and with TinyMCE versions 3.3.9.3 and 3.4.2 (both for jquery).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TwoD’s picture

Status: Active » Postponed (maintainer needs more info)

Which browser(s) are you seeing this in? I tested in FF4 and IE8 with Wysiwyg 7.x-2.x-dev and TinyMCE 3.4 and it appears to be working fine (except for the toolbar being obscured by the top menus in fullscreen mode).

I'll test in 6.x-2.x later.

jstoller’s picture

Status: Postponed (maintainer needs more info) » Active

I just tested this in FireFox 4.0, Chrome 10.0.648.205 and Safari 5.0.5, all running under Mac OS X 10.6.7. I also tested it in IE8, running under Windows XP (using Paralles Desktop virtualization). It didn't work in any of the browsers on either platform

Here are some modules I'm currently running which may or may not impact this issue:

Wysiwyg 6.x-2.x-dev with TinyMCE 3.4.2 for jQuery
Wysiwyg cleaner 6.x-1.2
jQuery Update 6.x-2.x-dev (2011-Feb-24 release)
jQuery UI 6.x-1.x-dev (2010-Nov-10 release) with jquery.ui version 1.7.3
Better Formats 6.x-2.x-dev
Vertical Tabs 6.x-1.x-dev (2011-Apr-05 release)

TwoD’s picture

I'd try disabling the Wysiwyg cleaner plugin. I took a quick look at its source and it seems to be doing something to iframes. My D6 test environment isn't operational at the moment so I can't verify it being the cause, but it'll narrow down the possibilities.

The fullscreen mode is a completely new editor instance which is destroyed and recreated by TinyMCE itself when toggling fullscreen mode. Wysiwyg doesn't do anything special to it other than making sure it targets the fullscreen instance, when active, for content inserts instead of the instance tied to the textarea since updating it will have no effect.
I'm familiar with the other modules and they should have no such effect, though I wonder if jQuery Update might be interfering with the TinyMCE jQuery build. If disabling the plugin doesn't help, try installing the standard TinyMCE version instead.

jstoller’s picture

WYSIWYG Cleaner does appear to be causing this problem. Or at least triggering it. I've posted an issue in that queue as well: #1135216: WYSIWYG Cleaner breaks TinyMCE Fullscreen plugin

TwoD’s picture

Status: Active » Needs review
FileSize
1.35 KB

Hmm, the plugin assumes Drupal.wysiwyg.instances to always have a key with the same name as the instanceId passed to its attach() method. That is not the case in fullscreen mode as TinyMCE will instead pass 'mce_fullscreen'.

Perhaps this patch can help.
It'll make the existence of TinyMCE's fullscreen mode even more transparent to other modules - which we should want since they're supposed to be cross-editor plugins. I wonder if this could have other consequences tho...
A native plugin would be passed the instance of the fullscreen editor instead of the regular editor in this case, but since cross-editor plugins should have no need to muck about with the internal structure of the editor, I think we're safe.

The "clean input on paste events" which Wysiwyg Cleaner would still be broken with this patch, it will process whatever's in the original editor's iframe instead of the fullscreen editor's iframe. Not much we can do about that right now though. I think our APIs would have to invoke attach() on pasted content as well (or at least relay the paste event to plugins in some way) for that to work best, but that's another issue.

There's also a problem with the plugin's assumption that Drupal.settings.wysiwyg always holds all the settings. That assumption is currently made in Wysiwyg itself too, but we'll have to change that to get it to work well with AJAX:ed forms. Again, that's another issue we'll leave for later.

sun’s picture

Can anyone test this patch? Looks good to me, code-wise.

Long-term though, we should have proper editor instance objects, and adjust the instance ID when the fullscreen plugin opens/closes.

sun’s picture

Status: Needs review » Fixed

Thanks for reporting, reviewing, and testing! Committed to all branches.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

Status: Fixed » Closed (fixed)

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

ccjjmartin’s picture