Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c406ef4

Browse files
committedFeb 16, 2025
Format files using biome (#29)
1 parent 6866bca commit c406ef4

File tree

2 files changed

+301
-251
lines changed

2 files changed

+301
-251
lines changed
 

‎media/commitfest/css/commitfest.css

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,45 @@
44

55
/* For close button with float disabled */
66
.close-nofloat {
7-
float: none !important;
7+
float: none !important;
88
}
99

1010
/* General form styling */
1111
.form-horizontal div.form-group {
12-
margin-bottom: 10px;
12+
margin-bottom: 10px;
1313
}
1414
div.form-group div.controls ul {
15-
list-style-type: none;
16-
margin: 0px;
17-
padding: 0px;
15+
list-style-type: none;
16+
margin: 0px;
17+
padding: 0px;
1818
}
1919
div.form-group div.controls ul li {
20-
display: inline;
20+
display: inline;
2121
}
2222
div.form-group div.controls ul li label {
23-
display: inline;
24-
font-weight: normal;
25-
vertical-align:middle;
23+
display: inline;
24+
font-weight: normal;
25+
vertical-align: middle;
2626
}
2727
div.form-group div.controls ul li label input {
28-
display: inline;
29-
vertical-align:middle;
28+
display: inline;
29+
vertical-align: middle;
3030
}
31-
div.form-group div.controls input[type='checkbox'] {
32-
width: 10px;
31+
div.form-group div.controls input[type="checkbox"] {
32+
width: 10px;
3333
}
3434

3535
div.form-group div.controls input.threadpick-input {
36-
width: 80%;
37-
display: inline;
36+
width: 80%;
37+
display: inline;
3838
}
3939

40-
41-
4240
/*
4341
* Attach thread dialog
4442
*/
4543
#attachThreadListWrap.loading {
4644
display: block;
47-
background: url('/media/commitfest/spinner.gif') no-repeat center;
45+
background: url("/media/commitfest/spinner.gif") no-repeat center;
4846
width: 124px;
4947
height: 124px;
5048
margin: 0 auto;
@@ -57,7 +55,7 @@ div.form-group div.controls input.threadpick-input {
5755
* Annotate message dialog */
5856
#annotateMessageBody.loading {
5957
display: block;
60-
background: url('/media/commitfest/spinner.gif') no-repeat center;
58+
background: url("/media/commitfest/spinner.gif") no-repeat center;
6159
width: 124px;
6260
height: 124px;
6361
margin: 0 auto;

‎media/commitfest/js/commitfest.js

Lines changed: 284 additions & 232 deletions
Original file line numberDiff line numberDiff line change
@@ -1,314 +1,366 @@
11
function verify_reject() {
2-
return confirm('Are you sure you want to close this patch as Rejected?\n\nThis should only be done when a patch will never be applied - if more work is needed, it should instead be set to "Returned with Feedback" or "Moved to next CF".\n\nSo - are you sure?');
2+
return confirm(
3+
'Are you sure you want to close this patch as Rejected?\n\nThis should only be done when a patch will never be applied - if more work is needed, it should instead be set to "Returned with Feedback" or "Moved to next CF".\n\nSo - are you sure?',
4+
);
35
}
46
function verify_withdrawn() {
5-
return confirm('Are you sure you want to close this patch as Withdrawn?\n\nThis should only be done when the author voluntarily withdraws the patch.\n\nSo - are you sure?');
7+
return confirm(
8+
"Are you sure you want to close this patch as Withdrawn?\n\nThis should only be done when the author voluntarily withdraws the patch.\n\nSo - are you sure?",
9+
);
610
}
711
function verify_returned() {
8-
return confirm('Are you sure you want to close this patch as Returned with Feedback?\n\nThis should be done if the patch is expected to be finished at some future time, but not necessarily in the next commitfest. If work is undergoing and expected in the next commitfest, it should instead be set to "Moved to next CF".\n\nSo - are you sure?');
12+
return confirm(
13+
'Are you sure you want to close this patch as Returned with Feedback?\n\nThis should be done if the patch is expected to be finished at some future time, but not necessarily in the next commitfest. If work is undergoing and expected in the next commitfest, it should instead be set to "Moved to next CF".\n\nSo - are you sure?',
14+
);
915
}
1016
function verify_next() {
11-
return confirm('Are you sure you want to move this patch to the next commitfest?\n\nThis means the patch will be marked as closed in this commitfest, but will automatically be moved to the next one. If no further work is expected on this patch, it should be closed with "Rejected" or "Returned with Feedback" instead.\n\nSo - are you sure?');
17+
return confirm(
18+
'Are you sure you want to move this patch to the next commitfest?\n\nThis means the patch will be marked as closed in this commitfest, but will automatically be moved to the next one. If no further work is expected on this patch, it should be closed with "Rejected" or "Returned with Feedback" instead.\n\nSo - are you sure?',
19+
);
1220
}
1321
function findLatestThreads() {
14-
$('#attachThreadListWrap').addClass('loading');
15-
$('#attachThreadSearchButton').addClass('disabled');
16-
$.get('/ajax/getThreads/', {
17-
's': $('#attachThreadSearchField').val(),
18-
'a': $('#attachThreadAttachOnly').val(),
19-
}).success(function(data) {
20-
sel = $('#attachThreadList');
21-
sel.find('option').remove();
22-
$.each(data, function(m,i) {
23-
sel.append($('<option/>').text(i.from + ': ' + i.subj + ' (' + i.date + ')').val(i.msgid));
24-
});
25-
}).always(function() {
26-
$('#attachThreadListWrap').removeClass('loading');
27-
$('#attachThreadSearchButton').removeClass('disabled');
28-
attachThreadChanged();
29-
});
30-
return false;
22+
$("#attachThreadListWrap").addClass("loading");
23+
$("#attachThreadSearchButton").addClass("disabled");
24+
$.get("/ajax/getThreads/", {
25+
s: $("#attachThreadSearchField").val(),
26+
a: $("#attachThreadAttachOnly").val(),
27+
})
28+
.success(function (data) {
29+
sel = $("#attachThreadList");
30+
sel.find("option").remove();
31+
$.each(data, function (m, i) {
32+
sel.append(
33+
$("<option/>")
34+
.text(i.from + ": " + i.subj + " (" + i.date + ")")
35+
.val(i.msgid),
36+
);
37+
});
38+
})
39+
.always(function () {
40+
$("#attachThreadListWrap").removeClass("loading");
41+
$("#attachThreadSearchButton").removeClass("disabled");
42+
attachThreadChanged();
43+
});
44+
return false;
3145
}
3246

3347
function browseThreads(attachfunc, closefunc) {
34-
$('#attachThreadList').find('option').remove();
35-
$('#attachThreadMessageId').val('');
36-
$('#attachModal').off('hidden.bs.modal');
37-
$('#attachModal').on('hidden.bs.modal', function(e) {
38-
if (closefunc) closefunc();
39-
});
40-
$('#attachModal').modal();
41-
findLatestThreads();
42-
43-
$('#doAttachThreadButton').unbind('click');
44-
$('#doAttachThreadButton').click(function() {
45-
msgid = $('#attachThreadMessageId').val();
46-
if (!msgid || msgid == '') {
47-
msgid = $('#attachThreadList').val();
48-
if (!msgid) return;
49-
}
48+
$("#attachThreadList").find("option").remove();
49+
$("#attachThreadMessageId").val("");
50+
$("#attachModal").off("hidden.bs.modal");
51+
$("#attachModal").on("hidden.bs.modal", function (e) {
52+
if (closefunc) closefunc();
53+
});
54+
$("#attachModal").modal();
55+
findLatestThreads();
5056

51-
$('#attachThreadListWrap').addClass('loading');
52-
$('#attachThreadSearchButton').addClass('disabled');
53-
$('#attachThreadButton').addClass('disabled');
54-
if (attachfunc(msgid)) {
55-
$('#attachModal').modal('hide');
56-
}
57-
$('#attachThreadListWrap').removeClass('loading');
58-
$('#attachThreadSearchButton').removeClass('disabled');
59-
attachThreadChanged();
60-
});
57+
$("#doAttachThreadButton").unbind("click");
58+
$("#doAttachThreadButton").click(function () {
59+
msgid = $("#attachThreadMessageId").val();
60+
if (!msgid || msgid == "") {
61+
msgid = $("#attachThreadList").val();
62+
if (!msgid) return;
63+
}
6164

65+
$("#attachThreadListWrap").addClass("loading");
66+
$("#attachThreadSearchButton").addClass("disabled");
67+
$("#attachThreadButton").addClass("disabled");
68+
if (attachfunc(msgid)) {
69+
$("#attachModal").modal("hide");
70+
}
71+
$("#attachThreadListWrap").removeClass("loading");
72+
$("#attachThreadSearchButton").removeClass("disabled");
73+
attachThreadChanged();
74+
});
6275
}
6376

6477
function attachThread(cfid, patchid, closefunc) {
65-
browseThreads(function(msgid) {
66-
doAttachThread(cfid, patchid, msgid, !closefunc);
67-
if (closefunc) {
68-
/* We don't really care about closing it, we just reload immediately */
69-
closefunc();
70-
}
71-
},
72-
function() {
73-
if (closefunc) closefunc();
74-
});
78+
browseThreads(
79+
function (msgid) {
80+
doAttachThread(cfid, patchid, msgid, !closefunc);
81+
if (closefunc) {
82+
/* We don't really care about closing it, we just reload immediately */
83+
closefunc();
84+
}
85+
},
86+
function () {
87+
if (closefunc) closefunc();
88+
},
89+
);
7590
}
7691

7792
function detachThread(cfid, patchid, msgid) {
78-
if (confirm('Are you sure you want to detach the thread with messageid "' + msgid + '" from this patch?')) {
79-
$.post('/ajax/detachThread/', {
80-
'cf': cfid,
81-
'p': patchid,
82-
'msg': msgid,
83-
}).success(function(data) {
84-
location.reload();
85-
}).fail(function(data) {
86-
alert('Failed to detach thread!');
87-
});
88-
}
93+
if (
94+
confirm(
95+
'Are you sure you want to detach the thread with messageid "' +
96+
msgid +
97+
'" from this patch?',
98+
)
99+
) {
100+
$.post("/ajax/detachThread/", {
101+
cf: cfid,
102+
p: patchid,
103+
msg: msgid,
104+
})
105+
.success(function (data) {
106+
location.reload();
107+
})
108+
.fail(function (data) {
109+
alert("Failed to detach thread!");
110+
});
111+
}
89112
}
90113

91114
function attachThreadChanged() {
92-
if ($('#attachThreadList').val() || $('#attachThreadMessageId').val()) {
93-
$('#doAttachThreadButton').removeClass('disabled');
94-
}
95-
else {
96-
$('#doAttachThreadButton').addClass('disabled');
97-
}
115+
if ($("#attachThreadList").val() || $("#attachThreadMessageId").val()) {
116+
$("#doAttachThreadButton").removeClass("disabled");
117+
} else {
118+
$("#doAttachThreadButton").addClass("disabled");
119+
}
98120
}
99121

100122
function doAttachThread(cfid, patchid, msgid, reloadonsuccess) {
101-
$.post('/ajax/attachThread/', {
102-
'cf': cfid,
103-
'p': patchid,
104-
'msg': msgid,
105-
}).success(function(data) {
106-
if (data != 'OK') {
107-
alert(data);
108-
}
109-
if (reloadonsuccess)
110-
location.reload();
111-
return true;
112-
}).fail(function(data) {
113-
if (data.status == 404) {
114-
alert('Message with messageid ' + msgid + ' not found');
115-
}
116-
else if (data.status == 503) {
117-
alert('Failed to attach thread: ' + data.responseText);
118-
}
119-
else {
120-
alert('Failed to attach thread: ' + data.statusText);
121-
}
122-
return false;
123-
});
123+
$.post("/ajax/attachThread/", {
124+
cf: cfid,
125+
p: patchid,
126+
msg: msgid,
127+
})
128+
.success(function (data) {
129+
if (data != "OK") {
130+
alert(data);
131+
}
132+
if (reloadonsuccess) location.reload();
133+
return true;
134+
})
135+
.fail(function (data) {
136+
if (data.status == 404) {
137+
alert("Message with messageid " + msgid + " not found");
138+
} else if (data.status == 503) {
139+
alert("Failed to attach thread: " + data.responseText);
140+
} else {
141+
alert("Failed to attach thread: " + data.statusText);
142+
}
143+
return false;
144+
});
124145
}
125146

126147
function updateAnnotationMessages(threadid) {
127-
$('#annotateMessageBody').addClass('loading');
128-
$('#doAnnotateMessageButton').addClass('disabled');
129-
$.get('/ajax/getMessages', {
130-
't': threadid,
131-
}).success(function(data) {
132-
sel = $('#annotateMessageList')
133-
sel.find('option').remove();
134-
sel.append('<option value="">---</option>');
135-
$.each(data, function(i,m) {
136-
sel.append('<option value="' + m.msgid + '">' + m.from + ': ' + m.subj + ' (' + m.date + ')</option>');
137-
});
138-
}).always(function() {
139-
$('#annotateMessageBody').removeClass('loading');
140-
});
148+
$("#annotateMessageBody").addClass("loading");
149+
$("#doAnnotateMessageButton").addClass("disabled");
150+
$.get("/ajax/getMessages", {
151+
t: threadid,
152+
})
153+
.success(function (data) {
154+
sel = $("#annotateMessageList");
155+
sel.find("option").remove();
156+
sel.append('<option value="">---</option>');
157+
$.each(data, function (i, m) {
158+
sel.append(
159+
'<option value="' +
160+
m.msgid +
161+
'">' +
162+
m.from +
163+
": " +
164+
m.subj +
165+
" (" +
166+
m.date +
167+
")</option>",
168+
);
169+
});
170+
})
171+
.always(function () {
172+
$("#annotateMessageBody").removeClass("loading");
173+
});
141174
}
142175
function addAnnotation(threadid) {
143-
$('#annotateThreadList').find('option').remove();
144-
$('#annotateMessage').val('');
145-
$('#annotateMsgId').val('');
146-
$('#annotateModal').modal();
147-
$('#annotateThreadList').focus();
176+
$("#annotateThreadList").find("option").remove();
177+
$("#annotateMessage").val("");
178+
$("#annotateMsgId").val("");
179+
$("#annotateModal").modal();
180+
$("#annotateThreadList").focus();
148181
updateAnnotationMessages(threadid);
149-
$('#doAnnotateMessageButton').unbind('click');
150-
$('#doAnnotateMessageButton').click(function() {
151-
var msg = $('#annotateMessage').val();
152-
if (msg.length >= 500) {
153-
alert('Maximum length for an annotation is 500 characters.\nYou should probably post an actual message in the thread!');
154-
return;
155-
}
156-
$('#doAnnotateMessageButton').addClass('disabled');
157-
$('#annotateMessageBody').addClass('loading');
158-
$.post('/ajax/annotateMessage/', {
159-
't': threadid,
160-
'msgid': $.trim($('#annotateMsgId').val()),
161-
'msg': msg
162-
}).success(function(data) {
163-
if (data != 'OK') {
164-
alert(data);
165-
$('#annotateMessageBody').removeClass('loading');
166-
}
167-
else {
168-
$('#annotateModal').modal('hide');
169-
location.reload();
170-
}
171-
}).fail(function(data) {
172-
alert('Failed to annotate message');
173-
$('#annotateMessageBody').removeClass('loading');
174-
});
182+
$("#doAnnotateMessageButton").unbind("click");
183+
$("#doAnnotateMessageButton").click(function () {
184+
var msg = $("#annotateMessage").val();
185+
if (msg.length >= 500) {
186+
alert(
187+
"Maximum length for an annotation is 500 characters.\nYou should probably post an actual message in the thread!",
188+
);
189+
return;
190+
}
191+
$("#doAnnotateMessageButton").addClass("disabled");
192+
$("#annotateMessageBody").addClass("loading");
193+
$.post("/ajax/annotateMessage/", {
194+
t: threadid,
195+
msgid: $.trim($("#annotateMsgId").val()),
196+
msg: msg,
197+
})
198+
.success(function (data) {
199+
if (data != "OK") {
200+
alert(data);
201+
$("#annotateMessageBody").removeClass("loading");
202+
} else {
203+
$("#annotateModal").modal("hide");
204+
location.reload();
205+
}
206+
})
207+
.fail(function (data) {
208+
alert("Failed to annotate message");
209+
$("#annotateMessageBody").removeClass("loading");
210+
});
175211
});
176212
}
177213

178214
function annotateMsgPicked() {
179-
var val = $('#annotateMessageList').val();
215+
var val = $("#annotateMessageList").val();
180216
if (val) {
181-
$('#annotateMsgId').val(val);
182-
annotateChanged();
217+
$("#annotateMsgId").val(val);
218+
annotateChanged();
183219
}
184220
}
185221

186222
function annotateChanged() {
187223
/* Enable/disable the annotate button */
188-
if ($('#annotateMessage').val() != '' && $('#annotateMsgId').val()) {
189-
$('#doAnnotateMessageButton').removeClass('disabled');
190-
}
191-
else {
192-
$('#doAnnotateMessageButton').addClass('disabled');
224+
if ($("#annotateMessage").val() != "" && $("#annotateMsgId").val()) {
225+
$("#doAnnotateMessageButton").removeClass("disabled");
226+
} else {
227+
$("#doAnnotateMessageButton").addClass("disabled");
193228
}
194229
}
195230

196231
function deleteAnnotation(annid) {
197-
if (confirm('Are you sure you want to delete this annotation?')) {
198-
$.post('/ajax/deleteAnnotation/', {
199-
'id': annid,
200-
}).success(function(data) {
201-
location.reload();
202-
}).fail(function(data) {
203-
alert('Failed to delete annotation!');
204-
});
232+
if (confirm("Are you sure you want to delete this annotation?")) {
233+
$.post("/ajax/deleteAnnotation/", {
234+
id: annid,
235+
})
236+
.success(function (data) {
237+
location.reload();
238+
})
239+
.fail(function (data) {
240+
alert("Failed to delete annotation!");
241+
});
205242
}
206243
}
207244

208245
function flagCommitted(committer) {
209-
$('#commitModal').modal();
210-
$('#committerSelect').val(committer);
211-
$('#doCommitButton').unbind('click');
212-
$('#doCommitButton').click(function() {
213-
var c = $('#committerSelect').val();
214-
if (!c) {
215-
alert('You need to select a committer before you can mark a patch as committed!');
216-
return;
217-
}
218-
document.location.href='close/committed/?c=' + c;
219-
});
220-
return false;
246+
$("#commitModal").modal();
247+
$("#committerSelect").val(committer);
248+
$("#doCommitButton").unbind("click");
249+
$("#doCommitButton").click(function () {
250+
var c = $("#committerSelect").val();
251+
if (!c) {
252+
alert(
253+
"You need to select a committer before you can mark a patch as committed!",
254+
);
255+
return;
256+
}
257+
document.location.href = "close/committed/?c=" + c;
258+
});
259+
return false;
221260
}
222261

223-
224262
function sortpatches(sortby) {
225-
if ($('#id_sortkey').val() == sortby) {
226-
$('#id_sortkey').val(0);
227-
} else {
228-
$('#id_sortkey').val(sortby);
229-
}
230-
$('#filterform').submit();
263+
if ($("#id_sortkey").val() == sortby) {
264+
$("#id_sortkey").val(0);
265+
} else {
266+
$("#id_sortkey").val(sortby);
267+
}
268+
$("#filterform").submit();
231269

232-
return false;
270+
return false;
233271
}
234272

235273
function toggleButtonCollapse(buttonId, collapseId) {
236-
$('#' + buttonId).button('toggle');
237-
$('#' + collapseId).toggleClass('in')
274+
$("#" + buttonId).button("toggle");
275+
$("#" + collapseId).toggleClass("in");
238276
}
239277

240278
function togglePatchFilterButton(buttonId, collapseId) {
241-
/* Figure out if we are collapsing it */
242-
if ($('#' + collapseId).hasClass('in')) {
243-
/* Go back to ourselves without a querystring to reset the form, unless it's already empty */
244-
if (document.location.href.indexOf('?') > -1) {
245-
document.location.href = '.';
246-
return;
247-
}
248-
}
279+
/* Figure out if we are collapsing it */
280+
if ($("#" + collapseId).hasClass("in")) {
281+
/* Go back to ourselves without a querystring to reset the form, unless it's already empty */
282+
if (document.location.href.indexOf("?") > -1) {
283+
document.location.href = ".";
284+
return;
285+
}
286+
}
249287

250-
toggleButtonCollapse(buttonId, collapseId);
288+
toggleButtonCollapse(buttonId, collapseId);
251289
}
252290

253-
254291
/*
255292
* Upstream user search dialog
256293
*/
257294
function search_and_store_user() {
258-
$('#doSelectUserButton').unbind('click');
259-
$('#doSelectUserButton').click(function() {
260-
if (!$('#searchUserList').val()) { return false; }
295+
$("#doSelectUserButton").unbind("click");
296+
$("#doSelectUserButton").click(function () {
297+
if (!$("#searchUserList").val()) {
298+
return false;
299+
}
261300

262-
/* Create this user locally */
263-
$.get('/ajax/importUser/', {
264-
'u': $('#searchUserList').val(),
265-
}).success(function(data) {
266-
if (data == 'OK') {
267-
alert('User imported!');
268-
$('#searchUserModal').modal('hide');
269-
} else {
270-
alert('Failed to import user: ' + data);
271-
}
272-
}).fail(function(data, statustxt) {
273-
alert('Failed to import user: ' + statustxt);
274-
});
301+
/* Create this user locally */
302+
$.get("/ajax/importUser/", {
303+
u: $("#searchUserList").val(),
304+
})
305+
.success(function (data) {
306+
if (data == "OK") {
307+
alert("User imported!");
308+
$("#searchUserModal").modal("hide");
309+
} else {
310+
alert("Failed to import user: " + data);
311+
}
312+
})
313+
.fail(function (data, statustxt) {
314+
alert("Failed to import user: " + statustxt);
315+
});
275316

276-
return false;
317+
return false;
277318
});
278319

279-
$('#searchUserModal').modal();
320+
$("#searchUserModal").modal();
280321
}
281322

282323
function findUsers() {
283-
if (!$('#searchUserSearchField').val()) {
284-
alert('No search term specified');
285-
return false;
324+
if (!$("#searchUserSearchField").val()) {
325+
alert("No search term specified");
326+
return false;
286327
}
287-
$('#searchUserListWrap').addClass('loading');
288-
$('#searchUserSearchButton').addClass('disabled');
289-
$.get('/ajax/searchUsers/', {
290-
's': $('#searchUserSearchField').val(),
291-
}).success(function(data) {
292-
sel = $('#searchUserList');
293-
sel.find('option').remove();
294-
$.each(data, function(i,u) {
295-
sel.append('<option value="' + u.u + '">' + u.u + ' (' + u.f + ' ' + u.l + ')</option>');
328+
$("#searchUserListWrap").addClass("loading");
329+
$("#searchUserSearchButton").addClass("disabled");
330+
$.get("/ajax/searchUsers/", {
331+
s: $("#searchUserSearchField").val(),
332+
})
333+
.success(function (data) {
334+
sel = $("#searchUserList");
335+
sel.find("option").remove();
336+
$.each(data, function (i, u) {
337+
sel.append(
338+
'<option value="' +
339+
u.u +
340+
'">' +
341+
u.u +
342+
" (" +
343+
u.f +
344+
" " +
345+
u.l +
346+
")</option>",
347+
);
348+
});
349+
})
350+
.always(function () {
351+
$("#searchUserListWrap").removeClass("loading");
352+
$("#searchUserSearchButton").removeClass("disabled");
353+
searchUserListChanged();
296354
});
297-
}).always(function() {
298-
$('#searchUserListWrap').removeClass('loading');
299-
$('#searchUserSearchButton').removeClass('disabled');
300-
searchUserListChanged();
301-
});
302-
return false;
355+
return false;
303356
}
304357

305358
function searchUserListChanged() {
306-
if ($('#searchUserList').val()) {
307-
$('#doSelectUserButton').removeClass('disabled');
308-
}
309-
else {
310-
$('#doSelectUserButton').addClass('disabled');
311-
}
359+
if ($("#searchUserList").val()) {
360+
$("#doSelectUserButton").removeClass("disabled");
361+
} else {
362+
$("#doSelectUserButton").addClass("disabled");
363+
}
312364
}
313365

314366
function addGitCheckoutToClipboard(patchId) {

0 commit comments

Comments
 (0)
Please sign in to comment.