{"action":"created","comment":{"url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/pulls/comments/48104820","id":48104820,"diff_hunk":"@@ -23,23 +24,31 @@\n   * @const {number}\n   */\n   var IMAGE_TIMEOUT = 1000;\n+  var REVIEWS_IN_PAGE = 3;\n+  var currentPage = 0;\n+  var allReviews = null;\n \n   filter.classList.add('invisible');\n   reviewsContainer.classList.add('reviews-list-loading');\n+\n   loadData('data/reviews.json', function(error, data) {\n     reviewsContainer.classList.remove('reviews-list-loading');\n     if (error) {\n       reviewsContainer.classList.add('reviews-load-failure');\n       return;\n     }\n-    var allReviews = data;\n-    filter.addEventListener('click', function() {\n-      activeFilter = filter.querySelector('input:checked').value;\n-      renderReviews(filterReviews(allReviews));\n+    allReviews = data;\n+\n+    filter.addEventListener('click', function(evt) {\n+      currentPage = 0;\n+      activeFilter = evt.target.value;\n+      renderReviews(filterReviews(allReviews), currentPage, true);\n+      showReviewsBtn.classList.remove('invisible');","path":"js/reviews.js","position":35,"original_position":35,"commit_id":"f7d8a55e612c350c1a93eb676e12940b555b648e","original_commit_id":"f7d8a55e612c350c1a93eb676e12940b555b648e","user":{"login":"4u","id":304576,"avatar_url":"https://avatars.githubusercontent.com/u/304576?v=3","gravatar_id":"","url":"https://api.github.com/users/4u","html_url":"https://github.com/4u","followers_url":"https://api.github.com/users/4u/followers","following_url":"https://api.github.com/users/4u/following{/other_user}","gists_url":"https://api.github.com/users/4u/gists{/gist_id}","starred_url":"https://api.github.com/users/4u/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4u/subscriptions","organizations_url":"https://api.github.com/users/4u/orgs","repos_url":"https://api.github.com/users/4u/repos","events_url":"https://api.github.com/users/4u/events{/privacy}","received_events_url":"https://api.github.com/users/4u/received_events","type":"User","site_admin":false},"body":"только если есть еще страницы","created_at":"2015-12-20T16:03:38Z","updated_at":"2015-12-20T16:03:38Z","html_url":"https://github.com/js-htmlacademy/50014-code-and-magick/pull/11#discussion_r48104820","pull_request_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/pulls/comments/48104820"},"html":{"href":"https://github.com/js-htmlacademy/50014-code-and-magick/pull/11#discussion_r48104820"},"pull_request":{"href":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/pulls/11","id":54185967,"html_url":"https://github.com/js-htmlacademy/50014-code-and-magick/pull/11","diff_url":"https://github.com/js-htmlacademy/50014-code-and-magick/pull/11.diff","patch_url":"https://github.com/js-htmlacademy/50014-code-and-magick/pull/11.patch","issue_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/issues/11","number":11,"state":"open","locked":false,"title":"Постраничный вывод и делегирование событий","user":{"login":"Yorkina","id":9257720,"avatar_url":"https://avatars.githubusercontent.com/u/9257720?v=3","gravatar_id":"","url":"https://api.github.com/users/Yorkina","html_url":"https://github.com/Yorkina","followers_url":"https://api.github.com/users/Yorkina/followers","following_url":"https://api.github.com/users/Yorkina/following{/other_user}","gists_url":"https://api.github.com/users/Yorkina/gists{/gist_id}","starred_url":"https://api.github.com/users/Yorkina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yorkina/subscriptions","organizations_url":"https://api.github.com/users/Yorkina/orgs","repos_url":"https://api.github.com/users/Yorkina/repos","events_url":"https://api.github.com/users/Yorkina/events{/privacy}","received_events_url":"https://api.github.com/users/Yorkina/received_events","type":"User","site_admin":false},"body":"\n\n--\n:boom: https://js-htmlacademy.github.io/50014-code-and-magick/11/","created_at":"2015-12-19T20:29:50Z","updated_at":"2015-12-20T16:03:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62377404732348954cdc4587568f32ef3518badd","assignee":{"login":"4u","id":304576,"avatar_url":"https://avatars.githubusercontent.com/u/304576?v=3","gravatar_id":"","url":"https://api.github.com/users/4u","html_url":"https://github.com/4u","followers_url":"https://api.github.com/users/4u/followers","following_url":"https://api.github.com/users/4u/following{/other_user}","gists_url":"https://api.github.com/users/4u/gists{/gist_id}","starred_url":"https://api.github.com/users/4u/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4u/subscriptions","organizations_url":"https://api.github.com/users/4u/orgs","repos_url":"https://api.github.com/users/4u/repos","events_url":"https://api.github.com/users/4u/events{/privacy}","received_events_url":"https://api.github.com/users/4u/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/pulls/11/commits","review_comments_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/pulls/11/comments","review_comment_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/pulls/comments{/number}","comments_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/issues/11/comments","statuses_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/statuses/f7d8a55e612c350c1a93eb676e12940b555b648e","head":{"label":"Yorkina:module6-task1","ref":"module6-task1","sha":"f7d8a55e612c350c1a93eb676e12940b555b648e","user":{"login":"Yorkina","id":9257720,"avatar_url":"https://avatars.githubusercontent.com/u/9257720?v=3","gravatar_id":"","url":"https://api.github.com/users/Yorkina","html_url":"https://github.com/Yorkina","followers_url":"https://api.github.com/users/Yorkina/followers","following_url":"https://api.github.com/users/Yorkina/following{/other_user}","gists_url":"https://api.github.com/users/Yorkina/gists{/gist_id}","starred_url":"https://api.github.com/users/Yorkina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yorkina/subscriptions","organizations_url":"https://api.github.com/users/Yorkina/orgs","repos_url":"https://api.github.com/users/Yorkina/repos","events_url":"https://api.github.com/users/Yorkina/events{/privacy}","received_events_url":"https://api.github.com/users/Yorkina/received_events","type":"User","site_admin":false},"repo":{"id":45935675,"name":"50014-code-and-magick","full_name":"Yorkina/50014-code-and-magick","owner":{"login":"Yorkina","id":9257720,"avatar_url":"https://avatars.githubusercontent.com/u/9257720?v=3","gravatar_id":"","url":"https://api.github.com/users/Yorkina","html_url":"https://github.com/Yorkina","followers_url":"https://api.github.com/users/Yorkina/followers","following_url":"https://api.github.com/users/Yorkina/following{/other_user}","gists_url":"https://api.github.com/users/Yorkina/gists{/gist_id}","starred_url":"https://api.github.com/users/Yorkina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yorkina/subscriptions","organizations_url":"https://api.github.com/users/Yorkina/orgs","repos_url":"https://api.github.com/users/Yorkina/repos","events_url":"https://api.github.com/users/Yorkina/events{/privacy}","received_events_url":"https://api.github.com/users/Yorkina/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Yorkina/50014-code-and-magick","description":"Наталья Ёркина","fork":true,"url":"https://api.github.com/repos/Yorkina/50014-code-and-magick","forks_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/forks","keys_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/teams","hooks_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/hooks","issue_events_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/issues/events{/number}","events_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/events","assignees_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/assignees{/user}","branches_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/branches{/branch}","tags_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/tags","blobs_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/statuses/{sha}","languages_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/languages","stargazers_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/stargazers","contributors_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/contributors","subscribers_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/subscribers","subscription_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/subscription","commits_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/contents/{+path}","compare_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/merges","archive_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/downloads","issues_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/issues{/number}","pulls_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/pulls{/number}","milestones_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/milestones{/number}","notifications_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/labels{/name}","releases_url":"https://api.github.com/repos/Yorkina/50014-code-and-magick/releases{/id}","created_at":"2015-11-10T19:37:34Z","updated_at":"2015-11-10T19:37:34Z","pushed_at":"2015-12-20T10:31:04Z","git_url":"git://github.com/Yorkina/50014-code-and-magick.git","ssh_url":"git@github.com:Yorkina/50014-code-and-magick.git","clone_url":"https://github.com/Yorkina/50014-code-and-magick.git","svn_url":"https://github.com/Yorkina/50014-code-and-magick","homepage":null,"size":1102,"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":"js-htmlacademy:master","ref":"master","sha":"2739f1a9e0c3bdb7bffd4b02b12e1a0f50b17718","user":{"login":"js-htmlacademy","id":14179712,"avatar_url":"https://avatars.githubusercontent.com/u/14179712?v=3","gravatar_id":"","url":"https://api.github.com/users/js-htmlacademy","html_url":"https://github.com/js-htmlacademy","followers_url":"https://api.github.com/users/js-htmlacademy/followers","following_url":"https://api.github.com/users/js-htmlacademy/following{/other_user}","gists_url":"https://api.github.com/users/js-htmlacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/js-htmlacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/js-htmlacademy/subscriptions","organizations_url":"https://api.github.com/users/js-htmlacademy/orgs","repos_url":"https://api.github.com/users/js-htmlacademy/repos","events_url":"https://api.github.com/users/js-htmlacademy/events{/privacy}","received_events_url":"https://api.github.com/users/js-htmlacademy/received_events","type":"Organization","site_admin":false},"repo":{"id":45935600,"name":"50014-code-and-magick","full_name":"js-htmlacademy/50014-code-and-magick","owner":{"login":"js-htmlacademy","id":14179712,"avatar_url":"https://avatars.githubusercontent.com/u/14179712?v=3","gravatar_id":"","url":"https://api.github.com/users/js-htmlacademy","html_url":"https://github.com/js-htmlacademy","followers_url":"https://api.github.com/users/js-htmlacademy/followers","following_url":"https://api.github.com/users/js-htmlacademy/following{/other_user}","gists_url":"https://api.github.com/users/js-htmlacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/js-htmlacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/js-htmlacademy/subscriptions","organizations_url":"https://api.github.com/users/js-htmlacademy/orgs","repos_url":"https://api.github.com/users/js-htmlacademy/repos","events_url":"https://api.github.com/users/js-htmlacademy/events{/privacy}","received_events_url":"https://api.github.com/users/js-htmlacademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/js-htmlacademy/50014-code-and-magick","description":"Наталья Ёркина","fork":false,"url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick","forks_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/forks","keys_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/teams","hooks_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/hooks","issue_events_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/issues/events{/number}","events_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/events","assignees_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/assignees{/user}","branches_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/branches{/branch}","tags_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/tags","blobs_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/git/refs{/sha}","trees_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/statuses/{sha}","languages_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/languages","stargazers_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/stargazers","contributors_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/contributors","subscribers_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/subscribers","subscription_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/subscription","commits_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/commits{/sha}","git_commits_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/git/commits{/sha}","comments_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/comments{/number}","issue_comment_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/issues/comments{/number}","contents_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/contents/{+path}","compare_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/merges","archive_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/downloads","issues_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/issues{/number}","pulls_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/pulls{/number}","milestones_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/milestones{/number}","notifications_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/labels{/name}","releases_url":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/releases{/id}","created_at":"2015-11-10T19:36:38Z","updated_at":"2015-11-13T12:44:31Z","pushed_at":"2015-12-20T10:33:04Z","git_url":"git://github.com/js-htmlacademy/50014-code-and-magick.git","ssh_url":"git@github.com:js-htmlacademy/50014-code-and-magick.git","clone_url":"https://github.com/js-htmlacademy/50014-code-and-magick.git","svn_url":"https://github.com/js-htmlacademy/50014-code-and-magick","homepage":"https://github.com/Yorkina/50014-code-and-magick","size":1129,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/pulls/11"},"html":{"href":"https://github.com/js-htmlacademy/50014-code-and-magick/pull/11"},"issue":{"href":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/issues/11"},"comments":{"href":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/js-htmlacademy/50014-code-and-magick/statuses/f7d8a55e612c350c1a93eb676e12940b555b648e"}}}}