This repository was archived by the owner on Aug 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc.Timer.php
More file actions
88 lines (69 loc) · 2.04 KB
/
Copy pathc.Timer.php
File metadata and controls
88 lines (69 loc) · 2.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<script type="text/javascript">
$(function()
{
$('#clock').stopwatch();
$('#task').focus(function() {
$(this).val('');
});
$("#distracted").css({ "opacity" : "0.5" });
$("#focused").css({ "opacity" : "0.5" });
$('#focused').bind('click', function () {
$("#distracted").css({ "opacity" : "0.5" });
$(this).css({ "opacity" : "1.0" });
$("#hidefocus").val("1");
});
$('#distracted').bind('click', function () {
$(this).css({ "opacity" : "1.0" });
$("#focused").css({ "opacity" : "0.5" });
$("#hidefocus").val("0");
});
$('#hidelog').click(function() {
$('#showlog').toggle('slow', function() {
});
});
$("#showlog").load("v.ShowRecentEntries.php");
//Buttons as Radio from http://dan.doezema.com/2012/03/twitter-bootstrap-radio-button-form-inputs/
$('div.btn-group[data-toggle-name=*]').each(function(){
var group = $(this);
var form = group.parents('form').eq(0);
var name = group.attr('data-toggle-name');
var hidden = $('input[name="' + name + '"]', form);
$('button', group).each(function(){
var button = $(this);
button.live('click', function(){
hidden.val($(this).val());
});
if(button.val() == hidden.val()) {
button.addClass('active');
}
});
});
$('#taskform').submit(function()
{
// Stop Post
event.preventDefault();
// Post Record
$.ajaxSetup({async:false});
$.post("m.SetTask.php", $("#taskform").serialize());
// Get Records
$("#showlog").load("v.ShowRecentEntries.php");
// Hide Entry Panel
$('#EntryModal').modal('hide');
h.html("00");
m.html("00");
s.html("00");
hour = parseFloat(h.text());
minute = parseFloat(m.text());
second = parseFloat(s.text());
// Reset Timestamp
console.log("Timer Reset" + second);
$.get('currtime.php', function(data)
{
$("#tstart").val(data);
phptime = data;
console.log("New Task At " + phptime);
});
return false;
});
});
</script>