This repository has been archived by the owner on Mar 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 245
/
rendered.html
64 lines (62 loc) · 1.52 KB
/
rendered.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Rendered Content | medium-draft</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: CustomSerif,Georgia,Cambria,'Times New Roman',serif;
margin: 0;
padding: 0;
font-size: 16px;
}
.content {
max-width: 600px;
margin: 0 auto;
}
</style>
</head>
<body>
<div id="content" class="content">
<p>
Open this page by clicking the <strong>Render HTML</strong> button.
</p>
</div>
<script src="/static/common.js"></script>
<script src="/static/vendor-react.js"></script>
<script src="/static/basic.js"></script>
<script>
function getScript() {
var script = document.createElement('script');
script.async = 1;
script.src = '//cdn.embedly.com/widgets/platform.js';
script.onload = () => {
window.embedly();
};
document.body.appendChild(script);
}
window.addEventListener('message', function(e) {
if (typeof e.data === 'object') {
return;
}
if (typeof e.data === 'string') {
try {
JSON.parse(e.data);
return;
} catch (ex) {
if (e.data.indexOf('webpackHot') === 0) {
return;
}
document.getElementById('content').innerHTML = e.data;
if (window.embedly) {
window.embedly();
} else {
getScript();
}
}
}
});
</script>
</body>
</html>