add an input for wsjt_decoding_depths

This commit is contained in:
Jakob Ketterl
2021-02-15 20:19:43 +01:00
parent 819790cbc8
commit c0193e677c
7 changed files with 72 additions and 26 deletions

View File

@ -0,0 +1,16 @@
$.fn.wsjtDecodingDepthsInput = function() {
var renderTable = function(data) {
var $table = $('<table class="table table-sm table-borderless wsjt-decoding-depths-table">');
$table.append($.map(data, function(value, mode){
return $('<tr><td>' + mode + '</td><td>' + value + '</td></tr>');
}));
return $table;
}
this.each(function(){
var $input = $(this);
var $el = $input.parent();
var $table = renderTable(JSON.parse($input.val()));
$el.append($table);
});
};