From 93b8f75cc3555f0c16feafa09b3325a44ec034e8 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 3 May 2020 23:56:22 +0200 Subject: [PATCH] automatically load modes into bookmark dialog --- htdocs/index.html | 12 +----------- htdocs/lib/BookmarkDialog.js | 10 ++++++++++ htdocs/lib/Modes.js | 1 + owrx/controllers/assets.py | 1 + 4 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 htdocs/lib/BookmarkDialog.js diff --git a/htdocs/index.html b/htdocs/index.html index abff134..6c1def2 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -211,17 +211,7 @@
- +
Cancel
diff --git a/htdocs/lib/BookmarkDialog.js b/htdocs/lib/BookmarkDialog.js new file mode 100644 index 0000000..09bfa1b --- /dev/null +++ b/htdocs/lib/BookmarkDialog.js @@ -0,0 +1,10 @@ +$.fn.bookmarkDialog = function() { + var $el = this; + return { + setModes: function(modes) { + $el.find('#modulation').html(modes.map(function(m) { + return ''; + }).join('')); + } + } +} \ No newline at end of file diff --git a/htdocs/lib/Modes.js b/htdocs/lib/Modes.js index a33cf4f..c68466a 100644 --- a/htdocs/lib/Modes.js +++ b/htdocs/lib/Modes.js @@ -5,6 +5,7 @@ var Modes = { setModes:function(json){ this.modes = json.map(function(m){ return new Mode(m); }); this.updatePanels(); + $('#openwebrx-dialog-bookmark').bookmarkDialog().setModes(this.modes); }, getModes:function(){ return this.modes; diff --git a/owrx/controllers/assets.py b/owrx/controllers/assets.py index 88563e5..b7b272a 100644 --- a/owrx/controllers/assets.py +++ b/owrx/controllers/assets.py @@ -72,6 +72,7 @@ class CompiledAssetsController(Controller): "lib/Demodulator.js", "lib/DemodulatorPanel.js", "lib/BookmarkBar.js", + "lib/BookmarkDialog.js", "lib/AudioEngine.js", "lib/ProgressBar.js", "lib/Measurement.js",