From 74f0272eabaf03a45f471966f7a8eecc07f95704 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 27 May 2024 18:03:21 +0700 Subject: [PATCH] cosmetic: logging and easier to read code --- html5/index.html | 17 +++++++++-------- html5/js/Client.js | 18 +++++++++--------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/html5/index.html b/html5/index.html index b67d491d..1b0ec5ab 100644 --- a/html5/index.html +++ b/html5/index.html @@ -1235,6 +1235,11 @@

Xpra Bug Report

} function init_file_transfer(client) { + if (!client.file_transfer) { + $("upload_link").removeAttr("href"); + return; + } + function handleFileSelect(evt) { evt.stopPropagation(); evt.preventDefault(); @@ -1465,6 +1470,7 @@

Xpra Bug Report

let client; function init_page() { + clog("initializing page"); const touchaction = getparam("touchaction") || "scroll"; touchaction_scroll = touchaction == "scroll"; set_touchaction(); @@ -1519,15 +1525,10 @@

Xpra Bug Report

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); diff --git a/html5/js/Client.js b/html5/js/Client.js index 04413c0c..a16acbff 100644 --- a/html5/js/Client.js +++ b/html5/js/Client.js @@ -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) { @@ -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;