Closed shiffman closed 8 years ago
I've gone back and forth on this.
If the user is set to run in a new window, then running automatically also involves opening a new window, and that's bad.
Maybe there can be an additional, optional param to the "share version" of the edit sketch url, like
"&autoplay=true"
which turns on runInFrame, and autoplays the sketch when the page loads.
I like that idea. This also brings up the question. . . I wonder if the "run in a new window" should be a sketch by sketch preference and not a user preference. I like the idea of that though I guess it would require some sort of "project" settings which is maybe not something we want?
With this, editor sketches won't automatically run in frame unless you add &autoplay=true
to the url
https://github.com/therewasaguy/p5js-webIDE/commit/ce91f4ec64a36867a8bf35e55f9a1ef34bc00635
For now, it also modifies the user settings to runInFrame
. That's not a good long term solution. It would be better to run it in the frame just one time without changing the user's settings, but this gets complicated because the editor would somehow need to know to shift views automatically.
Project settings would be good to add at some point, but so far there are only user settings which is nice and simple.
When I share a view like so:
http://p5ide.herokuapp.com/editor#?sketch=56899c0c66d9570300507582
Should the sketch run automatically or do I need to press "run"? My expectation is that it should run, but I'm not sure exactly what is right.