Skip to content

Commit

Permalink
data-env="development" and event.data.html
Browse files Browse the repository at this point in the history
  • Loading branch information
hatemhosny committed Sep 4, 2023
1 parent 5d6a053 commit a8caa00
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
21 changes: 21 additions & 0 deletions dist/v7/compiler.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LiveCodes Compiler Sandbox</title>
<script id="message-script" data-env="development">
window.addEventListener('message', function (event) {
if (event.data.type === 'init' && event.data.scriptUrl) {
var script = document.createElement('script');
script.src = event.data.scriptUrl;
script.onload = function () {
initCompiler(event.data);
};
document.head.appendChild(script);
}
});
</script>
</head>
<body></body>
</html>
17 changes: 17 additions & 0 deletions dist/v7/result.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script id="message-script" data-env="development">
window.addEventListener('message', function (event) {
var html = event.data.result || event.data.html;
if (html) {
document.write(html);
document.close();
}
});
</script>
</head>
<body></body>
</html>

0 comments on commit a8caa00

Please sign in to comment.