summaryrefslogtreecommitdiffstats
path: root/web/template/pkgbase_details.php
diff options
context:
space:
mode:
Diffstat (limited to 'web/template/pkgbase_details.php')
-rw-r--r--web/template/pkgbase_details.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/web/template/pkgbase_details.php b/web/template/pkgbase_details.php
index b2ce8cbe..a6857c4e 100644
--- a/web/template/pkgbase_details.php
+++ b/web/template/pkgbase_details.php
@@ -49,9 +49,9 @@ $base_uri = get_pkgbase_uri($row['Name']);
<tr>
<th><?= __('Git Clone URL') . ': ' ?></th>
<td>
- <a href="<?= $git_clone_uri_anon ?>"><?= $git_clone_uri_anon ?></a> (<?= __('read-only') ?>)
+ <a class="copy" href="<?= $git_clone_uri_anon ?>"><?= $git_clone_uri_anon ?></a> (<?= __('read-only') ?>, <?= __('click to copy') ?>)
<?php if (in_array($uid, $maintainers)): ?>
- <br /> <a href="<?= $git_clone_uri_priv ?>"><?= $git_clone_uri_priv ?></a>
+ <br /> <a class="copy" href="<?= $git_clone_uri_priv ?>"><?= $git_clone_uri_priv ?></a> (<?= __('click to copy') ?>)
<?php endif; ?>
</td>
</tr>
@@ -135,3 +135,16 @@ endif;
</div>
</div>
</div>
+
+<script>
+$(document).ready(function() {
+ $('.copy').click(function(e) {
+ var tmp = $("<input>");
+ $("body").append(tmp);
+ tmp.val($(this).text()).select();
+ document.execCommand("copy");
+ tmp.remove();
+ e.preventDefault();
+ });
+});
+</script>