GitHub PullRequestReviewCommentEvent at 2014-02-07 19:42:17
Repository: jenkins
Actor: daniel-beck
Payload: {"comment":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/9552059","id":9552059,"diff_hunk":"@@ -0,0 +1,63 @@\n+var errorMessage = \"Leave without saving?\";\n+var needToConfirm = false;\n+\n+window.onbeforeunload = confirmExit;\n+Event.observe(window, 'load', initConfirm);\n+\n+function initConfirm() {\n+  var configForm = document.getElementsByName(\"config\")[0];\n+\n+  var buttons = configForm.getElementsByTagName(\"button\");\n+  var name;\n+  for ( var i = 0; i < buttons.length; i++) {\n+    name = buttons[i].parentNode.parentNode.getAttribute('name');\n+    if (name == \"Submit\") {\n+      addEventToElement(buttons[i], 'click', function() {\n+        needToConfirm = false;\n+      });\n+    } else if (name == \"Apply\") {\n+    } else {\n+      addEventToElement(buttons[i], 'click', confirm);\n+    }\n+  }\n+\n+  var inputs = configForm.getElementsByTagName(\"input\");\n+  for ( var i = 0; i < inputs.length; i++) {\n+    addEventToElement(inputs[i], 'change', confirm);\n+    if (inputs[i].type == 'checkbox' || inputs[i].type == 'radio') {\n+      addEventToElement(inputs[i], 'click', confirm);\n+    } else {\n+      addEventToElement(inputs[i], 'keydown', confirm);","path":"core/src/main/resources/lib/form/confirm.js","position":30,"original_position":30,"commit_id":"ea82d38d4d1d6e3561af329206dd2081e17ad1d9","original_commit_id":"ea82d38d4d1d6e3561af329206dd2081e17ad1d9","user":{"login":"daniel-beck","id":1831569,"avatar_url":"https://gravatar.com/avatar/47a400884d886a87122398a6dc939081?d=https%3A%2F%2Fidenticons.github.com%2F12f274b49c9dd5e00b54eba8eb57f3f5.png&r=x","gravatar_id":"47a400884d886a87122398a6dc939081","url":"https://api.github.com/users/daniel-beck","html_url":"https://github.com/daniel-beck","followers_url":"https://api.github.com/users/daniel-beck/followers","following_url":"https://api.github.com/users/daniel-beck/following{/other_user}","gists_url":"https://api.github.com/users/daniel-beck/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-beck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-beck/subscriptions","organizations_url":"https://api.github.com/users/daniel-beck/orgs","repos_url":"https://api.github.com/users/daniel-beck/repos","events_url":"https://api.github.com/users/daniel-beck/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-beck/received_events","type":"User","site_admin":false},"body":"It seems this line breaks submitting the form by pressing return.","created_at":"2014-02-07T19:42:17Z","updated_at":"2014-02-07T19:42:17Z","html_url":"https://github.com/jenkinsci/jenkins/pull/962#discussion_r9552059","pull_request_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/962","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/9552059"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/962#discussion_r9552059"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/962"}}}}