-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbase.html
207 lines (186 loc) · 4.32 KB
/
base.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<html>
<head>
<style>
body {
font-family: sans-serif;
font-size: 10pt;
background-color: {{ palette.window.darker(120) }};
color: {{ palette.windowText }};
padding: 0;
margin: 0;
}
h1 {
font-size: 120%;
text-align: center;
padding: 0;
margin: 0;
}
h2 {
font-size: 100%;
text-shadow: rgba(255, 255, 255, 0.5) 1px 1px;
margin: 0;
padding: 0;
padding-top: 0.5em;
}
h2:first-child {
padding-top: 0;
}
/* Task list */
ul.tasks {
margin: 0;
padding: 0;
list-style-type: none;
}
ul.tasks > li {
margin: 0;
padding: 2px;
border: 1px solid {{ palette.shadow }};
border-bottom: 1px solid {{ palette.base.darker(120) }};
border-top: none;
background-color: {{ palette.base }};
}
ul.tasks > li:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-top: 1px solid {{ palette.shadow }};
}
ul.tasks > li:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: 1px solid {{ palette.shadow }};
}
ul.tasks .note {
background-color: {{ palette.alternateBase }};
}
ul.tasks .keyword {
border: 1px solid #aaf;
border-radius: 3px;
background-color: #eff;
padding: 0 3px;
color: #88f;
}
ul.tasks h1 {
text-align: left;
}
/* /Task list */
.group1 {
margin: 6px;
padding: 6px;
}
/* Due date */
.due-date {
float: right;
border-radius: 3px;
padding: 0 2px;
}
.due-date-overdue {
background: -webkit-gradient(linear, left top, left bottom,
from(#f00),
to(#f77)
);
color: white;
}
.due-date-today {
background: -webkit-gradient(linear, left top, left bottom,
from(#f80),
to(#fc8)
);
}
.due-date-week {
background: -webkit-gradient(linear, left top, left bottom,
from(#ff0),
to(#ff8)
);
}
/* /Due date */
.toolbar {
float: right;
height: 1em;
vertical-align: middle;
}
.description-icon {
vertical-align: middle;
}
.description {
padding-top: 6px;
display: none;
}
input {
margin: 0;
padding: 0;
height: 1em;
}
/* notification */
#notification {
display: none;
background: -webkit-gradient(linear, left top, left bottom,
from(#ffe68e),
to(#ffd53d)
);
color: black;
border: 1px solid #ffc800;
border-radius: 5px;
padding: 3px;
position: fixed;
top: 2px;
right: 2px;
}
</style>
<script src="jquery.js"></script>
<script>
var gNotificationTimer = null;
var gUndoFunction = null;
var NOTIFICATION_TIMEOUT = 5000;
var NOTIFICATION_ANIM_DURATION = 400;
function toggleVisibility(itemId) {
var speed = 200;
$("#" + itemId).slideToggle(speed);
}
function showNotification(msg, undoFunction) {
$("#notification-text").html(msg);
gUndoFunction = undoFunction;
$("#notification").fadeIn(NOTIFICATION_ANIM_DURATION);
gNotificationTimer = setTimeout(hideNotification, NOTIFICATION_TIMEOUT);
}
function hideNotification() {
$("#notification").fadeOut(NOTIFICATION_ANIM_DURATION);
clearTimeout(gNotificationTimer);
}
function setStatus(taskId, status) {
qtWindow.setTaskStatus(taskId, status);
var hiddenElements = new Array();
var element = $("#task-" + taskId);
var ul = element.parent();
var group2 = ul.parent(".group2");
var group1 = group2.parent(".group1");
element.hide();
hiddenElements.push(element);
if (ul.children("li:visible").length == 0) {
group2.hide();
hiddenElements.push(group2);
}
if (group1.children(".group2:visible").length == 0) {
group1.hide();
hiddenElements.push(group1);
}
showNotification("Task marked as " + status + ".", function() {
for(idx in hiddenElements) {
hiddenElements[idx].show();
}
var checkbox = $("#task-" + taskId + " input:checkbox")[0];
if (status == "new") {
qtWindow.setTaskStatus(taskId, "done");
checkbox.checked = true;
} else {
qtWindow.setTaskStatus(taskId, "new");
checkbox.checked = false;
}
});
}
</script>
</head>
<body>
<div id="notification"><span id="notification-text"></span> <a id="notification-undo" onclick="gUndoFunction(); hideNotification(); return false" href="#">Undo</a></div>
{% block content %}{% endblock %}
</body>
</html>