forked from webduinoio/webduino-blockly
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlive-preview.html
More file actions
49 lines (44 loc) · 1.05 KB
/
Copy pathlive-preview.html
File metadata and controls
49 lines (44 loc) · 1.05 KB
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
<!doctype html>
<html>
<head>
<title>HyProto Live-Preview</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script src="lib/JSONStorage.js"></script>
<style>
body,
html {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
#content {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0px;
}
</style>
</head>
<body>
<iframe id="frame" width="100%" height="100%" frameborder="0"></iframe>
<script>
window.addEventListener('load', function(e) {
var storage = new JSONStorage('https://glowing-fire-4998.firebaseio.com/hyproto');
var frame = document.querySelector('#frame');
if (window.location.hash.length > 1) {
storage.retrieve(window.location.hash.substring(1), function onload(err, data) {
if (!err && data) {
var doc = frame.contentDocument;
doc.open('text/html', '');
doc.write(data);
doc.close();
}
});
}
});
</script>
</body>
</html>