commit
2cf51a058a
@ -8,7 +8,6 @@ import type { ButtonClickedEvent } from "./Events/ButtonClickedEvent";
|
||||
import { ClosePopupEvent, isClosePopupEvent } from "./Events/ClosePopupEvent";
|
||||
import { scriptUtils } from "./ScriptUtils";
|
||||
import { isGoToPageEvent } from "./Events/GoToPageEvent";
|
||||
import { isCloseCoWebsite, CloseCoWebsiteEvent } from "./Events/CloseCoWebsiteEvent";
|
||||
import {
|
||||
IframeErrorAnswerEvent,
|
||||
IframeQueryMap,
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { coWebsiteManager, CoWebsite } from "../WebRtc/CoWebsiteManager";
|
||||
import { playersStore } from "../Stores/PlayersStore";
|
||||
import { chatMessagesStore } from "../Stores/ChatStore";
|
||||
import type { ChatEvent } from "./Events/ChatEvent";
|
||||
|
@ -512,7 +512,7 @@ class CoWebsiteManager {
|
||||
if (this.coWebsites.length < 1) {
|
||||
this.loadMain();
|
||||
} else if (this.coWebsites.length === 5) {
|
||||
throw new Error("Too many we");
|
||||
throw new Error("Too many websites");
|
||||
}
|
||||
|
||||
Promise.resolve(callback(this.cowebsiteBufferDom))
|
||||
@ -580,7 +580,7 @@ class CoWebsiteManager {
|
||||
return reject();
|
||||
});
|
||||
})
|
||||
.catch((e) => console.error("Error loadCoWebsite >=> ", e));
|
||||
.catch((e) => console.error("Error loadCoWebsite => ", e));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
WA.room.onEnterLayer('myLayer').subscribe(() => {
|
||||
WA.chat.sendChatMessage("Hello!", 'Wooka');
|
||||
WA.chat.sendChatMessage("Hello!", 'Woka');
|
||||
});
|
||||
|
||||
WA.room.onLeaveLayer('myLayer').subscribe(() => {
|
||||
WA.chat.sendChatMessage("Goodbye!", 'Wooka');
|
||||
WA.chat.sendChatMessage("Goodbye!", 'Woka');
|
||||
});
|
@ -12,12 +12,12 @@ WA.onInit().then(() => {
|
||||
});
|
||||
});
|
||||
|
||||
function wookaSendMessage(message) {
|
||||
WA.chat.sendChatMessage(message, 'Wooka');
|
||||
function wokaSendMessage(message) {
|
||||
WA.chat.sendChatMessage(message, 'Woka');
|
||||
}
|
||||
|
||||
function unknownCommand() {
|
||||
wookaSendMessage('Unknown command');
|
||||
wokaSendMessage('Unknown command');
|
||||
}
|
||||
|
||||
function executeCommand(command, args) {
|
||||
@ -32,7 +32,7 @@ function executeCommand(command, args) {
|
||||
|
||||
function coWebsiteCommand(args) {
|
||||
if (args.length < 1) {
|
||||
wookaSendMessage('Too few arguments');
|
||||
wokaSendMessage('Too few arguments');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -52,27 +52,27 @@ function coWebsiteCommand(args) {
|
||||
|
||||
async function openCoWebsite(args) {
|
||||
if (args.length < 1) {
|
||||
wookaSendMessage('Too few arguments');
|
||||
wokaSendMessage('Too few arguments');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const url = new URL(args[0]);
|
||||
} catch (exception) {
|
||||
wookaSendMessage('Parameter is not a valid URL !');
|
||||
wokaSendMessage('Parameter is not a valid URL !');
|
||||
return;
|
||||
}
|
||||
|
||||
await WA.nav.openCoWebSite(args[0]).then(() => {
|
||||
wookaSendMessage('Co-website has been opened !');
|
||||
wokaSendMessage('Co-website has been opened !');
|
||||
}).catch((error) => {
|
||||
wookaSendMessage(`Something wrong happen during co-website opening: ${error.message}`);
|
||||
wokaSendMessage(`Something wrong happen during co-website opening: ${error.message}`);
|
||||
});
|
||||
}
|
||||
|
||||
async function closeCoWebsite(args) {
|
||||
if (args.length < 1) {
|
||||
wookaSendMessage('Too few arguments');
|
||||
wokaSendMessage('Too few arguments');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ async function closeCoWebsite(args) {
|
||||
coWebsites.forEach(coWebsite => {
|
||||
coWebsite.close();
|
||||
});
|
||||
wookaSendMessage('All co-websites has been closed !');
|
||||
wokaSendMessage('All co-websites has been closed !');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -96,13 +96,13 @@ async function closeCoWebsite(args) {
|
||||
coWebsites.find((coWebsite) => coWebsite.position === position);
|
||||
|
||||
if (!coWebsite) {
|
||||
wookaSendMessage('Unknown co-website');
|
||||
wokaSendMessage('Unknown co-website');
|
||||
return;
|
||||
}
|
||||
|
||||
await coWebsite.close().then(() => {
|
||||
wookaSendMessage('This co-websites has been closed !');
|
||||
wokaSendMessage('This co-websites has been closed !');
|
||||
}).catch((error) => {
|
||||
wookaSendMessage(`Something wrong happen during co-website closing: ${error.message}`);
|
||||
wokaSendMessage(`Something wrong happen during co-website closing: ${error.message}`);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user