diff --git a/htdocs/icons/link.png b/htdocs/icons/link.png new file mode 100644 index 000000000..101865a0d Binary files /dev/null and b/htdocs/icons/link.png differ diff --git a/htdocs/icons/stepdn.16.png b/htdocs/icons/stepdn.16.png new file mode 100644 index 000000000..61f7acf5d Binary files /dev/null and b/htdocs/icons/stepdn.16.png differ diff --git a/htdocs/icons/stepdn.18.png b/htdocs/icons/stepdn.18.png new file mode 100644 index 000000000..20c7185a6 Binary files /dev/null and b/htdocs/icons/stepdn.18.png differ diff --git a/htdocs/icons/stepdn.20.png b/htdocs/icons/stepdn.20.png new file mode 100644 index 000000000..ab010b3c3 Binary files /dev/null and b/htdocs/icons/stepdn.20.png differ diff --git a/htdocs/icons/stepup.16.png b/htdocs/icons/stepup.16.png new file mode 100644 index 000000000..2ad18228b Binary files /dev/null and b/htdocs/icons/stepup.16.png differ diff --git a/htdocs/icons/stepup.18.png b/htdocs/icons/stepup.18.png new file mode 100644 index 000000000..54af8ac89 Binary files /dev/null and b/htdocs/icons/stepup.18.png differ diff --git a/htdocs/icons/stepup.20.png b/htdocs/icons/stepup.20.png new file mode 100644 index 000000000..68687369a Binary files /dev/null and b/htdocs/icons/stepup.20.png differ diff --git a/htdocs/index.wrx b/htdocs/index.wrx index 1be7dd760..a15b2cf79 100644 --- a/htdocs/index.wrx +++ b/htdocs/index.wrx @@ -89,7 +89,18 @@
---.--- MHz
+
---.--- MHz
+ +
+ + + + + + +
+
FM
diff --git a/htdocs/openwebrx.css b/htdocs/openwebrx.css index 9e75d8441..bdb50bcb1 100644 --- a/htdocs/openwebrx.css +++ b/htdocs/openwebrx.css @@ -492,14 +492,14 @@ input[type=range]:focus::-ms-fill-upper #webrx-actual-freq { - width: 100%; + text-align: left; font-size: 16pt; font-family: 'expletus-sans-medium'; padding: 0; margin: 0; line-height:22px; - +display: inline-block; } #webrx-mouse-freq @@ -971,3 +971,16 @@ img.openwebrx-mirror-img border-color: Red; } + +/*---- begin id-control:id-step-freq */ +#id-step-freq +{ + cursor: pointer; + +} + + +#id-freq-link { + display: inline-block; + float: right; +} diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index f26afadc7..e9509d92b 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -20,6 +20,10 @@ """ */ +var base_url = window.location.origin; +//console.log(base_url); +var act_freq=0; + is_firefox=navigator.userAgent.indexOf("Firefox")!=-1; @@ -149,6 +153,50 @@ function toggleMute() updateVolume(); } +function freqstep(sel){ + + stepsize = 0; + + switch(sel) { + case 0: + stepsize = -5000; + break; + case 1: + stepsize = -100; + break; + case 2: + stepsize = -10; + break; + case 3: + stepsize = 10; + break; + case 4: + stepsize = 100; + break; + case 5: + stepsize = 5000; + break; + default: + stepsize = 0; +} + + offset_frequency = parseInt(act_freq)-center_freq; + new_offset= offset_frequency + stepsize; + new_qrg = act_freq + stepsize; + demodulator_set_offset_frequency(0, new_offset); + e("webrx-actual-freq").innerHTML=format_frequency("{x} MHz",new_qrg,1e6,5); + updateShareLink(new_qrg); + act_freq = new_qrg; + } + +function updateShareLink(freq){ + //console.log(freq); + var sqlSliderValue=parseInt(e("openwebrx-panel-squelch").value); + e("id-freq-link").innerHTML=''; + +} + + function zoomInOneStep () { zoom_set(zoom_level+1); } function zoomOutOneStep () { zoom_set(zoom_level-1); } function zoomInTotal () { zoom_set(zoom_levels.length-1); } @@ -160,6 +208,7 @@ function updateSquelch() var sliderValue=parseInt(e("openwebrx-panel-squelch").value); var outputValue=(sliderValue==parseInt(e("openwebrx-panel-squelch").min))?0:getLinearSmeterValue(sliderValue); ws.send("SET squelch_level="+outputValue.toString()); + updateShareLink(act_freq); } function updateWaterfallColors(which) @@ -544,7 +593,9 @@ function demodulator_default_analog(offset_frequency,subtype) mkenvelopes(this.visible_range); this.parent.set(); //will have to change this when changing to multi-demodulator mode: - e("webrx-actual-freq").innerHTML=format_frequency("{x} MHz",center_freq+this.parent.offset_frequency,1e6,4); + e("webrx-actual-freq").innerHTML=format_frequency("{x} MHz",center_freq+this.parent.offset_frequency,1e6,5); + act_freq=center_freq+this.parent.offset_frequency; + updateShareLink(act_freq); return true; }; @@ -601,6 +652,7 @@ function demodulator_analog_replace(subtype, for_digital) } demodulator_add(new demodulator_default_analog(temp_offset,subtype)); demodulator_buttons_update(); + updateShareLink(act_freq); } function demodulator_set_offset_frequency(which,to_what) @@ -621,15 +673,59 @@ var scale_canvas; function scale_setup() { - e("webrx-actual-freq").innerHTML=format_frequency("{x} MHz",canvas_get_frequency(window.innerWidth/2),1e6,4); + act_freq=center_freq; + e("webrx-actual-freq").innerHTML=format_frequency("{x} MHz",act_freq,1e6,5); + updateShareLink(act_freq); + scale_canvas=e("openwebrx-scale-canvas"); scale_ctx=scale_canvas.getContext("2d"); scale_canvas.addEventListener("mousedown", scale_canvas_mousedown, false); scale_canvas.addEventListener("mousemove", scale_canvas_mousemove, false); scale_canvas.addEventListener("mouseup", scale_canvas_mouseup, false); + scale_canvas.addEventListener("wheel",scale_canvas_mousewheel, false); resize_scale(); } +var scale_canvas_scroll_params={ + key_modifiers: {shiftKey:false, altKey: false, ctrlKey: false} +}; + + +function scale_canvas_mousewheel(evt) +{ + //if(!waterfall_setup_done) return; + + var relativeX=(evt.offsetX)?evt.offsetX:evt.layerX; + var dir=(evt.deltaY/Math.abs(evt.deltaY))>0; + if (dir){ // scroll down on scale + + if (evt.shiftKey){ // shift pressed + stepsize = -5000; + } else { + stepsize = -100; + } + } else { // scroll up on scale + if (evt.shiftKey){ // shift pressed + stepsize = 5000; + } else { + stepsize = 100; + } + } + //console.log(act_freq); + offset_frequency = parseInt(act_freq)-center_freq; + new_offset= offset_frequency + stepsize; + //console.log(new_offset); + if (Math.abs(new_offset) < bandwidth/2){ // don't tune out of range + + new_qrg = act_freq + stepsize + demodulator_set_offset_frequency(0, new_offset); + e("webrx-actual-freq").innerHTML=format_frequency("{x} MHz",new_qrg,1e6,5); + updateShareLink(new_qrg); + act_freq = new_qrg; + } + evt.preventDefault(); +} + var scale_canvas_drag_params={ mouse_down: false, drag: false, @@ -674,6 +770,11 @@ function scale_canvas_mousemove(evt) for (var i=0;i