FireFox 3.6 KTML Editor Fix

With the introduction of Firefox 3.6 today I was alerted that the KTML editor used by some clients wasn't fully loading. The error indicated a missing setter. It turns out it is an easy fix.

In the file

/ktm/core/mozilla_ie_compat.js

you will find

view plain print about
1obj_doc.readyState = "complete";

This line is trying to set what FF 3.6 apparently thinks is a read only variable. I removed the line. So far no issues.

Next the file:

/ktm/modules/css/scripts.js

view plain print about
1if (this.edit.readyState != "complete") {
2setTimeout(function () {
3_this.init_fillCssClasses();
4},
5400);
6return;
7}

As a dirty hack to test I simply changed it to

view plain print about
1if (1 == 0) {
2setTimeout(function () {
3_this.init_fillCssClasses();
4},
5400);
6return;
7}

Basically the code always waited for the complete value in the readystate but firefox wasn't setting it. So it would never fire. Now we force it to fire by skipping the reload timeout.

So far these are the only two items to fix and the editor is working back to normal. However I am not 100% certain other issues may not come up.

The javascript is minified, so can be hard to read. If you ever need to read it there are some online utilities to help make it readable again. I found this one to be very useful.

TweetBacks
Comments
JD's Gravatar Thanks for the fix, it worked. Have you seen any issues with the editor and CSS Styles drop down? We seem to have lost the ability to view or select styles.
# Posted By JD | 1/25/10 4:14 PM
joshua's Gravatar I have seen FF have issues if the HTML in the editor is super redundant (font on font on font) or malformed. Cleaning up the HTML fixed the drop down. Odd that they were connected though.
# Posted By joshua | 1/25/10 4:29 PM
Fred's Gravatar html as in the page the editor is implemented on or the actual editor itself?
# Posted By Fred | 1/30/10 9:32 AM
joshua's Gravatar For me it will sometimes not allow the editor to change into code view, or when a user does change to code view it deletes all code. I find it only does this with multiple tags wrapping other tags (font over font over font).
# Posted By joshua | 1/30/10 10:27 AM
Fred's Gravatar I have noticed that myself but the problem I have is the editor page is empty, so there is nothing in the "text field", yet I still can't use the css dropdown.
# Posted By Fred | 1/30/10 12:35 PM
joshua's Gravatar I have a new patch actually. The fix above kills the drop down. I want to test this more over the weekend and will blog on the updated patch on Monday. Basically the /ktm/modules/css/scripts.js file has code that checks if readystate is complete before it fires, however our update above prevents that from firing. Removing that code check will let the css load properly.
# Posted By joshua | 1/30/10 1:32 PM
Fred's Gravatar Saw the same and tried to remove the following:
if (this.edit.readyState != "complete") {
setTimeout(function () {
_this.init_fillCssClasses();
},
400);
return;
} else {

Problem is my Javascript experience is not worth mentioning.
# Posted By Fred | 1/30/10 2:26 PM
joshua's Gravatar if I remember right, just change (this.edit.readyState != "complete") to (1 == 0)

It is a crappy hack but basically forces the else which triggers the css mod to load.
# Posted By joshua | 1/30/10 2:34 PM
Richard's Gravatar These fixes have worked on some issues, but any idea why the paragraph button no longer wants to work in the editor? Other source html buttons work just not the paragraph button
# Posted By Richard | 2/2/10 10:41 AM
Dario Vargas's Gravatar Gracias por publicar la solución a la compatibilidad del KTML a Firefox 3.6 y la solucion al panel de subir archivos o subir imagenes por el KTML en internet explorer, realizamos estos dos ajustes y el KTML siguió funcionando de maravilla!, gracias por compartir este post, Saludos desde Colombia.
# Posted By Dario Vargas | 2/6/10 4:07 PM
wayne's Gravatar i have been having issues with the code editor myself, it seems i can no longer copy and paste or that when i paste code into the code editor it submits nothing, has anyone any hacks?
# Posted By wayne | 3/4/10 12:01 PM
Al Johnson's Gravatar HI,

I am still fighting to keep my code going as there is nothing better than KTML nad I have written many mods over the years.

A better fix is simply to change

obj_doc.readyState = "complete";

to

obj_wnd.readyState = "complete";

the varibale is now still added to the object allowing the other code/functionality to remain in place. This probably was always a bug only it took FF 3.6 to expose it.

I love to hook up with anyone interested in keeping KTML/Interakt suite current. I am currently trying to get it fixed to work with PHP 5.3 (this may be a step too far ;-)
# Posted By Al Johnson | 3/9/10 7:50 AM
Joshua's Gravatar While changing that far will load the editor, does it show the drop down class menu correctly now?
# Posted By Joshua | 3/9/10 10:04 AM
Fred's Gravatar Found another bug in Firefox 3.6
When inserting a table you can't select the number of columns.
So I assume something in inserttable.js needs to be fixed.

Like I said previously my java is no good.
Anyone with a solution?
# Posted By Fred | 3/12/10 11:00 AM
GG's Gravatar Thanks for posting this tip, really helpful & it did the trick. Saved me several hours of frustration and a call to my PHP developer!
# Posted By GG | 3/16/10 12:22 PM
HVA's Gravatar Did you find any solution to let the CSS dropDown selector works in FireFox 3.6 ? Please let me know
# Posted By HVA | 3/18/10 5:34 AM
Joshua's Gravatar Note, I updated the code in the original post to reflect the fix for both loading the editor, and showing the CSS class drop down.
# Posted By Joshua | 3/18/10 11:11 AM
Jim's Gravatar Although we have downloaded and put the file mozilla_ie_compat.js into the relevant folder, we are still not seeing any drop down for the CSS selection box - well it drops down but the only words in it are "No CSS Style" - Any clues?
# Posted By Jim | 3/23/10 1:30 PM
Nims's Gravatar Hi Guys,

It seems the site I have taken over is running 3.2.4 (Appears to be KTML lite). I cant seem to find a fix for this version. I can find the file mozilla_ie_compat.js it is located in the folder location \ktml2\includes\ktedit, however i cannot find the mentiond modules/css/scripts.js the closest I can find is \ktml2\includes\ktedit\modules\linkintrospector\scripts.js but this is a different file.

Any ideas? How easy is it to update without breaking anything
# Posted By Nims | 4/13/10 10:59 PM
mac data recovery's Gravatar KTML Lite is supposed to be at around version 4.5 by now. Just update.
# Posted By mac data recovery | 4/20/10 2:13 PM
Jim Camomile's Gravatar Hey, you absolutely ROCK. Thanks for posting this and saving me huge issues with a number of clients using this editor.
# Posted By Jim Camomile | 4/20/10 4:03 PM
Russ Hall's Gravatar Am I the only one who is still having issues with the dropdowns? I tried the fix on this page, which worked for the issue of not being able to edit anything. The files on Interakt's website for patching the issue don't seem to fix the dropdown issue either.

I tried fixing the code, I tried replacing files, and I tried copying and pasting the code--all to no avail. Anyone else still having problems with the dropdowns in FF?
# Posted By Russ Hall | 4/28/10 2:16 PM
Joshua's Gravatar I think the files on the other site are just a copy from my solution. That said it should work just fine. Make sure to clear your cache though.
# Posted By Joshua | 4/28/10 2:35 PM
Russ Hall's Gravatar Working on my laptop OK, so I assume that it's gotta be fixed and that I'm just having a weird caching issue on the desktop PCs. Either way, thanks for the fix!
# Posted By Russ Hall | 4/28/10 3:05 PM
Jim's Gravatar As I commented above, we have downloaded and put the file mozilla_ie_compat.js into the relevant folder but we are not seeing any drop down for the CSS selection box apart from "No CSS Style" and I have cleared the FF cache. I am having to apply styles in HTML code view which is not a problem for me, but others in our team have to use IE or refuse to accept FF update to 3.6
# Posted By Jim | 4/28/10 3:06 PM
Russ's Gravatar @Jim
What OS are you guys running? After clearing my cache and restarting my Win XP desktop (and Firefox on one of the Macs in the office), the issue persists. However, on my Win 7 laptop, it works fine. (as you mentioned, IE works fine). I'm not even sure why there would be a difference between FF on Win7 and XP, though.

(sorry Joshua, if we're hijacking the comments, but you're the best Google hit for this particular issue).
# Posted By Russ | 4/28/10 6:38 PM
Joshua's Gravatar Happy to host the chat. :-) Not sure why the issue isn't working for the drop down for CSS. I can say that FF on my XP box at the office works fine. Could you have the code behind a proxy that is caching as well maybe?
# Posted By Joshua | 4/28/10 6:42 PM
Essay's Gravatar Thanks for the post. It has helped saved me some big issues with a few of my clients who are using this editor.
-
Thanks and continue the good work
_________________________________
- Jean Essay
# Posted By Essay | 5/6/10 4:24 AM
wayne's Gravatar Hi, this site has been a life saver, and I agree its been a struggle to find an editor as good as ktml in regards to adding templates etc. Has anyone had an issue with the link property? I have updated my js with help form above but now if i select the link button it puts an a tag in but the prpoerties panel is not avaialable to add teh specific url etc

Any thoughts?
# Posted By wayne | 5/12/10 7:08 AM
essay example's Gravatar Hey, you absolutely ROCK. Thanks for posting this and saving me huge issues with a number of clients using this editor. 100 htanks man!!
# Posted By essay example | 6/2/10 9:37 AM

NAVIGATION

Home
About Me

RSS


Search

Subscribe

Enter your email address to subscribe to this blog.

Recent Entries

Inception Plot Questions
Random Chuck Norris Fact Generator With A Twist
Virtual Currency for Buses
Applying ColdFusion Security Patches Gotcha
Privacy, Walled Gardens, Standards and Our Future

Recent Comments

KTML File Uploads Hang in IE7 with Flash 10 and How to Fix
Eric said: Thanks much [More]

Inception Plot Questions
hohack said: @ switchkosterice 5 comments, those kids are from when mal is alive still [More]

Inception Plot Questions
Ira said: Just saw it a 2nd time. Do so, and pay extremely close attention to two details throughout the film:... [More]

Inception Plot Questions
said: [More]

Inception Plot Questions
switchkosterice said: The kids at the end actually have aged. In fact, they're an entirely different (and older) set of ac... [More]

Calendar

Sun Mon Tue Wed Thu Fri Sat
    123
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Archives By Subject

blogs (31) [RSS]
books (4) [RSS]
Crazy (39) [RSS]
DIY (8) [RSS]
Flex (3) [RSS]
games (10) [RSS]
GRRR (13) [RSS]
Ideas (11) [RSS]
Local (14) [RSS]
LOLpics (2) [RSS]
money (9) [RSS]
music (3) [RSS]
Personal (27) [RSS]
Photos (8) [RSS]
Politics (8) [RSS]
Projects (22) [RSS]
Review (19) [RSS]
RPM (9) [RSS]
Spam (16) [RSS]
Technology (68) [RSS]
Testing (3) [RSS]
TV (15) [RSS]
video (32) [RSS]
Web Dev (224) [RSS]
World of Warcraft (16) [RSS]