{"action":"created","comment":{"url":"https://api.github.com/repos/andela/eventx/pulls/comments/52294803","id":52294803,"diff_hunk":"@@ -1,23 +1,80 @@\n-$(document).ready(function(){\n-  $(\".add_staff_field\").autocomplete({\n-    delay: 500,\n-    minLength: 4,\n-    source: \"/lookup_staffs\",\n-    select: function(event, ui){\n-      var staffId = ui.item.data;\n-      if ($(\".event_staffs\").length > 0){\n-        $.get(\"/user_info/\" + staffId, function(data){\n-          $(\".event_staffs\").append(data);\n-          $(\".add_staff_field\").val(\"\");\n-        });\n-      }\n-      else {\n-          $(\"#new_staff\").val(staffId);\n-      }\n-    }\n-  });\n \n-  $(\".event_staffs\").on(\"click\", \".remove_staff\", function(){\n-    $(this).parents(\".chip\").hide(\"slow\", function() { $(this).remove(); });\n+  $(document).ready(function(){\n+\n+    var from_page = document.getElementsByClassName(\"chip\");\n+    $(\".add_staff_field\").autocomplete({\n+        delay:500,\n+        minLength: 4,\n+        source: \"/lookup_staffs\",\n+        select:function(event, ui){\n+          var staffId = ui.item.data;\n+          $(\"#staff_id\").val(staffId);\n+        }\n+    });\n+\n+\n+      $(\".event_staffs\").on(\"click\", \".remove_staff\", function(){\n+        $(this).parents(\".chip\").hide(\"slow\", function() { $(this).remove(); });\n+      });\n+\n+\n+      $(\"#add_staff\").on(\"click\", function(){\n+        var check_field = $(\"#staff_field_id\").val()\n+\n+        if (check_field != \"\"){\n+          var staffId = $(\"#staff_id\").val();\n+          var staffRole = $(\"[name='role']\").val();\n+          var chips_div = $('.chip');","path":"app/assets/javascripts/event_staff.js","position":47,"original_position":47,"commit_id":"8aca6bfa1a5c4efd28e8d65fb2b8177bfde70d10","original_commit_id":"8aca6bfa1a5c4efd28e8d65fb2b8177bfde70d10","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Identifier 'chips_div' is not in camel case.<br>Mixed double and single quotes.<br>'chips_div' is defined but never used.","created_at":"2016-02-09T11:17:07Z","updated_at":"2016-02-09T11:17:07Z","html_url":"https://github.com/andela/eventx/pull/129#discussion_r52294803","pull_request_url":"https://api.github.com/repos/andela/eventx/pulls/129","_links":{"self":{"href":"https://api.github.com/repos/andela/eventx/pulls/comments/52294803"},"html":{"href":"https://github.com/andela/eventx/pull/129#discussion_r52294803"},"pull_request":{"href":"https://api.github.com/repos/andela/eventx/pulls/129"}}},"pull_request":{"url":"https://api.github.com/repos/andela/eventx/pulls/129","id":58557280,"html_url":"https://github.com/andela/eventx/pull/129","diff_url":"https://github.com/andela/eventx/pull/129.diff","patch_url":"https://github.com/andela/eventx/pull/129.patch","issue_url":"https://api.github.com/repos/andela/eventx/issues/129","number":129,"state":"open","locked":false,"title":"Ft add event staff form 101391882","user":{"login":"andela-aadepoju","id":10416202,"avatar_url":"https://avatars.githubusercontent.com/u/10416202?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-aadepoju","html_url":"https://github.com/andela-aadepoju","followers_url":"https://api.github.com/users/andela-aadepoju/followers","following_url":"https://api.github.com/users/andela-aadepoju/following{/other_user}","gists_url":"https://api.github.com/users/andela-aadepoju/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-aadepoju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-aadepoju/subscriptions","organizations_url":"https://api.github.com/users/andela-aadepoju/orgs","repos_url":"https://api.github.com/users/andela-aadepoju/repos","events_url":"https://api.github.com/users/andela-aadepoju/events{/privacy}","received_events_url":"https://api.github.com/users/andela-aadepoju/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-07T21:12:27Z","updated_at":"2016-02-09T11:17:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9d4517bb6c86620b8be68fbee78d035209ae7da","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/andela/eventx/pulls/129/commits","review_comments_url":"https://api.github.com/repos/andela/eventx/pulls/129/comments","review_comment_url":"https://api.github.com/repos/andela/eventx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/eventx/issues/129/comments","statuses_url":"https://api.github.com/repos/andela/eventx/statuses/8aca6bfa1a5c4efd28e8d65fb2b8177bfde70d10","head":{"label":"andela:ft-add-event-staff-form-101391882","ref":"ft-add-event-staff-form-101391882","sha":"8aca6bfa1a5c4efd28e8d65fb2b8177bfde70d10","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":39064541,"name":"eventx","full_name":"andela/eventx","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/eventx","description":"","fork":false,"url":"https://api.github.com/repos/andela/eventx","forks_url":"https://api.github.com/repos/andela/eventx/forks","keys_url":"https://api.github.com/repos/andela/eventx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/eventx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/eventx/teams","hooks_url":"https://api.github.com/repos/andela/eventx/hooks","issue_events_url":"https://api.github.com/repos/andela/eventx/issues/events{/number}","events_url":"https://api.github.com/repos/andela/eventx/events","assignees_url":"https://api.github.com/repos/andela/eventx/assignees{/user}","branches_url":"https://api.github.com/repos/andela/eventx/branches{/branch}","tags_url":"https://api.github.com/repos/andela/eventx/tags","blobs_url":"https://api.github.com/repos/andela/eventx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/eventx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/eventx/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/eventx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/eventx/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/eventx/languages","stargazers_url":"https://api.github.com/repos/andela/eventx/stargazers","contributors_url":"https://api.github.com/repos/andela/eventx/contributors","subscribers_url":"https://api.github.com/repos/andela/eventx/subscribers","subscription_url":"https://api.github.com/repos/andela/eventx/subscription","commits_url":"https://api.github.com/repos/andela/eventx/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/eventx/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/eventx/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/eventx/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/eventx/contents/{+path}","compare_url":"https://api.github.com/repos/andela/eventx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/eventx/merges","archive_url":"https://api.github.com/repos/andela/eventx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/eventx/downloads","issues_url":"https://api.github.com/repos/andela/eventx/issues{/number}","pulls_url":"https://api.github.com/repos/andela/eventx/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/eventx/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/eventx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/eventx/labels{/name}","releases_url":"https://api.github.com/repos/andela/eventx/releases{/id}","deployments_url":"https://api.github.com/repos/andela/eventx/deployments","created_at":"2015-07-14T08:57:10Z","updated_at":"2016-02-05T16:55:49Z","pushed_at":"2016-02-09T11:16:32Z","git_url":"git://github.com/andela/eventx.git","ssh_url":"git@github.com:andela/eventx.git","clone_url":"https://github.com/andela/eventx.git","svn_url":"https://github.com/andela/eventx","homepage":null,"size":28386,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"andela:master","ref":"master","sha":"ad8b29cc8432339295a919e01ed19665199a6a2d","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":39064541,"name":"eventx","full_name":"andela/eventx","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/eventx","description":"","fork":false,"url":"https://api.github.com/repos/andela/eventx","forks_url":"https://api.github.com/repos/andela/eventx/forks","keys_url":"https://api.github.com/repos/andela/eventx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/eventx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/eventx/teams","hooks_url":"https://api.github.com/repos/andela/eventx/hooks","issue_events_url":"https://api.github.com/repos/andela/eventx/issues/events{/number}","events_url":"https://api.github.com/repos/andela/eventx/events","assignees_url":"https://api.github.com/repos/andela/eventx/assignees{/user}","branches_url":"https://api.github.com/repos/andela/eventx/branches{/branch}","tags_url":"https://api.github.com/repos/andela/eventx/tags","blobs_url":"https://api.github.com/repos/andela/eventx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/eventx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/eventx/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/eventx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/eventx/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/eventx/languages","stargazers_url":"https://api.github.com/repos/andela/eventx/stargazers","contributors_url":"https://api.github.com/repos/andela/eventx/contributors","subscribers_url":"https://api.github.com/repos/andela/eventx/subscribers","subscription_url":"https://api.github.com/repos/andela/eventx/subscription","commits_url":"https://api.github.com/repos/andela/eventx/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/eventx/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/eventx/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/eventx/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/eventx/contents/{+path}","compare_url":"https://api.github.com/repos/andela/eventx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/eventx/merges","archive_url":"https://api.github.com/repos/andela/eventx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/eventx/downloads","issues_url":"https://api.github.com/repos/andela/eventx/issues{/number}","pulls_url":"https://api.github.com/repos/andela/eventx/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/eventx/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/eventx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/eventx/labels{/name}","releases_url":"https://api.github.com/repos/andela/eventx/releases{/id}","deployments_url":"https://api.github.com/repos/andela/eventx/deployments","created_at":"2015-07-14T08:57:10Z","updated_at":"2016-02-05T16:55:49Z","pushed_at":"2016-02-09T11:16:32Z","git_url":"git://github.com/andela/eventx.git","ssh_url":"git@github.com:andela/eventx.git","clone_url":"https://github.com/andela/eventx.git","svn_url":"https://github.com/andela/eventx","homepage":null,"size":28386,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/eventx/pulls/129"},"html":{"href":"https://github.com/andela/eventx/pull/129"},"issue":{"href":"https://api.github.com/repos/andela/eventx/issues/129"},"comments":{"href":"https://api.github.com/repos/andela/eventx/issues/129/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/eventx/pulls/129/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/eventx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/eventx/pulls/129/commits"},"statuses":{"href":"https://api.github.com/repos/andela/eventx/statuses/8aca6bfa1a5c4efd28e8d65fb2b8177bfde70d10"}}}}