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
Proposal: Download block image #3238
Comments
I’m not sure that item 2 is feasible at this time. When I was implementing this feature for App Inventor I had looked into putting the png onto the clipboard since it would be a great help for teachers, but according to MDN the list of supported MIME types for scripts to put onto the clipboard is pretty limited for security reasons. IIRC no image formats were supported.
If you want to see how we accomplish both of these features (workspace and blocks export) see blockseditor/src/exportBlocksImage.js in the mit-xml/appinventor-sources repo. Note that we haven’t embedded the XML for the workspace export but it would be pretty trivial to implement given the existing code.
… On Oct 14, 2019, at 15:37, Mark Gibson ***@***.***> wrote:
Is your feature request related to a problem? Please describe.
Allow exporting an image of a block, and copying a block between workspaces.
Describe the solution you'd like
A block context menu item to download the block as an image with the xml embedded (as demonstrated in App Inventor by Evan at the Blocky Summit 2019)
Standard 'copy' (eg. ctrl/cmd+c) to push the same thing into the clipboard
Drag and drop outside of the workspace (stretched goal)
Describe alternatives you've considered
Additional context
I've seen that the playground currently has a whole workspace download option.
I'm currently hacking at this to see if we can have a general reusable solution based on the playground screenshot and the ideas presented in App Inventor. I'll keep you posted via this issue of how I get on.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Thanks Evan, yeah I wasn't sure whether the clipboard interaction would be possible either. So far I've managed to add 'Download Block Image' menu item into the Block context menu, expanding on @samelhusseini's screenshot feature in the playground... https://github.com/jollytoad/blockly/blob/jollytoad/download-block/tests/playgrounds/screenshot.js Next I'm going to try to embed the xml into it. |
So, I've managed to port across the export/import from App Inventor into the playground, to varying degrees of hackiness. (see branch above) I've had to override bits of the core Blockly here and there, it's making me think we really need some standard plugin system for Blockly, so I'm going to raise a new proposal issue, and make some suggestions for discussion. |
Design/example for such a plugin system is here... #3260 |
Closing in favor of a plugin: google/blockly-samples#249 |
Is your feature request related to a problem? Please describe.
Allow exporting an image of a block, and copying a block between workspaces.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
I've seen that the playground currently has a whole workspace download option.
I'm currently hacking at this to see if we can have a general reusable solution based on the playground screenshot and the ideas presented in App Inventor. I'll keep you posted via this issue of how I get on.
The text was updated successfully, but these errors were encountered: