GitHub PullRequestReviewCommentEvent at 2014-11-19 06:48:18
Repository: gaia
Actor: EragonJ
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/20559955","id":20559955,"diff_hunk":"@@ -0,0 +1,112 @@\n+/**\n+ * PrivacyPanelItem provides the transition to Privacy Panel app.\n+ *\n+ * @module PrivacyPanelItem\n+ */\n+\n+define(function(require) {\n+  'use strict';\n+\n+  function PrivacyPanelItem(element) {\n+    this._element = element;\n+    this._app = null;\n+\n+    this._privacyPanelManifestURL = document.location.protocol +\n+      '//privacy-panel.gaiamobile.org' +\n+      (location.port ? (':' + location.port) : '') + '/manifest.webapp';\n+    \n+    this._getApp();\n+\n+    this._element.addEventListener('click', this._launch.bind(this));\n+  }\n+\n+  PrivacyPanelItem.prototype = {\n+\n+    /**\n+     * Set current status of privacyPanelItem\n+     *\n+     * @access public\n+     * @param {Boolean} enabled\n+     * @memberOf PrivacyPanelItem\n+     */\n+    set enabled(enabled) {\n+      if (this._enabled === enabled) {\n+        return;\n+      } else {\n+        this._enabled = enabled;\n+        if (this._enabled) {\n+          this._updateSelection();\n+        }\n+      }\n+    },\n+\n+    /**\n+     * Get current status of privacyPanelItem\n+     *\n+     * @access public\n+     * @memberOf PrivacyPanelItem\n+     */\n+    get enabled() {\n+      return this._enabled;\n+    },\n+\n+    /**\n+     * Search from privacy-panel app and grab it's instance.\n+     * @method _getApp\n+     */\n+    _getApp: function pp_getApp() {\n+      navigator.mozApps.mgmt.getAll().onsuccess = function gotApps(evt) {\n+        var apps = evt.target.result;\n+        for (var i = 0; i < apps.length; i++) {\n+          var app = apps[i];\n+          if (app.manifestURL === this._privacyPanelManifestURL) {\n+            this._app = app;\n+            this._element.removeAttribute('hidden');\n+            return;\n+          }\n+        }\n+      }.bind(this);\n+    },\n+\n+    /**\n+     * Launch Privacy Panel app.\n+     *\n+     * @param event\n+     * @method _launch\n+     */\n+    _launch: function pp_launch(event) {\n+      // Stop propagation & prevent default not to block other settings events.\n+      event.stopImmediatePropagation();\n+      event.preventDefault();\n+      \n+      if (this._app) {\n+        // Let privacy-panel app know that we launched it from settings\n+        // so the app can show us a back button pointing to settings app.\n+        var flag = navigator.mozSettings.createLock().set({\n+          'privacypanel.launched.by.settings': true\n+        });\n+        flag.onsuccess = function() {\n+          this._app.launch();\n+        }.bind(this);\n+        flag.onerror = function() {\n+          console.error('Problem with launching Privacy Panel');\n+        };\n+      } else {\n+        alert(navigator.mozL10n.get('no-privacy-panel'));\n+      }\n+    },\n+\n+    /**\n+     * Update theme section visibility based on _themeCount\n+     *\n+     * @memberOf PrivacyPanelItem\n+     */\n+    _updateSelection: function() {\n+      this._element.querySelector('a').blur();","path":"apps/settings/js/panels/root/privacy_panel_item.js","position":105,"original_position":105,"commit_id":"31bdc7dae68c15bbd14c5ae27e2a8931c0e41ce6","original_commit_id":"31bdc7dae68c15bbd14c5ae27e2a8931c0e41ce6","user":{"login":"EragonJ","id":68322,"avatar_url":"https://avatars.githubusercontent.com/u/68322?v=3","gravatar_id":"","url":"https://api.github.com/users/EragonJ","html_url":"https://github.com/EragonJ","followers_url":"https://api.github.com/users/EragonJ/followers","following_url":"https://api.github.com/users/EragonJ/following{/other_user}","gists_url":"https://api.github.com/users/EragonJ/gists{/gist_id}","starred_url":"https://api.github.com/users/EragonJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EragonJ/subscriptions","organizations_url":"https://api.github.com/users/EragonJ/orgs","repos_url":"https://api.github.com/users/EragonJ/repos","events_url":"https://api.github.com/users/EragonJ/events{/privacy}","received_events_url":"https://api.github.com/users/EragonJ/received_events","type":"User","site_admin":false},"body":"Please directly reference from this._element.xxx instead of `querySelector` here, thanks.","created_at":"2014-11-19T06:48:18Z","updated_at":"2014-11-19T06:48:18Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/25688#discussion_r20559955","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/25688","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/20559955"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/25688#discussion_r20559955"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/25688"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/25688","id":23661530,"html_url":"https://github.com/mozilla-b2g/gaia/pull/25688","diff_url":"https://github.com/mozilla-b2g/gaia/pull/25688.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/25688.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/25688","number":25688,"state":"open","locked":false,"title":"Privacy Panel new pull request","user":{"login":"martasect","id":4159990,"avatar_url":"https://avatars.githubusercontent.com/u/4159990?v=3","gravatar_id":"","url":"https://api.github.com/users/martasect","html_url":"https://github.com/martasect","followers_url":"https://api.github.com/users/martasect/followers","following_url":"https://api.github.com/users/martasect/following{/other_user}","gists_url":"https://api.github.com/users/martasect/gists{/gist_id}","starred_url":"https://api.github.com/users/martasect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martasect/subscriptions","organizations_url":"https://api.github.com/users/martasect/orgs","repos_url":"https://api.github.com/users/martasect/repos","events_url":"https://api.github.com/users/martasect/events{/privacy}","received_events_url":"https://api.github.com/users/martasect/received_events","type":"User","site_admin":false},"body":"This is a new pull request. We had to remove the old one due to big problems with git and some Schroedinger patches....","created_at":"2014-10-31T08:12:48Z","updated_at":"2014-11-19T06:48:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a706496cd9886cee0943b8359fc07a205b731105","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/25688/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/25688/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/25688/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/31bdc7dae68c15bbd14c5ae27e2a8931c0e41ce6","head":{"label":"martasect:privacy-panel-master-apps","ref":"privacy-panel-master-apps","sha":"31bdc7dae68c15bbd14c5ae27e2a8931c0e41ce6","user":{"login":"martasect","id":4159990,"avatar_url":"https://avatars.githubusercontent.com/u/4159990?v=3","gravatar_id":"","url":"https://api.github.com/users/martasect","html_url":"https://github.com/martasect","followers_url":"https://api.github.com/users/martasect/followers","following_url":"https://api.github.com/users/martasect/following{/other_user}","gists_url":"https://api.github.com/users/martasect/gists{/gist_id}","starred_url":"https://api.github.com/users/martasect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martasect/subscriptions","organizations_url":"https://api.github.com/users/martasect/orgs","repos_url":"https://api.github.com/users/martasect/repos","events_url":"https://api.github.com/users/martasect/events{/privacy}","received_events_url":"https://api.github.com/users/martasect/received_events","type":"User","site_admin":false},"repo":{"id":23979597,"name":"gaia","full_name":"martasect/gaia","owner":{"login":"martasect","id":4159990,"avatar_url":"https://avatars.githubusercontent.com/u/4159990?v=3","gravatar_id":"","url":"https://api.github.com/users/martasect","html_url":"https://github.com/martasect","followers_url":"https://api.github.com/users/martasect/followers","following_url":"https://api.github.com/users/martasect/following{/other_user}","gists_url":"https://api.github.com/users/martasect/gists{/gist_id}","starred_url":"https://api.github.com/users/martasect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martasect/subscriptions","organizations_url":"https://api.github.com/users/martasect/orgs","repos_url":"https://api.github.com/users/martasect/repos","events_url":"https://api.github.com/users/martasect/events{/privacy}","received_events_url":"https://api.github.com/users/martasect/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/martasect/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/martasect/gaia","forks_url":"https://api.github.com/repos/martasect/gaia/forks","keys_url":"https://api.github.com/repos/martasect/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martasect/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martasect/gaia/teams","hooks_url":"https://api.github.com/repos/martasect/gaia/hooks","issue_events_url":"https://api.github.com/repos/martasect/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/martasect/gaia/events","assignees_url":"https://api.github.com/repos/martasect/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/martasect/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/martasect/gaia/tags","blobs_url":"https://api.github.com/repos/martasect/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martasect/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martasect/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/martasect/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martasect/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/martasect/gaia/languages","stargazers_url":"https://api.github.com/repos/martasect/gaia/stargazers","contributors_url":"https://api.github.com/repos/martasect/gaia/contributors","subscribers_url":"https://api.github.com/repos/martasect/gaia/subscribers","subscription_url":"https://api.github.com/repos/martasect/gaia/subscription","commits_url":"https://api.github.com/repos/martasect/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/martasect/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/martasect/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/martasect/gaia/issues/comments/{number}","contents_url":"https://api.github.com/repos/martasect/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/martasect/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martasect/gaia/merges","archive_url":"https://api.github.com/repos/martasect/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martasect/gaia/downloads","issues_url":"https://api.github.com/repos/martasect/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/martasect/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/martasect/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/martasect/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martasect/gaia/labels{/name}","releases_url":"https://api.github.com/repos/martasect/gaia/releases{/id}","created_at":"2014-09-12T22:56:25Z","updated_at":"2014-09-12T10:34:19Z","pushed_at":"2014-11-18T17:57:32Z","git_url":"git://github.com/martasect/gaia.git","ssh_url":"git@github.com:martasect/gaia.git","clone_url":"https://github.com/martasect/gaia.git","svn_url":"https://github.com/martasect/gaia","homepage":"https://wiki.mozilla.org/B2G","size":871188,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"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":"mozilla-b2g:master","ref":"master","sha":"914937b56a3f9958e81b891d1679013471584965","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":"2014-11-19T05:01:18Z","pushed_at":"2014-11-19T04:09:56Z","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":1554098,"stargazers_count":1803,"watchers_count":1803,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2055,"mirror_url":null,"open_issues_count":702,"forks":2055,"open_issues":702,"watchers":1803,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/25688"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/25688"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/25688"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/25688/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/25688/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/25688/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/31bdc7dae68c15bbd14c5ae27e2a8931c0e41ce6"}}}}