8 Replies Latest reply on Oct 17, 2006 6:07 PM by Just Mary

    Resizing the help window when clicking "Show"

    Just Mary Level 1
      I have a WebHelp project (RH X5) with some page-level help topics. When the user clicks "Show" in a topic to open the full help system with navigation framework, I'd like the window to be resized (enlarged, specifically). Does anyone know how to accomplish this? I'm fairly certain I'll have to edit generated files (probably whtopic.js), which doesn't thrill me, but I can't tell where/how to do this.
        • 1. Re: Resizing the help window when clicking "Show"
          Gravenstein Level 2
          Bump.

          I'd like to know, too.
          • 2. Re: Resizing the help window when clicking "Show"
            MergeThis Level 4
            Why aren't you opening the full help system for your users, instead of forcing them to click the Show link?

            The call from the application should be to your start page first, then the related CSH page (Start_page.htm#screen_name.htm).


            Good luck,
            Leon
            • 3. Re: Resizing the help window when clicking "Show"
              Gravenstein Level 2
              Leon, in my case it's because the user is already in a specially-constucted, context-sensitive topic. Without going into a bunch of detail, let's just say that it makes sense in our application to do it this way.

              Appreciate your thoughts on opening the original topic with toc. Do you have any suggestions on the original question as stated?

              G
              • 4. Re: Resizing the help window when clicking "Show"
                HKabaker Level 2
                In whtopic.js,

                note the insertion of

                window.resizeTo(nnn,nnn);

                Try it!

                Harvey


                • 5. Re: Resizing the help window when clicking "Show"
                  Gravenstein Level 2
                  Harvey, thank you, that's terrific! I modified the line a bit, because my original window is located at the top right of the screen. The following compensates for the new size, plus offsets it vertically a bit. Don't know if I'll keep the vertical offset or not, but that's no biggie. Here's what I ended up with:

                  else if(sType=="show")
                  {
                  if(isTopicOnly()&&(!gbOpera6||gbOpera7))
                  {
                  var sTitle="Show Navigation Component";
                  goShow=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3);
                  sButton="<a title=\""+sTitle+"\" class=\"whtbtnshow\" href=\"javascript:void(0);\" onclick=\"window.resizeTo(800,600);window.moveTo(200,20); show();return false;\">";

                  This will definitely improve how things work. Thanks again.

                  G
                  • 6. Re: Resizing the help window when clicking &quot;Show&quot;
                    HKabaker Level 2
                    G,

                    You may want to get some user reaction to this.

                    Suppose I have adjusted the sizes and positions of the open windows, including WebHelp, to see the application and help at the same time.

                    Now I want to see the TOC, and -- POW! -- there it goes back.

                    I'd be annoyed, but maybe your users don't work with more than one window open.

                    Harvey

                    • 7. Re: Resizing the help window when clicking &quot;Show&quot;
                      Gravenstein Level 2
                      Given our most common usage scenario, I think that it's stil a net gain, even if the situation you describe does happen occasionally. But you're right, of course - it does warrant testing. Fortunately, we have a chance to give the idea a little run time before committing.

                      G
                      • 8. Re: Resizing the help window when clicking &quot;Show&quot;
                        Just Mary Level 1
                        What I ended up doing was adding the following JavaScript below the head tags in the file index.html (which is the name of my start page):

                        <script language="JavaScript1.2">
                        <!--
                        if (document.all) {
                        top.window.resizeTo(600,600);
                        }
                        else if (document.layers||document.getElementById) {
                        if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
                        top.window.outerHeight = 600;
                        top.window.outerWidth = 600;
                        }
                        }
                        //-->
                        </script>

                        This ensures that when users click the "Show Table of Contents" link on a context-sensitive help topic, the full help set opens in the specified window size. Because the JavaScript is placed in the generated file index.html, I have to reinsert it each time I publish WebHelp. I'd rather be able to accomplish this in a source file, but....

                        You could also indicate the coordinates of the window by placing the following line right after the start comment tag:

                        top.window.moveTo(100,100);

                        [where you replace (100,100) with the x,y coordinates you want].

                        I found this on the Web, but I've already forgotten where.