This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
/
popup.html
82 lines (74 loc) · 2.21 KB
/
popup.html
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
<html>
<head>
<link rel="stylesheet" href="media.css" />
<style>
body {
width:200px;
height:225px;
}
#custom-time-extras {
display:none;
}
</style>
<script src="jquery.js"></script>
<script src="cache.js"></script>
<script src="underscore.js"></script>
<script src="wandermind.js"></script>
<script>
$(document).ready(function() {
$("#selWork").click(function(e) {
$("#work-extras").show()
})
$("#selBreak").click(function(e) {
$("#work-extras").hide()
})
$("#selBreak").click(function(e) {
$("#work-extras").hide()
})
$("#customTime").click(function(e){
$("#custom-time-extras").toggle()
})
$("#go").click(function(e) {
var newMode = $("[name=mode]:checked").val()
var tags = $("#tags").val().split(" ")
var duration
if ($("#customTime:checked").val() == "1") {
duration = parseInt($("#time").val())
} else {
duration = defaultTime.get(newMode)
}
mode.change({mode: newMode, tags: tags, duration: duration})
window.location="letsdothis.html" ;
})
})
</script>
</head>
<body>
<table id="popup">
<tr>
<td><img src="icons/work.png" /></td><td><input type="radio" id="selWork" name="mode" value="work" checked /> <label for="selWork">Work</label></td>
</tr>
<tr id="work-extras">
<td></td>
<td>Which projects?<br><input type="text" id="tags" /></td>
<tr>
<td><img src="icons/break.png" /></td><td><input type="radio" id="selBreak" name="mode" value="break" /> <label for="selBreak">Break</label></td>
</tr>
<tr>
<td></td>
<td><br><input type="checkbox" id="customTime" value="1" /> <label for="customTime">Custom time?</label></td>
</tr>
<tr id="custom-time-extras">
<td></td>
<td>How long?<br> <input type="text" size="2" id="time" /> minutes</td>
</tr>
<tr>
<td></td>
<td>
<br>
<input type="submit" id="go" text="Start!">
</td>
</tr>
</table>
</body>
</html>