diff --git a/htdocs/lib/settings/FrequencyInput.js b/htdocs/lib/settings/ExponentialInput.js similarity index 87% rename from htdocs/lib/settings/FrequencyInput.js rename to htdocs/lib/settings/ExponentialInput.js index dbc978e..824d797 100644 --- a/htdocs/lib/settings/FrequencyInput.js +++ b/htdocs/lib/settings/ExponentialInput.js @@ -1,4 +1,4 @@ -$.fn.frequencyInput = function() { +$.fn.exponentialInput = function() { var suffixes = { "K": 3, "M": 6, @@ -9,7 +9,7 @@ $.fn.frequencyInput = function() { this.each(function(){ var $group = $(this); var currentExponent = 0; - $input = $group.find('input'); + var $input = $group.find('input'); var setExponent = function() { var newExponent = parseInt($exponent.val()); @@ -26,7 +26,7 @@ $.fn.frequencyInput = function() { } }); - $exponent = $group.find('select.frequency-exponent'); + var $exponent = $group.find('select.exponent'); $exponent.on('change', setExponent); // calculate initial exponent diff --git a/htdocs/settings.js b/htdocs/settings.js index f3a2d44..3a071b5 100644 --- a/htdocs/settings.js +++ b/htdocs/settings.js @@ -7,5 +7,5 @@ $(function(){ $('#rf_gain').gainInput(); $('.optional-section').optionalSection(); $('#scheduler').schedulerInput(); - $('.frequency-input').frequencyInput(); + $('.exponential-input').exponentialInput(); }); \ No newline at end of file diff --git a/owrx/controllers/assets.py b/owrx/controllers/assets.py index d42ae23..5973baf 100644 --- a/owrx/controllers/assets.py +++ b/owrx/controllers/assets.py @@ -153,7 +153,7 @@ class CompiledAssetsController(GzipMixin, ModificationAwareController): "lib/settings/GainInput.js", "lib/settings/OptionalSection.js", "lib/settings/SchedulerInput.js", - "lib/settings/FrequencyInput.js", + "lib/settings/ExponentialInput.js", "settings.js", ], } diff --git a/owrx/form/__init__.py b/owrx/form/__init__.py index 0d2c201..3e828fe 100644 --- a/owrx/form/__init__.py +++ b/owrx/form/__init__.py @@ -321,9 +321,10 @@ class ModesInput(DropdownInput): super().__init__(id, label, options) -class FrequencyInput(Input): - def __init__(self, id, label, infotext=None): +class ExponentialInput(Input): + def __init__(self, id, label, unit, infotext=None): super().__init__(id, label, infotext=infotext) + self.unit = unit def defaultConverter(self): return IntConverter() @@ -337,21 +338,22 @@ class FrequencyInput(Input): def render_input(self, value): append = """