From cf0e78a879c50ff0434bf2bfb4ec167536a02297 Mon Sep 17 00:00:00 2001 From: mikeller Date: Mon, 10 Jun 2019 01:19:19 +1200 Subject: [PATCH 1/4] Removed adjustment range slots from the UI. --- src/js/tabs/adjustments.js | 19 ++++++++++++++++--- src/tabs/adjustments.html | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/js/tabs/adjustments.js b/src/js/tabs/adjustments.js index face0b0366..bed5a25d3a 100644 --- a/src/js/tabs/adjustments.js +++ b/src/js/tabs/adjustments.js @@ -37,8 +37,10 @@ TABS.adjustments.initialize = function (callback) { // update selected slot // - var adjustmentList = $(newAdjustment).find('.adjustmentSlot .slot'); - adjustmentList.val(adjustmentRange.slotIndex); + if (semver.lt(CONFIG.apiVersion, "1.42.0")) { + var adjustmentList = $(newAdjustment).find('.adjustmentSlot .slot'); + adjustmentList.val(adjustmentRange.slotIndex); + } // // populate source channel select box @@ -162,6 +164,12 @@ TABS.adjustments.initialize = function (callback) { modeTableBodyElement.append(newAdjustment); } + + if (semver.gte(CONFIG.apiVersion, "1.42.0")) { + $('.tab-adjustments .adjustmentSlotHeader').hide(); + $('.tab-adjustments .adjustmentSlot').hide(); + } + // translate to user-selected language i18n.localizePage(); @@ -189,8 +197,13 @@ TABS.adjustments.initialize = function (callback) { if ($(adjustmentElement).find('.enable').prop("checked")) { var rangeValues = $(this).find('.range .channel-slider').val(); + var slotIndex = 0; + if (semver.lt(CONFIG.apiVersion, "1.42.0")) { + slotIndex = parseInt($(this).find('.adjustmentSlot .slot').val()); + } + var adjustmentRange = { - slotIndex: parseInt($(this).find('.adjustmentSlot .slot').val()), + slotIndex: slotIndex, auxChannelIndex: parseInt($(this).find('.channelInfo .channel').val()), range: { start: rangeValues[0], diff --git a/src/tabs/adjustments.html b/src/tabs/adjustments.html index 4cf8260bd1..c110a5e3a6 100644 --- a/src/tabs/adjustments.html +++ b/src/tabs/adjustments.html @@ -22,7 +22,7 @@ - + From 640286f680db82dfa5b2d3fd37606d9857b7909c Mon Sep 17 00:00:00 2001 From: mikeller Date: Mon, 10 Jun 2019 22:05:30 +1200 Subject: [PATCH 2/4] Updated adjustment range examples. --- locales/en/messages.json | 8 ++++---- src/tabs/adjustments.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/locales/en/messages.json b/locales/en/messages.json index 92563eb10b..e13cdd47a2 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -1840,16 +1840,16 @@ "message": "AND" }, "adjustmentsHelp": { - "message": "Configure adjustment switches. See the 'in-flight adjustments' section of the manual for details. The changes that adjustment functions make are not saved automatically. There are 4 slots. Each switch used to concurrently make adjustments requires exclusive use of a slot." + "message": "Configure adjustment switches. See the 'in-flight adjustments' section of the manual for details. The changes that adjustment functions make are not saved automatically." }, "adjustmentsExamples": { - "message": "Examples" + "message": "Examples:" }, "adjustmentsExample1": { - "message": "Use Slot 1 and a 3POS switch on AUX1 to select between Pitch/Roll P, I and D and another 3POS switch on AUX2 to increase or decrease the value when held up or down." + "message": "Use a three position switch on AUX1 to select between Pitch/Roll P, I and D and another three position switch on AUX2 to increase or decrease the value when held up or down." }, "adjustmentsExample2": { - "message": "Use Slot 2 and a 3POS switch on AUX4 to select enable Rate Profile Selection via the same 3POS switch on the same channel." + "message": "Use a three position switch on AUX4 to select enable Rate Profile Selection via the same three position switch on the same channel." }, "adjustmentsColumnEnable": { "message": "If enabled" diff --git a/src/tabs/adjustments.html b/src/tabs/adjustments.html index c110a5e3a6..419e80643b 100644 --- a/src/tabs/adjustments.html +++ b/src/tabs/adjustments.html @@ -7,7 +7,7 @@

-

+

  • From 3e1f961deb435283aae99cb78540d248053a1022 Mon Sep 17 00:00:00 2001 From: mikeller Date: Mon, 10 Jun 2019 23:54:04 +1200 Subject: [PATCH 3/4] Re-added adjustment slots help. --- locales/en/messages.json | 3 +++ src/js/tabs/adjustments.js | 1 + src/tabs/adjustments.html | 1 + 3 files changed, 5 insertions(+) diff --git a/locales/en/messages.json b/locales/en/messages.json index e13cdd47a2..e545470dd0 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -1842,6 +1842,9 @@ "adjustmentsHelp": { "message": "Configure adjustment switches. See the 'in-flight adjustments' section of the manual for details. The changes that adjustment functions make are not saved automatically." }, + "adjustmentSlotsHelp": { + "message": "There are 4 slots. Each switch used to concurrently make adjustments requires exclusive use of a slot." + }, "adjustmentsExamples": { "message": "Examples:" }, diff --git a/src/js/tabs/adjustments.js b/src/js/tabs/adjustments.js index bed5a25d3a..7e023eb566 100644 --- a/src/js/tabs/adjustments.js +++ b/src/js/tabs/adjustments.js @@ -166,6 +166,7 @@ TABS.adjustments.initialize = function (callback) { if (semver.gte(CONFIG.apiVersion, "1.42.0")) { + $('.tab-adjustments .adjustmentSlotsHelp').hide(); $('.tab-adjustments .adjustmentSlotHeader').hide(); $('.tab-adjustments .adjustmentSlot').hide(); } diff --git a/src/tabs/adjustments.html b/src/tabs/adjustments.html index 419e80643b..4f7770d04d 100644 --- a/src/tabs/adjustments.html +++ b/src/tabs/adjustments.html @@ -7,6 +7,7 @@

    +

    • From db6651e5606580dacc56acbb2458bddad30ea845 Mon Sep 17 00:00:00 2001 From: Miguel Angel Mulero Martinez Date: Tue, 11 Jun 2019 10:56:29 +0200 Subject: [PATCH 4/4] Order OSD elements in alphabetical order --- src/js/tabs/osd.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/js/tabs/osd.js b/src/js/tabs/osd.js index a3d988e512..c9f9be04c8 100644 --- a/src/js/tabs/osd.js +++ b/src/js/tabs/osd.js @@ -2275,7 +2275,19 @@ TABS.osd.initialize = function (callback) { })) ); } - $displayFields.append($field); + + // Insert in alphabetical order + let added = false; + $displayFields.children().each(function() { + if ($(this).text() > $field.text()) { + $(this).before($field); + added = true; + return false; + } + }); + if(!added) { + $displayFields.append($field); + } } GUI.switchery();