Description

When creating new page using [[NewPage]] macro, one might get FCKeditor when the browser does not support it.

Steps to reproduce

  1. Set your user preferences to "GUI Editor"
  2. Go to MoinMoinBugs and create a new bug using Safari

  3. You get FCKeditor with raw html in the text box, instead of the text editor with wiki markup.

Details

This wiki, Safari 1.2.4, Mac OS X 10.3.7.

Workaround

Append &editor=text to the url and press Enter to get the text editor.

Discussion

This could be solved by sending a tiny test document that check if FCKeditor is available using the function in common.js, and redirect to FCKeditor using Javascript, or to the text editor using meta tag.

Here is an example code:

snif.html:

<html>
<head>
<script type="text/javascript" src="snif.js"></script>
<script type="text/javascript">
if (canUseGUIEditor()) window.location.href = 'gui.html';
</script>
<META HTTP-EQUIV=Refresh CONTENT="0; URL=text.html">
</head>
</html>

snif.js:

function canUseGUIEditor() {
    return true;
}

Test here: http://nirs.dyndns.org/~nir/snif.html

This will create two requests for each request to edit a page with the gui editor, but will make sure we have a correct fallback.

Or we can simply send the text editor, with a javascript redirect to the gui editor. If the javascript will not run, you get the text editor. If it run, you get the gui editor. This will create more load on the server, as you need to read the page from the disk, send the text editor content and then the gui editor content, instead the tiny html above.

Plan


MoinMoinBugConfirmed

MoinMoin: MoinMoinBugs/Wrong editor when using NewPage macro (last edited 2007-10-29 19:16:49 by localhost)