workadventure/maps/tests/Metadata/showHideLayer.html
GRL78 4f513fb1e0
Fix test Scripting API (#1298)
* fix tests of Scripting API

* Suppression ts-ignore
2021-07-20 19:54:45 +02:00

27 lines
1.1 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<script>
var script = document.createElement('script');
// Don't do this at home kids! The "document.referrer" part is actually inserting a XSS security.
// We are OK in this precise case because the HTML page is hosted on the "maps" domain that contains only static files.
script.setAttribute('src', document.referrer + 'iframe_api.js');
document.head.appendChild(script);
window.addEventListener('load', () => {
document.getElementById('show/hideLayer').onclick = () => {
if (document.getElementById('show/hideLayer').checked) {
WA.room.showLayer('crystal');
}
else {
WA.room.hideLayer('crystal');
}
}
})
</script>
</head>
<body>
<div>
<label for="show/hideLayer">Crysal Layer : </label><input type="checkbox" id="show/hideLayer" name="visible" value="show" checked>
</div>
</body>
</html>