{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/pulls/comments/219312780","pull_request_review_id":157459109,"id":219312780,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTMxMjc4MA==","diff_hunk":"@@ -0,0 +1,58 @@\n+'use strict';\n+\n+// обработчики полей формы\n+(function () {\n+  var countParams = {\n+    '1': ['1'],\n+    '2': ['1', '2'],\n+    '3': ['1', '2', '3'],\n+    '100': ['0']\n+  };\n+\n+  var adType = document.querySelector('[name=type]');\n+  var adPrice = document.querySelector('[name=price]');\n+  var adTimeIn = document.querySelector('[name=timein]');\n+  var adTimeOut = document.querySelector('[name=timeout]');\n+  var adRooms = document.querySelector('[name=rooms]');\n+  var adCapacity = document.querySelector('[name=capacity]');\n+\n+  // функция-обработчик изменения поля Тип\n+  var onTypeChange = function () {\n+    var minPriceSelected = window.data.typesOffer[adType.value].MIN_PRICE;\n+    adPrice.setAttribute('placeholder', minPriceSelected);\n+    adPrice.setAttribute('min', minPriceSelected);\n+  };\n+\n+  // функция-обработчик изменения поля время заезда\n+  var onTimeInChange = function () {\n+    adTimeOut.value = adTimeIn.value;\n+  };\n+\n+  // функция-обработчик изменения поля выезда\n+  var onTimeOutChange = function () {\n+    adTimeIn.value = adTimeOut.value;\n+  };\n+\n+  // функция-обработчик изменений поля кол-во комнат\n+  var onCountChange = function () {\n+    var rooms = adRooms.value;\n+    var capacity = adCapacity.value;\n+    var message = (countParams[rooms].indexOf(capacity) === -1) ?\n+      'Количество гостей соответствует количеству комнат' : '';\n+    adCapacity.setCustomValidity(message);\n+  };\n+\n+  // функция добавляет обработчики change на поля формы\n+  var addHandlersFields = function () {\n+    adType.addEventListener('change', onTypeChange);\n+    adTimeIn.addEventListener('change', onTimeInChange);\n+    adTimeOut.addEventListener('change', onTimeOutChange);\n+    adRooms.addEventListener('change', onCountChange);\n+    adCapacity.addEventListener('change', onCountChange);\n+  };\n+\n+  window.form = {\n+    addHandlersFields: addHandlersFields","path":"js/form.js","position":55,"original_position":55,"commit_id":"2cce2554fef05a1a87978e857f37aab21b5dd4bf","original_commit_id":"2cce2554fef05a1a87978e857f37aab21b5dd4bf","user":{"login":"fyvfyv","id":3251438,"node_id":"MDQ6VXNlcjMyNTE0Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3251438?v=4","gravatar_id":"","url":"https://api.github.com/users/fyvfyv","html_url":"https://github.com/fyvfyv","followers_url":"https://api.github.com/users/fyvfyv/followers","following_url":"https://api.github.com/users/fyvfyv/following{/other_user}","gists_url":"https://api.github.com/users/fyvfyv/gists{/gist_id}","starred_url":"https://api.github.com/users/fyvfyv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fyvfyv/subscriptions","organizations_url":"https://api.github.com/users/fyvfyv/orgs","repos_url":"https://api.github.com/users/fyvfyv/repos","events_url":"https://api.github.com/users/fyvfyv/events{/privacy}","received_events_url":"https://api.github.com/users/fyvfyv/received_events","type":"User","site_admin":false},"body":"Если экспортируется одна функция, то объект не нужен","created_at":"2018-09-20T20:48:50Z","updated_at":"2018-09-20T20:49:33Z","html_url":"https://github.com/htmlacademy-javascript/216295-keksobooking/pull/6#discussion_r219312780","pull_request_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/pulls/6","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/pulls/comments/219312780"},"html":{"href":"https://github.com/htmlacademy-javascript/216295-keksobooking/pull/6#discussion_r219312780"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/pulls/6","id":217061467,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3MDYxNDY3","html_url":"https://github.com/htmlacademy-javascript/216295-keksobooking/pull/6","diff_url":"https://github.com/htmlacademy-javascript/216295-keksobooking/pull/6.diff","patch_url":"https://github.com/htmlacademy-javascript/216295-keksobooking/pull/6.patch","issue_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/issues/6","number":6,"state":"open","locked":false,"title":"Личный проект: модуляция","user":{"login":"Minatika","id":20661604,"node_id":"MDQ6VXNlcjIwNjYxNjA0","avatar_url":"https://avatars2.githubusercontent.com/u/20661604?v=4","gravatar_id":"","url":"https://api.github.com/users/Minatika","html_url":"https://github.com/Minatika","followers_url":"https://api.github.com/users/Minatika/followers","following_url":"https://api.github.com/users/Minatika/following{/other_user}","gists_url":"https://api.github.com/users/Minatika/gists{/gist_id}","starred_url":"https://api.github.com/users/Minatika/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Minatika/subscriptions","organizations_url":"https://api.github.com/users/Minatika/orgs","repos_url":"https://api.github.com/users/Minatika/repos","events_url":"https://api.github.com/users/Minatika/events{/privacy}","received_events_url":"https://api.github.com/users/Minatika/received_events","type":"User","site_admin":false},"body":"\n\n---\n:mortar_board: [Личный проект: модуляция](https://up.htmlacademy.ru/javascript/15/user/216295/tasks/20)","created_at":"2018-09-20T18:11:44Z","updated_at":"2018-09-20T20:49:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6371d0025010b67f81645c9515031d8984463ce1","assignee":{"login":"fyvfyv","id":3251438,"node_id":"MDQ6VXNlcjMyNTE0Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3251438?v=4","gravatar_id":"","url":"https://api.github.com/users/fyvfyv","html_url":"https://github.com/fyvfyv","followers_url":"https://api.github.com/users/fyvfyv/followers","following_url":"https://api.github.com/users/fyvfyv/following{/other_user}","gists_url":"https://api.github.com/users/fyvfyv/gists{/gist_id}","starred_url":"https://api.github.com/users/fyvfyv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fyvfyv/subscriptions","organizations_url":"https://api.github.com/users/fyvfyv/orgs","repos_url":"https://api.github.com/users/fyvfyv/repos","events_url":"https://api.github.com/users/fyvfyv/events{/privacy}","received_events_url":"https://api.github.com/users/fyvfyv/received_events","type":"User","site_admin":false},"assignees":[{"login":"fyvfyv","id":3251438,"node_id":"MDQ6VXNlcjMyNTE0Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3251438?v=4","gravatar_id":"","url":"https://api.github.com/users/fyvfyv","html_url":"https://github.com/fyvfyv","followers_url":"https://api.github.com/users/fyvfyv/followers","following_url":"https://api.github.com/users/fyvfyv/following{/other_user}","gists_url":"https://api.github.com/users/fyvfyv/gists{/gist_id}","starred_url":"https://api.github.com/users/fyvfyv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fyvfyv/subscriptions","organizations_url":"https://api.github.com/users/fyvfyv/orgs","repos_url":"https://api.github.com/users/fyvfyv/repos","events_url":"https://api.github.com/users/fyvfyv/events{/privacy}","received_events_url":"https://api.github.com/users/fyvfyv/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/pulls/6/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/pulls/6/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/issues/6/comments","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/statuses/2cce2554fef05a1a87978e857f37aab21b5dd4bf","head":{"label":"Minatika:module5-task2","ref":"module5-task2","sha":"2cce2554fef05a1a87978e857f37aab21b5dd4bf","user":{"login":"Minatika","id":20661604,"node_id":"MDQ6VXNlcjIwNjYxNjA0","avatar_url":"https://avatars2.githubusercontent.com/u/20661604?v=4","gravatar_id":"","url":"https://api.github.com/users/Minatika","html_url":"https://github.com/Minatika","followers_url":"https://api.github.com/users/Minatika/followers","following_url":"https://api.github.com/users/Minatika/following{/other_user}","gists_url":"https://api.github.com/users/Minatika/gists{/gist_id}","starred_url":"https://api.github.com/users/Minatika/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Minatika/subscriptions","organizations_url":"https://api.github.com/users/Minatika/orgs","repos_url":"https://api.github.com/users/Minatika/repos","events_url":"https://api.github.com/users/Minatika/events{/privacy}","received_events_url":"https://api.github.com/users/Minatika/received_events","type":"User","site_admin":false},"repo":{"id":146689531,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY2ODk1MzE=","name":"216295-keksobooking","full_name":"Minatika/216295-keksobooking","private":false,"owner":{"login":"Minatika","id":20661604,"node_id":"MDQ6VXNlcjIwNjYxNjA0","avatar_url":"https://avatars2.githubusercontent.com/u/20661604?v=4","gravatar_id":"","url":"https://api.github.com/users/Minatika","html_url":"https://github.com/Minatika","followers_url":"https://api.github.com/users/Minatika/followers","following_url":"https://api.github.com/users/Minatika/following{/other_user}","gists_url":"https://api.github.com/users/Minatika/gists{/gist_id}","starred_url":"https://api.github.com/users/Minatika/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Minatika/subscriptions","organizations_url":"https://api.github.com/users/Minatika/orgs","repos_url":"https://api.github.com/users/Minatika/repos","events_url":"https://api.github.com/users/Minatika/events{/privacy}","received_events_url":"https://api.github.com/users/Minatika/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Minatika/216295-keksobooking","description":"Наталия Мартынова","fork":true,"url":"https://api.github.com/repos/Minatika/216295-keksobooking","forks_url":"https://api.github.com/repos/Minatika/216295-keksobooking/forks","keys_url":"https://api.github.com/repos/Minatika/216295-keksobooking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Minatika/216295-keksobooking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Minatika/216295-keksobooking/teams","hooks_url":"https://api.github.com/repos/Minatika/216295-keksobooking/hooks","issue_events_url":"https://api.github.com/repos/Minatika/216295-keksobooking/issues/events{/number}","events_url":"https://api.github.com/repos/Minatika/216295-keksobooking/events","assignees_url":"https://api.github.com/repos/Minatika/216295-keksobooking/assignees{/user}","branches_url":"https://api.github.com/repos/Minatika/216295-keksobooking/branches{/branch}","tags_url":"https://api.github.com/repos/Minatika/216295-keksobooking/tags","blobs_url":"https://api.github.com/repos/Minatika/216295-keksobooking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Minatika/216295-keksobooking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Minatika/216295-keksobooking/git/refs{/sha}","trees_url":"https://api.github.com/repos/Minatika/216295-keksobooking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Minatika/216295-keksobooking/statuses/{sha}","languages_url":"https://api.github.com/repos/Minatika/216295-keksobooking/languages","stargazers_url":"https://api.github.com/repos/Minatika/216295-keksobooking/stargazers","contributors_url":"https://api.github.com/repos/Minatika/216295-keksobooking/contributors","subscribers_url":"https://api.github.com/repos/Minatika/216295-keksobooking/subscribers","subscription_url":"https://api.github.com/repos/Minatika/216295-keksobooking/subscription","commits_url":"https://api.github.com/repos/Minatika/216295-keksobooking/commits{/sha}","git_commits_url":"https://api.github.com/repos/Minatika/216295-keksobooking/git/commits{/sha}","comments_url":"https://api.github.com/repos/Minatika/216295-keksobooking/comments{/number}","issue_comment_url":"https://api.github.com/repos/Minatika/216295-keksobooking/issues/comments{/number}","contents_url":"https://api.github.com/repos/Minatika/216295-keksobooking/contents/{+path}","compare_url":"https://api.github.com/repos/Minatika/216295-keksobooking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Minatika/216295-keksobooking/merges","archive_url":"https://api.github.com/repos/Minatika/216295-keksobooking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Minatika/216295-keksobooking/downloads","issues_url":"https://api.github.com/repos/Minatika/216295-keksobooking/issues{/number}","pulls_url":"https://api.github.com/repos/Minatika/216295-keksobooking/pulls{/number}","milestones_url":"https://api.github.com/repos/Minatika/216295-keksobooking/milestones{/number}","notifications_url":"https://api.github.com/repos/Minatika/216295-keksobooking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Minatika/216295-keksobooking/labels{/name}","releases_url":"https://api.github.com/repos/Minatika/216295-keksobooking/releases{/id}","deployments_url":"https://api.github.com/repos/Minatika/216295-keksobooking/deployments","created_at":"2018-08-30T03:14:56Z","updated_at":"2018-09-19T16:28:22Z","pushed_at":"2018-09-20T18:11:23Z","git_url":"git://github.com/Minatika/216295-keksobooking.git","ssh_url":"git@github.com:Minatika/216295-keksobooking.git","clone_url":"https://github.com/Minatika/216295-keksobooking.git","svn_url":"https://github.com/Minatika/216295-keksobooking","homepage":null,"size":923,"stargazers_count":0,"watchers_count":0,"language":"CSS","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-javascript:master","ref":"master","sha":"b92b88a27dd2a644bec93f38e2f024975a5b64be","user":{"login":"htmlacademy-javascript","id":14179712,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc5NzEy","avatar_url":"https://avatars2.githubusercontent.com/u/14179712?v=4","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-javascript","html_url":"https://github.com/htmlacademy-javascript","followers_url":"https://api.github.com/users/htmlacademy-javascript/followers","following_url":"https://api.github.com/users/htmlacademy-javascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-javascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-javascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-javascript/repos","events_url":"https://api.github.com/users/htmlacademy-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-javascript/received_events","type":"Organization","site_admin":false},"repo":{"id":146689157,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY2ODkxNTc=","name":"216295-keksobooking","full_name":"htmlacademy-javascript/216295-keksobooking","private":false,"owner":{"login":"htmlacademy-javascript","id":14179712,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc5NzEy","avatar_url":"https://avatars2.githubusercontent.com/u/14179712?v=4","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-javascript","html_url":"https://github.com/htmlacademy-javascript","followers_url":"https://api.github.com/users/htmlacademy-javascript/followers","following_url":"https://api.github.com/users/htmlacademy-javascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-javascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-javascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-javascript/repos","events_url":"https://api.github.com/users/htmlacademy-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-javascript/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/htmlacademy-javascript/216295-keksobooking","description":"Наталия Мартынова","fork":false,"url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking","forks_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/forks","keys_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/teams","hooks_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/events","assignees_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/tags","blobs_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/subscription","commits_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/merges","archive_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/downloads","issues_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/deployments","created_at":"2018-08-30T03:10:54Z","updated_at":"2018-09-19T09:22:04Z","pushed_at":"2018-09-20T18:11:45Z","git_url":"git://github.com/htmlacademy-javascript/216295-keksobooking.git","ssh_url":"git@github.com:htmlacademy-javascript/216295-keksobooking.git","clone_url":"https://github.com/htmlacademy-javascript/216295-keksobooking.git","svn_url":"https://github.com/htmlacademy-javascript/216295-keksobooking","homepage":"https://github.com/Minatika/216295-keksobooking","size":957,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_projects":false,"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-javascript/216295-keksobooking/pulls/6"},"html":{"href":"https://github.com/htmlacademy-javascript/216295-keksobooking/pull/6"},"issue":{"href":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/issues/6"},"comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-javascript/216295-keksobooking/statuses/2cce2554fef05a1a87978e857f37aab21b5dd4bf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"fyvfyv"}}