{"action":"created","comment":{"url":"https://api.github.com/repos/foosel/OctoPrint/pulls/comments/59180411","id":59180411,"diff_hunk":"@@ -423,16 +424,74 @@ $(function() {\n                     }\n                 }\n                 output += gettext(\"Estimated Print Time\") + \": \" + formatDuration(data[\"gcodeAnalysis\"][\"estimatedPrintTime\"]) + \"<br>\";\n-\t\tif(self.loginState.isUser()&&data[\"gcodeAnalysis\"][\"warning\"])\n+\t\tif(self.loginState.isUser())\n \t\t{\n-\t\t    var warning = \"<p>\" + gettext(\"Object exceeds printing area\") + \"</p>\";\n-                    warning += pnotifyAdditionalInfo(\"<pre>Object or objects in file '\"+data[\"name\"]+\"' exceed/s the printing area</pre>\");\n-                    new PNotify({\n-                        title: \"Object dimensions\",\n-                        text: warning,\n-                        type: \"warning\",\n-                        hide: false\n-                    });\n+                    var profileItems=self.printerProfiles.profiles.items();\n+                    var count=0;\n+                    while(count<profileItems.length && !profileItems[count].current)\n+                    {\n+                        count++;\n+                    }\n+                    if(count<profileItems.length)\n+                    {\n+                        var warn=false;\n+                        var volumeInfo=profileItems[count].volume;\n+                        var printingArea=data[\"gcodeAnalysis\"][\"printingArea\"];\n+                        if(volumeInfo.origin==\"lowerleft\")\n+                        {\n+                            if(printingArea[\"maxX\"]>volumeInfo.width || printingArea[\"maxY\"]>volumeInfo.depth || printingArea[\"maxZ\"]>volumeInfo.height)\n+                            {\n+                                warn=true;\n+                            }\n+                        }\n+                        else //origin is centre\n+                        {\n+                            if( printingArea[\"maxX\"]>(volumeInfo.width/2) || printingArea[\"maxY\"]>(volumeInfo.depth/2) || printingArea[\"maxZ\"]>volumeInfo.height || Math.abs(printingArea[\"minX\"])>(volumeInfo.width/2) || Math.abs(printingArea[\"minY\"])>(volumeInfo.depth/2))\n+                            {\n+                                warn=true;\n+                            }\n+                        }\n+                    }\n+                    if(warn)","path":"src/octoprint/static/js/app/viewmodels/files.js","position":40,"original_position":49,"commit_id":"95b6eba2ad034d48c1b56576a2c665b4bb3abf72","original_commit_id":"3baf9d7fc0b05a336e17a3920fd5d267423959b3","user":{"login":"Javierma","id":13371130,"avatar_url":"https://avatars.githubusercontent.com/u/13371130?v=3","gravatar_id":"","url":"https://api.github.com/users/Javierma","html_url":"https://github.com/Javierma","followers_url":"https://api.github.com/users/Javierma/followers","following_url":"https://api.github.com/users/Javierma/following{/other_user}","gists_url":"https://api.github.com/users/Javierma/gists{/gist_id}","starred_url":"https://api.github.com/users/Javierma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Javierma/subscriptions","organizations_url":"https://api.github.com/users/Javierma/orgs","repos_url":"https://api.github.com/users/Javierma/repos","events_url":"https://api.github.com/users/Javierma/events{/privacy}","received_events_url":"https://api.github.com/users/Javierma/received_events","type":"User","site_admin":false},"body":"I agree this way is much better than the improvement I applied to the original code.","created_at":"2016-04-11T09:57:03Z","updated_at":"2016-04-11T09:57:03Z","html_url":"https://github.com/foosel/OctoPrint/pull/1254#discussion_r59180411","pull_request_url":"https://api.github.com/repos/foosel/OctoPrint/pulls/1254","_links":{"self":{"href":"https://api.github.com/repos/foosel/OctoPrint/pulls/comments/59180411"},"html":{"href":"https://github.com/foosel/OctoPrint/pull/1254#discussion_r59180411"},"pull_request":{"href":"https://api.github.com/repos/foosel/OctoPrint/pulls/1254"}}},"pull_request":{"url":"https://api.github.com/repos/foosel/OctoPrint/pulls/1254","id":61703902,"html_url":"https://github.com/foosel/OctoPrint/pull/1254","diff_url":"https://github.com/foosel/OctoPrint/pull/1254.diff","patch_url":"https://github.com/foosel/OctoPrint/pull/1254.patch","issue_url":"https://api.github.com/repos/foosel/OctoPrint/issues/1254","number":1254,"state":"open","locked":false,"title":"[Brainstorming] Warn if any of the objects exceed the printing area","user":{"login":"Javierma","id":13371130,"avatar_url":"https://avatars.githubusercontent.com/u/13371130?v=3","gravatar_id":"","url":"https://api.github.com/users/Javierma","html_url":"https://github.com/Javierma","followers_url":"https://api.github.com/users/Javierma/followers","following_url":"https://api.github.com/users/Javierma/following{/other_user}","gists_url":"https://api.github.com/users/Javierma/gists{/gist_id}","starred_url":"https://api.github.com/users/Javierma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Javierma/subscriptions","organizations_url":"https://api.github.com/users/Javierma/orgs","repos_url":"https://api.github.com/users/Javierma/repos","events_url":"https://api.github.com/users/Javierma/events{/privacy}","received_events_url":"https://api.github.com/users/Javierma/received_events","type":"User","site_admin":false},"body":"After fixing errors and removing non-related files, I try again the pull request. I wasn't able to add only one commit (I don't know why, maybe because previous ones where related with these files) but this time it is much more easy to know the changes that have been done. I believe I solved problems with coding styles (tabs and spaces) but if it is not the case please let me know.\r\n\r\nBasically, what it happens is that when you add a gcode file and is analysed, in case that user has logged in and it is detected that a move exceeds the printing area, it will show a warning like the following one:\r\n\r\n![screenshot from 2016-03-04 12 57 45](https://cloud.githubusercontent.com/assets/13371130/13526729/2e6f3612-e20a-11e5-8e0e-d978ea1f3167.png)\r\n\r\nRegards,\r\n\r\nJavier\r\n\r\n","created_at":"2016-03-04T12:09:04Z","updated_at":"2016-04-11T09:57:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"464b8ddf8b1da899a6ca740787ea5f54506d5c9f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/foosel/OctoPrint/pulls/1254/commits","review_comments_url":"https://api.github.com/repos/foosel/OctoPrint/pulls/1254/comments","review_comment_url":"https://api.github.com/repos/foosel/OctoPrint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/foosel/OctoPrint/issues/1254/comments","statuses_url":"https://api.github.com/repos/foosel/OctoPrint/statuses/95b6eba2ad034d48c1b56576a2c665b4bb3abf72","head":{"label":"Javierma:area_warning","ref":"area_warning","sha":"95b6eba2ad034d48c1b56576a2c665b4bb3abf72","user":{"login":"Javierma","id":13371130,"avatar_url":"https://avatars.githubusercontent.com/u/13371130?v=3","gravatar_id":"","url":"https://api.github.com/users/Javierma","html_url":"https://github.com/Javierma","followers_url":"https://api.github.com/users/Javierma/followers","following_url":"https://api.github.com/users/Javierma/following{/other_user}","gists_url":"https://api.github.com/users/Javierma/gists{/gist_id}","starred_url":"https://api.github.com/users/Javierma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Javierma/subscriptions","organizations_url":"https://api.github.com/users/Javierma/orgs","repos_url":"https://api.github.com/users/Javierma/repos","events_url":"https://api.github.com/users/Javierma/events{/privacy}","received_events_url":"https://api.github.com/users/Javierma/received_events","type":"User","site_admin":false},"repo":{"id":50424540,"name":"OctoPrint-TFG","full_name":"Javierma/OctoPrint-TFG","owner":{"login":"Javierma","id":13371130,"avatar_url":"https://avatars.githubusercontent.com/u/13371130?v=3","gravatar_id":"","url":"https://api.github.com/users/Javierma","html_url":"https://github.com/Javierma","followers_url":"https://api.github.com/users/Javierma/followers","following_url":"https://api.github.com/users/Javierma/following{/other_user}","gists_url":"https://api.github.com/users/Javierma/gists{/gist_id}","starred_url":"https://api.github.com/users/Javierma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Javierma/subscriptions","organizations_url":"https://api.github.com/users/Javierma/orgs","repos_url":"https://api.github.com/users/Javierma/repos","events_url":"https://api.github.com/users/Javierma/events{/privacy}","received_events_url":"https://api.github.com/users/Javierma/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Javierma/OctoPrint-TFG","description":"OctoPrint provides a snappy web interface for controlling a 3D printer (RepRap, Ultimaker, ...).","fork":true,"url":"https://api.github.com/repos/Javierma/OctoPrint-TFG","forks_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/forks","keys_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/teams","hooks_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/hooks","issue_events_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/issues/events{/number}","events_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/events","assignees_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/assignees{/user}","branches_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/branches{/branch}","tags_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/tags","blobs_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/git/refs{/sha}","trees_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/statuses/{sha}","languages_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/languages","stargazers_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/stargazers","contributors_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/contributors","subscribers_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/subscribers","subscription_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/subscription","commits_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/commits{/sha}","git_commits_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/git/commits{/sha}","comments_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/comments{/number}","issue_comment_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/issues/comments{/number}","contents_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/contents/{+path}","compare_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/merges","archive_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/downloads","issues_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/issues{/number}","pulls_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/pulls{/number}","milestones_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/milestones{/number}","notifications_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/labels{/name}","releases_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/releases{/id}","deployments_url":"https://api.github.com/repos/Javierma/OctoPrint-TFG/deployments","created_at":"2016-01-26T11:30:52Z","updated_at":"2016-01-26T11:33:55Z","pushed_at":"2016-04-04T16:49:08Z","git_url":"git://github.com/Javierma/OctoPrint-TFG.git","ssh_url":"git@github.com:Javierma/OctoPrint-TFG.git","clone_url":"https://github.com/Javierma/OctoPrint-TFG.git","svn_url":"https://github.com/Javierma/OctoPrint-TFG","homepage":"http://octoprint.org","size":54057,"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":"foosel:devel","ref":"devel","sha":"cb687f01f71ec64a3435b07dccb0547cc8691fc8","user":{"login":"foosel","id":83657,"avatar_url":"https://avatars.githubusercontent.com/u/83657?v=3","gravatar_id":"","url":"https://api.github.com/users/foosel","html_url":"https://github.com/foosel","followers_url":"https://api.github.com/users/foosel/followers","following_url":"https://api.github.com/users/foosel/following{/other_user}","gists_url":"https://api.github.com/users/foosel/gists{/gist_id}","starred_url":"https://api.github.com/users/foosel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foosel/subscriptions","organizations_url":"https://api.github.com/users/foosel/orgs","repos_url":"https://api.github.com/users/foosel/repos","events_url":"https://api.github.com/users/foosel/events{/privacy}","received_events_url":"https://api.github.com/users/foosel/received_events","type":"User","site_admin":false},"repo":{"id":7386799,"name":"OctoPrint","full_name":"foosel/OctoPrint","owner":{"login":"foosel","id":83657,"avatar_url":"https://avatars.githubusercontent.com/u/83657?v=3","gravatar_id":"","url":"https://api.github.com/users/foosel","html_url":"https://github.com/foosel","followers_url":"https://api.github.com/users/foosel/followers","following_url":"https://api.github.com/users/foosel/following{/other_user}","gists_url":"https://api.github.com/users/foosel/gists{/gist_id}","starred_url":"https://api.github.com/users/foosel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foosel/subscriptions","organizations_url":"https://api.github.com/users/foosel/orgs","repos_url":"https://api.github.com/users/foosel/repos","events_url":"https://api.github.com/users/foosel/events{/privacy}","received_events_url":"https://api.github.com/users/foosel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/foosel/OctoPrint","description":"OctoPrint provides a snappy web interface for controlling a 3D printer (RepRap, Ultimaker, ...).","fork":false,"url":"https://api.github.com/repos/foosel/OctoPrint","forks_url":"https://api.github.com/repos/foosel/OctoPrint/forks","keys_url":"https://api.github.com/repos/foosel/OctoPrint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/foosel/OctoPrint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/foosel/OctoPrint/teams","hooks_url":"https://api.github.com/repos/foosel/OctoPrint/hooks","issue_events_url":"https://api.github.com/repos/foosel/OctoPrint/issues/events{/number}","events_url":"https://api.github.com/repos/foosel/OctoPrint/events","assignees_url":"https://api.github.com/repos/foosel/OctoPrint/assignees{/user}","branches_url":"https://api.github.com/repos/foosel/OctoPrint/branches{/branch}","tags_url":"https://api.github.com/repos/foosel/OctoPrint/tags","blobs_url":"https://api.github.com/repos/foosel/OctoPrint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/foosel/OctoPrint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/foosel/OctoPrint/git/refs{/sha}","trees_url":"https://api.github.com/repos/foosel/OctoPrint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/foosel/OctoPrint/statuses/{sha}","languages_url":"https://api.github.com/repos/foosel/OctoPrint/languages","stargazers_url":"https://api.github.com/repos/foosel/OctoPrint/stargazers","contributors_url":"https://api.github.com/repos/foosel/OctoPrint/contributors","subscribers_url":"https://api.github.com/repos/foosel/OctoPrint/subscribers","subscription_url":"https://api.github.com/repos/foosel/OctoPrint/subscription","commits_url":"https://api.github.com/repos/foosel/OctoPrint/commits{/sha}","git_commits_url":"https://api.github.com/repos/foosel/OctoPrint/git/commits{/sha}","comments_url":"https://api.github.com/repos/foosel/OctoPrint/comments{/number}","issue_comment_url":"https://api.github.com/repos/foosel/OctoPrint/issues/comments{/number}","contents_url":"https://api.github.com/repos/foosel/OctoPrint/contents/{+path}","compare_url":"https://api.github.com/repos/foosel/OctoPrint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/foosel/OctoPrint/merges","archive_url":"https://api.github.com/repos/foosel/OctoPrint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/foosel/OctoPrint/downloads","issues_url":"https://api.github.com/repos/foosel/OctoPrint/issues{/number}","pulls_url":"https://api.github.com/repos/foosel/OctoPrint/pulls{/number}","milestones_url":"https://api.github.com/repos/foosel/OctoPrint/milestones{/number}","notifications_url":"https://api.github.com/repos/foosel/OctoPrint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/foosel/OctoPrint/labels{/name}","releases_url":"https://api.github.com/repos/foosel/OctoPrint/releases{/id}","deployments_url":"https://api.github.com/repos/foosel/OctoPrint/deployments","created_at":"2012-12-31T12:20:57Z","updated_at":"2016-04-10T03:53:18Z","pushed_at":"2016-04-10T20:47:44Z","git_url":"git://github.com/foosel/OctoPrint.git","ssh_url":"git@github.com:foosel/OctoPrint.git","clone_url":"https://github.com/foosel/OctoPrint.git","svn_url":"https://github.com/foosel/OctoPrint","homepage":"http://octoprint.org","size":55745,"stargazers_count":1269,"watchers_count":1269,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":563,"mirror_url":null,"open_issues_count":179,"forks":563,"open_issues":179,"watchers":1269,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/foosel/OctoPrint/pulls/1254"},"html":{"href":"https://github.com/foosel/OctoPrint/pull/1254"},"issue":{"href":"https://api.github.com/repos/foosel/OctoPrint/issues/1254"},"comments":{"href":"https://api.github.com/repos/foosel/OctoPrint/issues/1254/comments"},"review_comments":{"href":"https://api.github.com/repos/foosel/OctoPrint/pulls/1254/comments"},"review_comment":{"href":"https://api.github.com/repos/foosel/OctoPrint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/foosel/OctoPrint/pulls/1254/commits"},"statuses":{"href":"https://api.github.com/repos/foosel/OctoPrint/statuses/95b6eba2ad034d48c1b56576a2c665b4bb3abf72"}}}}