{"action":"created","issue":{"url":"https://api.github.com/repos/EOL/eol/issues/118","labels_url":"https://api.github.com/repos/EOL/eol/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/EOL/eol/issues/118/comments","events_url":"https://api.github.com/repos/EOL/eol/issues/118/events","html_url":"https://github.com/EOL/eol/pull/118","id":66499435,"number":118,"title":"Switch to using crop percentages","user":{"login":"hyanwong","id":4699014,"avatar_url":"https://avatars.githubusercontent.com/u/4699014?v=3","gravatar_id":"","url":"https://api.github.com/users/hyanwong","html_url":"https://github.com/hyanwong","followers_url":"https://api.github.com/users/hyanwong/followers","following_url":"https://api.github.com/users/hyanwong/following{/other_user}","gists_url":"https://api.github.com/users/hyanwong/gists{/gist_id}","starred_url":"https://api.github.com/users/hyanwong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyanwong/subscriptions","organizations_url":"https://api.github.com/users/hyanwong/orgs","repos_url":"https://api.github.com/users/hyanwong/repos","events_url":"https://api.github.com/users/hyanwong/events{/privacy}","received_events_url":"https://api.github.com/users/hyanwong/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-06T00:50:04Z","updated_at":"2015-04-06T16:44:19Z","closed_at":"2015-04-06T12:16:02Z","pull_request":{"url":"https://api.github.com/repos/EOL/eol/pulls/118","html_url":"https://github.com/EOL/eol/pull/118","diff_url":"https://github.com/EOL/eol/pull/118.diff","patch_url":"https://github.com/EOL/eol/pull/118.patch"},"body":"This moves the calculation on lines 686-717 of ContentManager.php to the javascript side. That means the php image cropping code in ContentManager.php becomes independent of the front-end web code (css etc). It should allow 62 lines (the crop_image function) to be cut from the php code. Annoyingly, the javascript replacement is slightly complicated by having to deal with the lack of the naturalWidth and naturalHeight properties in Internet Explorer 6, 7  and 8.\r\n\r\nThis code has not been tested on a full working system: in particular, I am not sure if the ruby code has been correctly changed so that the crop_image_pct() function is called instead of crop_image()"},"comment":{"url":"https://api.github.com/repos/EOL/eol/issues/comments/90144720","html_url":"https://github.com/EOL/eol/pull/118#issuecomment-90144720","issue_url":"https://api.github.com/repos/EOL/eol/issues/118","id":90144720,"user":{"login":"hyanwong","id":4699014,"avatar_url":"https://avatars.githubusercontent.com/u/4699014?v=3","gravatar_id":"","url":"https://api.github.com/users/hyanwong","html_url":"https://github.com/hyanwong","followers_url":"https://api.github.com/users/hyanwong/followers","following_url":"https://api.github.com/users/hyanwong/following{/other_user}","gists_url":"https://api.github.com/users/hyanwong/gists{/gist_id}","starred_url":"https://api.github.com/users/hyanwong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyanwong/subscriptions","organizations_url":"https://api.github.com/users/hyanwong/orgs","repos_url":"https://api.github.com/users/hyanwong/repos","events_url":"https://api.github.com/users/hyanwong/events{/privacy}","received_events_url":"https://api.github.com/users/hyanwong/received_events","type":"User","site_admin":false},"created_at":"2015-04-06T16:44:19Z","updated_at":"2015-04-06T16:44:19Z","body":"\nOn 6 Apr 2015, at 15:28, Jeremy Rice <notifications@github.com> wrote:\n\n> I'm about to deploy the code, soooooo... you'll be able to run it through\n> it's paces in about 15 minutes.\n\nIt�s not up on the main site yet. I don�t know how it gets moved into http://eol.org/assets/jcrop_data_objects.js or http://eol.org/assets/jcrop_data_objects-a2b94ca70b1503fdbea4d383f007f8dd.js or whatever.\n\nYan"}}