Atrium detection

Use this board to ask questions or have discussions with other Atrium users.
Post Reply
SeanTyree
Profound User
Posts: 76
Joined: Fri Jan 11, 2013 6:11 pm
First Name: Sean
Last Name: Tyree
Company Name: US HealthWorks
State / Province: California
Zip / Postal Code: 91355
Country: United States
Contact:

Atrium detection

Post by SeanTyree »

Is there any way to tell if a ProfoundUI program is running within Atrium?
I want to respond to a button click with Atrium.launchURL when the user is running inside of Atrium and pui.openURL when not running Atrium.

Thanks,
Sean
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Atrium detection

Post by David »

You can determine that with this bit of JavaScript:

Code: Select all


if (parent != window && parent.Atrium) {

  // Running inside Atrium.

}

The first condition checks to see if you are running in a frame. The 'parent' will be the same as 'window' when not running in a frame, but will be set to the parent page's 'window' when running inside a frame. The 2nd condition checks to see if the parent page has a property called 'Atrium', which then indicates that you are inside Atrium.
SeanTyree
Profound User
Posts: 76
Joined: Fri Jan 11, 2013 6:11 pm
First Name: Sean
Last Name: Tyree
Company Name: US HealthWorks
State / Province: California
Zip / Postal Code: 91355
Country: United States
Contact:

Re: Atrium detection

Post by SeanTyree »

Thanks David!
Worked like a charm.

Sean
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests