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 (Comment Moderation is enabled. Your comment will not appear until approved.)
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
Steve P's Gravatar Hello everyone,
I also got this issue, that my website is running 3.2.4 and it is a KTML lite. I couldn't find a fix for this version. I could find the file mozilla_ie_compat.js it is located in the folder location \ktml2\includes\ktedit, however i could not find the mentiond modules/css/scripts.js the closest I could find was \ktml2\includes\ktedit\modules\linkintrospector\scripts.js but this is a different file. After a while I found some tips on this topic at http://www.pdfok.com/firefox-3-6-ktml , they saved me; and also the info helped me to solve some issues with several people who are using this editor.
# Posted By Steve P | 8/10/10 9:29 AM
wayne's Gravatar Hi everybody, thanks for your reply joshua. I still have a bug for ktml in asp for a link properties, the html is formated correctly and dont thik it will be a doctype issue. If you add a hyperlink the text underlines as usual but the property panel does not change to allow you to add a url, see http://www.paulcookpt.com/adminsection/newtest.asp... and try and add a link. Has anyone else had this problem?
# Posted By wayne | 8/24/10 10:50 AM
Joshua's Gravatar Hi Wayne,

I just tried opening the editor in IE from the link you supplied. I was able to open the editor and make a link in IE, both in version 8, as well as compatibility mode for 7.
# Posted By Joshua | 8/24/10 10:51 AM
rock guitar's Gravatar Is the ktml realy discontinued for dreamweaver
# Posted By rock guitar | 9/3/10 2:35 PM
wayne's Gravatar Hi Joshua thanks for looking. In ie I can add a few characters and click the link button without highlighting the tex, and it puts a link in with access to the properties panel, so I can live with that for now, however in ff i get nothing, have you successfully fixed a ktml to work in ff and ie?
# Posted By wayne | 9/8/10 3:36 PM
Joshua's Gravatar yup, my KTML works just fine in current IE and FF. Not sure what the issue is. Not sure why it isn't working for you in FF. I would supply files, but I have modified the editor for our CMS so it wouldn't work for you directly.
# Posted By Joshua | 9/8/10 3:41 PM
wayne's Gravatar Hi Joshua, just thought id post back, the problem is solved, slightly embarrassingly though the ktml version was a previous of 4.1 not 4.1.6, so did a fresh install added the files and so far so good. Just thought id say thanks for your responses.
# Posted By wayne | 9/10/10 6:02 AM
argumentative essay'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 review or select styles.
# Posted By argumentative essay | 9/11/10 1:12 PM
-'s Gravatar obj_doc.readyState = "complete";

to

obj_wnd.readyState = "complete";

fixed mine!
# Posted By - | 9/13/10 9:26 PM
Johnnyj's Gravatar Hey Joshua,
Do you have any updates on the latest version of FF? It seems that a lot of plugins have become unusable specially the firebug thing?
Any comments?
# Posted By Johnnyj | 9/19/10 2:23 PM

NAVIGATION

Home
About Me

RSS


Search

Subscribe

Enter your email address to subscribe to this blog.

Recent Entries

Google TV Review
Playbook - Developers It's Time To Get Started
cf.Objective 2011 - Speak Your Mind
Timesheets, Project Management, and Invoicing - FreshBooks Review
A New Phase of My Life

Recent Comments

OTA OK?
AnoraDD said: I get 18 of these exact sms's everyday! How do I get it to STOP?!? [More]

Coldfusion Hosting with Network Solutions
LIzm said: Ugh. I have a client who insists on hosting with them and two weeks after first contact, a very simp... [More]

IE nested list item whitespace solution: vertical-align:bottom
Lauren said: Thought I'd add to the thank yous... Thank you! [More]

OTA OK?
Rita said: Thank you, this was very helpful. [More]

OTA OK?
diggs said: Just got it today, T-Mobile. Thanks for the articale about it. [More]

Calendar

Sun Mon Tue Wed Thu Fri Sat
   1234
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    

Archives By Subject

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