aboutsummaryrefslogtreecommitdiffstats
path: root/ui-summary.c
diff options
context:
space:
mode:
authorYigit Sever2022-03-31 00:48:06 +0000
committerYigit Sever2023-07-21 02:58:04 +0300
commit8dbc2778d78461f488f08ca5847753173ad024ba (patch)
tree577ea0347b8a10259a0f5dc63ce1c224c4bac071 /ui-summary.c
parentb2351835592be470d67d02637b8ae14283d87f25 (diff)
downloadcgit-8dbc2778d78461f488f08ca5847753173ad024ba.tar.gz
cgit-8dbc2778d78461f488f08ca5847753173ad024ba.tar.bz2
cgit-8dbc2778d78461f488f08ca5847753173ad024ba.zip
Serve jquery here and move copy on click
Diffstat (limited to 'ui-summary.c')
-rw-r--r--ui-summary.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/ui-summary.c b/ui-summary.c
index 03b8c6b..6ddd2d7 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -27,10 +27,7 @@ static void print_url(const char *url)
27 columns++; 27 columns++;
28 28
29 if (urls++ == 0) { 29 if (urls++ == 0) {
30 html("<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js'></script>\n"); 30 html("<script type='text/javascript' src='/site.js'></script>\n");
31 html("<script>\n");
32 html("$(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(); }); });\n");
33 html("</script>");
34 htmlf("<tr class='nohover'><td colspan='%d'>&nbsp;</td></tr>", columns); 31 htmlf("<tr class='nohover'><td colspan='%d'>&nbsp;</td></tr>", columns);
35 htmlf("<tr class='nohover'><th class='left' colspan='%d'>clone</th></tr>\n", columns); 32 htmlf("<tr class='nohover'><th class='left' colspan='%d'>clone</th></tr>\n", columns);
36 } 33 }