Popup openWebSite
Add possibility to open a website with a popup 3 cases : Open page GoTo Page OpenCoWebsite
This commit is contained in:
parent
7140637807
commit
8764fe5de5
10 changed files with 282 additions and 544 deletions
49
maps/tests/goToPageScript.js
Normal file
49
maps/tests/goToPageScript.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
var zoneName = "popUpGoToPageZone";
|
||||
var urlPricing = "https://workadventu.re/pricing";
|
||||
var urlGettingStarted = "https://workadventu.re/getting-started";
|
||||
var isCoWebSiteOpened = false;
|
||||
|
||||
WA.onChatMessage((message => {
|
||||
WA.sendChatMessage('Poly Parrot says: "'+message+'"', 'Poly Parrot');
|
||||
}));
|
||||
|
||||
WA.onEnterZone(zoneName, () => {
|
||||
WA.openPopup("popUp","Open Links",[
|
||||
{
|
||||
label: "Open Tab",
|
||||
className: "popUpElement",
|
||||
callback: (popup => {
|
||||
WA.openTab(urlPricing);
|
||||
popup.close();
|
||||
})
|
||||
},
|
||||
{
|
||||
label: "Go To Page", className : "popUpElement",
|
||||
callback:(popup => {
|
||||
WA.goToPage(urlPricing);
|
||||
popup.close();
|
||||
})
|
||||
|
||||
}
|
||||
,
|
||||
{
|
||||
label: "openCoWebSite", className : "popUpElement",
|
||||
callback:(popup => {
|
||||
WA.openCoWebSite(urlPricing);
|
||||
isCoWebSiteOpened = true;
|
||||
popup.close();
|
||||
})
|
||||
|
||||
}]);
|
||||
})
|
||||
|
||||
WA.onLeaveZone(zoneName, () => {
|
||||
if (isCoWebSiteOpened) {
|
||||
WA.closeCoWebSite();
|
||||
isCoWebSiteOpened = false;
|
||||
}
|
||||
})
|
||||
|
||||
WA.onLeaveZone('popupZone', () => {
|
||||
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue