/
codespeed.js
54 lines (50 loc) · 1.48 KB
/
codespeed.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
53
54
function readCheckbox(el) {
/* Builds a string that holds all checked values in an input form */
var config = "";
$(el).each(function() {
config += $(this).val() + ",";
});
// Remove last comma
config = config.slice(0, -1);
return config;
}
function getLoadText(text, h, showloader) {
var loadtext = '<div style="text-align:center;">';
var pstyle = "";
if (h > 0) {
h = h - 32;
if(h < 80) { h = 180; }
else if (h > 400) { h = 400; }
pstyle = ' style="line-height:' + h + 'px;"';
}
loadtext += '<p' + pstyle + '>'+ text;
if (showloader) {
loadtext += ' <img src="' + window.STATIC_URL +'images/ajax-loader.gif" align="bottom">';
}
loadtext += '</p></div>';
return loadtext;
}
$(function() {
// Check all and none links
$('.checkall').each(function() {
var inputs = $(this).parent().children("li").children("input");
$(this).click(function() {
inputs.attr("checked", true);
return false;
});
});
$('.uncheckall').each(function() {
var inputs = $(this).parent().children("li").children("input");
$(this).click(function() {
inputs.attr("checked", false);
return false;
});
});
$('.togglefold').each(function() {
var lis = $(this).parent().children("li");
$(this).click(function() {
lis.slideToggle();
return false;
});
});
});