{"action":"created","comment":{"url":"https://api.github.com/repos/Tapfiliate/tapatar/pulls/comments/44760976","id":44760976,"diff_hunk":"@@ -180,6 +187,16 @@\n \n             return $el;\n         },\n+        _addCropper: function(source) {\n+            var $img = this.$containerEl.find('.tptr-big-image');\n+            $img\n+                .cropper(this.options.cropper.options)\n+                .on('crop.cropper', this._cropEvent.bind(this, source, $img));\n+        },\n+        _cropEvent: function(source, $img) {\n+            source.setImageData($img.cropper('getCroppedCanvas').toDataURL());\n+            this._setPickedImage(source);","path":"src/tapatar.js","position":54,"original_position":54,"commit_id":"80e180b3fb5d10429c70757ac38fc5fbbfb7aa6b","original_commit_id":"80e180b3fb5d10429c70757ac38fc5fbbfb7aa6b","user":{"login":"kurtextrem","id":502146,"avatar_url":"https://avatars.githubusercontent.com/u/502146?v=3","gravatar_id":"","url":"https://api.github.com/users/kurtextrem","html_url":"https://github.com/kurtextrem","followers_url":"https://api.github.com/users/kurtextrem/followers","following_url":"https://api.github.com/users/kurtextrem/following{/other_user}","gists_url":"https://api.github.com/users/kurtextrem/gists{/gist_id}","starred_url":"https://api.github.com/users/kurtextrem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kurtextrem/subscriptions","organizations_url":"https://api.github.com/users/kurtextrem/orgs","repos_url":"https://api.github.com/users/kurtextrem/repos","events_url":"https://api.github.com/users/kurtextrem/events{/privacy}","received_events_url":"https://api.github.com/users/kurtextrem/received_events","type":"User","site_admin":false},"body":"in case you wonder why I don't set the 2nd parameter to true (`setImageData`): It would end in a cropper init loop.\r\nThat is why _setPickedImage has to be called separately.","created_at":"2015-11-13T08:52:01Z","updated_at":"2015-11-13T08:52:01Z","html_url":"https://github.com/Tapfiliate/tapatar/pull/7#discussion_r44760976","pull_request_url":"https://api.github.com/repos/Tapfiliate/tapatar/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/Tapfiliate/tapatar/pulls/comments/44760976"},"html":{"href":"https://github.com/Tapfiliate/tapatar/pull/7#discussion_r44760976"},"pull_request":{"href":"https://api.github.com/repos/Tapfiliate/tapatar/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/Tapfiliate/tapatar/pulls/7","id":50522644,"html_url":"https://github.com/Tapfiliate/tapatar/pull/7","diff_url":"https://github.com/Tapfiliate/tapatar/pull/7.diff","patch_url":"https://github.com/Tapfiliate/tapatar/pull/7.patch","issue_url":"https://api.github.com/repos/Tapfiliate/tapatar/issues/7","number":7,"state":"open","locked":false,"title":"Add crop(per) support","user":{"login":"kurtextrem","id":502146,"avatar_url":"https://avatars.githubusercontent.com/u/502146?v=3","gravatar_id":"","url":"https://api.github.com/users/kurtextrem","html_url":"https://github.com/kurtextrem","followers_url":"https://api.github.com/users/kurtextrem/followers","following_url":"https://api.github.com/users/kurtextrem/following{/other_user}","gists_url":"https://api.github.com/users/kurtextrem/gists{/gist_id}","starred_url":"https://api.github.com/users/kurtextrem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kurtextrem/subscriptions","organizations_url":"https://api.github.com/users/kurtextrem/orgs","repos_url":"https://api.github.com/users/kurtextrem/repos","events_url":"https://api.github.com/users/kurtextrem/events{/privacy}","received_events_url":"https://api.github.com/users/kurtextrem/received_events","type":"User","site_admin":false},"body":"To use cropper, simply embed the cropper.(min).js and the cropper.(min).css from https://github.com/fengyuanchen/cropper\r\n\r\n```\r\n<!doctype html>\r\n<html>\r\n<head>\r\n\t<title>tapatar test</title>\r\n\r\n\t<link rel=\"stylesheet\" href=\"dist/tapatar.css\">\r\n\t<link rel=\"stylesheet\" href=\"src/cropper/cropper.min.css\">\r\n</head>\r\n<body>\r\n\t<input type=\"hidden\" class=\"tapatar\">\r\n\t<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js\"></script>\r\n\t<script src=\"src/tapatar.js\"></script>\r\n\t<script src=\"src/tapatar-source.js\"></script>\r\n\t<script src=\"src/sources/local.js\"></script>\r\n\t<script src=\"src/cropper/cropper.min.js\"></script>\r\n\t<script>\r\n\t\t$.fn.ready(function (){\r\n\t\t\t$('input.tapatar').tapatar({ cropper: {enabled:true}})\r\n\t\t})\r\n\t</script>\r\n</body>\r\n</html>\r\n```","created_at":"2015-11-12T15:15:18Z","updated_at":"2015-11-13T08:52:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7480d4a4a6b813769dd518f44787006e761c1326","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Tapfiliate/tapatar/pulls/7/commits","review_comments_url":"https://api.github.com/repos/Tapfiliate/tapatar/pulls/7/comments","review_comment_url":"https://api.github.com/repos/Tapfiliate/tapatar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Tapfiliate/tapatar/issues/7/comments","statuses_url":"https://api.github.com/repos/Tapfiliate/tapatar/statuses/80e180b3fb5d10429c70757ac38fc5fbbfb7aa6b","head":{"label":"kurtextrem:master","ref":"master","sha":"80e180b3fb5d10429c70757ac38fc5fbbfb7aa6b","user":{"login":"kurtextrem","id":502146,"avatar_url":"https://avatars.githubusercontent.com/u/502146?v=3","gravatar_id":"","url":"https://api.github.com/users/kurtextrem","html_url":"https://github.com/kurtextrem","followers_url":"https://api.github.com/users/kurtextrem/followers","following_url":"https://api.github.com/users/kurtextrem/following{/other_user}","gists_url":"https://api.github.com/users/kurtextrem/gists{/gist_id}","starred_url":"https://api.github.com/users/kurtextrem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kurtextrem/subscriptions","organizations_url":"https://api.github.com/users/kurtextrem/orgs","repos_url":"https://api.github.com/users/kurtextrem/repos","events_url":"https://api.github.com/users/kurtextrem/events{/privacy}","received_events_url":"https://api.github.com/users/kurtextrem/received_events","type":"User","site_admin":false},"repo":{"id":45615050,"name":"tapatar","full_name":"kurtextrem/tapatar","owner":{"login":"kurtextrem","id":502146,"avatar_url":"https://avatars.githubusercontent.com/u/502146?v=3","gravatar_id":"","url":"https://api.github.com/users/kurtextrem","html_url":"https://github.com/kurtextrem","followers_url":"https://api.github.com/users/kurtextrem/followers","following_url":"https://api.github.com/users/kurtextrem/following{/other_user}","gists_url":"https://api.github.com/users/kurtextrem/gists{/gist_id}","starred_url":"https://api.github.com/users/kurtextrem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kurtextrem/subscriptions","organizations_url":"https://api.github.com/users/kurtextrem/orgs","repos_url":"https://api.github.com/users/kurtextrem/repos","events_url":"https://api.github.com/users/kurtextrem/events{/privacy}","received_events_url":"https://api.github.com/users/kurtextrem/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kurtextrem/tapatar","description":null,"fork":true,"url":"https://api.github.com/repos/kurtextrem/tapatar","forks_url":"https://api.github.com/repos/kurtextrem/tapatar/forks","keys_url":"https://api.github.com/repos/kurtextrem/tapatar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kurtextrem/tapatar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kurtextrem/tapatar/teams","hooks_url":"https://api.github.com/repos/kurtextrem/tapatar/hooks","issue_events_url":"https://api.github.com/repos/kurtextrem/tapatar/issues/events{/number}","events_url":"https://api.github.com/repos/kurtextrem/tapatar/events","assignees_url":"https://api.github.com/repos/kurtextrem/tapatar/assignees{/user}","branches_url":"https://api.github.com/repos/kurtextrem/tapatar/branches{/branch}","tags_url":"https://api.github.com/repos/kurtextrem/tapatar/tags","blobs_url":"https://api.github.com/repos/kurtextrem/tapatar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kurtextrem/tapatar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kurtextrem/tapatar/git/refs{/sha}","trees_url":"https://api.github.com/repos/kurtextrem/tapatar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kurtextrem/tapatar/statuses/{sha}","languages_url":"https://api.github.com/repos/kurtextrem/tapatar/languages","stargazers_url":"https://api.github.com/repos/kurtextrem/tapatar/stargazers","contributors_url":"https://api.github.com/repos/kurtextrem/tapatar/contributors","subscribers_url":"https://api.github.com/repos/kurtextrem/tapatar/subscribers","subscription_url":"https://api.github.com/repos/kurtextrem/tapatar/subscription","commits_url":"https://api.github.com/repos/kurtextrem/tapatar/commits{/sha}","git_commits_url":"https://api.github.com/repos/kurtextrem/tapatar/git/commits{/sha}","comments_url":"https://api.github.com/repos/kurtextrem/tapatar/comments{/number}","issue_comment_url":"https://api.github.com/repos/kurtextrem/tapatar/issues/comments{/number}","contents_url":"https://api.github.com/repos/kurtextrem/tapatar/contents/{+path}","compare_url":"https://api.github.com/repos/kurtextrem/tapatar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kurtextrem/tapatar/merges","archive_url":"https://api.github.com/repos/kurtextrem/tapatar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kurtextrem/tapatar/downloads","issues_url":"https://api.github.com/repos/kurtextrem/tapatar/issues{/number}","pulls_url":"https://api.github.com/repos/kurtextrem/tapatar/pulls{/number}","milestones_url":"https://api.github.com/repos/kurtextrem/tapatar/milestones{/number}","notifications_url":"https://api.github.com/repos/kurtextrem/tapatar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kurtextrem/tapatar/labels{/name}","releases_url":"https://api.github.com/repos/kurtextrem/tapatar/releases{/id}","created_at":"2015-11-05T14:08:51Z","updated_at":"2015-11-05T14:08:52Z","pushed_at":"2015-11-12T16:35:16Z","git_url":"git://github.com/kurtextrem/tapatar.git","ssh_url":"git@github.com:kurtextrem/tapatar.git","clone_url":"https://github.com/kurtextrem/tapatar.git","svn_url":"https://github.com/kurtextrem/tapatar","homepage":null,"size":121,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Tapfiliate:master","ref":"master","sha":"fcdd2c2ed8d6b7e357416dfe0273e78f45d4ae99","user":{"login":"Tapfiliate","id":7225319,"avatar_url":"https://avatars.githubusercontent.com/u/7225319?v=3","gravatar_id":"","url":"https://api.github.com/users/Tapfiliate","html_url":"https://github.com/Tapfiliate","followers_url":"https://api.github.com/users/Tapfiliate/followers","following_url":"https://api.github.com/users/Tapfiliate/following{/other_user}","gists_url":"https://api.github.com/users/Tapfiliate/gists{/gist_id}","starred_url":"https://api.github.com/users/Tapfiliate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tapfiliate/subscriptions","organizations_url":"https://api.github.com/users/Tapfiliate/orgs","repos_url":"https://api.github.com/users/Tapfiliate/repos","events_url":"https://api.github.com/users/Tapfiliate/events{/privacy}","received_events_url":"https://api.github.com/users/Tapfiliate/received_events","type":"Organization","site_admin":false},"repo":{"id":36607046,"name":"tapatar","full_name":"Tapfiliate/tapatar","owner":{"login":"Tapfiliate","id":7225319,"avatar_url":"https://avatars.githubusercontent.com/u/7225319?v=3","gravatar_id":"","url":"https://api.github.com/users/Tapfiliate","html_url":"https://github.com/Tapfiliate","followers_url":"https://api.github.com/users/Tapfiliate/followers","following_url":"https://api.github.com/users/Tapfiliate/following{/other_user}","gists_url":"https://api.github.com/users/Tapfiliate/gists{/gist_id}","starred_url":"https://api.github.com/users/Tapfiliate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tapfiliate/subscriptions","organizations_url":"https://api.github.com/users/Tapfiliate/orgs","repos_url":"https://api.github.com/users/Tapfiliate/repos","events_url":"https://api.github.com/users/Tapfiliate/events{/privacy}","received_events_url":"https://api.github.com/users/Tapfiliate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tapfiliate/tapatar","description":null,"fork":false,"url":"https://api.github.com/repos/Tapfiliate/tapatar","forks_url":"https://api.github.com/repos/Tapfiliate/tapatar/forks","keys_url":"https://api.github.com/repos/Tapfiliate/tapatar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tapfiliate/tapatar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tapfiliate/tapatar/teams","hooks_url":"https://api.github.com/repos/Tapfiliate/tapatar/hooks","issue_events_url":"https://api.github.com/repos/Tapfiliate/tapatar/issues/events{/number}","events_url":"https://api.github.com/repos/Tapfiliate/tapatar/events","assignees_url":"https://api.github.com/repos/Tapfiliate/tapatar/assignees{/user}","branches_url":"https://api.github.com/repos/Tapfiliate/tapatar/branches{/branch}","tags_url":"https://api.github.com/repos/Tapfiliate/tapatar/tags","blobs_url":"https://api.github.com/repos/Tapfiliate/tapatar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tapfiliate/tapatar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tapfiliate/tapatar/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tapfiliate/tapatar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tapfiliate/tapatar/statuses/{sha}","languages_url":"https://api.github.com/repos/Tapfiliate/tapatar/languages","stargazers_url":"https://api.github.com/repos/Tapfiliate/tapatar/stargazers","contributors_url":"https://api.github.com/repos/Tapfiliate/tapatar/contributors","subscribers_url":"https://api.github.com/repos/Tapfiliate/tapatar/subscribers","subscription_url":"https://api.github.com/repos/Tapfiliate/tapatar/subscription","commits_url":"https://api.github.com/repos/Tapfiliate/tapatar/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tapfiliate/tapatar/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tapfiliate/tapatar/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tapfiliate/tapatar/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tapfiliate/tapatar/contents/{+path}","compare_url":"https://api.github.com/repos/Tapfiliate/tapatar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tapfiliate/tapatar/merges","archive_url":"https://api.github.com/repos/Tapfiliate/tapatar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tapfiliate/tapatar/downloads","issues_url":"https://api.github.com/repos/Tapfiliate/tapatar/issues{/number}","pulls_url":"https://api.github.com/repos/Tapfiliate/tapatar/pulls{/number}","milestones_url":"https://api.github.com/repos/Tapfiliate/tapatar/milestones{/number}","notifications_url":"https://api.github.com/repos/Tapfiliate/tapatar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tapfiliate/tapatar/labels{/name}","releases_url":"https://api.github.com/repos/Tapfiliate/tapatar/releases{/id}","created_at":"2015-05-31T14:38:38Z","updated_at":"2015-11-02T22:20:49Z","pushed_at":"2015-11-12T16:35:16Z","git_url":"git://github.com/Tapfiliate/tapatar.git","ssh_url":"git@github.com:Tapfiliate/tapatar.git","clone_url":"https://github.com/Tapfiliate/tapatar.git","svn_url":"https://github.com/Tapfiliate/tapatar","homepage":null,"size":181,"stargazers_count":29,"watchers_count":29,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":2,"forks":11,"open_issues":2,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Tapfiliate/tapatar/pulls/7"},"html":{"href":"https://github.com/Tapfiliate/tapatar/pull/7"},"issue":{"href":"https://api.github.com/repos/Tapfiliate/tapatar/issues/7"},"comments":{"href":"https://api.github.com/repos/Tapfiliate/tapatar/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/Tapfiliate/tapatar/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/Tapfiliate/tapatar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Tapfiliate/tapatar/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/Tapfiliate/tapatar/statuses/80e180b3fb5d10429c70757ac38fc5fbbfb7aa6b"}}}}