New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists

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

Priority: Urgent
Current State: Closed
Released In: 1.0.7
Target Release: patch
Applies To: Extension
Component: TinyMCEPlugin
Reported By: PaulHarvey
Waiting For:
Last Change By: KennethLavrsen
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, distro:a51f13330191 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
Checkins Rev 4909 not found distro:5ad88235b021 distro:a51f13330191 distro:506f507b3c29 distro:a4b9b2b4dbaa
TargetRelease patch
ReleasedIn 1.0.7
Topic attachments
I Attachment Action Size Date Who Comment
natedit_mess.pngpng natedit_mess.png manage 47 K 11 Sep 2009 - 07:07 PaulHarvey  
pattern_rawmode_fullscreen_mess.pngpng pattern_rawmode_fullscreen_mess.png manage 100 K 12 Sep 2009 - 03:28 PaulHarvey pattern skin wiki text fullscreen
pattern_wysiwyg_fullscreen.pngpng pattern_wysiwyg_fullscreen.png manage 55 K 12 Sep 2009 - 03:27 PaulHarvey pattern skin wysiwyg fullscreen
wysiwyg_fullscreen.pngpng wysiwyg_fullscreen.png manage 34 K 11 Sep 2009 - 07:07 PaulHarvey  
Topic revision: r16 - 20 Sep 2009, KennethLavrsen - This page was cached on 21 Sep 2018 - 07:38.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy