From 76cc8456d23bea8d8426d9f3ae14687a3df63bca Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Sat, 22 Apr 2023 13:48:06 +0000 Subject: [PATCH] Add clipboard function --- onlylegs/static/js/clipboard.js | 8 ++++++++ onlylegs/templates/group.html | 13 ++----------- onlylegs/templates/image.html | 10 +--------- onlylegs/templates/profile.html | 2 +- 4 files changed, 12 insertions(+), 21 deletions(-) create mode 100644 onlylegs/static/js/clipboard.js diff --git a/onlylegs/static/js/clipboard.js b/onlylegs/static/js/clipboard.js new file mode 100644 index 0000000..0882f56 --- /dev/null +++ b/onlylegs/static/js/clipboard.js @@ -0,0 +1,8 @@ +function copyToClipboard(data) { + try { + navigator.clipboard.writeText(data) + addNotification("Copied to clipboard!", 4); + } catch (err) { + addNotification("Oh noes, something when wrong D:", 2); + } +} \ No newline at end of file diff --git a/onlylegs/templates/group.html b/onlylegs/templates/group.html index d69530f..c7c3827 100644 --- a/onlylegs/templates/group.html +++ b/onlylegs/templates/group.html @@ -9,15 +9,6 @@ {% endif %}