{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/pulls/comments/177990638","pull_request_review_id":107968252,"id":177990638,"diff_hunk":"@@ -0,0 +1,36 @@\n+const template = document.querySelector(`#templates`);\n+const templateContent = `content` in template ? template.content : template;\n+const templateList = templateContent.cloneNode(true).querySelectorAll(`.main`);\n+const templatesArr = Array.from(templateList);\n+const mainSection = document.querySelector(`section.main`);\n+let indexScreen = 0;\n+\n+/**\n+ * Показывает экран\n+ * @param {number} index - номер экрана\n+ */\n+function showScreen(index) {\n+  const currentTemplate = templatesArr[index];\n+  mainSection.innerHTML = ``;\n+  mainSection.appendChild(currentTemplate);\n+}\n+\n+/**\n+ * Обработчик нажатия на клавиши\n+ * @param {KeyboardEvent} evt\n+ */\n+function onKeyDown(evt) {\n+  if (evt.altKey && evt.key === `ArrowRight` && indexScreen < templatesArr.length - 1) {\n+    evt.preventDefault();","path":"js/main.js","position":24,"original_position":24,"commit_id":"79b68bc740c79a795091a932b028b51107679fac","original_commit_id":"79b68bc740c79a795091a932b028b51107679fac","user":{"login":"nicksp","id":579331,"avatar_url":"https://avatars2.githubusercontent.com/u/579331?v=4","gravatar_id":"","url":"https://api.github.com/users/nicksp","html_url":"https://github.com/nicksp","followers_url":"https://api.github.com/users/nicksp/followers","following_url":"https://api.github.com/users/nicksp/following{/other_user}","gists_url":"https://api.github.com/users/nicksp/gists{/gist_id}","starred_url":"https://api.github.com/users/nicksp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicksp/subscriptions","organizations_url":"https://api.github.com/users/nicksp/orgs","repos_url":"https://api.github.com/users/nicksp/repos","events_url":"https://api.github.com/users/nicksp/events{/privacy}","received_events_url":"https://api.github.com/users/nicksp/received_events","type":"User","site_admin":false},"body":"чтобы не дублировать, давай вынесем за условие.","created_at":"2018-03-29T08:49:31Z","updated_at":"2018-03-29T08:49:31Z","html_url":"https://github.com/htmlacademy-ecmascript/129884-guess-melody/pull/2#discussion_r177990638","pull_request_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/pulls/2","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/pulls/comments/177990638"},"html":{"href":"https://github.com/htmlacademy-ecmascript/129884-guess-melody/pull/2#discussion_r177990638"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/pulls/2","id":177895501,"html_url":"https://github.com/htmlacademy-ecmascript/129884-guess-melody/pull/2","diff_url":"https://github.com/htmlacademy-ecmascript/129884-guess-melody/pull/2.diff","patch_url":"https://github.com/htmlacademy-ecmascript/129884-guess-melody/pull/2.patch","issue_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/issues/2","number":2,"state":"open","locked":false,"title":"Начинаем программировать","user":{"login":"Anchello","id":16352548,"avatar_url":"https://avatars1.githubusercontent.com/u/16352548?v=4","gravatar_id":"","url":"https://api.github.com/users/Anchello","html_url":"https://github.com/Anchello","followers_url":"https://api.github.com/users/Anchello/followers","following_url":"https://api.github.com/users/Anchello/following{/other_user}","gists_url":"https://api.github.com/users/Anchello/gists{/gist_id}","starred_url":"https://api.github.com/users/Anchello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anchello/subscriptions","organizations_url":"https://api.github.com/users/Anchello/orgs","repos_url":"https://api.github.com/users/Anchello/repos","events_url":"https://api.github.com/users/Anchello/events{/privacy}","received_events_url":"https://api.github.com/users/Anchello/received_events","type":"User","site_admin":false},"body":"Я надеюсь правильно поняла задание, и пока что не надо js писать в отдельном модуле...\r\nВызвала проблему функция onKeyDown, не знаю как ее написать лучше(\n\n---\n:mortar_board: [Начинаем программировать](https://up.htmlacademy.ru/ecmascript/4/user/129884/tasks/3)\n\n:boom: https://htmlacademy-ecmascript.github.io/129884-guess-melody/2/","created_at":"2018-03-27T23:51:10Z","updated_at":"2018-03-29T08:49:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a50f0cbedca5f365ffdb08f47c5f5740d5011d2","assignee":{"login":"nicksp","id":579331,"avatar_url":"https://avatars2.githubusercontent.com/u/579331?v=4","gravatar_id":"","url":"https://api.github.com/users/nicksp","html_url":"https://github.com/nicksp","followers_url":"https://api.github.com/users/nicksp/followers","following_url":"https://api.github.com/users/nicksp/following{/other_user}","gists_url":"https://api.github.com/users/nicksp/gists{/gist_id}","starred_url":"https://api.github.com/users/nicksp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicksp/subscriptions","organizations_url":"https://api.github.com/users/nicksp/orgs","repos_url":"https://api.github.com/users/nicksp/repos","events_url":"https://api.github.com/users/nicksp/events{/privacy}","received_events_url":"https://api.github.com/users/nicksp/received_events","type":"User","site_admin":false},"assignees":[{"login":"nicksp","id":579331,"avatar_url":"https://avatars2.githubusercontent.com/u/579331?v=4","gravatar_id":"","url":"https://api.github.com/users/nicksp","html_url":"https://github.com/nicksp","followers_url":"https://api.github.com/users/nicksp/followers","following_url":"https://api.github.com/users/nicksp/following{/other_user}","gists_url":"https://api.github.com/users/nicksp/gists{/gist_id}","starred_url":"https://api.github.com/users/nicksp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicksp/subscriptions","organizations_url":"https://api.github.com/users/nicksp/orgs","repos_url":"https://api.github.com/users/nicksp/repos","events_url":"https://api.github.com/users/nicksp/events{/privacy}","received_events_url":"https://api.github.com/users/nicksp/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/pulls/2/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/pulls/2/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/issues/2/comments","statuses_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/statuses/79b68bc740c79a795091a932b028b51107679fac","head":{"label":"Anchello:module1-task2","ref":"module1-task2","sha":"79b68bc740c79a795091a932b028b51107679fac","user":{"login":"Anchello","id":16352548,"avatar_url":"https://avatars1.githubusercontent.com/u/16352548?v=4","gravatar_id":"","url":"https://api.github.com/users/Anchello","html_url":"https://github.com/Anchello","followers_url":"https://api.github.com/users/Anchello/followers","following_url":"https://api.github.com/users/Anchello/following{/other_user}","gists_url":"https://api.github.com/users/Anchello/gists{/gist_id}","starred_url":"https://api.github.com/users/Anchello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anchello/subscriptions","organizations_url":"https://api.github.com/users/Anchello/orgs","repos_url":"https://api.github.com/users/Anchello/repos","events_url":"https://api.github.com/users/Anchello/events{/privacy}","received_events_url":"https://api.github.com/users/Anchello/received_events","type":"User","site_admin":false},"repo":{"id":126873476,"name":"129884-guess-melody","full_name":"Anchello/129884-guess-melody","owner":{"login":"Anchello","id":16352548,"avatar_url":"https://avatars1.githubusercontent.com/u/16352548?v=4","gravatar_id":"","url":"https://api.github.com/users/Anchello","html_url":"https://github.com/Anchello","followers_url":"https://api.github.com/users/Anchello/followers","following_url":"https://api.github.com/users/Anchello/following{/other_user}","gists_url":"https://api.github.com/users/Anchello/gists{/gist_id}","starred_url":"https://api.github.com/users/Anchello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anchello/subscriptions","organizations_url":"https://api.github.com/users/Anchello/orgs","repos_url":"https://api.github.com/users/Anchello/repos","events_url":"https://api.github.com/users/Anchello/events{/privacy}","received_events_url":"https://api.github.com/users/Anchello/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Anchello/129884-guess-melody","description":"Anna Popova","fork":true,"url":"https://api.github.com/repos/Anchello/129884-guess-melody","forks_url":"https://api.github.com/repos/Anchello/129884-guess-melody/forks","keys_url":"https://api.github.com/repos/Anchello/129884-guess-melody/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Anchello/129884-guess-melody/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Anchello/129884-guess-melody/teams","hooks_url":"https://api.github.com/repos/Anchello/129884-guess-melody/hooks","issue_events_url":"https://api.github.com/repos/Anchello/129884-guess-melody/issues/events{/number}","events_url":"https://api.github.com/repos/Anchello/129884-guess-melody/events","assignees_url":"https://api.github.com/repos/Anchello/129884-guess-melody/assignees{/user}","branches_url":"https://api.github.com/repos/Anchello/129884-guess-melody/branches{/branch}","tags_url":"https://api.github.com/repos/Anchello/129884-guess-melody/tags","blobs_url":"https://api.github.com/repos/Anchello/129884-guess-melody/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Anchello/129884-guess-melody/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Anchello/129884-guess-melody/git/refs{/sha}","trees_url":"https://api.github.com/repos/Anchello/129884-guess-melody/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Anchello/129884-guess-melody/statuses/{sha}","languages_url":"https://api.github.com/repos/Anchello/129884-guess-melody/languages","stargazers_url":"https://api.github.com/repos/Anchello/129884-guess-melody/stargazers","contributors_url":"https://api.github.com/repos/Anchello/129884-guess-melody/contributors","subscribers_url":"https://api.github.com/repos/Anchello/129884-guess-melody/subscribers","subscription_url":"https://api.github.com/repos/Anchello/129884-guess-melody/subscription","commits_url":"https://api.github.com/repos/Anchello/129884-guess-melody/commits{/sha}","git_commits_url":"https://api.github.com/repos/Anchello/129884-guess-melody/git/commits{/sha}","comments_url":"https://api.github.com/repos/Anchello/129884-guess-melody/comments{/number}","issue_comment_url":"https://api.github.com/repos/Anchello/129884-guess-melody/issues/comments{/number}","contents_url":"https://api.github.com/repos/Anchello/129884-guess-melody/contents/{+path}","compare_url":"https://api.github.com/repos/Anchello/129884-guess-melody/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Anchello/129884-guess-melody/merges","archive_url":"https://api.github.com/repos/Anchello/129884-guess-melody/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Anchello/129884-guess-melody/downloads","issues_url":"https://api.github.com/repos/Anchello/129884-guess-melody/issues{/number}","pulls_url":"https://api.github.com/repos/Anchello/129884-guess-melody/pulls{/number}","milestones_url":"https://api.github.com/repos/Anchello/129884-guess-melody/milestones{/number}","notifications_url":"https://api.github.com/repos/Anchello/129884-guess-melody/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Anchello/129884-guess-melody/labels{/name}","releases_url":"https://api.github.com/repos/Anchello/129884-guess-melody/releases{/id}","deployments_url":"https://api.github.com/repos/Anchello/129884-guess-melody/deployments","created_at":"2018-03-26T18:37:28Z","updated_at":"2018-03-27T20:35:13Z","pushed_at":"2018-03-29T08:22:47Z","git_url":"git://github.com/Anchello/129884-guess-melody.git","ssh_url":"git@github.com:Anchello/129884-guess-melody.git","clone_url":"https://github.com/Anchello/129884-guess-melody.git","svn_url":"https://github.com/Anchello/129884-guess-melody","homepage":null,"size":243,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"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":"htmlacademy-ecmascript:master","ref":"master","sha":"6ca5d1c8c3d7e08dadb3e29508ace98aa294697a","user":{"login":"htmlacademy-ecmascript","id":22890904,"avatar_url":"https://avatars2.githubusercontent.com/u/22890904?v=4","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-ecmascript","html_url":"https://github.com/htmlacademy-ecmascript","followers_url":"https://api.github.com/users/htmlacademy-ecmascript/followers","following_url":"https://api.github.com/users/htmlacademy-ecmascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-ecmascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-ecmascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-ecmascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-ecmascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-ecmascript/repos","events_url":"https://api.github.com/users/htmlacademy-ecmascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-ecmascript/received_events","type":"Organization","site_admin":false},"repo":{"id":126873287,"name":"129884-guess-melody","full_name":"htmlacademy-ecmascript/129884-guess-melody","owner":{"login":"htmlacademy-ecmascript","id":22890904,"avatar_url":"https://avatars2.githubusercontent.com/u/22890904?v=4","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-ecmascript","html_url":"https://github.com/htmlacademy-ecmascript","followers_url":"https://api.github.com/users/htmlacademy-ecmascript/followers","following_url":"https://api.github.com/users/htmlacademy-ecmascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-ecmascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-ecmascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-ecmascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-ecmascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-ecmascript/repos","events_url":"https://api.github.com/users/htmlacademy-ecmascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-ecmascript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/htmlacademy-ecmascript/129884-guess-melody","description":"Anna Popova","fork":false,"url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody","forks_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/forks","keys_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/teams","hooks_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/events","assignees_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/tags","blobs_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/subscription","commits_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/merges","archive_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/downloads","issues_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/deployments","created_at":"2018-03-26T18:35:39Z","updated_at":"2018-03-27T00:01:38Z","pushed_at":"2018-03-29T08:38:43Z","git_url":"git://github.com/htmlacademy-ecmascript/129884-guess-melody.git","ssh_url":"git@github.com:htmlacademy-ecmascript/129884-guess-melody.git","clone_url":"https://github.com/htmlacademy-ecmascript/129884-guess-melody.git","svn_url":"https://github.com/htmlacademy-ecmascript/129884-guess-melody","homepage":"https://github.com/Anchello/129884-guess-melody","size":249,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/pulls/2"},"html":{"href":"https://github.com/htmlacademy-ecmascript/129884-guess-melody/pull/2"},"issue":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/issues/2"},"comments":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/129884-guess-melody/statuses/79b68bc740c79a795091a932b028b51107679fac"}},"author_association":"NONE"}}
{"actor":{"display_login":"nicksp"}}