Make Context-sensitive help window come to top

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
tomjohnson1492
Propeller Head
Posts: 90
Joined: Wed Nov 07, 2007 11:08 pm
Location: Salt Lake City
Contact:

Make Context-sensitive help window come to top

Post by tomjohnson1492 »

I've implemented context-sensitive help with a webhelp application on a java platform. I'm calling the help like this:

<a href="javascript:FMCOpenHelp (1, null, null, null);">Help</a>

However, this method is somewhat problematic. If the user doesn't close the help (just minimizes it or clicks on the application window), the next time he or she clicks a help button, the new help topic will load in the old help window. Most likely the user won't even see it. Do you know how to make the help window remain on top until the user closes it? Or at least make the help window come forward when the user clicks another help button?
-------------
my blog/podcast: http://www.idratherbewriting.com
Ryan Cerniglia

Re: Make Context-sensitive help window come to top

Post by Ryan Cerniglia »

There are a couple different approaches to this problem. The easiest one to implement is to place this code in the body tag of the main WebHelp page (Default.htm)

Code: Select all

<body onBlur="self.close()">
This code will close the window when they click out of the help, but it's probably not exactly what you want. You won't have to rebuild the help at this point, though :)

Alternatively, you could try placing some JavaScript code in every topic using a MasterPage:

Code: Select all

<script type="text/javascript">window.onLoad=window.top.focus();</script>
Not 100% sure the second will work, but it should lead you on the right direction on this one
tomjohnson1492
Propeller Head
Posts: 90
Joined: Wed Nov 07, 2007 11:08 pm
Location: Salt Lake City
Contact:

Re: Make Context-sensitive help window come to top

Post by tomjohnson1492 »

Thanks Ryan for the workaround. I ended up implementing something else, which I described here: http://www.idratherbewriting.com/2009/0 ... ck-on-top/

1. Go to C:\Program Files\MadCap Software\MadCap Flare V4\Flare.app\Resources\WebHelp or wherever you installed Flare.
2. Open Default.js in Notepad.
3. Search for window.open( cshString, “_MCWebHelpCSH”, browserOptions + size ); and delete it.
4. Insert these two lines in its place:

var newWindow = window.open( cshString, “_MCWebHelpCSH”, browserOptions + size );

newWindow.focus();

5. Completely wipe away the previously published target and reupload or republish your files.
-------------
my blog/podcast: http://www.idratherbewriting.com
Post Reply