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
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 skin wiki text fullscreen:
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:
- Edit
- Enter wysiwyg text
- Fullscreen
- Enter wysiwyg fullscreen text
- Switch to raw
- Enter raw text
- Switch back to wysiwyg
- fullscreen
- 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