From 028ed5d5a308f73e1bd7276f6d6697417ec25a38 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 12 Nov 2025 16:48:24 +0100 Subject: [PATCH] add select for saving text to clipboard --- views/bootstrap/styles/application.js | 5 +++++ views/bootstrap4/styles/application.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/views/bootstrap/styles/application.js b/views/bootstrap/styles/application.js index a249aae65..6e27c3e3a 100644 --- a/views/bootstrap/styles/application.js +++ b/views/bootstrap/styles/application.js @@ -757,6 +757,11 @@ $(document).ready( function() { } return e.which != 13; }); /* }}} */ + + $("body").on("click", ".copy-to-clipboard", function(ev) { + console.log($(this).data()); + navigator.clipboard.writeText($(this).data("text")); + }); }); function onAddClipboard(ev) { /* {{{ */ diff --git a/views/bootstrap4/styles/application.js b/views/bootstrap4/styles/application.js index 39d229062..63f401832 100644 --- a/views/bootstrap4/styles/application.js +++ b/views/bootstrap4/styles/application.js @@ -805,6 +805,11 @@ $(document).ready( function() { } return e.which != 13; }); /* }}} */ + + $("body").on("click", ".copy-to-clipboard", function(ev) { + console.log($(this).data()); + navigator.clipboard.writeText($(this).data("text")); + }); }); function onAddClipboard(ev) { /* {{{ */