diff options
author | Pawel Spychalski (DzikuVx) <pspychalski@gmail.com> | 2019-04-27 20:24:14 +0300 |
---|---|---|
committer | Pawel Spychalski (DzikuVx) <pspychalski@gmail.com> | 2019-04-27 20:24:14 +0300 |
commit | b5db21ae7c43a9ebe979218efbb223604a16d976 (patch) | |
tree | 7165620335b3444f34896d3bbe771804f4e4e2f4 /js | |
parent | 7bc94e130ae400daeab85df9a4a8aec77258a698 (diff) |
Remove Autoconnect
Diffstat (limited to 'js')
-rw-r--r-- | js/gui.js | 1 | ||||
-rwxr-xr-x | js/port_handler.js | 10 | ||||
-rwxr-xr-x | js/serial_backend.js | 43 |
3 files changed, 1 insertions, 53 deletions
@@ -4,7 +4,6 @@ var TABS = {}; // filled by individual tab js file var GUI_control = function () { - this.auto_connect = false; this.connecting_to = false; this.connected_to = false; this.connect_lock = false; diff --git a/js/port_handler.js b/js/port_handler.js index 138a7fdc..28023291 100755 --- a/js/port_handler.js +++ b/js/port_handler.js @@ -121,16 +121,6 @@ PortHandler.check = function () { $('div#port-picker #port').val(GUI.connected_to); } - // start connect procedure (if statement is valid) - if (GUI.auto_connect && !GUI.connecting_to && !GUI.connected_to) { - // we need firmware flasher protection over here - if (GUI.active_tab != 'firmware_flasher') { - helper.timeout.add('auto-connect_timeout', function () { - $('div#port-picker a.connect').click(); - }, 100); // timeout so bus have time to initialize after being detected by the system - } - } - // trigger callbacks for (var i = (self.port_detected_callbacks.length - 1); i >= 0; i--) { var obj = self.port_detected_callbacks[i]; diff --git a/js/serial_backend.js b/js/serial_backend.js index 677c7704..4305f4d5 100755 --- a/js/serial_backend.js +++ b/js/serial_backend.js @@ -153,9 +153,7 @@ $(document).ready(function () { // unlock port select & baud $port.prop('disabled', false); - if (!GUI.auto_connect) { - $baud.prop('disabled', false); - } + $baud.prop('disabled', false); // reset connect / disconnect button $('div.connect_controls a.connect').removeClass('active'); @@ -177,45 +175,6 @@ $(document).ready(function () { } }); - // auto-connect - chrome.storage.local.get('auto_connect', function (result) { - if (result.auto_connect === 'undefined' || result.auto_connect) { - // default or enabled by user - GUI.auto_connect = true; - - $('input.auto_connect').prop('checked', true); - $('input.auto_connect, span.auto_connect').prop('title', chrome.i18n.getMessage('autoConnectEnabled')); - - $baud.val(115200).prop('disabled', true); - } else { - // disabled by user - GUI.auto_connect = false; - - $('input.auto_connect').prop('checked', false); - $('input.auto_connect, span.auto_connect').prop('title', chrome.i18n.getMessage('autoConnectDisabled')); - } - - // bind UI hook to auto-connect checkbos - $('input.auto_connect').change(function () { - GUI.auto_connect = $(this).is(':checked'); - - // update title/tooltip - if (GUI.auto_connect) { - $('input.auto_connect, span.auto_connect').prop('title', chrome.i18n.getMessage('autoConnectEnabled')); - - $baud.val(115200).prop('disabled', true); - } else { - $('input.auto_connect, span.auto_connect').prop('title', chrome.i18n.getMessage('autoConnectDisabled')); - - if (!GUI.connected_to && !GUI.connecting_to) $('select#baud').prop('disabled', false); - } - - chrome.storage.local.set({'auto_connect': GUI.auto_connect}); - - - }); - }); - PortHandler.initialize(); }); |