From 32a27b73a7d1a38a9ad47f21633cddc9a45bb880 Mon Sep 17 00:00:00 2001 From: Roeland Lutters Date: Tue, 6 Jan 2015 20:35:58 +0100 Subject: [PATCH] CLI available for old firmware versions --- _locales/en/messages.json | 2 +- eventPage.js | 0 js/data_storage.js | 1 + js/serial_backend.js | 7 ++++++- main.js | 6 +++++- 5 files changed, 13 insertions(+), 3 deletions(-) mode change 100644 => 100755 eventPage.js mode change 100644 => 100755 js/data_storage.js mode change 100644 => 100755 js/serial_backend.js mode change 100644 => 100755 main.js diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 377b8598a5..ed4d302129 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -103,7 +103,7 @@ "message": "No configuration received within 10 seconds, communication failed" }, "firmwareVersionNotSupported": { - "message": "This firmware version is not supported. Please upgrade to firmware that supports api version $1 or higher" + "message": "This firmware version is not supported. Please upgrade to firmware that supports api version $1 or higher. Only CLI is usable for backup purposes." }, "firmwareVersion": { "message": "Firmware Version: $1" diff --git a/eventPage.js b/eventPage.js old mode 100644 new mode 100755 diff --git a/js/data_storage.js b/js/data_storage.js old mode 100644 new mode 100755 index 836a344154..723e230026 --- a/js/data_storage.js +++ b/js/data_storage.js @@ -5,6 +5,7 @@ var CONFIGURATOR = { 'apiVersionAccepted': 1.1, 'backupFileMinVersionAccepted': '0.55', // chrome.runtime.getManifest().version is stored as string, so does this one 'connectionValid': false, + 'connectionValidCliOnly': false, 'cliActive': false, 'cliValid': false }; diff --git a/js/serial_backend.js b/js/serial_backend.js old mode 100644 new mode 100755 index 688181ccd1..d6e678991c --- a/js/serial_backend.js +++ b/js/serial_backend.js @@ -27,6 +27,7 @@ $(document).ready(function () { GUI.connected_to = false; CONFIGURATOR.connectionValid = false; + CONFIGURATOR.connectionValidCliOnly = false; MSP.disconnect_cleanup(); PortUsage.reset(); @@ -177,7 +178,11 @@ function onOpen(openInfo) { }); } else { GUI.log(chrome.i18n.getMessage('firmwareVersionNotSupported', [CONFIGURATOR.apiVersionAccepted])); - $('div#port-picker a.connect').click(); // disconnect + CONFIGURATOR.connectionValid = true; // making it possible to open the CLI tab + $('div#port-picker a.connect').text(chrome.i18n.getMessage('disconnect')).addClass('active'); + $('#tabs li a:last').click(); // open CLI tab + GUI.timeout_remove('connecting'); // kill connecting timer + CONFIGURATOR.connectionValidCliOnly = true; } }); } else { diff --git a/main.js b/main.js old mode 100644 new mode 100755 index 7994b85cb3..f5e60d5e07 --- a/main.js +++ b/main.js @@ -62,12 +62,16 @@ $(document).ready(function () { var self = this, tab = $(self).parent().prop('class'); - // if there is no active connection, return if (!CONFIGURATOR.connectionValid) { GUI.log('You need to connect before you can view any of the tabs'); return; } + if (CONFIGURATOR.connectionValidCliOnly) { + GUI.log('You need to Upgrade your firmware before you can view any of the tabs'); + return; + } + GUI.tab_switch_in_progress = true; GUI.tab_switch_cleanup(function () {