Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Little bug with advanced editor

Quote Reply
Little bug with advanced editor
Hi,

Sometimes a javascript error appears with the advanced editor in french version 1.1.8. I found how to solve it.

Change in editor.js file (admin/templates/common) this

Code:
var cutable = sel.queryCommandEnabled('Cut');
var copyable = sel.queryCommandEnabled('Copy');
var pastable = sel.queryCommandEnabled('Paste');
var linkable = (sel.htmlText != '' && sel.htmlText != '\n<P>&nbsp;</P>');
if ( cutable && outerdoc.all.cut.disabled ) enable (outerdoc.all.cut );
for this
Code:
var cutable = false;
var copyable = false;
var pastable = false;
try {
cutable = sel.queryCommandEnabled('Cut');
copyable = sel.queryCommandEnabled('Copy');
pastable = sel.queryCommandEnabled('Paste');
} catch (e) { }
var linkable = (sel.htmlText != '' && sel.htmlText != '\n<P>&nbsp;</P>');
if ( cutable && outerdoc.all.cut.disabled ) enable (outerdoc.all.cut );


Cheers, Wink

François

Last edited by:

Franco: Jan 2, 2003, 5:37 PM
Quote Reply
Re: [Franco] Little bug with advanced editor In reply to
Hi François,

This is the exact same solution I came up a couple of months ago to fix the problem - I was sure I had posted the fix to this forum, but after several minutes of searching, I can't find it anywhere. This is not just similar - it is identical to the solution that I found (currently contained in the CVS copy of that template).

I also changed the section below it:

Code:
function command (cmd) {
iframe.focus();
try {
editor.execCommand(cmd);
} catch (e) { }
iframe.focus();
}

(the green lines are added), and removed a duplicate "command" function a few lines down in the file.

I've attached the fixed up english and french editor.js files to this post - editor.js is for english and german installations, while fr_editor.js is for the french version, but should be renamed to editor.js. editor.js should go into the admin/templates/common directory.

Thanks, François, for the post. I seem to have forgotten to post the fix Blush.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Little bug with advanced editor In reply to
Hi Jason, Smile

This is the exact same solution since I found that solution in the html code of the present forum. I was not able to reproduce the error on your forum, so I compared the javascript code used on your forum with the javascript code used on mine, and I found some differences... My browser told me that the error was neer the line on the "paste" function. My knowledge in javascript is really not enought good to create myself that kind of solution.

Now I know why I didn't find the solution in the english templates... Wink

François

Last edited by:

Franco: Jan 5, 2003, 1:52 PM
Quote Reply
Re: [Franco] Little bug with advanced editor In reply to
In Reply To:
This is the exact same solution since I found that solution in the html code of the present forum.


Ah... That explains it then Cool

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Little bug with advanced editor In reply to
So, is this a change we all should be making to our forums?

I'm always leary of making change for the sake of change.

Steve

Visit The Guitar Diner
Quote Reply
Re: [Boomer] Little bug with advanced editor In reply to
Quote:
I'm always leary of making change for the sake of change.

It's not a change for the sake of change, it's to fix a bug.
Quote Reply
Re: [Boomer] Little bug with advanced editor In reply to
It fixes a bug in the advanced editor that a very small number of users see. From my experience, it seems to be mainly (but not entirely) non-english language users that run into the problem - but that may be just coincidence since my experience is only with a very small number of cases.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com