15 Replies Latest reply on Oct 22, 2015 7:02 AM by JGaf

    Customized whthost.js - not working as expected

    JGaf Level 1

      Hi,

       

      I've used a customized whthost.js file for a couple years now with no issues.  Lately, it seems that clicking on a TOC entry does NOT expand it.  Clicking once on a topic in the TOC will display the content in the reading pane, clicking twice on it will (sometimes) expand the TOC.  Subsequent selections in the TOC seem to sporadically expand the TOC entries and then not expand the TOC entries.  I can't figure out why it's not working consistently & correctly.

       

      I've customized whthost.js using William's awesomely helpful information here:  Make WebHelp TOC Wrap | WvanWeelden.eu, including wrapping the TOC around the images.

       

      For fun, I've reapplied the customizations in a newly generated whthost.js thinking there's been an extra space or something in my customized file that I've overlooked and is now causing a problem. No luck.  This happens whether I'm viewing the docs in Chrome or IE, locally.  It doesn't discriminate

       

      I've also customized  the spacing between each level of the TOC.

       

      These are the only customizations in that file.

       

      This problem does not occur on output files, which do not contain the customized file.  Once I copy/paste this file into my published files (or into my output file, the error occurs.

       

      I also apply customized whtbar.js, whskin_banner.htm, whskin_mbars.htm, whskin_tbars.htm files.  But, I believe the TOC issue is in the whthost.js file.

       

      Anyone else have this problem?

       

      thanks!

       

      RH 11.0.4.291,Webhelp

      IE 10.0.9

      Chrome 42.0.2311.135 m

        • 1. Re: Customized whthost.js - not working as expected
          JGaf Level 1

          Is there any way to auto-wrap the TOC text without hacking the script? 

          • 2. Re: Customized whthost.js - not working as expected
            JGaf Level 1

            Similarly, if this error also occurs when I click on a link in the content pane - the TOC will not expand to sync with the topic currently being viewed  (if it's during the time when the toc won't expand).  And yes, I do have "sync TOC" option in the SSL file selected.

            • 3. Re: Customized whthost.js - not working as expected
              Willam van Weelden Adobe Community Professional & MVP

              The whthost.js holds the most important scripts for the TOC, but it could be something else as well. Do you get a different result if you run the modified whthost.js but WITHOUT the other modified files? (Just to make sure that this is the issue.)

               

              If you open the developer console (F12) and click a link, do you get any errors on the console tab?

               

              Unfortunately, in WebHelp there is no way to add reflow other than manually modifying the script.

              • 4. Re: Customized whthost.js - not working as expected
                JGaf Level 1

                William,

                 

                Thanks for responding.

                 

                I tested the project without any modified files (the output), no errors, expansion and syncing are correct.

                I tested the project with all modified files except the whthost.js, no errors, expansion and syncing are correct.

                I tested the project with all modified files, including whthost.js - errors and expansion and syncing are incorrect.

                I tested the project with ONLY the whthost.js - errors and expansion and syncing are incorrect.

                 

                This file contains your suggested modifications + 2 spacing/sizing edits.

                 

                var gsMargin="2pt";

                var gsIndent="25pt";

                 

                 

                I changed them back to the default numbers and tested again, same issues.

                 

                Interestingly, I generated a different version of the project about 3-4 wks ago and I don't have this error.  The only changes to the project are in content only.  I compared the whthost.js script from that earlier version of the project that works correctly, and it is identical to the one I'm using now.

                Several users are reporting this error, so it's not only me.

                 

                When I open the project in IE and click on F12, this is the information I see:

                HTML1527: DOCTYPE expected. The shortest valid doctype is "<!DOCTYPE html>".

                index.html, line 1 character 1

                SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited.

                index.html

                 

                I also see this information when I open a project working correctly.

                 

                Is there any way to wrap the TOC without having to edit this file? (all this time Adobe hasn't made it standard?)

                 

                 


                • 5. Re: Customized whthost.js - not working as expected
                  JGaf Level 1

                  I just wanted to update -

                   

                  It seems that I could not get my issue resolved in time, so I had to use the auto-generated script, without TOC wrapping, for my deadline.  I don't know why my toc expansion and syncing sporadically broke, but if anyone else encounters this error, let me know, and if you know what went wrong, please let me know that too!

                   

                  thank you!

                  • 6. Re: Customized whthost.js - not working as expected
                    Willam van Weelden Adobe Community Professional & MVP

                    This is very strange. I just tried another WebHelp output from RH11 with a modified whthost.js and it all worked like a charm. Perhaps there is a scenario that the change doesn't take into account. Would it be possible to share the project with me so that I can have a look?

                     

                    Does the same issue occur when you generate a sample project and update the whthost.js file?

                    • 7. Re: Customized whthost.js - not working as expected
                      JGaf Level 1

                      yes, same with RH sample.

                       

                      I created a sample project and could reproduced the error again.  I sent it to you.

                       

                      thanks a million for all your help!

                       


                      • 8. Re: Customized whthost.js - not working as expected
                        JGaf Level 1

                        I'm still having this issue. 

                         

                        Are there any files, other than the whthost.js file that I can look at that would be causing the TOC to not expand when selected?  Is this the only file that controls the TOC?

                         

                        As mentioned earlier, a project generated a few weeks prior does not have this issue (I'll call it project 1).  I took project 1's .hhk file and put it into the project which does not expand correctly (I'll call it project 2).  I applied the whthost.js file (from project 1)  to project 2 and the TOC did not expand as selected.

                         

                        Project 2 contains a different stylesheet for the content, but the TOC style, spacing, font, etc are exactly the same.

                         

                        Sometimes if I click enough times on a TOC entry, or when not expanded, move to another entry and  it will expand.......it's flaky.....

                        • 9. Re: Customized whthost.js - not working as expected
                          Willam van Weelden Adobe Community Professional & MVP

                          The cause of this is quite simple: the zoomsearch allows to search in multiple DUCC's at the same time. As long as you stay in the same DUCC, all is well. As soon as you jump with to a topic in another DUCC, it stops working.

                           

                          The original issue was also cause by this, but I could work around that with some JavaScript changes. The TOC is another matter though. I don't see an easy way to overcome this, other than finding out whether you are in a scenario and redirecting the user to a the right DUCC. This is something to take up as a project and you can hire me to dive into this, but it will be at least a full days work.

                           

                          I would suggest looking into the RoboHelp 2015 Dynamic Filters as you can achieve the same there while everything will keep working.

                          • 10. Re: Customized whthost.js - not working as expected
                            mkocik11

                            Using RH10 and I'm having the same problem, seemingly out of the blue. This is happening to me in IE8, Chrome (latest), and Firefox (latest).

                            I downloaded all of the recent patches that corrected the problem with WebHelp in IE10/11 Chrome and Firefox, and things were working fine until recently. Now when I create a new WebHelp output from any of my projects, the TOC entries do not expand until I click other entries 2 or 3 times.

                            I have NOT modified whthost.js, for the record (unless there is some way it gets customized by me doing something with the project).

                            Also not using DUCC.

                             

                            Clients are frustrated over this. Hope Adobe can address this.

                            • 11. Re: Customized whthost.js - not working as expected
                              Willam van Weelden Adobe Community Professional & MVP

                              In your case, the problem would have a different cause. Can you share an example output that exhibits this issue? I would like to take a look. Please contact me at contact [at] wvanweelden [dot] eu.

                              • 12. Re: Customized whthost.js - not working as expected
                                JGaf Level 1

                                Hi,

                                 

                                Still not resolved.  I'm really at a loss here.

                                 

                                The issue where the TOC doesn't expand as expected, and/or only expands after clicking 2-3 other expandable TOC headings, only occurs on published files when I apply the whthost.js customized files. Output files, without the customized whthost.js files work great.

                                 

                                Isn't there a way to wrap the TOC without having to apply a customized file yet?  I really am going to have to release this version WITHOUT wrapping because it's the only way these files work.  It looks terrible unwrapped, honestly and adds another scroll bar!

                                thanks!

                                 


                                • 13. Re: Customized whthost.js - not working as expected
                                  JGaf Level 1

                                  Hi mkocik11 -

                                   

                                  did you find a solution to your problem on this?  thanks....

                                  • 14. Re: Customized whthost.js - not working as expected
                                    JGaf Level 1

                                    Hi,

                                     

                                    I'm not sure what DUCC has to do with the TOC expansion issue.  The issue occurs no matter what "content category" displays.

                                     

                                    It worked on version A, stopped working as expected on version A.1.

                                     

                                    On version A.1:

                                    The TOC only expands after clicking 2-3 expandable TOC headings, then it seems to "catch" and expand and all is well.  Additionally, TOC syncing with the content pane does not work unless the TOC suddenly starts to expand correctly - then everything works.   Something has changed or stopped working between version a and a.1.

                                     

                                    Other than content changes between those versions, plus tweaking the CSS, I can't think of any other changes that occurred.

                                     

                                    Output files, using the non customized whthost.js, work great, TOC expansion & TOC synching works.

                                     

                                    The TOC expansion/syncing issue occurs only when customization is applied.  I've even used a fresh output whthost.js file and applied customizations only to the point of TOC wrapping (not wrapping around images) and it breaks.  I've triple checked everything I can think of to find out why version A is okay and version A.1 is not.

                                     

                                     

                                     

                                    Still using

                                    RH 11.0.4.291,Webhelp

                                    IE 10.0.9

                                    Chrome 42.0.2311.135 m

                                     


                                    • 15. Re: Customized whthost.js - not working as expected
                                      JGaf Level 1

                                      I just wanted to follow-up here with my solution.

                                       

                                      I found an old TOC from an earlier VERSION of the same project which did not have the toc expansion error.

                                       

                                      I copied the good TOC to my current problem project and rebuilt the new TOC by adding/deleting/moving topics as needed.

                                       

                                      Problem solved.

                                       

                                      I still don't know what the cause was!