{"action":"created","comment":{"url":"https://api.github.com/repos/thelounge/lounge/pulls/comments/92950553","pull_request_review_id":13472138,"id":92950553,"diff_hunk":"@@ -1269,45 +1269,65 @@ $(function() {\n \t\tforms.find(\".username\").val(nick);\n \t});\n \n-\tMousetrap.bind([\n-\t\t\"command+up\",\n-\t\t\"command+down\",\n-\t\t\"ctrl+up\",\n-\t\t\"ctrl+down\"\n-\t], function(e, keys) {\n-\t\tvar channels = sidebar.find(\".chan\");\n-\t\tvar index = channels.index(channels.filter(\".active\"));\n-\t\tvar direction = keys.split(\"+\").pop();\n-\t\tswitch (direction) {\n-\t\tcase \"up\":\n-\t\t\t// Loop\n-\t\t\tvar upTarget = (channels.length + (index - 1 + channels.length)) % channels.length;\n-\t\t\tchannels.eq(upTarget).click();\n-\t\t\tbreak;\n+\t(function HotkeysScope() {\n+\t\tMousetrap.bind([\n+\t\t\t\"command+up\",\n+\t\t\t\"command+down\",\n+\t\t\t\"ctrl+up\",\n+\t\t\t\"ctrl+down\"\n+\t\t], function(e, keys) {\n+\t\t\tvar channels = sidebar.find(\".chan\");\n+\t\t\tvar index = channels.index(channels.filter(\".active\"));\n+\t\t\tvar direction = keys.split(\"+\").pop();\n+\t\t\tswitch (direction) {\n+\t\t\tcase \"up\":\n+\t\t\t\t// Loop\n+\t\t\t\tvar upTarget = (channels.length + (index - 1 + channels.length)) % channels.length;\n+\t\t\t\tchannels.eq(upTarget).click();\n+\t\t\t\tbreak;\n+\n+\t\t\tcase \"down\":\n+\t\t\t\t// Loop\n+\t\t\t\tvar downTarget = (channels.length + (index + 1 + channels.length)) % channels.length;\n+\t\t\t\tchannels.eq(downTarget).click();\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t});\n \n-\t\tcase \"down\":\n-\t\t\t// Loop\n-\t\t\tvar downTarget = (channels.length + (index + 1 + channels.length)) % channels.length;\n-\t\t\tchannels.eq(downTarget).click();\n-\t\t\tbreak;\n-\t\t}\n-\t});\n+\t\tMousetrap.bind([\n+\t\t\t\"command+k\",\n+\t\t\t\"ctrl+shift+l\"\n+\t\t], function(e) {\n+\t\t\tif (e.target === input[0]) {\n+\t\t\t\tclear();\n+\t\t\t\te.preventDefault();\n+\t\t\t}\n+\t\t});\n \n-\tMousetrap.bind([\n-\t\t\"command+k\",\n-\t\t\"ctrl+shift+l\"\n-\t], function(e) {\n-\t\tif (e.target === input[0]) {\n-\t\t\tclear();\n-\t\t\te.preventDefault();\n-\t\t}\n-\t});\n+\t\tMousetrap.bind([\n+\t\t\t\"escape\"\n+\t\t], function() {\n+\t\t\tcontextMenuContainer.hide();\n+\t\t});\n \n-\tMousetrap.bind([\n-\t\t\"escape\"\n-\t], function() {\n-\t\tcontextMenuContainer.hide();\n-\t});\n+\t\tvar colorsHotkeys = {\n+\t\t\tk: \"\\x03\",","path":"client/js/lounge.js","position":82,"original_position":82,"commit_id":"5c191774b53b84bd6c3a514937b53cd136a1e0cf","original_commit_id":"5c191774b53b84bd6c3a514937b53cd136a1e0cf","user":{"login":"astorije","id":113730,"avatar_url":"https://avatars.githubusercontent.com/u/113730?v=3","gravatar_id":"","url":"https://api.github.com/users/astorije","html_url":"https://github.com/astorije","followers_url":"https://api.github.com/users/astorije/followers","following_url":"https://api.github.com/users/astorije/following{/other_user}","gists_url":"https://api.github.com/users/astorije/gists{/gist_id}","starred_url":"https://api.github.com/users/astorije/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astorije/subscriptions","organizations_url":"https://api.github.com/users/astorije/orgs","repos_url":"https://api.github.com/users/astorije/repos","events_url":"https://api.github.com/users/astorije/events{/privacy}","received_events_url":"https://api.github.com/users/astorije/received_events","type":"User","site_admin":false},"body":"`command+k` is already used by clearing the screen on macOS (see L1298)... I don't want us to clearing this to `command+l` because it focuses the URL bar, which is immensely useful.\r\nAny other hot key we can use for colors?","created_at":"2016-12-18T21:02:21Z","updated_at":"2016-12-18T21:02:46Z","html_url":"https://github.com/thelounge/lounge/pull/810#discussion_r92950553","pull_request_url":"https://api.github.com/repos/thelounge/lounge/pulls/810","_links":{"self":{"href":"https://api.github.com/repos/thelounge/lounge/pulls/comments/92950553"},"html":{"href":"https://github.com/thelounge/lounge/pull/810#discussion_r92950553"},"pull_request":{"href":"https://api.github.com/repos/thelounge/lounge/pulls/810"}}},"pull_request":{"url":"https://api.github.com/repos/thelounge/lounge/pulls/810","id":98454114,"html_url":"https://github.com/thelounge/lounge/pull/810","diff_url":"https://github.com/thelounge/lounge/pull/810.diff","patch_url":"https://github.com/thelounge/lounge/pull/810.patch","issue_url":"https://api.github.com/repos/thelounge/lounge/issues/810","number":810,"state":"open","locked":false,"title":"Implement color hotkeys","user":{"login":"xPaw","id":613331,"avatar_url":"https://avatars.githubusercontent.com/u/613331?v=3","gravatar_id":"","url":"https://api.github.com/users/xPaw","html_url":"https://github.com/xPaw","followers_url":"https://api.github.com/users/xPaw/followers","following_url":"https://api.github.com/users/xPaw/following{/other_user}","gists_url":"https://api.github.com/users/xPaw/gists{/gist_id}","starred_url":"https://api.github.com/users/xPaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xPaw/subscriptions","organizations_url":"https://api.github.com/users/xPaw/orgs","repos_url":"https://api.github.com/users/xPaw/repos","events_url":"https://api.github.com/users/xPaw/events{/privacy}","received_events_url":"https://api.github.com/users/xPaw/received_events","type":"User","site_admin":false},"body":"Same key bindings as http://www.ircbeginner.com/ircinfo/colors.html\r\n\r\nEven though the characters are invisible (in Chrome at least), it's still useful as an initial implementation.\r\n\r\nI moved all hotkey bindings into their own scope (add `?w=1` to url for saner diff)","created_at":"2016-12-17T20:03:53Z","updated_at":"2016-12-18T21:02:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8924e0d77153a8a7056b6248ad33d4d83d94effd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/thelounge/lounge/pulls/810/commits","review_comments_url":"https://api.github.com/repos/thelounge/lounge/pulls/810/comments","review_comment_url":"https://api.github.com/repos/thelounge/lounge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thelounge/lounge/issues/810/comments","statuses_url":"https://api.github.com/repos/thelounge/lounge/statuses/5c191774b53b84bd6c3a514937b53cd136a1e0cf","head":{"label":"thelounge:xpaw/color-hotkeys","ref":"xpaw/color-hotkeys","sha":"5c191774b53b84bd6c3a514937b53cd136a1e0cf","user":{"login":"thelounge","id":14336958,"avatar_url":"https://avatars.githubusercontent.com/u/14336958?v=3","gravatar_id":"","url":"https://api.github.com/users/thelounge","html_url":"https://github.com/thelounge","followers_url":"https://api.github.com/users/thelounge/followers","following_url":"https://api.github.com/users/thelounge/following{/other_user}","gists_url":"https://api.github.com/users/thelounge/gists{/gist_id}","starred_url":"https://api.github.com/users/thelounge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelounge/subscriptions","organizations_url":"https://api.github.com/users/thelounge/orgs","repos_url":"https://api.github.com/users/thelounge/repos","events_url":"https://api.github.com/users/thelounge/events{/privacy}","received_events_url":"https://api.github.com/users/thelounge/received_events","type":"Organization","site_admin":false},"repo":{"id":51344082,"name":"lounge","full_name":"thelounge/lounge","owner":{"login":"thelounge","id":14336958,"avatar_url":"https://avatars.githubusercontent.com/u/14336958?v=3","gravatar_id":"","url":"https://api.github.com/users/thelounge","html_url":"https://github.com/thelounge","followers_url":"https://api.github.com/users/thelounge/followers","following_url":"https://api.github.com/users/thelounge/following{/other_user}","gists_url":"https://api.github.com/users/thelounge/gists{/gist_id}","starred_url":"https://api.github.com/users/thelounge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelounge/subscriptions","organizations_url":"https://api.github.com/users/thelounge/orgs","repos_url":"https://api.github.com/users/thelounge/repos","events_url":"https://api.github.com/users/thelounge/events{/privacy}","received_events_url":"https://api.github.com/users/thelounge/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thelounge/lounge","description":"The Lounge — Self-hosted web IRC client","fork":false,"url":"https://api.github.com/repos/thelounge/lounge","forks_url":"https://api.github.com/repos/thelounge/lounge/forks","keys_url":"https://api.github.com/repos/thelounge/lounge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thelounge/lounge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thelounge/lounge/teams","hooks_url":"https://api.github.com/repos/thelounge/lounge/hooks","issue_events_url":"https://api.github.com/repos/thelounge/lounge/issues/events{/number}","events_url":"https://api.github.com/repos/thelounge/lounge/events","assignees_url":"https://api.github.com/repos/thelounge/lounge/assignees{/user}","branches_url":"https://api.github.com/repos/thelounge/lounge/branches{/branch}","tags_url":"https://api.github.com/repos/thelounge/lounge/tags","blobs_url":"https://api.github.com/repos/thelounge/lounge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thelounge/lounge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thelounge/lounge/git/refs{/sha}","trees_url":"https://api.github.com/repos/thelounge/lounge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thelounge/lounge/statuses/{sha}","languages_url":"https://api.github.com/repos/thelounge/lounge/languages","stargazers_url":"https://api.github.com/repos/thelounge/lounge/stargazers","contributors_url":"https://api.github.com/repos/thelounge/lounge/contributors","subscribers_url":"https://api.github.com/repos/thelounge/lounge/subscribers","subscription_url":"https://api.github.com/repos/thelounge/lounge/subscription","commits_url":"https://api.github.com/repos/thelounge/lounge/commits{/sha}","git_commits_url":"https://api.github.com/repos/thelounge/lounge/git/commits{/sha}","comments_url":"https://api.github.com/repos/thelounge/lounge/comments{/number}","issue_comment_url":"https://api.github.com/repos/thelounge/lounge/issues/comments{/number}","contents_url":"https://api.github.com/repos/thelounge/lounge/contents/{+path}","compare_url":"https://api.github.com/repos/thelounge/lounge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thelounge/lounge/merges","archive_url":"https://api.github.com/repos/thelounge/lounge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thelounge/lounge/downloads","issues_url":"https://api.github.com/repos/thelounge/lounge/issues{/number}","pulls_url":"https://api.github.com/repos/thelounge/lounge/pulls{/number}","milestones_url":"https://api.github.com/repos/thelounge/lounge/milestones{/number}","notifications_url":"https://api.github.com/repos/thelounge/lounge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thelounge/lounge/labels{/name}","releases_url":"https://api.github.com/repos/thelounge/lounge/releases{/id}","deployments_url":"https://api.github.com/repos/thelounge/lounge/deployments","created_at":"2016-02-09T03:16:03Z","updated_at":"2016-12-18T18:33:48Z","pushed_at":"2016-12-18T16:19:13Z","git_url":"git://github.com/thelounge/lounge.git","ssh_url":"git@github.com:thelounge/lounge.git","clone_url":"https://github.com/thelounge/lounge.git","svn_url":"https://github.com/thelounge/lounge","homepage":"https://thelounge.github.io","size":5706,"stargazers_count":852,"watchers_count":852,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":129,"mirror_url":null,"open_issues_count":178,"forks":129,"open_issues":178,"watchers":852,"default_branch":"master"}},"base":{"label":"thelounge:master","ref":"master","sha":"3c8179fda12bb2ad6d6a2962788ae608835ffc85","user":{"login":"thelounge","id":14336958,"avatar_url":"https://avatars.githubusercontent.com/u/14336958?v=3","gravatar_id":"","url":"https://api.github.com/users/thelounge","html_url":"https://github.com/thelounge","followers_url":"https://api.github.com/users/thelounge/followers","following_url":"https://api.github.com/users/thelounge/following{/other_user}","gists_url":"https://api.github.com/users/thelounge/gists{/gist_id}","starred_url":"https://api.github.com/users/thelounge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelounge/subscriptions","organizations_url":"https://api.github.com/users/thelounge/orgs","repos_url":"https://api.github.com/users/thelounge/repos","events_url":"https://api.github.com/users/thelounge/events{/privacy}","received_events_url":"https://api.github.com/users/thelounge/received_events","type":"Organization","site_admin":false},"repo":{"id":51344082,"name":"lounge","full_name":"thelounge/lounge","owner":{"login":"thelounge","id":14336958,"avatar_url":"https://avatars.githubusercontent.com/u/14336958?v=3","gravatar_id":"","url":"https://api.github.com/users/thelounge","html_url":"https://github.com/thelounge","followers_url":"https://api.github.com/users/thelounge/followers","following_url":"https://api.github.com/users/thelounge/following{/other_user}","gists_url":"https://api.github.com/users/thelounge/gists{/gist_id}","starred_url":"https://api.github.com/users/thelounge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelounge/subscriptions","organizations_url":"https://api.github.com/users/thelounge/orgs","repos_url":"https://api.github.com/users/thelounge/repos","events_url":"https://api.github.com/users/thelounge/events{/privacy}","received_events_url":"https://api.github.com/users/thelounge/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thelounge/lounge","description":"The Lounge — Self-hosted web IRC client","fork":false,"url":"https://api.github.com/repos/thelounge/lounge","forks_url":"https://api.github.com/repos/thelounge/lounge/forks","keys_url":"https://api.github.com/repos/thelounge/lounge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thelounge/lounge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thelounge/lounge/teams","hooks_url":"https://api.github.com/repos/thelounge/lounge/hooks","issue_events_url":"https://api.github.com/repos/thelounge/lounge/issues/events{/number}","events_url":"https://api.github.com/repos/thelounge/lounge/events","assignees_url":"https://api.github.com/repos/thelounge/lounge/assignees{/user}","branches_url":"https://api.github.com/repos/thelounge/lounge/branches{/branch}","tags_url":"https://api.github.com/repos/thelounge/lounge/tags","blobs_url":"https://api.github.com/repos/thelounge/lounge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thelounge/lounge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thelounge/lounge/git/refs{/sha}","trees_url":"https://api.github.com/repos/thelounge/lounge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thelounge/lounge/statuses/{sha}","languages_url":"https://api.github.com/repos/thelounge/lounge/languages","stargazers_url":"https://api.github.com/repos/thelounge/lounge/stargazers","contributors_url":"https://api.github.com/repos/thelounge/lounge/contributors","subscribers_url":"https://api.github.com/repos/thelounge/lounge/subscribers","subscription_url":"https://api.github.com/repos/thelounge/lounge/subscription","commits_url":"https://api.github.com/repos/thelounge/lounge/commits{/sha}","git_commits_url":"https://api.github.com/repos/thelounge/lounge/git/commits{/sha}","comments_url":"https://api.github.com/repos/thelounge/lounge/comments{/number}","issue_comment_url":"https://api.github.com/repos/thelounge/lounge/issues/comments{/number}","contents_url":"https://api.github.com/repos/thelounge/lounge/contents/{+path}","compare_url":"https://api.github.com/repos/thelounge/lounge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thelounge/lounge/merges","archive_url":"https://api.github.com/repos/thelounge/lounge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thelounge/lounge/downloads","issues_url":"https://api.github.com/repos/thelounge/lounge/issues{/number}","pulls_url":"https://api.github.com/repos/thelounge/lounge/pulls{/number}","milestones_url":"https://api.github.com/repos/thelounge/lounge/milestones{/number}","notifications_url":"https://api.github.com/repos/thelounge/lounge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thelounge/lounge/labels{/name}","releases_url":"https://api.github.com/repos/thelounge/lounge/releases{/id}","deployments_url":"https://api.github.com/repos/thelounge/lounge/deployments","created_at":"2016-02-09T03:16:03Z","updated_at":"2016-12-18T18:33:48Z","pushed_at":"2016-12-18T16:19:13Z","git_url":"git://github.com/thelounge/lounge.git","ssh_url":"git@github.com:thelounge/lounge.git","clone_url":"https://github.com/thelounge/lounge.git","svn_url":"https://github.com/thelounge/lounge","homepage":"https://thelounge.github.io","size":5706,"stargazers_count":852,"watchers_count":852,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":129,"mirror_url":null,"open_issues_count":178,"forks":129,"open_issues":178,"watchers":852,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thelounge/lounge/pulls/810"},"html":{"href":"https://github.com/thelounge/lounge/pull/810"},"issue":{"href":"https://api.github.com/repos/thelounge/lounge/issues/810"},"comments":{"href":"https://api.github.com/repos/thelounge/lounge/issues/810/comments"},"review_comments":{"href":"https://api.github.com/repos/thelounge/lounge/pulls/810/comments"},"review_comment":{"href":"https://api.github.com/repos/thelounge/lounge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thelounge/lounge/pulls/810/commits"},"statuses":{"href":"https://api.github.com/repos/thelounge/lounge/statuses/5c191774b53b84bd6c3a514937b53cd136a1e0cf"}}}}
{"actor":{"display_login":"astorije"}}