{"action":"created","comment":{"url":"https://api.github.com/repos/OurMark/hermanosdesangre/pulls/comments/41023290","id":41023290,"diff_hunk":"@@ -0,0 +1,60 @@\n+(function($) {\n+    $('[data-toggle=\"tooltip\"]').tooltip();\n+\n+  $('.registrarse form').on('submit', function( event ) {\n+    var contraseniaValida = validarContrasenias();\n+    var dniValido = validarDni();\n+    var emailValido = validarEmail();\n+    return contraseniaValida && dniValido && emailValido;\n+  })\n+\n+  function validarContrasenias(){\n+    var passwordConfirmation = $('#user_password_confirmation');\n+    var userPassword = $('#user_password');\n+    if ( userPassword.val() == '' ){\n+      passwordConfirmation.attr('data-original-title', 'Campo de contraseña vacío');\n+      passwordConfirmation.tooltip('show');\n+      return false;\n+    }else{\n+     if ( userPassword.val() === passwordConfirmation.val() ){\n+      passwordConfirmation.tooltip('hide');\n+      return true;\n+     }else{\n+      passwordConfirmation.attr('data-original-title', 'Las contraseñas ingresadas no son iguales');\n+      passwordConfirmation.tooltip('show');\n+      return false;\n+    }\n+    }","path":"app/assets/javascripts/app/registration.js","position":27,"original_position":27,"commit_id":"8791ce1b3b59b4f349ff55fc65860b0d61f03264","original_commit_id":"8791ce1b3b59b4f349ff55fc65860b0d61f03264","user":{"login":"aotaduy","id":11633046,"avatar_url":"https://avatars.githubusercontent.com/u/11633046?v=3","gravatar_id":"","url":"https://api.github.com/users/aotaduy","html_url":"https://github.com/aotaduy","followers_url":"https://api.github.com/users/aotaduy/followers","following_url":"https://api.github.com/users/aotaduy/following{/other_user}","gists_url":"https://api.github.com/users/aotaduy/gists{/gist_id}","starred_url":"https://api.github.com/users/aotaduy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aotaduy/subscriptions","organizations_url":"https://api.github.com/users/aotaduy/orgs","repos_url":"https://api.github.com/users/aotaduy/repos","events_url":"https://api.github.com/users/aotaduy/events{/privacy}","received_events_url":"https://api.github.com/users/aotaduy/received_events","type":"User","site_admin":false},"body":"Si cada if tiene un return se podrian eliminar los else y que reducir la profundidad. \r\nNo se si es de tu gusto algo asi pero a veces queda bien\r\n````javascript\r\nif ( userPassword.val() == '' ){\r\n  passwordConfirmation.attr('data-original-title', 'Campo de contraseña vacío');\r\n  passwordConfirmation.tooltip('show');\r\n  return false;\r\n}\r\nif ( userPassword.val() === passwordConfirmation.val() ){\r\n  passwordConfirmation.tooltip('hide');\r\n  return true;\r\n}\r\npasswordConfirmation.attr('data-original-title', 'Las contraseñas ingresadas no son iguales');\r\npasswordConfirmation.tooltip('show');\r\nreturn false;\r\n````\r\n\r\nPor ahi queda mas simple, solo una sugerencia","created_at":"2015-10-02T13:55:22Z","updated_at":"2015-10-02T13:55:22Z","html_url":"https://github.com/OurMark/hermanosdesangre/pull/35#discussion_r41023290","pull_request_url":"https://api.github.com/repos/OurMark/hermanosdesangre/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/OurMark/hermanosdesangre/pulls/comments/41023290"},"html":{"href":"https://github.com/OurMark/hermanosdesangre/pull/35#discussion_r41023290"},"pull_request":{"href":"https://api.github.com/repos/OurMark/hermanosdesangre/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/OurMark/hermanosdesangre/pulls/35","id":46320937,"html_url":"https://github.com/OurMark/hermanosdesangre/pull/35","diff_url":"https://github.com/OurMark/hermanosdesangre/pull/35.diff","patch_url":"https://github.com/OurMark/hermanosdesangre/pull/35.patch","issue_url":"https://api.github.com/repos/OurMark/hermanosdesangre/issues/35","number":35,"state":"open","locked":false,"title":"Arreglo del formulario y validacion js de Registro de Nuevo usuario","user":{"login":"CarolinaIungelsonGlobant","id":14219397,"avatar_url":"https://avatars.githubusercontent.com/u/14219397?v=3","gravatar_id":"","url":"https://api.github.com/users/CarolinaIungelsonGlobant","html_url":"https://github.com/CarolinaIungelsonGlobant","followers_url":"https://api.github.com/users/CarolinaIungelsonGlobant/followers","following_url":"https://api.github.com/users/CarolinaIungelsonGlobant/following{/other_user}","gists_url":"https://api.github.com/users/CarolinaIungelsonGlobant/gists{/gist_id}","starred_url":"https://api.github.com/users/CarolinaIungelsonGlobant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarolinaIungelsonGlobant/subscriptions","organizations_url":"https://api.github.com/users/CarolinaIungelsonGlobant/orgs","repos_url":"https://api.github.com/users/CarolinaIungelsonGlobant/repos","events_url":"https://api.github.com/users/CarolinaIungelsonGlobant/events{/privacy}","received_events_url":"https://api.github.com/users/CarolinaIungelsonGlobant/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-29T19:29:53Z","updated_at":"2015-10-02T13:55:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"421da16458a191135ae57bf4e0656501aa63fb1e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OurMark/hermanosdesangre/pulls/35/commits","review_comments_url":"https://api.github.com/repos/OurMark/hermanosdesangre/pulls/35/comments","review_comment_url":"https://api.github.com/repos/OurMark/hermanosdesangre/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OurMark/hermanosdesangre/issues/35/comments","statuses_url":"https://api.github.com/repos/OurMark/hermanosdesangre/statuses/8791ce1b3b59b4f349ff55fc65860b0d61f03264","head":{"label":"CarolinaIungelsonGlobant:formRegistro","ref":"formRegistro","sha":"8791ce1b3b59b4f349ff55fc65860b0d61f03264","user":{"login":"CarolinaIungelsonGlobant","id":14219397,"avatar_url":"https://avatars.githubusercontent.com/u/14219397?v=3","gravatar_id":"","url":"https://api.github.com/users/CarolinaIungelsonGlobant","html_url":"https://github.com/CarolinaIungelsonGlobant","followers_url":"https://api.github.com/users/CarolinaIungelsonGlobant/followers","following_url":"https://api.github.com/users/CarolinaIungelsonGlobant/following{/other_user}","gists_url":"https://api.github.com/users/CarolinaIungelsonGlobant/gists{/gist_id}","starred_url":"https://api.github.com/users/CarolinaIungelsonGlobant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarolinaIungelsonGlobant/subscriptions","organizations_url":"https://api.github.com/users/CarolinaIungelsonGlobant/orgs","repos_url":"https://api.github.com/users/CarolinaIungelsonGlobant/repos","events_url":"https://api.github.com/users/CarolinaIungelsonGlobant/events{/privacy}","received_events_url":"https://api.github.com/users/CarolinaIungelsonGlobant/received_events","type":"User","site_admin":false},"repo":{"id":42249775,"name":"hermanosdesangre","full_name":"CarolinaIungelsonGlobant/hermanosdesangre","owner":{"login":"CarolinaIungelsonGlobant","id":14219397,"avatar_url":"https://avatars.githubusercontent.com/u/14219397?v=3","gravatar_id":"","url":"https://api.github.com/users/CarolinaIungelsonGlobant","html_url":"https://github.com/CarolinaIungelsonGlobant","followers_url":"https://api.github.com/users/CarolinaIungelsonGlobant/followers","following_url":"https://api.github.com/users/CarolinaIungelsonGlobant/following{/other_user}","gists_url":"https://api.github.com/users/CarolinaIungelsonGlobant/gists{/gist_id}","starred_url":"https://api.github.com/users/CarolinaIungelsonGlobant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarolinaIungelsonGlobant/subscriptions","organizations_url":"https://api.github.com/users/CarolinaIungelsonGlobant/orgs","repos_url":"https://api.github.com/users/CarolinaIungelsonGlobant/repos","events_url":"https://api.github.com/users/CarolinaIungelsonGlobant/events{/privacy}","received_events_url":"https://api.github.com/users/CarolinaIungelsonGlobant/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CarolinaIungelsonGlobant/hermanosdesangre","description":"Aplicación para fomentar la donación de sangre.","fork":true,"url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre","forks_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/forks","keys_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/teams","hooks_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/hooks","issue_events_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/issues/events{/number}","events_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/events","assignees_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/assignees{/user}","branches_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/branches{/branch}","tags_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/tags","blobs_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/git/refs{/sha}","trees_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/statuses/{sha}","languages_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/languages","stargazers_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/stargazers","contributors_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/contributors","subscribers_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/subscribers","subscription_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/subscription","commits_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/commits{/sha}","git_commits_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/git/commits{/sha}","comments_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/comments{/number}","issue_comment_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/issues/comments{/number}","contents_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/contents/{+path}","compare_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/merges","archive_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/downloads","issues_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/issues{/number}","pulls_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/pulls{/number}","milestones_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/milestones{/number}","notifications_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/labels{/name}","releases_url":"https://api.github.com/repos/CarolinaIungelsonGlobant/hermanosdesangre/releases{/id}","created_at":"2015-09-10T14:32:14Z","updated_at":"2015-09-10T14:32:14Z","pushed_at":"2015-09-29T19:45:33Z","git_url":"git://github.com/CarolinaIungelsonGlobant/hermanosdesangre.git","ssh_url":"git@github.com:CarolinaIungelsonGlobant/hermanosdesangre.git","clone_url":"https://github.com/CarolinaIungelsonGlobant/hermanosdesangre.git","svn_url":"https://github.com/CarolinaIungelsonGlobant/hermanosdesangre","homepage":"http://hermanosdesangre.herokuapp.com","size":2092,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"OurMark:development","ref":"development","sha":"d61c85ec4c4e4a41ea9f50c50c7c7eb12d56caa7","user":{"login":"OurMark","id":8690208,"avatar_url":"https://avatars.githubusercontent.com/u/8690208?v=3","gravatar_id":"","url":"https://api.github.com/users/OurMark","html_url":"https://github.com/OurMark","followers_url":"https://api.github.com/users/OurMark/followers","following_url":"https://api.github.com/users/OurMark/following{/other_user}","gists_url":"https://api.github.com/users/OurMark/gists{/gist_id}","starred_url":"https://api.github.com/users/OurMark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OurMark/subscriptions","organizations_url":"https://api.github.com/users/OurMark/orgs","repos_url":"https://api.github.com/users/OurMark/repos","events_url":"https://api.github.com/users/OurMark/events{/privacy}","received_events_url":"https://api.github.com/users/OurMark/received_events","type":"Organization","site_admin":false},"repo":{"id":23244740,"name":"hermanosdesangre","full_name":"OurMark/hermanosdesangre","owner":{"login":"OurMark","id":8690208,"avatar_url":"https://avatars.githubusercontent.com/u/8690208?v=3","gravatar_id":"","url":"https://api.github.com/users/OurMark","html_url":"https://github.com/OurMark","followers_url":"https://api.github.com/users/OurMark/followers","following_url":"https://api.github.com/users/OurMark/following{/other_user}","gists_url":"https://api.github.com/users/OurMark/gists{/gist_id}","starred_url":"https://api.github.com/users/OurMark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OurMark/subscriptions","organizations_url":"https://api.github.com/users/OurMark/orgs","repos_url":"https://api.github.com/users/OurMark/repos","events_url":"https://api.github.com/users/OurMark/events{/privacy}","received_events_url":"https://api.github.com/users/OurMark/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OurMark/hermanosdesangre","description":"Aplicación para fomentar la donación de sangre.","fork":false,"url":"https://api.github.com/repos/OurMark/hermanosdesangre","forks_url":"https://api.github.com/repos/OurMark/hermanosdesangre/forks","keys_url":"https://api.github.com/repos/OurMark/hermanosdesangre/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OurMark/hermanosdesangre/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OurMark/hermanosdesangre/teams","hooks_url":"https://api.github.com/repos/OurMark/hermanosdesangre/hooks","issue_events_url":"https://api.github.com/repos/OurMark/hermanosdesangre/issues/events{/number}","events_url":"https://api.github.com/repos/OurMark/hermanosdesangre/events","assignees_url":"https://api.github.com/repos/OurMark/hermanosdesangre/assignees{/user}","branches_url":"https://api.github.com/repos/OurMark/hermanosdesangre/branches{/branch}","tags_url":"https://api.github.com/repos/OurMark/hermanosdesangre/tags","blobs_url":"https://api.github.com/repos/OurMark/hermanosdesangre/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OurMark/hermanosdesangre/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OurMark/hermanosdesangre/git/refs{/sha}","trees_url":"https://api.github.com/repos/OurMark/hermanosdesangre/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OurMark/hermanosdesangre/statuses/{sha}","languages_url":"https://api.github.com/repos/OurMark/hermanosdesangre/languages","stargazers_url":"https://api.github.com/repos/OurMark/hermanosdesangre/stargazers","contributors_url":"https://api.github.com/repos/OurMark/hermanosdesangre/contributors","subscribers_url":"https://api.github.com/repos/OurMark/hermanosdesangre/subscribers","subscription_url":"https://api.github.com/repos/OurMark/hermanosdesangre/subscription","commits_url":"https://api.github.com/repos/OurMark/hermanosdesangre/commits{/sha}","git_commits_url":"https://api.github.com/repos/OurMark/hermanosdesangre/git/commits{/sha}","comments_url":"https://api.github.com/repos/OurMark/hermanosdesangre/comments{/number}","issue_comment_url":"https://api.github.com/repos/OurMark/hermanosdesangre/issues/comments{/number}","contents_url":"https://api.github.com/repos/OurMark/hermanosdesangre/contents/{+path}","compare_url":"https://api.github.com/repos/OurMark/hermanosdesangre/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OurMark/hermanosdesangre/merges","archive_url":"https://api.github.com/repos/OurMark/hermanosdesangre/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OurMark/hermanosdesangre/downloads","issues_url":"https://api.github.com/repos/OurMark/hermanosdesangre/issues{/number}","pulls_url":"https://api.github.com/repos/OurMark/hermanosdesangre/pulls{/number}","milestones_url":"https://api.github.com/repos/OurMark/hermanosdesangre/milestones{/number}","notifications_url":"https://api.github.com/repos/OurMark/hermanosdesangre/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OurMark/hermanosdesangre/labels{/name}","releases_url":"https://api.github.com/repos/OurMark/hermanosdesangre/releases{/id}","created_at":"2014-08-23T01:19:34Z","updated_at":"2015-09-16T03:27:58Z","pushed_at":"2015-10-01T20:53:00Z","git_url":"git://github.com/OurMark/hermanosdesangre.git","ssh_url":"git@github.com:OurMark/hermanosdesangre.git","clone_url":"https://github.com/OurMark/hermanosdesangre.git","svn_url":"https://github.com/OurMark/hermanosdesangre","homepage":"http://hermanosdesangre.herokuapp.com","size":2545,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":5,"forks":10,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OurMark/hermanosdesangre/pulls/35"},"html":{"href":"https://github.com/OurMark/hermanosdesangre/pull/35"},"issue":{"href":"https://api.github.com/repos/OurMark/hermanosdesangre/issues/35"},"comments":{"href":"https://api.github.com/repos/OurMark/hermanosdesangre/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/OurMark/hermanosdesangre/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/OurMark/hermanosdesangre/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OurMark/hermanosdesangre/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/OurMark/hermanosdesangre/statuses/8791ce1b3b59b4f349ff55fc65860b0d61f03264"}}}}