-
Notifications
You must be signed in to change notification settings - Fork 61
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
Sharing Sketches #212
Comments
so sharing sketches between users is something that we've talked about before but it would likely need a server and we've tried to steer clear of that up until now. There are probably ways of doing it without but it would require some thought etc. The idea of having you able to save sketches to a github gist (or any other text based storage medium) is a good one though. At this point, given that we're already going down the route of having some server side functionality available, I do think it's worth looking at this again. Making sure that it gracefully degrades if the server isn't available shouldn't be too tricky. I've only just noticed the macro/functions issue you posted and i've not read it yet so don't know yet where the other stuff is going. Will have a look now |
Actually, I think it's possible to posts gists purely from the client (Gist API). LCL could have a "save" button that posts the gist and presents the user with a link There is a definite risk of XSS (which will be reduced once LCL has its own parser). However, the user is not logged in, so there is no sensitive data. Worst that can happen is that a malicious user script screws up the LCL environment, which can be solved by a simple F5. |
If it's possible to save the gist entirely in the client side then that would do away with the need for the server, though there'd still be the question of authentication etc (which can almost certainly still be done client side, but I just think it makes things into a much bigger task) Ultimately, I'm totally behind the idea, I just want to refine the implementation, and as someone that much prefers backend coding, thats the way I lean hehe |
Sharing sketches could just be a simple save and load feature, you could save your own sketches and choose to make them public which we could send to reddit or here to github, as all you need to do is copy and paste the code that you have written as a text file, people could download them as a file that can be opened directly by livecodelab, then open them at any time they want to using the load feature that I was talking about. |
I'd say let's keep it simple as first step: click share button - the code is saved in the URL and the URL is minified. That's it. Wanna share it? Share it. Wanna save it? Bookmark it. That's how Mr Doob does it here: http://mrdoob.com/#/146/html_editor |
yes, but where do the codes that are shared go? To a server most likely, but we want to do something else, so I'm saying that sharing it would post it to reddit and it would show up in a "shared" tab in livecodelab, what I'm saying basically is that we use an existing share website (with the ability to show symbols and indents) as a place to put the code without having to use a server. |
yeah yeah I'm cool with "fully fledged" server-heavy sharing - I made myself already a fully working system here https://github.com/davidedc/sketchPatch , which also saves thumbnails, has comments, manages permissions, "forks" sketches, tags, shows by author, etc. I'm just saying what the first step is to make the simplest URL-encoded sharing. Waiting on big releases doesn't make too much sense, I suggest we ship well-made and robust small stuff first, and then we iterate... |
How about just overloading the URL? It would be cumbersome for larger sketches, but it could also mean that “run” links could be added to the screenshots on the site without having to have any server-side code. Even the safest limit is 2000 characters which is a decent amount of code. As well, code that’s added in-editor could simply be echoed to the url meaning users could copy/paste exactly as they expect. |
Sharing
Allow users to share sketches by just dumping them to Gist or similar. Allow other users to import these sketches into their own sketch:
import gist/123456
. The imported sketch could consist of fully fleshed out visuals, or it could just define functions (#211) (likegrid
) with macros, so the user now has access to these extras.Other thoughs:
import grid --> import gist/123456
.ifmain
: the imported sketches might need a way of knowing whether they are viewed as a standalone sketch or imported. If the sketch is viewed by itself, it could include examples of the function that was defined.The text was updated successfully, but these errors were encountered: