window.name = "body" messes up displaying content in frames.

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
Netta
Jr. Propeller Head
Posts: 7
Joined: Thu Jan 04, 2007 11:01 am

window.name = "body" messes up displaying content in frames.

Post by Netta »

Hi Folks,

I am using Flare for generating WebHelp documentation content in the usual way AND also for generating guidance pages which are displayed in browser panels which are embedded in our application. The embedded browsers are actually initialised with a default page which contains a frameset with two named frames. Individual flare content pages are explicitly displayed in one of these frames depending on the state of the system (using the target name). This used to work just fine and was very powerful since our documentation and application were always kept in sync.

Since I upgraded to 3.1, This no longer works. I have debugged it and found that it is due to the first function in MadCapBody.js which sets window.name = "body". This overrides the frame name and so, on the next attempt to display a page in that frame using the original target name, a new window is openned because the original target frame name is no longer there (ie. it's been changed to "body").

Is there a way to disable this behaviour or do I have to write a script to comment this out in my embedded version?

Cheers,
Netta.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: window.name = "body" messes up displaying content in frames.

Post by LTinker68 »

In the short-term, I'd create a copy of the MadCapBody.js file and keep it somewhere outside the project. Edit the file using Notepad and change that line in the file to whatever name or value it was set to before. This is only a temporary solution, so every time you build the project, you open the Output folder and copy your version of the MadCapBody.js file and overwrite the one that was just generated.

In the long term, I'd submit a feature request to http://www.madcapsoftware.com/bugs/submit.aspx and ask for this to be changed back or for it to be a parameter that can be set in the target.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: window.name = "body" messes up displaying content in frames.

Post by doc_guy »

Here is a VERY UNSUPPORTED work around.

Before I begin, let me tell you a couple of warnings:

First, you must make a back-up copy of the original .js file, because if you modify this file and don't have a backup, you may need to reinstall the application to fix problems that arise.

Second, this change will affect every project that you build that uses a WebHelp target. Only make this change if you want it to happen in EVERY WebHelp project you build.

Finally, When you upgrade Flare, this change will be overwritten. You will need to document the changes you make, so you can go back and re-make the change if you ever re-install or upgrade Flare.

Ok. So here's the deal:
  1. Open the following directory on your computer:
    C:\Program Files\MadCap Software\MadCap Flare V3\Flare.app\Resources\WebHelp\Content\SkinSupport\
  2. Locate the MadCapBody.js file.
  3. Make a backup of the MadCapBody.js file. (You might name this "MadCapBody.js.old")
  4. Open the MadCapBody.js file.
  5. Make any desired changes to this file and save them.
  6. Build a WebHelp target to see if your changes work like you want.
Hope this helps.
Paul Pehrson
My Blog

Image
Netta
Jr. Propeller Head
Posts: 7
Joined: Thu Jan 04, 2007 11:01 am

Re: window.name = "body" messes up displaying content in frames.

Post by Netta »

Hi Lisa and Paul,

Thanks for your responses. Looks like I'll have to write a little script to automate this just for this case so that it doesn't get messed up by manual processing and doesn;t break functionality for other users. Paul, I think making the change in the source version of the MadCapBody.js would be unwise becasue, looking into the code a bit further it looks like there are several other features which rely on the fact that the window has been renamed to "body".

Unfortunately my maintenance contract has expired and since I didn't really get any value from the first year's worth, I haven't bothered to renew. In fact the only really useful support I got was from Lisa on this forum (ta)!

So if either of you have the facility to submit a bug report, please feel free to do it on my behalf as this is fairly dodgy code. Instead of just blatting the current window name, it should store the name in a local variable and use that to refer to the frame in the places where it's currently looking for "body" hardcoded... not very elegant :(
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: window.name = "body" messes up displaying content in frames.

Post by doc_guy »

For what its worth, you don't have to have a maintenance contract to submit a bug request. You can do it here:

https://www.madcapsoftware.com/bugs/submit.aspx

Did you at least get a free upgrade to a newer version with your maintenance contract?
Paul Pehrson
My Blog

Image
Netta
Jr. Propeller Head
Posts: 7
Joined: Thu Jan 04, 2007 11:01 am

Re: window.name = "body" messes up displaying content in frames.

Post by Netta »

we did get the upgrade yes... It only ran out a couple of months ago.
Post Reply