GitHub PullRequestReviewCommentEvent at 2014-04-07 08:32:33
Repository: gaia
Actor: crh0716
Payload: {"comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/11334737","id":11334737,"diff_hunk":"@@ -0,0 +1,85 @@\n+/* global SettingsListener */\n+define(function(require) {\n+  'use strict';\n+\n+  var SettingsService = require('modules/settings_service');\n+  var PhoneLock = function ctor_phonelock() {\n+    return {\n+      panel: null,\n+\n+      settings: {\n+        passcodeEnable: false,\n+        lockscreenEnable: false\n+      },\n+\n+      getAllElements: function pl_getAllElements() {\n+        this.phonelockPanel = this.panel;\n+        this.lockscreenEnable = this.panel.querySelector('#lockscreen-enable');\n+        this.passcodeEnable = this.panel.querySelector('#passcode-enable');\n+        this.passcodeEditButton = this.panel.querySelector('#passcode-edit');\n+      },\n+\n+      init: function pl_init() {\n+        this.getAllElements();\n+        this.passcodeEnable.addEventListener('click', this);\n+        this.lockscreenEnable.addEventListener('click', this);\n+        this.passcodeEditButton.addEventListener('click', this);\n+        this.fetchSettings();\n+      },\n+\n+      onInit: function(panel) {\n+        this.panel = panel;\n+        this.init();\n+      },\n+\n+      fetchSettings: function pl_fetchSettings() {\n+        SettingsListener.observe('lockscreen.enabled', false,\n+          function(enabled) {\n+            this.toggleLock(enabled);\n+        }.bind(this));\n+\n+        SettingsListener.observe('lockscreen.passcode-lock.enabled', false,\n+          function(enabled) {\n+            this.settings.passcodeEnable = enabled;\n+            this.phonelockPanel.dataset.passcodeEnabled = enabled;\n+            this.passcodeEnable.checked = enabled;\n+        }.bind(this));\n+      },\n+\n+      toggleLock: function pl_toggleLock(enable) {","path":"apps/settings/js/panels/phone_lock/phone_lock.js","position":49,"original_position":49,"commit_id":"823acc9f973e4d47a5a511556eb9d51ede98b886","original_commit_id":"823acc9f973e4d47a5a511556eb9d51ede98b886","user":{"login":"crh0716","id":2899280,"avatar_url":"https://avatars.githubusercontent.com/u/2899280?","gravatar_id":"ab20989d946f4bd31c590b5a6ef73f7a","url":"https://api.github.com/users/crh0716","html_url":"https://github.com/crh0716","followers_url":"https://api.github.com/users/crh0716/followers","following_url":"https://api.github.com/users/crh0716/following{/other_user}","gists_url":"https://api.github.com/users/crh0716/gists{/gist_id}","starred_url":"https://api.github.com/users/crh0716/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crh0716/subscriptions","organizations_url":"https://api.github.com/users/crh0716/orgs","repos_url":"https://api.github.com/users/crh0716/repos","events_url":"https://api.github.com/users/crh0716/events{/privacy}","received_events_url":"https://api.github.com/users/crh0716/received_events","type":"User","site_admin":false},"body":"nit: enabled","created_at":"2014-04-07T08:32:33Z","updated_at":"2014-04-07T08:32:33Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/17842#discussion_r11334737","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/17842","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/11334737"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/17842#discussion_r11334737"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/17842"}}}}