{"action":"created","comment":{"url":"https://api.github.com/repos/geometalab/osmaxx/pulls/comments/47220718","id":47220718,"diff_hunk":"@@ -32,15 +66,60 @@\n                     checkbox.setCustomValidity('Please choose minimal one export format!');\n                 }\n             }.bind(this));\n+            this.setSubmitButtonState();\n         }.bind(this);\n \n+        this.validateExcerptBounds = function() {\n+            var allowedMaxSize = 250*1024*1024;\n+\n+            var north = document.getElementById('id_north').value;\n+            var east = document.getElementById('id_east').value;\n+            var south = document.getElementById('id_south').value;\n+            var west = document.getElementById('id_west').value;\n+\n+            jQuery.getJSON(\n+                '/api/estimated_file_size/',\n+                { 'north': north, 'east': east, 'south': south, 'west': west },\n+                function(data) {\n+                    var estimatedFileSize = Number(data['estimated_file_size_in_bytes']);\n+                    this.validity['excerptBounds'] = estimatedFileSize < allowedMaxSize;\n+                    this.setSubmitButtonState();\n+                    \n+                    this.excerptBoundInputFields.forEach(function(excerptBoundInputField) {\n+                        if(this.validity['excerptBounds']) {\n+                            excerptBoundInputField.setCustomValidity('');\n+                            document.getElementById('excerpt-validation').textContent = '';\n+                        } else {\n+                            var howMuchTooLarge = estimatedFileSize ? Math.round(100 / allowedMaxSize * estimatedFileSize - 100) + '% ': '';","path":"osmaxx-py/osmaxx/excerptexport/static/excerptexport/scripts/formValidation.js","position":null,"original_position":91,"commit_id":"4e99ccb263ee5a92749177c454178b16d855b5f1","original_commit_id":"46f9d890fdd4c2a4722c9e6010e77b5be10fd576","user":{"login":"wasabideveloper","id":10944699,"avatar_url":"https://avatars.githubusercontent.com/u/10944699?v=3","gravatar_id":"","url":"https://api.github.com/users/wasabideveloper","html_url":"https://github.com/wasabideveloper","followers_url":"https://api.github.com/users/wasabideveloper/followers","following_url":"https://api.github.com/users/wasabideveloper/following{/other_user}","gists_url":"https://api.github.com/users/wasabideveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/wasabideveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wasabideveloper/subscriptions","organizations_url":"https://api.github.com/users/wasabideveloper/orgs","repos_url":"https://api.github.com/users/wasabideveloper/repos","events_url":"https://api.github.com/users/wasabideveloper/events{/privacy}","received_events_url":"https://api.github.com/users/wasabideveloper/received_events","type":"User","site_admin":false},"body":":heavy_check_mark: ","created_at":"2015-12-10T12:34:51Z","updated_at":"2015-12-10T12:34:51Z","html_url":"https://github.com/geometalab/osmaxx/pull/294#discussion_r47220718","pull_request_url":"https://api.github.com/repos/geometalab/osmaxx/pulls/294","_links":{"self":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/comments/47220718"},"html":{"href":"https://github.com/geometalab/osmaxx/pull/294#discussion_r47220718"},"pull_request":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/294"}}},"pull_request":{"url":"https://api.github.com/repos/geometalab/osmaxx/pulls/294","id":52987511,"html_url":"https://github.com/geometalab/osmaxx/pull/294","diff_url":"https://github.com/geometalab/osmaxx/pull/294.diff","patch_url":"https://github.com/geometalab/osmaxx/pull/294.patch","issue_url":"https://api.github.com/repos/geometalab/osmaxx/issues/294","number":294,"state":"open","locked":false,"title":"Feature/client validation#19","user":{"login":"wasabideveloper","id":10944699,"avatar_url":"https://avatars.githubusercontent.com/u/10944699?v=3","gravatar_id":"","url":"https://api.github.com/users/wasabideveloper","html_url":"https://github.com/wasabideveloper","followers_url":"https://api.github.com/users/wasabideveloper/followers","following_url":"https://api.github.com/users/wasabideveloper/following{/other_user}","gists_url":"https://api.github.com/users/wasabideveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/wasabideveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wasabideveloper/subscriptions","organizations_url":"https://api.github.com/users/wasabideveloper/orgs","repos_url":"https://api.github.com/users/wasabideveloper/repos","events_url":"https://api.github.com/users/wasabideveloper/events{/privacy}","received_events_url":"https://api.github.com/users/wasabideveloper/received_events","type":"User","site_admin":false},"body":"Implementation of feature #19 (Merge will close #19 ).\r\n\r\n* locales **NOT** compiled -> do this on release (prevent huge locale diffs in changes)\r\n* JS string **NOT** localized. Todo later: #293 .\r\n* ran tests\r\n* tested views by hand:\r\n  * /orders/new [get/post]\r\n\r\nTo be reviewed by:\r\n- [ ] @das-g \r\n- [x] @hixi \r\n\r\n*Contains changes of #254 *\r\n\r\n<hr />\r\n![screen shot 2015-12-08 at 15 28 39](https://cloud.githubusercontent.com/assets/10944699/11658078/13766624-9dc1-11e5-8b32-e3a7b44334fd.png)\r\n</hr>","created_at":"2015-12-08T14:34:15Z","updated_at":"2015-12-10T12:34:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da3a98213d57c45722c9b29b7b1115f73331f951","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/geometalab/osmaxx/pulls/294/commits","review_comments_url":"https://api.github.com/repos/geometalab/osmaxx/pulls/294/comments","review_comment_url":"https://api.github.com/repos/geometalab/osmaxx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geometalab/osmaxx/issues/294/comments","statuses_url":"https://api.github.com/repos/geometalab/osmaxx/statuses/4e99ccb263ee5a92749177c454178b16d855b5f1","head":{"label":"geometalab:feature/clientValidation#19","ref":"feature/clientValidation#19","sha":"4e99ccb263ee5a92749177c454178b16d855b5f1","user":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"repo":{"id":28986110,"name":"osmaxx","full_name":"geometalab/osmaxx","owner":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geometalab/osmaxx","description":"OpenStreetMap Arbitrary eXcerpt eXport (main repository)","fork":false,"url":"https://api.github.com/repos/geometalab/osmaxx","forks_url":"https://api.github.com/repos/geometalab/osmaxx/forks","keys_url":"https://api.github.com/repos/geometalab/osmaxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geometalab/osmaxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geometalab/osmaxx/teams","hooks_url":"https://api.github.com/repos/geometalab/osmaxx/hooks","issue_events_url":"https://api.github.com/repos/geometalab/osmaxx/issues/events{/number}","events_url":"https://api.github.com/repos/geometalab/osmaxx/events","assignees_url":"https://api.github.com/repos/geometalab/osmaxx/assignees{/user}","branches_url":"https://api.github.com/repos/geometalab/osmaxx/branches{/branch}","tags_url":"https://api.github.com/repos/geometalab/osmaxx/tags","blobs_url":"https://api.github.com/repos/geometalab/osmaxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geometalab/osmaxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geometalab/osmaxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/geometalab/osmaxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geometalab/osmaxx/statuses/{sha}","languages_url":"https://api.github.com/repos/geometalab/osmaxx/languages","stargazers_url":"https://api.github.com/repos/geometalab/osmaxx/stargazers","contributors_url":"https://api.github.com/repos/geometalab/osmaxx/contributors","subscribers_url":"https://api.github.com/repos/geometalab/osmaxx/subscribers","subscription_url":"https://api.github.com/repos/geometalab/osmaxx/subscription","commits_url":"https://api.github.com/repos/geometalab/osmaxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/geometalab/osmaxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/geometalab/osmaxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/geometalab/osmaxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/geometalab/osmaxx/contents/{+path}","compare_url":"https://api.github.com/repos/geometalab/osmaxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geometalab/osmaxx/merges","archive_url":"https://api.github.com/repos/geometalab/osmaxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geometalab/osmaxx/downloads","issues_url":"https://api.github.com/repos/geometalab/osmaxx/issues{/number}","pulls_url":"https://api.github.com/repos/geometalab/osmaxx/pulls{/number}","milestones_url":"https://api.github.com/repos/geometalab/osmaxx/milestones{/number}","notifications_url":"https://api.github.com/repos/geometalab/osmaxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geometalab/osmaxx/labels{/name}","releases_url":"https://api.github.com/repos/geometalab/osmaxx/releases{/id}","created_at":"2015-01-08T21:05:34Z","updated_at":"2015-10-04T10:35:53Z","pushed_at":"2015-12-10T12:34:38Z","git_url":"git://github.com/geometalab/osmaxx.git","ssh_url":"git@github.com:geometalab/osmaxx.git","clone_url":"https://github.com/geometalab/osmaxx.git","svn_url":"https://github.com/geometalab/osmaxx","homepage":"http://osmaxx.hsr.ch/","size":4400,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":44,"forks":0,"open_issues":44,"watchers":2,"default_branch":"develop"}},"base":{"label":"geometalab:develop","ref":"develop","sha":"8dbaca0e838dce9d39b6b7e53c13b48917289298","user":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"repo":{"id":28986110,"name":"osmaxx","full_name":"geometalab/osmaxx","owner":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geometalab/osmaxx","description":"OpenStreetMap Arbitrary eXcerpt eXport (main repository)","fork":false,"url":"https://api.github.com/repos/geometalab/osmaxx","forks_url":"https://api.github.com/repos/geometalab/osmaxx/forks","keys_url":"https://api.github.com/repos/geometalab/osmaxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geometalab/osmaxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geometalab/osmaxx/teams","hooks_url":"https://api.github.com/repos/geometalab/osmaxx/hooks","issue_events_url":"https://api.github.com/repos/geometalab/osmaxx/issues/events{/number}","events_url":"https://api.github.com/repos/geometalab/osmaxx/events","assignees_url":"https://api.github.com/repos/geometalab/osmaxx/assignees{/user}","branches_url":"https://api.github.com/repos/geometalab/osmaxx/branches{/branch}","tags_url":"https://api.github.com/repos/geometalab/osmaxx/tags","blobs_url":"https://api.github.com/repos/geometalab/osmaxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geometalab/osmaxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geometalab/osmaxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/geometalab/osmaxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geometalab/osmaxx/statuses/{sha}","languages_url":"https://api.github.com/repos/geometalab/osmaxx/languages","stargazers_url":"https://api.github.com/repos/geometalab/osmaxx/stargazers","contributors_url":"https://api.github.com/repos/geometalab/osmaxx/contributors","subscribers_url":"https://api.github.com/repos/geometalab/osmaxx/subscribers","subscription_url":"https://api.github.com/repos/geometalab/osmaxx/subscription","commits_url":"https://api.github.com/repos/geometalab/osmaxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/geometalab/osmaxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/geometalab/osmaxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/geometalab/osmaxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/geometalab/osmaxx/contents/{+path}","compare_url":"https://api.github.com/repos/geometalab/osmaxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geometalab/osmaxx/merges","archive_url":"https://api.github.com/repos/geometalab/osmaxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geometalab/osmaxx/downloads","issues_url":"https://api.github.com/repos/geometalab/osmaxx/issues{/number}","pulls_url":"https://api.github.com/repos/geometalab/osmaxx/pulls{/number}","milestones_url":"https://api.github.com/repos/geometalab/osmaxx/milestones{/number}","notifications_url":"https://api.github.com/repos/geometalab/osmaxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geometalab/osmaxx/labels{/name}","releases_url":"https://api.github.com/repos/geometalab/osmaxx/releases{/id}","created_at":"2015-01-08T21:05:34Z","updated_at":"2015-10-04T10:35:53Z","pushed_at":"2015-12-10T12:34:38Z","git_url":"git://github.com/geometalab/osmaxx.git","ssh_url":"git@github.com:geometalab/osmaxx.git","clone_url":"https://github.com/geometalab/osmaxx.git","svn_url":"https://github.com/geometalab/osmaxx","homepage":"http://osmaxx.hsr.ch/","size":4400,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":44,"forks":0,"open_issues":44,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/294"},"html":{"href":"https://github.com/geometalab/osmaxx/pull/294"},"issue":{"href":"https://api.github.com/repos/geometalab/osmaxx/issues/294"},"comments":{"href":"https://api.github.com/repos/geometalab/osmaxx/issues/294/comments"},"review_comments":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/294/comments"},"review_comment":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/294/commits"},"statuses":{"href":"https://api.github.com/repos/geometalab/osmaxx/statuses/4e99ccb263ee5a92749177c454178b16d855b5f1"}}}}