| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 addClass(this.hostNameCell_, 'mode-select-label'); | 76 addClass(this.hostNameCell_, 'mode-select-label'); |
| 77 this.hostNameCell_.appendChild( | 77 this.hostNameCell_.appendChild( |
| 78 document.createTextNode(host.hostName)); | 78 document.createTextNode(host.hostName)); |
| 79 this.hostNameCell_.ondblclick = function() { that.beginRename_(); }; | 79 this.hostNameCell_.ondblclick = function() { that.beginRename_(); }; |
| 80 this.tableRow.appendChild(this.hostNameCell_); | 80 this.tableRow.appendChild(this.hostNameCell_); |
| 81 | 81 |
| 82 // Create the host status cell. | 82 // Create the host status cell. |
| 83 var hostStatus = document.createElement('td'); | 83 var hostStatus = document.createElement('td'); |
| 84 if (host.status == 'ONLINE') { | 84 if (host.status == 'ONLINE') { |
| 85 var hostUrl = chrome.extension.getURL('choice.html') + | 85 var hostUrl = chrome.extension.getURL('choice.html') + |
| 86 '?mode=me2me' + | 86 '?mode=me2me&hostId=' + encodeURIComponent(host.hostId); |
| 87 '&hostJid=' + encodeURIComponent(host.jabberId) + | |
| 88 '&hostPublicKey=' + encodeURIComponent(host.publicKey) + | |
| 89 '&hostName=' + encodeURIComponent(host.hostName); | |
| 90 var connectButton = document.createElement('button'); | 87 var connectButton = document.createElement('button'); |
| 91 connectButton.setAttribute('class', 'mode-select-button'); | 88 connectButton.setAttribute('class', 'mode-select-button'); |
| 92 connectButton.setAttribute('type', 'button'); | 89 connectButton.setAttribute('type', 'button'); |
| 93 connectButton.setAttribute('onclick', | 90 connectButton.setAttribute('onclick', |
| 94 'window.open("' + hostUrl + '", "_blank");'); | 91 'window.open("' + hostUrl + '", "_blank");'); |
| 95 connectButton.innerHTML = | 92 connectButton.innerHTML = |
| 96 chrome.i18n.getMessage(/*i18n-content*/'CONNECT_BUTTON'); | 93 chrome.i18n.getMessage(/*i18n-content*/'CONNECT_BUTTON'); |
| 97 hostStatus.appendChild(connectButton); | 94 hostStatus.appendChild(connectButton); |
| 98 } else { | 95 } else { |
| 99 addClass(this.tableRow, 'host-offline'); | 96 addClass(this.tableRow, 'host-offline'); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 * @return {void} Nothing. | 181 * @return {void} Nothing. |
| 185 * @private | 182 * @private |
| 186 */ | 183 */ |
| 187 remoting.HostTableEntry.prototype.onKeydown_ = function(event) { | 184 remoting.HostTableEntry.prototype.onKeydown_ = function(event) { |
| 188 if (event.which == 27) { // Escape | 185 if (event.which == 27) { // Escape |
| 189 this.removeEditBox_(); | 186 this.removeEditBox_(); |
| 190 } else if (event.which == 13) { // Enter | 187 } else if (event.which == 13) { // Enter |
| 191 this.commitRename_(); | 188 this.commitRename_(); |
| 192 } | 189 } |
| 193 }; | 190 }; |
| OLD | NEW |