From c352199434a1c43fc85f9148ab32d53904381182 Mon Sep 17 00:00:00 2001 From: cTn Date: Wed, 17 Sep 2014 14:22:16 +0200 Subject: [PATCH] working mixer list with mixer preview --- _locales/en/messages.json | 3 +++ tabs/configuration.css | 26 ++++++++++++++++++----- tabs/configuration.html | 9 +++++++- tabs/configuration.js | 44 ++++++++++++++++++++++++++++++++++++++- 4 files changed, 75 insertions(+), 7 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 4a5b169b..2bdd11d7 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -300,6 +300,9 @@ "configurationFeatures": { "message": "Features" }, + "configurationThrottleAndRC": { + "message": "Throttle & RC" + }, "configurationEepromSaved": { "message": "EEPROM saved" }, diff --git a/tabs/configuration.css b/tabs/configuration.css index d14e9089..df098409 100644 --- a/tabs/configuration.css +++ b/tabs/configuration.css @@ -3,16 +3,33 @@ } .tab-configuration .groupTitle { padding: 0 0 5px 0; - margin: 0 0 10px 0; + margin: 10px 0 10px 0; font-size: 16px; border-bottom: 1px solid #dddddd; } -.tab-configuration .hugeWhitespace { - height: 100px; +.tab-configuration .groupTitle:nth-of-type(1){ + margin-top: 0; } -.tab-configuration dl.features { +.tab-configuration .mixerList { + float: left; + + height: 100px; + + border: 1px solid silver; +} +.tab-configuration .mixerPreview { + float: left; + + width: 100px; + height: 100px; + + margin: 0 0 0 15px; +} +.tab-configuration .mixerPreview img { + width: 100%; + height: 100%; } .tab-configuration dl.features dt { float: left; @@ -30,7 +47,6 @@ line-height: 18px; } - .tab-configuration .buttons { position: fixed; diff --git a/tabs/configuration.html b/tabs/configuration.html index 48af5d71..fef2ab28 100644 --- a/tabs/configuration.html +++ b/tabs/configuration.html @@ -1,10 +1,17 @@
-
+ +
+ +
+
+
diff --git a/tabs/configuration.js b/tabs/configuration.js index 0c7e9c47..ff2091a2 100644 --- a/tabs/configuration.js +++ b/tabs/configuration.js @@ -50,6 +50,49 @@ TABS.configuration.initialize = function (callback) { // index references var RCMAPlLetters = ['A', 'E', 'R', 'T', '1', '2', '3', '4']; + // generate mixer + var mixerList = [ + {name: 'Tricopter', image: 'tri'}, + {name: 'Quad +', image: 'quadp'}, + {name: 'Quad X', image: 'quadx'}, + {name: 'Bicopter', image: 'custom'}, + {name: 'Gimbal', image: 'custom'}, + {name: 'Y 6', image: 'y6'}, + {name: 'HEX 6', image: 'hex6p'}, + {name: 'Flying Wing', image: 'custom'}, + {name: 'Y 4', image: 'y4'}, + {name: 'HEX 6 X', image: 'hex6x'}, + {name: 'OCTO X8', image: 'octox'}, + {name: 'OCTO Flat +', image: 'octox'}, + {name: 'OCTO Flat X', image: 'octox'}, + {name: 'Airplane', image: 'airplane'}, + {name: 'Heli 120', image: 'custom'}, + {name: 'Heli 90', image: 'custom'}, + {name: 'Vtail 4', image: 'vtail'}, + {name: 'Hex 6 H', image: 'custom'}, + {name: 'PPM to SERVO', image: 'custom'}, + {name: 'Dualcopter', image: 'custom'}, + {name: 'Singlecopter', image: 'custom'}, + {name: 'Custom', image: 'custom'} + ]; + + var mixer_list_e = $('select.mixerList'); + for (var i = 0; i < mixerList.length; i++) { + mixer_list_e.append(''); + } + + mixer_list_e.change(function () { + var val = parseInt($(this).val()); + + BF_CONFIG.mixerConfiguration = val; + + $('.mixerPreview img').attr('src', './images/motor_order/' + mixerList[val - 1].image + '.svg'); + }); + + // select current configuration + mixer_list_e.val(BF_CONFIG.mixerConfiguration).change(); + + // generate features var featureNames = [ 'PPM - Disable PWM input and enable PPM input', 'VBAT', @@ -68,7 +111,6 @@ TABS.configuration.initialize = function (callback) { '3D' ]; - // generate features var features_e = $('.features'); for (var i = 0; i < featureNames.length; i++) { var element = $('
');