context-sensitive help links break in Chrome and IE

Oxygen general issues.
urbanrobots
Posts: 86
Joined: Sun May 03, 2015 7:34 pm
Location: San Francisco

context-sensitive help links break in Chrome and IE

Post by urbanrobots »

Hello,

If a person views the webhelp in Chrome or IE, the webhelp links break after they click OK to the error about JavaScript. Is there any way to suppress this error message and automatically load the frameset version of the webhelp? We want to be able to link to any page in the webhelp no matter what browser a person uses.

Here is the error from Chrome for reference:
Chrome limits JavaScript functionality when a page is loaded from the local disk. This prevents the normal help viewer from loading.
You will be redirected to the frameset version of the help.
Thanks for your help.

Take care,
- Nick
bogdan_cercelaru
Posts: 222
Joined: Tue Jul 01, 2014 11:48 am

Re: context-sensitive help links break in Chrome and IE

Post by bogdan_cercelaru »

Hello,

To automatically load the frameset version of the WebHelp when you use it locally, you should edit the "OXYGEN_DIR/frameworks/dita/DITA-OT/plugins/com.oxygenxml.webhelp/oxygen-webhelp/resources/skins/desktop/toc_driver.js" file, changing the following code (line 47):

Code: Select all


	var warningMsg = 'Chrome limits JavaScript functionality when a page is loaded from the local disk. This prevents the normal help viewer from loading.\nYou will be redirected to the frameset version of the help.';
if (confirm(warningMsg)) {
// using Chrome to read local files
redirect('index_frames.html');
} else {
alert ("Not all features are enabled when using Google Chrome for webhelp loaded from local file system!");
var warningSign = '<span id="warningSign"><img src="oxygen-webhelp/resources/img/warning.png" alt="warning" border="0"></span>';
$('#productTitle .framesLink').append(warningSign);
$('#warningSign').mouseenter(function () {
$('#warning').show();
});
$('#warningSign').mouseleave(function () {
$('#warning').hide();
});
var warning = '<div id="warning">Not all features will be enabled using Google Chrome for webhelp loaded from local file system!</div>';
$('#productTitle .framesLink').append(warning);
};
with:

Code: Select all


	var p;
try {
p = parseUri(window.location.href);
} catch (e) {
debug(e);
}
redirect('index_frames.html?' + p.query);
Using this code, the browser will pass the contextId parameter to the frameset version of WebHelp.

Let me know if you need any further assistance.

Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
urbanrobots
Posts: 86
Joined: Sun May 03, 2015 7:34 pm
Location: San Francisco

Re: context-sensitive help links break in Chrome and IE

Post by urbanrobots »

Hi, Bogdan --

Thanks for the information. I like how the user does not need to interact with an error message to access the webhelp. However, this does not solve the problem of context-sensitive links. If you try to directly access a file that is not index_frames.html, does the webhelp load the page or does it just load index_frames.html? For me, any link to a specific file just loads index_frames.html and not the specific HTML page.

Is there a way to capture the file name in the JavaScript so that the page loads index_frames.html#<file_name>.html instead?

Thanks,
- Nick
bogdan_cercelaru
Posts: 222
Joined: Tue Jul 01, 2014 11:48 am

Re: context-sensitive help links break in Chrome and IE

Post by bogdan_cercelaru »

urbanrobots wrote: Is there a way to capture the file name in the JavaScript so that the page loads index_frames.html#<file_name>.html instead?
There is no easy way to do that.
Instead, you can use the contextId parameter to link to specific file from your WebHelp. Here you can find more information regarding this parameter: Output Formats / WebHelp Output / Context-Sensitive WebHelp System.
Using that parameter, the modified code will automatically redirect your users to the frameset version of WebHelp, which will load the requested page.

Best regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply