{"action":"created","comment":{"url":"https://api.github.com/repos/wagn/wikirate/pulls/comments/58627865","id":58627865,"diff_hunk":"@@ -74,26 +77,52 @@ $(document).ready ->\n     $sourceCntr.find('form').addClass('hide')\n \n   $('body').on 'click', '._cite_button', ->\n-    $timelineContainer  = $(\".timeline-row .card-slot form\")\n-    $relSource          = $timelineContainer.find(\".relevant-sources\")\n-    $citedSource        = $timelineContainer.find(\".cited-sources\")\n-    $this               = $(this)\n-    sourceName          = $this.closest(\".TYPE-source\").data(\"card-name\")\n-    sourceID            = \"#\"+$this.closest(\".TYPE-source\").attr(\"id\")+\".TYPE-source:first\"\n-    $sourceContainer    = $timelineContainer.find(sourceID).parent().detach()\n-    $sourceFormContr    = $('#source-form-container').find(sourceID)\n-    $hiddenInput        = $('<input>').attr('type','hidden').attr('name','card[subcards][+source][content]')\n-\n-    $([$sourceFormContr.find(\"._cite_button\"),$sourceContainer.find(\"._cite_button\"), ]).each ->\n-      $(this).removeClass(\"_cite_button btn-highlight\").addClass(\"_cited_button btn-default\").text(\"Cited!\")\n-\n-    $citedSource.empty() if $citedSource.text().search(\"None\") > 0\n+    sourceCitation(this, 'cite')\n+\n+  $('body').on 'click', '._cited_button', ->\n+    sourceCitation(this, 'uncite')\n+\n+  sourceCitation = (ele, action) ->\n+     $timelineContainer  = $(\".timeline-row .card-slot form\")\n+     $relSource          = $timelineContainer.find(\".relevant-sources\")\n+     $citedSource        = $timelineContainer.find(\".cited-sources\")\n+     $this               = $(ele)\n+     sourceName          = $this.closest(\".TYPE-source\").data(\"card-name\")\n+     sourceID            = \"#\"+$this.closest(\".TYPE-source\").attr(\"id\")+\".TYPE-source:first\"\n+     $sourceContainer    = $timelineContainer.find(sourceID).parent().detach()\n+     $sourceFormContr    = $('#source-form-container').find(sourceID)\n+     $hiddenInput        = $('<input>').attr('type','hidden').attr('name','card[subcards][+source][content]')\n+     if(action =='cite')\n+      $([$sourceFormContr.find(\"._cite_button\"),$sourceContainer.find(\"._cite_button\"), ]).each ->","path":"mod/01_rating/lib/javascript/script_metric_value.js.coffee","position":51,"original_position":51,"commit_id":"555a5cf7a17fb519abd72b6da555505936ae0708","original_commit_id":"555a5cf7a17fb519abd72b6da555505936ae0708","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Line contains inconsistent indentation<br>Line exceeds maximum allowed length","created_at":"2016-04-05T22:55:54Z","updated_at":"2016-04-05T22:55:54Z","html_url":"https://github.com/wagn/wikirate/pull/365#discussion_r58627865","pull_request_url":"https://api.github.com/repos/wagn/wikirate/pulls/365","_links":{"self":{"href":"https://api.github.com/repos/wagn/wikirate/pulls/comments/58627865"},"html":{"href":"https://github.com/wagn/wikirate/pull/365#discussion_r58627865"},"pull_request":{"href":"https://api.github.com/repos/wagn/wikirate/pulls/365"}}},"pull_request":{"url":"https://api.github.com/repos/wagn/wikirate/pulls/365","id":65385321,"html_url":"https://github.com/wagn/wikirate/pull/365","diff_url":"https://github.com/wagn/wikirate/pull/365.diff","patch_url":"https://github.com/wagn/wikirate/pull/365.patch","issue_url":"https://api.github.com/repos/wagn/wikirate/issues/365","number":365,"state":"open","locked":false,"title":"New metric value","user":{"login":"srivig","id":6579236,"avatar_url":"https://avatars.githubusercontent.com/u/6579236?v=3","gravatar_id":"","url":"https://api.github.com/users/srivig","html_url":"https://github.com/srivig","followers_url":"https://api.github.com/users/srivig/followers","following_url":"https://api.github.com/users/srivig/following{/other_user}","gists_url":"https://api.github.com/users/srivig/gists{/gist_id}","starred_url":"https://api.github.com/users/srivig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srivig/subscriptions","organizations_url":"https://api.github.com/users/srivig/orgs","repos_url":"https://api.github.com/users/srivig/repos","events_url":"https://api.github.com/users/srivig/events{/privacy}","received_events_url":"https://api.github.com/users/srivig/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-05T22:55:46Z","updated_at":"2016-04-05T22:55:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6829eb85c7f223171933d83aa4e0c112fcde768f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wagn/wikirate/pulls/365/commits","review_comments_url":"https://api.github.com/repos/wagn/wikirate/pulls/365/comments","review_comment_url":"https://api.github.com/repos/wagn/wikirate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wagn/wikirate/issues/365/comments","statuses_url":"https://api.github.com/repos/wagn/wikirate/statuses/555a5cf7a17fb519abd72b6da555505936ae0708","head":{"label":"srivig:new_metric_value","ref":"new_metric_value","sha":"555a5cf7a17fb519abd72b6da555505936ae0708","user":{"login":"srivig","id":6579236,"avatar_url":"https://avatars.githubusercontent.com/u/6579236?v=3","gravatar_id":"","url":"https://api.github.com/users/srivig","html_url":"https://github.com/srivig","followers_url":"https://api.github.com/users/srivig/followers","following_url":"https://api.github.com/users/srivig/following{/other_user}","gists_url":"https://api.github.com/users/srivig/gists{/gist_id}","starred_url":"https://api.github.com/users/srivig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srivig/subscriptions","organizations_url":"https://api.github.com/users/srivig/orgs","repos_url":"https://api.github.com/users/srivig/repos","events_url":"https://api.github.com/users/srivig/events{/privacy}","received_events_url":"https://api.github.com/users/srivig/received_events","type":"User","site_admin":false},"repo":{"id":26482921,"name":"wikirate","full_name":"srivig/wikirate","owner":{"login":"srivig","id":6579236,"avatar_url":"https://avatars.githubusercontent.com/u/6579236?v=3","gravatar_id":"","url":"https://api.github.com/users/srivig","html_url":"https://github.com/srivig","followers_url":"https://api.github.com/users/srivig/followers","following_url":"https://api.github.com/users/srivig/following{/other_user}","gists_url":"https://api.github.com/users/srivig/gists{/gist_id}","starred_url":"https://api.github.com/users/srivig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srivig/subscriptions","organizations_url":"https://api.github.com/users/srivig/orgs","repos_url":"https://api.github.com/users/srivig/repos","events_url":"https://api.github.com/users/srivig/events{/privacy}","received_events_url":"https://api.github.com/users/srivig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/srivig/wikirate","description":"","fork":true,"url":"https://api.github.com/repos/srivig/wikirate","forks_url":"https://api.github.com/repos/srivig/wikirate/forks","keys_url":"https://api.github.com/repos/srivig/wikirate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/srivig/wikirate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/srivig/wikirate/teams","hooks_url":"https://api.github.com/repos/srivig/wikirate/hooks","issue_events_url":"https://api.github.com/repos/srivig/wikirate/issues/events{/number}","events_url":"https://api.github.com/repos/srivig/wikirate/events","assignees_url":"https://api.github.com/repos/srivig/wikirate/assignees{/user}","branches_url":"https://api.github.com/repos/srivig/wikirate/branches{/branch}","tags_url":"https://api.github.com/repos/srivig/wikirate/tags","blobs_url":"https://api.github.com/repos/srivig/wikirate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/srivig/wikirate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/srivig/wikirate/git/refs{/sha}","trees_url":"https://api.github.com/repos/srivig/wikirate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/srivig/wikirate/statuses/{sha}","languages_url":"https://api.github.com/repos/srivig/wikirate/languages","stargazers_url":"https://api.github.com/repos/srivig/wikirate/stargazers","contributors_url":"https://api.github.com/repos/srivig/wikirate/contributors","subscribers_url":"https://api.github.com/repos/srivig/wikirate/subscribers","subscription_url":"https://api.github.com/repos/srivig/wikirate/subscription","commits_url":"https://api.github.com/repos/srivig/wikirate/commits{/sha}","git_commits_url":"https://api.github.com/repos/srivig/wikirate/git/commits{/sha}","comments_url":"https://api.github.com/repos/srivig/wikirate/comments{/number}","issue_comment_url":"https://api.github.com/repos/srivig/wikirate/issues/comments{/number}","contents_url":"https://api.github.com/repos/srivig/wikirate/contents/{+path}","compare_url":"https://api.github.com/repos/srivig/wikirate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/srivig/wikirate/merges","archive_url":"https://api.github.com/repos/srivig/wikirate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/srivig/wikirate/downloads","issues_url":"https://api.github.com/repos/srivig/wikirate/issues{/number}","pulls_url":"https://api.github.com/repos/srivig/wikirate/pulls{/number}","milestones_url":"https://api.github.com/repos/srivig/wikirate/milestones{/number}","notifications_url":"https://api.github.com/repos/srivig/wikirate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/srivig/wikirate/labels{/name}","releases_url":"https://api.github.com/repos/srivig/wikirate/releases{/id}","deployments_url":"https://api.github.com/repos/srivig/wikirate/deployments","created_at":"2014-11-11T11:53:21Z","updated_at":"2015-11-09T14:04:46Z","pushed_at":"2016-04-05T22:54:56Z","git_url":"git://github.com/srivig/wikirate.git","ssh_url":"git@github.com:srivig/wikirate.git","clone_url":"https://github.com/srivig/wikirate.git","svn_url":"https://github.com/srivig/wikirate","homepage":null,"size":84653,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"wagn:dev","ref":"dev","sha":"ea40d15c760ea317bf9f2c8532cf9dbc66ad700a","user":{"login":"wagn","id":20722,"avatar_url":"https://avatars.githubusercontent.com/u/20722?v=3","gravatar_id":"","url":"https://api.github.com/users/wagn","html_url":"https://github.com/wagn","followers_url":"https://api.github.com/users/wagn/followers","following_url":"https://api.github.com/users/wagn/following{/other_user}","gists_url":"https://api.github.com/users/wagn/gists{/gist_id}","starred_url":"https://api.github.com/users/wagn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wagn/subscriptions","organizations_url":"https://api.github.com/users/wagn/orgs","repos_url":"https://api.github.com/users/wagn/repos","events_url":"https://api.github.com/users/wagn/events{/privacy}","received_events_url":"https://api.github.com/users/wagn/received_events","type":"User","site_admin":false},"repo":{"id":15884166,"name":"wikirate","full_name":"wagn/wikirate","owner":{"login":"wagn","id":20722,"avatar_url":"https://avatars.githubusercontent.com/u/20722?v=3","gravatar_id":"","url":"https://api.github.com/users/wagn","html_url":"https://github.com/wagn","followers_url":"https://api.github.com/users/wagn/followers","following_url":"https://api.github.com/users/wagn/following{/other_user}","gists_url":"https://api.github.com/users/wagn/gists{/gist_id}","starred_url":"https://api.github.com/users/wagn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wagn/subscriptions","organizations_url":"https://api.github.com/users/wagn/orgs","repos_url":"https://api.github.com/users/wagn/repos","events_url":"https://api.github.com/users/wagn/events{/privacy}","received_events_url":"https://api.github.com/users/wagn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wagn/wikirate","description":"","fork":false,"url":"https://api.github.com/repos/wagn/wikirate","forks_url":"https://api.github.com/repos/wagn/wikirate/forks","keys_url":"https://api.github.com/repos/wagn/wikirate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wagn/wikirate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wagn/wikirate/teams","hooks_url":"https://api.github.com/repos/wagn/wikirate/hooks","issue_events_url":"https://api.github.com/repos/wagn/wikirate/issues/events{/number}","events_url":"https://api.github.com/repos/wagn/wikirate/events","assignees_url":"https://api.github.com/repos/wagn/wikirate/assignees{/user}","branches_url":"https://api.github.com/repos/wagn/wikirate/branches{/branch}","tags_url":"https://api.github.com/repos/wagn/wikirate/tags","blobs_url":"https://api.github.com/repos/wagn/wikirate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wagn/wikirate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wagn/wikirate/git/refs{/sha}","trees_url":"https://api.github.com/repos/wagn/wikirate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wagn/wikirate/statuses/{sha}","languages_url":"https://api.github.com/repos/wagn/wikirate/languages","stargazers_url":"https://api.github.com/repos/wagn/wikirate/stargazers","contributors_url":"https://api.github.com/repos/wagn/wikirate/contributors","subscribers_url":"https://api.github.com/repos/wagn/wikirate/subscribers","subscription_url":"https://api.github.com/repos/wagn/wikirate/subscription","commits_url":"https://api.github.com/repos/wagn/wikirate/commits{/sha}","git_commits_url":"https://api.github.com/repos/wagn/wikirate/git/commits{/sha}","comments_url":"https://api.github.com/repos/wagn/wikirate/comments{/number}","issue_comment_url":"https://api.github.com/repos/wagn/wikirate/issues/comments{/number}","contents_url":"https://api.github.com/repos/wagn/wikirate/contents/{+path}","compare_url":"https://api.github.com/repos/wagn/wikirate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wagn/wikirate/merges","archive_url":"https://api.github.com/repos/wagn/wikirate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wagn/wikirate/downloads","issues_url":"https://api.github.com/repos/wagn/wikirate/issues{/number}","pulls_url":"https://api.github.com/repos/wagn/wikirate/pulls{/number}","milestones_url":"https://api.github.com/repos/wagn/wikirate/milestones{/number}","notifications_url":"https://api.github.com/repos/wagn/wikirate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wagn/wikirate/labels{/name}","releases_url":"https://api.github.com/repos/wagn/wikirate/releases{/id}","deployments_url":"https://api.github.com/repos/wagn/wikirate/deployments","created_at":"2014-01-13T22:29:39Z","updated_at":"2016-01-11T16:43:51Z","pushed_at":"2016-04-05T22:55:47Z","git_url":"git://github.com/wagn/wikirate.git","ssh_url":"git@github.com:wagn/wikirate.git","clone_url":"https://github.com/wagn/wikirate.git","svn_url":"https://github.com/wagn/wikirate","homepage":null,"size":85882,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":5,"forks":5,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wagn/wikirate/pulls/365"},"html":{"href":"https://github.com/wagn/wikirate/pull/365"},"issue":{"href":"https://api.github.com/repos/wagn/wikirate/issues/365"},"comments":{"href":"https://api.github.com/repos/wagn/wikirate/issues/365/comments"},"review_comments":{"href":"https://api.github.com/repos/wagn/wikirate/pulls/365/comments"},"review_comment":{"href":"https://api.github.com/repos/wagn/wikirate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wagn/wikirate/pulls/365/commits"},"statuses":{"href":"https://api.github.com/repos/wagn/wikirate/statuses/555a5cf7a17fb519abd72b6da555505936ae0708"}}}}