From 6742c45c209f997d25a9d2d70840b2e88e77a618 Mon Sep 17 00:00:00 2001 From: xhyrom Date: Tue, 21 Dec 2021 15:59:51 +0100 Subject: [PATCH] comment + copy --- src/web/app/js/script.js | 12 ++++++++++++ src/web/app/scss/_forumstyle.scss | 4 ++++ src/web/dist/style.css | 4 ++++ src/web/dist/style.css.map | 2 +- src/web/index.html | 6 ++++-- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/web/app/js/script.js b/src/web/app/js/script.js index 0c3727a..8be098a 100644 --- a/src/web/app/js/script.js +++ b/src/web/app/js/script.js @@ -37,6 +37,18 @@ $('button[id=addRole]').click((e) => { }).catch(swal.noop) }) +$('pre[id=json].copy').click((e) => { + navigator.clipboard.writeText(e?.currentTarget?.textContent || e.textContent); + + Swal.fire({ + position: 'top-end', + icon: 'success', + title: 'Copied!', + showConfirmButton: false, + timer: 1500 + }) +}) + $(window).on('load', () => { $('input').toArray().forEach((i) => i.value = ''); document.getElementById('json').innerHTML = hljs.highlight(JSON.stringify(json), { language: 'json' }).value; diff --git a/src/web/app/scss/_forumstyle.scss b/src/web/app/scss/_forumstyle.scss index 964c48f..c58194e 100644 --- a/src/web/app/scss/_forumstyle.scss +++ b/src/web/app/scss/_forumstyle.scss @@ -28,6 +28,10 @@ input { max-width: 900px; } +.copy { + cursor: pointer; +} + @media screen and (max-width:600px) { input { font-size: 1rem; diff --git a/src/web/dist/style.css b/src/web/dist/style.css index 25d379e..e2f8bc7 100644 --- a/src/web/dist/style.css +++ b/src/web/dist/style.css @@ -142,6 +142,10 @@ input { max-width: 900px; } +.copy { + cursor: pointer; +} + @media screen and (max-width: 600px) { input { font-size: 1rem; diff --git a/src/web/dist/style.css.map b/src/web/dist/style.css.map index c613cd7..fb6ae79 100644 --- a/src/web/dist/style.css.map +++ b/src/web/dist/style.css.map @@ -1,6 +1,6 @@ { "version": 3, - "mappings": "AAKA,OAAO,CAAC,0HAAI;ACLZ,AAAA,IAAI,CAAC;EACH,SAAS,EAAE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;EACG,WAAW,EAAE,uBAAuB;EACpC,KAAK,EAAE,KAAK;EACZ,SAAS,EAAE,IAAI;EACf,eAAe,EAAE,IAAI;EACrB,WAAW,EAAE,GAAG;CACnB;;AACD,AAAA,MAAM,CAAC;EACH,WAAW,EAAE,uBAAuB;EACpC,KAAK,EAAE,KAAK;EACZ,SAAS,EAAE,IAAI;EACf,eAAe,EAAE,IAAI;EACrB,WAAW,EAAE,GAAG;CACnB;;ACzBD,AAAA,MAAM,CAAC;EACH,gBAAgB,EAAE,aAAa;EAC/B,aAAa,EAAE,KAAK;EACpB,YAAY,EAAE,IAAI;EAClB,UAAU,EAAE,KAAK;EACjB,SAAS,EAAE,MAAM;EACjB,OAAO,EAAE,WAAW;EACpB,MAAM,EAAE,gCAAgC;EACxC,UAAU,EAAE,GAAG;EACf,MAAM,EAAE,OAAO;CAKlB;;AAdD,AAWI,MAXE,AAWD,MAAM,CAAA;EACH,gBAAgB,EAAE,kBAAkB;CACvC;;AAGL,AAAA,KAAK,CAAC;EACF,KAAK,EAAE,KAAK;EACZ,OAAO,EAAE,WAAW;EACpB,gBAAgB,EAAE,gBAAgB;EAClC,UAAU,EAAE,KAAK;EACjB,SAAS,EAAE,MAAM;EACjB,YAAY,EAAE,IAAI;EAClB,aAAa,EAAE,KAAK;CACvB;;AAED,AAAA,KAAK,CAAA;EACL,SAAS,EAAE,KAAK;CACf;;AAED,AAAA,KAAK,CAAC;EACF,MAAM,EAAE,OAAO;CAClB;;AAED,MAAM,CAAC,MAAM,MAAM,SAAS,EAAE,KAAK;EAC/B,AAAA,KAAK,CAAC;IACF,SAAS,EAAE,IAAI;GAClB;EACD,AAAA,MAAM,CAAC;IACH,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,WAAW;GACvB;EACD,AAAA,KAAK,CAAA;IACD,SAAS,EAAE,KAAK;GACf", "sources": [ "../app/scss/style.scss", "../app/scss/_globals.scss", diff --git a/src/web/index.html b/src/web/index.html index bef07ca..f9f039f 100644 --- a/src/web/index.html +++ b/src/web/index.html @@ -27,11 +27,13 @@

Generate

-
+
-
+ +
+ Put json from ^ to /setup