| 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 | 9 |
| 10 function inspect(data) { | 10 function sendCommand(command, args) { |
| 11 chrome.send('inspect', [data]); | 11 chrome.send(command, Array.prototype.slice.call(arguments, 1)); |
| 12 } | 12 } |
| 13 | 13 |
| 14 function activate(data) { | 14 function sendTargetCommand(command, target) { |
| 15 chrome.send('activate', [data]); | 15 sendCommand(command, target.source, target.id); |
| 16 } | |
| 17 | |
| 18 function close(data) { | |
| 19 chrome.send('close', [data]); | |
| 20 } | |
| 21 | |
| 22 function reload(data) { | |
| 23 chrome.send('reload', [data]); | |
| 24 } | |
| 25 | |
| 26 function open(browserId, url) { | |
| 27 chrome.send('open', [browserId, url]); | |
| 28 } | 16 } |
| 29 | 17 |
| 30 function removeChildren(element_id) { | 18 function removeChildren(element_id) { |
| 31 var element = $(element_id); | 19 var element = $(element_id); |
| 32 element.textContent = ''; | 20 element.textContent = ''; |
| 33 } | 21 } |
| 34 | 22 |
| 35 function onload() { | 23 function onload() { |
| 36 var tabContents = document.querySelectorAll('#content > div'); | 24 var tabContents = document.querySelectorAll('#content > div'); |
| 37 for (var i = 0; i != tabContents.length; i++) { | 25 for (var i = 0; i != tabContents.length; i++) { |
| 38 var tabContent = tabContents[i]; | 26 var tabContent = tabContents[i]; |
| 39 var tabName = tabContent.querySelector('.content-header').textContent; | 27 var tabName = tabContent.querySelector('.content-header').textContent; |
| 40 | 28 |
| 41 var tabHeader = document.createElement('div'); | 29 var tabHeader = document.createElement('div'); |
| 42 tabHeader.className = 'tab-header'; | 30 tabHeader.className = 'tab-header'; |
| 43 var button = document.createElement('button'); | 31 var button = document.createElement('button'); |
| 44 button.textContent = tabName; | 32 button.textContent = tabName; |
| 45 tabHeader.appendChild(button); | 33 tabHeader.appendChild(button); |
| 46 tabHeader.addEventListener('click', selectTab.bind(null, tabContent.id)); | 34 tabHeader.addEventListener('click', selectTab.bind(null, tabContent.id)); |
| 47 $('navigation').appendChild(tabHeader); | 35 $('navigation').appendChild(tabHeader); |
| 48 } | 36 } |
| 49 var selectedTabName = window.location.hash.slice(1) || 'devices'; | 37 var selectedTabName = window.location.hash.slice(1) || 'devices'; |
| 50 selectTab(selectedTabName); | 38 selectTab(selectedTabName); |
| 51 initSettings(); | 39 initSettings(); |
| 52 chrome.send('init-ui'); | 40 sendCommand('init-ui'); |
| 53 } | 41 } |
| 54 | 42 |
| 55 function selectTab(id) { | 43 function selectTab(id) { |
| 56 var tabContents = document.querySelectorAll('#content > div'); | 44 var tabContents = document.querySelectorAll('#content > div'); |
| 57 var tabHeaders = $('navigation').querySelectorAll('.tab-header'); | 45 var tabHeaders = $('navigation').querySelectorAll('.tab-header'); |
| 58 for (var i = 0; i != tabContents.length; i++) { | 46 for (var i = 0; i != tabContents.length; i++) { |
| 59 var tabContent = tabContents[i]; | 47 var tabContent = tabContents[i]; |
| 60 var tabHeader = tabHeaders[i]; | 48 var tabHeader = tabHeaders[i]; |
| 61 if (tabContent.id == id) { | 49 if (tabContent.id == id) { |
| 62 tabContent.classList.add('selected'); | 50 tabContent.classList.add('selected'); |
| 63 tabHeader.classList.add('selected'); | 51 tabHeader.classList.add('selected'); |
| 64 } else { | 52 } else { |
| 65 tabContent.classList.remove('selected'); | 53 tabContent.classList.remove('selected'); |
| 66 tabHeader.classList.remove('selected'); | 54 tabHeader.classList.remove('selected'); |
| 67 } | 55 } |
| 68 } | 56 } |
| 69 window.location.hash = id; | 57 window.location.hash = id; |
| 70 } | 58 } |
| 71 | 59 |
| 60 function populateTargets(source, data) { |
| 61 if (source == 'renderers') |
| 62 populateWebContentsTargets(data); |
| 63 else if (source == 'workers') |
| 64 populateWorkerTargets(data); |
| 65 else if (source == 'adb') |
| 66 populateRemoteTargets(data); |
| 67 else |
| 68 console.error('Unknown source type: ' + source); |
| 69 } |
| 70 |
| 72 function populateWebContentsTargets(data) { | 71 function populateWebContentsTargets(data) { |
| 73 removeChildren('pages-list'); | 72 removeChildren('pages-list'); |
| 74 removeChildren('extensions-list'); | 73 removeChildren('extensions-list'); |
| 75 removeChildren('apps-list'); | 74 removeChildren('apps-list'); |
| 76 removeChildren('others-list'); | 75 removeChildren('others-list'); |
| 77 | 76 |
| 78 for (var i = 0; i < data.length; i++) { | 77 for (var i = 0; i < data.length; i++) { |
| 79 if (data[i].type === 'page') | 78 if (data[i].type === 'page') |
| 80 addToPagesList(data[i]); | 79 addToPagesList(data[i]); |
| 81 else if (data[i].type === 'background_page') | 80 else if (data[i].type === 'background_page') |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 124 |
| 126 var deviceList = $('devices-list'); | 125 var deviceList = $('devices-list'); |
| 127 if (alreadyDisplayed(deviceList, devices)) | 126 if (alreadyDisplayed(deviceList, devices)) |
| 128 return; | 127 return; |
| 129 | 128 |
| 130 function removeObsolete(validIds, section) { | 129 function removeObsolete(validIds, section) { |
| 131 if (validIds.indexOf(section.id) < 0) | 130 if (validIds.indexOf(section.id) < 0) |
| 132 section.remove(); | 131 section.remove(); |
| 133 } | 132 } |
| 134 | 133 |
| 135 var newDeviceIds = devices.map(function(d) { return d.adbGlobalId }); | 134 var newDeviceIds = devices.map(function(d) { return d.id }); |
| 136 Array.prototype.forEach.call( | 135 Array.prototype.forEach.call( |
| 137 deviceList.querySelectorAll('.device'), | 136 deviceList.querySelectorAll('.device'), |
| 138 removeObsolete.bind(null, newDeviceIds)); | 137 removeObsolete.bind(null, newDeviceIds)); |
| 139 | 138 |
| 140 for (var d = 0; d < devices.length; d++) { | 139 for (var d = 0; d < devices.length; d++) { |
| 141 var device = devices[d]; | 140 var device = devices[d]; |
| 142 | 141 |
| 143 var deviceSection = $(device.adbGlobalId); | 142 var deviceSection = $(device.id); |
| 144 if (!deviceSection) { | 143 if (!deviceSection) { |
| 145 deviceSection = document.createElement('div'); | 144 deviceSection = document.createElement('div'); |
| 146 deviceSection.id = device.adbGlobalId; | 145 deviceSection.id = device.id; |
| 147 deviceSection.className = 'device'; | 146 deviceSection.className = 'device'; |
| 148 deviceList.appendChild(deviceSection); | 147 deviceList.appendChild(deviceSection); |
| 149 | 148 |
| 150 var deviceHeader = document.createElement('div'); | 149 var deviceHeader = document.createElement('div'); |
| 151 deviceHeader.className = 'device-header'; | 150 deviceHeader.className = 'device-header'; |
| 152 deviceSection.appendChild(deviceHeader); | 151 deviceSection.appendChild(deviceHeader); |
| 153 | 152 |
| 154 var deviceName = document.createElement('div'); | 153 var deviceName = document.createElement('div'); |
| 155 deviceName.className = 'device-name'; | 154 deviceName.className = 'device-name'; |
| 156 deviceHeader.appendChild(deviceName); | 155 deviceHeader.appendChild(deviceName); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 portNumber.className = 'port-number'; | 201 portNumber.className = 'port-number'; |
| 203 portNumber.textContent = ':' + port; | 202 portNumber.textContent = ':' + port; |
| 204 if (status > 0) | 203 if (status > 0) |
| 205 portNumber.textContent += '(' + status + ')'; | 204 portNumber.textContent += '(' + status + ')'; |
| 206 devicePorts.appendChild(portNumber); | 205 devicePorts.appendChild(portNumber); |
| 207 } | 206 } |
| 208 } | 207 } |
| 209 | 208 |
| 210 var browserList = deviceSection.querySelector('.browsers'); | 209 var browserList = deviceSection.querySelector('.browsers'); |
| 211 var newBrowserIds = | 210 var newBrowserIds = |
| 212 device.browsers.map(function(b) { return b.adbGlobalId }); | 211 device.browsers.map(function(b) { return b.id }); |
| 213 Array.prototype.forEach.call( | 212 Array.prototype.forEach.call( |
| 214 browserList.querySelectorAll('.browser'), | 213 browserList.querySelectorAll('.browser'), |
| 215 removeObsolete.bind(null, newBrowserIds)); | 214 removeObsolete.bind(null, newBrowserIds)); |
| 216 | 215 |
| 217 for (var b = 0; b < device.browsers.length; b++) { | 216 for (var b = 0; b < device.browsers.length; b++) { |
| 218 var browser = device.browsers[b]; | 217 var browser = device.browsers[b]; |
| 219 | 218 |
| 220 var majorChromeVersion = browser.adbBrowserChromeVersion; | 219 var majorChromeVersion = browser.adbBrowserChromeVersion; |
| 221 | 220 |
| 222 var pageList; | 221 var pageList; |
| 223 var browserSection = $(browser.adbGlobalId); | 222 var browserSection = $(browser.id); |
| 224 if (browserSection) { | 223 if (browserSection) { |
| 225 pageList = browserSection.querySelector('.pages'); | 224 pageList = browserSection.querySelector('.pages'); |
| 226 } else { | 225 } else { |
| 227 browserSection = document.createElement('div'); | 226 browserSection = document.createElement('div'); |
| 228 browserSection.id = browser.adbGlobalId; | 227 browserSection.id = browser.id; |
| 229 browserSection.className = 'browser'; | 228 browserSection.className = 'browser'; |
| 230 insertChildSortedById(browserList, browserSection); | 229 insertChildSortedById(browserList, browserSection); |
| 231 | 230 |
| 232 var browserHeader = document.createElement('div'); | 231 var browserHeader = document.createElement('div'); |
| 233 browserHeader.className = 'browser-header'; | 232 browserHeader.className = 'browser-header'; |
| 234 | 233 |
| 235 var browserName = document.createElement('div'); | 234 var browserName = document.createElement('div'); |
| 236 browserName.className = 'browser-name'; | 235 browserName.className = 'browser-name'; |
| 237 browserHeader.appendChild(browserName); | 236 browserHeader.appendChild(browserName); |
| 238 browserName.textContent = browser.adbBrowserName; | 237 browserName.textContent = browser.adbBrowserName; |
| 239 if (browser.adbBrowserVersion) | 238 if (browser.adbBrowserVersion) |
| 240 browserName.textContent += ' (' + browser.adbBrowserVersion + ')'; | 239 browserName.textContent += ' (' + browser.adbBrowserVersion + ')'; |
| 241 browserSection.appendChild(browserHeader); | 240 browserSection.appendChild(browserHeader); |
| 242 | 241 |
| 243 if (majorChromeVersion >= MIN_VERSION_NEW_TAB) { | 242 if (majorChromeVersion >= MIN_VERSION_NEW_TAB) { |
| 244 var newPage = document.createElement('div'); | 243 var newPage = document.createElement('div'); |
| 245 newPage.className = 'open'; | 244 newPage.className = 'open'; |
| 246 | 245 |
| 247 var newPageUrl = document.createElement('input'); | 246 var newPageUrl = document.createElement('input'); |
| 248 newPageUrl.type = 'text'; | 247 newPageUrl.type = 'text'; |
| 249 newPageUrl.placeholder = 'Open tab with url'; | 248 newPageUrl.placeholder = 'Open tab with url'; |
| 250 newPage.appendChild(newPageUrl); | 249 newPage.appendChild(newPageUrl); |
| 251 | 250 |
| 252 var openHandler = function(browserId, input) { | 251 var openHandler = function(sourceId, browserId, input) { |
| 253 open(browserId, input.value || 'about:blank'); | 252 sendCommand( |
| 253 'open', sourceId, browserId, input.value || 'about:blank'); |
| 254 input.value = ''; | 254 input.value = ''; |
| 255 }.bind(null, browser.adbGlobalId, newPageUrl); | 255 }.bind(null, browser.source, browser.id, newPageUrl); |
| 256 newPageUrl.addEventListener('keyup', function(handler, event) { | 256 newPageUrl.addEventListener('keyup', function(handler, event) { |
| 257 if (event.keyIdentifier == 'Enter' && event.target.value) | 257 if (event.keyIdentifier == 'Enter' && event.target.value) |
| 258 handler(); | 258 handler(); |
| 259 }.bind(null, openHandler), true); | 259 }.bind(null, openHandler), true); |
| 260 | 260 |
| 261 var newPageButton = document.createElement('button'); | 261 var newPageButton = document.createElement('button'); |
| 262 newPageButton.textContent = 'Open'; | 262 newPageButton.textContent = 'Open'; |
| 263 newPage.appendChild(newPageButton); | 263 newPage.appendChild(newPageButton); |
| 264 newPageButton.addEventListener('click', openHandler, true); | 264 newPageButton.addEventListener('click', openHandler, true); |
| 265 | 265 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 279 var page = browser.pages[p]; | 279 var page = browser.pages[p]; |
| 280 // Attached targets have no unique id until Chrome 26. For such targets | 280 // Attached targets have no unique id until Chrome 26. For such targets |
| 281 // it is impossible to activate existing DevTools window. | 281 // it is impossible to activate existing DevTools window. |
| 282 page.hasNoUniqueId = page.attached && | 282 page.hasNoUniqueId = page.attached && |
| 283 (majorChromeVersion && majorChromeVersion < MIN_VERSION_TARGET_ID); | 283 (majorChromeVersion && majorChromeVersion < MIN_VERSION_TARGET_ID); |
| 284 var row = addTargetToList(page, pageList, ['name', 'url']); | 284 var row = addTargetToList(page, pageList, ['name', 'url']); |
| 285 if (page['description']) | 285 if (page['description']) |
| 286 addWebViewDetails(row, page); | 286 addWebViewDetails(row, page); |
| 287 else | 287 else |
| 288 addFavicon(row, page); | 288 addFavicon(row, page); |
| 289 if (majorChromeVersion >= MIN_VERSION_TAB_ACTIVATE) | 289 if (majorChromeVersion >= MIN_VERSION_TAB_ACTIVATE) { |
| 290 addActionLink(row, 'focus tab', activate.bind(null, page), false); | 290 addActionLink(row, 'focus tab', |
| 291 if (majorChromeVersion) | 291 sendTargetCommand.bind(null, 'activate', page), false); |
| 292 addActionLink(row, 'reload', reload.bind(null, page), page.attached); | 292 } |
| 293 if (majorChromeVersion >= MIN_VERSION_TAB_CLOSE) | 293 if (majorChromeVersion) { |
| 294 addActionLink(row, 'close', close.bind(null, page), page.attached); | 294 addActionLink(row, 'reload', |
| 295 sendTargetCommand.bind(null, 'reload', page), page.attached); |
| 296 } |
| 297 if (majorChromeVersion >= MIN_VERSION_TAB_CLOSE) { |
| 298 addActionLink(row, 'close', |
| 299 sendTargetCommand.bind(null, 'close', page), page.attached); |
| 300 } |
| 295 } | 301 } |
| 296 } | 302 } |
| 297 } | 303 } |
| 298 } | 304 } |
| 299 | 305 |
| 300 function addToPagesList(data) { | 306 function addToPagesList(data) { |
| 301 var row = addTargetToList(data, $('pages-list'), ['name', 'url']); | 307 var row = addTargetToList(data, $('pages-list'), ['name', 'url']); |
| 302 addFavicon(row, data); | 308 addFavicon(row, data); |
| 303 } | 309 } |
| 304 | 310 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 315 var guestRow = addTargetToList(guest, row, ['name', 'url']); | 321 var guestRow = addTargetToList(guest, row, ['name', 'url']); |
| 316 guestRow.classList.add('guest'); | 322 guestRow.classList.add('guest'); |
| 317 addFavicon(guestRow, guest); | 323 addFavicon(guestRow, guest); |
| 318 }); | 324 }); |
| 319 } | 325 } |
| 320 } | 326 } |
| 321 | 327 |
| 322 function addToWorkersList(data) { | 328 function addToWorkersList(data) { |
| 323 var row = | 329 var row = |
| 324 addTargetToList(data, $('workers-list'), ['name', 'description', 'url']); | 330 addTargetToList(data, $('workers-list'), ['name', 'description', 'url']); |
| 325 addActionLink(row, 'terminate', close.bind(null, data), data.attached); | 331 addActionLink(row, 'terminate', |
| 332 sendTargetCommand.bind(null, 'close', data), data.attached); |
| 326 } | 333 } |
| 327 | 334 |
| 328 function addToOthersList(data) { | 335 function addToOthersList(data) { |
| 329 addTargetToList(data, $('others-list'), ['url']); | 336 addTargetToList(data, $('others-list'), ['url']); |
| 330 } | 337 } |
| 331 | 338 |
| 332 function formatValue(data, property) { | 339 function formatValue(data, property) { |
| 333 var value = data[property]; | 340 var value = data[property]; |
| 334 | 341 |
| 335 if (property == 'name' && value == '') { | 342 if (property == 'name' && value == '') { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 for (var j = 0; j < properties.length; j++) | 467 for (var j = 0; j < properties.length; j++) |
| 461 subrow.appendChild(formatValue(data, properties[j])); | 468 subrow.appendChild(formatValue(data, properties[j])); |
| 462 | 469 |
| 463 if (description) | 470 if (description) |
| 464 addWebViewDescription(description, subrowBox); | 471 addWebViewDescription(description, subrowBox); |
| 465 | 472 |
| 466 var actionBox = document.createElement('div'); | 473 var actionBox = document.createElement('div'); |
| 467 actionBox.className = 'actions'; | 474 actionBox.className = 'actions'; |
| 468 subrowBox.appendChild(actionBox); | 475 subrowBox.appendChild(actionBox); |
| 469 | 476 |
| 470 addActionLink(row, 'inspect', inspect.bind(null, data), | 477 addActionLink(row, 'inspect', sendTargetCommand.bind(null, 'inspect', data), |
| 471 data.hasNoUniqueId || data.adbAttachedForeign); | 478 data.hasNoUniqueId || data.adbAttachedForeign); |
| 472 | 479 |
| 473 list.appendChild(row); | 480 list.appendChild(row); |
| 474 return row; | 481 return row; |
| 475 } | 482 } |
| 476 | 483 |
| 477 function addActionLink(row, text, handler, opt_disabled) { | 484 function addActionLink(row, text, handler, opt_disabled) { |
| 478 var link = document.createElement('a'); | 485 var link = document.createElement('a'); |
| 479 if (opt_disabled) | 486 if (opt_disabled) |
| 480 link.classList.add('disabled'); | 487 link.classList.add('disabled'); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 495 $('port-forwarding-enable').addEventListener('change', enablePortForwarding); | 502 $('port-forwarding-enable').addEventListener('change', enablePortForwarding); |
| 496 $('port-forwarding-config-open').addEventListener( | 503 $('port-forwarding-config-open').addEventListener( |
| 497 'click', openPortForwardingConfig); | 504 'click', openPortForwardingConfig); |
| 498 $('port-forwarding-config-close').addEventListener( | 505 $('port-forwarding-config-close').addEventListener( |
| 499 'click', closePortForwardingConfig); | 506 'click', closePortForwardingConfig); |
| 500 $('port-forwarding-config-done').addEventListener( | 507 $('port-forwarding-config-done').addEventListener( |
| 501 'click', commitPortForwardingConfig.bind(true)); | 508 'click', commitPortForwardingConfig.bind(true)); |
| 502 } | 509 } |
| 503 | 510 |
| 504 function enableDiscoverUsbDevices(event) { | 511 function enableDiscoverUsbDevices(event) { |
| 505 chrome.send('set-discover-usb-devices-enabled', [event.target.checked]); | 512 sendCommand('set-discover-usb-devices-enabled', event.target.checked); |
| 506 } | 513 } |
| 507 | 514 |
| 508 function enablePortForwarding(event) { | 515 function enablePortForwarding(event) { |
| 509 chrome.send('set-port-forwarding-enabled', [event.target.checked]); | 516 sendCommand('set-port-forwarding-enabled', event.target.checked); |
| 510 } | 517 } |
| 511 | 518 |
| 512 function handleKey(event) { | 519 function handleKey(event) { |
| 513 switch (event.keyCode) { | 520 switch (event.keyCode) { |
| 514 case 13: // Enter | 521 case 13: // Enter |
| 515 if (event.target.nodeName == 'INPUT') { | 522 if (event.target.nodeName == 'INPUT') { |
| 516 var line = event.target.parentNode; | 523 var line = event.target.parentNode; |
| 517 if (!line.classList.contains('fresh') || | 524 if (!line.classList.contains('fresh') || |
| 518 line.classList.contains('empty')) { | 525 line.classList.contains('empty')) { |
| 519 commitPortForwardingConfig(true); | 526 commitPortForwardingConfig(true); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 portInput.lastValidValue : | 617 portInput.lastValidValue : |
| 611 portInput.value; | 618 portInput.value; |
| 612 | 619 |
| 613 var location = locationInput.classList.contains('invalid') ? | 620 var location = locationInput.classList.contains('invalid') ? |
| 614 locationInput.lastValidValue : | 621 locationInput.lastValidValue : |
| 615 locationInput.value; | 622 locationInput.value; |
| 616 | 623 |
| 617 if (port && location) | 624 if (port && location) |
| 618 config[port] = location; | 625 config[port] = location; |
| 619 } | 626 } |
| 620 chrome.send('set-port-forwarding-config', [config]); | 627 sendCommand('set-port-forwarding-config', config); |
| 621 } | 628 } |
| 622 | 629 |
| 623 function updateDiscoverUsbDevicesEnabled(enabled) { | 630 function updateDiscoverUsbDevicesEnabled(enabled) { |
| 624 var checkbox = $('discover-usb-devices-enable'); | 631 var checkbox = $('discover-usb-devices-enable'); |
| 625 checkbox.checked = !!enabled; | 632 checkbox.checked = !!enabled; |
| 626 checkbox.disabled = false; | 633 checkbox.disabled = false; |
| 627 } | 634 } |
| 628 | 635 |
| 629 function updatePortForwardingEnabled(enabled) { | 636 function updatePortForwardingEnabled(enabled) { |
| 630 var checkbox = $('port-forwarding-enable'); | 637 var checkbox = $('port-forwarding-enable'); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 if (line.querySelector('.invalid')) | 778 if (line.querySelector('.invalid')) |
| 772 return; | 779 return; |
| 773 line.classList.remove('fresh'); | 780 line.classList.remove('fresh'); |
| 774 var freshLine = createEmptyConfigLine(); | 781 var freshLine = createEmptyConfigLine(); |
| 775 line.parentNode.appendChild(freshLine); | 782 line.parentNode.appendChild(freshLine); |
| 776 if (opt_selectNew) | 783 if (opt_selectNew) |
| 777 freshLine.querySelector('.port').focus(); | 784 freshLine.querySelector('.port').focus(); |
| 778 } | 785 } |
| 779 | 786 |
| 780 document.addEventListener('DOMContentLoaded', onload); | 787 document.addEventListener('DOMContentLoaded', onload); |
| OLD | NEW |