Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
frozenskys committed Jun 12, 2019
2 parents 19f9e26 + bb72a44 commit b31cb7f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 10 deletions.
11 changes: 7 additions & 4 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1840,16 +1840,19 @@
"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."
},
"adjustmentSlotsHelp": {
"message": "There are 4 slots. Each switch used to concurrently make adjustments requires exclusive use of a slot."
},
"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"
Expand Down
20 changes: 17 additions & 3 deletions src/js/tabs/adjustments.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -162,6 +164,13 @@ TABS.adjustments.initialize = function (callback) {
modeTableBodyElement.append(newAdjustment);
}


if (semver.gte(CONFIG.apiVersion, "1.42.0")) {
$('.tab-adjustments .adjustmentSlotsHelp').hide();
$('.tab-adjustments .adjustmentSlotHeader').hide();
$('.tab-adjustments .adjustmentSlot').hide();
}

// translate to user-selected language
i18n.localizePage();

Expand Down Expand Up @@ -189,8 +198,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],
Expand Down
14 changes: 13 additions & 1 deletion src/js/tabs/osd.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 3 additions & 2 deletions src/tabs/adjustments.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<div class="note spacebottom">
<div class="note_spacer">
<p i18n="adjustmentsHelp"></p>
<p i18n="adjustmentsExamples"></p>
<p class="adjustmentSlotsHelp" i18n="adjustmentSlotsHelp"></p>
<b><p i18n="adjustmentsExamples"></p></b>
<ul>
<li i18n="adjustmentsExample1"></li>
<li i18n="adjustmentsExample2"></li>
Expand All @@ -22,7 +23,7 @@
<td i18n="adjustmentsColumnWhenChannel"></td>
<td i18n="adjustmentsColumnIsInRange"></td>
<td i18n="adjustmentsColumnThenApplyFunction"></td>
<td i18n="adjustmentsColumnUsingSlot"></td>
<td class="adjustmentSlotHeader" i18n="adjustmentsColumnUsingSlot"></td>
<td i18n="adjustmentsColumnViaChannel"></td>
</tr>
</thead>
Expand Down

0 comments on commit b31cb7f

Please sign in to comment.