automatically load modes into bookmark dialog

This commit is contained in:
Jakob Ketterl 2020-05-03 23:56:22 +02:00
parent a6a29b7032
commit 93b8f75cc3
4 changed files with 13 additions and 11 deletions

View File

@ -211,17 +211,7 @@
</div> </div>
<div class="form-field"> <div class="form-field">
<label for="modulation">Modulation:</label> <label for="modulation">Modulation:</label>
<select name="modulation" id="modulation"> <select name="modulation" id="modulation"></select>
<option value="nfm">FM</option>
<option value="am">AM</option>
<option value="usb">USB</option>
<option value="lsb">LSB</option>
<option value="cw">CW</option>
<option value="dmr">DMR</option>
<option value="dstar">D-Star</option>
<option value="nxdn">NXDN</option>
<option value="ysf">YSF</option>
</select>
</div> </div>
<div class="buttons"> <div class="buttons">
<div class="openwebrx-button" data-action="cancel">Cancel</div> <div class="openwebrx-button" data-action="cancel">Cancel</div>

View File

@ -0,0 +1,10 @@
$.fn.bookmarkDialog = function() {
var $el = this;
return {
setModes: function(modes) {
$el.find('#modulation').html(modes.map(function(m) {
return '<option value="' + m.modulation + '">' + m.name + '</option>';
}).join(''));
}
}
}

View File

@ -5,6 +5,7 @@ var Modes = {
setModes:function(json){ setModes:function(json){
this.modes = json.map(function(m){ return new Mode(m); }); this.modes = json.map(function(m){ return new Mode(m); });
this.updatePanels(); this.updatePanels();
$('#openwebrx-dialog-bookmark').bookmarkDialog().setModes(this.modes);
}, },
getModes:function(){ getModes:function(){
return this.modes; return this.modes;

View File

@ -72,6 +72,7 @@ class CompiledAssetsController(Controller):
"lib/Demodulator.js", "lib/Demodulator.js",
"lib/DemodulatorPanel.js", "lib/DemodulatorPanel.js",
"lib/BookmarkBar.js", "lib/BookmarkBar.js",
"lib/BookmarkDialog.js",
"lib/AudioEngine.js", "lib/AudioEngine.js",
"lib/ProgressBar.js", "lib/ProgressBar.js",
"lib/Measurement.js", "lib/Measurement.js",