From f49ae172fd6c919353866c1288ee9b7926472325 Mon Sep 17 00:00:00 2001 From: error414 Date: Tue, 20 Aug 2024 21:40:37 +0200 Subject: [PATCH 01/16] speed up OSD search --- tabs/osd.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tabs/osd.js b/tabs/osd.js index 00d920821..7f11a6a60 100644 --- a/tabs/osd.js +++ b/tabs/osd.js @@ -2661,7 +2661,7 @@ OSD.GUI.updateUnits = function() { }); }; -OSD.GUI.updateFields = function() { +OSD.GUI.updateFields = function(event) { // display fields on/off and position var $tmpl = $('#osd_group_template').hide(); // Clear previous groups, if any @@ -2702,6 +2702,7 @@ OSD.GUI.updateFields = function() { }); } var $displayFields = groupContainer.find('.display-fields'); + var osdSearch = $('.osd_search'); for (var jj = 0; jj < groupItems.length; jj++) { var item = groupItems[jj]; var itemData = OSD.data.items[item.id]; @@ -2715,7 +2716,7 @@ OSD.GUI.updateFields = function() { } else { name = inflection.titleize(name); } - var searchTerm = $('.osd_search').val(); + var searchTerm = osdSearch.val(); if (searchTerm.length > 0 && !name.toLowerCase().includes(searchTerm.toLowerCase())) { continue; } @@ -2811,10 +2812,13 @@ OSD.GUI.updateFields = function() { // needs to be called after all of them have been set up GUI.switchery(); - // Update the OSD preview - refreshOSDSwitchIndicators(); - updatePilotAndCraftNames(); - updatePanServoPreview(); + if(event != null && event.currentTarget !== osdSearch[0]) + { + // Update the OSD preview + refreshOSDSwitchIndicators(); + updatePilotAndCraftNames(); + updatePanServoPreview(); + } }; OSD.GUI.removeBottomLines = function(){ @@ -3210,8 +3214,8 @@ OSD.GUI.updateAll = function() { clear.off('change'); } - $('.osd_search').on('input', function() { - OSD.GUI.updateFields(); + $('.osd_search').on('input', function(event) { + OSD.GUI.updateFields(event); }); $('.supported').fadeIn(); OSD.GUI.updateVideoMode(); From 2d685df081705635ec6216fbc22d8b93e68f00ba Mon Sep 17 00:00:00 2001 From: Ray Morris Date: Sat, 23 Nov 2024 12:44:50 -0600 Subject: [PATCH 02/16] outputs tab preview label motor numbers --- src/css/tabs/motors.css | 15 ++++++++++++++- tabs/outputs.html | 6 +++++- tabs/outputs.js | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/src/css/tabs/motors.css b/src/css/tabs/motors.css index 11048ab49..5d2f00b36 100644 --- a/src/css/tabs/motors.css +++ b/src/css/tabs/motors.css @@ -463,4 +463,17 @@ .tab-motors .config-section .number input { margin-right: 4px; -} \ No newline at end of file +} + +.tab-motors .mixerPreview { + position: relative; +} + +.tab-motors .motorNumber { + position: absolute; + font-size: 1.4em; +} + +.tab-motors .mixer-preview-image-numbers { + width: fit-content; +} diff --git a/tabs/outputs.html b/tabs/outputs.html index d57cc76d6..64a714762 100644 --- a/tabs/outputs.html +++ b/tabs/outputs.html @@ -117,7 +117,11 @@
- + +
1
+
2
+
3
+
4
diff --git a/tabs/outputs.js b/tabs/outputs.js index d936d18af..c7f259445 100644 --- a/tabs/outputs.js +++ b/tabs/outputs.js @@ -501,6 +501,8 @@ TABS.outputs.initialize = function (callback) { $motorSliders.append('
'); $motorValues.append('
  • '); + labelMotorNumbers(); + for (let i = 0; i < FC.SERVO_RULES.getServoCount(); i++) { let opacity = ""; @@ -717,6 +719,39 @@ TABS.outputs.initialize = function (callback) { GUI.content_ready(callback); } + function labelMotorNumbers() { + let index = 0; + var rules = FC.MOTOR_RULES.get(); + + for (const i in rules) { + if (rules.hasOwnProperty(i)) { + const rule = rules[i]; + index++; + + /* + if (currentMixerPreset.image != 'quad_x') { + $("#motorNumber"+index).css("visibility", "hidden"); + continue; + } + */ + + let top_px = 30; + let left_px = 28; + if (rule.getRoll() < -0.5) { + left_px = $("#motor-mixer-preview-img").width() - 20; + } + + if (rule.getPitch() > 0.5) { + top_px = $("#motor-mixer-preview-img").height() - 20; + } + $("#motorNumber"+index).css("left", left_px + "px"); + $("#motorNumber"+index).css("top", top_px + "px"); + $("#motorNumber"+index).css("visibility", "visible"); + } + } + } + + }; TABS.outputs.cleanup = function (callback) { From 9ff375ed64d1e95cf24ef24fa16cf1aa5092be45 Mon Sep 17 00:00:00 2001 From: Mr D - RC Date: Wed, 27 Nov 2024 22:17:14 +0000 Subject: [PATCH 03/16] Rearrange top bar to fit on 1024px screens --- index.html | 16 ++++++++------- js/serial_backend.js | 3 +++ src/css/main.css | 48 +++++++++++++++++++++++++++++++++++--------- 3 files changed, 51 insertions(+), 16 deletions(-) diff --git a/index.html b/index.html index 651930611..6a5cfddce 100644 --- a/index.html +++ b/index.html @@ -88,13 +88,7 @@

    -
    -
    -
      -
    • -
      -
    • -
    +
    +
    +
    +
      +
    • +
      +
    • +
    +
    -
    @@ -164,4 +163,4 @@

    - \ No newline at end of file + From 1e2da772774f1cd4e1410adb99b421aa996fdf77 Mon Sep 17 00:00:00 2001 From: Ray Morris Date: Fri, 13 Dec 2024 13:39:26 -0600 Subject: [PATCH 15/16] support per-language fonts (for Japanese etc) --- index.html | 2 +- js/localization.js | 12 ++++++++++++ locale/en/messages.json | 3 +++ locale/uk/messages.json | 3 +++ src/css/main.css | 6 +++++- 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 6a5cfddce..d7681ca2d 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + diff --git a/js/localization.js b/js/localization.js index 2c7e49cd6..6da7a92ad 100644 --- a/js/localization.js +++ b/js/localization.js @@ -173,6 +173,11 @@ i18n.localize = function (reTranslate = false) { const element = $(this); element.attr('placeholder', translate(element.attr('i18n_placeholder'))); }); + + $('[i18n_lang]').each(function() { + const element = $(this); + element.attr('lang', translate(element.attr('i18n_lang'))); + }); } else { $('[i18n]:not(.i18n-replaced)').each(function() { @@ -234,6 +239,13 @@ i18n.localize = function (reTranslate = false) { element.attr('placeholder', translate(element.attr('i18n_placeholder'))); element.addClass('i18n_placeholder-replaced'); }); + + $('[i18n_lang]:not(.i18n_lang-replaced)').each(function() { + const element = $(this); + element.attr('lang', translate(element.attr('i18n_lang'))); + element.addClass('i18n_lang-replaced'); + }); + } return localized; diff --git a/locale/en/messages.json b/locale/en/messages.json index e0d9c2847..afef64449 100644 --- a/locale/en/messages.json +++ b/locale/en/messages.json @@ -6152,5 +6152,8 @@ }, "adsbHeartbeatTotalMessages": { "message": "Heartbeat msgs" + }, + "currentLanguage": { + "message": "en" } } diff --git a/locale/uk/messages.json b/locale/uk/messages.json index 74b236e97..bb0ab4a84 100644 --- a/locale/uk/messages.json +++ b/locale/uk/messages.json @@ -5926,5 +5926,8 @@ }, "adsbHeartbeatTotalMessages": { "message": "Повід. сигналів перевірки" + }, + "currentLanguage": { + "message": "uk" } } diff --git a/src/css/main.css b/src/css/main.css index 6a011d8eb..9dec4129e 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -2332,4 +2332,8 @@ ol li { .bold { font-weight: bold; -} \ No newline at end of file +} + +*:lang(ja) { + font-family:"ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro",Osaka, "メイリオ", Meiryo, "MS Pゴシック", "MS PGothic", sans-serif; +} From 665bf19fb19fc1f61be5486bf2af502038788c0e Mon Sep 17 00:00:00 2001 From: Sensei Date: Fri, 13 Dec 2024 13:47:47 -0600 Subject: [PATCH 16/16] dd currentLanguage to zh_CN/messages.json --- locale/zh_CN/messages.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/locale/zh_CN/messages.json b/locale/zh_CN/messages.json index 49debeeb2..9b2f7b4b2 100644 --- a/locale/zh_CN/messages.json +++ b/locale/zh_CN/messages.json @@ -6156,5 +6156,8 @@ }, "adsbHeartbeatTotalMessages": { "message": "心跳消息" + }, + "currentLanguage": { + "message": "zh-CN" } }