[pbs-devel] applied-series: [PATCH proxmox-backup v2 1/2] gui: remove document.execCommand calls
Thomas Lamprecht
t.lamprecht at proxmox.com
Mon Mar 25 16:46:58 CET 2024
Am 14/03/2024 um 10:32 schrieb Gabriel Goller:
> 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 at proxmox.com>
> ---
>
> v2, thanks @Dominik:
> - add explanation of why async handlers are ok
>
> www/ServerStatus.js | 8 +++-----
> www/panel/NodeInfo.js | 5 ++---
> www/window/DatastoreRepoInfo.js | 5 ++---
> www/window/TokenEdit.js | 6 +++---
> 4 files changed, 10 insertions(+), 14 deletions(-)
>
>
applied, thanks!
More information about the pbs-devel
mailing list