{"action":"created","comment":{"url":"https://api.github.com/repos/olimart/yasite/pulls/comments/32590279","id":32590279,"diff_hunk":"@@ -0,0 +1,125 @@\n+$(function() {\n+    $('#new_metadata').bind('click', function(ev){\n+      // reset input value\n+      $('input[name=variable]').val(\"\");\n+      $('input[name=value]').val(\"\");\n+      \n+      // add new row\n+\t  var x = $('#tbl_metadata tr.new:last').clone(true);\n+      x.insertBefore('#tbl_metadata tr.new:last');\n+      \n+      // reset value of last row\n+      $('#tbl_metadata tr.new:last td:nth-child(2) span').text(\"\");\n+      $('#tbl_metadata tr.new:last td:first span').text(\"\");\n+\t});\n+\t\n+\t// SAVE METADATA\n+\t$('#save_metadata').bind('click', function(){\n+\t\tvar hash = save_metadata();\n+\t\tvar url = $(this).data().url;\n+\t\t$.ajax({\n+\t\t   type: \"POST\",\n+\t\t   data: {meta: hash},\n+\t\t   url: url,\n+\t\t   success: function(data){\n+\t\t     alert(data.msg);\n+\t\t   }\n+\t\t});\n+\t});\n+\t\n+\t// DELETE ONE ROW IN TABLE\n+\t$(\".delete\").bind('click', function(event) {\n+\t\tif($(this).closest(\"tr\").is(\":last-child\")){\n+\t\t\treturn;\n+\t\t}else{\n+\t\t\t$(this).closest(\"tr\").remove();\n+\t\t}\n+\t});\n+\t\n+\t// HANDLE EDIT BUTTON\n+\t$(\".edit\").bind('click', function(event) {\n+    if($(this).closest(\"tr\").is(\":last-child\")){\n+      return;\n+    }else{\n+      var tr = $(this).closest(\"tr\");\n+      var name = tr.find(\".name\").find(\"span\").text();\n+      var value = tr.find(\".value\").find(\"span\").text();\n+      var newtr = \"<tr><td class='name'><span class='hidden name'>\" + name + \"</span><input maxlength='1024' value='\" + name + \"' /></td><td class='value'><span class='hidden value'>\" + value + \"</span><input maxlength='1024' value='\" + value + \"'></td><td><input type='button' value='Save' class='btn--green submit_edit' onclick=save(this) /></td></tr>\";\n+      tr.replaceWith(newtr);\n+    }\n+  });\n+  \n+  // HANDLE SAVE BUTTON \n+  save = function(element){\n+    var tr = $(element).closest(\"tr\");\n+    var newtr = $('#tbl_metadata tr.new:last').clone(true);\n+    \n+    var name = tr.find(\".name\").find(\"input\").val();\n+    console.log(name);\n+    var value = tr.find(\".value\").find(\"input\").val();\n+    \n+    newtr.find(\".name\").find(\"span\").text(name);\n+    newtr.find(\".value\").find(\"span\").text(value);","path":"app/assets/javascripts/metadata.js","position":62,"original_position":62,"commit_id":"9e14ee91abd2a8aff833905176fec92bd211e1a2","original_commit_id":"9e14ee91abd2a8aff833905176fec92bd211e1a2","user":{"login":"codeguardci","id":9791874,"avatar_url":"https://avatars.githubusercontent.com/u/9791874?v=3","gravatar_id":"","url":"https://api.github.com/users/codeguardci","html_url":"https://github.com/codeguardci","followers_url":"https://api.github.com/users/codeguardci/followers","following_url":"https://api.github.com/users/codeguardci/following{/other_user}","gists_url":"https://api.github.com/users/codeguardci/gists{/gist_id}","starred_url":"https://api.github.com/users/codeguardci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeguardci/subscriptions","organizations_url":"https://api.github.com/users/codeguardci/orgs","repos_url":"https://api.github.com/users/codeguardci/repos","events_url":"https://api.github.com/users/codeguardci/events{/privacy}","received_events_url":"https://api.github.com/users/codeguardci/received_events","type":"User","site_admin":false},"body":"Mixed double and single quotes.","created_at":"2015-06-17T02:06:04Z","updated_at":"2015-06-17T02:06:04Z","html_url":"https://github.com/olimart/yasite/pull/5#discussion_r32590279","pull_request_url":"https://api.github.com/repos/olimart/yasite/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/olimart/yasite/pulls/comments/32590279"},"html":{"href":"https://github.com/olimart/yasite/pull/5#discussion_r32590279"},"pull_request":{"href":"https://api.github.com/repos/olimart/yasite/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/olimart/yasite/pulls/5","id":37859680,"html_url":"https://github.com/olimart/yasite/pull/5","diff_url":"https://github.com/olimart/yasite/pull/5.diff","patch_url":"https://github.com/olimart/yasite/pull/5.patch","issue_url":"https://api.github.com/repos/olimart/yasite/issues/5","number":5,"state":"open","locked":false,"title":"[FEATURE] Resolved issue #2","user":{"login":"olimart","id":547754,"avatar_url":"https://avatars.githubusercontent.com/u/547754?v=3","gravatar_id":"","url":"https://api.github.com/users/olimart","html_url":"https://github.com/olimart","followers_url":"https://api.github.com/users/olimart/followers","following_url":"https://api.github.com/users/olimart/following{/other_user}","gists_url":"https://api.github.com/users/olimart/gists{/gist_id}","starred_url":"https://api.github.com/users/olimart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olimart/subscriptions","organizations_url":"https://api.github.com/users/olimart/orgs","repos_url":"https://api.github.com/users/olimart/repos","events_url":"https://api.github.com/users/olimart/events{/privacy}","received_events_url":"https://api.github.com/users/olimart/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-17T02:05:55Z","updated_at":"2015-06-17T02:06:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5ff3aa6f4e04226221a72ea154458c4e0aafa6a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/olimart/yasite/pulls/5/commits","review_comments_url":"https://api.github.com/repos/olimart/yasite/pulls/5/comments","review_comment_url":"https://api.github.com/repos/olimart/yasite/pulls/comments{/number}","comments_url":"https://api.github.com/repos/olimart/yasite/issues/5/comments","statuses_url":"https://api.github.com/repos/olimart/yasite/statuses/9e14ee91abd2a8aff833905176fec92bd211e1a2","head":{"label":"olimart:larion_issue_2","ref":"larion_issue_2","sha":"9e14ee91abd2a8aff833905176fec92bd211e1a2","user":{"login":"olimart","id":547754,"avatar_url":"https://avatars.githubusercontent.com/u/547754?v=3","gravatar_id":"","url":"https://api.github.com/users/olimart","html_url":"https://github.com/olimart","followers_url":"https://api.github.com/users/olimart/followers","following_url":"https://api.github.com/users/olimart/following{/other_user}","gists_url":"https://api.github.com/users/olimart/gists{/gist_id}","starred_url":"https://api.github.com/users/olimart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olimart/subscriptions","organizations_url":"https://api.github.com/users/olimart/orgs","repos_url":"https://api.github.com/users/olimart/repos","events_url":"https://api.github.com/users/olimart/events{/privacy}","received_events_url":"https://api.github.com/users/olimart/received_events","type":"User","site_admin":false},"repo":{"id":37227549,"name":"yasite","full_name":"olimart/yasite","owner":{"login":"olimart","id":547754,"avatar_url":"https://avatars.githubusercontent.com/u/547754?v=3","gravatar_id":"","url":"https://api.github.com/users/olimart","html_url":"https://github.com/olimart","followers_url":"https://api.github.com/users/olimart/followers","following_url":"https://api.github.com/users/olimart/following{/other_user}","gists_url":"https://api.github.com/users/olimart/gists{/gist_id}","starred_url":"https://api.github.com/users/olimart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olimart/subscriptions","organizations_url":"https://api.github.com/users/olimart/orgs","repos_url":"https://api.github.com/users/olimart/repos","events_url":"https://api.github.com/users/olimart/events{/privacy}","received_events_url":"https://api.github.com/users/olimart/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/olimart/yasite","description":null,"fork":false,"url":"https://api.github.com/repos/olimart/yasite","forks_url":"https://api.github.com/repos/olimart/yasite/forks","keys_url":"https://api.github.com/repos/olimart/yasite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/olimart/yasite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/olimart/yasite/teams","hooks_url":"https://api.github.com/repos/olimart/yasite/hooks","issue_events_url":"https://api.github.com/repos/olimart/yasite/issues/events{/number}","events_url":"https://api.github.com/repos/olimart/yasite/events","assignees_url":"https://api.github.com/repos/olimart/yasite/assignees{/user}","branches_url":"https://api.github.com/repos/olimart/yasite/branches{/branch}","tags_url":"https://api.github.com/repos/olimart/yasite/tags","blobs_url":"https://api.github.com/repos/olimart/yasite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/olimart/yasite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/olimart/yasite/git/refs{/sha}","trees_url":"https://api.github.com/repos/olimart/yasite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/olimart/yasite/statuses/{sha}","languages_url":"https://api.github.com/repos/olimart/yasite/languages","stargazers_url":"https://api.github.com/repos/olimart/yasite/stargazers","contributors_url":"https://api.github.com/repos/olimart/yasite/contributors","subscribers_url":"https://api.github.com/repos/olimart/yasite/subscribers","subscription_url":"https://api.github.com/repos/olimart/yasite/subscription","commits_url":"https://api.github.com/repos/olimart/yasite/commits{/sha}","git_commits_url":"https://api.github.com/repos/olimart/yasite/git/commits{/sha}","comments_url":"https://api.github.com/repos/olimart/yasite/comments{/number}","issue_comment_url":"https://api.github.com/repos/olimart/yasite/issues/comments{/number}","contents_url":"https://api.github.com/repos/olimart/yasite/contents/{+path}","compare_url":"https://api.github.com/repos/olimart/yasite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/olimart/yasite/merges","archive_url":"https://api.github.com/repos/olimart/yasite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/olimart/yasite/downloads","issues_url":"https://api.github.com/repos/olimart/yasite/issues{/number}","pulls_url":"https://api.github.com/repos/olimart/yasite/pulls{/number}","milestones_url":"https://api.github.com/repos/olimart/yasite/milestones{/number}","notifications_url":"https://api.github.com/repos/olimart/yasite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/olimart/yasite/labels{/name}","releases_url":"https://api.github.com/repos/olimart/yasite/releases{/id}","created_at":"2015-06-10T23:11:34Z","updated_at":"2015-06-10T23:11:37Z","pushed_at":"2015-06-17T02:05:56Z","git_url":"git://github.com/olimart/yasite.git","ssh_url":"git@github.com:olimart/yasite.git","clone_url":"https://github.com/olimart/yasite.git","svn_url":"https://github.com/olimart/yasite","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"olimart:master","ref":"master","sha":"5036d920c2ac0c84faa67032cef703bd2397d4c9","user":{"login":"olimart","id":547754,"avatar_url":"https://avatars.githubusercontent.com/u/547754?v=3","gravatar_id":"","url":"https://api.github.com/users/olimart","html_url":"https://github.com/olimart","followers_url":"https://api.github.com/users/olimart/followers","following_url":"https://api.github.com/users/olimart/following{/other_user}","gists_url":"https://api.github.com/users/olimart/gists{/gist_id}","starred_url":"https://api.github.com/users/olimart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olimart/subscriptions","organizations_url":"https://api.github.com/users/olimart/orgs","repos_url":"https://api.github.com/users/olimart/repos","events_url":"https://api.github.com/users/olimart/events{/privacy}","received_events_url":"https://api.github.com/users/olimart/received_events","type":"User","site_admin":false},"repo":{"id":37227549,"name":"yasite","full_name":"olimart/yasite","owner":{"login":"olimart","id":547754,"avatar_url":"https://avatars.githubusercontent.com/u/547754?v=3","gravatar_id":"","url":"https://api.github.com/users/olimart","html_url":"https://github.com/olimart","followers_url":"https://api.github.com/users/olimart/followers","following_url":"https://api.github.com/users/olimart/following{/other_user}","gists_url":"https://api.github.com/users/olimart/gists{/gist_id}","starred_url":"https://api.github.com/users/olimart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olimart/subscriptions","organizations_url":"https://api.github.com/users/olimart/orgs","repos_url":"https://api.github.com/users/olimart/repos","events_url":"https://api.github.com/users/olimart/events{/privacy}","received_events_url":"https://api.github.com/users/olimart/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/olimart/yasite","description":null,"fork":false,"url":"https://api.github.com/repos/olimart/yasite","forks_url":"https://api.github.com/repos/olimart/yasite/forks","keys_url":"https://api.github.com/repos/olimart/yasite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/olimart/yasite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/olimart/yasite/teams","hooks_url":"https://api.github.com/repos/olimart/yasite/hooks","issue_events_url":"https://api.github.com/repos/olimart/yasite/issues/events{/number}","events_url":"https://api.github.com/repos/olimart/yasite/events","assignees_url":"https://api.github.com/repos/olimart/yasite/assignees{/user}","branches_url":"https://api.github.com/repos/olimart/yasite/branches{/branch}","tags_url":"https://api.github.com/repos/olimart/yasite/tags","blobs_url":"https://api.github.com/repos/olimart/yasite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/olimart/yasite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/olimart/yasite/git/refs{/sha}","trees_url":"https://api.github.com/repos/olimart/yasite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/olimart/yasite/statuses/{sha}","languages_url":"https://api.github.com/repos/olimart/yasite/languages","stargazers_url":"https://api.github.com/repos/olimart/yasite/stargazers","contributors_url":"https://api.github.com/repos/olimart/yasite/contributors","subscribers_url":"https://api.github.com/repos/olimart/yasite/subscribers","subscription_url":"https://api.github.com/repos/olimart/yasite/subscription","commits_url":"https://api.github.com/repos/olimart/yasite/commits{/sha}","git_commits_url":"https://api.github.com/repos/olimart/yasite/git/commits{/sha}","comments_url":"https://api.github.com/repos/olimart/yasite/comments{/number}","issue_comment_url":"https://api.github.com/repos/olimart/yasite/issues/comments{/number}","contents_url":"https://api.github.com/repos/olimart/yasite/contents/{+path}","compare_url":"https://api.github.com/repos/olimart/yasite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/olimart/yasite/merges","archive_url":"https://api.github.com/repos/olimart/yasite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/olimart/yasite/downloads","issues_url":"https://api.github.com/repos/olimart/yasite/issues{/number}","pulls_url":"https://api.github.com/repos/olimart/yasite/pulls{/number}","milestones_url":"https://api.github.com/repos/olimart/yasite/milestones{/number}","notifications_url":"https://api.github.com/repos/olimart/yasite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/olimart/yasite/labels{/name}","releases_url":"https://api.github.com/repos/olimart/yasite/releases{/id}","created_at":"2015-06-10T23:11:34Z","updated_at":"2015-06-10T23:11:37Z","pushed_at":"2015-06-17T02:05:56Z","git_url":"git://github.com/olimart/yasite.git","ssh_url":"git@github.com:olimart/yasite.git","clone_url":"https://github.com/olimart/yasite.git","svn_url":"https://github.com/olimart/yasite","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/olimart/yasite/pulls/5"},"html":{"href":"https://github.com/olimart/yasite/pull/5"},"issue":{"href":"https://api.github.com/repos/olimart/yasite/issues/5"},"comments":{"href":"https://api.github.com/repos/olimart/yasite/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/olimart/yasite/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/olimart/yasite/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/olimart/yasite/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/olimart/yasite/statuses/9e14ee91abd2a8aff833905176fec92bd211e1a2"}}}}