From b680b6d27d8b7506c7acbc1c01de7edd720bcd4e Mon Sep 17 00:00:00 2001 From: kjh Date: Thu, 29 Aug 2024 14:51:08 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=AA=A8=EB=B0=94=EC=9D=BC=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EB=B3=B5=EC=82=AC=ED=95=98=EA=B8=B0=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/webapp/WEB-INF/jsp/notiprnt.jsp | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/mens-api/src/main/webapp/WEB-INF/jsp/notiprnt.jsp b/mens-api/src/main/webapp/WEB-INF/jsp/notiprnt.jsp index b84758e..6d5526f 100644 --- a/mens-api/src/main/webapp/WEB-INF/jsp/notiprnt.jsp +++ b/mens-api/src/main/webapp/WEB-INF/jsp/notiprnt.jsp @@ -209,8 +209,24 @@ str = str.replace(/\[/g, '\\[').replace(/\]/g, '\\]') txt = txt.replace(new RegExp(str, 'g'), span.outerHTML); + if (txt.indexOf(str) > -1 && style['use-copybutton']) { + let btn = document.createElement('button'); + let btn_text = document.createTextNode('복사하기'); + btn.appendChild(btn_text); + btn.setAttribute('type', 'button'); + btn.setAttribute('data-text', str); + btn.classList.add('clipboard'); + btn.style.backgroundColor = '#4990e2'; + btn.style.color = 'white'; + btn.style.border = 'none'; + btn.style.fontSize = '2rem'; + btn.style.textAlign = 'center'; + btn.style.height = '3rem'; + btn.style.width = '10rem'; + btn.style.marginLeft = '20px'; + txt = txt+btn.outerHTML; + } } - return txt; } /* =============== @@ -291,6 +307,12 @@ clipboardCopy(this.innerText); }); }); + + document.querySelectorAll('button.clipboard').forEach((ele) => { + ele.addEventListener('click', function () { + clipboardCopy(this.dataset.text); + }); + }); } /* ===============