{"action":"created","comment":{"url":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls/comments/23246302","id":23246302,"diff_hunk":"@@ -0,0 +1,21 @@\n+/* Javascript for ForumLeaderboardXBlock. */\n+function ForumLeaderboardStudioXBlock(runtime, element) {\n+    $('.save-button', element).bind('click', function() {\n+        var handlerUrl = runtime.handlerUrl(element, 'studio_submit');\n+        var data = {\n+            discussion_id: $(element).find('input[name=discussion_id]').val(),\n+            count: $(element).find('input[name=count]').val()\n+        };\n+        $.post(handlerUrl, JSON.stringify(data)).success(function(response) {\n+            if (response['success']) {\n+                window.location.reload(false);\n+                return\n+            }\n+            alert(response['errors'].join('\\n'));","path":"forum_leaderboard/static/js/src/forum_leaderboard_studio.js","position":14,"original_position":14,"commit_id":"3f4fe1e7be49a6b6b34e89c842258d49bc14c032","original_commit_id":"3f4fe1e7be49a6b6b34e89c842258d49bc14c032","user":{"login":"Kelketek","id":1099483,"avatar_url":"https://avatars.githubusercontent.com/u/1099483?v=3","gravatar_id":"","url":"https://api.github.com/users/Kelketek","html_url":"https://github.com/Kelketek","followers_url":"https://api.github.com/users/Kelketek/followers","following_url":"https://api.github.com/users/Kelketek/following{/other_user}","gists_url":"https://api.github.com/users/Kelketek/gists{/gist_id}","starred_url":"https://api.github.com/users/Kelketek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kelketek/subscriptions","organizations_url":"https://api.github.com/users/Kelketek/orgs","repos_url":"https://api.github.com/users/Kelketek/repos","events_url":"https://api.github.com/users/Kelketek/events{/privacy}","received_events_url":"https://api.github.com/users/Kelketek/received_events","type":"User","site_admin":false},"body":"@bradenmacdonald The actual source code for this appears to be in `cms/static/coffee/src/xblock/cms.runtime.v1.coffee`, and there's also an `error` function. I'm adding these changes to my latest version of the poll XBlock if you want an example of how to use the Error function. This should be available later today.","created_at":"2015-01-20T19:06:57Z","updated_at":"2015-01-20T19:06:57Z","html_url":"https://github.com/open-craft/xblock-leaderboard/pull/2#discussion_r23246302","pull_request_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls/comments/23246302"},"html":{"href":"https://github.com/open-craft/xblock-leaderboard/pull/2#discussion_r23246302"},"pull_request":{"href":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls/2","id":27619453,"html_url":"https://github.com/open-craft/xblock-leaderboard/pull/2","diff_url":"https://github.com/open-craft/xblock-leaderboard/pull/2.diff","patch_url":"https://github.com/open-craft/xblock-leaderboard/pull/2.patch","issue_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/issues/2","number":2,"state":"open","locked":false,"title":"Polish XBlock Leaderboard","user":{"login":"Kelketek","id":1099483,"avatar_url":"https://avatars.githubusercontent.com/u/1099483?v=3","gravatar_id":"","url":"https://api.github.com/users/Kelketek","html_url":"https://github.com/Kelketek","followers_url":"https://api.github.com/users/Kelketek/followers","following_url":"https://api.github.com/users/Kelketek/following{/other_user}","gists_url":"https://api.github.com/users/Kelketek/gists{/gist_id}","starred_url":"https://api.github.com/users/Kelketek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kelketek/subscriptions","organizations_url":"https://api.github.com/users/Kelketek/orgs","repos_url":"https://api.github.com/users/Kelketek/repos","events_url":"https://api.github.com/users/Kelketek/events{/privacy}","received_events_url":"https://api.github.com/users/Kelketek/received_events","type":"User","site_admin":false},"body":"This PR adds to the Leaderboard XBlock:\r\n\r\n1. A studio view\r\n2. Tests\r\n3. A readme\r\n4. Links to each thread and a display of the username.\r\n5. Minimal, but present, styling","created_at":"2015-01-19T16:39:37Z","updated_at":"2015-01-20T19:06:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c71d5a5c6e6d11324de993866fa2f3bfe6c2cee","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls/2/commits","review_comments_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls/2/comments","review_comment_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls/comments/{number}","comments_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/issues/2/comments","statuses_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/statuses/3f4fe1e7be49a6b6b34e89c842258d49bc14c032","head":{"label":"open-craft:sprint_surplus","ref":"sprint_surplus","sha":"3f4fe1e7be49a6b6b34e89c842258d49bc14c032","user":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"repo":{"id":29268710,"name":"xblock-leaderboard","full_name":"open-craft/xblock-leaderboard","owner":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-craft/xblock-leaderboard","description":"An XBlock for displaying the top voted threads in an inline discussion.","fork":false,"url":"https://api.github.com/repos/open-craft/xblock-leaderboard","forks_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/forks","keys_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/teams","hooks_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/hooks","issue_events_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/issues/events{/number}","events_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/events","assignees_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/assignees{/user}","branches_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/branches{/branch}","tags_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/tags","blobs_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/statuses/{sha}","languages_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/languages","stargazers_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/stargazers","contributors_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/contributors","subscribers_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/subscribers","subscription_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/subscription","commits_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/issues/comments/{number}","contents_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/contents/{+path}","compare_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/merges","archive_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/downloads","issues_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/issues{/number}","pulls_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls{/number}","milestones_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/milestones{/number}","notifications_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/labels{/name}","releases_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/releases{/id}","created_at":"2015-01-14T22:18:53Z","updated_at":"2015-01-19T13:10:31Z","pushed_at":"2015-01-20T05:04:27Z","git_url":"git://github.com/open-craft/xblock-leaderboard.git","ssh_url":"git@github.com:open-craft/xblock-leaderboard.git","clone_url":"https://github.com/open-craft/xblock-leaderboard.git","svn_url":"https://github.com/open-craft/xblock-leaderboard","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"open-craft:master","ref":"master","sha":"5131c168b751b8dbdb74281785748dc3febdbec6","user":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"repo":{"id":29268710,"name":"xblock-leaderboard","full_name":"open-craft/xblock-leaderboard","owner":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-craft/xblock-leaderboard","description":"An XBlock for displaying the top voted threads in an inline discussion.","fork":false,"url":"https://api.github.com/repos/open-craft/xblock-leaderboard","forks_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/forks","keys_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/teams","hooks_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/hooks","issue_events_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/issues/events{/number}","events_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/events","assignees_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/assignees{/user}","branches_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/branches{/branch}","tags_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/tags","blobs_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/statuses/{sha}","languages_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/languages","stargazers_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/stargazers","contributors_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/contributors","subscribers_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/subscribers","subscription_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/subscription","commits_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/issues/comments/{number}","contents_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/contents/{+path}","compare_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/merges","archive_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/downloads","issues_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/issues{/number}","pulls_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls{/number}","milestones_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/milestones{/number}","notifications_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/labels{/name}","releases_url":"https://api.github.com/repos/open-craft/xblock-leaderboard/releases{/id}","created_at":"2015-01-14T22:18:53Z","updated_at":"2015-01-19T13:10:31Z","pushed_at":"2015-01-20T05:04:27Z","git_url":"git://github.com/open-craft/xblock-leaderboard.git","ssh_url":"git@github.com:open-craft/xblock-leaderboard.git","clone_url":"https://github.com/open-craft/xblock-leaderboard.git","svn_url":"https://github.com/open-craft/xblock-leaderboard","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls/2"},"html":{"href":"https://github.com/open-craft/xblock-leaderboard/pull/2"},"issue":{"href":"https://api.github.com/repos/open-craft/xblock-leaderboard/issues/2"},"comments":{"href":"https://api.github.com/repos/open-craft/xblock-leaderboard/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/open-craft/xblock-leaderboard/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/open-craft/xblock-leaderboard/statuses/3f4fe1e7be49a6b6b34e89c842258d49bc14c032"}}}}