diff options
author | silverwind <me@silverwind.io> | 2021-05-30 21:15:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-30 20:15:57 +0100 |
commit | 37205039fc83707edc8079d0884d4c12953e80b1 (patch) | |
tree | ff4adbd4ce4f6f56c5166758e2e21144d91faa1f /templates/repo/clone_buttons.tmpl | |
parent | 36dce0e457d99ae22530f606ce296ef4946b257b (diff) | |
download | gitea-37205039fc83707edc8079d0884d4c12953e80b1.tar.gz gitea-37205039fc83707edc8079d0884d4c12953e80b1.zip |
Replace clipboard.js with async clipboard api (#15899)
Use async clipboard api [1] over this dependency, saving around 10kB
bundle size before minify while delivering the same functionality.
The issue comment button works but does not have a popup indication. We
could add some toast-style notifications in the future to fix that but I
think it's out of scope of this PR.
[1] https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText
Diffstat (limited to 'templates/repo/clone_buttons.tmpl')
-rw-r--r-- | templates/repo/clone_buttons.tmpl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/clone_buttons.tmpl b/templates/repo/clone_buttons.tmpl index b0377b5bc3..8fc1ba12c1 100644 --- a/templates/repo/clone_buttons.tmpl +++ b/templates/repo/clone_buttons.tmpl @@ -14,7 +14,7 @@ <input id="repo-clone-url" value="{{if $.PageIsWiki}}{{$.WikiCloneLink.SSH}}{{else}}{{$.CloneLink.SSH}}{{end}}" readonly> {{end}} {{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}} - <button class="ui basic icon button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url"> + <button class="ui basic icon button poping up" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url"> {{svg "octicon-clippy"}} </button> {{end}} |