{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/pulls/comments/181594581","pull_request_review_id":112248883,"id":181594581,"diff_hunk":"@@ -0,0 +1,185 @@\n+'use strict';\n+\n+// Возвращает случайное число из диапазона\n+var getRandomElement = function (min, max) {\n+  return min + Math.floor(Math.random() * (max - min + 1));\n+};\n+\n+// Возвращает 1 случайное значение массива\n+var getRandomArrayValue = function (array) {\n+  return array[getRandomElement(0, array.length - 1)];\n+};\n+\n+// Перетасовывает значения массива в случайном порядке\n+var shuffleArray = function (source) {\n+  var array = source.slice();\n+  return array.sort(function () {\n+    return Math.random() - 0.5;\n+  });\n+};\n+\n+// Возвращает случайное количество значений массива\n+var getRandomArrayValues = function (source) {\n+  var valuesQuantity = getRandomElement(1, source.length); // Генерирует количество значений массива\n+  var array = shuffleArray(source.slice()).slice(0, valuesQuantity);\n+  return array;\n+};\n+\n+// Значения для генерация тестовых данных\n+var testDataSource = {\n+  avatarSrc: 'img/avatars/user{{xx}}.png',\n+  titleSrc: [\n+    'Большая уютная квартира',\n+    'Маленькая неуютная квартира',\n+    'Огромный прекрасный дворец',\n+    'Маленький ужасный дворец',\n+    'Красивый гостевой домик',\n+    'Некрасивый негостеприимный домик',\n+    'Уютное бунгало далеко от моря',\n+    'Неуютное бунгало по колено в воде'\n+  ],\n+  typeSrc: [\n+    'palace',\n+    'flat',\n+    'house',\n+    'bungalo'\n+  ],\n+  checkinChecoutTimeSrc: [\n+    '12:00',\n+    '13:00',\n+    '14:00'\n+  ],\n+  featuresSrc: [\n+    'wifi',\n+    'dishwasher',\n+    'parking',\n+    'washer',\n+    'elevator',\n+    'conditioner'\n+  ],\n+  photosSrc: [\n+    'http://o0.github.io/assets/images/tokyo/hotel1.jpg',\n+    'http://o0.github.io/assets/images/tokyo/hotel2.jpg',\n+    'http://o0.github.io/assets/images/tokyo/hotel3.jpg'\n+  ],\n+};\n+var markQuantity = 8; // Количество меток на карте\n+var markFragmentTemplate = document.querySelector('template').content.querySelector('.map__pin'); // Фрагмент для вывода меток\n+var adFragmentTemplate = document.querySelector('template').content.querySelector('.map__card'); // Фрагмент для вывода объявления\n+var markSize = { /* Размер метки */\n+  width: 50,\n+  height: 70\n+};\n+\n+// Генерирует массив тестовых данных\n+var renderTestData = function (testData, quantity) {\n+  var testdata = [];\n+  var titles = shuffleArray(testData.titleSrc);\n+  for (var i = 0; i < quantity; i++) {\n+    var locationX = getRandomElement(300, 900);\n+    var locationY = getRandomElement(150, 500);\n+    testdata.push({\n+      author: {\n+        avatar: testData.avatarSrc.replace('{{xx}}', new Intl.NumberFormat('ru-RU', {minimumIntegerDigits: 2, useGrouping: false}).format(i + 1)),","path":"js/map.js","position":83,"original_position":83,"commit_id":"e07feeb9dcc6ab0581ed60fcfc405ae239e6132d","original_commit_id":"e07feeb9dcc6ab0581ed60fcfc405ae239e6132d","user":{"login":"yandzee","id":5919088,"avatar_url":"https://avatars3.githubusercontent.com/u/5919088?v=4","gravatar_id":"","url":"https://api.github.com/users/yandzee","html_url":"https://github.com/yandzee","followers_url":"https://api.github.com/users/yandzee/followers","following_url":"https://api.github.com/users/yandzee/following{/other_user}","gists_url":"https://api.github.com/users/yandzee/gists{/gist_id}","starred_url":"https://api.github.com/users/yandzee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yandzee/subscriptions","organizations_url":"https://api.github.com/users/yandzee/orgs","repos_url":"https://api.github.com/users/yandzee/repos","events_url":"https://api.github.com/users/yandzee/events{/privacy}","received_events_url":"https://api.github.com/users/yandzee/received_events","type":"User","site_admin":false},"body":"Воу воу воу :)\r\nКруто конечно, но можно было сделать `testData.avatar` функцией, принимающей число и возращающей нужную строку:\r\n`avatar: testData.avatarSrc(i + 1)`","created_at":"2018-04-15T19:46:54Z","updated_at":"2018-04-15T19:58:30Z","html_url":"https://github.com/htmlacademy-javascript/631285-keksobooking/pull/3#discussion_r181594581","pull_request_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/pulls/3","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/pulls/comments/181594581"},"html":{"href":"https://github.com/htmlacademy-javascript/631285-keksobooking/pull/3#discussion_r181594581"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/pulls/3","id":181657921,"html_url":"https://github.com/htmlacademy-javascript/631285-keksobooking/pull/3","diff_url":"https://github.com/htmlacademy-javascript/631285-keksobooking/pull/3.diff","patch_url":"https://github.com/htmlacademy-javascript/631285-keksobooking/pull/3.patch","issue_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/issues/3","number":3,"state":"open","locked":false,"title":"Личный проект: милый DOM","user":{"login":"annach453","id":35502795,"avatar_url":"https://avatars1.githubusercontent.com/u/35502795?v=4","gravatar_id":"","url":"https://api.github.com/users/annach453","html_url":"https://github.com/annach453","followers_url":"https://api.github.com/users/annach453/followers","following_url":"https://api.github.com/users/annach453/following{/other_user}","gists_url":"https://api.github.com/users/annach453/gists{/gist_id}","starred_url":"https://api.github.com/users/annach453/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annach453/subscriptions","organizations_url":"https://api.github.com/users/annach453/orgs","repos_url":"https://api.github.com/users/annach453/repos","events_url":"https://api.github.com/users/annach453/events{/privacy}","received_events_url":"https://api.github.com/users/annach453/received_events","type":"User","site_admin":false},"body":"\n\n---\n:mortar_board: [Личный проект: милый DOM](https://up.htmlacademy.ru/javascript/13/user/631285/tasks/13)","created_at":"2018-04-14T17:23:12Z","updated_at":"2018-04-15T19:58:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9ddae0e41ac3243650e2c0cf03e044c92ffb175","assignee":{"login":"yandzee","id":5919088,"avatar_url":"https://avatars3.githubusercontent.com/u/5919088?v=4","gravatar_id":"","url":"https://api.github.com/users/yandzee","html_url":"https://github.com/yandzee","followers_url":"https://api.github.com/users/yandzee/followers","following_url":"https://api.github.com/users/yandzee/following{/other_user}","gists_url":"https://api.github.com/users/yandzee/gists{/gist_id}","starred_url":"https://api.github.com/users/yandzee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yandzee/subscriptions","organizations_url":"https://api.github.com/users/yandzee/orgs","repos_url":"https://api.github.com/users/yandzee/repos","events_url":"https://api.github.com/users/yandzee/events{/privacy}","received_events_url":"https://api.github.com/users/yandzee/received_events","type":"User","site_admin":false},"assignees":[{"login":"yandzee","id":5919088,"avatar_url":"https://avatars3.githubusercontent.com/u/5919088?v=4","gravatar_id":"","url":"https://api.github.com/users/yandzee","html_url":"https://github.com/yandzee","followers_url":"https://api.github.com/users/yandzee/followers","following_url":"https://api.github.com/users/yandzee/following{/other_user}","gists_url":"https://api.github.com/users/yandzee/gists{/gist_id}","starred_url":"https://api.github.com/users/yandzee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yandzee/subscriptions","organizations_url":"https://api.github.com/users/yandzee/orgs","repos_url":"https://api.github.com/users/yandzee/repos","events_url":"https://api.github.com/users/yandzee/events{/privacy}","received_events_url":"https://api.github.com/users/yandzee/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/pulls/3/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/pulls/3/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/issues/3/comments","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/statuses/e07feeb9dcc6ab0581ed60fcfc405ae239e6132d","head":{"label":"annach453:module3-task1","ref":"module3-task1","sha":"e07feeb9dcc6ab0581ed60fcfc405ae239e6132d","user":{"login":"annach453","id":35502795,"avatar_url":"https://avatars1.githubusercontent.com/u/35502795?v=4","gravatar_id":"","url":"https://api.github.com/users/annach453","html_url":"https://github.com/annach453","followers_url":"https://api.github.com/users/annach453/followers","following_url":"https://api.github.com/users/annach453/following{/other_user}","gists_url":"https://api.github.com/users/annach453/gists{/gist_id}","starred_url":"https://api.github.com/users/annach453/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annach453/subscriptions","organizations_url":"https://api.github.com/users/annach453/orgs","repos_url":"https://api.github.com/users/annach453/repos","events_url":"https://api.github.com/users/annach453/events{/privacy}","received_events_url":"https://api.github.com/users/annach453/received_events","type":"User","site_admin":false},"repo":{"id":127475388,"name":"631285-keksobooking","full_name":"annach453/631285-keksobooking","owner":{"login":"annach453","id":35502795,"avatar_url":"https://avatars1.githubusercontent.com/u/35502795?v=4","gravatar_id":"","url":"https://api.github.com/users/annach453","html_url":"https://github.com/annach453","followers_url":"https://api.github.com/users/annach453/followers","following_url":"https://api.github.com/users/annach453/following{/other_user}","gists_url":"https://api.github.com/users/annach453/gists{/gist_id}","starred_url":"https://api.github.com/users/annach453/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annach453/subscriptions","organizations_url":"https://api.github.com/users/annach453/orgs","repos_url":"https://api.github.com/users/annach453/repos","events_url":"https://api.github.com/users/annach453/events{/privacy}","received_events_url":"https://api.github.com/users/annach453/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/annach453/631285-keksobooking","description":"Анна","fork":true,"url":"https://api.github.com/repos/annach453/631285-keksobooking","forks_url":"https://api.github.com/repos/annach453/631285-keksobooking/forks","keys_url":"https://api.github.com/repos/annach453/631285-keksobooking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/annach453/631285-keksobooking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/annach453/631285-keksobooking/teams","hooks_url":"https://api.github.com/repos/annach453/631285-keksobooking/hooks","issue_events_url":"https://api.github.com/repos/annach453/631285-keksobooking/issues/events{/number}","events_url":"https://api.github.com/repos/annach453/631285-keksobooking/events","assignees_url":"https://api.github.com/repos/annach453/631285-keksobooking/assignees{/user}","branches_url":"https://api.github.com/repos/annach453/631285-keksobooking/branches{/branch}","tags_url":"https://api.github.com/repos/annach453/631285-keksobooking/tags","blobs_url":"https://api.github.com/repos/annach453/631285-keksobooking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/annach453/631285-keksobooking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/annach453/631285-keksobooking/git/refs{/sha}","trees_url":"https://api.github.com/repos/annach453/631285-keksobooking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/annach453/631285-keksobooking/statuses/{sha}","languages_url":"https://api.github.com/repos/annach453/631285-keksobooking/languages","stargazers_url":"https://api.github.com/repos/annach453/631285-keksobooking/stargazers","contributors_url":"https://api.github.com/repos/annach453/631285-keksobooking/contributors","subscribers_url":"https://api.github.com/repos/annach453/631285-keksobooking/subscribers","subscription_url":"https://api.github.com/repos/annach453/631285-keksobooking/subscription","commits_url":"https://api.github.com/repos/annach453/631285-keksobooking/commits{/sha}","git_commits_url":"https://api.github.com/repos/annach453/631285-keksobooking/git/commits{/sha}","comments_url":"https://api.github.com/repos/annach453/631285-keksobooking/comments{/number}","issue_comment_url":"https://api.github.com/repos/annach453/631285-keksobooking/issues/comments{/number}","contents_url":"https://api.github.com/repos/annach453/631285-keksobooking/contents/{+path}","compare_url":"https://api.github.com/repos/annach453/631285-keksobooking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/annach453/631285-keksobooking/merges","archive_url":"https://api.github.com/repos/annach453/631285-keksobooking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/annach453/631285-keksobooking/downloads","issues_url":"https://api.github.com/repos/annach453/631285-keksobooking/issues{/number}","pulls_url":"https://api.github.com/repos/annach453/631285-keksobooking/pulls{/number}","milestones_url":"https://api.github.com/repos/annach453/631285-keksobooking/milestones{/number}","notifications_url":"https://api.github.com/repos/annach453/631285-keksobooking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/annach453/631285-keksobooking/labels{/name}","releases_url":"https://api.github.com/repos/annach453/631285-keksobooking/releases{/id}","deployments_url":"https://api.github.com/repos/annach453/631285-keksobooking/deployments","created_at":"2018-03-30T21:38:53Z","updated_at":"2018-04-11T20:34:58Z","pushed_at":"2018-04-14T18:22:31Z","git_url":"git://github.com/annach453/631285-keksobooking.git","ssh_url":"git@github.com:annach453/631285-keksobooking.git","clone_url":"https://github.com/annach453/631285-keksobooking.git","svn_url":"https://github.com/annach453/631285-keksobooking","homepage":null,"size":577,"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":"c1a65bea7605681987049c8517cacbba366b6727","user":{"login":"htmlacademy-javascript","id":14179712,"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":127475205,"name":"631285-keksobooking","full_name":"htmlacademy-javascript/631285-keksobooking","owner":{"login":"htmlacademy-javascript","id":14179712,"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},"private":false,"html_url":"https://github.com/htmlacademy-javascript/631285-keksobooking","description":"Анна","fork":false,"url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking","forks_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/forks","keys_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/teams","hooks_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/events","assignees_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/tags","blobs_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/subscription","commits_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/merges","archive_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/downloads","issues_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/deployments","created_at":"2018-03-30T21:35:58Z","updated_at":"2018-03-31T12:27:59Z","pushed_at":"2018-04-14T18:22:32Z","git_url":"git://github.com/htmlacademy-javascript/631285-keksobooking.git","ssh_url":"git@github.com:htmlacademy-javascript/631285-keksobooking.git","clone_url":"https://github.com/htmlacademy-javascript/631285-keksobooking.git","svn_url":"https://github.com/htmlacademy-javascript/631285-keksobooking","homepage":"https://github.com/annach453/631285-keksobooking","size":577,"stargazers_count":0,"watchers_count":0,"language":"CSS","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-javascript/631285-keksobooking/pulls/3"},"html":{"href":"https://github.com/htmlacademy-javascript/631285-keksobooking/pull/3"},"issue":{"href":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/issues/3"},"comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-javascript/631285-keksobooking/statuses/e07feeb9dcc6ab0581ed60fcfc405ae239e6132d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"yandzee"}}