| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 var MIN_VERSION_TAB_CLOSE = 25; | 5 var MIN_VERSION_TAB_CLOSE = 25; |
| 6 var MIN_VERSION_TARGET_ID = 26; | 6 var MIN_VERSION_TARGET_ID = 26; |
| 7 var MIN_VERSION_NEW_TAB = 29; | 7 var MIN_VERSION_NEW_TAB = 29; |
| 8 var MIN_VERSION_TAB_ACTIVATE = 30; | 8 var MIN_VERSION_TAB_ACTIVATE = 30; |
| 9 var WEBRTC_SERIAL = 'WEBRTC'; | 9 var WEBRTC_SERIAL = 'WEBRTC'; |
| 10 | 10 |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 newPageUrl.type = 'text'; | 307 newPageUrl.type = 'text'; |
| 308 newPageUrl.placeholder = 'Open tab with url'; | 308 newPageUrl.placeholder = 'Open tab with url'; |
| 309 newPage.appendChild(newPageUrl); | 309 newPage.appendChild(newPageUrl); |
| 310 | 310 |
| 311 var openHandler = function(sourceId, browserId, input) { | 311 var openHandler = function(sourceId, browserId, input) { |
| 312 sendCommand( | 312 sendCommand( |
| 313 'open', sourceId, browserId, input.value || 'about:blank'); | 313 'open', sourceId, browserId, input.value || 'about:blank'); |
| 314 input.value = ''; | 314 input.value = ''; |
| 315 }.bind(null, browser.source, browser.id, newPageUrl); | 315 }.bind(null, browser.source, browser.id, newPageUrl); |
| 316 newPageUrl.addEventListener('keyup', function(handler, event) { | 316 newPageUrl.addEventListener('keyup', function(handler, event) { |
| 317 if (event.keyIdentifier == 'Enter' && event.target.value) | 317 if (event.key == 'Enter' && event.target.value) |
| 318 handler(); | 318 handler(); |
| 319 }.bind(null, openHandler), true); | 319 }.bind(null, openHandler), true); |
| 320 | 320 |
| 321 var newPageButton = document.createElement('button'); | 321 var newPageButton = document.createElement('button'); |
| 322 newPageButton.textContent = 'Open'; | 322 newPageButton.textContent = 'Open'; |
| 323 newPage.appendChild(newPageButton); | 323 newPage.appendChild(newPageButton); |
| 324 newPageButton.addEventListener('click', openHandler, true); | 324 newPageButton.addEventListener('click', openHandler, true); |
| 325 | 325 |
| 326 browserHeader.appendChild(newPage); | 326 browserHeader.appendChild(newPage); |
| 327 } | 327 } |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 link.classList.add('action'); | 583 link.classList.add('action'); |
| 584 link.setAttribute('tabindex', 1); | 584 link.setAttribute('tabindex', 1); |
| 585 if (opt_disabled) | 585 if (opt_disabled) |
| 586 link.classList.add('disabled'); | 586 link.classList.add('disabled'); |
| 587 else | 587 else |
| 588 link.classList.remove('disabled'); | 588 link.classList.remove('disabled'); |
| 589 | 589 |
| 590 link.textContent = text; | 590 link.textContent = text; |
| 591 link.addEventListener('click', handler, true); | 591 link.addEventListener('click', handler, true); |
| 592 function handleKey(e) { | 592 function handleKey(e) { |
| 593 if (e.keyIdentifier == 'Enter' || e.keyIdentifier == 'U+0020') { | 593 if (e.key == 'Enter' || e.key == ' ') { |
| 594 e.preventDefault(); | 594 e.preventDefault(); |
| 595 handler(); | 595 handler(); |
| 596 } | 596 } |
| 597 } | 597 } |
| 598 link.addEventListener('keydown', handleKey, true); | 598 link.addEventListener('keydown', handleKey, true); |
| 599 row.querySelector('.actions').appendChild(link); | 599 row.querySelector('.actions').appendChild(link); |
| 600 } | 600 } |
| 601 | 601 |
| 602 | 602 |
| 603 function initSettings() { | 603 function initSettings() { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 var line = document.createElement('div'); | 725 var line = document.createElement('div'); |
| 726 line.className = 'port-forwarding-pair'; | 726 line.className = 'port-forwarding-pair'; |
| 727 | 727 |
| 728 var portInput = createConfigField(port, 'port', 'Port', validatePort); | 728 var portInput = createConfigField(port, 'port', 'Port', validatePort); |
| 729 line.appendChild(portInput); | 729 line.appendChild(portInput); |
| 730 | 730 |
| 731 var locationInput = createConfigField( | 731 var locationInput = createConfigField( |
| 732 location, 'location', 'IP address and port', validateLocation); | 732 location, 'location', 'IP address and port', validateLocation); |
| 733 line.appendChild(locationInput); | 733 line.appendChild(locationInput); |
| 734 locationInput.addEventListener('keydown', function(e) { | 734 locationInput.addEventListener('keydown', function(e) { |
| 735 if (e.keyIdentifier == 'U+0009' && // Tab | 735 if (e.key == 'Tab' && |
| 736 !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && | 736 !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && |
| 737 line.classList.contains('fresh') && | 737 line.classList.contains('fresh') && |
| 738 !line.classList.contains('empty')) { | 738 !line.classList.contains('empty')) { |
| 739 // Tabbing forward on the fresh line, try create a new empty one. | 739 // Tabbing forward on the fresh line, try create a new empty one. |
| 740 if (commitFreshLineIfValid(true)) | 740 if (commitFreshLineIfValid(true)) |
| 741 e.preventDefault(); | 741 e.preventDefault(); |
| 742 } | 742 } |
| 743 }); | 743 }); |
| 744 | 744 |
| 745 var lineDelete = document.createElement('div'); | 745 var lineDelete = document.createElement('div'); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 deviceSection.querySelectorAll('.browser'), clearBrowserPorts); | 930 deviceSection.querySelectorAll('.browser'), clearBrowserPorts); |
| 931 } | 931 } |
| 932 | 932 |
| 933 Array.prototype.forEach.call( | 933 Array.prototype.forEach.call( |
| 934 document.querySelectorAll('.device'), clearPorts); | 934 document.querySelectorAll('.device'), clearPorts); |
| 935 } | 935 } |
| 936 | 936 |
| 937 document.addEventListener('DOMContentLoaded', onload); | 937 document.addEventListener('DOMContentLoaded', onload); |
| 938 | 938 |
| 939 window.addEventListener('hashchange', onHashChange); | 939 window.addEventListener('hashchange', onHashChange); |
| OLD | NEW |