-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a downloadable archive for self-hosting the widget #45
Comments
Er, @indefinit, what happens if you download the following archive, add it as a subdirectory to your own website, and load the widget from there? https://github.com/toolness/p5.js-widget/archive/gh-pages.zip Based on the way the widget is constructed, I think that should actually work, but I'm not sure... |
This seems to work, however, it breaks if I try to load both the widget and p5.dom library at the same time. Error seems to be that create* is not defined because the "this" context is getting lost in p5 global mode. |
Oh, weird... Where is If it's the former, the widget doesn't actually support this use-case yet--it's filed as #53. If it's the latter, then I'm surprised that doesn't work... |
hmm, It seems to be the latter case. I'll have to wait until after the semester ends to post a few examples for debugging. Thanks for your help though! |
+1 to this one. I teach p5js in a school, and our internet connection is ... well... I really need local hosting :) |
As @indefinit mentions in #39 (comment), it would be nice to support users who want to self-host the widget, as there's nothing in the widget that should explicitly require an internet connection.
We might also want to make it possible to add a data attribute to the widget'sFiled as #48.<script>
tag that allows the embedder to specify a self-hosted version of p5 to use, too, since we currently retrieve that over CDN. This would allow for offline use-cases.Aside: In his original question, @indefinit asked if it was possible to combine all the dependencies into one lib js file. Unfortunately, it's difficult to do this, as different JS needs to be loaded in different contexts--one for the widget on the embedding page, another for the widget in the iframe, and another for running the sketch in the preview pane. It's also not clear that combining everything into a single file would be efficient, since it'd prevent lazy loading.
The text was updated successfully, but these errors were encountered: