{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/22814853","id":22814853,"diff_hunk":"@@ -504,6 +517,144 @@ var KeypadManager = {\n     }\n   },\n \n+  /**\n+   * Returns true if the number is a speed dial code as described in\n+   * 3GPP TS 22.030 6.6.4. Speed dial codes are in the N(N)(N)# format.\n+   */\n+  _isSpeedDialNumber: function(number) {\n+    return !!number.match(/^[0-9][0-9]{0,2}\\#$/);\n+  },\n+\n+  /**\n+   * Returns the telephony number corresponding to the specified index. Speed\n+   * dial numbers are retrieved from the SIM contacts list and not from the\n+   * regular contacts.\n+   *\n+   * @param {Integer} index The index of the speed dial number.\n+   * @returns {Promise} A promise that resolves to the corresponding number.\n+   */\n+  _getSpeedDialNumber: function(index) {\n+    var self = this;\n+    var cardIndex;\n+\n+    index--; // Speed dial indexes are 1-based\n+\n+    return new Promise(function(resolve, reject) {\n+      LazyLoader.load(['/shared/js/sim_settings_helper.js'], function() {\n+        SimSettingsHelper.getCardIndexFrom('outgoingCall',\n+        function(defaultCardIndex) {\n+          if (defaultCardIndex == SimSettingsHelper.ALWAYS_ASK_OPTION_VALUE) {\n+            LazyLoader.load(['/shared/js/component_utils.js',\n+                             '/shared/elements/gaia_sim_picker/script.js'],\n+            function() {\n+              var simPicker = document.getElementById('sim-picker');\n+              simPicker.getOrPick(defaultCardIndex, null, function(ci) {\n+                cardIndex = ci;","path":"shared/js/dialer/keypad.js","position":74,"original_position":74,"commit_id":"2945a5d7281ff67c06835c7f05eefd7389449cbb","original_commit_id":"2945a5d7281ff67c06835c7f05eefd7389449cbb","user":{"login":"DouglasSherk","id":1310914,"avatar_url":"https://avatars.githubusercontent.com/u/1310914?v=3","gravatar_id":"","url":"https://api.github.com/users/DouglasSherk","html_url":"https://github.com/DouglasSherk","followers_url":"https://api.github.com/users/DouglasSherk/followers","following_url":"https://api.github.com/users/DouglasSherk/following{/other_user}","gists_url":"https://api.github.com/users/DouglasSherk/gists{/gist_id}","starred_url":"https://api.github.com/users/DouglasSherk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DouglasSherk/subscriptions","organizations_url":"https://api.github.com/users/DouglasSherk/orgs","repos_url":"https://api.github.com/users/DouglasSherk/repos","events_url":"https://api.github.com/users/DouglasSherk/events{/privacy}","received_events_url":"https://api.github.com/users/DouglasSherk/received_events","type":"User","site_admin":false},"body":"This is really poor naming. Maybe change ```ci``` to ```pickedCardIndex```.","created_at":"2015-01-12T19:32:09Z","updated_at":"2015-01-12T19:32:09Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/27293#discussion_r22814853","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27293","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/22814853"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/27293#discussion_r22814853"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27293"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27293","id":27148137,"html_url":"https://github.com/mozilla-b2g/gaia/pull/27293","diff_url":"https://github.com/mozilla-b2g/gaia/pull/27293.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/27293.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/27293","number":27293,"state":"open","locked":false,"title":"Bug 1061130 - Add speed dial functionality to the dialer","user":{"login":"gabrielesvelto","id":1159312,"avatar_url":"https://avatars.githubusercontent.com/u/1159312?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrielesvelto","html_url":"https://github.com/gabrielesvelto","followers_url":"https://api.github.com/users/gabrielesvelto/followers","following_url":"https://api.github.com/users/gabrielesvelto/following{/other_user}","gists_url":"https://api.github.com/users/gabrielesvelto/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielesvelto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielesvelto/subscriptions","organizations_url":"https://api.github.com/users/gabrielesvelto/orgs","repos_url":"https://api.github.com/users/gabrielesvelto/repos","events_url":"https://api.github.com/users/gabrielesvelto/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielesvelto/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-10T11:57:41Z","updated_at":"2015-01-12T19:32:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fa02f259acd0f8af4d3f8492fb9c67a4c6fb660","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27293/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27293/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/27293/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/2945a5d7281ff67c06835c7f05eefd7389449cbb","head":{"label":"gabrielesvelto:bug-1061130-speed-dial","ref":"bug-1061130-speed-dial","sha":"2945a5d7281ff67c06835c7f05eefd7389449cbb","user":{"login":"gabrielesvelto","id":1159312,"avatar_url":"https://avatars.githubusercontent.com/u/1159312?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrielesvelto","html_url":"https://github.com/gabrielesvelto","followers_url":"https://api.github.com/users/gabrielesvelto/followers","following_url":"https://api.github.com/users/gabrielesvelto/following{/other_user}","gists_url":"https://api.github.com/users/gabrielesvelto/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielesvelto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielesvelto/subscriptions","organizations_url":"https://api.github.com/users/gabrielesvelto/orgs","repos_url":"https://api.github.com/users/gabrielesvelto/repos","events_url":"https://api.github.com/users/gabrielesvelto/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielesvelto/received_events","type":"User","site_admin":false},"repo":{"id":6279318,"name":"gaia","full_name":"gabrielesvelto/gaia","owner":{"login":"gabrielesvelto","id":1159312,"avatar_url":"https://avatars.githubusercontent.com/u/1159312?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrielesvelto","html_url":"https://github.com/gabrielesvelto","followers_url":"https://api.github.com/users/gabrielesvelto/followers","following_url":"https://api.github.com/users/gabrielesvelto/following{/other_user}","gists_url":"https://api.github.com/users/gabrielesvelto/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielesvelto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielesvelto/subscriptions","organizations_url":"https://api.github.com/users/gabrielesvelto/orgs","repos_url":"https://api.github.com/users/gabrielesvelto/repos","events_url":"https://api.github.com/users/gabrielesvelto/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielesvelto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gabrielesvelto/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project","fork":true,"url":"https://api.github.com/repos/gabrielesvelto/gaia","forks_url":"https://api.github.com/repos/gabrielesvelto/gaia/forks","keys_url":"https://api.github.com/repos/gabrielesvelto/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gabrielesvelto/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gabrielesvelto/gaia/teams","hooks_url":"https://api.github.com/repos/gabrielesvelto/gaia/hooks","issue_events_url":"https://api.github.com/repos/gabrielesvelto/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/gabrielesvelto/gaia/events","assignees_url":"https://api.github.com/repos/gabrielesvelto/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/gabrielesvelto/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/gabrielesvelto/gaia/tags","blobs_url":"https://api.github.com/repos/gabrielesvelto/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gabrielesvelto/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gabrielesvelto/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/gabrielesvelto/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gabrielesvelto/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/gabrielesvelto/gaia/languages","stargazers_url":"https://api.github.com/repos/gabrielesvelto/gaia/stargazers","contributors_url":"https://api.github.com/repos/gabrielesvelto/gaia/contributors","subscribers_url":"https://api.github.com/repos/gabrielesvelto/gaia/subscribers","subscription_url":"https://api.github.com/repos/gabrielesvelto/gaia/subscription","commits_url":"https://api.github.com/repos/gabrielesvelto/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/gabrielesvelto/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/gabrielesvelto/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/gabrielesvelto/gaia/issues/comments/{number}","contents_url":"https://api.github.com/repos/gabrielesvelto/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/gabrielesvelto/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gabrielesvelto/gaia/merges","archive_url":"https://api.github.com/repos/gabrielesvelto/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gabrielesvelto/gaia/downloads","issues_url":"https://api.github.com/repos/gabrielesvelto/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/gabrielesvelto/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/gabrielesvelto/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/gabrielesvelto/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gabrielesvelto/gaia/labels{/name}","releases_url":"https://api.github.com/repos/gabrielesvelto/gaia/releases{/id}","created_at":"2012-10-18T13:53:19Z","updated_at":"2015-01-12T10:42:59Z","pushed_at":"2015-01-12T16:22:13Z","git_url":"git://github.com/gabrielesvelto/gaia.git","ssh_url":"git@github.com:gabrielesvelto/gaia.git","clone_url":"https://github.com/gabrielesvelto/gaia.git","svn_url":"https://github.com/gabrielesvelto/gaia","homepage":"https://wiki.mozilla.org/B2G","size":884524,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"0cd0ad51bd9591ee4bf8c8210d8fbe688814d1a8","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-01-12T17:32:39Z","pushed_at":"2015-01-12T17:32:38Z","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":1374030,"stargazers_count":1848,"watchers_count":1848,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2162,"mirror_url":null,"open_issues_count":804,"forks":2162,"open_issues":804,"watchers":1848,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27293"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/27293"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/27293"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/27293/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/27293/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/27293/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/2945a5d7281ff67c06835c7f05eefd7389449cbb"}}}}