{"action":"created","comment":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/28089251","id":28089251,"diff_hunk":"@@ -1,5 +1,42 @@\n /** TODO(bjordan): Move this all into StudioApps */\n $(window).load(function () {\n+  $.widget(\"custom.coloriconselectmenu\", $.ui.selectmenu, {\n+    /**\n+     * Override the jQuery selectmenu to add a color square icon driven by the\n+     * data-color attribute on select elements.\n+     * @param ul\n+     * @param item\n+     * @returns {*}\n+     * @private\n+     */\n+    _renderItem: function (ul, item) {\n+      var li = $(\"<li>\", {text: item.label});\n+      var color = item.element.attr(\"data-color\");\n+      makeColorSquareIcon(color).appendTo(li);\n+      return li.appendTo(ul);\n+    },\n+    styleCurrentValue: function () {\n+      styleButton(this.element);\n+    }\n+  });\n+\n+  function bgColorStyle(color) {\n+    return \"background-color: \" + color;\n+  }\n+\n+  function styleButton(selectElement) {\n+    var selectedColor = $(selectElement).find(\"option:selected\").attr(\"data-color\");\n+    var hiddenSelectMenuBtn = \"#\" + $(selectElement).attr(\"id\") + \"-button .ui-selectmenu-text\";","path":"dashboard/app/assets/javascripts/levels/contract_match.js.jsx","position":null,"original_position":29,"commit_id":"d67f3a45dea8511546aeb4b78f80f95daefe865f","original_commit_id":"0d948ab301f4739dd55dee318c00621004732211","user":{"login":"Bjvanminnen","id":1767466,"avatar_url":"https://avatars.githubusercontent.com/u/1767466?v=3","gravatar_id":"","url":"https://api.github.com/users/Bjvanminnen","html_url":"https://github.com/Bjvanminnen","followers_url":"https://api.github.com/users/Bjvanminnen/followers","following_url":"https://api.github.com/users/Bjvanminnen/following{/other_user}","gists_url":"https://api.github.com/users/Bjvanminnen/gists{/gist_id}","starred_url":"https://api.github.com/users/Bjvanminnen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bjvanminnen/subscriptions","organizations_url":"https://api.github.com/users/Bjvanminnen/orgs","repos_url":"https://api.github.com/users/Bjvanminnen/repos","events_url":"https://api.github.com/users/Bjvanminnen/events{/privacy}","received_events_url":"https://api.github.com/users/Bjvanminnen/received_events","type":"User","site_admin":false},"body":"I might put this string inside the $(). The variable name makes me expect to have a button object, not a string that is a selector to get a button object.","created_at":"2015-04-09T18:32:59Z","updated_at":"2015-04-09T18:32:59Z","html_url":"https://github.com/code-dot-org/code-dot-org/pull/1996#discussion_r28089251","pull_request_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1996","_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/28089251"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/1996#discussion_r28089251"},"pull_request":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1996"}}},"pull_request":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1996","id":32982063,"html_url":"https://github.com/code-dot-org/code-dot-org/pull/1996","diff_url":"https://github.com/code-dot-org/code-dot-org/pull/1996.diff","patch_url":"https://github.com/code-dot-org/code-dot-org/pull/1996.patch","issue_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/1996","number":1996,"state":"open","locked":false,"title":"Add color box to contract assessment dropdown button & dropdown [finishes #89659872]","user":{"login":"bcjordan","id":206973,"avatar_url":"https://avatars.githubusercontent.com/u/206973?v=3","gravatar_id":"","url":"https://api.github.com/users/bcjordan","html_url":"https://github.com/bcjordan","followers_url":"https://api.github.com/users/bcjordan/followers","following_url":"https://api.github.com/users/bcjordan/following{/other_user}","gists_url":"https://api.github.com/users/bcjordan/gists{/gist_id}","starred_url":"https://api.github.com/users/bcjordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcjordan/subscriptions","organizations_url":"https://api.github.com/users/bcjordan/orgs","repos_url":"https://api.github.com/users/bcjordan/repos","events_url":"https://api.github.com/users/bcjordan/events{/privacy}","received_events_url":"https://api.github.com/users/bcjordan/received_events","type":"User","site_admin":false},"body":"![contract_match_colors](https://cloud.githubusercontent.com/assets/206973/7073762/93cc1cfa-deaa-11e4-8d02-a53b562d7a29.gif)\r\n","created_at":"2015-04-09T18:21:48Z","updated_at":"2015-04-09T18:32:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cde8369ac5350492e173f166df19f5c181c85a7c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1996/commits","review_comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1996/comments","review_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/1996/comments","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/d67f3a45dea8511546aeb4b78f80f95daefe865f","head":{"label":"code-dot-org:contract_assessment_color_box","ref":"contract_assessment_color_box","sha":"d67f3a45dea8511546aeb4b78f80f95daefe865f","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","created_at":"2014-09-20T00:46:11Z","updated_at":"2015-04-09T17:55:47Z","pushed_at":"2015-04-09T18:31:59Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":1908397,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":22,"forks":24,"open_issues":22,"watchers":32,"default_branch":"staging"}},"base":{"label":"code-dot-org:staging","ref":"staging","sha":"1a0d58f9af4f7eeec3b4f5790771cfe2d5776a94","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","created_at":"2014-09-20T00:46:11Z","updated_at":"2015-04-09T17:55:47Z","pushed_at":"2015-04-09T18:31:59Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":1908397,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":22,"forks":24,"open_issues":22,"watchers":32,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1996"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/1996"},"issue":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/1996"},"comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/1996/comments"},"review_comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1996/comments"},"review_comment":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1996/commits"},"statuses":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/d67f3a45dea8511546aeb4b78f80f95daefe865f"}}}}