Added discussion scripting
This commit is contained in:
parent
e7727e122e
commit
b4fc8c6d27
@ -95,6 +95,9 @@ class IframeListener {
|
||||
else if(payload.type === 'closeCoWebSite') {
|
||||
scriptUtils.closeCoWebSite();
|
||||
}
|
||||
else if(payload.type === 'closeChatMessage') {
|
||||
scriptUtils.closeChatMessage();
|
||||
}
|
||||
else if (payload.type === 'disablePlayerControl'){
|
||||
this._disablePlayerControlStream.next();
|
||||
}
|
||||
|
@ -1,4 +1,6 @@
|
||||
import {coWebsiteManager} from "../WebRtc/CoWebsiteManager";
|
||||
import {discussionManager} from "../WebRtc/DiscussionManager";
|
||||
|
||||
|
||||
class ScriptUtils {
|
||||
|
||||
@ -11,12 +13,16 @@ class ScriptUtils {
|
||||
|
||||
}
|
||||
|
||||
public closeCoWebSite(){
|
||||
coWebsiteManager.closeCoWebsite();
|
||||
}
|
||||
|
||||
public openCoWebsite(url : string){
|
||||
coWebsiteManager.loadCoWebsite(url,url);
|
||||
}
|
||||
|
||||
public closeCoWebSite(){
|
||||
coWebsiteManager.closeCoWebsite();
|
||||
public closeChatMessage(){
|
||||
discussionManager.hideDiscussion();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ export class DiscussionManager {
|
||||
this.divDiscuss?.classList.add('active');
|
||||
}
|
||||
|
||||
private hideDiscussion(){
|
||||
public hideDiscussion(){
|
||||
this.activeDiscussion = false;
|
||||
this.divDiscuss?.classList.remove('active');
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import {OpenCoWebSiteEvent} from "./Api/Events/OpenCoWebSiteEvent";
|
||||
interface WorkAdventureApi {
|
||||
sendChatMessage(message: string, author: string): void;
|
||||
onChatMessage(callback: (message: string) => void): void;
|
||||
closeChatMessage() : void;
|
||||
onEnterZone(name: string, callback: () => void): void;
|
||||
onLeaveZone(name: string, callback: () => void): void;
|
||||
openPopup(targetObject: string, message: string, buttons: ButtonDescriptor[]): Popup;
|
||||
@ -88,6 +89,11 @@ window.WA = {
|
||||
} as ChatEvent
|
||||
}, '*');
|
||||
},
|
||||
closeChatMessage() : void{
|
||||
window.parent.postMessage({
|
||||
"type" : 'closeChatMessage'
|
||||
},'*');
|
||||
},
|
||||
disablePlayerControl() : void {
|
||||
window.parent.postMessage({'type' : 'disablePlayerControl'},'*');
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user