I had a look through some of the changes Mr Doob's code editor (which is now called htmleditor). Naturally, they're much nicer than mine. I hate that guy. But not really. He's awesome.
Anyhow, I delete the resize handler from my fork:
I cannot believe that did not occur to me. Sigh.
Actual window resizing will not cause a visualization update. That is a relatively rare event and there is that big “Update” button on the screen that programmers can use to force a visualization update if needed.
There is another nifty addition to upstream—the sharing experience is much improved. Instead of putting a sharable URL in the address bar and hoping the user notices, Mr.doob has a popup that displays the URL. In the hopes that I can cherry pick most of this commit, I add the original repository to my local copy as remote “upstream”:
So I manually copy the code from the commit into my
editor.jsand eventually get:
That is actually pretty slick. I can Ctrl+C to copy that URL immediately and it works. I will have to add some instructions to make it more beginner friendly, but that is nice. I end tonight by removing some resize handling code in the popup. Ironically, it includes code to reposition the popup on resize. I replace it with code that simply removes the popup on resize. That seems reasonable behavior for something that is unlikely to happen often.
Tomorrow, I will pick back up incorporating this into a URL shortener. No one should have to share a link as long as: http://gamingjs.com/ice/#B/jZKxTsMwEIZ3nuKUpU6HuAWKEE0ZisSAxELzAo5zioMSX2QbWt4e4zRpWlWlWZy7//sy/HGaU/HznPJw3KRWmqp1YI1cRcq59onzUjSVLt82iaSGZ8ogJp828krHXiG9KEMNvlY7tJdUvpFkMCdhihOs5/wbwLcwYAcSVqBxCweVxUsPHYDETwCuatCwuBskfWlX0Faz+Wy/Cjxb9KPCumWTNQLuJNY1ageOAIVUQE6hSSYe5NM/VLQt6uIdrRUlsihD62Ae7b9zLry9FN71YXO0vh+c4kRY+ASm/IzzEMVLCHvOwaIbvDXlURyC46K6Dh5noUBJ2lKNSU0lGzElulA1i/+hMl/4VdAHNqLS/rIEevTPR88v—especially kids.