Copy link to clipboard
Copied
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–
A special thanks to Eileen for providing help. 🙂
~Vimal
Copy link to clipboard
Copied
Thank you for sharing that Vimal.
See www.grainge.org for RoboHelp and Authoring tips
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Thank you.
cheers,
Christina
Copy link to clipboard
Copied
Correction. I assumed the link did not work because the site got organised. In fact the link is still working just fine, I tried it. Something is blocking it for you so go back to IT or try the link from home.
See www.grainge.org for RoboHelp and Authoring tips
Copy link to clipboard
Copied
I got back to Support and they did their voodoo and downloaded the script for me. Have run it and my problem is now fixed.
A big thank you to both of you. 🙂
cheers,
Christina
Copy link to clipboard
Copied
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