{"action":"created","comment":{"url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/pulls/comments/27044189","id":27044189,"diff_hunk":"@@ -0,0 +1,66 @@\n+//For fields having the same max and min you can use default values\n+//For field with specified max and min you can specify them by data-min or data-max attributes.\n+// For fields with unliminited max you can specify data-max=\"unlimit\".\n+\n+\n+(function() {\n+  var wdg_counters = document.querySelectorAll('.js-counter');\n+  // var input_tmpl = document.querySelector('#input-template').innerHTML;\n+  // var adults = ['взрослого'];\n+  // var children = ['ребенка'];\n+\n+  var min_counter = 0;\n+  var max_counter = 30;\n+  for(var i = 0, len = wdg_counters.length; i < len; i++){\n+    var counter = wdg_counters[i];\n+    var input = counter.querySelector('input');\n+\n+    input.oninput = checkCounter;\n+    counter.onclick = changeCounter;\n+\n+  }\n+\n+\n+  function changeCounter(e){\n+    var e = e || window.event;\n+    var target = e.target;\n+\n+    if(target.tagName != 'BUTTON') return;\n+\n+    var input = this.querySelector('input');\n+    var min = input.dataset.min || min_counter;\n+    var max = input.dataset.max || max_counter;\n+\n+     if(target.dataset.count == 'minus') {\n+      if(--input.value < min) input.value = min;\n+\n+     }\n+     if(target.dataset.count == 'plus') {\n+      max != 'unlimit' && input.value > (max-1)? input.value = max : ++input.value;\n+\n+     }\n+    return false;\n+  };\n+\n+  function checkCounter(e){\n+    var e = e || window.event;\n+    var target = e.target;\n+    var min = target.dataset.min || min_counter;\n+    var max = target.dataset.max || max_counter;\n+    var val = checkValue(target.value, min, max);\n+    target.value = val;\n+  };\n+\n+  function checkValue(val, min, max){\n+    var res = parseInt(val);\n+\n+    if(isNaN(res) || res < min) res = min;\n+\n+    if(max != 'unlimit' && res > parseInt(max)) res = max;","path":"sedona_feedback_page/js/script.js","position":59,"original_position":59,"commit_id":"0947f3cea2a5af0090173621b0a266502ce678b8","original_commit_id":"0947f3cea2a5af0090173621b0a266502ce678b8","user":{"login":"aalexeev239","id":6787602,"avatar_url":"https://avatars.githubusercontent.com/u/6787602?v=3","gravatar_id":"","url":"https://api.github.com/users/aalexeev239","html_url":"https://github.com/aalexeev239","followers_url":"https://api.github.com/users/aalexeev239/followers","following_url":"https://api.github.com/users/aalexeev239/following{/other_user}","gists_url":"https://api.github.com/users/aalexeev239/gists{/gist_id}","starred_url":"https://api.github.com/users/aalexeev239/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalexeev239/subscriptions","organizations_url":"https://api.github.com/users/aalexeev239/orgs","repos_url":"https://api.github.com/users/aalexeev239/repos","events_url":"https://api.github.com/users/aalexeev239/events{/privacy}","received_events_url":"https://api.github.com/users/aalexeev239/received_events","type":"User","site_admin":false},"body":"аналогично retutn max","created_at":"2015-03-24T16:16:02Z","updated_at":"2015-03-24T16:16:02Z","html_url":"https://github.com/up-htmlacademy/17099-Sedona/pull/2#discussion_r27044189","pull_request_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/pulls/comments/27044189"},"html":{"href":"https://github.com/up-htmlacademy/17099-Sedona/pull/2#discussion_r27044189"},"pull_request":{"href":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/pulls/2","id":31673372,"html_url":"https://github.com/up-htmlacademy/17099-Sedona/pull/2","diff_url":"https://github.com/up-htmlacademy/17099-Sedona/pull/2.diff","patch_url":"https://github.com/up-htmlacademy/17099-Sedona/pull/2.patch","issue_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/issues/2","number":2,"state":"open","locked":false,"title":"первое задание по javascript","user":{"login":"Irena-jane","id":4623289,"avatar_url":"https://avatars.githubusercontent.com/u/4623289?v=3","gravatar_id":"","url":"https://api.github.com/users/Irena-jane","html_url":"https://github.com/Irena-jane","followers_url":"https://api.github.com/users/Irena-jane/followers","following_url":"https://api.github.com/users/Irena-jane/following{/other_user}","gists_url":"https://api.github.com/users/Irena-jane/gists{/gist_id}","starred_url":"https://api.github.com/users/Irena-jane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Irena-jane/subscriptions","organizations_url":"https://api.github.com/users/Irena-jane/orgs","repos_url":"https://api.github.com/users/Irena-jane/repos","events_url":"https://api.github.com/users/Irena-jane/events{/privacy}","received_events_url":"https://api.github.com/users/Irena-jane/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-21T16:02:35Z","updated_at":"2015-03-24T16:16:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"02f6ab1415596e243e6b2db288c6bcf733a8aa94","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/pulls/2/commits","review_comments_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/pulls/2/comments","review_comment_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/pulls/comments{/number}","comments_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/issues/2/comments","statuses_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/statuses/0947f3cea2a5af0090173621b0a266502ce678b8","head":{"label":"Irena-jane:master","ref":"master","sha":"0947f3cea2a5af0090173621b0a266502ce678b8","user":{"login":"Irena-jane","id":4623289,"avatar_url":"https://avatars.githubusercontent.com/u/4623289?v=3","gravatar_id":"","url":"https://api.github.com/users/Irena-jane","html_url":"https://github.com/Irena-jane","followers_url":"https://api.github.com/users/Irena-jane/followers","following_url":"https://api.github.com/users/Irena-jane/following{/other_user}","gists_url":"https://api.github.com/users/Irena-jane/gists{/gist_id}","starred_url":"https://api.github.com/users/Irena-jane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Irena-jane/subscriptions","organizations_url":"https://api.github.com/users/Irena-jane/orgs","repos_url":"https://api.github.com/users/Irena-jane/repos","events_url":"https://api.github.com/users/Irena-jane/events{/privacy}","received_events_url":"https://api.github.com/users/Irena-jane/received_events","type":"User","site_admin":false},"repo":{"id":31459640,"name":"17099-Sedona","full_name":"Irena-jane/17099-Sedona","owner":{"login":"Irena-jane","id":4623289,"avatar_url":"https://avatars.githubusercontent.com/u/4623289?v=3","gravatar_id":"","url":"https://api.github.com/users/Irena-jane","html_url":"https://github.com/Irena-jane","followers_url":"https://api.github.com/users/Irena-jane/followers","following_url":"https://api.github.com/users/Irena-jane/following{/other_user}","gists_url":"https://api.github.com/users/Irena-jane/gists{/gist_id}","starred_url":"https://api.github.com/users/Irena-jane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Irena-jane/subscriptions","organizations_url":"https://api.github.com/users/Irena-jane/orgs","repos_url":"https://api.github.com/users/Irena-jane/repos","events_url":"https://api.github.com/users/Irena-jane/events{/privacy}","received_events_url":"https://api.github.com/users/Irena-jane/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Irena-jane/17099-Sedona","description":null,"fork":true,"url":"https://api.github.com/repos/Irena-jane/17099-Sedona","forks_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/forks","keys_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/teams","hooks_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/hooks","issue_events_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/issues/events{/number}","events_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/events","assignees_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/assignees{/user}","branches_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/branches{/branch}","tags_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/tags","blobs_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/git/refs{/sha}","trees_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/statuses/{sha}","languages_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/languages","stargazers_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/stargazers","contributors_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/contributors","subscribers_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/subscribers","subscription_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/subscription","commits_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/commits{/sha}","git_commits_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/git/commits{/sha}","comments_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/comments{/number}","issue_comment_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/issues/comments{/number}","contents_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/contents/{+path}","compare_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/merges","archive_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/downloads","issues_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/issues{/number}","pulls_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/pulls{/number}","milestones_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/milestones{/number}","notifications_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/labels{/name}","releases_url":"https://api.github.com/repos/Irena-jane/17099-Sedona/releases{/id}","created_at":"2015-02-28T10:41:55Z","updated_at":"2015-03-24T15:01:50Z","pushed_at":"2015-03-24T15:01:49Z","git_url":"git://github.com/Irena-jane/17099-Sedona.git","ssh_url":"git@github.com:Irena-jane/17099-Sedona.git","clone_url":"https://github.com/Irena-jane/17099-Sedona.git","svn_url":"https://github.com/Irena-jane/17099-Sedona","homepage":null,"size":447,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"up-htmlacademy:master","ref":"master","sha":"dd0d29e4ff7301ec430fa01df1f043d237eeaa81","user":{"login":"up-htmlacademy","id":9918669,"avatar_url":"https://avatars.githubusercontent.com/u/9918669?v=3","gravatar_id":"","url":"https://api.github.com/users/up-htmlacademy","html_url":"https://github.com/up-htmlacademy","followers_url":"https://api.github.com/users/up-htmlacademy/followers","following_url":"https://api.github.com/users/up-htmlacademy/following{/other_user}","gists_url":"https://api.github.com/users/up-htmlacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/up-htmlacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/up-htmlacademy/subscriptions","organizations_url":"https://api.github.com/users/up-htmlacademy/orgs","repos_url":"https://api.github.com/users/up-htmlacademy/repos","events_url":"https://api.github.com/users/up-htmlacademy/events{/privacy}","received_events_url":"https://api.github.com/users/up-htmlacademy/received_events","type":"Organization","site_admin":false},"repo":{"id":31368899,"name":"17099-Sedona","full_name":"up-htmlacademy/17099-Sedona","owner":{"login":"up-htmlacademy","id":9918669,"avatar_url":"https://avatars.githubusercontent.com/u/9918669?v=3","gravatar_id":"","url":"https://api.github.com/users/up-htmlacademy","html_url":"https://github.com/up-htmlacademy","followers_url":"https://api.github.com/users/up-htmlacademy/followers","following_url":"https://api.github.com/users/up-htmlacademy/following{/other_user}","gists_url":"https://api.github.com/users/up-htmlacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/up-htmlacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/up-htmlacademy/subscriptions","organizations_url":"https://api.github.com/users/up-htmlacademy/orgs","repos_url":"https://api.github.com/users/up-htmlacademy/repos","events_url":"https://api.github.com/users/up-htmlacademy/events{/privacy}","received_events_url":"https://api.github.com/users/up-htmlacademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/up-htmlacademy/17099-Sedona","description":null,"fork":false,"url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona","forks_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/forks","keys_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/keys{/key_id}","collaborators_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/teams","hooks_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/hooks","issue_events_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/issues/events{/number}","events_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/events","assignees_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/assignees{/user}","branches_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/branches{/branch}","tags_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/tags","blobs_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/git/refs{/sha}","trees_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/git/trees{/sha}","statuses_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/statuses/{sha}","languages_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/languages","stargazers_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/stargazers","contributors_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/contributors","subscribers_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/subscribers","subscription_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/subscription","commits_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/commits{/sha}","git_commits_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/git/commits{/sha}","comments_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/comments{/number}","issue_comment_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/issues/comments{/number}","contents_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/contents/{+path}","compare_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/compare/{base}...{head}","merges_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/merges","archive_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/downloads","issues_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/issues{/number}","pulls_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/pulls{/number}","milestones_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/milestones{/number}","notifications_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/labels{/name}","releases_url":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/releases{/id}","created_at":"2015-02-26T13:44:20Z","updated_at":"2015-03-06T08:41:54Z","pushed_at":"2015-03-24T15:01:50Z","git_url":"git://github.com/up-htmlacademy/17099-Sedona.git","ssh_url":"git@github.com:up-htmlacademy/17099-Sedona.git","clone_url":"https://github.com/up-htmlacademy/17099-Sedona.git","svn_url":"https://github.com/up-htmlacademy/17099-Sedona","homepage":null,"size":173,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/pulls/2"},"html":{"href":"https://github.com/up-htmlacademy/17099-Sedona/pull/2"},"issue":{"href":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/issues/2"},"comments":{"href":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/up-htmlacademy/17099-Sedona/statuses/0947f3cea2a5af0090173621b0a266502ce678b8"}}}}