diff --git a/dj2ls.png b/dj2ls.png new file mode 100644 index 00000000..9db8f82b Binary files /dev/null and b/dj2ls.png differ diff --git a/gui/preload-chat.js b/gui/preload-chat.js index 20ce0429..0ecefaea 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -42,6 +42,7 @@ var filename = ''; var callsign_counter = 0; var selected_callsign = ''; // ----------------------------------- + var chatDB = path.join(configFolder, 'chatDB') // ---- MessageDB var PouchDB = require('pouchdb'); @@ -80,6 +81,18 @@ db.find({ }); // WINDOW LISTENER window.addEventListener('DOMContentLoaded', () => { + + + // theme selector + if(config.theme != 'default'){ + var theme_path = "../node_modules/bootswatch/dist/"+ config.theme +"/bootstrap.min.css"; + document.getElementById("bootstrap_theme").href = theme_path; + } else { + var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; + document.getElementById("bootstrap_theme").href = theme_path; + } + + document.querySelector('emoji-picker').addEventListener("emoji-click", (event) => { document.getElementById('chatModuleMessage').setRangeText(event.detail.emoji.unicode) console.log(event.detail); @@ -130,7 +143,7 @@ window.addEventListener('DOMContentLoaded', () => { document.addEventListener("keyup", function(event) { // Number 13 == Enter - if (event.keyCode === 13) { + if (event.keyCode === 13 && !event.shiftKey) { // Cancel the default action, if needed event.preventDefault(); // Trigger the button element with a click @@ -185,9 +198,9 @@ db.post({ console.log(filename); console.log(filetype); var data_with_attachment = chatmessage + split_char + filename + split_char + filetype + split_char + file; - document.getElementById('selectFilesButton').innerHTML = ` - - `; + + + document.getElementById('selectFilesButton').innerHTML = ``; var uuid = uuidv4(); console.log(data_with_attachment) let Data = { @@ -247,8 +260,7 @@ ipcRenderer.on('return-selected-files', (event, arg) => { file = arg.data; filename = arg.filename; document.getElementById('selectFilesButton').innerHTML = ` - - + New file selected `; @@ -440,7 +452,7 @@ update_chat = function(obj) { var shortmsg = obj.type; } else { var shortmsg = obj.msg; - var maxlength = 45; + var maxlength = 40; var shortmsg = shortmsg.length > maxlength ? shortmsg.substring(0, maxlength - 3) + "..." : shortmsg; @@ -569,6 +581,8 @@ update_chat = function(obj) { } + // CHECK FOR NEW LINE AND REPLACE WITH
+ var message_html = obj.msg.replace('\n', "
"); if (obj.type == 'received') { @@ -578,7 +592,7 @@ update_chat = function(obj) {
${fileheader}
-

${obj.msg}

+

${message_html}

${timestamp} @@ -588,14 +602,17 @@ update_chat = function(obj) {

`; } + + + if (obj.type == 'transmit') { var new_message = ` -
+
-
+
${fileheader}
-

${obj.msg}

+

${message_html}

${timestamp} - ${status} diff --git a/gui/src/chat-module.html b/gui/src/chat-module.html index 1a075251..a0221322 100644 --- a/gui/src/chat-module.html +++ b/gui/src/chat-module.html @@ -1,165 +1,79 @@ - - - - - - - - - - - FreeDATA - CHAT - - - - - - - + + + + + + + + + + + FreeDATA - CHAT + - + + + + + + + + + +

+
+
+
+ +
+
+ + +
+
+
+
+
+
+
+
+ +
+
+ + + +
+
+
+ +
+ +
+ +
+
+ + + + + - - + + + +
+
+
+
+
+ - - - -
-
-
- - - - - - - -
- -
- - - -
- -
- -
- -
-
- -
-
- - -
- -
- - - - - - - -
- - - - -
- -
- - -
- - - - - - - - - - - - - - - -
- -
- -
- - - - - - - - - - - - - - -
- -
- -
-
- - - - - - - - -
- - - - - - diff --git a/gui/src/styles.css b/gui/src/styles.css index b7d24a7f..17112d0c 100644 --- a/gui/src/styles.css +++ b/gui/src/styles.css @@ -2,6 +2,7 @@ body { padding-right: 0px !important; overflow-y: hidden !important; + overflow-x: hidden !important; } /*Progress bars with centered text*/ @@ -15,3 +16,10 @@ body { width: 100%; color: black; } + + +/* hide scrollbar in callsign list */ +#callsignlist::-webkit-scrollbar { + display: none; +} + diff --git a/tnc/codec2.py b/tnc/codec2.py index 47b4f2bb..c1e84c15 100644 --- a/tnc/codec2.py +++ b/tnc/codec2.py @@ -188,8 +188,8 @@ api.FREEDV_MODE_FSK_LDPC_0_ADV.interleave_frames = 0 api.FREEDV_MODE_FSK_LDPC_0_ADV.M = 4 api.FREEDV_MODE_FSK_LDPC_0_ADV.Rs = 100 api.FREEDV_MODE_FSK_LDPC_0_ADV.Fs = 8000 -api.FREEDV_MODE_FSK_LDPC_0_ADV.first_tone = 1150 # 1250 4fsk, 1500 2fsk -api.FREEDV_MODE_FSK_LDPC_0_ADV.tone_spacing = 100 #200 +api.FREEDV_MODE_FSK_LDPC_0_ADV.first_tone = 1400 # 1150 4fsk, 1500 2fsk +api.FREEDV_MODE_FSK_LDPC_0_ADV.tone_spacing = 120 #200 api.FREEDV_MODE_FSK_LDPC_0_ADV.codename = 'H_128_256_5'.encode('utf-8') # code word # --------------- 4 H_256_512_4, 7 bytes diff --git a/tnc/modem.py b/tnc/modem.py index 88fba30b..107afd93 100644 --- a/tnc/modem.py +++ b/tnc/modem.py @@ -386,10 +386,12 @@ class RF(): txbuffer += bytes(mod_out) - + # codec2 fsk preamble may be broken - at least it sounds like that so we are disabling it for testing + if not self.MODE == 'FSK_LDPC_0' or self.MODE == 200 or self.MODE == 'FSK_LDPC_1' or self.MODE == 201: + # write preamble to txbuffer + codec2.api.freedv_rawdatapostambletx(freedv, mod_out_postamble) + txbuffer += bytes(mod_out_postamble) # append postamble to txbuffer - codec2.api.freedv_rawdatapostambletx(freedv, mod_out_postamble) - txbuffer += bytes(mod_out_postamble) # add delay to end of frames samples_delay = int(self.MODEM_SAMPLE_RATE*(repeat_delay/1000)) mod_out_silence = create_string_buffer(samples_delay*2)