From a5685deab639b3ba49d344f66bd273a893605c9d Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 17 Mar 2022 23:05:07 +0300 Subject: add a "Copy" button --- assets/js/main.js | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) (limited to 'assets/js') diff --git a/assets/js/main.js b/assets/js/main.js index 84970dc..fdda3f4 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -386,6 +386,60 @@ function dload_btn_on_click(btn, path, pre) { link[0].click(); } +function copy_to_clipboard(elem) { + // This is rather neat, thanks: + // https://stackoverflow.com/a/22581382/514684 + + // Apparently, you can only do execCommand('copy') from and + //