{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/pulls/comments/67436419","id":67436419,"diff_hunk":"@@ -37,8 +45,113 @@ var getReviewElement = function(data, container) {\n   return element;\n };\n \n-window.reviews.forEach(function(review) {\n-  getReviewElement(review, reviewsList);\n-});\n+var getReviews = function(callback) {\n+  var xhr = new XMLHttpRequest();\n+\n+  xhr.onload = function(evt) {\n+    var loadedData = JSON.parse(evt.target.response);\n+    callback(loadedData);\n+  };\n+\n+  xhr.open('GET', REVIEWS_LOAD_URL);\n+  xhr.send();\n+\n+  xhr.timeout = 30000;\n+\n+  xhr.onreadystatechange = function() {\n+    if (xhr.status !== 200) {\n+      reviewsContainer.classList.add('reviews-load-failure');\n+    }\n+  };\n+};\n+\n+var renderReviews = function(reviewsArr) {\n+  reviewsList.innerHTML = '';\n+\n+  reviewsArr.forEach(function(review) {\n+    getReviewElement(review, reviewsList);\n+  });\n+};\n \n-reviewsFilter.classList.remove('invisible');\n+\n+var getFilteredReviews = function(reviewsArr, filter) {\n+  var reviewsToFilter = reviewsArr.slice(0);\n+  reviewsContainer.classList.remove('reviews-list-loading');","path":"src/reviews.js","position":66,"original_position":66,"commit_id":"8fbf0d81c611c5a9c1e083af6ef7f5ab66b4ac17","original_commit_id":"8fbf0d81c611c5a9c1e083af6ef7f5ab66b4ac17","user":{"login":"nezed","id":1659008,"avatar_url":"https://avatars.githubusercontent.com/u/1659008?v=3","gravatar_id":"","url":"https://api.github.com/users/nezed","html_url":"https://github.com/nezed","followers_url":"https://api.github.com/users/nezed/followers","following_url":"https://api.github.com/users/nezed/following{/other_user}","gists_url":"https://api.github.com/users/nezed/gists{/gist_id}","starred_url":"https://api.github.com/users/nezed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nezed/subscriptions","organizations_url":"https://api.github.com/users/nezed/orgs","repos_url":"https://api.github.com/users/nezed/repos","events_url":"https://api.github.com/users/nezed/events{/privacy}","received_events_url":"https://api.github.com/users/nezed/received_events","type":"User","site_admin":false},"body":"Этот класс убирается по окончанию загрузки, а не при каждом филтровании","created_at":"2016-06-16T22:36:39Z","updated_at":"2016-06-16T22:36:39Z","html_url":"https://github.com/htmlacademy-javascript/31279-code-and-magick/pull/8#discussion_r67436419","pull_request_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/pulls/comments/67436419"},"html":{"href":"https://github.com/htmlacademy-javascript/31279-code-and-magick/pull/8#discussion_r67436419"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/pulls/8","id":73906793,"html_url":"https://github.com/htmlacademy-javascript/31279-code-and-magick/pull/8","diff_url":"https://github.com/htmlacademy-javascript/31279-code-and-magick/pull/8.diff","patch_url":"https://github.com/htmlacademy-javascript/31279-code-and-magick/pull/8.patch","issue_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/issues/8","number":8,"state":"open","locked":false,"title":"Робкое знакомство с AJAX","user":{"login":"aleksi4","id":6616395,"avatar_url":"https://avatars.githubusercontent.com/u/6616395?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksi4","html_url":"https://github.com/aleksi4","followers_url":"https://api.github.com/users/aleksi4/followers","following_url":"https://api.github.com/users/aleksi4/following{/other_user}","gists_url":"https://api.github.com/users/aleksi4/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksi4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksi4/subscriptions","organizations_url":"https://api.github.com/users/aleksi4/orgs","repos_url":"https://api.github.com/users/aleksi4/repos","events_url":"https://api.github.com/users/aleksi4/events{/privacy}","received_events_url":"https://api.github.com/users/aleksi4/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-15T13:00:02Z","updated_at":"2016-06-16T22:36:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1bf6807f04e3b192b8f0ba1b098ec41d0bcd9025","assignee":{"login":"nezed","id":1659008,"avatar_url":"https://avatars.githubusercontent.com/u/1659008?v=3","gravatar_id":"","url":"https://api.github.com/users/nezed","html_url":"https://github.com/nezed","followers_url":"https://api.github.com/users/nezed/followers","following_url":"https://api.github.com/users/nezed/following{/other_user}","gists_url":"https://api.github.com/users/nezed/gists{/gist_id}","starred_url":"https://api.github.com/users/nezed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nezed/subscriptions","organizations_url":"https://api.github.com/users/nezed/orgs","repos_url":"https://api.github.com/users/nezed/repos","events_url":"https://api.github.com/users/nezed/events{/privacy}","received_events_url":"https://api.github.com/users/nezed/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/pulls/8/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/pulls/8/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/issues/8/comments","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/statuses/8fbf0d81c611c5a9c1e083af6ef7f5ab66b4ac17","head":{"label":"aleksi4:module5-task1","ref":"module5-task1","sha":"8fbf0d81c611c5a9c1e083af6ef7f5ab66b4ac17","user":{"login":"aleksi4","id":6616395,"avatar_url":"https://avatars.githubusercontent.com/u/6616395?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksi4","html_url":"https://github.com/aleksi4","followers_url":"https://api.github.com/users/aleksi4/followers","following_url":"https://api.github.com/users/aleksi4/following{/other_user}","gists_url":"https://api.github.com/users/aleksi4/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksi4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksi4/subscriptions","organizations_url":"https://api.github.com/users/aleksi4/orgs","repos_url":"https://api.github.com/users/aleksi4/repos","events_url":"https://api.github.com/users/aleksi4/events{/privacy}","received_events_url":"https://api.github.com/users/aleksi4/received_events","type":"User","site_admin":false},"repo":{"id":59600382,"name":"31279-code-and-magick","full_name":"aleksi4/31279-code-and-magick","owner":{"login":"aleksi4","id":6616395,"avatar_url":"https://avatars.githubusercontent.com/u/6616395?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksi4","html_url":"https://github.com/aleksi4","followers_url":"https://api.github.com/users/aleksi4/followers","following_url":"https://api.github.com/users/aleksi4/following{/other_user}","gists_url":"https://api.github.com/users/aleksi4/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksi4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksi4/subscriptions","organizations_url":"https://api.github.com/users/aleksi4/orgs","repos_url":"https://api.github.com/users/aleksi4/repos","events_url":"https://api.github.com/users/aleksi4/events{/privacy}","received_events_url":"https://api.github.com/users/aleksi4/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aleksi4/31279-code-and-magick","description":"Александр Никонов","fork":true,"url":"https://api.github.com/repos/aleksi4/31279-code-and-magick","forks_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/forks","keys_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/teams","hooks_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/hooks","issue_events_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/issues/events{/number}","events_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/events","assignees_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/assignees{/user}","branches_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/branches{/branch}","tags_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/tags","blobs_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/git/refs{/sha}","trees_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/statuses/{sha}","languages_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/languages","stargazers_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/stargazers","contributors_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/contributors","subscribers_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/subscribers","subscription_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/subscription","commits_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/commits{/sha}","git_commits_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/git/commits{/sha}","comments_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/comments{/number}","issue_comment_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/issues/comments{/number}","contents_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/contents/{+path}","compare_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/merges","archive_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/downloads","issues_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/issues{/number}","pulls_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/pulls{/number}","milestones_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/milestones{/number}","notifications_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/labels{/name}","releases_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/releases{/id}","deployments_url":"https://api.github.com/repos/aleksi4/31279-code-and-magick/deployments","created_at":"2016-05-24T18:59:29Z","updated_at":"2016-05-24T18:59:30Z","pushed_at":"2016-06-15T12:58:48Z","git_url":"git://github.com/aleksi4/31279-code-and-magick.git","ssh_url":"git@github.com:aleksi4/31279-code-and-magick.git","clone_url":"https://github.com/aleksi4/31279-code-and-magick.git","svn_url":"https://github.com/aleksi4/31279-code-and-magick","homepage":null,"size":1070,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"htmlacademy-javascript:master","ref":"master","sha":"bfde602b2f2d1d371c038d5d001196fe19403046","user":{"login":"htmlacademy-javascript","id":14179712,"avatar_url":"https://avatars.githubusercontent.com/u/14179712?v=3","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":59600337,"name":"31279-code-and-magick","full_name":"htmlacademy-javascript/31279-code-and-magick","owner":{"login":"htmlacademy-javascript","id":14179712,"avatar_url":"https://avatars.githubusercontent.com/u/14179712?v=3","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/31279-code-and-magick","description":"Александр Никонов","fork":false,"url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick","forks_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/forks","keys_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/teams","hooks_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/events","assignees_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/tags","blobs_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/subscription","commits_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/merges","archive_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/downloads","issues_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/deployments","created_at":"2016-05-24T18:58:48Z","updated_at":"2016-05-24T19:19:57Z","pushed_at":"2016-06-15T13:00:02Z","git_url":"git://github.com/htmlacademy-javascript/31279-code-and-magick.git","ssh_url":"git@github.com:htmlacademy-javascript/31279-code-and-magick.git","clone_url":"https://github.com/htmlacademy-javascript/31279-code-and-magick.git","svn_url":"https://github.com/htmlacademy-javascript/31279-code-and-magick","homepage":"https://github.com/aleksi4/31279-code-and-magick","size":1116,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/pulls/8"},"html":{"href":"https://github.com/htmlacademy-javascript/31279-code-and-magick/pull/8"},"issue":{"href":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/issues/8"},"comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-javascript/31279-code-and-magick/statuses/8fbf0d81c611c5a9c1e083af6ef7f5ab66b4ac17"}}}}
{"actor":{"display_login":"nezed"}}