Dr Fragen in the operating room

Opening 2 browser windows

·

In fixing Radio’s File menu choices for “View in Browser” and “Save As HTML” I found that 2 browser windows were opening if the outline was from the ODB.
Here’s what happens. When you choose “Save As HTML” from the File menu the Frontier.tools.windowTypes.commands.saveAsHtml is called. This calls Frontier.tools.data.windowTypes.outlinerFile.saveAsHtml. This script has the bundle added by Dave on 4/27/02 that opens the document in the web browser.
If you call “View in Browser” from the File menu the Frontier.tools.windowTypes.commands.viewInBrowser script is called. This then calls Frontier.tools.windowTypes.commands.saveAsHtml and follows the path above. However, once finished with that path it goes back to the Frontier.tools.windowTypes.commands.viewInBrowser script which the opens a browser window with the html. Consequently there are now 2 open browser windows.
The easiest change is to comment out the bundle that Dave added to the Frontier.tools.data.windowTypes.outlinerFile.saveAsHtml script. The menu command doesn’t expressly state that you will see the results so it makes it easy enough to comment this out and still retain the intended function.
There is another change that also needs to be made to complete this. In Frontier.tools.windowTypes.commands.saveAsHtml the line:
From:

if Frontier.tools.windowTypes.findWindowType (adradrtable:@adrtype, adrwindow:adr) {
   if defined (adrtype^.saveAsHtml) {
      if adrtype^.saveAsHtml (adr, adrFilepath, flPreview)  {
         return (false)}}}

To:

if Frontier.tools.windowTypes.findWindowType (adradrtable:@adrtype, adrwindow:adr) {
   if defined (adrtype^.saveAsHtml) {
      if adrtype^.saveAsHtml (adr, adrFilepath, flPreview) {
         return (true)}}}

These changes will make the following happen. First, when the “Save As HTML” command is chosen the file will be saved and no browser window will be opened. Second, when the “View in Browser” command is chosen only one browser window will be opened.
I believe that was the original intent. I’m sure I’ll be corrected if I’m wrong here.
Boy it takes a lot of revisions to make this code look pretty.