forked from jaymzcd/gitweb-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextra.js
54 lines (50 loc) · 1.77 KB
/
extra.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$(function(){
$('table.project_list tr[class]')
.each(function(){
var git_link = $(this).find('a.list:eq(0)');
var name = git_link.text();
var path = '/var/git/' + name;
var command = 'git clone koopa.u-dox.com:' + path;
git_link
.before(
$('<a>', {
text: '[clone]',
css: {
marginRight: '15px',
color: '#AFAFAF',
cursor: 'pointer'
}
}
).click(
function(){
$('<div>', {
'class': "copybox"
})
.text('copy this clone command')
.append(
$('<input>')
.attr('type', 'text')
.val(command)
).append(
$('<a>', {
'class': 'close-copybox',
'text': 'close'
})
)
.insertAfter(this)
.show('fast')
.find('input')
.select();
}
)
);
});
$('.close-copybox')
.live('click', function(){
$(this)
.parent()
.hide('fast', function(){
$(this).remove();
});
});
});