forked from saurabhshalu/TaskTracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatom.tracker.js
More file actions
74 lines (50 loc) · 1.04 KB
/
atom.tracker.js
File metadata and controls
74 lines (50 loc) · 1.04 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
function getUTCoffset()
{
var x = new Date();
var UTCseconds = (x.getTimezoneOffset());
document.cookie = "user-time="+(0-UTCseconds*60);
}
function build() {
getUTCoffset();
$('#log').load('log.php?mode=build');
tally();
}
function tally() {
$('#tally').load('log.php?mode=tally');
}
$(document).ready(function(){
build();
setInterval(function(){
build();
}, 30000);
$('#form-new').submit(function(event){
event.preventDefault();
var form = $(this);
var data = form.serialize();
$.ajax({
url: 'log.php?mode=new',
data: data,
success: function() {
build();
}
});
});
$('#log').on('click','.btn-stop',function(){
var id = $(this).data('id');
$.ajax({
url: 'log.php?mode=stop&id='+id,
success: function() {
build();
}
});
});
$('#log').on('click','.btn-remove',function(){
var id = $(this).data('id');
$.ajax({
url: 'log.php?mode=remove&id='+id,
success: function() {
build();
}
});
});
});