The foswiki svn repository will become read-only on Friday 8/8. Developers should register for a http://github.com/ account for commit access to foswiki.

Item2037: Switching to Wiki Text (raw) when TMCE is fullscreen results in mess

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Urgent Closed Extension TinyMCEPlugin  
When editing a topic, the user is presented with the WYSIWYG TinyMCE editor.

The user goes to fullscreen.

Then the user goes to "Wiki Text" mode.

The user is then presented with a bizarre mess, topic editor contents centred over the top of the rest of the page (not within an editable textarea).

Screenshots attached.

I've reproduced this on an up-to-date trunk (rev4845) installation and Foswiki 1.0.6 with trunk NatSkin, NatEdit, TMCE.

-- PaulHarvey - 11 Sep 2009

I've updated this report to reflect that this issue is present without NatEdit.

Replicated the problem with essentially a default PatternSkin setup, NatEditPlugin and NatSkinPlugin disabled.

View-> Source revealed the HTML had no natskin/natedit artifacts, Net trace showed no NatEdit/NatSkin files being loaded.

New screenshots attached.

-- PaulHarvey - 12 Sep 2009

  • pattern skin wysiwyg fullscreen:
    pattern_wysiwyg_fullscreen.png

  • pattern skin wiki text fullscreen:
    pattern_rawmode_fullscreen_mess.png


My first approach has been this change:

Index: TinyMCEPlugin/pub/System/TinyMCEPlugin/foswiki_tiny_src.js
===================================================================
--- TinyMCEPlugin/pub/System/TinyMCEPlugin/foswiki_tiny_src.js   (revision 4685)
+++ TinyMCEPlugin/pub/System/TinyMCEPlugin/foswiki_tiny_src.js   (working copy)
@@ -116,6 +116,10 @@
 
     // Convert HTML content to textarea. Called from the WYSIWYG->raw switch
     switchToRaw : function (editor) {
+        if (true === editor.getParam('fullscreen_is_enabled')) {
+            editor.execCommand('mceFullScreen');
+            console.log('disabled fullscreen, from switchToRaw()');
+        }
         var text = editor.getContent();
 
         // Make the raw-edit help visible (still subject to toggle)

Studying the fullscreen TMCE plugin, it seems a new TMCE editor instance is created (?) id #mce_fullscreen (vs #topic for normal WYSIWYG).

In foswiki_tiny_src.js, there's a call to FoswikiTiny.transform() in switchToRaw() which tries to set the contents of the raw <textarea> with this.getElement().value, which should get a reference to the the original element before TMCE took it over. However because this is a new TMCE instance and (it seems) there was no original textarea to start with... getElement() is returning null.

-- PaulHarvey - 12 Sep 2009

Just to confirm. This is also an issue in PatternSkin.

This is a release blocker.

-- KennethLavrsen - 13 Sep 2009

For 1.0.7 we could just turn off the full screen plugin. That would be OK for 1.0.7.

-- KennethLavrsen - 13 Sep 2009

That's only needed in combination with NatEditPlugin. It's init routine disables the fullscreen button for now til there's a proper fix.

Added a workaround in NatEditPlugin

-- MichaelDaum - 14 Sep 2009

It is also a problem in PatternSkin so I am now disabling the full screen feature in the version on Release01x00 branch.

This way it does not become a show stopper in 1.0.7.

I leave the feature enabled in trunk so Paul and Michael T can work on fixing it.

-- KennethLavrsen - 14 Sep 2009

This bug was not in 1.0.6 so there is no need to add it to release note for 1.0.7.

I simply allocate it to target release minor (1.1) so it gets on the release blockers for this and not 1.0.7 now that the 1.0.7 has been handled with the already checked in workarounds.

-- KennethLavrsen - 16 Sep 2009

MichaelTempest, Foswikirev:5005 works beautifully, thankyou. My tests were on FW 1.0.6 with latest Wysiwyg and NatSkin. Tests went as follows:
  1. Edit
  2. Enter wysiwyg text
  3. Fullscreen
  4. Enter wysiwyg fullscreen text
  5. Switch to raw
  6. Enter raw text
  7. Switch back to wysiwyg
  8. fullscreen
  9. switch to raw 10 save

Tested on:
  • Opera 10.00 (Linux)
  • Firefox (Iceweasel) 3.0.12 (Linux)
  • Epiphany 2.22.3 (Linux)
  • IE6.0.28800.1106 (Linux/Wine)

-- PaulHarvey - 20 Sep 2009

ItemTemplate edit

Summary Switching to Wiki Text (raw) when TMCE is fullscreen results in mess
ReportedBy PaulHarvey
Codebase 1.0.6, trunk
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component TinyMCEPlugin
Priority Urgent
CurrentState Closed
WaitingFor
Checkins Foswikirev:4909 Foswikirev:4925 Foswikirev:5005 Foswikirev:5012 Foswikirev:5013
TargetRelease patch
ReleasedIn 1.0.7
Topic attachments
I Attachment Action Size Date Who Comment
natedit_mess.pngpng natedit_mess.png manage 47.8 K 11 Sep 2009 - 07:07 PaulHarvey  
pattern_rawmode_fullscreen_mess.pngpng pattern_rawmode_fullscreen_mess.png manage 100.3 K 12 Sep 2009 - 03:28 PaulHarvey pattern skin wiki text fullscreen
pattern_wysiwyg_fullscreen.pngpng pattern_wysiwyg_fullscreen.png manage 56.0 K 12 Sep 2009 - 03:27 PaulHarvey pattern skin wysiwyg fullscreen
wysiwyg_fullscreen.pngpng wysiwyg_fullscreen.png manage 34.3 K 11 Sep 2009 - 07:07 PaulHarvey  
Topic revision: r16 - 20 Sep 2009, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License