View Single Post
Old 05-30-2012, 10:32 AM   #35
mike2046
Member
mike2046 knows what time it ismike2046 knows what time it ismike2046 knows what time it ismike2046 knows what time it ismike2046 knows what time it ismike2046 knows what time it ismike2046 knows what time it ismike2046 knows what time it ismike2046 knows what time it ismike2046 knows what time it ismike2046 knows what time it is
 
Posts: 15
Karma: 2006
Join Date: Mar 2012
Location: UK
Device: Kindle
accook - re your post

I've tried using Mobipocket Creator again today, having seen your post. I now find that I have the same problem ie it doesn't work. Something has evidently changed recently as a result of a Windows 7 update and I think it again has something to do with the javascript engine used by IE9 and the fact it is not 100% compatible with IE8 even in compatibility mode. This led to a problem with empty fields when using the Table of Contents option.

I've investigated it on the Guide option and I think it is for a similar reason ie one of the "Filename" or "onclick" fields is always empty. Something has changed in IE9 and the way they are handled now results in an error with the empty field.

I found that by adding some code to set these fields to "" if they were empty seems to fix the problem. I did this as follows

In the Guide.html file in the html folder there is a function for setting the guide items using the values you have chosen

Code:
 function update_guide_items()
About 18 lines down within this function is the following code
Code:
for (var i = 0; i < document.all.guides.rows.length - 2; i++)
  {
    guides[i] =
    [
      get_edited_item_field("guide__" + i + "__title"),
      get_edited_item_field("guide__" + i + "__href"),
      get_edited_item_field("guide__" + i + "__type"),
      get_edited_item_field("guide__" + i + "__onclick")
    ];
I inserted the following lines immediately after it
Code:
	if (guides[i][1] == "")
        {    guides[i][1] = "";
	}
	if (guides[i][3] == "")
        {    guides[i][3] = "";
	}
so it looks like this
Code:
  for (var i = 0; i < document.all.guides.rows.length - 2; i++)
  {
    guides[i] =
    [
      get_edited_item_field("guide__" + i + "__title"),
      get_edited_item_field("guide__" + i + "__href"),
      get_edited_item_field("guide__" + i + "__type"),
      get_edited_item_field("guide__" + i + "__onclick")
    ];


    if (guides[i][1] == "")
    {    guides[i][1] = "";
	}
    if (guides[i][3] == "")
    {    guides[i][3] = "";
	}
The rest of the code below this should be left untouched.

This appears to fix the current problem with the guide option. Only try this if you're confident about making the changes. Also make a backup copy of the guide.html file before making any changes so you can restore the original file if you need to.

Note that the above changes are in addition to the "compatibility mode" changes described at the start of this thread.

Last edited by mike2046; 05-30-2012 at 11:04 AM. Reason: add note that compatibility changes still needed
mike2046 is offline   Reply With Quote