diff --git a/index.html b/index.html index b044276..856248f 100644 --- a/index.html +++ b/index.html @@ -177,6 +177,7 @@ function sandboxify() { let run = (t) => { let $res = t.parentElement.children[1] function log(res){ + if( !$res ) return $res.innerHTML = typeof res == 'string' ? res : JSON.stringify(res,null,2) } let _log = console.log @@ -188,6 +189,7 @@ function sandboxify() { const textareas = document.querySelectorAll("textarea.sandboxify"); textareas.forEach(t => { t.addEventListener("input", function (event) { + if( String(t.className).match(/noresult/) ) return try { run(t) } catch (error) { @@ -291,605 +293,7 @@ a?this.setAttribute("z",a):this.removeAttribute("z")}get w(){return parseFloat(t a;return[a.clientX||0,a.clientY||0]};class K extends Z{static get observedAttributes(){return["height","width"]}constructor(){super();this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){this.shadow.innerHTML=W.render(this.width,this.height);this.canvas=W.map(this.shadow).canvas;setTimeout(()=>{try{this.init()}catch(a){console.error(a&&a.message||"Error in shader-doodle.")}})}disconnectedCallback(){super.disconnectedCallback();this.renderer.removeSurface(this.surface);this.surface.dispose(); this.surface=void 0}attributeChangedCallback(a){let b=this.shadow.styleSheets;if(("height"===a||"width"===a)&&0 - + @@ -1335,9 +739,9 @@ Error message and password prompt