{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang-nursery/mdBook/pulls/comments/165955433","pull_request_review_id":93969556,"id":165955433,"diff_hunk":"@@ -455,6 +455,26 @@ function playpen_text(playpen) {\n         }\n     }, { passive: true });\n \n+    document.addEventListener('keydown', function (e) {\n+        if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return; }\n+\n+        switch (e.key) {\n+            case 'F9':\n+                if (html.classList.contains(\"sidebar-hidden\")) {","path":"src/theme/book.js","position":9,"original_position":9,"commit_id":"7a50f7910e7996dedfa3231450f060dbcb247bdf","original_commit_id":"7a50f7910e7996dedfa3231450f060dbcb247bdf","user":{"login":"sorin-davidoi","id":2109702,"avatar_url":"https://avatars1.githubusercontent.com/u/2109702?v=4","gravatar_id":"","url":"https://api.github.com/users/sorin-davidoi","html_url":"https://github.com/sorin-davidoi","followers_url":"https://api.github.com/users/sorin-davidoi/followers","following_url":"https://api.github.com/users/sorin-davidoi/following{/other_user}","gists_url":"https://api.github.com/users/sorin-davidoi/gists{/gist_id}","starred_url":"https://api.github.com/users/sorin-davidoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sorin-davidoi/subscriptions","organizations_url":"https://api.github.com/users/sorin-davidoi/orgs","repos_url":"https://api.github.com/users/sorin-davidoi/repos","events_url":"https://api.github.com/users/sorin-davidoi/events{/privacy}","received_events_url":"https://api.github.com/users/sorin-davidoi/received_events","type":"User","site_admin":false},"body":"Could you extract this into a separate function (since it is the same logic as in the `click` handler)? We could then just call it from the switch and the `click` handler would be\r\n\r\n```js\r\nsidebarToggleButton.addEventListener('click', toggleSidebar);\r\n```","created_at":"2018-02-05T12:13:59Z","updated_at":"2018-02-05T12:13:59Z","html_url":"https://github.com/rust-lang-nursery/mdBook/pull/608#discussion_r165955433","pull_request_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/pulls/608","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/rust-lang-nursery/mdBook/pulls/comments/165955433"},"html":{"href":"https://github.com/rust-lang-nursery/mdBook/pull/608#discussion_r165955433"},"pull_request":{"href":"https://api.github.com/repos/rust-lang-nursery/mdBook/pulls/608"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang-nursery/mdBook/pulls/608","id":167117827,"html_url":"https://github.com/rust-lang-nursery/mdBook/pull/608","diff_url":"https://github.com/rust-lang-nursery/mdBook/pull/608.diff","patch_url":"https://github.com/rust-lang-nursery/mdBook/pull/608.patch","issue_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/issues/608","number":608,"state":"open","locked":false,"title":"WIP: add support for j/k - vi-style navigation","user":{"login":"bmusin","id":9249387,"avatar_url":"https://avatars0.githubusercontent.com/u/9249387?v=4","gravatar_id":"","url":"https://api.github.com/users/bmusin","html_url":"https://github.com/bmusin","followers_url":"https://api.github.com/users/bmusin/followers","following_url":"https://api.github.com/users/bmusin/following{/other_user}","gists_url":"https://api.github.com/users/bmusin/gists{/gist_id}","starred_url":"https://api.github.com/users/bmusin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmusin/subscriptions","organizations_url":"https://api.github.com/users/bmusin/orgs","repos_url":"https://api.github.com/users/bmusin/repos","events_url":"https://api.github.com/users/bmusin/events{/privacy}","received_events_url":"https://api.github.com/users/bmusin/received_events","type":"User","site_admin":false},"body":"I want to add suport for h/l (vi-like), F9 (or something else)\r\nto open/close left navigation panel.\r\n\r\nWhat tags/ids of DOM elments should I manipulate to open/close side panel?","created_at":"2018-02-05T11:18:37Z","updated_at":"2018-02-05T12:13:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e96e29c273281fb09d199603153de95b4749378","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/pulls/608/commits","review_comments_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/pulls/608/comments","review_comment_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/issues/608/comments","statuses_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/statuses/7a50f7910e7996dedfa3231450f060dbcb247bdf","head":{"label":"bmusin:shortcuts","ref":"shortcuts","sha":"7a50f7910e7996dedfa3231450f060dbcb247bdf","user":{"login":"bmusin","id":9249387,"avatar_url":"https://avatars0.githubusercontent.com/u/9249387?v=4","gravatar_id":"","url":"https://api.github.com/users/bmusin","html_url":"https://github.com/bmusin","followers_url":"https://api.github.com/users/bmusin/followers","following_url":"https://api.github.com/users/bmusin/following{/other_user}","gists_url":"https://api.github.com/users/bmusin/gists{/gist_id}","starred_url":"https://api.github.com/users/bmusin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmusin/subscriptions","organizations_url":"https://api.github.com/users/bmusin/orgs","repos_url":"https://api.github.com/users/bmusin/repos","events_url":"https://api.github.com/users/bmusin/events{/privacy}","received_events_url":"https://api.github.com/users/bmusin/received_events","type":"User","site_admin":false},"repo":{"id":118805242,"name":"mdBook","full_name":"bmusin/mdBook","owner":{"login":"bmusin","id":9249387,"avatar_url":"https://avatars0.githubusercontent.com/u/9249387?v=4","gravatar_id":"","url":"https://api.github.com/users/bmusin","html_url":"https://github.com/bmusin","followers_url":"https://api.github.com/users/bmusin/followers","following_url":"https://api.github.com/users/bmusin/following{/other_user}","gists_url":"https://api.github.com/users/bmusin/gists{/gist_id}","starred_url":"https://api.github.com/users/bmusin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmusin/subscriptions","organizations_url":"https://api.github.com/users/bmusin/orgs","repos_url":"https://api.github.com/users/bmusin/repos","events_url":"https://api.github.com/users/bmusin/events{/privacy}","received_events_url":"https://api.github.com/users/bmusin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bmusin/mdBook","description":"Create book from markdown files. Like Gitbook but implemented in Rust","fork":true,"url":"https://api.github.com/repos/bmusin/mdBook","forks_url":"https://api.github.com/repos/bmusin/mdBook/forks","keys_url":"https://api.github.com/repos/bmusin/mdBook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bmusin/mdBook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bmusin/mdBook/teams","hooks_url":"https://api.github.com/repos/bmusin/mdBook/hooks","issue_events_url":"https://api.github.com/repos/bmusin/mdBook/issues/events{/number}","events_url":"https://api.github.com/repos/bmusin/mdBook/events","assignees_url":"https://api.github.com/repos/bmusin/mdBook/assignees{/user}","branches_url":"https://api.github.com/repos/bmusin/mdBook/branches{/branch}","tags_url":"https://api.github.com/repos/bmusin/mdBook/tags","blobs_url":"https://api.github.com/repos/bmusin/mdBook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bmusin/mdBook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bmusin/mdBook/git/refs{/sha}","trees_url":"https://api.github.com/repos/bmusin/mdBook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bmusin/mdBook/statuses/{sha}","languages_url":"https://api.github.com/repos/bmusin/mdBook/languages","stargazers_url":"https://api.github.com/repos/bmusin/mdBook/stargazers","contributors_url":"https://api.github.com/repos/bmusin/mdBook/contributors","subscribers_url":"https://api.github.com/repos/bmusin/mdBook/subscribers","subscription_url":"https://api.github.com/repos/bmusin/mdBook/subscription","commits_url":"https://api.github.com/repos/bmusin/mdBook/commits{/sha}","git_commits_url":"https://api.github.com/repos/bmusin/mdBook/git/commits{/sha}","comments_url":"https://api.github.com/repos/bmusin/mdBook/comments{/number}","issue_comment_url":"https://api.github.com/repos/bmusin/mdBook/issues/comments{/number}","contents_url":"https://api.github.com/repos/bmusin/mdBook/contents/{+path}","compare_url":"https://api.github.com/repos/bmusin/mdBook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bmusin/mdBook/merges","archive_url":"https://api.github.com/repos/bmusin/mdBook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bmusin/mdBook/downloads","issues_url":"https://api.github.com/repos/bmusin/mdBook/issues{/number}","pulls_url":"https://api.github.com/repos/bmusin/mdBook/pulls{/number}","milestones_url":"https://api.github.com/repos/bmusin/mdBook/milestones{/number}","notifications_url":"https://api.github.com/repos/bmusin/mdBook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bmusin/mdBook/labels{/name}","releases_url":"https://api.github.com/repos/bmusin/mdBook/releases{/id}","deployments_url":"https://api.github.com/repos/bmusin/mdBook/deployments","created_at":"2018-01-24T18:30:07Z","updated_at":"2018-01-24T18:30:09Z","pushed_at":"2018-02-05T12:08:57Z","git_url":"git://github.com/bmusin/mdBook.git","ssh_url":"git@github.com:bmusin/mdBook.git","clone_url":"https://github.com/bmusin/mdBook.git","svn_url":"https://github.com/bmusin/mdBook","homepage":"","size":79430,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang-nursery:master","ref":"master","sha":"31a370d149bbd301f88921eacacc39d1bf8db096","user":{"login":"rust-lang-nursery","id":14631425,"avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"repo":{"id":38655056,"name":"mdBook","full_name":"rust-lang-nursery/mdBook","owner":{"login":"rust-lang-nursery","id":14631425,"avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang-nursery/mdBook","description":"Create book from markdown files. Like Gitbook but implemented in Rust","fork":false,"url":"https://api.github.com/repos/rust-lang-nursery/mdBook","forks_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/forks","keys_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/teams","hooks_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/hooks","issue_events_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/events","assignees_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/tags","blobs_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/languages","stargazers_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/stargazers","contributors_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/contributors","subscribers_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/subscribers","subscription_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/subscription","commits_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/merges","archive_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/downloads","issues_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang-nursery/mdBook/deployments","created_at":"2015-07-07T00:57:25Z","updated_at":"2018-02-04T14:31:57Z","pushed_at":"2018-02-05T12:08:58Z","git_url":"git://github.com/rust-lang-nursery/mdBook.git","ssh_url":"git@github.com:rust-lang-nursery/mdBook.git","clone_url":"https://github.com/rust-lang-nursery/mdBook.git","svn_url":"https://github.com/rust-lang-nursery/mdBook","homepage":"","size":80593,"stargazers_count":870,"watchers_count":870,"language":"Rust","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":140,"mirror_url":null,"archived":false,"open_issues_count":105,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":140,"open_issues":105,"watchers":870,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang-nursery/mdBook/pulls/608"},"html":{"href":"https://github.com/rust-lang-nursery/mdBook/pull/608"},"issue":{"href":"https://api.github.com/repos/rust-lang-nursery/mdBook/issues/608"},"comments":{"href":"https://api.github.com/repos/rust-lang-nursery/mdBook/issues/608/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang-nursery/mdBook/pulls/608/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang-nursery/mdBook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang-nursery/mdBook/pulls/608/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang-nursery/mdBook/statuses/7a50f7910e7996dedfa3231450f060dbcb247bdf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sorin-davidoi"}}