{"action":"created","comment":{"url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls/comments/154295225","pull_request_review_id":80436507,"id":154295225,"diff_hunk":"@@ -0,0 +1,75 @@\n+const input = document.querySelector('.phone-input');\n+const link = document.querySelector('.phone-link');\n+\n+const digitCodes = new Set(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']);\n+const delCode = 8;\n+const base = 3;\n+\n+function getLink() {\n+  const value = input.value.split('');\n+  let number = '';\n+\n+  for (const i in value) {\n+    if (value[i] !== '+' && value[i] !== '(' && value[i] !== ')' && value[i] !== '-' && value[i] !== '_') {\n+      number += value[i];\n+    }\n+  }\n+  if (number.length === 11) {\n+    link.textContent = 'Позвонить на ' + input.value;\n+    link.href = 'tel:' + number;\n+  } else {\n+    link.textContent = 'Введите номер';\n+    link.href = '';\n+  }\n+}\n+\n+function printDigit(key) {\n+  let position = input.selectionStart;\n+\n+  if (position === input.value.length) {\n+    return;\n+  }\n+  if (position < base) {\n+    position = base;\n+  }\n+  const value = input.value.split('');\n+\n+  while (value[position] === ')' || value[position] === '-') {\n+    position++;\n+  }\n+  value[position] = event.key;\n+  input.value = value.join('');\n+  input.setSelectionRange(position + 1, position + 1);\n+}\n+\n+function deleteDigit() {\n+  let position = input.selectionStart;\n+\n+  if (position === base) {\n+    return;\n+  }\n+  const value = input.value.split('');\n+\n+  while (value[position - 1] === '-' || value[position - 1] === ')') {\n+    position--;\n+  }\n+  value[position - 1] = '_';\n+  input.value = value.join('');\n+  input.setSelectionRange(position - 1, position - 1);\n+}\n+\n+function DigitCheck(event) {\n+  if (digitCodes.has(event.key)) {\n+    event.preventDefault();","path":"07/01/main.js","position":63,"original_position":63,"commit_id":"9a88e638bb9c2a4707eb50ad2f5e362122c5b1f5","original_commit_id":"9a88e638bb9c2a4707eb50ad2f5e362122c5b1f5","user":{"login":"u3c","id":29478447,"avatar_url":"https://avatars1.githubusercontent.com/u/29478447?v=4","gravatar_id":"","url":"https://api.github.com/users/u3c","html_url":"https://github.com/u3c","followers_url":"https://api.github.com/users/u3c/followers","following_url":"https://api.github.com/users/u3c/following{/other_user}","gists_url":"https://api.github.com/users/u3c/gists{/gist_id}","starred_url":"https://api.github.com/users/u3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u3c/subscriptions","organizations_url":"https://api.github.com/users/u3c/orgs","repos_url":"https://api.github.com/users/u3c/repos","events_url":"https://api.github.com/users/u3c/events{/privacy}","received_events_url":"https://api.github.com/users/u3c/received_events","type":"User","site_admin":false},"body":"Может быть, было бы достаточно написать один раз в конце?","created_at":"2017-12-01T09:02:03Z","updated_at":"2017-12-01T09:02:03Z","html_url":"https://github.com/artemtan/Fintech-Javascript-3/pull/17#discussion_r154295225","pull_request_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls/17","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls/comments/154295225"},"html":{"href":"https://github.com/artemtan/Fintech-Javascript-3/pull/17#discussion_r154295225"},"pull_request":{"href":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls/17","id":151820053,"html_url":"https://github.com/artemtan/Fintech-Javascript-3/pull/17","diff_url":"https://github.com/artemtan/Fintech-Javascript-3/pull/17.diff","patch_url":"https://github.com/artemtan/Fintech-Javascript-3/pull/17.patch","issue_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/issues/17","number":17,"state":"open","locked":false,"title":"Lesson 07","user":{"login":"artemtan","id":31790837,"avatar_url":"https://avatars3.githubusercontent.com/u/31790837?v=4","gravatar_id":"","url":"https://api.github.com/users/artemtan","html_url":"https://github.com/artemtan","followers_url":"https://api.github.com/users/artemtan/followers","following_url":"https://api.github.com/users/artemtan/following{/other_user}","gists_url":"https://api.github.com/users/artemtan/gists{/gist_id}","starred_url":"https://api.github.com/users/artemtan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artemtan/subscriptions","organizations_url":"https://api.github.com/users/artemtan/orgs","repos_url":"https://api.github.com/users/artemtan/repos","events_url":"https://api.github.com/users/artemtan/events{/privacy}","received_events_url":"https://api.github.com/users/artemtan/received_events","type":"User","site_admin":false},"body":"1, 2, 3 taks","created_at":"2017-11-10T03:42:15Z","updated_at":"2017-12-01T09:02:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2b227b5b951ac224837f2bb0427fd056b814fc1","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls/17/commits","review_comments_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls/17/comments","review_comment_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/issues/17/comments","statuses_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/statuses/9a88e638bb9c2a4707eb50ad2f5e362122c5b1f5","head":{"label":"artemtan:lesson-07","ref":"lesson-07","sha":"9a88e638bb9c2a4707eb50ad2f5e362122c5b1f5","user":{"login":"artemtan","id":31790837,"avatar_url":"https://avatars3.githubusercontent.com/u/31790837?v=4","gravatar_id":"","url":"https://api.github.com/users/artemtan","html_url":"https://github.com/artemtan","followers_url":"https://api.github.com/users/artemtan/followers","following_url":"https://api.github.com/users/artemtan/following{/other_user}","gists_url":"https://api.github.com/users/artemtan/gists{/gist_id}","starred_url":"https://api.github.com/users/artemtan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artemtan/subscriptions","organizations_url":"https://api.github.com/users/artemtan/orgs","repos_url":"https://api.github.com/users/artemtan/repos","events_url":"https://api.github.com/users/artemtan/events{/privacy}","received_events_url":"https://api.github.com/users/artemtan/received_events","type":"User","site_admin":false},"repo":{"id":104928808,"name":"Fintech-Javascript-3","full_name":"artemtan/Fintech-Javascript-3","owner":{"login":"artemtan","id":31790837,"avatar_url":"https://avatars3.githubusercontent.com/u/31790837?v=4","gravatar_id":"","url":"https://api.github.com/users/artemtan","html_url":"https://github.com/artemtan","followers_url":"https://api.github.com/users/artemtan/followers","following_url":"https://api.github.com/users/artemtan/following{/other_user}","gists_url":"https://api.github.com/users/artemtan/gists{/gist_id}","starred_url":"https://api.github.com/users/artemtan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artemtan/subscriptions","organizations_url":"https://api.github.com/users/artemtan/orgs","repos_url":"https://api.github.com/users/artemtan/repos","events_url":"https://api.github.com/users/artemtan/events{/privacy}","received_events_url":"https://api.github.com/users/artemtan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/artemtan/Fintech-Javascript-3","description":"Repository for homeworks at Tinkoff fintech school autumn 2017","fork":true,"url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3","forks_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/forks","keys_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/teams","hooks_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/hooks","issue_events_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/issues/events{/number}","events_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/events","assignees_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/assignees{/user}","branches_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/branches{/branch}","tags_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/tags","blobs_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/git/refs{/sha}","trees_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/statuses/{sha}","languages_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/languages","stargazers_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/stargazers","contributors_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/contributors","subscribers_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/subscribers","subscription_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/subscription","commits_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/commits{/sha}","git_commits_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/git/commits{/sha}","comments_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/comments{/number}","issue_comment_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/issues/comments{/number}","contents_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/contents/{+path}","compare_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/merges","archive_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/downloads","issues_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/issues{/number}","pulls_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls{/number}","milestones_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/milestones{/number}","notifications_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/labels{/name}","releases_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/releases{/id}","deployments_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/deployments","created_at":"2017-09-26T19:28:16Z","updated_at":"2017-11-10T03:46:08Z","pushed_at":"2017-11-10T03:46:06Z","git_url":"git://github.com/artemtan/Fintech-Javascript-3.git","ssh_url":"git@github.com:artemtan/Fintech-Javascript-3.git","clone_url":"https://github.com/artemtan/Fintech-Javascript-3.git","svn_url":"https://github.com/artemtan/Fintech-Javascript-3","homepage":"","size":14679,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":null,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"artemtan:master","ref":"master","sha":"6f427bb27d8b3376ace7978fd870970a6716ac31","user":{"login":"artemtan","id":31790837,"avatar_url":"https://avatars3.githubusercontent.com/u/31790837?v=4","gravatar_id":"","url":"https://api.github.com/users/artemtan","html_url":"https://github.com/artemtan","followers_url":"https://api.github.com/users/artemtan/followers","following_url":"https://api.github.com/users/artemtan/following{/other_user}","gists_url":"https://api.github.com/users/artemtan/gists{/gist_id}","starred_url":"https://api.github.com/users/artemtan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artemtan/subscriptions","organizations_url":"https://api.github.com/users/artemtan/orgs","repos_url":"https://api.github.com/users/artemtan/repos","events_url":"https://api.github.com/users/artemtan/events{/privacy}","received_events_url":"https://api.github.com/users/artemtan/received_events","type":"User","site_admin":false},"repo":{"id":104928808,"name":"Fintech-Javascript-3","full_name":"artemtan/Fintech-Javascript-3","owner":{"login":"artemtan","id":31790837,"avatar_url":"https://avatars3.githubusercontent.com/u/31790837?v=4","gravatar_id":"","url":"https://api.github.com/users/artemtan","html_url":"https://github.com/artemtan","followers_url":"https://api.github.com/users/artemtan/followers","following_url":"https://api.github.com/users/artemtan/following{/other_user}","gists_url":"https://api.github.com/users/artemtan/gists{/gist_id}","starred_url":"https://api.github.com/users/artemtan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artemtan/subscriptions","organizations_url":"https://api.github.com/users/artemtan/orgs","repos_url":"https://api.github.com/users/artemtan/repos","events_url":"https://api.github.com/users/artemtan/events{/privacy}","received_events_url":"https://api.github.com/users/artemtan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/artemtan/Fintech-Javascript-3","description":"Repository for homeworks at Tinkoff fintech school autumn 2017","fork":true,"url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3","forks_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/forks","keys_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/teams","hooks_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/hooks","issue_events_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/issues/events{/number}","events_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/events","assignees_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/assignees{/user}","branches_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/branches{/branch}","tags_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/tags","blobs_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/git/refs{/sha}","trees_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/statuses/{sha}","languages_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/languages","stargazers_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/stargazers","contributors_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/contributors","subscribers_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/subscribers","subscription_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/subscription","commits_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/commits{/sha}","git_commits_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/git/commits{/sha}","comments_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/comments{/number}","issue_comment_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/issues/comments{/number}","contents_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/contents/{+path}","compare_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/merges","archive_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/downloads","issues_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/issues{/number}","pulls_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls{/number}","milestones_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/milestones{/number}","notifications_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/labels{/name}","releases_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/releases{/id}","deployments_url":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/deployments","created_at":"2017-09-26T19:28:16Z","updated_at":"2017-11-10T03:46:08Z","pushed_at":"2017-11-10T03:46:06Z","git_url":"git://github.com/artemtan/Fintech-Javascript-3.git","ssh_url":"git@github.com:artemtan/Fintech-Javascript-3.git","clone_url":"https://github.com/artemtan/Fintech-Javascript-3.git","svn_url":"https://github.com/artemtan/Fintech-Javascript-3","homepage":"","size":14679,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":null,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls/17"},"html":{"href":"https://github.com/artemtan/Fintech-Javascript-3/pull/17"},"issue":{"href":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/issues/17"},"comments":{"href":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/artemtan/Fintech-Javascript-3/statuses/9a88e638bb9c2a4707eb50ad2f5e362122c5b1f5"}},"author_association":"OWNER"}}
{"actor":{"display_login":"u3c"}}