{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleChrome/webrtc/pulls/comments/23245575","id":23245575,"diff_hunk":"@@ -0,0 +1,139 @@\n+/*\n+ *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.\n+ *\n+ *  Use of this source code is governed by a BSD-style license\n+ *  that can be found in the LICENSE file in the root of the source\n+ *  tree.\n+ */\n+\n+/* More information about these options at jshint.com/docs/options */\n+\n+/* globals randomString, Storage, parseJSON */\n+/* exported RoomSelection */\n+\n+'use strict';\n+\n+var RoomSelection = function(roomSelectionDiv, uiConstants, recentRoomsKey) {\n+  this.roomSelectionDiv_ = roomSelectionDiv;\n+  \n+  this.uiConstants = uiConstants;\n+  \n+  this.roomIdInput_ = this.roomSelectionDiv_.querySelector(this.uiConstants.roomSelectionInput);\n+  this.roomJoinButton_ = this.roomSelectionDiv_.querySelector(this.uiConstants.roomSelectionJoinButton);\n+  this.roomRandomButton_ = this.roomSelectionDiv_.querySelector(this.uiConstants.roomSelectionRandomButton);\n+  this.roomRecentList_ = this.roomSelectionDiv_.querySelector(this.uiConstants.roomSelectionRecentList);\n+  \n+  this.roomIdInput_.value = randomString(9);\n+  // Call onRoomIdInput_ now to validate initial state of input box.\n+  this.onRoomIdInput_();\n+  this.roomIdInput_.addEventListener('input', this.onRoomIdInput_.bind(this), false);\n+  this.roomRandomButton_.addEventListener('click', this.onRandomButton_.bind(this), false);\n+  this.roomJoinButton_.addEventListener('click', this.onJoinButton_.bind(this), false);\n+  \n+  // Public callbacks. Keep it sorted.\n+  this.onRoomSelected = null;\n+  \n+  this.recentlyUsedList_ = new RoomSelection.RecentlyUsedList(recentRoomsKey);\n+  this.startBuildingRecentRoomList_();\n+};\n+\n+RoomSelection.prototype.startBuildingRecentRoomList_ = function() {\n+  this.recentlyUsedList_.getRecentRooms().then(this.buildRecentRoomList_.bind(this)).catch(function(error) {\n+    trace('Error building recent rooms list: ' + error.message);\n+  }.bind(this));\n+};\n+\n+RoomSelection.prototype.buildRecentRoomList_ = function(recentRooms) {\n+  for (var i = 0; i < recentRooms.length; ++i) {\n+    // Create link in recent list\n+    var li = document.createElement('li');\n+    var href = document.createElement('a');\n+    var linkText = document.createTextNode(recentRooms[i]);\n+    href.appendChild(linkText);\n+    href.href = location.origin + '/r/' + encodeURIComponent(recentRooms[i]);\n+    li.appendChild(href);\n+    this.roomRecentList_.appendChild(li);\n+  \n+    // Set up click handler to avoid browser navigation.\n+    href.addEventListener('click', this.makeRecentlyUsedClickHandler_(recentRooms[i]).bind(this), false);\n+  }\n+};\n+\n+RoomSelection.prototype.onRoomIdInput_ = function() {\n+  // validate room id, enable/disable join button","path":"samples/web/content/apprtc/js/roomselection.js","position":63,"original_position":63,"commit_id":"90c9ddb7b762987d46c23117e76b59f3190fd9e2","original_commit_id":"90c9ddb7b762987d46c23117e76b59f3190fd9e2","user":{"login":"jiayliu","id":7770539,"avatar_url":"https://avatars.githubusercontent.com/u/7770539?v=3","gravatar_id":"","url":"https://api.github.com/users/jiayliu","html_url":"https://github.com/jiayliu","followers_url":"https://api.github.com/users/jiayliu/followers","following_url":"https://api.github.com/users/jiayliu/following{/other_user}","gists_url":"https://api.github.com/users/jiayliu/gists{/gist_id}","starred_url":"https://api.github.com/users/jiayliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiayliu/subscriptions","organizations_url":"https://api.github.com/users/jiayliu/orgs","repos_url":"https://api.github.com/users/jiayliu/repos","events_url":"https://api.github.com/users/jiayliu/events{/privacy}","received_events_url":"https://api.github.com/users/jiayliu/received_events","type":"User","site_admin":false},"body":"nit: end with '.'","created_at":"2015-01-20T18:58:25Z","updated_at":"2015-01-20T18:58:25Z","html_url":"https://github.com/GoogleChrome/webrtc/pull/392#discussion_r23245575","pull_request_url":"https://api.github.com/repos/GoogleChrome/webrtc/pulls/392","_links":{"self":{"href":"https://api.github.com/repos/GoogleChrome/webrtc/pulls/comments/23245575"},"html":{"href":"https://github.com/GoogleChrome/webrtc/pull/392#discussion_r23245575"},"pull_request":{"href":"https://api.github.com/repos/GoogleChrome/webrtc/pulls/392"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleChrome/webrtc/pulls/392","id":27523009,"html_url":"https://github.com/GoogleChrome/webrtc/pull/392","diff_url":"https://github.com/GoogleChrome/webrtc/pull/392.diff","patch_url":"https://github.com/GoogleChrome/webrtc/pull/392.patch","issue_url":"https://api.github.com/repos/GoogleChrome/webrtc/issues/392","number":392,"state":"open","locked":false,"title":"Add landing page to apprtc and chrome app.","user":{"login":"chuckhays","id":1405600,"avatar_url":"https://avatars.githubusercontent.com/u/1405600?v=3","gravatar_id":"","url":"https://api.github.com/users/chuckhays","html_url":"https://github.com/chuckhays","followers_url":"https://api.github.com/users/chuckhays/followers","following_url":"https://api.github.com/users/chuckhays/following{/other_user}","gists_url":"https://api.github.com/users/chuckhays/gists{/gist_id}","starred_url":"https://api.github.com/users/chuckhays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuckhays/subscriptions","organizations_url":"https://api.github.com/users/chuckhays/orgs","repos_url":"https://api.github.com/users/chuckhays/repos","events_url":"https://api.github.com/users/chuckhays/events{/privacy}","received_events_url":"https://api.github.com/users/chuckhays/received_events","type":"User","site_admin":false},"body":"This adds a basic landing page to the web app and Chrome app, with UI similar to the existing landing page of the android app. \r\n\r\nWe can use this as a starting point for building the new UI for the Chrome app.\r\n\r\n@jiayliu @juberti ","created_at":"2015-01-16T17:46:19Z","updated_at":"2015-01-20T18:58:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9956c1710926a61783567dc928d5b035a16d18d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleChrome/webrtc/pulls/392/commits","review_comments_url":"https://api.github.com/repos/GoogleChrome/webrtc/pulls/392/comments","review_comment_url":"https://api.github.com/repos/GoogleChrome/webrtc/pulls/comments/{number}","comments_url":"https://api.github.com/repos/GoogleChrome/webrtc/issues/392/comments","statuses_url":"https://api.github.com/repos/GoogleChrome/webrtc/statuses/90c9ddb7b762987d46c23117e76b59f3190fd9e2","head":{"label":"chuckhays:landing","ref":"landing","sha":"90c9ddb7b762987d46c23117e76b59f3190fd9e2","user":{"login":"chuckhays","id":1405600,"avatar_url":"https://avatars.githubusercontent.com/u/1405600?v=3","gravatar_id":"","url":"https://api.github.com/users/chuckhays","html_url":"https://github.com/chuckhays","followers_url":"https://api.github.com/users/chuckhays/followers","following_url":"https://api.github.com/users/chuckhays/following{/other_user}","gists_url":"https://api.github.com/users/chuckhays/gists{/gist_id}","starred_url":"https://api.github.com/users/chuckhays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuckhays/subscriptions","organizations_url":"https://api.github.com/users/chuckhays/orgs","repos_url":"https://api.github.com/users/chuckhays/repos","events_url":"https://api.github.com/users/chuckhays/events{/privacy}","received_events_url":"https://api.github.com/users/chuckhays/received_events","type":"User","site_admin":false},"repo":{"id":28193736,"name":"webrtc","full_name":"chuckhays/webrtc","owner":{"login":"chuckhays","id":1405600,"avatar_url":"https://avatars.githubusercontent.com/u/1405600?v=3","gravatar_id":"","url":"https://api.github.com/users/chuckhays","html_url":"https://github.com/chuckhays","followers_url":"https://api.github.com/users/chuckhays/followers","following_url":"https://api.github.com/users/chuckhays/following{/other_user}","gists_url":"https://api.github.com/users/chuckhays/gists{/gist_id}","starred_url":"https://api.github.com/users/chuckhays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuckhays/subscriptions","organizations_url":"https://api.github.com/users/chuckhays/orgs","repos_url":"https://api.github.com/users/chuckhays/repos","events_url":"https://api.github.com/users/chuckhays/events{/privacy}","received_events_url":"https://api.github.com/users/chuckhays/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chuckhays/webrtc","description":"WebRTC demos and samples","fork":true,"url":"https://api.github.com/repos/chuckhays/webrtc","forks_url":"https://api.github.com/repos/chuckhays/webrtc/forks","keys_url":"https://api.github.com/repos/chuckhays/webrtc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chuckhays/webrtc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chuckhays/webrtc/teams","hooks_url":"https://api.github.com/repos/chuckhays/webrtc/hooks","issue_events_url":"https://api.github.com/repos/chuckhays/webrtc/issues/events{/number}","events_url":"https://api.github.com/repos/chuckhays/webrtc/events","assignees_url":"https://api.github.com/repos/chuckhays/webrtc/assignees{/user}","branches_url":"https://api.github.com/repos/chuckhays/webrtc/branches{/branch}","tags_url":"https://api.github.com/repos/chuckhays/webrtc/tags","blobs_url":"https://api.github.com/repos/chuckhays/webrtc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chuckhays/webrtc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chuckhays/webrtc/git/refs{/sha}","trees_url":"https://api.github.com/repos/chuckhays/webrtc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chuckhays/webrtc/statuses/{sha}","languages_url":"https://api.github.com/repos/chuckhays/webrtc/languages","stargazers_url":"https://api.github.com/repos/chuckhays/webrtc/stargazers","contributors_url":"https://api.github.com/repos/chuckhays/webrtc/contributors","subscribers_url":"https://api.github.com/repos/chuckhays/webrtc/subscribers","subscription_url":"https://api.github.com/repos/chuckhays/webrtc/subscription","commits_url":"https://api.github.com/repos/chuckhays/webrtc/commits{/sha}","git_commits_url":"https://api.github.com/repos/chuckhays/webrtc/git/commits{/sha}","comments_url":"https://api.github.com/repos/chuckhays/webrtc/comments{/number}","issue_comment_url":"https://api.github.com/repos/chuckhays/webrtc/issues/comments/{number}","contents_url":"https://api.github.com/repos/chuckhays/webrtc/contents/{+path}","compare_url":"https://api.github.com/repos/chuckhays/webrtc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chuckhays/webrtc/merges","archive_url":"https://api.github.com/repos/chuckhays/webrtc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chuckhays/webrtc/downloads","issues_url":"https://api.github.com/repos/chuckhays/webrtc/issues{/number}","pulls_url":"https://api.github.com/repos/chuckhays/webrtc/pulls{/number}","milestones_url":"https://api.github.com/repos/chuckhays/webrtc/milestones{/number}","notifications_url":"https://api.github.com/repos/chuckhays/webrtc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chuckhays/webrtc/labels{/name}","releases_url":"https://api.github.com/repos/chuckhays/webrtc/releases{/id}","created_at":"2014-12-18T17:27:09Z","updated_at":"2015-01-20T17:53:44Z","pushed_at":"2015-01-20T18:10:42Z","git_url":"git://github.com/chuckhays/webrtc.git","ssh_url":"git@github.com:chuckhays/webrtc.git","clone_url":"https://github.com/chuckhays/webrtc.git","svn_url":"https://github.com/chuckhays/webrtc","homepage":"http://googlechrome.github.io/webrtc/","size":3227,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"GoogleChrome:master","ref":"master","sha":"5daa5cf233fafb6986995e65d5f4bf9901211049","user":{"login":"GoogleChrome","id":1778935,"avatar_url":"https://avatars.githubusercontent.com/u/1778935?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleChrome","html_url":"https://github.com/GoogleChrome","followers_url":"https://api.github.com/users/GoogleChrome/followers","following_url":"https://api.github.com/users/GoogleChrome/following{/other_user}","gists_url":"https://api.github.com/users/GoogleChrome/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleChrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleChrome/subscriptions","organizations_url":"https://api.github.com/users/GoogleChrome/orgs","repos_url":"https://api.github.com/users/GoogleChrome/repos","events_url":"https://api.github.com/users/GoogleChrome/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleChrome/received_events","type":"Organization","site_admin":false},"repo":{"id":12970971,"name":"webrtc","full_name":"GoogleChrome/webrtc","owner":{"login":"GoogleChrome","id":1778935,"avatar_url":"https://avatars.githubusercontent.com/u/1778935?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleChrome","html_url":"https://github.com/GoogleChrome","followers_url":"https://api.github.com/users/GoogleChrome/followers","following_url":"https://api.github.com/users/GoogleChrome/following{/other_user}","gists_url":"https://api.github.com/users/GoogleChrome/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleChrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleChrome/subscriptions","organizations_url":"https://api.github.com/users/GoogleChrome/orgs","repos_url":"https://api.github.com/users/GoogleChrome/repos","events_url":"https://api.github.com/users/GoogleChrome/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleChrome/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleChrome/webrtc","description":"WebRTC demos and samples","fork":false,"url":"https://api.github.com/repos/GoogleChrome/webrtc","forks_url":"https://api.github.com/repos/GoogleChrome/webrtc/forks","keys_url":"https://api.github.com/repos/GoogleChrome/webrtc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleChrome/webrtc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleChrome/webrtc/teams","hooks_url":"https://api.github.com/repos/GoogleChrome/webrtc/hooks","issue_events_url":"https://api.github.com/repos/GoogleChrome/webrtc/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleChrome/webrtc/events","assignees_url":"https://api.github.com/repos/GoogleChrome/webrtc/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleChrome/webrtc/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleChrome/webrtc/tags","blobs_url":"https://api.github.com/repos/GoogleChrome/webrtc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleChrome/webrtc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleChrome/webrtc/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleChrome/webrtc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleChrome/webrtc/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleChrome/webrtc/languages","stargazers_url":"https://api.github.com/repos/GoogleChrome/webrtc/stargazers","contributors_url":"https://api.github.com/repos/GoogleChrome/webrtc/contributors","subscribers_url":"https://api.github.com/repos/GoogleChrome/webrtc/subscribers","subscription_url":"https://api.github.com/repos/GoogleChrome/webrtc/subscription","commits_url":"https://api.github.com/repos/GoogleChrome/webrtc/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleChrome/webrtc/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleChrome/webrtc/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleChrome/webrtc/issues/comments/{number}","contents_url":"https://api.github.com/repos/GoogleChrome/webrtc/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleChrome/webrtc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleChrome/webrtc/merges","archive_url":"https://api.github.com/repos/GoogleChrome/webrtc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleChrome/webrtc/downloads","issues_url":"https://api.github.com/repos/GoogleChrome/webrtc/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleChrome/webrtc/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleChrome/webrtc/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleChrome/webrtc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleChrome/webrtc/labels{/name}","releases_url":"https://api.github.com/repos/GoogleChrome/webrtc/releases{/id}","created_at":"2013-09-20T10:40:23Z","updated_at":"2015-01-20T10:06:08Z","pushed_at":"2015-01-20T10:33:17Z","git_url":"git://github.com/GoogleChrome/webrtc.git","ssh_url":"git@github.com:GoogleChrome/webrtc.git","clone_url":"https://github.com/GoogleChrome/webrtc.git","svn_url":"https://github.com/GoogleChrome/webrtc","homepage":"http://googlechrome.github.io/webrtc/","size":10342,"stargazers_count":648,"watchers_count":648,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":383,"mirror_url":null,"open_issues_count":89,"forks":383,"open_issues":89,"watchers":648,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleChrome/webrtc/pulls/392"},"html":{"href":"https://github.com/GoogleChrome/webrtc/pull/392"},"issue":{"href":"https://api.github.com/repos/GoogleChrome/webrtc/issues/392"},"comments":{"href":"https://api.github.com/repos/GoogleChrome/webrtc/issues/392/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleChrome/webrtc/pulls/392/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleChrome/webrtc/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/GoogleChrome/webrtc/pulls/392/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleChrome/webrtc/statuses/90c9ddb7b762987d46c23117e76b59f3190fd9e2"}}}}