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);
+}