GitHub PullRequestReviewCommentEvent at 2014-09-23 11:57:53
Repository: fxa-content-server
Actor: shane-tomlinson
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/comments/17903676","id":17903676,"diff_hunk":"@@ -215,6 +246,72 @@ function (_, p, BaseView, FormView, Template, Session, PasswordMixin, AuthErrors\n       });\n     },\n \n+    onUserYearSelect: function() {\n+      userAge.year = parseInt(this._getYear(), 10);\n+      if (userAge.year === CUTOFF_AGE.year) {\n+        this._toggleDatePicker(); \n+      }\n+    },\n+\n+    onUserMonthSelect: function() {\n+      userAge.month = parseInt(this._getMonth(), 10);\n+      var days = this._daysInMonth(userAge.year, userAge.month);\n+      var datePickerEl = this.$('#fxa-age-date');\n+\n+      if (isNaN(userAge.month)) {\n+        this._disableDatePicker(datePickerEl);\n+        userAge.date = 'none';\n+      } else {\n+        this._enableDatePicker(datePickerEl);\n+      }\n+\n+      this._updateDatePickerValues(datePickerEl, days);\n+      \n+      if (this._isDateValidOnMonthChange(days)) {\n+        datePickerEl.val(userAge.date);\n+      }\n+    },\n+\n+    onUserDateSelect: function() {\n+      userAge.date = parseInt(this._getDate(), 10); \n+    },\n+\n+    //if the user changes from march to february (or similar),\n+    //we need to reset out-of-bounds dates, or keep in-bounds dates\n+    _isDateValidOnMonthChange: function(days) {\n+      if (typeof userAge.date === 'number') {\n+        return userAge.date <= days;\n+      }\n+    },\n+\n+    _disableDatePicker: function(datePickerEl) {\n+      datePickerEl.attr('disabled', 'true');\n+      datePickerEl.parent().addClass('disabled');\n+    },\n+\n+    _enableDatePicker: function(datePickerEl) {\n+      datePickerEl.removeAttr('disabled');\n+      datePickerEl.parent().removeClass('disabled');\n+    },\n+\n+    _updateDatePickerValues: function(datePickerEl, days) {\n+      var defaultValue = datePickerEl.children(':eq(0)');\n+      datePickerEl.empty();\n+      datePickerEl.append(defaultValue);\n+      for (var i = 1; i <= days; i++) {\n+        datePickerEl.append('<option id=\"fxa-day-' + i + 'value=\"' + i + ' \" >' + i + ' </option>');\n+      }\n+    },\n+\n+    _daysInMonth: function(year, month) {\n+      return new Date(year, month, 0).getDate();\n+    },\n+\n+    _toggleDatePicker: function() {\n+      this.$('#year-picker').addClass('hidden');\n+      this.$('#month-date-picker').removeClass('hidden').find(\"#fxa-age-month\").focus();","path":"app/scripts/views/sign_up.js","position":178,"original_position":178,"commit_id":"f8f69537f6395cef10f1ece0dd38dea128c3cf87","original_commit_id":"f8f69537f6395cef10f1ece0dd38dea128c3cf87","user":{"login":"shane-tomlinson","id":848085,"avatar_url":"https://avatars.githubusercontent.com/u/848085?v=2","gravatar_id":"","url":"https://api.github.com/users/shane-tomlinson","html_url":"https://github.com/shane-tomlinson","followers_url":"https://api.github.com/users/shane-tomlinson/followers","following_url":"https://api.github.com/users/shane-tomlinson/following{/other_user}","gists_url":"https://api.github.com/users/shane-tomlinson/gists{/gist_id}","starred_url":"https://api.github.com/users/shane-tomlinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shane-tomlinson/subscriptions","organizations_url":"https://api.github.com/users/shane-tomlinson/orgs","repos_url":"https://api.github.com/users/shane-tomlinson/repos","events_url":"https://api.github.com/users/shane-tomlinson/events{/privacy}","received_events_url":"https://api.github.com/users/shane-tomlinson/received_events","type":"User","site_admin":false},"body":"Let's use `this.focus('#fxa-age-month')` here.","created_at":"2014-09-23T11:57:53Z","updated_at":"2014-09-23T11:57:53Z","html_url":"https://github.com/mozilla/fxa-content-server/pull/1682#discussion_r17903676","pull_request_url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/1682","_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/comments/17903676"},"html":{"href":"https://github.com/mozilla/fxa-content-server/pull/1682#discussion_r17903676"},"pull_request":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/1682"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/1682","id":21589912,"html_url":"https://github.com/mozilla/fxa-content-server/pull/1682","diff_url":"https://github.com/mozilla/fxa-content-server/pull/1682.diff","patch_url":"https://github.com/mozilla/fxa-content-server/pull/1682.patch","issue_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/1682","number":1682,"state":"open","locked":false,"title":"WIP issue-358 COPPA fix","user":{"login":"johngruen","id":3323249,"avatar_url":"https://avatars.githubusercontent.com/u/3323249?v=2","gravatar_id":"","url":"https://api.github.com/users/johngruen","html_url":"https://github.com/johngruen","followers_url":"https://api.github.com/users/johngruen/followers","following_url":"https://api.github.com/users/johngruen/following{/other_user}","gists_url":"https://api.github.com/users/johngruen/gists{/gist_id}","starred_url":"https://api.github.com/users/johngruen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johngruen/subscriptions","organizations_url":"https://api.github.com/users/johngruen/orgs","repos_url":"https://api.github.com/users/johngruen/repos","events_url":"https://api.github.com/users/johngruen/events{/privacy}","received_events_url":"https://api.github.com/users/johngruen/received_events","type":"User","site_admin":false},"body":"Need to add validation and tidy things up. Also, maybe i should split all of this into a mixin?","created_at":"2014-09-22T16:06:33Z","updated_at":"2014-09-23T11:57:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8bc9e1d717622d916238160f6fd20a349ad5b61e","assignee":{"login":"shane-tomlinson","id":848085,"avatar_url":"https://avatars.githubusercontent.com/u/848085?v=2","gravatar_id":"","url":"https://api.github.com/users/shane-tomlinson","html_url":"https://github.com/shane-tomlinson","followers_url":"https://api.github.com/users/shane-tomlinson/followers","following_url":"https://api.github.com/users/shane-tomlinson/following{/other_user}","gists_url":"https://api.github.com/users/shane-tomlinson/gists{/gist_id}","starred_url":"https://api.github.com/users/shane-tomlinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shane-tomlinson/subscriptions","organizations_url":"https://api.github.com/users/shane-tomlinson/orgs","repos_url":"https://api.github.com/users/shane-tomlinson/repos","events_url":"https://api.github.com/users/shane-tomlinson/events{/privacy}","received_events_url":"https://api.github.com/users/shane-tomlinson/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/1682/commits","review_comments_url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/1682/comments","review_comment_url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/1682/comments","statuses_url":"https://api.github.com/repos/mozilla/fxa-content-server/statuses/f8f69537f6395cef10f1ece0dd38dea128c3cf87","head":{"label":"mozilla:issue-358","ref":"issue-358","sha":"f8f69537f6395cef10f1ece0dd38dea128c3cf87","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=2","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":11778024,"name":"fxa-content-server","full_name":"mozilla/fxa-content-server","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=2","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/fxa-content-server","description":"Firefox Accounts Content Server","fork":false,"url":"https://api.github.com/repos/mozilla/fxa-content-server","forks_url":"https://api.github.com/repos/mozilla/fxa-content-server/forks","keys_url":"https://api.github.com/repos/mozilla/fxa-content-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa-content-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa-content-server/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa-content-server/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa-content-server/events","assignees_url":"https://api.github.com/repos/mozilla/fxa-content-server/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa-content-server/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa-content-server/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa-content-server/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa-content-server/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa-content-server/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa-content-server/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa-content-server/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa-content-server/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa-content-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa-content-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla/fxa-content-server/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa-content-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa-content-server/merges","archive_url":"https://api.github.com/repos/mozilla/fxa-content-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa-content-server/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa-content-server/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa-content-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa-content-server/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa-content-server/releases{/id}","created_at":"2013-07-30T23:35:35Z","updated_at":"2014-09-23T03:53:55Z","pushed_at":"2014-09-23T03:54:34Z","git_url":"git://github.com/mozilla/fxa-content-server.git","ssh_url":"git@github.com:mozilla/fxa-content-server.git","clone_url":"https://github.com/mozilla/fxa-content-server.git","svn_url":"https://github.com/mozilla/fxa-content-server","homepage":"","size":30279,"stargazers_count":31,"watchers_count":31,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":161,"forks":26,"open_issues":161,"watchers":31,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"82f042fa4604c2aee75b2dd133b0d2df72de81f5","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=2","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":11778024,"name":"fxa-content-server","full_name":"mozilla/fxa-content-server","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=2","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/fxa-content-server","description":"Firefox Accounts Content Server","fork":false,"url":"https://api.github.com/repos/mozilla/fxa-content-server","forks_url":"https://api.github.com/repos/mozilla/fxa-content-server/forks","keys_url":"https://api.github.com/repos/mozilla/fxa-content-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa-content-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa-content-server/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa-content-server/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa-content-server/events","assignees_url":"https://api.github.com/repos/mozilla/fxa-content-server/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa-content-server/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa-content-server/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa-content-server/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa-content-server/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa-content-server/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa-content-server/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa-content-server/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa-content-server/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa-content-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa-content-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla/fxa-content-server/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa-content-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa-content-server/merges","archive_url":"https://api.github.com/repos/mozilla/fxa-content-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa-content-server/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa-content-server/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa-content-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa-content-server/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa-content-server/releases{/id}","created_at":"2013-07-30T23:35:35Z","updated_at":"2014-09-23T03:53:55Z","pushed_at":"2014-09-23T03:54:34Z","git_url":"git://github.com/mozilla/fxa-content-server.git","ssh_url":"git@github.com:mozilla/fxa-content-server.git","clone_url":"https://github.com/mozilla/fxa-content-server.git","svn_url":"https://github.com/mozilla/fxa-content-server","homepage":"","size":30279,"stargazers_count":31,"watchers_count":31,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":161,"forks":26,"open_issues":161,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/1682"},"html":{"href":"https://github.com/mozilla/fxa-content-server/pull/1682"},"issue":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/issues/1682"},"comments":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/issues/1682/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/1682/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/1682/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/statuses/f8f69537f6395cef10f1ece0dd38dea128c3cf87"}}}}