Rename cowebsite API functions
This commit is contained in:
parent
fbff7491df
commit
fb7fe0dc0a
@ -52,9 +52,7 @@ WA.nav.goToRoom("/_/global/<path to global map>.json#start-layer-2")
|
|||||||
### Opening/closing web page in Co-Websites
|
### Opening/closing web page in Co-Websites
|
||||||
|
|
||||||
```
|
```
|
||||||
WA.nav.openCoWebsite(url: string, allowApi: boolean = false, allowPolicy: string = "", position: number = 0): Promise
|
WA.nav.openCoWebSite(url: string, allowApi: boolean = false, allowPolicy: string = "", position: number = 0): Promise<CoWebsite>
|
||||||
WA.nav.closeCoWebsite(coWebsiteId: string): Promise
|
|
||||||
WA.nav.closeCoWebsites(): Promise
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Opens the webpage at "url" in an iFrame (on the right side of the screen) or close that iFrame. `allowApi` allows the webpage to use the "IFrame API" and execute script (it is equivalent to putting the `openWebsiteAllowApi` property in the map). `allowPolicy` grants additional access rights to the iFrame. The `allowPolicy` parameter is turned into an [`allow` feature policy in the iFrame](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-allow), position in whitch slot the web page will be open.
|
Opens the webpage at "url" in an iFrame (on the right side of the screen) or close that iFrame. `allowApi` allows the webpage to use the "IFrame API" and execute script (it is equivalent to putting the `openWebsiteAllowApi` property in the map). `allowPolicy` grants additional access rights to the iFrame. The `allowPolicy` parameter is turned into an [`allow` feature policy in the iFrame](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-allow), position in whitch slot the web page will be open.
|
||||||
@ -62,17 +60,16 @@ Opens the webpage at "url" in an iFrame (on the right side of the screen) or clo
|
|||||||
Example:
|
Example:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const coWebsite = await WA.nav.openCoWebsite('https://www.wikipedia.org/');
|
const coWebsite = await WA.nav.openCoWebSite('https://www.wikipedia.org/');
|
||||||
const coWebsiteWorkAdventure = await WA.nav.openCoWebsite('https://workadventu.re/', true, "", 1);
|
const coWebsiteWorkAdventure = await WA.nav.openCoWebSite('https://workadventu.re/', true, "", 1);
|
||||||
// ...
|
// ...
|
||||||
WA.nav.closeCoWebsite(coWebsite.id);
|
coWebsite.close();
|
||||||
WA.nav.closeCoWebsites();
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Opening/closing web page in Co-Websites
|
### Opening/closing web page in Co-Websites
|
||||||
|
|
||||||
```
|
```
|
||||||
WA.nav.getCoWebsites(): Promise
|
WA.nav.getCoWebSites(): Promise<CoWebsite[]>
|
||||||
```
|
```
|
||||||
|
|
||||||
Get all opened co-websites withe their ids and positions.
|
Get all opened co-websites withe their ids and positions.
|
||||||
@ -80,5 +77,5 @@ Get all opened co-websites withe their ids and positions.
|
|||||||
Example:
|
Example:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const coWebsites = await WA.nav.getCowebsites();
|
const coWebsites = await WA.nav.getCowebSites();
|
||||||
```
|
```
|
||||||
|
@ -41,22 +41,7 @@ export class WorkadventureNavigationCommands extends IframeApiContribution<Worka
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
async openCoWebSite(url: string, allowApi?: boolean, allowPolicy?: string, position?: number): Promise<CoWebsite> {
|
||||||
* @deprecated Use openCoWebsite instead
|
|
||||||
*/
|
|
||||||
openCoWebSite(url: string, allowApi?: boolean, allowPolicy?: string) {
|
|
||||||
return queryWorkadventure({
|
|
||||||
type: "openCoWebsite",
|
|
||||||
data: {
|
|
||||||
url,
|
|
||||||
allowApi,
|
|
||||||
allowPolicy,
|
|
||||||
position: undefined,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async openCoWebsite(url: string, allowApi?: boolean, allowPolicy?: string, position?: number): Promise<CoWebsite> {
|
|
||||||
const result = await queryWorkadventure({
|
const result = await queryWorkadventure({
|
||||||
type: "openCoWebsite",
|
type: "openCoWebsite",
|
||||||
data: {
|
data: {
|
||||||
@ -69,7 +54,7 @@ export class WorkadventureNavigationCommands extends IframeApiContribution<Worka
|
|||||||
return new CoWebsite(result.id, result.position);
|
return new CoWebsite(result.id, result.position);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getCoWebsites(): Promise<CoWebsite[]> {
|
async getCoWebSites(): Promise<CoWebsite[]> {
|
||||||
const result = await queryWorkadventure({
|
const result = await queryWorkadventure({
|
||||||
type: "getCoWebsites",
|
type: "getCoWebsites",
|
||||||
data: undefined
|
data: undefined
|
||||||
@ -86,20 +71,6 @@ export class WorkadventureNavigationCommands extends IframeApiContribution<Worka
|
|||||||
data: undefined,
|
data: undefined,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
closeCoWebsite(coWebsiteId: string) {
|
|
||||||
return queryWorkadventure({
|
|
||||||
type: "closeCoWebsite",
|
|
||||||
data: coWebsiteId,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
closeCoWebsites() {
|
|
||||||
return queryWorkadventure({
|
|
||||||
type: "closeCoWebsites",
|
|
||||||
data: undefined,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new WorkadventureNavigationCommands();
|
export default new WorkadventureNavigationCommands();
|
||||||
|
Loading…
Reference in New Issue
Block a user