2021-03-04 19:00:00 +01:00
|
|
|
<!doctype html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<script src="http://play.workadventure.localhost/iframe_api.js"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<button id="sendchat">Send chat message</button>
|
|
|
|
<script>
|
|
|
|
document.getElementById('sendchat').onclick = () => {
|
|
|
|
WA.sendChatMessage('Hello world!', 'Mr Robot');
|
|
|
|
}
|
|
|
|
</script>
|
2021-03-06 15:26:07 +01:00
|
|
|
<div id="chatSent"></div>
|
|
|
|
<script>
|
|
|
|
WA.onChatMessage((message => {
|
|
|
|
const chatDiv = document.createElement('p');
|
|
|
|
chatDiv.innerText = message;
|
|
|
|
document.getElementById('chatSent').append(chatDiv);
|
|
|
|
}));
|
|
|
|
</script>
|
2021-05-10 11:19:18 +02:00
|
|
|
<div>
|
2021-05-10 15:10:11 +02:00
|
|
|
<label for="show/hideLayer">Layer Name : </label><input type="checkbox" id="show/hideLayer" name="visible" value="show" checked>
|
2021-05-10 11:19:18 +02:00
|
|
|
</div>
|
|
|
|
<script>
|
2021-05-10 15:10:11 +02:00
|
|
|
document.getElementById('show/hideLayer').onclick = () => {
|
|
|
|
if (document.getElementById('show/hideLayer').checked) {
|
|
|
|
WA.showLayer('LayerName');
|
2021-05-10 11:19:18 +02:00
|
|
|
}
|
|
|
|
else {
|
2021-05-10 15:10:11 +02:00
|
|
|
WA.hideLayer('LayerName');
|
2021-05-10 11:19:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
2021-03-04 19:00:00 +01:00
|
|
|
</body>
|
|
|
|
</html>
|