]> git.proxmox.com Git - proxmox-backup.git/commit
gui: remove document.execCommand calls
authorGabriel Goller <g.goller@proxmox.com>
Thu, 14 Mar 2024 09:32:23 +0000 (10:32 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 25 Mar 2024 15:42:54 +0000 (16:42 +0100)
commite66d75ca2f78a52977e63a539a20aa56b58a986f
treeb9f41a39fb1d9f4d4360ffa2bc1ff387c8be0288
parent5b1f51ffa585b92b9c108268eb7024ceda6222f6
gui: remove document.execCommand calls

The `document.execCommand` call is deprecated since a few years [0] so I
went ahead and removed it. We only use it to copy stuff to the clipboard
and the recommended way now is to use `navigator.clipboard.writeText`
[1]. `writeText` is kind of new, but I think we'll be alright regarding
compatibility (Compat table is also available at [1]).

Making the handler functions async is okay because extjs executes the
handler and does not expect any result from it, nor does it need to do
some work afterwards.

[0]: https://developer.mozilla.org/en-US/docs/Web/API/document/execCommand
[1]: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/ServerStatus.js
www/panel/NodeInfo.js
www/window/DatastoreRepoInfo.js
www/window/TokenEdit.js