From 313c64cb2ba775cf57abdecf83648140ffaa2221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=CC=81scar=20M=2E=20Lage?= Date: Thu, 5 Dec 2024 18:25:04 +0100 Subject: [PATCH] Feat: Now the URL can be coppied with just a click --- assets/clipboard.min.js | 7 ++++++ assets/custom.js | 27 +++++++++++++++++++++ internal/web/templates/partials/header.html | 1 + internal/web/templates/result.html | 22 ++++++++++++++++- 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 assets/clipboard.min.js create mode 100644 assets/custom.js diff --git a/assets/clipboard.min.js b/assets/clipboard.min.js new file mode 100644 index 0000000..98d959b --- /dev/null +++ b/assets/clipboard.min.js @@ -0,0 +1,7 @@ +/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1 { + feedback.classList.add("hidden"); + clipboardDiv.classList.remove("bg-green-100"); + clipboardDiv.classList.add("bg-white", "hover:bg-gray-100"); + }, 2000); +}); + +// Manejar errores +clipboard.on("error", function (e) { + console.error("Failed to copy:", e); +}); diff --git a/internal/web/templates/partials/header.html b/internal/web/templates/partials/header.html index 9b71129..f78609b 100644 --- a/internal/web/templates/partials/header.html +++ b/internal/web/templates/partials/header.html @@ -13,6 +13,7 @@ + diff --git a/internal/web/templates/result.html b/internal/web/templates/result.html index 132d7c1..60a7368 100644 --- a/internal/web/templates/result.html +++ b/internal/web/templates/result.html @@ -1,9 +1,29 @@ {{ template "header.html" . }} -

+

{{.baseURL}}/results/{{.uniqueID}}

+
+ +
+ {{.baseURL}}/results/{{.uniqueID}} + + + +
+ + +
+ +

Command Statistics