{"action":"created","comment":{"url":"https://api.github.com/repos/vvscode/js--base-course/pulls/comments/120015263","pull_request_review_id":41946162,"id":120015263,"diff_hunk":"@@ -0,0 +1,213 @@\n+window.onload = function () {\r\n+\r\n+\tvar settingsRuler = document.getElementById(\"settings__ruler\");\r\n+\tvar settingsCreateNote = document.getElementById(\"settings__create-note\");\r\n+\tvar settingsDeleteNote = document.getElementById(\"settings__delete-note\");\r\n+\tvar settingsCreateTitle = document.getElementById(\"settings__calendar-title\");\r\n+\tvar createButton = document.getElementById(\"create-calendar\");\r\n+\r\n+\tfunction createCalendar() {\r\n+\t\tvar d = new Date();\r\n+\t\tvar month = d.getMonth(); \r\n+\t\tvar year = d.getFullYear();\r\n+\t\tvar date = d.getDate();\r\n+\t\tvar monthNameArray = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\r\n+\t\tvar titleValue = settingsCreateTitle.value;\r\n+\r\n+\r\n+\t\tvar calendarWrapper = document.createElement('DIV');\r\n+\t\tcalendarWrapper.className = \"calendar__wrapper\";\r\n+\t\tdocument.body.appendChild(calendarWrapper);\r\n+\r\n+\r\n+\t\tif (titleValue != false) {\r\n+\t\t\tvar calendarTitle = document.createElement('DIV');\r\n+\t\t\tcalendarTitle.className = \"calendar__title\";\r\n+\t\t\tcalendarTitle.innerHTML = titleValue;\r\n+\t\t\tcalendarWrapper.appendChild(calendarTitle);\r\n+\t\t}\r\n+\r\n+\t\tvar calendarHeader = document.createElement('DIV');\r\n+\t\tcalendarHeader.className = \"calendar__header\";\r\n+\t\tcalendarWrapper.appendChild(calendarHeader);\r\n+\r\n+\t\tif (settingsRuler.checked == false) {\r\n+\t\t\tvar prevMonth = document.createElement('BUTTON');\r\n+\t\t\tprevMonth.className = \"calendar__ruler\";\r\n+\t\t\tprevMonth.innerHTML = \"<\";\r\n+\t\t\tcalendarHeader.appendChild(prevMonth);\r\n+\t\t}\r\n+\r\n+\t\tprevMonth.addEventListener('click', function() {\r\n+\t\t\tif (--month < 0) {\r\n+\t\t\t\tmonth = 11;\r\n+\t\t\t} else {\r\n+\t\t\t\tmonth = month;\r\n+\t\t\t}\r\n+\t\t\tcurrentMonth.innerHTML = monthNameArray[month];\r\n+\t\t\ttable.innerHTML = '';\r\n+\t\t\tnewCalendar(year, month);\r\n+\t\t});\r\n+\r\n+\t\t\r\n+\t\tvar currentMonth = document.createElement('DIV');\r\n+\t\tcurrentMonth.className = \"calendar__month-name\";\r\n+\t\tcurrentMonth.innerHTML = monthNameArray[month];\r\n+\t\tcalendarHeader.appendChild(currentMonth);\r\n+\r\n+\r\n+\t\tif (settingsRuler.checked == false) {\r\n+\t\t\tvar nextMonth = document.createElement('BUTTON');\r\n+\t\t\tnextMonth.className = \"calendar__ruler\";\r\n+\t\t\tnextMonth.innerHTML = \">\";\r\n+\t\t\tcalendarHeader.appendChild(nextMonth);\r\n+\t\t}\r\n+\r\n+\t\tnextMonth.addEventListener('click', function() {\r\n+\t\t\tmonth = ++month % 12;\r\n+\t\t\tcurrentMonth.innerHTML = monthNameArray[month];\r\n+\t\t\ttable.innerHTML = '';\r\n+\t\t\tnewCalendar(year, month);\r\n+\t\t});\r\n+\t\t\r\n+\r\n+\t\tvar table = document.createElement('TABLE');\r\n+\t\ttable.className = \"calendar__table\";\r\n+\t\t\r\n+\r\n+\r\n+\t\tfunction newCalendar (year, month) {\r\n+\t\t\tvar firstDateThisMonth = new Date(year, month, 1); \r\n+\t\t\tvar lastDateThisMonth = new Date(year, month + 1, 0); \r\n+\t\t\t\r\n+\r\n+\t\t\tfunction newCalendar (year, month) {\r\n+\t\t\t\tvar firstDateThisMonth = new Date(year, month, 1); \r\n+\t      \t\tvar tableRow = table.insertRow();\r\n+\t     \t\tfor (var i = 0; i < getDay(firstDateThisMonth); i++) {\r\n+\t\t\t\t\tvar tableCell = tableRow.insertCell();\r\n+\t\t\t\t\ttableCell.className = \"calendar__table-cell\";\r\n+\t\t\t\t}\r\n+\r\n+\t     \t\twhile (firstDateThisMonth.getMonth() == month) {\r\n+\t\t\t\t\tvar tableCell = tableRow.insertCell();\r\n+\t\t\t\t\ttableCell.innerHTML = firstDateThisMonth.getDate();\r\n+\t\t\t\t\ttableCell.id = \"c\" + firstDateThisMonth.getTime();\r\n+\t\t\t\t\ttableCell.className = \"calendar__table-cell\";\r\n+\r\n+\t       \t\t\tif (getDay(firstDateThisMonth) % 7 === 6) {\r\n+\t\t\t\t\t\ttableRow = table.insertRow();\r\n+\t\t\t\t\t}\r\n+\t\t\t\t\tfirstDateThisMonth.setDate(firstDateThisMonth.getDate() + 1);\r\n+\t\t\t\t}\r\n+\r\n+\r\n+\t\t\t\tfunction getDay(date) { // weekdays Monday (0) to Sunday (6)\r\n+\t\t\t\t\tvar weekDay = date.getDay();\r\n+\t\t\t\t\t\tif (weekDay === 0) weekDay = 7;\r\n+\t\t\t\t\t\treturn weekDay - 1;\r\n+\t\t\t\t\t}\r\n+\r\n+\t\t\t\t\tif (getDay(firstDateThisMonth) !== 0) {\r\n+\t\t\t\t\t\tfor (i = getDay(lastDateThisMonth); i < 6; i++) {\r\n+\t\t\t\t\t\t\tvar tableCell = tableRow.insertCell();\r\n+\t\t\t\t\t\t\ttableCell.className = \"calendar__table-cell\";\r\n+\t\t\t\t\t\t}\r\n+\t\t\t\t\t}\r\n+\r\n+\t\t\t\t\tcalendarWrapper.appendChild(table);\r\n+\t\t\t\t}\t\r\n+\r\n+\t\t\t\tnewCalendar(year, month);\r\n+\r\n+\t\t\t\r\n+\t\t\tif (settingsCreateNote.checked == false) {\r\n+\r\n+\t\t\t\ttable.onclick = function(event) {\r","path":"02/ht/AlesiaGit/script.js","position":126,"original_position":126,"commit_id":"37d0b58f298f270098d36673e2238ffdeaa3cc3f","original_commit_id":"37d0b58f298f270098d36673e2238ffdeaa3cc3f","user":{"login":"vvscode","id":6904368,"avatar_url":"https://avatars2.githubusercontent.com/u/6904368?v=3","gravatar_id":"","url":"https://api.github.com/users/vvscode","html_url":"https://github.com/vvscode","followers_url":"https://api.github.com/users/vvscode/followers","following_url":"https://api.github.com/users/vvscode/following{/other_user}","gists_url":"https://api.github.com/users/vvscode/gists{/gist_id}","starred_url":"https://api.github.com/users/vvscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvscode/subscriptions","organizations_url":"https://api.github.com/users/vvscode/orgs","repos_url":"https://api.github.com/users/vvscode/repos","events_url":"https://api.github.com/users/vvscode/events{/privacy}","received_events_url":"https://api.github.com/users/vvscode/received_events","type":"User","site_admin":false},"body":"тоже самое - почему лучше `addEventListener` ?","created_at":"2017-06-04T17:09:00Z","updated_at":"2017-06-04T17:09:01Z","html_url":"https://github.com/vvscode/js--base-course/pull/35#discussion_r120015263","pull_request_url":"https://api.github.com/repos/vvscode/js--base-course/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/vvscode/js--base-course/pulls/comments/120015263"},"html":{"href":"https://github.com/vvscode/js--base-course/pull/35#discussion_r120015263"},"pull_request":{"href":"https://api.github.com/repos/vvscode/js--base-course/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/vvscode/js--base-course/pulls/35","id":123750198,"html_url":"https://github.com/vvscode/js--base-course/pull/35","diff_url":"https://github.com/vvscode/js--base-course/pull/35.diff","patch_url":"https://github.com/vvscode/js--base-course/pull/35.patch","issue_url":"https://api.github.com/repos/vvscode/js--base-course/issues/35","number":35,"state":"open","locked":false,"title":"02","user":{"login":"AlesiaGit","id":25744907,"avatar_url":"https://avatars2.githubusercontent.com/u/25744907?v=3","gravatar_id":"","url":"https://api.github.com/users/AlesiaGit","html_url":"https://github.com/AlesiaGit","followers_url":"https://api.github.com/users/AlesiaGit/followers","following_url":"https://api.github.com/users/AlesiaGit/following{/other_user}","gists_url":"https://api.github.com/users/AlesiaGit/gists{/gist_id}","starred_url":"https://api.github.com/users/AlesiaGit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlesiaGit/subscriptions","organizations_url":"https://api.github.com/users/AlesiaGit/orgs","repos_url":"https://api.github.com/users/AlesiaGit/repos","events_url":"https://api.github.com/users/AlesiaGit/events{/privacy}","received_events_url":"https://api.github.com/users/AlesiaGit/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-06-02T16:05:45Z","updated_at":"2017-06-04T17:09:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fdf89ec1d38a8438e8ab4dfe8745d3eedaeb91d6","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/vvscode/js--base-course/pulls/35/commits","review_comments_url":"https://api.github.com/repos/vvscode/js--base-course/pulls/35/comments","review_comment_url":"https://api.github.com/repos/vvscode/js--base-course/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vvscode/js--base-course/issues/35/comments","statuses_url":"https://api.github.com/repos/vvscode/js--base-course/statuses/37d0b58f298f270098d36673e2238ffdeaa3cc3f","head":{"label":"AlesiaGit:02","ref":"02","sha":"37d0b58f298f270098d36673e2238ffdeaa3cc3f","user":{"login":"AlesiaGit","id":25744907,"avatar_url":"https://avatars2.githubusercontent.com/u/25744907?v=3","gravatar_id":"","url":"https://api.github.com/users/AlesiaGit","html_url":"https://github.com/AlesiaGit","followers_url":"https://api.github.com/users/AlesiaGit/followers","following_url":"https://api.github.com/users/AlesiaGit/following{/other_user}","gists_url":"https://api.github.com/users/AlesiaGit/gists{/gist_id}","starred_url":"https://api.github.com/users/AlesiaGit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlesiaGit/subscriptions","organizations_url":"https://api.github.com/users/AlesiaGit/orgs","repos_url":"https://api.github.com/users/AlesiaGit/repos","events_url":"https://api.github.com/users/AlesiaGit/events{/privacy}","received_events_url":"https://api.github.com/users/AlesiaGit/received_events","type":"User","site_admin":false},"repo":{"id":91793328,"name":"js--base-course","full_name":"AlesiaGit/js--base-course","owner":{"login":"AlesiaGit","id":25744907,"avatar_url":"https://avatars2.githubusercontent.com/u/25744907?v=3","gravatar_id":"","url":"https://api.github.com/users/AlesiaGit","html_url":"https://github.com/AlesiaGit","followers_url":"https://api.github.com/users/AlesiaGit/followers","following_url":"https://api.github.com/users/AlesiaGit/following{/other_user}","gists_url":"https://api.github.com/users/AlesiaGit/gists{/gist_id}","starred_url":"https://api.github.com/users/AlesiaGit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlesiaGit/subscriptions","organizations_url":"https://api.github.com/users/AlesiaGit/orgs","repos_url":"https://api.github.com/users/AlesiaGit/repos","events_url":"https://api.github.com/users/AlesiaGit/events{/privacy}","received_events_url":"https://api.github.com/users/AlesiaGit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlesiaGit/js--base-course","description":"Базовый курс JS","fork":true,"url":"https://api.github.com/repos/AlesiaGit/js--base-course","forks_url":"https://api.github.com/repos/AlesiaGit/js--base-course/forks","keys_url":"https://api.github.com/repos/AlesiaGit/js--base-course/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlesiaGit/js--base-course/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlesiaGit/js--base-course/teams","hooks_url":"https://api.github.com/repos/AlesiaGit/js--base-course/hooks","issue_events_url":"https://api.github.com/repos/AlesiaGit/js--base-course/issues/events{/number}","events_url":"https://api.github.com/repos/AlesiaGit/js--base-course/events","assignees_url":"https://api.github.com/repos/AlesiaGit/js--base-course/assignees{/user}","branches_url":"https://api.github.com/repos/AlesiaGit/js--base-course/branches{/branch}","tags_url":"https://api.github.com/repos/AlesiaGit/js--base-course/tags","blobs_url":"https://api.github.com/repos/AlesiaGit/js--base-course/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlesiaGit/js--base-course/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlesiaGit/js--base-course/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlesiaGit/js--base-course/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlesiaGit/js--base-course/statuses/{sha}","languages_url":"https://api.github.com/repos/AlesiaGit/js--base-course/languages","stargazers_url":"https://api.github.com/repos/AlesiaGit/js--base-course/stargazers","contributors_url":"https://api.github.com/repos/AlesiaGit/js--base-course/contributors","subscribers_url":"https://api.github.com/repos/AlesiaGit/js--base-course/subscribers","subscription_url":"https://api.github.com/repos/AlesiaGit/js--base-course/subscription","commits_url":"https://api.github.com/repos/AlesiaGit/js--base-course/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlesiaGit/js--base-course/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlesiaGit/js--base-course/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlesiaGit/js--base-course/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlesiaGit/js--base-course/contents/{+path}","compare_url":"https://api.github.com/repos/AlesiaGit/js--base-course/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlesiaGit/js--base-course/merges","archive_url":"https://api.github.com/repos/AlesiaGit/js--base-course/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlesiaGit/js--base-course/downloads","issues_url":"https://api.github.com/repos/AlesiaGit/js--base-course/issues{/number}","pulls_url":"https://api.github.com/repos/AlesiaGit/js--base-course/pulls{/number}","milestones_url":"https://api.github.com/repos/AlesiaGit/js--base-course/milestones{/number}","notifications_url":"https://api.github.com/repos/AlesiaGit/js--base-course/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlesiaGit/js--base-course/labels{/name}","releases_url":"https://api.github.com/repos/AlesiaGit/js--base-course/releases{/id}","deployments_url":"https://api.github.com/repos/AlesiaGit/js--base-course/deployments","created_at":"2017-05-19T10:06:42Z","updated_at":"2017-05-26T17:57:02Z","pushed_at":"2017-06-02T17:35:18Z","git_url":"git://github.com/AlesiaGit/js--base-course.git","ssh_url":"git@github.com:AlesiaGit/js--base-course.git","clone_url":"https://github.com/AlesiaGit/js--base-course.git","svn_url":"https://github.com/AlesiaGit/js--base-course","homepage":null,"size":92,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"vvscode:master","ref":"master","sha":"701ebf6d473eb3ab7d57ecf6b87533b6474afe31","user":{"login":"vvscode","id":6904368,"avatar_url":"https://avatars2.githubusercontent.com/u/6904368?v=3","gravatar_id":"","url":"https://api.github.com/users/vvscode","html_url":"https://github.com/vvscode","followers_url":"https://api.github.com/users/vvscode/followers","following_url":"https://api.github.com/users/vvscode/following{/other_user}","gists_url":"https://api.github.com/users/vvscode/gists{/gist_id}","starred_url":"https://api.github.com/users/vvscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvscode/subscriptions","organizations_url":"https://api.github.com/users/vvscode/orgs","repos_url":"https://api.github.com/users/vvscode/repos","events_url":"https://api.github.com/users/vvscode/events{/privacy}","received_events_url":"https://api.github.com/users/vvscode/received_events","type":"User","site_admin":false},"repo":{"id":85982423,"name":"js--base-course","full_name":"vvscode/js--base-course","owner":{"login":"vvscode","id":6904368,"avatar_url":"https://avatars2.githubusercontent.com/u/6904368?v=3","gravatar_id":"","url":"https://api.github.com/users/vvscode","html_url":"https://github.com/vvscode","followers_url":"https://api.github.com/users/vvscode/followers","following_url":"https://api.github.com/users/vvscode/following{/other_user}","gists_url":"https://api.github.com/users/vvscode/gists{/gist_id}","starred_url":"https://api.github.com/users/vvscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvscode/subscriptions","organizations_url":"https://api.github.com/users/vvscode/orgs","repos_url":"https://api.github.com/users/vvscode/repos","events_url":"https://api.github.com/users/vvscode/events{/privacy}","received_events_url":"https://api.github.com/users/vvscode/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vvscode/js--base-course","description":"Базовый курс JS","fork":false,"url":"https://api.github.com/repos/vvscode/js--base-course","forks_url":"https://api.github.com/repos/vvscode/js--base-course/forks","keys_url":"https://api.github.com/repos/vvscode/js--base-course/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vvscode/js--base-course/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vvscode/js--base-course/teams","hooks_url":"https://api.github.com/repos/vvscode/js--base-course/hooks","issue_events_url":"https://api.github.com/repos/vvscode/js--base-course/issues/events{/number}","events_url":"https://api.github.com/repos/vvscode/js--base-course/events","assignees_url":"https://api.github.com/repos/vvscode/js--base-course/assignees{/user}","branches_url":"https://api.github.com/repos/vvscode/js--base-course/branches{/branch}","tags_url":"https://api.github.com/repos/vvscode/js--base-course/tags","blobs_url":"https://api.github.com/repos/vvscode/js--base-course/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vvscode/js--base-course/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vvscode/js--base-course/git/refs{/sha}","trees_url":"https://api.github.com/repos/vvscode/js--base-course/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vvscode/js--base-course/statuses/{sha}","languages_url":"https://api.github.com/repos/vvscode/js--base-course/languages","stargazers_url":"https://api.github.com/repos/vvscode/js--base-course/stargazers","contributors_url":"https://api.github.com/repos/vvscode/js--base-course/contributors","subscribers_url":"https://api.github.com/repos/vvscode/js--base-course/subscribers","subscription_url":"https://api.github.com/repos/vvscode/js--base-course/subscription","commits_url":"https://api.github.com/repos/vvscode/js--base-course/commits{/sha}","git_commits_url":"https://api.github.com/repos/vvscode/js--base-course/git/commits{/sha}","comments_url":"https://api.github.com/repos/vvscode/js--base-course/comments{/number}","issue_comment_url":"https://api.github.com/repos/vvscode/js--base-course/issues/comments{/number}","contents_url":"https://api.github.com/repos/vvscode/js--base-course/contents/{+path}","compare_url":"https://api.github.com/repos/vvscode/js--base-course/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vvscode/js--base-course/merges","archive_url":"https://api.github.com/repos/vvscode/js--base-course/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vvscode/js--base-course/downloads","issues_url":"https://api.github.com/repos/vvscode/js--base-course/issues{/number}","pulls_url":"https://api.github.com/repos/vvscode/js--base-course/pulls{/number}","milestones_url":"https://api.github.com/repos/vvscode/js--base-course/milestones{/number}","notifications_url":"https://api.github.com/repos/vvscode/js--base-course/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vvscode/js--base-course/labels{/name}","releases_url":"https://api.github.com/repos/vvscode/js--base-course/releases{/id}","deployments_url":"https://api.github.com/repos/vvscode/js--base-course/deployments","created_at":"2017-03-23T18:10:10Z","updated_at":"2017-05-27T16:15:43Z","pushed_at":"2017-06-03T18:04:51Z","git_url":"git://github.com/vvscode/js--base-course.git","ssh_url":"git@github.com:vvscode/js--base-course.git","clone_url":"https://github.com/vvscode/js--base-course.git","svn_url":"https://github.com/vvscode/js--base-course","homepage":null,"size":93,"stargazers_count":3,"watchers_count":3,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":17,"forks":13,"open_issues":17,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vvscode/js--base-course/pulls/35"},"html":{"href":"https://github.com/vvscode/js--base-course/pull/35"},"issue":{"href":"https://api.github.com/repos/vvscode/js--base-course/issues/35"},"comments":{"href":"https://api.github.com/repos/vvscode/js--base-course/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/vvscode/js--base-course/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/vvscode/js--base-course/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vvscode/js--base-course/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/vvscode/js--base-course/statuses/37d0b58f298f270098d36673e2238ffdeaa3cc3f"}}}}
{"actor":{"display_login":"vvscode"}}