diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index ae45e37b2f..5c395dd607 100755
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -48,6 +48,9 @@
"tabConfiguration": {
"message": "Configuration"
},
+ "tabPorts": {
+ "message": "Ports"
+ },
"tabPidTuning": {
"message": "PID Tuning"
},
@@ -432,6 +435,10 @@
"message": "Save and Reboot"
},
+ "portsButtonSave": {
+ "message": "Save and Reboot"
+ },
+
"pidTuningName": {
"message": "Name"
},
diff --git a/main.css b/main.css
index e729c7a2e0..d22e306cec 100644
--- a/main.css
+++ b/main.css
@@ -319,47 +319,3 @@ input[type="number"]::-webkit-inner-spin-button {
text-align: center;
font-weight: bold;
}
-#dialog {
- position: fixed;
- top: 0;
- left: 0;
- border: 1px solid silver;
- background-color: white;
- display: none;
- z-index: 1001;
-}
-#dialog.review {
- width: 300px;
-}
-#dialog.review .head {
- line-height: 20px;
- color: white;
- font-weight: bold;
- text-align: center;
- border-bottom: 1px solid silver;
- background-color: #3f4241;
-}
-#dialog.review .wrapper {
- padding: 5px;
-}
-#dialog.review p {
- display: none;
- padding: 5px;
- text-align: center;
-}
-#dialog.review .buttons {
- float: right;
- margin: 5px 0 0 0;
-}
-#dialog.review .yes,
-#dialog.review .no {
- display: block;
- float: left;
- margin: 0 0 0 5px;
- height: 24px;
- line-height: 24px;
- padding: 0 10px 0 10px;
- font-weight: bold;
- border: 1px solid #dddddd;
- background-color: #f1f1f1;
-}
\ No newline at end of file
diff --git a/main.html b/main.html
index 7ffb90d8ec..ff519d3aed 100644
--- a/main.html
+++ b/main.html
@@ -11,6 +11,7 @@
+
@@ -46,7 +47,6 @@
-
@@ -55,6 +55,7 @@
+
@@ -119,6 +120,7 @@
+
diff --git a/main.js b/main.js
index 19c0bc01b0..293ebd41f8 100644
--- a/main.js
+++ b/main.js
@@ -95,6 +95,9 @@ $(document).ready(function () {
case 'tab_adjustments':
TABS.adjustments.initialize(content_ready);
break;
+ case 'tab_ports':
+ TABS.ports.initialize(content_ready);
+ break;
case 'tab_setup':
TABS.setup.initialize(content_ready);
diff --git a/tabs/ports.css b/tabs/ports.css
new file mode 100644
index 0000000000..4fb297601f
--- /dev/null
+++ b/tabs/ports.css
@@ -0,0 +1,29 @@
+.tab-ports {
+ position: relative;
+}
+
+.tab-ports > .buttons {
+ width: calc(100% - 20px);
+
+ margin-top: 10px;
+ bottom: 10px;
+}
+
+.tab-ports .save {
+ display: block;
+ float: right;
+
+ height: 28px;
+ line-height: 28px;
+
+ padding: 0 15px 0 15px;
+
+ text-align: center;
+ font-weight: bold;
+
+ border: 1px solid silver;
+ background-color: #ececec;
+}
+.tab-ports .save:hover {
+ background-color: #dedcdc;
+}
\ No newline at end of file
diff --git a/tabs/ports.html b/tabs/ports.html
new file mode 100644
index 0000000000..0eda8601ad
--- /dev/null
+++ b/tabs/ports.html
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/tabs/ports.js b/tabs/ports.js
new file mode 100644
index 0000000000..835b5de96e
--- /dev/null
+++ b/tabs/ports.js
@@ -0,0 +1,66 @@
+'use strict';
+
+TABS.ports = {};
+
+TABS.ports.initialize = function (callback, scrollPosition) {
+ var self = this;
+
+ if (GUI.active_tab != 'ports') {
+ GUI.active_tab = 'ports';
+ googleAnalytics.sendAppView('Ports');
+ }
+
+ function load_config() {
+ MSP.send_message(MSP_codes.MSP_CONFIG, false, false, load_html);
+ }
+
+ function load_html() {
+ $('#content').load("./tabs/ports.html", process_html);
+ }
+
+ MSP.send_message(MSP_codes.MSP_IDENT, false, false, load_config);
+
+ function process_html() {
+
+ localize();
+
+ $('a.save').click(function () {
+
+ function save_to_eeprom() {
+ MSP.send_message(MSP_codes.MSP_EEPROM_WRITE, false, false, reboot);
+ }
+
+ function reboot() {
+ GUI.log(chrome.i18n.getMessage('configurationEepromSaved'));
+
+ GUI.tab_switch_cleanup(function() {
+ MSP.send_message(MSP_codes.MSP_SET_REBOOT, false, false, reinitialize);
+ });
+ }
+
+ function reinitialize() {
+ GUI.log(chrome.i18n.getMessage('deviceRebooting'));
+
+ GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
+ MSP.send_message(MSP_codes.MSP_IDENT, false, false, function () {
+ GUI.log(chrome.i18n.getMessage('deviceReady'));
+ TABS.ports.initialize(false, $('#content').scrollTop());
+ });
+ },1500); // 1500 ms seems to be just the right amount of delay to prevent data request timeouts
+ }
+
+ MSP.send_message(MSP_codes.MSP_SET_CONFIG, MSP.crunch(MSP_codes.MSP_SET_CONFIG), false, save_to_eeprom);
+ });
+
+ // status data pulled via separate timer with static speed
+ GUI.interval_add('status_pull', function status_pull() {
+ MSP.send_message(MSP_codes.MSP_STATUS);
+ }, 250, true);
+
+ if (callback) callback();
+ }
+};
+
+TABS.ports.cleanup = function (callback) {
+ if (callback) callback();
+};
\ No newline at end of file