Explore the community Forums Lectora Lectora Questions & Answers VAR(BrowserType) in Offline output Reply To: VAR(BrowserType) in Offline output

#388003 Score: 2
Profile photo of Tim K
Tim K
Member
contributor
beginner
intermediate
advanced
friend finder
junior moderator
advocate
wise owl
curious george
Group Member
354 pts
@timk

The help has not been updated for a while. Lectora doesn’t use the Lectora Viewer any more. It’s been changed to use Awesomium as the browser to display content published to offline. The good thing about this is that you now can use Javascript in offline content as well and check the url of the course.

Create a variable, e.g. “offline”

Add two actions on title level:

Action: Modify variable
Target: offline
Type: Set as empty

Action: Run javascript
Javascript:

if (window.location.href.indexOf("file") > -1){
Varoffline.set("yes");
}else{
Varoffline.set("no");
}

The URL of the page will contain “file” if it’s opened offline. You can use the variable in conditions, e.g.

Only if “offline” “equal to” “yes”

This post has received 2 votes up.