Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
115 lines (102 loc) · 3.54 KB

File metadata and controls

115 lines (102 loc) · 3.54 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<html>
<style>
body {
background: transparent;
}
a,
a:visited {
text-decoration: none !important;
}
body a svg {
width: calc(100% - 1rem);
height: calc(100% - 3rem);
}
footer {
position: absolute;
bottom: 0;
height: 1.3rem;
background: #ccc;
text-align: right;
color: white;
font-size: 0.7rem;
font-family: consolas;
left: 0;
right: 0;
padding-top: 0.5rem;
padding-right: 1rem;
}
footer a, footer a:visited {
color: white;
}
</style>
<body>
<div id="blocks"></div>
<footer class="ui horizontal small divided link list footer">
<a target="_blank" class="item" href="https://makecode.com">Microsoft MakeCode</a>
<a target="_blank" class="item" href="https://makecode.com/termsofuse">Terms of Use </a>
<a target="_blank" class="item" href="https://makecode.com/privacy">Privacy </a>
</footer>
<script id="loader">
// This line gets patched up by the cloud
var pxtConfig = null;
// handle to rendering iframe
var pxtFrame;
// ....#pub:projectid
var projectid = /pub:([^&?]+)/i.exec(window.location.hash)[1];
function makeCodeInjectRenderer() {
pxtFrame = document.createElement("iframe");
pxtFrame.id = "makecoderenderer";
pxtFrame.style.position = "absolute";
pxtFrame.style.left = 0;
pxtFrame.style.bottom = 0;
pxtFrame.style.width = "1px";
pxtFrame.style.height = "1px";
pxtFrame.src = (pxtConfig ? pxtConfig.docsUrl : '---docs') + '?render=1';
document.body.appendChild(pxtFrame);
}
function makeCodeRenderPre(elid, pid) {
var f = document.getElementById("makecoderenderer");
f.contentWindow.postMessage({
type: "renderblocks",
id: elid,
options: {
packageId: pid
}
}, "*");
}
function removeEl(el) {
if (el && el.parentElement) el.parentElement.removeChild(el);
}
window.addEventListener("message", function (ev) {
var msg = ev.data;
if (msg.source != "makecode") return;
switch (msg.type) {
case "renderready":
makeCodeRenderPre("blocks", projectid)
break;
case "renderblocks":
var id = msg.id;
if (msg.svg) {
var svg = new DOMParser().parseFromString(msg.svg, "image/svg+xml");
var img = svg.childNodes.item(0)
var code = document.getElementById(id)
var a = document.createElement("a")
a.target = "_blank"
a.href = (pxtConfig ? pxtConfig.targetUrl : "") + "/#pub:" + projectid;
a.appendChild(img)
code.parentElement.insertBefore(a, code)
code.parentElement.removeChild(code);
}
// unload iframe
if (pxtFrame) {
removeEl(pxtFrame);
removeEl(document.getElementById("loader"));
pxtFrame = undefined;
}
break;
}
}, false);
makeCodeInjectRenderer();
</script>
</body>
</html>
Morty Proxy This is a proxified and sanitized view of the page, visit original site.