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