Skip to content

Commit

Permalink
cosmetic: logging and easier to read code
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed May 27, 2024
1 parent 11070d0 commit 74f0272
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
17 changes: 9 additions & 8 deletions html5/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,11 @@ <h2>Xpra Bug Report</h2>
}

function init_file_transfer(client) {
if (!client.file_transfer) {
$("upload_link").removeAttr("href");
return;
}

function handleFileSelect(evt) {
evt.stopPropagation();
evt.preventDefault();
Expand Down Expand Up @@ -1465,6 +1470,7 @@ <h2>Xpra Bug Report</h2>

let client;
function init_page() {
clog("initializing page");
const touchaction = getparam("touchaction") || "scroll";
touchaction_scroll = touchaction == "scroll";
set_touchaction();
Expand Down Expand Up @@ -1519,15 +1525,10 @@ <h2>Xpra Bug Report</h2>
client.debug.apply(client, arguments);
}
};
clog("initializing subsystems");
init_tablet_input(client);
if (client.clipboard_enabled) {
init_clipboard(client);
}
if (client.file_transfer) {
init_file_transfer(client);
} else {
$("upload_link").removeAttr("href");
}
init_clipboard(client);
init_file_transfer(client);
init_keyboard(client);
init_clock(client, getboolparam("clock", true));
init_audio(client);
Expand Down
18 changes: 9 additions & 9 deletions html5/js/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1909,6 +1909,11 @@ class XpraClient {
}

init_clipboard() {
this.clog("initializing clipboard: enabled=", this.clipboard_enabled,
", poll=", this.clipboard_poll, ", preferred format=", this.clipboard_preferred_format);
if (!this.clipboard_enabled) {
return;
}
window.addEventListener("paste", (e) => {
let clipboardData = (e.originalEvent || e).clipboardData;
if (clipboardData && clipboardData.files && clipboardData.files.length > 0) {
Expand Down Expand Up @@ -2463,15 +2468,10 @@ class XpraClient {
}

_process_close(packet) {
this.clog(
"websocket closed: ",
packet[1],
"reason: ",
this.disconnect_reason,
", reconnect: ",
this.reconnect,
", reconnect attempt: ",
this.reconnect_attempt
this.clog("websocket closed: ", packet[1],
"reason: ", this.disconnect_reason,
", reconnect: ", this.reconnect,
", reconnect attempt: ", this.reconnect_attempt
);
if (this.reconnect_in_progress) {
return;
Expand Down

0 comments on commit 74f0272

Please sign in to comment.