{"action":"created","comment":{"url":"https://api.github.com/repos/collective/collective.upload/pulls/comments/66480213","id":66480213,"diff_hunk":"@@ -186,32 +83,42 @@ $(document).ready(function() {\n             });\n \n             $(document).bind('drop', function (e) {\n-                var url = $(e.originalEvent.dataTransfer.getData('text/html')).filter('img').attr('src');\n-                if (url) {\n-                    $.getImageData({\n-                        url: url,\n-                        server:'http://localhost:8080/Plone/@@jsonimageserializer?callback=?',\n-                        success: function (img) {\n-                            var canvas = document.createElement('canvas');\n-                            canvas.width = img.width;\n-                            canvas.height = img.height;\n-                            if (canvas.getContext && canvas.toBlob) {\n-                                canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height);\n-                                canvas.toBlob(function (blob) {\n-                                    $('#fileupload').fileupload('add', {files: [blob]});\n-                                }, \"image/jpeg\");\n-                            }\n-                        },\n-                        error: function(xhr, text_status){\n-                            // Handle your error here\n-                        }\n-                    });\n+              e.preventDefault();\n+              var upload_image = function(img) {\n+                var canvas = document.createElement('canvas');\n+                canvas.width = img.width;\n+                canvas.height = img.height;\n+                canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height);\n+                canvas.toBlob(function (blob) {\n+                  $('#fileupload').fileupload('add', {files: [blob]});\n+                }, \"image/jpeg\");","path":"src/collective/upload/static/main.js","position":149,"original_position":149,"commit_id":"ca1bd04269db7ab66597a0b50cfc51657e4f343b","original_commit_id":"ca1bd04269db7ab66597a0b50cfc51657e4f343b","user":{"login":"rodfersou","id":131209,"avatar_url":"https://avatars.githubusercontent.com/u/131209?v=3","gravatar_id":"","url":"https://api.github.com/users/rodfersou","html_url":"https://github.com/rodfersou","followers_url":"https://api.github.com/users/rodfersou/followers","following_url":"https://api.github.com/users/rodfersou/following{/other_user}","gists_url":"https://api.github.com/users/rodfersou/gists{/gist_id}","starred_url":"https://api.github.com/users/rodfersou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodfersou/subscriptions","organizations_url":"https://api.github.com/users/rodfersou/orgs","repos_url":"https://api.github.com/users/rodfersou/repos","events_url":"https://api.github.com/users/rodfersou/events{/privacy}","received_events_url":"https://api.github.com/users/rodfersou/received_events","type":"User","site_admin":false},"body":"this is just do fill the canvas preview, the original image is not hard-coded type","created_at":"2016-06-09T17:01:16Z","updated_at":"2016-06-09T17:01:16Z","html_url":"https://github.com/collective/collective.upload/pull/74#discussion_r66480213","pull_request_url":"https://api.github.com/repos/collective/collective.upload/pulls/74","_links":{"self":{"href":"https://api.github.com/repos/collective/collective.upload/pulls/comments/66480213"},"html":{"href":"https://github.com/collective/collective.upload/pull/74#discussion_r66480213"},"pull_request":{"href":"https://api.github.com/repos/collective/collective.upload/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/collective/collective.upload/pulls/74","id":73075250,"html_url":"https://github.com/collective/collective.upload/pull/74","diff_url":"https://github.com/collective/collective.upload/pull/74.diff","patch_url":"https://github.com/collective/collective.upload/pull/74.patch","issue_url":"https://api.github.com/repos/collective/collective.upload/issues/74","number":74,"state":"open","locked":false,"title":"Issue 71 - Review drop files in the file uploader","user":{"login":"rodfersou","id":131209,"avatar_url":"https://avatars.githubusercontent.com/u/131209?v=3","gravatar_id":"","url":"https://api.github.com/users/rodfersou","html_url":"https://github.com/rodfersou","followers_url":"https://api.github.com/users/rodfersou/followers","following_url":"https://api.github.com/users/rodfersou/following{/other_user}","gists_url":"https://api.github.com/users/rodfersou/gists{/gist_id}","starred_url":"https://api.github.com/users/rodfersou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodfersou/subscriptions","organizations_url":"https://api.github.com/users/rodfersou/orgs","repos_url":"https://api.github.com/users/rodfersou/repos","events_url":"https://api.github.com/users/rodfersou/events{/privacy}","received_events_url":"https://api.github.com/users/rodfersou/received_events","type":"User","site_admin":false},"body":"closes #71","created_at":"2016-06-08T16:08:05Z","updated_at":"2016-06-09T17:01:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ca3c8eed58a261ff3a743690906101e264c2240","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/collective/collective.upload/pulls/74/commits","review_comments_url":"https://api.github.com/repos/collective/collective.upload/pulls/74/comments","review_comment_url":"https://api.github.com/repos/collective/collective.upload/pulls/comments{/number}","comments_url":"https://api.github.com/repos/collective/collective.upload/issues/74/comments","statuses_url":"https://api.github.com/repos/collective/collective.upload/statuses/ca1bd04269db7ab66597a0b50cfc51657e4f343b","head":{"label":"collective:issue_71","ref":"issue_71","sha":"ca1bd04269db7ab66597a0b50cfc51657e4f343b","user":{"login":"collective","id":362867,"avatar_url":"https://avatars.githubusercontent.com/u/362867?v=3","gravatar_id":"","url":"https://api.github.com/users/collective","html_url":"https://github.com/collective","followers_url":"https://api.github.com/users/collective/followers","following_url":"https://api.github.com/users/collective/following{/other_user}","gists_url":"https://api.github.com/users/collective/gists{/gist_id}","starred_url":"https://api.github.com/users/collective/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/collective/subscriptions","organizations_url":"https://api.github.com/users/collective/orgs","repos_url":"https://api.github.com/users/collective/repos","events_url":"https://api.github.com/users/collective/events{/privacy}","received_events_url":"https://api.github.com/users/collective/received_events","type":"Organization","site_admin":false},"repo":{"id":2477462,"name":"collective.upload","full_name":"collective/collective.upload","owner":{"login":"collective","id":362867,"avatar_url":"https://avatars.githubusercontent.com/u/362867?v=3","gravatar_id":"","url":"https://api.github.com/users/collective","html_url":"https://github.com/collective","followers_url":"https://api.github.com/users/collective/followers","following_url":"https://api.github.com/users/collective/following{/other_user}","gists_url":"https://api.github.com/users/collective/gists{/gist_id}","starred_url":"https://api.github.com/users/collective/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/collective/subscriptions","organizations_url":"https://api.github.com/users/collective/orgs","repos_url":"https://api.github.com/users/collective/repos","events_url":"https://api.github.com/users/collective/events{/privacy}","received_events_url":"https://api.github.com/users/collective/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/collective/collective.upload","description":"File upload widget with multiple file selection, drag&drop support, progress bars, client-side image resizing and preview images.","fork":false,"url":"https://api.github.com/repos/collective/collective.upload","forks_url":"https://api.github.com/repos/collective/collective.upload/forks","keys_url":"https://api.github.com/repos/collective/collective.upload/keys{/key_id}","collaborators_url":"https://api.github.com/repos/collective/collective.upload/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/collective/collective.upload/teams","hooks_url":"https://api.github.com/repos/collective/collective.upload/hooks","issue_events_url":"https://api.github.com/repos/collective/collective.upload/issues/events{/number}","events_url":"https://api.github.com/repos/collective/collective.upload/events","assignees_url":"https://api.github.com/repos/collective/collective.upload/assignees{/user}","branches_url":"https://api.github.com/repos/collective/collective.upload/branches{/branch}","tags_url":"https://api.github.com/repos/collective/collective.upload/tags","blobs_url":"https://api.github.com/repos/collective/collective.upload/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/collective/collective.upload/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/collective/collective.upload/git/refs{/sha}","trees_url":"https://api.github.com/repos/collective/collective.upload/git/trees{/sha}","statuses_url":"https://api.github.com/repos/collective/collective.upload/statuses/{sha}","languages_url":"https://api.github.com/repos/collective/collective.upload/languages","stargazers_url":"https://api.github.com/repos/collective/collective.upload/stargazers","contributors_url":"https://api.github.com/repos/collective/collective.upload/contributors","subscribers_url":"https://api.github.com/repos/collective/collective.upload/subscribers","subscription_url":"https://api.github.com/repos/collective/collective.upload/subscription","commits_url":"https://api.github.com/repos/collective/collective.upload/commits{/sha}","git_commits_url":"https://api.github.com/repos/collective/collective.upload/git/commits{/sha}","comments_url":"https://api.github.com/repos/collective/collective.upload/comments{/number}","issue_comment_url":"https://api.github.com/repos/collective/collective.upload/issues/comments{/number}","contents_url":"https://api.github.com/repos/collective/collective.upload/contents/{+path}","compare_url":"https://api.github.com/repos/collective/collective.upload/compare/{base}...{head}","merges_url":"https://api.github.com/repos/collective/collective.upload/merges","archive_url":"https://api.github.com/repos/collective/collective.upload/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/collective/collective.upload/downloads","issues_url":"https://api.github.com/repos/collective/collective.upload/issues{/number}","pulls_url":"https://api.github.com/repos/collective/collective.upload/pulls{/number}","milestones_url":"https://api.github.com/repos/collective/collective.upload/milestones{/number}","notifications_url":"https://api.github.com/repos/collective/collective.upload/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/collective/collective.upload/labels{/name}","releases_url":"https://api.github.com/repos/collective/collective.upload/releases{/id}","deployments_url":"https://api.github.com/repos/collective/collective.upload/deployments","created_at":"2011-09-28T19:48:32Z","updated_at":"2016-06-04T19:16:44Z","pushed_at":"2016-06-08T18:54:42Z","git_url":"git://github.com/collective/collective.upload.git","ssh_url":"git@github.com:collective/collective.upload.git","clone_url":"https://github.com/collective/collective.upload.git","svn_url":"https://github.com/collective/collective.upload","homepage":"","size":449,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":23,"forks":6,"open_issues":23,"watchers":8,"default_branch":"master"}},"base":{"label":"collective:master","ref":"master","sha":"8468e186c462699d2410385ed28d463ae415d427","user":{"login":"collective","id":362867,"avatar_url":"https://avatars.githubusercontent.com/u/362867?v=3","gravatar_id":"","url":"https://api.github.com/users/collective","html_url":"https://github.com/collective","followers_url":"https://api.github.com/users/collective/followers","following_url":"https://api.github.com/users/collective/following{/other_user}","gists_url":"https://api.github.com/users/collective/gists{/gist_id}","starred_url":"https://api.github.com/users/collective/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/collective/subscriptions","organizations_url":"https://api.github.com/users/collective/orgs","repos_url":"https://api.github.com/users/collective/repos","events_url":"https://api.github.com/users/collective/events{/privacy}","received_events_url":"https://api.github.com/users/collective/received_events","type":"Organization","site_admin":false},"repo":{"id":2477462,"name":"collective.upload","full_name":"collective/collective.upload","owner":{"login":"collective","id":362867,"avatar_url":"https://avatars.githubusercontent.com/u/362867?v=3","gravatar_id":"","url":"https://api.github.com/users/collective","html_url":"https://github.com/collective","followers_url":"https://api.github.com/users/collective/followers","following_url":"https://api.github.com/users/collective/following{/other_user}","gists_url":"https://api.github.com/users/collective/gists{/gist_id}","starred_url":"https://api.github.com/users/collective/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/collective/subscriptions","organizations_url":"https://api.github.com/users/collective/orgs","repos_url":"https://api.github.com/users/collective/repos","events_url":"https://api.github.com/users/collective/events{/privacy}","received_events_url":"https://api.github.com/users/collective/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/collective/collective.upload","description":"File upload widget with multiple file selection, drag&drop support, progress bars, client-side image resizing and preview images.","fork":false,"url":"https://api.github.com/repos/collective/collective.upload","forks_url":"https://api.github.com/repos/collective/collective.upload/forks","keys_url":"https://api.github.com/repos/collective/collective.upload/keys{/key_id}","collaborators_url":"https://api.github.com/repos/collective/collective.upload/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/collective/collective.upload/teams","hooks_url":"https://api.github.com/repos/collective/collective.upload/hooks","issue_events_url":"https://api.github.com/repos/collective/collective.upload/issues/events{/number}","events_url":"https://api.github.com/repos/collective/collective.upload/events","assignees_url":"https://api.github.com/repos/collective/collective.upload/assignees{/user}","branches_url":"https://api.github.com/repos/collective/collective.upload/branches{/branch}","tags_url":"https://api.github.com/repos/collective/collective.upload/tags","blobs_url":"https://api.github.com/repos/collective/collective.upload/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/collective/collective.upload/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/collective/collective.upload/git/refs{/sha}","trees_url":"https://api.github.com/repos/collective/collective.upload/git/trees{/sha}","statuses_url":"https://api.github.com/repos/collective/collective.upload/statuses/{sha}","languages_url":"https://api.github.com/repos/collective/collective.upload/languages","stargazers_url":"https://api.github.com/repos/collective/collective.upload/stargazers","contributors_url":"https://api.github.com/repos/collective/collective.upload/contributors","subscribers_url":"https://api.github.com/repos/collective/collective.upload/subscribers","subscription_url":"https://api.github.com/repos/collective/collective.upload/subscription","commits_url":"https://api.github.com/repos/collective/collective.upload/commits{/sha}","git_commits_url":"https://api.github.com/repos/collective/collective.upload/git/commits{/sha}","comments_url":"https://api.github.com/repos/collective/collective.upload/comments{/number}","issue_comment_url":"https://api.github.com/repos/collective/collective.upload/issues/comments{/number}","contents_url":"https://api.github.com/repos/collective/collective.upload/contents/{+path}","compare_url":"https://api.github.com/repos/collective/collective.upload/compare/{base}...{head}","merges_url":"https://api.github.com/repos/collective/collective.upload/merges","archive_url":"https://api.github.com/repos/collective/collective.upload/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/collective/collective.upload/downloads","issues_url":"https://api.github.com/repos/collective/collective.upload/issues{/number}","pulls_url":"https://api.github.com/repos/collective/collective.upload/pulls{/number}","milestones_url":"https://api.github.com/repos/collective/collective.upload/milestones{/number}","notifications_url":"https://api.github.com/repos/collective/collective.upload/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/collective/collective.upload/labels{/name}","releases_url":"https://api.github.com/repos/collective/collective.upload/releases{/id}","deployments_url":"https://api.github.com/repos/collective/collective.upload/deployments","created_at":"2011-09-28T19:48:32Z","updated_at":"2016-06-04T19:16:44Z","pushed_at":"2016-06-08T18:54:42Z","git_url":"git://github.com/collective/collective.upload.git","ssh_url":"git@github.com:collective/collective.upload.git","clone_url":"https://github.com/collective/collective.upload.git","svn_url":"https://github.com/collective/collective.upload","homepage":"","size":449,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":23,"forks":6,"open_issues":23,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/collective/collective.upload/pulls/74"},"html":{"href":"https://github.com/collective/collective.upload/pull/74"},"issue":{"href":"https://api.github.com/repos/collective/collective.upload/issues/74"},"comments":{"href":"https://api.github.com/repos/collective/collective.upload/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/collective/collective.upload/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/collective/collective.upload/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/collective/collective.upload/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/collective/collective.upload/statuses/ca1bd04269db7ab66597a0b50cfc51657e4f343b"}}}}
{"actor":{"display_login":"rodfersou"}}