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

js/start.js   A

Complexity

Total Complexity 6
Complexity/F 1.2

Size

Lines of Code 28
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 6
c 3
b 0
f 0
dl 0
loc 28
rs 10
cc 0
nc 1
mnd 1
bc 6
fnc 5
bpm 1.2
cpm 1.2
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A $(document).ready 0 15 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