Skip to main content
Participant
February 25, 2013
Question

Pop-up incorrect placement - Fix

  • February 25, 2013
  • 3 replies
  • 2514 views

Issue: Incorrect location of pop-up windows.

Cause: The possible reason of this issue could be a pop-up window or an image-pop-up window and "Drop-down Hot Spot" or "Expanding Hot Spot" text exist in a topic.

RH version: I faced the issue in RH v8 with patch 2. (Not sure about other versions!)

Output: CHM, WebHelp

Solution: As a solution to the pop-up windows not showing at correct location, a script file was provided by Praful Jain (see his post on the above forum at Post#17 for more details.)

I had the same issue with the pop-up windows in few topics while in other topics it worked well. After running the said script file, the issue did not resolve for me and pop-ups were showing up at top left corner of the Help window.

I found that the script rightly resolves the issue of normal pop-up windows but it does not fix the image-map pop-up windows issue, and I was using image-map pop-ups in my window.

I did some modification to the script and executed the modified script in my project. I got my issue of image-map pop-ups incorrect placement fixed.

I have uploaded the modified version of the script file @ https://workspaces.acrobat.com/?d=L77ZP59R4Y6rTo9lG8Q4DA

Hope this script helps to all those who are facing the same problem in their projects. It worked very well for me, but I would advise all to take backup of their project before running this script.

Follow the below steps to executing the script file–

  1. Back up your project before proceeding further.
  2. Download the script file and import in script explorer in RoboHelp 8.
  3. Open the project which is having popup issue and run this script file.
  4. Once the script file execution is complete, Click on Tools>Update DHTML Effects in Topics.. menu item, and click Yes on the message box.
  5. Preview topic or generate CHM output and see if popup are working fine as expected or not.

A special thanks to Eileen for providing help. 🙂

~Vimal


This topic has been closed for replies.

3 replies

Adobe Employee
February 28, 2014

Since workspaces.acrobat.com is retiring soon, placing the file here itself:

---------------------------------------------------------

/************************************************************************************************************

* $$FileName                    Popup Placement Fixer.jsx

*

* $$Description             Sample ExtendScript file Fixes the popup placement issues in CHM output of RoboHelp 8

*

* Author                                        Praful Jain

* Copyright (c) 2009 Adobe Systems Incorporated. All Rights Reserved.

* Modified by: Vimal Chhutani (22.02.2013) to include Image Map pop-window placement

*************************************************************************************************************/

var topicmgr;

main();

function main()

{

          msg('Starting The Fixing Process');

          topicmgr = RoboHelp.project.TopicManager;

          FixAllPopups();

          msg('Done with Fixing');

}

function FixAllPopups()

{

          if(topicmgr.count>0)

          {

                    var topic = topicmgr.item(1);

                    while(typeof(topic)!='undefined')

                    {

                              FixPopupInTopic(topic.path);

                              topic = topic.next;

                    }

          }

}

function FixPopupInTopic(filepath)

{

          msg('Parsing Topic '+filepath);

          //we will create al popup ID with name PopupID+count

          var stringToSearch = 'javascript:bsscpopup(';

          var tokenmgr = RoboHelp.getTokenManager(filepath);

          var bSave = false;

          if(typeof(tokenmgr)!='undefined')

          {

                    if(tokenmgr.count>0)

                    {

                              var token = tokenmgr.item(1);

                              while(typeof(token)!='undefined')

                              {

                                        //check if it is text or not

                                        if(token.tokenType == RoboHelp.TokenType.TOKENTAG) // && token.tagType == RoboHelp.TagType.TAGANCHOR)

                                        {

                                                            //we need to find the href attribute and see if it contains  javascript:BSSCPopup(

                                                            var hrefString = token.getAttribute('href');

                                                            if(typeof(hrefString)==='string' && hrefString.length>0)

                                                            {

                                                                      var orghrefString = hrefString;

                                                                      hrefString = hrefString.toLowerCase();

                                                                      if(hrefString.indexOf(stringToSearch)!=-1)

                                                                      {

                                                                                //this is the token with popup link, we need to find the onclick attribute now

                                                                                var onClickAttribute = token.getAttribute('onclick');

                                                                                if(typeof(onClickAttribute)=='undefined' || onClickAttribute.length==0)

                                                                                {

                                                                                          msg('Found buggy popup Links Fixing now');

                                                                                          //we found a popup with issue

                                                                                          //fix the popup now

                                                                                          //we need to set the href as javascript:void(0);

                                                                                          token.setAttribute('href','javascript:void(0);');

                                                                                          //now add the onMouseover attribute

                                                                                          token.setAttribute('onmouseover','if (parseInt(navigator.appVersion) >= 4 && typeof(BSPSPopupOnMouseOver) == \'function\') BSPSPopupOnMouseOver(event);');

                                                                                          //set onclick attribute now

                                                                                          orghrefString +=';return false;';

                                                                                          token.setAttribute('onclick',orghrefString);

                                                                                          bSave = true;

                                                                                }

                                                                      }

                                                            }

                                        }

                                        token = token.next;

                              }

                    }

          }

          else

                    alert('there is some error in getting the token manager');

 

          if(bSave)

          {

                    msg('saving file '+filepath);

                    tokenmgr.save();

          }

}

function msg(szString)

{

          RoboHelp.project.outputMessage (szString);

          RoboHelp.project.outputMessage ('\n');

}

---------------------------------------------------------

~Amit Agarwal

cnevin
Known Participant
April 25, 2013

Hi,

Is this script file still available?

I am having the same pop-up location problem as mentioned and would like to try the script on it. Unfortunately, when I click on the link above, I am redirected to a blank screen. I have checked with my company Support and they say it isn't due to our firewall.

regards,

Christina

Peter Grainge
Community Expert
Community Expert
April 26, 2013

It is because the host site got reorganised. I have put out a request for the new link.


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
cnevin
Known Participant
April 26, 2013

Thank you.

cheers,

Christina

Peter Grainge
Community Expert
Community Expert
February 25, 2013

Thank you for sharing that Vimal.


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.