processing / p5.js-editor

Deprecated desktop editor for p5.js
https://p5js.org
MIT License
338 stars 91 forks source link

dragging a unassociated sketch.js file onto the editor #161

Open shiffman opened 8 years ago

shiffman commented 8 years ago

This scenario has come up a few times. A student has a sketch.js file on their desktop, not in a folder with an index.html and libraries directory. The student drags that file onto the p5.js editor. It opens but doesn't run of course since the the html file is not there. And if you select "show sidebar" your whole desktop appears (since that's its directory).

I propose making some attempt to detect opening a file not associated with a properly formatted "project" folder, giving a warning to the user, and offering to make a project folder with the sketch.js file. This is a similar behavior to opening a pde file in Processing not in a proper sketch folder.