Cross-Browser Rich Text EditorTuesday April 1st, 2003Kevin Roth wrote in to tell us that he has "created a cross-browser rich-text editor incorporating the new Midas API included with Mozilla version 1.3. Source code is available for download." It works in IE 6 but I can't get it to work in Moz 1.3. The Javascript console tells me: Error: uncaught exception: Permission denied to call method Window.focus Broken here too. :-( Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.4a) Gecko/20030329 It sounds as if you have denied scripts to raise (focus) windows in Preferences > Advanced > Scripts & Plugins. interactivetools.com's htmlArea (at http://www.interactivetools.com/products/htmlarea/ )? That doesn't really work well with mozilla, does it? In fact it only works with ie 5.5 . Could this be adapted to output Wiki tags instead of HTML/CSS? Sure, if you write a XSL that converts HTML -> Wiki that would work. The way back to edit an existing page requires wiki -> html which wiki already does This can actually work w/o the IE specific code. I changed the designmode function to look like this: function enableDesignMode() { frames.edit.document.designMode = "On"; } The "frames." is unecessary as well. In any case, this will work on both Moz. and IE, which makes it a bit easier on web-site designers. Unfortunately, the mozilla specific code doesn't work on IE. It *should* work, but for some reason the "getElementByID" combined with the "designMode" seems to fail (on IE). Therefore, "edit.document.designMode" works, but "document.getElementById('edit').document.designMode" doesn't (doesn't work with 'contentDocument' either). "edit" should be the same as "document.getElementByID('edit')" but in this case it's not for some reason. Luckily Moz works with the IE code, so the function above works on both. :) -Dan Does anyone know, where to implement the onpaste (IE only) event? I tried the following in the enableDesignMode function: var oRTE = frames[rte].document; oRTE.open(); oRTE.write(frameHtml); oRTE.close(); if (!readOnly) oRTE.designMode = "On"; oRTE.document.onpaste = myFunction; but i got an error that says "Permission denied" can anybody help me? Don“t need help anymore. |