mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Prettified Code!
This commit is contained in:
parent
fd21b8b71b
commit
e62cac90de
|
@ -460,57 +460,50 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||||
}
|
}
|
||||||
var timestamp = Math.floor(Date.now() / 1000);
|
var timestamp = Math.floor(Date.now() / 1000);
|
||||||
|
|
||||||
|
|
||||||
// check if broadcast
|
// check if broadcast
|
||||||
if (dxcallsign == 'broadcast') {
|
if (dxcallsign == "broadcast") {
|
||||||
|
var tnc_command = "broadcast";
|
||||||
var tnc_command = "broadcast"
|
|
||||||
|
|
||||||
let Data = {
|
let Data = {
|
||||||
command: tnc_command,
|
command: tnc_command,
|
||||||
data: chatmessage,
|
data: chatmessage,
|
||||||
};
|
};
|
||||||
ipcRenderer.send("run-tnc-command", Data);
|
ipcRenderer.send("run-tnc-command", Data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var file_checksum = crc32(file).toString(16).toUpperCase();
|
var file_checksum = crc32(file).toString(16).toUpperCase();
|
||||||
var tnc_command = "msg"
|
var tnc_command = "msg";
|
||||||
var file_checksum = crc32(file).toString(16).toUpperCase();
|
var file_checksum = crc32(file).toString(16).toUpperCase();
|
||||||
console.log(file_checksum);
|
console.log(file_checksum);
|
||||||
var data_with_attachment =
|
var data_with_attachment =
|
||||||
timestamp +
|
timestamp +
|
||||||
split_char +
|
split_char +
|
||||||
chatmessage +
|
chatmessage +
|
||||||
split_char +
|
split_char +
|
||||||
filename +
|
filename +
|
||||||
split_char +
|
split_char +
|
||||||
filetype +
|
filetype +
|
||||||
split_char +
|
split_char +
|
||||||
file;
|
file;
|
||||||
|
|
||||||
document.getElementById("selectFilesButton").innerHTML = ``;
|
document.getElementById("selectFilesButton").innerHTML = ``;
|
||||||
var uuid = uuidv4();
|
var uuid = uuidv4();
|
||||||
let uuidlast = uuid.lastIndexOf("-");
|
let uuidlast = uuid.lastIndexOf("-");
|
||||||
uuidlast += 1;
|
uuidlast += 1;
|
||||||
if (uuidlast > 0) {
|
if (uuidlast > 0) {
|
||||||
uuid = uuid.substring(uuidlast);
|
uuid = uuid.substring(uuidlast);
|
||||||
|
}
|
||||||
|
console.log(data_with_attachment);
|
||||||
|
let Data = {
|
||||||
|
command: tnc_command,
|
||||||
|
dxcallsign: dxcallsign,
|
||||||
|
mode: 255,
|
||||||
|
frames: 5,
|
||||||
|
data: data_with_attachment,
|
||||||
|
checksum: file_checksum,
|
||||||
|
uuid: uuid,
|
||||||
|
};
|
||||||
|
ipcRenderer.send("run-tnc-command", Data);
|
||||||
}
|
}
|
||||||
console.log(data_with_attachment);
|
|
||||||
let Data = {
|
|
||||||
command: tnc_command,
|
|
||||||
dxcallsign: dxcallsign,
|
|
||||||
mode: 255,
|
|
||||||
frames: 5,
|
|
||||||
data: data_with_attachment,
|
|
||||||
checksum: file_checksum,
|
|
||||||
uuid: uuid,
|
|
||||||
};
|
|
||||||
ipcRenderer.send("run-tnc-command", Data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
db.post({
|
db.post({
|
||||||
_id: uuid,
|
_id: uuid,
|
||||||
|
|
Loading…
Reference in a new issue