{"action":"created","issue":{"url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/983","labels_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/983/labels{/name}","comments_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/983/comments","events_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/983/events","html_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/983","id":113531134,"number":983,"title":"WIP: Use Blob API to Save Files (to Disk)","user":{"login":"cycomachead","id":1505907,"avatar_url":"https://avatars.githubusercontent.com/u/1505907?v=3","gravatar_id":"","url":"https://api.github.com/users/cycomachead","html_url":"https://github.com/cycomachead","followers_url":"https://api.github.com/users/cycomachead/followers","following_url":"https://api.github.com/users/cycomachead/following{/other_user}","gists_url":"https://api.github.com/users/cycomachead/gists{/gist_id}","starred_url":"https://api.github.com/users/cycomachead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cycomachead/subscriptions","organizations_url":"https://api.github.com/users/cycomachead/orgs","repos_url":"https://api.github.com/users/cycomachead/repos","events_url":"https://api.github.com/users/cycomachead/events{/privacy}","received_events_url":"https://api.github.com/users/cycomachead/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/labels/in%20progress%20/%20not%20ready","name":"in progress / not ready","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-10-27T08:35:08Z","updated_at":"2015-12-01T08:15:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/983","html_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/983","diff_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/983.diff","patch_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/983.patch"},"body":"This is following the discussion on #966 this adds FileSaver as a library\r\nand creates a new function `IDE_Morph::saveFileAs` that is designed to be the\r\none-and-only way of getting data from Snap<i>!</i> to a user's computer.\r\n\r\nI still have lots of work to do, but I wanted to share the code so others could\r\ntest if desired. Right now, I've only been messing with the export project\r\nfunction.\r\n\r\nTODO:\r\n- [ ] Lots of testing! :smile: \r\n- [x] Refactor conditionals in `saveFileAs`\r\n- [x] Write Error messages\r\n- [x] Handle `isCatchingErrors`\r\n- [x] verify file names\r\n- [x] Use blob URLs for new windows? \r\n- [x] fix \"Export Project\" to Open and not download ?"},"comment":{"url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/comments/160890854","html_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/983#issuecomment-160890854","issue_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/983","id":160890854,"user":{"login":"cycomachead","id":1505907,"avatar_url":"https://avatars.githubusercontent.com/u/1505907?v=3","gravatar_id":"","url":"https://api.github.com/users/cycomachead","html_url":"https://github.com/cycomachead","followers_url":"https://api.github.com/users/cycomachead/followers","following_url":"https://api.github.com/users/cycomachead/following{/other_user}","gists_url":"https://api.github.com/users/cycomachead/gists{/gist_id}","starred_url":"https://api.github.com/users/cycomachead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cycomachead/subscriptions","organizations_url":"https://api.github.com/users/cycomachead/orgs","repos_url":"https://api.github.com/users/cycomachead/repos","events_url":"https://api.github.com/users/cycomachead/events{/privacy}","received_events_url":"https://api.github.com/users/cycomachead/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T08:15:38Z","updated_at":"2015-12-01T08:15:38Z","body":"This is almost ready, I have a few fixes to make for exporting script pics for the block editor and for a couple file names, but I'd welcome other's input if they've tested.\r\n\r\nTesting Plans:\r\nImages should be displayed in a new tab unless they are large.\r\n* blocks.js:1855 - Script pic with Result\r\n* blocks.js:2325 - Script pic (normal)\r\n* blocks.js:5420 - Script pic (block editor)\r\n* blocks.js:11099 - Comment Pic\r\n* byob.js:770 - Script pic (custom block script)\r\n* gui.js:3151 - ALL Scripts pic\r\n* gui.js:5908 - Stage Picture (icon context menu)\r\n* gui.js:6277 - export costume\r\n* objects.js:5740 - stage pic (stage context menu)\r\n\r\nSaving an XML should download to disk\r\n* Note Safari is stupid and will just display the darned file.\r\n* byob.js:798 - export single block definition (?)\r\n* byob.js:3383 - export blocks dialog\r\n* gui.js:3023 - export project (normal mode)\r\n* gui.js:3033 - export project (dev mode)\r\n* gui.js:3102 - export sprite\r\n* gui.js:4524 - export media (normal)\r\n* gui.js:4534 - export media (dev)\r\n* gui.js:4553 - export NO media (normal)\r\n* gui.js:4563 - export NO media (dev)\r\n* gui.js:4583 - export cloud data (normal)\r\n* gui.js:4595 - export cloud data (dev)\r\n\r\nAdditional Cases:\r\n* gui.js:3428 - Project summary HTML: New Tab\r\n* objects.js:7629 - exporting a variable\r\n\r\nBrowsers:\r\n\r\n- [ ] IE 11\r\n- [ ] IE Edge\r\n- [ ] Chrome (Windows)\r\n- [ ] Firefox (Windows)\r\n- [ ] Chrome (OS X)\r\n- [ ] Safari (OS X)\r\n- [ ] Firefox (OS X)\r\n- [ ] Chrome (Linux)\r\n- [ ] Firefox (Linux)\r\n"}}