7 Replies Latest reply on Jul 30, 2008 1:49 AM by NL_Derek-GsBV5a

    Editing HTML affects Browsing

    NL_Derek-GsBV5a Level 1
      In the FAQ of help-info.de I find the following:

      ------------------------------------------------------------------------------------------ -----
      Q: Is there a way to specify that as soon as a page loads in the "main" window of the CHM viewer, I should be able to immediately use the PgUp, PgDn, Up-Arrow or Down-Arrow keys on the keyboard, without having to first click the mouse arrow somewhere in the "main" window?

      A: You need to set the focus to the page in which you want to scroll, by changing its BODY start-tag to this:
      <body onLoad="self.focus()">
      ------------------------------------------------------------------------------------------ -----

      A quick check shows that it works, and we have had complaints from users about always having to click to move the focus, so it sounds like a good idea for us.

      But I have always heard that it is a bad idea to touch the HTML when using a WYSIWYG editor; is this edit safe and/or stable (that is, will RoboHelp crash and/or silently undo it one day)?

      We run RoboHelp 7.02.001 under Windows XP.
        • 1. Editing HTML
          MergeThis Level 4
          <body onload can be edited in the TrueCode mode without breaking anything (assuming, of course, you do it right!).

          By the way, best practice for any edits in the TrueCode is to Save your changes before you return to WYSIWYG mode.


          Good luck,
          Leon
          • 2. Editing HTML
            MergeThis Level 4
            Duplicate post...ignore.
            • 3. Re: Editing HTML
              NL_Derek-GsBV5a Level 1
              Thanks for the reassurance Leon; but I thought about it last night and I realize that I shall have to make the change to every topic. Do you think it will be safe using RoboHelp's Multi-File-Find-and-Replace? or should I use another tool?

              Going even further, is there any way I can have the modified <body> tag automagically included in newly created topics?

              --- Derek
              • 4. Re: Editing HTML
                MergeThis Level 4
                Keep in mind that the RH MFF&R does not deal with line breaks, tabs, or multiple spaces.

                Given that, if your topics are all currently holding <body> only, RH can handle this type of replacement.

                For anything more complex (see above), get FAR (shareware) or BK ReplaceEm (freeware), both endorsed by many forum members (I'm partial to FAR, myself).


                Good luck,
                Leon
                • 5. Re: Editing HTML
                  RoboWizard Level 4
                  Hi Derek and Leon

                  Here's a couple of ideas that might work.

                  1. Create a topic template. Inside the template, place some JavaScript. I tried a script that looks like below and it seems to work.

                  <script>document.focus();</script>

                  I inserted this script just above the closing Body tag like this:

                  <script>document.focus();</script>
                  </body>

                  Or, 2. You might insert the same type of script in a footer attached to a topic template. Then apply the footer to all existing topics to propagate the script.

                  • 6. Re: Editing HTML
                    NL_Derek-GsBV5a Level 1
                    Hi again,

                    I tried editing my project using MFFAR, changing <body> to <body onLoad="self.focus()">. That went fine, and the focus was as desired. But my Browse Sequences had disappeared. I tried the usual things, but that didn't help. I reversed the edit (that is, in MFFAR I changed <body onLoad="self.focus()"> to <body>) and my Browse Sequences came back.

                    Does anybody have suggestions to help me?

                    --- Derek
                    • 7. Re: Editing HTML
                      NL_Derek-GsBV5a Level 1
                      The problem seems to be the Default Topic specified in the SSL, which is the home page of my CHM. If that topic contains the 'magic' tag <body onLoad="self.focus()"> then I have no Browse Sequences; if it contains a plain <body> tag then I have Browse Sequences. I now have the 'magic' tag in all other topics of my project, and all seems to be OK.

                      But I still don't understand what is going on; can anyone enlighten me?

                      --- Derek