Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: remoting/webapp/me2mom/host_table_entry.js

Issue 8782001: Refactored HostList to better support bookmarking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge bug. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/webapp/me2mom/host_list.js ('k') | remoting/webapp/me2mom/remoting.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Class representing an entry in the host-list portion of the home screen. 7 * Class representing an entry in the host-list portion of the home screen.
8 */ 8 */
9 9
10 'use strict'; 10 'use strict';
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 addClass(this.hostNameCell_, 'mode-select-label'); 78 addClass(this.hostNameCell_, 'mode-select-label');
79 this.hostNameCell_.appendChild( 79 this.hostNameCell_.appendChild(
80 document.createTextNode(host.hostName)); 80 document.createTextNode(host.hostName));
81 this.hostNameCell_.ondblclick = function() { that.beginRename_(); }; 81 this.hostNameCell_.ondblclick = function() { that.beginRename_(); };
82 this.tableRow.appendChild(this.hostNameCell_); 82 this.tableRow.appendChild(this.hostNameCell_);
83 83
84 // Create the host status cell. 84 // Create the host status cell.
85 var hostStatus = document.createElement('td'); 85 var hostStatus = document.createElement('td');
86 if (host.status == 'ONLINE') { 86 if (host.status == 'ONLINE') {
87 var hostUrl = chrome.extension.getURL('choice.html') + 87 var hostUrl = chrome.extension.getURL('choice.html') +
88 '?mode=me2me' + 88 '?mode=me2me&hostId=' + encodeURIComponent(host.hostId);
89 '&hostJid=' + encodeURIComponent(host.jabberId) +
90 '&hostPublicKey=' + encodeURIComponent(host.publicKey) +
91 '&hostName=' + encodeURIComponent(host.hostName);
92 var connectButton = document.createElement('button'); 89 var connectButton = document.createElement('button');
93 connectButton.setAttribute('class', 'mode-select-button'); 90 connectButton.setAttribute('class', 'mode-select-button');
94 connectButton.setAttribute('type', 'button'); 91 connectButton.setAttribute('type', 'button');
95 connectButton.setAttribute('onclick', 92 connectButton.setAttribute('onclick',
96 'window.open("' + hostUrl + '", "_blank");'); 93 'window.open("' + hostUrl + '", "_blank");');
97 connectButton.innerHTML = 94 connectButton.innerHTML =
98 chrome.i18n.getMessage(/*i18n-content*/'CONNECT_BUTTON'); 95 chrome.i18n.getMessage(/*i18n-content*/'CONNECT_BUTTON');
99 hostStatus.appendChild(connectButton); 96 hostStatus.appendChild(connectButton);
100 } else { 97 } else {
101 addClass(this.tableRow, 'host-offline'); 98 addClass(this.tableRow, 'host-offline');
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 * @return {void} Nothing. 183 * @return {void} Nothing.
187 * @private 184 * @private
188 */ 185 */
189 remoting.HostTableEntry.prototype.onKeydown_ = function(event) { 186 remoting.HostTableEntry.prototype.onKeydown_ = function(event) {
190 if (event.which == 27) { // Escape 187 if (event.which == 27) { // Escape
191 this.removeEditBox_(); 188 this.removeEditBox_();
192 } else if (event.which == 13) { // Enter 189 } else if (event.which == 13) { // Enter
193 this.commitRename_(); 190 this.commitRename_();
194 } 191 }
195 }; 192 };
OLDNEW
« no previous file with comments | « remoting/webapp/me2mom/host_list.js ('k') | remoting/webapp/me2mom/remoting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698