|
3 | 3 | 'use strict'; |
4 | 4 |
|
5 | 5 | const liveReloadCheck = document.getElementById('liveReloadCheck'); |
6 | | - const proxyCheckBox = document.getElementById('proxyCheckBox'); |
| 6 | + const noProxyCheckBox = document.getElementById('noProxyCheckBox'); |
7 | 7 | const actualServerAddress = document.getElementById('actualServer'); |
8 | 8 | const liveServerAddress = document.getElementById('liveServer'); |
9 | 9 | const submitBtn = document.getElementById('submitBtn'); |
|
13 | 13 | function submitForm() { |
14 | 14 | const formData = { |
15 | 15 | isEnable: liveReloadCheck.checked, |
16 | | - proxySetup: proxyCheckBox.checked, |
| 16 | + proxySetup: !noProxyCheckBox.checked, |
17 | 17 | actualUrl: actualServerAddress.value || '', |
18 | 18 | liveServerUrl: liveServerAddress.value || '' |
19 | 19 | } |
|
27 | 27 | liveReloadCheck.onclick = () => { |
28 | 28 | submitForm(); |
29 | 29 | } |
30 | | - proxyCheckBox.onchange = () => { |
| 30 | + noProxyCheckBox.onchange = () => { |
31 | 31 | submitForm(); |
32 | 32 | } |
33 | 33 |
|
34 | | - proxyCheckBox.onclick = () => { |
35 | | - serverSetupDiv.className = proxyCheckBox.checked ? 'show' : 'hide'; |
| 34 | + noProxyCheckBox.onclick = () => { |
| 35 | + serverSetupDiv.className = noProxyCheckBox.checked ? 'show' : 'hide'; |
36 | 36 | } |
37 | 37 |
|
38 | 38 | document.addEventListener('DOMContentLoaded', () => { |
39 | 39 | chrome.runtime.sendMessage({ |
40 | 40 | req: 'get-live-server-config' |
41 | 41 | }, (data) => { |
| 42 | + console.log('popupwidnow') |
42 | 43 | liveReloadCheck.checked = data.isEnable || false; |
43 | | - proxyCheckBox.checked = data.proxySetup || false; |
| 44 | + noProxyCheckBox.checked = data.proxySetup || false; |
44 | 45 | actualServerAddress.value = data.actualUrl || ''; |
45 | 46 | liveServerAddress.value = data.liveServerUrl || ''; |
46 | | - serverSetupDiv.className = proxyCheckBox.checked ? 'show' : 'hide'; |
| 47 | + serverSetupDiv.className = noProxyCheckBox.checked ? 'show' : 'hide'; |
47 | 48 | }); |
48 | 49 | }); |
49 | 50 |
|
|
0 commit comments