From c025d1798bedb9a68389d729cf15013b69ef0972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Mon, 10 May 2021 12:14:31 +0200 Subject: [PATCH] Renaming restorePlayerControls/disablePlayerControls Putting "controls" in the plural form: - restorePlayerControl => restorePlayerControls - disablePlayerControl => disablePlayerControls --- front/src/Api/Events/IframeEvent.ts | 6 +++--- front/src/Api/IframeListener.ts | 4 ++-- front/src/iframe_api.ts | 12 ++++++------ maps/Tuto/scriptTuto.js | 4 ++-- maps/tests/script.js | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/front/src/Api/Events/IframeEvent.ts b/front/src/Api/Events/IframeEvent.ts index 1ed853c9..2f703222 100644 --- a/front/src/Api/Events/IframeEvent.ts +++ b/front/src/Api/Events/IframeEvent.ts @@ -25,8 +25,8 @@ export type IframeEventMap = { goToPage: GoToPageEvent openCoWebSite: OpenCoWebSiteEvent closeCoWebSite: null - disablePlayerControl: null - restorePlayerControl: null + disablePlayerControls: null + restorePlayerControls: null displayBubble: null removeBubble: null } @@ -52,4 +52,4 @@ export interface IframeResponseEvent { } // eslint-disable-next-line @typescript-eslint/no-explicit-any -export const isIframeResponseEventWrapper = (event: { type?: string }): event is IframeResponseEvent => typeof event.type === 'string'; \ No newline at end of file +export const isIframeResponseEventWrapper = (event: { type?: string }): event is IframeResponseEvent => typeof event.type === 'string'; diff --git a/front/src/Api/IframeListener.ts b/front/src/Api/IframeListener.ts index d3b8ce4f..29e87b8a 100644 --- a/front/src/Api/IframeListener.ts +++ b/front/src/Api/IframeListener.ts @@ -96,10 +96,10 @@ class IframeListener { else if (payload.type === 'closeCoWebSite') { scriptUtils.closeCoWebSite(); } - else if (payload.type === 'disablePlayerControl') { + else if (payload.type === 'disablePlayerControls') { this._disablePlayerControlStream.next(); } - else if (payload.type === 'restorePlayerControl') { + else if (payload.type === 'restorePlayerControls') { this._enablePlayerControlStream.next(); } else if (payload.type === 'displayBubble') { diff --git a/front/src/iframe_api.ts b/front/src/iframe_api.ts index 6d0ef354..0bef1cc7 100644 --- a/front/src/iframe_api.ts +++ b/front/src/iframe_api.ts @@ -20,8 +20,8 @@ interface WorkAdventureApi { goToPage(url : string): void; openCoWebSite(url : string): void; closeCoWebSite(): void; - disablePlayerControl(): void; - restorePlayerControl(): void; + disablePlayerControls(): void; + restorePlayerControls(): void; displayBubble(): void; removeBubble(): void; } @@ -88,12 +88,12 @@ window.WA = { } as ChatEvent }, '*'); }, - disablePlayerControl(): void { - window.parent.postMessage({ 'type': 'disablePlayerControl' }, '*'); + disablePlayerControls(): void { + window.parent.postMessage({ 'type': 'disablePlayerControls' }, '*'); }, - restorePlayerControl(): void { - window.parent.postMessage({ 'type': 'restorePlayerControl' }, '*'); + restorePlayerControls(): void { + window.parent.postMessage({ 'type': 'restorePlayerControls' }, '*'); }, displayBubble(): void { diff --git a/maps/Tuto/scriptTuto.js b/maps/Tuto/scriptTuto.js index 869ec447..65962a94 100644 --- a/maps/Tuto/scriptTuto.js +++ b/maps/Tuto/scriptTuto.js @@ -25,7 +25,7 @@ function launchTuto (){ label: "Got it!", className : "success",callback:(popup2 => { popup2.close(); - WA.restorePlayerControl(); + WA.restorePlayerControls(); }) } ]) @@ -36,7 +36,7 @@ function launchTuto (){ } } ]); - WA.disablePlayerControl(); + WA.disablePlayerControls(); } diff --git a/maps/tests/script.js b/maps/tests/script.js index 25e47249..4a889a8a 100644 --- a/maps/tests/script.js +++ b/maps/tests/script.js @@ -21,7 +21,7 @@ function launchTuto (){ callback: (popup1) => { WA.sendChatMessage("Hey you can talk here too ! ", 'WA Guide'); popup1.close(); - WA.restorePlayerControl(); + WA.restorePlayerControls(); } } @@ -29,7 +29,7 @@ function launchTuto (){ } } ]); - WA.disablePlayerControl(); + WA.disablePlayerControls(); } WA.onChatMessage((message => {