{"action":"created","comment":{"url":"https://api.github.com/repos/zulip/zulip/pulls/comments/56768052","id":56768052,"diff_hunk":"@@ -408,6 +432,51 @@ exports.setup_page = function () {\n             }\n         });\n     });\n+\n+    $('.admin_emoji_table').on('click', '.delete', function (e) {\n+        e.preventDefault();\n+        e.stopPropagation();\n+        var btn = $(this);\n+\n+        channel.del({\n+            url: '/json/realm/emoji/' + encodeURIComponent(btn.attr('data-emoji-name')),\n+            error: function (xhr, error_type) {\n+                if (xhr.status.toString().charAt(0) === \"4\") {\n+                    btn.closest(\"td\").html(\n+                        $(\"<p>\").addClass(\"text-error\").text($.parseJSON(xhr.responseText).msg)\n+                    );\n+                } else {\n+                     btn.text(\"Failed!\");\n+                }\n+            },\n+            success: function () {\n+                var row = btn.parents('tr');\n+                row.remove();\n+            }\n+        });\n+    });\n+\n+    $(\".administration\").on(\"submit\", \"form.admin-emoji-form\", function (e) {\n+        e.preventDefault();\n+        e.stopPropagation();\n+        var emoji_status = $('#admin-emoji-status');\n+        var emoji_table = $('.admin_emoji_table');\n+        var emoji = {};\n+        $(this).serializeArray().map(function(x){emoji[x.name] = x.value;});\n+\n+        channel.put({\n+            url: \"/json/realm/emoji\",\n+            data: $(this).serialize(),","path":"static/js/admin.js","position":96,"original_position":96,"commit_id":"bb35240c423c560b6ce8d95e959068de6da41755","original_commit_id":"bb35240c423c560b6ce8d95e959068de6da41755","user":{"login":"blablacio","id":3009538,"avatar_url":"https://avatars.githubusercontent.com/u/3009538?v=3","gravatar_id":"","url":"https://api.github.com/users/blablacio","html_url":"https://github.com/blablacio","followers_url":"https://api.github.com/users/blablacio/followers","following_url":"https://api.github.com/users/blablacio/following{/other_user}","gists_url":"https://api.github.com/users/blablacio/gists{/gist_id}","starred_url":"https://api.github.com/users/blablacio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blablacio/subscriptions","organizations_url":"https://api.github.com/users/blablacio/orgs","repos_url":"https://api.github.com/users/blablacio/repos","events_url":"https://api.github.com/users/blablacio/events{/privacy}","received_events_url":"https://api.github.com/users/blablacio/received_events","type":"User","site_admin":false},"body":"`this` corresponds to the form in this context. It usually yields the element you're binding.\r\nAn excerpt from https://api.jquery.com/on/:\r\n\r\n> When jQuery calls a handler, the this keyword is a reference to the element where the event is being delivered; for directly bound events this is the element where the event was attached and for delegated events this is an element matching selector. (Note that this may not be equal to event.target if the event has bubbled from a descendant element.) To create a jQuery object from the element so that it can be used with jQuery methods, use $( this ).","created_at":"2016-03-20T17:22:12Z","updated_at":"2016-03-20T17:22:12Z","html_url":"https://github.com/zulip/zulip/pull/543#discussion_r56768052","pull_request_url":"https://api.github.com/repos/zulip/zulip/pulls/543","_links":{"self":{"href":"https://api.github.com/repos/zulip/zulip/pulls/comments/56768052"},"html":{"href":"https://github.com/zulip/zulip/pull/543#discussion_r56768052"},"pull_request":{"href":"https://api.github.com/repos/zulip/zulip/pulls/543"}}},"pull_request":{"url":"https://api.github.com/repos/zulip/zulip/pulls/543","id":63205574,"html_url":"https://github.com/zulip/zulip/pull/543","diff_url":"https://github.com/zulip/zulip/pull/543.diff","patch_url":"https://github.com/zulip/zulip/pull/543.patch","issue_url":"https://api.github.com/repos/zulip/zulip/issues/543","number":543,"state":"open","locked":false,"title":"Custom realm emoji","user":{"login":"blablacio","id":3009538,"avatar_url":"https://avatars.githubusercontent.com/u/3009538?v=3","gravatar_id":"","url":"https://api.github.com/users/blablacio","html_url":"https://github.com/blablacio","followers_url":"https://api.github.com/users/blablacio/followers","following_url":"https://api.github.com/users/blablacio/following{/other_user}","gists_url":"https://api.github.com/users/blablacio/gists{/gist_id}","starred_url":"https://api.github.com/users/blablacio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blablacio/subscriptions","organizations_url":"https://api.github.com/users/blablacio/orgs","repos_url":"https://api.github.com/users/blablacio/repos","events_url":"https://api.github.com/users/blablacio/events{/privacy}","received_events_url":"https://api.github.com/users/blablacio/received_events","type":"User","site_admin":false},"body":"Adding some functionality to allow for managing custom realm emoji from admin.","created_at":"2016-03-17T11:04:16Z","updated_at":"2016-03-20T17:22:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3b805a6fb32c3db6886aa3968f4ac91ae57f8fc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zulip/zulip/pulls/543/commits","review_comments_url":"https://api.github.com/repos/zulip/zulip/pulls/543/comments","review_comment_url":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/543/comments","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/bb35240c423c560b6ce8d95e959068de6da41755","head":{"label":"blablacio:custom-realm-emoji","ref":"custom-realm-emoji","sha":"bb35240c423c560b6ce8d95e959068de6da41755","user":{"login":"blablacio","id":3009538,"avatar_url":"https://avatars.githubusercontent.com/u/3009538?v=3","gravatar_id":"","url":"https://api.github.com/users/blablacio","html_url":"https://github.com/blablacio","followers_url":"https://api.github.com/users/blablacio/followers","following_url":"https://api.github.com/users/blablacio/following{/other_user}","gists_url":"https://api.github.com/users/blablacio/gists{/gist_id}","starred_url":"https://api.github.com/users/blablacio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blablacio/subscriptions","organizations_url":"https://api.github.com/users/blablacio/orgs","repos_url":"https://api.github.com/users/blablacio/repos","events_url":"https://api.github.com/users/blablacio/events{/privacy}","received_events_url":"https://api.github.com/users/blablacio/received_events","type":"User","site_admin":false},"repo":{"id":49497841,"name":"zulip","full_name":"blablacio/zulip","owner":{"login":"blablacio","id":3009538,"avatar_url":"https://avatars.githubusercontent.com/u/3009538?v=3","gravatar_id":"","url":"https://api.github.com/users/blablacio","html_url":"https://github.com/blablacio","followers_url":"https://api.github.com/users/blablacio/followers","following_url":"https://api.github.com/users/blablacio/following{/other_user}","gists_url":"https://api.github.com/users/blablacio/gists{/gist_id}","starred_url":"https://api.github.com/users/blablacio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blablacio/subscriptions","organizations_url":"https://api.github.com/users/blablacio/orgs","repos_url":"https://api.github.com/users/blablacio/repos","events_url":"https://api.github.com/users/blablacio/events{/privacy}","received_events_url":"https://api.github.com/users/blablacio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/blablacio/zulip","description":"Zulip server - powerful open source group chat","fork":true,"url":"https://api.github.com/repos/blablacio/zulip","forks_url":"https://api.github.com/repos/blablacio/zulip/forks","keys_url":"https://api.github.com/repos/blablacio/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blablacio/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blablacio/zulip/teams","hooks_url":"https://api.github.com/repos/blablacio/zulip/hooks","issue_events_url":"https://api.github.com/repos/blablacio/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/blablacio/zulip/events","assignees_url":"https://api.github.com/repos/blablacio/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/blablacio/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/blablacio/zulip/tags","blobs_url":"https://api.github.com/repos/blablacio/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blablacio/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blablacio/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/blablacio/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blablacio/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/blablacio/zulip/languages","stargazers_url":"https://api.github.com/repos/blablacio/zulip/stargazers","contributors_url":"https://api.github.com/repos/blablacio/zulip/contributors","subscribers_url":"https://api.github.com/repos/blablacio/zulip/subscribers","subscription_url":"https://api.github.com/repos/blablacio/zulip/subscription","commits_url":"https://api.github.com/repos/blablacio/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/blablacio/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/blablacio/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/blablacio/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/blablacio/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/blablacio/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blablacio/zulip/merges","archive_url":"https://api.github.com/repos/blablacio/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blablacio/zulip/downloads","issues_url":"https://api.github.com/repos/blablacio/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/blablacio/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/blablacio/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/blablacio/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blablacio/zulip/labels{/name}","releases_url":"https://api.github.com/repos/blablacio/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/blablacio/zulip/deployments","created_at":"2016-01-12T12:08:57Z","updated_at":"2016-01-12T12:09:00Z","pushed_at":"2016-03-20T09:23:45Z","git_url":"git://github.com/blablacio/zulip.git","ssh_url":"git@github.com:blablacio/zulip.git","clone_url":"https://github.com/blablacio/zulip.git","svn_url":"https://github.com/blablacio/zulip","homepage":"","size":106611,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"zulip:master","ref":"master","sha":"3e3a22460767d1747d6f16317b6c01ecd54c2ca8","user":{"login":"zulip","id":4921959,"avatar_url":"https://avatars.githubusercontent.com/u/4921959?v=3","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"repo":{"id":43160685,"name":"zulip","full_name":"zulip/zulip","owner":{"login":"zulip","id":4921959,"avatar_url":"https://avatars.githubusercontent.com/u/4921959?v=3","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zulip/zulip","description":"Zulip server - powerful open source group chat","fork":false,"url":"https://api.github.com/repos/zulip/zulip","forks_url":"https://api.github.com/repos/zulip/zulip/forks","keys_url":"https://api.github.com/repos/zulip/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zulip/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zulip/zulip/teams","hooks_url":"https://api.github.com/repos/zulip/zulip/hooks","issue_events_url":"https://api.github.com/repos/zulip/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/zulip/zulip/events","assignees_url":"https://api.github.com/repos/zulip/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/zulip/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/zulip/zulip/tags","blobs_url":"https://api.github.com/repos/zulip/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zulip/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zulip/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/zulip/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/zulip/zulip/languages","stargazers_url":"https://api.github.com/repos/zulip/zulip/stargazers","contributors_url":"https://api.github.com/repos/zulip/zulip/contributors","subscribers_url":"https://api.github.com/repos/zulip/zulip/subscribers","subscription_url":"https://api.github.com/repos/zulip/zulip/subscription","commits_url":"https://api.github.com/repos/zulip/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/zulip/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/zulip/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/zulip/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/zulip/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/zulip/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zulip/zulip/merges","archive_url":"https://api.github.com/repos/zulip/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zulip/zulip/downloads","issues_url":"https://api.github.com/repos/zulip/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/zulip/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/zulip/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/zulip/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zulip/zulip/labels{/name}","releases_url":"https://api.github.com/repos/zulip/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/zulip/zulip/deployments","created_at":"2015-09-25T16:37:25Z","updated_at":"2016-03-20T16:17:36Z","pushed_at":"2016-03-20T17:14:58Z","git_url":"git://github.com/zulip/zulip.git","ssh_url":"git@github.com:zulip/zulip.git","clone_url":"https://github.com/zulip/zulip.git","svn_url":"https://github.com/zulip/zulip","homepage":"","size":111410,"stargazers_count":3760,"watchers_count":3760,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":502,"mirror_url":null,"open_issues_count":216,"forks":502,"open_issues":216,"watchers":3760,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zulip/zulip/pulls/543"},"html":{"href":"https://github.com/zulip/zulip/pull/543"},"issue":{"href":"https://api.github.com/repos/zulip/zulip/issues/543"},"comments":{"href":"https://api.github.com/repos/zulip/zulip/issues/543/comments"},"review_comments":{"href":"https://api.github.com/repos/zulip/zulip/pulls/543/comments"},"review_comment":{"href":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zulip/zulip/pulls/543/commits"},"statuses":{"href":"https://api.github.com/repos/zulip/zulip/statuses/bb35240c423c560b6ce8d95e959068de6da41755"}}}}