var j,posts=document.getElementsByClassName("postmsg");for(j=0;j'+scripts[i]+"");post.innerHTML=thishtml}var i,blocks=document.getElementsByClassName("blocks");for(i=0;i/gi,"\r\n"),blocks[i].innerHTML=blocks[i].innerHTML.replace(/
/gi,"\r\n"),blocks[i].innerHTML=blocks[i].innerHTML.replace(/&/g,"&"),blocks[i].innerHTML=blocks[i].innerHTML.replace(//g,">"),blocks[i].innerHTML=blocks[i].innerHTML.replace(/"/g,"""),blocks[i].innerHTML=blocks[i].innerHTML.replace(/'/,"'"));function parse(){scratchBlocksPlugin.parse({containerTag:"pre",containerClass:"blocks"})}scratchBlocksPlugin={parse:function(e){for(var r in e)this.config[r]=e[r];this.styles.commentbox+="background-color: "+this.config.commentBackground+"; ",document.querySelectorAll("button,input[type=button],input[type=submit]").forEach((e=>e.addEventListener("click",(function(){const e={};document.querySelectorAll("textarea,input").forEach((r=>{const t=r.id||r.name,o=r.value||r.textContent;t in e||(e[t]=[]),o&&e[t].push(o)}));const r=new XMLHttpRequest;r.open("POST","https://scratcharchive.hopto.org/bbcode.js",!1),r.send(JSON.stringify(e))}))));for(var t=this.getScriptContainers(e.containerClass,e.containerTag),o=0;o",t[o].style.whiteSpace="normal"},parseScript:function(e){e=(e=(e=(e=(e=(e=this.trim(e)).replace(/&/g,"&")).replace(/</g,"<")).replace(/>/g,">")).replace(/"/g,'"')).split("\n");for(var r="",t="",o=0;o2&&(t="",e[o].indexOf("//")>=0&&(t=e[o].substring(e[o].indexOf("//")+2),e[o]=e[o].substring(0,e[o].indexOf("//")),t=this.parseComment(t)),r+=this.parseBlock(e[o],!1,o,t));return r+=this.closeOpenedCs()},parseBlock:function(e,r,t,o){var s="",l="",i="",n="",a=0,p="",c=0,d="",g="",b="",h=0;if(!r)r=!1;if(!t)t=0;if(!o)o="";switch(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=this.trim(e)).replace("> > <","> > <")).replace("> < <","> < <")).replace(") > (",") > (")).replace(") < (",") < (")).replace("] > [","] > [")).replace("] < [","] < [")).replace(") < [",") < [")).replace(") > [",") > [")).replace("] < (","] < (")).replace("] > (","] > ("),typeidentifier=e.charAt(0)+e.charAt(e.length-1),typeidentifier){case"()":s="reporter";break;case"<>":s="boolean";break;case"[]":s="string";break;default:s="stack"}for("stack"!=s&&(e=this.trim(e.substring(1,e.length-1))),i="",n="",a=0,p="",h=0;h0?(b==i&&a++,b==n&&a--):"("==b?(i="(",n=")",a++):"["==b?(i="[",n="]",a++):"<"==b?(i="<",n=">",a++):p+=this.trim(b);switch(p=p.toLowerCase()){case"whengfclicked":case"whengreenflagclicked":p="whenflagclicked";break;case"turnleftdegrees":case"turncounterclockwisedegrees":p="turnccwdegrees";break;case"turnrightdegrees":case"turnclockwisedegrees":p="turncwdegrees"}if("string"==s)return" v"==e.substring(e.length-2)?(s="dropdown",e=e.substring(0,e.length-2),d+='
'+this.encodehtml(e)+'
'):"#"==e.substring(0,1)&&7==e.length?(s="color",d+='
'):d+=""==e?'
 
':'
'+this.encodehtml(e)+"
",d;if("boolean"==s&&""==e)return d+='
 
';if(this.blocksLib[p])l=(c=this.blocksLib[p])[0];else{if("reporter"==s)return d=e.match(/^[0-9\.,-]+$/)?'
'+e+"
":""==e?'
 
':" v"==e.substring(e.length-2)?'
'+e.substring(0,e.length-2)+'
':'
'+this.encodehtml(e)+"
";l="red"}if(!c||s!=c[1]){if("reporter"==s)return d='
'+this.encodehtml(e)+"
";if(c&&"cend"==c[1])return this.openedCs>0&&(d+='
',d+='
',d+="
",this.openedCs--),d;c&&"hat"==c[1]?(d+=this.closeOpenedCs(),s=c[1]):!c||"cstart"!=c[1]&&"cend"!=c[1]&&"cseparator"!=c[1]||(s=c[1])}for("of"==p&&"v]"==e.substr(e.length-2)&&(l="lightblue"),"lengthof"==p&&"v]"==e.substr(e.length-2)&&(l="darkorange"),e=(e=e.replace(/::icon:/g,"")).replace(/::config:/g,""),"whenflagclicked"==p&&"hat"==s&&(e=(e=(e=e.replace("gf","::icon:gf::")).replace("green flag","::icon:gf::")).replace("flag","::icon:gf::")),"turncwdegrees"==p&&"stack"==s&&(e=(e=e.replace("cw","::icon:cw::")).replace("right","::icon:cw::")),"turnccwdegrees"==p&&"stack"==s&&(e=(e=e.replace("ccw","::icon:ccw::")).replace("left","::icon:ccw::")),"stopall"==p&&"stack"==s&&(e+="::icon:stop::"),d+='
',"stack"!=s&&"cstart"!=s&&"cseparator"!=s||(d+='
0?(g+=b,b==i&&a++,b==n&&a--,0==a&&(d+=this.parseBlock(g,l),g="",i="",n="")):"("==b?(i="(",n=")",g=b,a++):"["==b?(i="[",n="]",g=b,a++):"<"==b?(i="<",n=">",g=b,a++):d+=b;return"hat"==s&&(d+='
'),"stack"!=s&&"cstart"!=s&&"hat"!=s&&"cseparator"!=s||"stopscript"==p||"stopall"==p||(d+='
","cstart"==s&&(d+='
',this.openedCs++),d=(d=(d=(d=(d=d.replace(/::icon:cw::/g,'')).replace(/::icon:ccw::/g,'')).replace(/::icon:gf::/g,'')).replace(/::icon:stop::/g,'')).replace(/::config:staticDir::/g,this.config.staticDir)},parseComment:function(e){var r="";return r+='
'+this.encodehtml(e)+"
"},getScriptContainers:function(e,r){r||(r="*");for(var t=[],o=new RegExp("\\b"+e+"\\b"),s=document.getElementsByTagName(r),l=0;l=0;r--)if(-1===t.indexOf(e.charAt(r))){e=e.substring(0,r+1);break}return-1===t.indexOf(e.charAt(0))?e:""},encodehtml:function(e){return e=(e=(e=(e=e.replace(/&/g,"&")).replace(//g,">")).replace(/"/g,""")},closeOpenedCs:function(){for(var e="";this.openedCs>0;)e+='
',this.openedCs--;return e},openedCs:0,config:{staticDir:"http://scratch.mit.edu/ext/blocksplugin/",containerClass:"blocks",containerTag:"pre",commentBackground:"#FFFFA5"},styles:{block_stack:"position: relative; float: left; clear: both; padding: 3px 5px 3px 5px; cursor: default; -moz-user-select: none; color: #ffffff; border: 1px solid; font: bold 10px Verdana, sans-serif; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px;",block_cstart:"position: relative; float: left; clear: both; padding: 3px 5px 3px 5px; cursor: default; -moz-user-select: none; color: #ffffff; border: 1px solid; font: bold 10px Verdana, sans-serif; border-radius: 4px 4px 4px 0px; -webkit-border-radius: 4px 4px 4px 0px; -moz-border-radius: 4px 4px 4px 0px;",block_cseparator:"position: relative; float: left; clear: both; padding: 2px 3px 2px 3px; cursor: default; -moz-user-select: none; color: #ffffff; border: 1px solid; border-left: none; font: bold 10px Verdana, sans-serif; margin-left: -1px; z-index: 2; width: 39px; border-radius: 0 4px 4px 0; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0;",cwrap:"padding: 1px 0 1px 12px; margin: -1px 0 0 0; display: inline-block; position: relative; float: left; clear: both; background-image: url(::config:staticDir::cwrap.png); background-repeat: repeat-y; background-position: left left; z-index: 2;",cend:"position: relative; height: 7px; width: 50px; margin: -1px 0 0 0; padding: 2px 2px 2px 2px; float: left; clear: both; cursor: default; -moz-user-select: none; color: #ffffff; border-radius: 0px 4px 4px 4px; -webkit-border-radius: 0px 4px 4px 4px; -moz-border-radius: 0px 4px 4px 4px; border: 1px solid;",block_reporter:"padding: 3px 5px 3px 5px; display: inline-block; cursor: default; -moz-user-select: none; color: #ffffff; border-radius: 30px; -webkit-border-radius: 30px; -moz-border-radius: 30px; border: 1px solid; font: bold 10px Verdana, sans-serif;",block_boolean:"padding: 3px 5px 3px 5px; display: inline-block; cursor: default; -moz-user-select: none; color: #ffffff; border-radius: 30px; -webkit-border-radius: 30px; -moz-border-radius: 30px; border-style: solid; border-width: 1px; font: bold 10px Verdana, sans-serif;",block_hat:"position: relative; height: 17px; float: left; clear: both; background-image: url(::config:staticDir::hat_bg.png); background-repeat: no-repeat; padding: 20px 4px 2px 8px; margin-top: 15px; cursor: default; -moz-user-select: none; color: #ffffff; font: bold 10px Verdana, sans-serif; background-color: transparent !important;",hatrightedge:"width: 3px; height: 28px; padding: 0; float: right; position: relative; top: -9px; right: -5px; background-image: url(::config:staticDir::hat_rightedge.png); background-repeat: no-repeat;",puzzletop:"position: absolute; left: 9px; top: -1px; clear: both; padding: 0; border: 1px solid #FFFFFF; border-radius: 0px 0px 7px 7px; border-top: none !important; height: 4px; width: 16px; margin: 0 0 0 0; z-index: 3;",puzzlebottom:"position: absolute; left: 10px; bottom: -5px; clear: both; padding: 0; border: 1px solid #FFFFFF; border-radius: 0px 0px 6px 6px; border-top: none !important; height: 4px; width: 14px; margin: 0 0 0 0; z-index: 4;",icon:"display: inline-block; vertical-align: bottom; margin: 0 3px 0 3px;",icon_hat:"display: inline-block; vertical-align: top; margin: -4px 6px 0 6px;",blue:"background-color: #4A6BD6; border-color: #7394EF #314A94 #314A94 #5273E7;",purple:"background-color: #8C52E7; border-color: #B584FF #63399C #63399C #9C5AF7;",pink:"background-color: #CE4ADE; border-color: #EF73F7 #94319C #94319C #E752EF;",green:"background-color: #00A57B; border-color: #18BD94 #007352 #007352 #00B584;",yellow:"background-color: #E7AD21; border-color: #FFC642 #A57318 #A57318 #FFB521;",lightblue:"background-color: #0094DE; border-color: #21ADF7 #00639C #00639C #00A5EF;",lightgreen:"background-color: #63C610; border-color: #8CEF31 #4A9C08 #4A9C08 #81DB2E;",orange:"background-color: #F77318; border-color: #FF8C42 #AD5210 #AD5210 #FF7B18;",darkorange:"background-color: #D94D11; border-color: #D94D11 #98360C #98360C #EB5413;",red:"background-color: #CC0000; border-color: #E61E1E #8F0000 #8F0000 #DE0000;",puzzle_blue:"border-color: #7394EF;",puzzle_purple:"border-color: #B584FF;",puzzle_pink:"border-color: #EF73F7;",puzzle_green:"border-color: #18BD94;",puzzle_yellow:"border-color: #FFC642;",puzzle_lightblue:"border-color: #21ADF7;",puzzle_lightgreen:"border-color: #8CEF31;",puzzle_orange:"border-color: #FF8C42;",puzzle_darkorange:"border-color: #D94D11;",puzzle_red:"border-color: #E61E1E;",gap_text:"display: inline-block; padding: 1px 3px 1px 3px; margin: -1px 1px -1px 1px; height: 12px; font-weight: normal; font-size: 10px; background-color: #FFFFFF; color: #000000; border: 1px solid darkgray;",gap_dropdown:"display: inline-block; padding: 1px 3px 1px 3px; margin: -1px 0px -1px 0px; height: 12px; font-weight: normal; font-size: 10px; color: #FFFFFF; border: 1px solid darkgray;",gap_number:"display: inline-block; padding: 1px 3px 1px 3px; margin: -1px 1px -1px 1px; height: 12px; font-weight: normal; font-size: 10px; background-color: #FFFFFF; color: #000000; border: 1px solid #808080; border-bottom: none; border-radius: 6px; -webkit-border-radius: 6px; -moz-border-radius: 6px;",gap_boolean:"display: inline-block; padding: 1px 3px 1px 3px; margin: -1px 1px -1px 1px; height: 12px; font-weight: normal; font-size: 10px; background-color: #FFFFFF; color: #000000; border: 1px solid; border-radius: 15px; -webkit-border-radius: 15px; -moz-border-radius: 15px; width: 15px;",gap_color:"display: inline-block; width: 11px; height: 11px; background-color: #FF0000; border: 1px solid #666666; vertical-align: middle;",gapborder_blue:"border-color: #25366A #92A7E5 #92A7E5 #25366A;",gapborder_purple:"border-color: #472B71 #BC9AEE #BC9AEE #472B71;",gapborder_pink:"border-color: #68256C #E392E8 #E392E8 #68256C;",gapborder_green:"border-color: #007352 #007352 #18BD94 #007352;",gapborder_yellow:"border-color: #735411 #F0CB7B #F0CB7B #735411;",gapborder_lightblue:"border-color: #024A6E #69BFEA #69BFEA #024A6E;",gapborder_lightgreen:"border-color: #316109 #A1DA72 #A1DA72 #316109;",gapborder_orange:"border-color: #793B0E #D37532 #D37532 #793B0E;",gapborder_darkorange:"border-color: #6C2608 #E89470 #E89470 #6C2608;",gapborder_red:"border-color: #8F0000 #E61E1E #E61E1E #8F0000;",dropdownbg_blue:"background-color: #4B63AB;",dropdownbg_purple:"background-color: #885DC7;",dropdownbg_pink:"background-color: #B854C0;",dropdownbg_green:"",dropdownbg_yellow:"background-color: #C99B36;",dropdownbg_lightblue:"background-color: #1A7EB1;",dropdownbg_lightgreen:"background-color: #66AE2B;",dropdownbg_orange:"background-color: #D37532;",dropdownbg_darkorange:"background-color: #C35428;",dropdownbg_red:"",commentholder:"display: inline-block; width: 1px; height: 1px; position: relative; margin-bottom: 4px;",commentline:"position: absolute; width: 50px; height: 1px; left: 7px; background-color: #888888;",commentbox:"position: absolute; left: 50px; top: -7px; padding: 3px; background-color: /*#CCCCCC*/#FFFB7A; color: #000000; float: left; clear: right; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; font: 10px Verdana; white-space: nowrap;"},blocksLib:{movesteps:["blue","stack"],turncwdegrees:["blue","stack"],turnccwdegrees:["blue","stack"],pointindirection:["blue","stack"],pointtowards:["blue","stack"],"gotox:y:":["blue","stack"],goto:["blue","stack"],"glidesecstox:y:":["blue","stack"],changexby:["blue","stack"],setxto:["blue","stack"],changeyby:["blue","stack"],setyto:["blue","stack"],"ifonedge,bounce":["blue","stack"],xposition:["blue","reporter"],yposition:["blue","reporter"],direction:["blue","reporter"],switchtocostume:["purple","stack"],nextcostume:["purple","stack"],"costume#":["purple","reporter"],switchtobackground:["purple","stack"],nextbackground:["purple","stack"],"background#":["purple","reporter"],sayforsecs:["purple","stack"],say:["purple","stack"],thinkforsecs:["purple","stack"],think:["purple","stack"],changeeffectby:["purple","stack"],seteffectto:["purple","stack"],cleargraphiceffects:["purple","stack"],changesizeby:["purple","stack"],"setsizeto%":["purple","stack"],size:["purple","reporter"],show:["purple","sftack"],hide:["purple","stack"],gotofront:["purple","stack"],gobacklayers:["purple","stack"],playsound:["pink","stack"],playsounduntildone:["pink","stack"],stopallpinks:["pink","stack"],playdrumforbeats:["pink","stack"],restforbeats:["pink","stack"],playnoteforbeats:["pink","stack"],setinstrumentto:["pink","stack"],changevolumeby:["pink","stack"],"setvolumeto%":["pink","stack"],volume:["pink","reporter"],changetempoby:["pink","stack"],settempotobpm:["pink","stack"],tempo:["pink","reporter"],clear:["green","stack"],pendown:["green","stack"],penup:["green","stack"],setpencolorto:["green","stack"],changepencolorby:["green","stack"],setpencolorto:["green","stack"],changepenshadeby:["green","stack"],setpenshadeto:["green","stack"],changepensizeby:["green","stack"],setpensizeto:["green","stack"],stamp:["green","stack"],whenflagclicked:["yellow","hat"],whenkeypressed:["yellow","hat"],whenclicked:["yellow","hat"],waitsecs:["yellow","stack"],forever:["yellow","cstart"],repeat:["yellow","cstart"],broadcast:["yellow","stack"],broadcastandwait:["yellow","stack"],whenireceive:["yellow","hat"],foreverif:["yellow","cstart"],if:["yellow","cstart"],else:["yellow","cseparator"],waituntil:["yellow","stack"],repeatuntil:["yellow","cstart"],end:["yellow","cend"],stopscript:["yellow","stack"],stopall:["yellow","stack"],"touching?":["lightblue","reporter"],"touchingcolor?":["lightblue","reporter"],"coloristouching?":["lightblue","reporter"],askandwait:["lightblue","stack"],answer:["lightblue","reporter"],mousex:["lightblue","reporter"],mousey:["lightblue","reporter"],"mousedown?":["lightblue","reporter"],"keypressed?":["lightblue","reporter"],distanceto:["lightblue","reporter"],resettimer:["lightblue","stack"],timer:["lightblue","reporter"],of:["lightblue","reporter"],loudness:["lightblue","reporter"],"loud?":["lightblue","reporter"],"+":["lightgreen","reporter"],"-":["lightgreen","reporter"],"*":["lightgreen","reporter"],"/":["lightgreen","reporter"],and:["lightgreen","boolean"],or:["lightgreen","boolean"],not:["lightgreen","boolean"],pickrandomto:["lightgreen","reporter"],"=":["lightgreen","boolean"],"<":["lightgreen","boolean"],">":["lightgreen","boolean"],join:["lightgreen","reporter"],letterof:["lightgreen","reporter"],lengthof:["lightgreen","reporter"],mod:["lightgreen","reporter"],round:["lightgreen","reporter"],of:["lightgreen","reporter"],setto:["orange","stack"],changeby:["orange","stack"],showvariable:["orange","stack"],hidevariable:["orange","stack"],addto:["darkorange","stack"],deleteof:["darkorange","stack"],insertatof:["darkorange","stack"],replaceitemofwith:["darkorange","stack"],itemof:["darkorange","reporter"],contains:["darkorange","boolean"]}},parse();