{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/45828056","id":45828056,"diff_hunk":"@@ -0,0 +1,98 @@\n+/* global evt, SettingsListener, KeyNavigationAdapter, SimpleKeyNavigation */\n+(function (exports) {\n+'use strict';\n+\n+window.addEventListener('load', function() {\n+\n+  var tvFTU = evt({\n+\n+    init: function () {\n+      this.APP_USAGE_ENABLE_KEY = 'debug.performance_data.shared';\n+      this.APP_USAGE_ENABLE_VALUE = true;\n+      this.APP_USAGE_DISABLE_VALUE = false;\n+\n+      this._noButton =\n+          document.getElementById('appUsageSlide-noButton');\n+      this._yesButton =\n+          document.getElementById('appUsageSlide-yesButton');\n+      this._terms =\n+          document.getElementById('appUsageSlide-terms');\n+      this._termsSection =\n+          document.getElementById('appUsageSlide-termsSection');\n+      this._arrowIcon =\n+          document.getElementById('appUsageSlide-arrowIcon');\n+\n+      this.keyNavAdapter = new KeyNavigationAdapter();\n+      this.keyNavAdapter.init();\n+      this.keyNavAdapter.on('move', this.onKeyMove.bind(this));\n+      this.keyNavAdapter.on('enter-keyup', this.onKeyEnterUp.bind(this));\n+\n+      this.buttonNav = new SimpleKeyNavigation();\n+      this.buttonNav.start(\n+        [this._noButton, this._yesButton],\n+        SimpleKeyNavigation.DIRECTION.HORIZONTAL\n+      );\n+      this.buttonNav.on('focusChanged', (elem) => {\n+        this.fire('focus', elem);\n+      });\n+      this.buttonNav.pause();\n+\n+      this._termsSection.focus();\n+      this._currentFocused = this._termsSection;\n+      this.on('focus', this.onFocus.bind(this));\n+    },\n+\n+    onFocus: function (elem) {\n+      this._currentFocused = elem;\n+    },\n+\n+    onKeyMove: function (key) {\n+      switch (key) {\n+        case 'up':\n+          if (this._currentFocused !== this._termsSection) {\n+            this.buttonNav.blur();\n+            this.buttonNav.pause();\n+            this._termsSection.focus();\n+            this.fire('focus', this._termsSection);\n+            this._arrowIcon.classList.remove('hidden');\n+          }\n+        break;\n+\n+        case 'down':\n+          if (this._currentFocused === this._termsSection) {\n+            var unscrolledValue = this._terms.clientHeight -\n+                                  this._termsSection.scrollTop -\n+                                  this._termsSection.clientHeight;\n+            if ((unscrolledValue > 0) === false) {\n+              this.buttonNav.resume();\n+              this.buttonNav.focusOn(this._yesButton);\n+              this._arrowIcon.classList.add('hidden');\n+            }\n+          }\n+        break;\n+      }\n+    },\n+\n+    onKeyEnterUp: function () {","path":"tv_apps/tv-ftu/js/index.js","position":76,"original_position":76,"commit_id":"8c70f2bf03c8c28164679685d583a73bfde1496b","original_commit_id":"8c70f2bf03c8c28164679685d583a73bfde1496b","user":{"login":"rexboy7","id":2406290,"avatar_url":"https://avatars.githubusercontent.com/u/2406290?v=3","gravatar_id":"","url":"https://api.github.com/users/rexboy7","html_url":"https://github.com/rexboy7","followers_url":"https://api.github.com/users/rexboy7/followers","following_url":"https://api.github.com/users/rexboy7/following{/other_user}","gists_url":"https://api.github.com/users/rexboy7/gists{/gist_id}","starred_url":"https://api.github.com/users/rexboy7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rexboy7/subscriptions","organizations_url":"https://api.github.com/users/rexboy7/orgs","repos_url":"https://api.github.com/users/rexboy7/repos","events_url":"https://api.github.com/users/rexboy7/events{/privacy}","received_events_url":"https://api.github.com/users/rexboy7/received_events","type":"User","site_admin":false},"body":"`onEnterKeyUp`.","created_at":"2015-11-25T04:13:16Z","updated_at":"2015-11-25T04:13:16Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/33286#discussion_r45828056","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/33286","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/45828056"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/33286#discussion_r45828056"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/33286"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/33286","id":51310674,"html_url":"https://github.com/mozilla-b2g/gaia/pull/33286","diff_url":"https://github.com/mozilla-b2g/gaia/pull/33286.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/33286.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/33286","number":33286,"state":"open","locked":false,"title":"Bug 1220588 - [TV] FTE for usage matrics","user":{"login":"Fischer-L","id":5627487,"avatar_url":"https://avatars.githubusercontent.com/u/5627487?v=3","gravatar_id":"","url":"https://api.github.com/users/Fischer-L","html_url":"https://github.com/Fischer-L","followers_url":"https://api.github.com/users/Fischer-L/followers","following_url":"https://api.github.com/users/Fischer-L/following{/other_user}","gists_url":"https://api.github.com/users/Fischer-L/gists{/gist_id}","starred_url":"https://api.github.com/users/Fischer-L/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fischer-L/subscriptions","organizations_url":"https://api.github.com/users/Fischer-L/orgs","repos_url":"https://api.github.com/users/Fischer-L/repos","events_url":"https://api.github.com/users/Fischer-L/events{/privacy}","received_events_url":"https://api.github.com/users/Fischer-L/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-20T02:29:49Z","updated_at":"2015-11-25T04:13:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1243b9f778371e4f7249b24b3a8fe4bf6080a271","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/33286/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/33286/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/33286/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/8c70f2bf03c8c28164679685d583a73bfde1496b","head":{"label":"Fischer-L:bug_1220588-FTE-for-usage-metrics","ref":"bug_1220588-FTE-for-usage-metrics","sha":"8c70f2bf03c8c28164679685d583a73bfde1496b","user":{"login":"Fischer-L","id":5627487,"avatar_url":"https://avatars.githubusercontent.com/u/5627487?v=3","gravatar_id":"","url":"https://api.github.com/users/Fischer-L","html_url":"https://github.com/Fischer-L","followers_url":"https://api.github.com/users/Fischer-L/followers","following_url":"https://api.github.com/users/Fischer-L/following{/other_user}","gists_url":"https://api.github.com/users/Fischer-L/gists{/gist_id}","starred_url":"https://api.github.com/users/Fischer-L/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fischer-L/subscriptions","organizations_url":"https://api.github.com/users/Fischer-L/orgs","repos_url":"https://api.github.com/users/Fischer-L/repos","events_url":"https://api.github.com/users/Fischer-L/events{/privacy}","received_events_url":"https://api.github.com/users/Fischer-L/received_events","type":"User","site_admin":false},"repo":{"id":41299807,"name":"gaia","full_name":"Fischer-L/gaia","owner":{"login":"Fischer-L","id":5627487,"avatar_url":"https://avatars.githubusercontent.com/u/5627487?v=3","gravatar_id":"","url":"https://api.github.com/users/Fischer-L","html_url":"https://github.com/Fischer-L","followers_url":"https://api.github.com/users/Fischer-L/followers","following_url":"https://api.github.com/users/Fischer-L/following{/other_user}","gists_url":"https://api.github.com/users/Fischer-L/gists{/gist_id}","starred_url":"https://api.github.com/users/Fischer-L/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fischer-L/subscriptions","organizations_url":"https://api.github.com/users/Fischer-L/orgs","repos_url":"https://api.github.com/users/Fischer-L/repos","events_url":"https://api.github.com/users/Fischer-L/events{/privacy}","received_events_url":"https://api.github.com/users/Fischer-L/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Fischer-L/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":true,"url":"https://api.github.com/repos/Fischer-L/gaia","forks_url":"https://api.github.com/repos/Fischer-L/gaia/forks","keys_url":"https://api.github.com/repos/Fischer-L/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Fischer-L/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Fischer-L/gaia/teams","hooks_url":"https://api.github.com/repos/Fischer-L/gaia/hooks","issue_events_url":"https://api.github.com/repos/Fischer-L/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/Fischer-L/gaia/events","assignees_url":"https://api.github.com/repos/Fischer-L/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/Fischer-L/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/Fischer-L/gaia/tags","blobs_url":"https://api.github.com/repos/Fischer-L/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Fischer-L/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Fischer-L/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/Fischer-L/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Fischer-L/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/Fischer-L/gaia/languages","stargazers_url":"https://api.github.com/repos/Fischer-L/gaia/stargazers","contributors_url":"https://api.github.com/repos/Fischer-L/gaia/contributors","subscribers_url":"https://api.github.com/repos/Fischer-L/gaia/subscribers","subscription_url":"https://api.github.com/repos/Fischer-L/gaia/subscription","commits_url":"https://api.github.com/repos/Fischer-L/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/Fischer-L/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/Fischer-L/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/Fischer-L/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/Fischer-L/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/Fischer-L/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Fischer-L/gaia/merges","archive_url":"https://api.github.com/repos/Fischer-L/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Fischer-L/gaia/downloads","issues_url":"https://api.github.com/repos/Fischer-L/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/Fischer-L/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/Fischer-L/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/Fischer-L/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Fischer-L/gaia/labels{/name}","releases_url":"https://api.github.com/repos/Fischer-L/gaia/releases{/id}","created_at":"2015-08-24T11:41:41Z","updated_at":"2015-08-24T11:42:10Z","pushed_at":"2015-11-25T03:51:00Z","git_url":"git://github.com/Fischer-L/gaia.git","ssh_url":"git@github.com:Fischer-L/gaia.git","clone_url":"https://github.com/Fischer-L/gaia.git","svn_url":"https://github.com/Fischer-L/gaia","homepage":"https://wiki.mozilla.org/B2G","size":997268,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"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":"mozilla-b2g:master","ref":"master","sha":"98e460ceef4b84752e3a5dac89e3507d593666e4","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","created_at":"2011-09-03T01:38:46Z","updated_at":"2015-11-23T21:54:38Z","pushed_at":"2015-11-25T03:25:52Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1184044,"stargazers_count":2012,"watchers_count":2012,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2552,"mirror_url":null,"open_issues_count":1282,"forks":2552,"open_issues":1282,"watchers":2012,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/33286"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/33286"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/33286"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/33286/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/33286/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/33286/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/8c70f2bf03c8c28164679685d583a73bfde1496b"}}}}