Passed
Push — dartcafe-patch-1 ( eb2768...095f44 )
by René
02:23
created

$(document).ready   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 15
rs 9.4285
cc 1
nc 1
nop 0

3 Functions

Rating   Name   Duplication   Size   Complexity  
A 0 3 1
A 0 3 1
A 0 3 1
1
function deletePoll() {
2
	var str = t('polls', 'Do you really want to delete that poll?') + '\n\n' + $(this).attr('data-value');
3
	if (confirm(str)) {
4
		var form = document.form_delete_poll;
5
		var hiddenId = document.createElement("input");
6
		hiddenId.setAttribute("name", "pollId");
7
		hiddenId.setAttribute("type", "hidden");
8
		form.appendChild(hiddenId);
9
		form.elements.pollId.value = this.id.split('_')[2];
10
		form.submit();
11
	}
12
}
13
14
$(document).ready(function () {
15
	$('.table-body .avatardiv').each(function(i, obj) {
16
		$(obj).avatar(obj.title, 32);
17
	});
18
	
19
	$('.popupmenu').each(function() {
20
		OC.registerMenu($('#expand_' + $(this).attr('value')), $('#expanddiv_' + $(this).attr('value')) ); 
21
	});
22
	
23
	$('.delete_poll').click(deletePoll);
24
25
	$('.copy_link').click(function() {
26
		window.prompt(t('polls','Copy to clipboard: Ctrl+C, Enter'), $(this).data('url'));
27
	});
28
});
29
30