{"action":"created","comment":{"url":"https://api.github.com/repos/metapolator/metapolator/pulls/comments/28268485","id":28268485,"diff_hunk":"@@ -614,6 +616,38 @@ define([\n         exportController.export();\n     };\n \n+    _p.exportZipInstance = function(masterName, instanceName, precision) {\n+        //export the font to a temporary directory\n+        var temp_dir = instanceName+\"_temp\";\n+        this.exportInstance(masterName, temp_dir, precision);\n+\n+        //encode it as a zip file\n+        var content = zip.encode(this._io, temp_dir);\n+        this._io.writeFile(false, instanceName, new Buffer(content, 'base64'));\n+\n+        //delete the temp dir\n+        function rmDirRecursive(io, dir){\n+            function _isDirName(name) {\n+                return name.slice(-1) === '/';\n+            }\n+\n+            var i;\n+            var entries = io.readDir(false, dir);\n+            for (i in entries){","path":"app/lib/project/MetapolatorProject.js","position":37,"original_position":37,"commit_id":"355ca56eef64cb1faa5c699cebdb03221102b32a","original_commit_id":"355ca56eef64cb1faa5c699cebdb03221102b32a","user":{"login":"graphicore","id":393132,"avatar_url":"https://avatars.githubusercontent.com/u/393132?v=3","gravatar_id":"","url":"https://api.github.com/users/graphicore","html_url":"https://github.com/graphicore","followers_url":"https://api.github.com/users/graphicore/followers","following_url":"https://api.github.com/users/graphicore/following{/other_user}","gists_url":"https://api.github.com/users/graphicore/gists{/gist_id}","starred_url":"https://api.github.com/users/graphicore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphicore/subscriptions","organizations_url":"https://api.github.com/users/graphicore/orgs","repos_url":"https://api.github.com/users/graphicore/repos","events_url":"https://api.github.com/users/graphicore/events{/privacy}","received_events_url":"https://api.github.com/users/graphicore/received_events","type":"User","site_admin":false},"body":"Don't iterate over array this way. In the future of js `for(item of array)` is planned, but we can't use it right now.\r\n\r\nyou can use `array.prototype.map` or you do\r\n```\r\n  var i;\r\n  for(i=0;i<entries.length;i++)`\r\n// a bit more efficient:\r\nvar i,l;\r\nfor(i=0, l=entries.length;i<l;i++)\r\n```\r\n\r\n","created_at":"2015-04-13T19:04:54Z","updated_at":"2015-04-13T19:04:54Z","html_url":"https://github.com/metapolator/metapolator/pull/396#discussion_r28268485","pull_request_url":"https://api.github.com/repos/metapolator/metapolator/pulls/396","_links":{"self":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/comments/28268485"},"html":{"href":"https://github.com/metapolator/metapolator/pull/396#discussion_r28268485"},"pull_request":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/396"}}},"pull_request":{"url":"https://api.github.com/repos/metapolator/metapolator/pulls/396","id":33185034,"html_url":"https://github.com/metapolator/metapolator/pull/396","diff_url":"https://github.com/metapolator/metapolator/pull/396.diff","patch_url":"https://github.com/metapolator/metapolator/pull/396.patch","issue_url":"https://api.github.com/repos/metapolator/metapolator/issues/396","number":396,"state":"open","locked":false,"title":"Zip ufo js zip approach 2","user":{"login":"felipesanches","id":213676,"avatar_url":"https://avatars.githubusercontent.com/u/213676?v=3","gravatar_id":"","url":"https://api.github.com/users/felipesanches","html_url":"https://github.com/felipesanches","followers_url":"https://api.github.com/users/felipesanches/followers","following_url":"https://api.github.com/users/felipesanches/following{/other_user}","gists_url":"https://api.github.com/users/felipesanches/gists{/gist_id}","starred_url":"https://api.github.com/users/felipesanches/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipesanches/subscriptions","organizations_url":"https://api.github.com/users/felipesanches/orgs","repos_url":"https://api.github.com/users/felipesanches/repos","events_url":"https://api.github.com/users/felipesanches/events{/privacy}","received_events_url":"https://api.github.com/users/felipesanches/received_events","type":"User","site_admin":false},"body":"This is the UFO ZIP export feature using the JSZip library.","created_at":"2015-04-13T17:33:10Z","updated_at":"2015-04-13T19:04:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53821c8105200ae9e5522461b752716090aa8db1","assignee":{"login":"graphicore","id":393132,"avatar_url":"https://avatars.githubusercontent.com/u/393132?v=3","gravatar_id":"","url":"https://api.github.com/users/graphicore","html_url":"https://github.com/graphicore","followers_url":"https://api.github.com/users/graphicore/followers","following_url":"https://api.github.com/users/graphicore/following{/other_user}","gists_url":"https://api.github.com/users/graphicore/gists{/gist_id}","starred_url":"https://api.github.com/users/graphicore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphicore/subscriptions","organizations_url":"https://api.github.com/users/graphicore/orgs","repos_url":"https://api.github.com/users/graphicore/repos","events_url":"https://api.github.com/users/graphicore/events{/privacy}","received_events_url":"https://api.github.com/users/graphicore/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/metapolator/metapolator/pulls/396/commits","review_comments_url":"https://api.github.com/repos/metapolator/metapolator/pulls/396/comments","review_comment_url":"https://api.github.com/repos/metapolator/metapolator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/metapolator/metapolator/issues/396/comments","statuses_url":"https://api.github.com/repos/metapolator/metapolator/statuses/355ca56eef64cb1faa5c699cebdb03221102b32a","head":{"label":"felipesanches:zip_ufo_JSZip_approach_2","ref":"zip_ufo_JSZip_approach_2","sha":"355ca56eef64cb1faa5c699cebdb03221102b32a","user":{"login":"felipesanches","id":213676,"avatar_url":"https://avatars.githubusercontent.com/u/213676?v=3","gravatar_id":"","url":"https://api.github.com/users/felipesanches","html_url":"https://github.com/felipesanches","followers_url":"https://api.github.com/users/felipesanches/followers","following_url":"https://api.github.com/users/felipesanches/following{/other_user}","gists_url":"https://api.github.com/users/felipesanches/gists{/gist_id}","starred_url":"https://api.github.com/users/felipesanches/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipesanches/subscriptions","organizations_url":"https://api.github.com/users/felipesanches/orgs","repos_url":"https://api.github.com/users/felipesanches/repos","events_url":"https://api.github.com/users/felipesanches/events{/privacy}","received_events_url":"https://api.github.com/users/felipesanches/received_events","type":"User","site_admin":false},"repo":{"id":33308614,"name":"metapolator","full_name":"felipesanches/metapolator","owner":{"login":"felipesanches","id":213676,"avatar_url":"https://avatars.githubusercontent.com/u/213676?v=3","gravatar_id":"","url":"https://api.github.com/users/felipesanches","html_url":"https://github.com/felipesanches","followers_url":"https://api.github.com/users/felipesanches/followers","following_url":"https://api.github.com/users/felipesanches/following{/other_user}","gists_url":"https://api.github.com/users/felipesanches/gists{/gist_id}","starred_url":"https://api.github.com/users/felipesanches/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipesanches/subscriptions","organizations_url":"https://api.github.com/users/felipesanches/orgs","repos_url":"https://api.github.com/users/felipesanches/repos","events_url":"https://api.github.com/users/felipesanches/events{/privacy}","received_events_url":"https://api.github.com/users/felipesanches/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/felipesanches/metapolator","description":"Design typeface families","fork":true,"url":"https://api.github.com/repos/felipesanches/metapolator","forks_url":"https://api.github.com/repos/felipesanches/metapolator/forks","keys_url":"https://api.github.com/repos/felipesanches/metapolator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/felipesanches/metapolator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/felipesanches/metapolator/teams","hooks_url":"https://api.github.com/repos/felipesanches/metapolator/hooks","issue_events_url":"https://api.github.com/repos/felipesanches/metapolator/issues/events{/number}","events_url":"https://api.github.com/repos/felipesanches/metapolator/events","assignees_url":"https://api.github.com/repos/felipesanches/metapolator/assignees{/user}","branches_url":"https://api.github.com/repos/felipesanches/metapolator/branches{/branch}","tags_url":"https://api.github.com/repos/felipesanches/metapolator/tags","blobs_url":"https://api.github.com/repos/felipesanches/metapolator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/felipesanches/metapolator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/felipesanches/metapolator/git/refs{/sha}","trees_url":"https://api.github.com/repos/felipesanches/metapolator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/felipesanches/metapolator/statuses/{sha}","languages_url":"https://api.github.com/repos/felipesanches/metapolator/languages","stargazers_url":"https://api.github.com/repos/felipesanches/metapolator/stargazers","contributors_url":"https://api.github.com/repos/felipesanches/metapolator/contributors","subscribers_url":"https://api.github.com/repos/felipesanches/metapolator/subscribers","subscription_url":"https://api.github.com/repos/felipesanches/metapolator/subscription","commits_url":"https://api.github.com/repos/felipesanches/metapolator/commits{/sha}","git_commits_url":"https://api.github.com/repos/felipesanches/metapolator/git/commits{/sha}","comments_url":"https://api.github.com/repos/felipesanches/metapolator/comments{/number}","issue_comment_url":"https://api.github.com/repos/felipesanches/metapolator/issues/comments{/number}","contents_url":"https://api.github.com/repos/felipesanches/metapolator/contents/{+path}","compare_url":"https://api.github.com/repos/felipesanches/metapolator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/felipesanches/metapolator/merges","archive_url":"https://api.github.com/repos/felipesanches/metapolator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/felipesanches/metapolator/downloads","issues_url":"https://api.github.com/repos/felipesanches/metapolator/issues{/number}","pulls_url":"https://api.github.com/repos/felipesanches/metapolator/pulls{/number}","milestones_url":"https://api.github.com/repos/felipesanches/metapolator/milestones{/number}","notifications_url":"https://api.github.com/repos/felipesanches/metapolator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/felipesanches/metapolator/labels{/name}","releases_url":"https://api.github.com/repos/felipesanches/metapolator/releases{/id}","created_at":"2015-04-02T12:52:37Z","updated_at":"2015-04-02T12:52:49Z","pushed_at":"2015-04-13T03:50:06Z","git_url":"git://github.com/felipesanches/metapolator.git","ssh_url":"git@github.com:felipesanches/metapolator.git","clone_url":"https://github.com/felipesanches/metapolator.git","svn_url":"https://github.com/felipesanches/metapolator","homepage":"metapolator.com","size":147148,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"metapolator:master","ref":"master","sha":"c7a1f33bc611be4a49b41a62ca6666dff41dc268","user":{"login":"metapolator","id":4283442,"avatar_url":"https://avatars.githubusercontent.com/u/4283442?v=3","gravatar_id":"","url":"https://api.github.com/users/metapolator","html_url":"https://github.com/metapolator","followers_url":"https://api.github.com/users/metapolator/followers","following_url":"https://api.github.com/users/metapolator/following{/other_user}","gists_url":"https://api.github.com/users/metapolator/gists{/gist_id}","starred_url":"https://api.github.com/users/metapolator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metapolator/subscriptions","organizations_url":"https://api.github.com/users/metapolator/orgs","repos_url":"https://api.github.com/users/metapolator/repos","events_url":"https://api.github.com/users/metapolator/events{/privacy}","received_events_url":"https://api.github.com/users/metapolator/received_events","type":"Organization","site_admin":false},"repo":{"id":9852744,"name":"metapolator","full_name":"metapolator/metapolator","owner":{"login":"metapolator","id":4283442,"avatar_url":"https://avatars.githubusercontent.com/u/4283442?v=3","gravatar_id":"","url":"https://api.github.com/users/metapolator","html_url":"https://github.com/metapolator","followers_url":"https://api.github.com/users/metapolator/followers","following_url":"https://api.github.com/users/metapolator/following{/other_user}","gists_url":"https://api.github.com/users/metapolator/gists{/gist_id}","starred_url":"https://api.github.com/users/metapolator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metapolator/subscriptions","organizations_url":"https://api.github.com/users/metapolator/orgs","repos_url":"https://api.github.com/users/metapolator/repos","events_url":"https://api.github.com/users/metapolator/events{/privacy}","received_events_url":"https://api.github.com/users/metapolator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metapolator/metapolator","description":"Design typeface families","fork":false,"url":"https://api.github.com/repos/metapolator/metapolator","forks_url":"https://api.github.com/repos/metapolator/metapolator/forks","keys_url":"https://api.github.com/repos/metapolator/metapolator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metapolator/metapolator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metapolator/metapolator/teams","hooks_url":"https://api.github.com/repos/metapolator/metapolator/hooks","issue_events_url":"https://api.github.com/repos/metapolator/metapolator/issues/events{/number}","events_url":"https://api.github.com/repos/metapolator/metapolator/events","assignees_url":"https://api.github.com/repos/metapolator/metapolator/assignees{/user}","branches_url":"https://api.github.com/repos/metapolator/metapolator/branches{/branch}","tags_url":"https://api.github.com/repos/metapolator/metapolator/tags","blobs_url":"https://api.github.com/repos/metapolator/metapolator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metapolator/metapolator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metapolator/metapolator/git/refs{/sha}","trees_url":"https://api.github.com/repos/metapolator/metapolator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metapolator/metapolator/statuses/{sha}","languages_url":"https://api.github.com/repos/metapolator/metapolator/languages","stargazers_url":"https://api.github.com/repos/metapolator/metapolator/stargazers","contributors_url":"https://api.github.com/repos/metapolator/metapolator/contributors","subscribers_url":"https://api.github.com/repos/metapolator/metapolator/subscribers","subscription_url":"https://api.github.com/repos/metapolator/metapolator/subscription","commits_url":"https://api.github.com/repos/metapolator/metapolator/commits{/sha}","git_commits_url":"https://api.github.com/repos/metapolator/metapolator/git/commits{/sha}","comments_url":"https://api.github.com/repos/metapolator/metapolator/comments{/number}","issue_comment_url":"https://api.github.com/repos/metapolator/metapolator/issues/comments{/number}","contents_url":"https://api.github.com/repos/metapolator/metapolator/contents/{+path}","compare_url":"https://api.github.com/repos/metapolator/metapolator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metapolator/metapolator/merges","archive_url":"https://api.github.com/repos/metapolator/metapolator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metapolator/metapolator/downloads","issues_url":"https://api.github.com/repos/metapolator/metapolator/issues{/number}","pulls_url":"https://api.github.com/repos/metapolator/metapolator/pulls{/number}","milestones_url":"https://api.github.com/repos/metapolator/metapolator/milestones{/number}","notifications_url":"https://api.github.com/repos/metapolator/metapolator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metapolator/metapolator/labels{/name}","releases_url":"https://api.github.com/repos/metapolator/metapolator/releases{/id}","created_at":"2013-05-04T10:51:47Z","updated_at":"2015-04-12T01:24:07Z","pushed_at":"2015-04-13T17:33:11Z","git_url":"git://github.com/metapolator/metapolator.git","ssh_url":"git@github.com:metapolator/metapolator.git","clone_url":"https://github.com/metapolator/metapolator.git","svn_url":"https://github.com/metapolator/metapolator","homepage":"metapolator.com","size":153997,"stargazers_count":111,"watchers_count":111,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":16,"mirror_url":null,"open_issues_count":60,"forks":16,"open_issues":60,"watchers":111,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/396"},"html":{"href":"https://github.com/metapolator/metapolator/pull/396"},"issue":{"href":"https://api.github.com/repos/metapolator/metapolator/issues/396"},"comments":{"href":"https://api.github.com/repos/metapolator/metapolator/issues/396/comments"},"review_comments":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/396/comments"},"review_comment":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/396/commits"},"statuses":{"href":"https://api.github.com/repos/metapolator/metapolator/statuses/355ca56eef64cb1faa5c699cebdb03221102b32a"}}}}