| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }; |
| OLD | NEW |