{"action":"created","comment":{"url":"https://api.github.com/repos/evercam/evercam-admin/pulls/comments/48719767","id":48719767,"diff_hunk":"@@ -102,22 +102,103 @@ onCameraDelete = ->\n           tr.remove()\n           count--\n           action.find('td:nth-child(5)').text(count)\n+          $(\".bb-alert\")\n+            .addClass(\"alert-success\")\n+            .text(\"Camere has been deleted!\")\n+            .delay(200)\n+            .fadeIn()\n+            .delay(4000)\n+            .fadeOut()\n         error: (xhr, status, error) ->\n-          $(\".alert-danger\").text(xhr.responseText)\n+          $(\".alert-danger\")\n+            .text(xhr.responseText)\n+            .delay(200)\n+            .fadeIn()\n+            .delay(4000)\n+            .fadeOut()\n     else if $(\"#camera_specified_id\").val() is \"\"\n       $(\".alert-danger\")\n-      .text(\"Please specify your camera id!\")\n-      .delay(200)\n-      .fadeIn()\n-      .delay(4000)\n-      .fadeOut()\n+        .text(\"Please specify your camera id!\")\n+        .delay(200)\n+        .fadeIn()\n+        .delay(4000)\n+        .fadeOut()\n     else\n       $(\".alert-danger\")\n-      .text(\"Invalid camera id!\")\n-      .delay(200)\n-      .fadeIn()\n-      .delay(4000)\n-      .fadeOut()\n+        .text(\"Invalid camera id!\")\n+        .delay(200)\n+        .fadeIn()\n+        .delay(4000)\n+        .fadeOut()\n+\n+onCameraMerge = ->\n+  tr = ''\n+  needToMergeId = ''\n+  cameraName = ''\n+  fCId = ''\n+  mergedRow = ''\n+  $(\"#dat\").on 'click', '.merge-cam', ->\n+    $('#mergeModal').modal('show')\n+    tr = $(this).parents('tr')\n+    needToMergeId = tr.find('td:nth-child(9)').text()\n+    cameraName = tr.find('td:nth-child(1)').text()\n+    nCameraCount = tr.find('td:nth-child(6)').text()\n+    $(\"p > #mc\").append cameraName + \" - share count ( \" + nCameraCount + \" )\"\n+    tbl = $('#dat > table > tbody > tr:has(td)').map((i, v) ->\n+      $td = $('td', this)\n+      {\n+        id: ++i\n+        camId: $td.eq(8).text()\n+        camName: $td.eq(0).text()\n+        exId: $td.eq(1).text()\n+        sCount: $td.eq(5).text()\n+      }\n+    ).get()\n+    i = 0\n+    while i < tbl.length\n+      if tbl[i].camId == needToMergeId && tbl[i].camName == cameraName\n+        tbl.splice(i,1);\n+      i++\n+    optionsHtml = ''\n+    tbl.forEach (value) ->\n+      optionsHtml += '<option value=\"' + value.camId + '\">' + value.camName + ' - share Count (' + value.sCount + ')</option>'\n+    $('#with-cam').html '<select id=\"cam-f-id\" class=\"form-control\">' + optionsHtml + '</select>'","path":"app/assets/javascripts/admin/merges.js.coffee","position":84,"original_position":84,"commit_id":"eab1925cea8720a2d58948e84c3af508638645af","original_commit_id":"eab1925cea8720a2d58948e84c3af508638645af","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":"Line exceeds maximum allowed length","created_at":"2016-01-04T10:43:55Z","updated_at":"2016-01-04T10:43:55Z","html_url":"https://github.com/evercam/evercam-admin/pull/78#discussion_r48719767","pull_request_url":"https://api.github.com/repos/evercam/evercam-admin/pulls/78","_links":{"self":{"href":"https://api.github.com/repos/evercam/evercam-admin/pulls/comments/48719767"},"html":{"href":"https://github.com/evercam/evercam-admin/pull/78#discussion_r48719767"},"pull_request":{"href":"https://api.github.com/repos/evercam/evercam-admin/pulls/78"}}},"pull_request":{"url":"https://api.github.com/repos/evercam/evercam-admin/pulls/78","id":54962336,"html_url":"https://github.com/evercam/evercam-admin/pull/78","diff_url":"https://github.com/evercam/evercam-admin/pull/78.diff","patch_url":"https://github.com/evercam/evercam-admin/pull/78.patch","issue_url":"https://api.github.com/repos/evercam/evercam-admin/issues/78","number":78,"state":"open","locked":false,"title":"Merge cameras","user":{"login":"ijunaidfarooq","id":13561999,"avatar_url":"https://avatars.githubusercontent.com/u/13561999?v=3","gravatar_id":"","url":"https://api.github.com/users/ijunaidfarooq","html_url":"https://github.com/ijunaidfarooq","followers_url":"https://api.github.com/users/ijunaidfarooq/followers","following_url":"https://api.github.com/users/ijunaidfarooq/following{/other_user}","gists_url":"https://api.github.com/users/ijunaidfarooq/gists{/gist_id}","starred_url":"https://api.github.com/users/ijunaidfarooq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ijunaidfarooq/subscriptions","organizations_url":"https://api.github.com/users/ijunaidfarooq/orgs","repos_url":"https://api.github.com/users/ijunaidfarooq/repos","events_url":"https://api.github.com/users/ijunaidfarooq/events{/privacy}","received_events_url":"https://api.github.com/users/ijunaidfarooq/received_events","type":"User","site_admin":false},"body":"@azharmalik3 ","created_at":"2016-01-04T10:43:44Z","updated_at":"2016-01-04T10:43:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eac8f56aa2b0a08cc507de6d6553d8910d81ba71","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/evercam/evercam-admin/pulls/78/commits","review_comments_url":"https://api.github.com/repos/evercam/evercam-admin/pulls/78/comments","review_comment_url":"https://api.github.com/repos/evercam/evercam-admin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/evercam/evercam-admin/issues/78/comments","statuses_url":"https://api.github.com/repos/evercam/evercam-admin/statuses/eab1925cea8720a2d58948e84c3af508638645af","head":{"label":"evercam:merge_cameras","ref":"merge_cameras","sha":"eab1925cea8720a2d58948e84c3af508638645af","user":{"login":"evercam","id":5575404,"avatar_url":"https://avatars.githubusercontent.com/u/5575404?v=3","gravatar_id":"","url":"https://api.github.com/users/evercam","html_url":"https://github.com/evercam","followers_url":"https://api.github.com/users/evercam/followers","following_url":"https://api.github.com/users/evercam/following{/other_user}","gists_url":"https://api.github.com/users/evercam/gists{/gist_id}","starred_url":"https://api.github.com/users/evercam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evercam/subscriptions","organizations_url":"https://api.github.com/users/evercam/orgs","repos_url":"https://api.github.com/users/evercam/repos","events_url":"https://api.github.com/users/evercam/events{/privacy}","received_events_url":"https://api.github.com/users/evercam/received_events","type":"Organization","site_admin":false},"repo":{"id":38099607,"name":"evercam-admin","full_name":"evercam/evercam-admin","owner":{"login":"evercam","id":5575404,"avatar_url":"https://avatars.githubusercontent.com/u/5575404?v=3","gravatar_id":"","url":"https://api.github.com/users/evercam","html_url":"https://github.com/evercam","followers_url":"https://api.github.com/users/evercam/followers","following_url":"https://api.github.com/users/evercam/following{/other_user}","gists_url":"https://api.github.com/users/evercam/gists{/gist_id}","starred_url":"https://api.github.com/users/evercam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evercam/subscriptions","organizations_url":"https://api.github.com/users/evercam/orgs","repos_url":"https://api.github.com/users/evercam/repos","events_url":"https://api.github.com/users/evercam/events{/privacy}","received_events_url":"https://api.github.com/users/evercam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/evercam/evercam-admin","description":"Rails Application for Admin Area for User & Camera Management","fork":false,"url":"https://api.github.com/repos/evercam/evercam-admin","forks_url":"https://api.github.com/repos/evercam/evercam-admin/forks","keys_url":"https://api.github.com/repos/evercam/evercam-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evercam/evercam-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evercam/evercam-admin/teams","hooks_url":"https://api.github.com/repos/evercam/evercam-admin/hooks","issue_events_url":"https://api.github.com/repos/evercam/evercam-admin/issues/events{/number}","events_url":"https://api.github.com/repos/evercam/evercam-admin/events","assignees_url":"https://api.github.com/repos/evercam/evercam-admin/assignees{/user}","branches_url":"https://api.github.com/repos/evercam/evercam-admin/branches{/branch}","tags_url":"https://api.github.com/repos/evercam/evercam-admin/tags","blobs_url":"https://api.github.com/repos/evercam/evercam-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evercam/evercam-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evercam/evercam-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/evercam/evercam-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evercam/evercam-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/evercam/evercam-admin/languages","stargazers_url":"https://api.github.com/repos/evercam/evercam-admin/stargazers","contributors_url":"https://api.github.com/repos/evercam/evercam-admin/contributors","subscribers_url":"https://api.github.com/repos/evercam/evercam-admin/subscribers","subscription_url":"https://api.github.com/repos/evercam/evercam-admin/subscription","commits_url":"https://api.github.com/repos/evercam/evercam-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/evercam/evercam-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/evercam/evercam-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/evercam/evercam-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/evercam/evercam-admin/contents/{+path}","compare_url":"https://api.github.com/repos/evercam/evercam-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evercam/evercam-admin/merges","archive_url":"https://api.github.com/repos/evercam/evercam-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evercam/evercam-admin/downloads","issues_url":"https://api.github.com/repos/evercam/evercam-admin/issues{/number}","pulls_url":"https://api.github.com/repos/evercam/evercam-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/evercam/evercam-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/evercam/evercam-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evercam/evercam-admin/labels{/name}","releases_url":"https://api.github.com/repos/evercam/evercam-admin/releases{/id}","created_at":"2015-06-26T08:22:15Z","updated_at":"2015-11-05T10:42:17Z","pushed_at":"2016-01-04T10:43:45Z","git_url":"git://github.com/evercam/evercam-admin.git","ssh_url":"git@github.com:evercam/evercam-admin.git","clone_url":"https://github.com/evercam/evercam-admin.git","svn_url":"https://github.com/evercam/evercam-admin","homepage":null,"size":7982,"stargazers_count":4,"watchers_count":4,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":4,"default_branch":"master"}},"base":{"label":"evercam:master","ref":"master","sha":"e596fca82db57fcc99497534693c20bea96a3768","user":{"login":"evercam","id":5575404,"avatar_url":"https://avatars.githubusercontent.com/u/5575404?v=3","gravatar_id":"","url":"https://api.github.com/users/evercam","html_url":"https://github.com/evercam","followers_url":"https://api.github.com/users/evercam/followers","following_url":"https://api.github.com/users/evercam/following{/other_user}","gists_url":"https://api.github.com/users/evercam/gists{/gist_id}","starred_url":"https://api.github.com/users/evercam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evercam/subscriptions","organizations_url":"https://api.github.com/users/evercam/orgs","repos_url":"https://api.github.com/users/evercam/repos","events_url":"https://api.github.com/users/evercam/events{/privacy}","received_events_url":"https://api.github.com/users/evercam/received_events","type":"Organization","site_admin":false},"repo":{"id":38099607,"name":"evercam-admin","full_name":"evercam/evercam-admin","owner":{"login":"evercam","id":5575404,"avatar_url":"https://avatars.githubusercontent.com/u/5575404?v=3","gravatar_id":"","url":"https://api.github.com/users/evercam","html_url":"https://github.com/evercam","followers_url":"https://api.github.com/users/evercam/followers","following_url":"https://api.github.com/users/evercam/following{/other_user}","gists_url":"https://api.github.com/users/evercam/gists{/gist_id}","starred_url":"https://api.github.com/users/evercam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evercam/subscriptions","organizations_url":"https://api.github.com/users/evercam/orgs","repos_url":"https://api.github.com/users/evercam/repos","events_url":"https://api.github.com/users/evercam/events{/privacy}","received_events_url":"https://api.github.com/users/evercam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/evercam/evercam-admin","description":"Rails Application for Admin Area for User & Camera Management","fork":false,"url":"https://api.github.com/repos/evercam/evercam-admin","forks_url":"https://api.github.com/repos/evercam/evercam-admin/forks","keys_url":"https://api.github.com/repos/evercam/evercam-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evercam/evercam-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evercam/evercam-admin/teams","hooks_url":"https://api.github.com/repos/evercam/evercam-admin/hooks","issue_events_url":"https://api.github.com/repos/evercam/evercam-admin/issues/events{/number}","events_url":"https://api.github.com/repos/evercam/evercam-admin/events","assignees_url":"https://api.github.com/repos/evercam/evercam-admin/assignees{/user}","branches_url":"https://api.github.com/repos/evercam/evercam-admin/branches{/branch}","tags_url":"https://api.github.com/repos/evercam/evercam-admin/tags","blobs_url":"https://api.github.com/repos/evercam/evercam-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evercam/evercam-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evercam/evercam-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/evercam/evercam-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evercam/evercam-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/evercam/evercam-admin/languages","stargazers_url":"https://api.github.com/repos/evercam/evercam-admin/stargazers","contributors_url":"https://api.github.com/repos/evercam/evercam-admin/contributors","subscribers_url":"https://api.github.com/repos/evercam/evercam-admin/subscribers","subscription_url":"https://api.github.com/repos/evercam/evercam-admin/subscription","commits_url":"https://api.github.com/repos/evercam/evercam-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/evercam/evercam-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/evercam/evercam-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/evercam/evercam-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/evercam/evercam-admin/contents/{+path}","compare_url":"https://api.github.com/repos/evercam/evercam-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evercam/evercam-admin/merges","archive_url":"https://api.github.com/repos/evercam/evercam-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evercam/evercam-admin/downloads","issues_url":"https://api.github.com/repos/evercam/evercam-admin/issues{/number}","pulls_url":"https://api.github.com/repos/evercam/evercam-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/evercam/evercam-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/evercam/evercam-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evercam/evercam-admin/labels{/name}","releases_url":"https://api.github.com/repos/evercam/evercam-admin/releases{/id}","created_at":"2015-06-26T08:22:15Z","updated_at":"2015-11-05T10:42:17Z","pushed_at":"2016-01-04T10:43:45Z","git_url":"git://github.com/evercam/evercam-admin.git","ssh_url":"git@github.com:evercam/evercam-admin.git","clone_url":"https://github.com/evercam/evercam-admin.git","svn_url":"https://github.com/evercam/evercam-admin","homepage":null,"size":7982,"stargazers_count":4,"watchers_count":4,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/evercam/evercam-admin/pulls/78"},"html":{"href":"https://github.com/evercam/evercam-admin/pull/78"},"issue":{"href":"https://api.github.com/repos/evercam/evercam-admin/issues/78"},"comments":{"href":"https://api.github.com/repos/evercam/evercam-admin/issues/78/comments"},"review_comments":{"href":"https://api.github.com/repos/evercam/evercam-admin/pulls/78/comments"},"review_comment":{"href":"https://api.github.com/repos/evercam/evercam-admin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/evercam/evercam-admin/pulls/78/commits"},"statuses":{"href":"https://api.github.com/repos/evercam/evercam-admin/statuses/eab1925cea8720a2d58948e84c3af508638645af"}}}}