You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varmakeCodeRenderPre=makeCodeRenderPre||(function(){// pre waiting to be rendered// when undefined, iframe is loaded and readyvarpendingPres=[];functioninjectRenderer(){varf=document.getElementById("makecoderenderer");// check iframe already added to the DOMif(f){return;}varf=document.createElement("iframe");f.id="makecoderenderer";f.style.position="absolute";f.style.left=0;f.style.bottom=0;f.style.width="1px";f.style.height="1px";f.src="https://arcade.makecode.com/--docs?render=1"document.body.appendChild(f);}functionrenderPre(pre){console.log('render '+pre.id)varf=document.getElementById("makecoderenderer");// check if iframe is added and ready (pendingPres is undefined)if(!f||!!pendingPres){// queue uppendingPres.push(pre);injectRenderer();}else{f.contentWindow.postMessage({type: "renderblocks",id: pre.id,code: pre.innerText},"https://arcade.makecode.com/");}}// listen for messageswindow.addEventListener("message",function(ev){varmsg=ev.data;if(msg.source!="makecode")return;console.log(msg.type)switch(msg.type){case"renderready":
// flush pending requests varpres=pendingPres;// set as undefined to notify that iframe is readypendingPres=undefined;pres.forEach(function(pre){renderPre(pre);})break;case"renderblocks":
varsvg=msg.svg;// this is an string containing SVGvarid=msg.id;// this is the id you sent// replace text with svgvarimg=document.createElement("img");img.src=msg.uri;img.width=msg.width;img.height=msg.height;varcode=document.getElementById(id);code.parentElement.insertBefore(img,code)code.parentElement.removeChild(code);break;}},false);returnrenderPre;})();functionrenderSnippets(){// TODO ADD RENDER LOGIC HEREletpres=document.getElementsByTagName("pre");Array.prototype.forEach.call(pres,function(pre){makeCodeRenderPre(pre);})}// load the rendererrenderSnippets();// message signaturesinterfaceSimulatorMessage{}interfaceRenderBlocksRequestMessageextendsSimulatorMessage{
type: "renderblocks",id: string;
code: string;options?: {package?: string;packageId?: string;snippetMode?: boolean;}}interfaceRenderBlocksResponseMessageextendsSimulatorMessage{source: "makecode",type: "renderblocks",id: string;svg?: string;width?: number;height?: number;}// message signatures
Your CSS
The text was updated successfully, but these errors were encountered:
Error code
ERRW:0.7:7323
Were you logged in?
Yes
Your username (if logged in)
SoCuul
Your HTML
Your JavaScript
Your CSS
The text was updated successfully, but these errors were encountered: