aboutsummaryrefslogtreecommitdiffstats
path: root/static/main.js
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2024-01-24 17:29:33 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2024-01-24 17:29:33 +0100
commit67441f813917d0a9c6624ec04ddc08d89ec2b3bc (patch)
tree8071903dc1c6982daa2fd84e2cc867e276c1160e /static/main.js
parent82f6ce1b1f003903c0e8ffceafe17682ecd7fb88 (diff)
downloadcats-radio-node-67441f813917d0a9c6624ec04ddc08d89ec2b3bc.tar.gz
cats-radio-node-67441f813917d0a9c6624ec04ddc08d89ec2b3bc.tar.bz2
cats-radio-node-67441f813917d0a9c6624ec04ddc08d89ec2b3bc.zip
Work on chat page
Diffstat (limited to 'static/main.js')
-rw-r--r--static/main.js48
1 files changed, 0 insertions, 48 deletions
diff --git a/static/main.js b/static/main.js
index 7f6b110..8e8b87c 100644
--- a/static/main.js
+++ b/static/main.js
@@ -1,51 +1,3 @@
-async function btn_add_destination() {
- const template = document.getElementById('destination_template');
-
- let clon = template.content.cloneNode(true);
- document.getElementById('destinations').appendChild(clon);
-}
-
-async function btn_remove_destination(element_clicked) {
- element_clicked.parentElement.remove()
-}
-
-async function btn_send_packet() {
- let data = {
- 'comment': null,
- //'simplex': null,
- 'destinations': [],
- };
-
- if (document.getElementById('with_comment').checked) {
- data.comment = document.getElementById('whisker_comment').value;
- }
-
- /* not yet implemented in ham-cats
- if (document.getElementById('with_simplex').checked) {
- const simplex_freq_MHz = parseInt(document.getElementById('simplex_mode').value, 10);
- const mode_select = document.getElementById('simplex_mode')
- const i = mode_select.selectedIndex;
- const simplex_mode = mode_select.options[i].text;
-
- data.simplex = {'frequency': simplex_freq_MHz * 1e6, 'mode': simplex_mode};
- }
- */
-
- const destinations = document.getElementById('destinations');
- const destList = destinations.querySelectorAll("p.destination");
- for (let i = 0; i < destList.length; i++) {
- const dest_callsign = destList[i].querySelector("input.dest_callsign").value;
- const dest_ssid_str = destList[i].querySelector("input.dest_ssid").value;
- const dest_ssid = parseInt(dest_ssid_str, 10);
- if (dest_ssid < 0 || dest_ssid > 255) {
- alert("SSID must be between 0 and 255");
- return;
- }
- data.destinations.push({'callsign': dest_callsign, 'ssid': dest_ssid});
- }
-
- await post('/api/send_packet', data);
-}
async function post(url, data) {
const params = {