From 8d23fe783478ab673f8a4a3b0eac3f8f2a3aa938 Mon Sep 17 00:00:00 2001 From: Thomas Smith <49042513+tsmitty11@users.noreply.github.com> Date: Wed, 19 Oct 2022 16:07:48 -0400 Subject: [PATCH] Converted clipboard copy cta to partial --- src/layouts/index.html | 2 +- src/layouts/page/tea-cli.html | 169 +---------------------- src/layouts/partials/clipboard-copy.html | 155 ++++++++++++++++----- 3 files changed, 119 insertions(+), 207 deletions(-) diff --git a/src/layouts/index.html b/src/layouts/index.html index 4ca713d..af105d3 100644 --- a/src/layouts/index.html +++ b/src/layouts/index.html @@ -41,7 +41,7 @@
- {{- partial "full-width-cta.html" . -}} + {{- partial "clipboard-copy.html" . -}}
diff --git a/src/layouts/page/tea-cli.html b/src/layouts/page/tea-cli.html index c991b7e..120eebd 100644 --- a/src/layouts/page/tea-cli.html +++ b/src/layouts/page/tea-cli.html @@ -24,174 +24,7 @@ -
-
- - - - -
-
- - - - - - +{{- partial "clipboard-copy.html" -}}
diff --git a/src/layouts/partials/clipboard-copy.html b/src/layouts/partials/clipboard-copy.html index 9ffd692..174359b 100644 --- a/src/layouts/partials/clipboard-copy.html +++ b/src/layouts/partials/clipboard-copy.html @@ -1,52 +1,130 @@
-
- +
+ - + +

- @@ -64,11 +142,12 @@ // Copy the text inside the text field navigator.clipboard.writeText(copyText.value); - // Alert the copied text - alert("Copied " + copyText.value + " to clipboard"); + /* Alert the copied text + alert("Copied " + copyText.value + " to clipboard");*/ - // Copy icon + //Change button text to 'copied' document.getElementById("copy-icon").innerHTML = "copied!"; + }