| commit | 1752a176b8ec249ce8a89985e8d73f14054d0a5d | [log] [tgz] |
|---|---|---|
| author | gio <gio@v1.dodo.cloud> | Wed Jun 19 15:18:19 2024 +0400 |
| committer | gio <gio@v1.dodo.cloud> | Wed Jun 19 16:03:14 2024 +0400 |
| tree | a1de12cdae786a70f1b148186f095af0fe65b9a9 | |
| parent | f5ffedb5f8b7d2039ded283c700edf39b13d94b9 [diff] |
Launcher: implement copy to clipboard Change-Id: Idbcf5d1bfe574005d5abb60e519eac3ede6aec52
diff --git a/core/installer/welcome/launcher-tmpl/launcher.html b/core/installer/welcome/launcher-tmpl/launcher.html index 9d7eb17..91562f5 100644 --- a/core/installer/welcome/launcher-tmpl/launcher.html +++ b/core/installer/welcome/launcher-tmpl/launcher.html
@@ -81,6 +81,6 @@ {{ template "help-content-template" (dict "Help" $h.Children "First" false) }} {{ end }} {{ end }} - <script src="/static/launcher.js?v=0.0.2"></script> + <script src="/static/launcher.js?v=0.0.3"></script> </body> </html>
diff --git a/core/installer/welcome/static/launcher.js b/core/installer/welcome/static/launcher.js index 58ab6af..cbd35fd 100644 --- a/core/installer/welcome/static/launcher.js +++ b/core/installer/welcome/static/launcher.js
@@ -134,3 +134,13 @@ } }); }); + +function copyToClipboard(elem, text) { + navigator.clipboard.writeText(text); + elem.setAttribute("data-tooltip", "Copied"); + elem.setAttribute("data-placement", "bottom"); + setTimeout(() => { + elem.removeAttribute("data-tooltip"); + elem.removeAttribute("data-placement"); + }, 500); +}