{"action":"created","comment":{"url":"https://api.github.com/repos/backbee/BbCoreJs/pulls/comments/58494527","id":58494527,"diff_hunk":"@@ -0,0 +1,229 @@\n+/*\n+ * Copyright (c) 2011-2016 Lp digital system\n+ *\n+ * This file is part of BackBee.\n+ *\n+ * BackBee is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU General Public License as published by\n+ * the Free Software Foundation, either version 3 of the License, or\n+ * (at your option) any later version.\n+ *\n+ * BackBee is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with BackBee. If not, see <http://www.gnu.org/licenses/>.\n+ */\n+\n+require.config({\n+    paths: {\n+        'ls-templates': 'src/tb/component/imagecropper/templates'\n+    }\n+});\n+\n+define(\n+    [\n+        'Core/Renderer',\n+        'crop.repository',\n+        'content.repository',\n+        'jquery',\n+        'component!popin',\n+        'component!translator',\n+        'content.manager',\n+        'text!ls-templates/layout.twig',\n+        'jquery-layout',\n+        'jsclass',\n+        'cropper'\n+    ],\n+    function (Renderer,\n+        CropRepository,\n+        ContentRepository,\n+        jQuery,\n+        PopInManager,\n+        Translator,\n+        ContentManager,\n+        layoutTemplate\n+        ) {\n+\n+        \"use strict\";\n+\n+        var ImageCropper = new JS.Class({\n+\n+            initialize: function () {\n+                var self = this,\n+                    popin_config = {\n+                        title: Translator.translate('crop_image'),\n+                        id: 'cropper-popin',\n+                        width: 500,\n+                        top: 15,\n+                        height: 'auto',\n+                        open: jQuery.proxy(function () { self.onOpen(self); }, null, this),\n+                        close: jQuery.proxy(function () { self.onClose(self); }, null, this)\n+                    };\n+                this.popin = PopInManager.createPopIn(popin_config);\n+            },\n+\n+            show: function (imageUid) {\n+                var self = this,\n+                    imageUrl = '',\n+                    available_proportions = [\n+                        ['16/9', '1.77'],\n+                        ['3/2', '1.5'],\n+                        ['5/3', '1.66'],\n+                        ['4/3', '1.33'],\n+                        ['5/4', '1.25'],\n+                        ['7/5', '1.4'],\n+                        [Translator.translate('square'), '1'],\n+                        [Translator.translate('custom'), 'NaN']\n+                    ];\n+\n+                if (null === imageUid || '' === imageUid) {\n+                    this.popin.destroy();\n+                    return require('component!notify').error(Translator.translate('image_could_not_load'));\n+                }\n+\n+                ContentRepository.find('Element/Image', imageUid).done(function (response) {","path":"src/tb/component/imagecropper/main.js","position":87,"original_position":87,"commit_id":"f46c8ed3a7cd2520d41c4a2414c760b09740ed48","original_commit_id":"f46c8ed3a7cd2520d41c4a2414c760b09740ed48","user":{"login":"fkroockmann","id":9247945,"avatar_url":"https://avatars.githubusercontent.com/u/9247945?v=3","gravatar_id":"","url":"https://api.github.com/users/fkroockmann","html_url":"https://github.com/fkroockmann","followers_url":"https://api.github.com/users/fkroockmann/followers","following_url":"https://api.github.com/users/fkroockmann/following{/other_user}","gists_url":"https://api.github.com/users/fkroockmann/gists{/gist_id}","starred_url":"https://api.github.com/users/fkroockmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fkroockmann/subscriptions","organizations_url":"https://api.github.com/users/fkroockmann/orgs","repos_url":"https://api.github.com/users/fkroockmann/repos","events_url":"https://api.github.com/users/fkroockmann/events{/privacy}","received_events_url":"https://api.github.com/users/fkroockmann/received_events","type":"User","site_admin":false},"body":"element/image is not always","created_at":"2016-04-05T07:02:38Z","updated_at":"2016-04-05T07:02:38Z","html_url":"https://github.com/backbee/BbCoreJs/pull/1236#discussion_r58494527","pull_request_url":"https://api.github.com/repos/backbee/BbCoreJs/pulls/1236","_links":{"self":{"href":"https://api.github.com/repos/backbee/BbCoreJs/pulls/comments/58494527"},"html":{"href":"https://github.com/backbee/BbCoreJs/pull/1236#discussion_r58494527"},"pull_request":{"href":"https://api.github.com/repos/backbee/BbCoreJs/pulls/1236"}}},"pull_request":{"url":"https://api.github.com/repos/backbee/BbCoreJs/pulls/1236","id":64756947,"html_url":"https://github.com/backbee/BbCoreJs/pull/1236","diff_url":"https://github.com/backbee/BbCoreJs/pull/1236.diff","patch_url":"https://github.com/backbee/BbCoreJs/pull/1236.patch","issue_url":"https://api.github.com/repos/backbee/BbCoreJs/issues/1236","number":1236,"state":"open","locked":false,"title":"[MEDIA] Image croping","user":{"login":"mihaifaget","id":17977132,"avatar_url":"https://avatars.githubusercontent.com/u/17977132?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaifaget","html_url":"https://github.com/mihaifaget","followers_url":"https://api.github.com/users/mihaifaget/followers","following_url":"https://api.github.com/users/mihaifaget/following{/other_user}","gists_url":"https://api.github.com/users/mihaifaget/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaifaget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaifaget/subscriptions","organizations_url":"https://api.github.com/users/mihaifaget/orgs","repos_url":"https://api.github.com/users/mihaifaget/repos","events_url":"https://api.github.com/users/mihaifaget/events{/privacy}","received_events_url":"https://api.github.com/users/mihaifaget/received_events","type":"User","site_admin":false},"body":"Related issue: https://github.com/backbee/backbee-standard/issues/666","created_at":"2016-03-31T09:07:43Z","updated_at":"2016-04-05T07:02:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da0a1009eb70bb1b7a8021d9294c0a52a4e69f76","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/backbee/BbCoreJs/pulls/1236/commits","review_comments_url":"https://api.github.com/repos/backbee/BbCoreJs/pulls/1236/comments","review_comment_url":"https://api.github.com/repos/backbee/BbCoreJs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/backbee/BbCoreJs/issues/1236/comments","statuses_url":"https://api.github.com/repos/backbee/BbCoreJs/statuses/f46c8ed3a7cd2520d41c4a2414c760b09740ed48","head":{"label":"mihaifaget:666","ref":"666","sha":"f46c8ed3a7cd2520d41c4a2414c760b09740ed48","user":{"login":"mihaifaget","id":17977132,"avatar_url":"https://avatars.githubusercontent.com/u/17977132?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaifaget","html_url":"https://github.com/mihaifaget","followers_url":"https://api.github.com/users/mihaifaget/followers","following_url":"https://api.github.com/users/mihaifaget/following{/other_user}","gists_url":"https://api.github.com/users/mihaifaget/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaifaget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaifaget/subscriptions","organizations_url":"https://api.github.com/users/mihaifaget/orgs","repos_url":"https://api.github.com/users/mihaifaget/repos","events_url":"https://api.github.com/users/mihaifaget/events{/privacy}","received_events_url":"https://api.github.com/users/mihaifaget/received_events","type":"User","site_admin":false},"repo":{"id":54371285,"name":"BbCoreJs","full_name":"mihaifaget/BbCoreJs","owner":{"login":"mihaifaget","id":17977132,"avatar_url":"https://avatars.githubusercontent.com/u/17977132?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaifaget","html_url":"https://github.com/mihaifaget","followers_url":"https://api.github.com/users/mihaifaget/followers","following_url":"https://api.github.com/users/mihaifaget/following{/other_user}","gists_url":"https://api.github.com/users/mihaifaget/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaifaget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaifaget/subscriptions","organizations_url":"https://api.github.com/users/mihaifaget/orgs","repos_url":"https://api.github.com/users/mihaifaget/repos","events_url":"https://api.github.com/users/mihaifaget/events{/privacy}","received_events_url":"https://api.github.com/users/mihaifaget/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mihaifaget/BbCoreJs","description":"BackBee front-admin javascript","fork":true,"url":"https://api.github.com/repos/mihaifaget/BbCoreJs","forks_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/forks","keys_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/teams","hooks_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/hooks","issue_events_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/issues/events{/number}","events_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/events","assignees_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/assignees{/user}","branches_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/branches{/branch}","tags_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/tags","blobs_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/git/refs{/sha}","trees_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/statuses/{sha}","languages_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/languages","stargazers_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/stargazers","contributors_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/contributors","subscribers_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/subscribers","subscription_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/subscription","commits_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/commits{/sha}","git_commits_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/git/commits{/sha}","comments_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/comments{/number}","issue_comment_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/issues/comments{/number}","contents_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/contents/{+path}","compare_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/merges","archive_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/downloads","issues_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/issues{/number}","pulls_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/pulls{/number}","milestones_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/milestones{/number}","notifications_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/labels{/name}","releases_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/releases{/id}","deployments_url":"https://api.github.com/repos/mihaifaget/BbCoreJs/deployments","created_at":"2016-03-21T08:21:12Z","updated_at":"2016-03-21T08:21:15Z","pushed_at":"2016-04-04T15:12:32Z","git_url":"git://github.com/mihaifaget/BbCoreJs.git","ssh_url":"git@github.com:mihaifaget/BbCoreJs.git","clone_url":"https://github.com/mihaifaget/BbCoreJs.git","svn_url":"https://github.com/mihaifaget/BbCoreJs","homepage":null,"size":13977,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"backbee:master","ref":"master","sha":"acd92a7a379acd77b286c23ea18cf8790bad5f3a","user":{"login":"backbee","id":8198689,"avatar_url":"https://avatars.githubusercontent.com/u/8198689?v=3","gravatar_id":"","url":"https://api.github.com/users/backbee","html_url":"https://github.com/backbee","followers_url":"https://api.github.com/users/backbee/followers","following_url":"https://api.github.com/users/backbee/following{/other_user}","gists_url":"https://api.github.com/users/backbee/gists{/gist_id}","starred_url":"https://api.github.com/users/backbee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/backbee/subscriptions","organizations_url":"https://api.github.com/users/backbee/orgs","repos_url":"https://api.github.com/users/backbee/repos","events_url":"https://api.github.com/users/backbee/events{/privacy}","received_events_url":"https://api.github.com/users/backbee/received_events","type":"Organization","site_admin":false},"repo":{"id":25197244,"name":"BbCoreJs","full_name":"backbee/BbCoreJs","owner":{"login":"backbee","id":8198689,"avatar_url":"https://avatars.githubusercontent.com/u/8198689?v=3","gravatar_id":"","url":"https://api.github.com/users/backbee","html_url":"https://github.com/backbee","followers_url":"https://api.github.com/users/backbee/followers","following_url":"https://api.github.com/users/backbee/following{/other_user}","gists_url":"https://api.github.com/users/backbee/gists{/gist_id}","starred_url":"https://api.github.com/users/backbee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/backbee/subscriptions","organizations_url":"https://api.github.com/users/backbee/orgs","repos_url":"https://api.github.com/users/backbee/repos","events_url":"https://api.github.com/users/backbee/events{/privacy}","received_events_url":"https://api.github.com/users/backbee/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/backbee/BbCoreJs","description":"BackBee front-admin javascript","fork":false,"url":"https://api.github.com/repos/backbee/BbCoreJs","forks_url":"https://api.github.com/repos/backbee/BbCoreJs/forks","keys_url":"https://api.github.com/repos/backbee/BbCoreJs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/backbee/BbCoreJs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/backbee/BbCoreJs/teams","hooks_url":"https://api.github.com/repos/backbee/BbCoreJs/hooks","issue_events_url":"https://api.github.com/repos/backbee/BbCoreJs/issues/events{/number}","events_url":"https://api.github.com/repos/backbee/BbCoreJs/events","assignees_url":"https://api.github.com/repos/backbee/BbCoreJs/assignees{/user}","branches_url":"https://api.github.com/repos/backbee/BbCoreJs/branches{/branch}","tags_url":"https://api.github.com/repos/backbee/BbCoreJs/tags","blobs_url":"https://api.github.com/repos/backbee/BbCoreJs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/backbee/BbCoreJs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/backbee/BbCoreJs/git/refs{/sha}","trees_url":"https://api.github.com/repos/backbee/BbCoreJs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/backbee/BbCoreJs/statuses/{sha}","languages_url":"https://api.github.com/repos/backbee/BbCoreJs/languages","stargazers_url":"https://api.github.com/repos/backbee/BbCoreJs/stargazers","contributors_url":"https://api.github.com/repos/backbee/BbCoreJs/contributors","subscribers_url":"https://api.github.com/repos/backbee/BbCoreJs/subscribers","subscription_url":"https://api.github.com/repos/backbee/BbCoreJs/subscription","commits_url":"https://api.github.com/repos/backbee/BbCoreJs/commits{/sha}","git_commits_url":"https://api.github.com/repos/backbee/BbCoreJs/git/commits{/sha}","comments_url":"https://api.github.com/repos/backbee/BbCoreJs/comments{/number}","issue_comment_url":"https://api.github.com/repos/backbee/BbCoreJs/issues/comments{/number}","contents_url":"https://api.github.com/repos/backbee/BbCoreJs/contents/{+path}","compare_url":"https://api.github.com/repos/backbee/BbCoreJs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/backbee/BbCoreJs/merges","archive_url":"https://api.github.com/repos/backbee/BbCoreJs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/backbee/BbCoreJs/downloads","issues_url":"https://api.github.com/repos/backbee/BbCoreJs/issues{/number}","pulls_url":"https://api.github.com/repos/backbee/BbCoreJs/pulls{/number}","milestones_url":"https://api.github.com/repos/backbee/BbCoreJs/milestones{/number}","notifications_url":"https://api.github.com/repos/backbee/BbCoreJs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/backbee/BbCoreJs/labels{/name}","releases_url":"https://api.github.com/repos/backbee/BbCoreJs/releases{/id}","deployments_url":"https://api.github.com/repos/backbee/BbCoreJs/deployments","created_at":"2014-10-14T08:32:15Z","updated_at":"2016-01-12T10:57:35Z","pushed_at":"2016-04-05T06:12:44Z","git_url":"git://github.com/backbee/BbCoreJs.git","ssh_url":"git@github.com:backbee/BbCoreJs.git","clone_url":"https://github.com/backbee/BbCoreJs.git","svn_url":"https://github.com/backbee/BbCoreJs","homepage":null,"size":16302,"stargazers_count":26,"watchers_count":26,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":6,"forks":18,"open_issues":6,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/backbee/BbCoreJs/pulls/1236"},"html":{"href":"https://github.com/backbee/BbCoreJs/pull/1236"},"issue":{"href":"https://api.github.com/repos/backbee/BbCoreJs/issues/1236"},"comments":{"href":"https://api.github.com/repos/backbee/BbCoreJs/issues/1236/comments"},"review_comments":{"href":"https://api.github.com/repos/backbee/BbCoreJs/pulls/1236/comments"},"review_comment":{"href":"https://api.github.com/repos/backbee/BbCoreJs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/backbee/BbCoreJs/pulls/1236/commits"},"statuses":{"href":"https://api.github.com/repos/backbee/BbCoreJs/statuses/f46c8ed3a7cd2520d41c4a2414c760b09740ed48"}}}}