-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.html
58 lines (51 loc) · 2.22 KB
/
sample.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
<!DOCTYPE html>
<html>
<head>
<title>Buggerall Simple Sample</title>
<script src="support/date.js"></script>
<script src="support/time.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="buggerall.js"></script>
<script>
$(function() {
console.log("Starting query");
// CHANGE THE QUERY BELOW
// if you would like to see different results.
var queryString = "product=Firefox&component=Developer%20Tools&whiteboard=[minotaur]";
$('#query').html(queryString);
var query = new buggerall.Query({
query: queryString,
fields: "id,creation_time,attachments,history",
computeLastCommentTime: true
});
query.run(function(query) {
console.log("Result has arrived");
var result = "<table><thead><th>bug</th><th>event type</th><th>timestamp</th><th>details</th></thead><tbody>";
var timeline = query.timeline();
timeline.events.forEach(function(event) {
result += "<tr><td><a href=\"" + query.viewURL + event.bugId + "\">" + event.bugId + "</a></td><td>" + event.type + "</td><td>" + event.when + "</td><td>" + event.detail + "</td></tr>";
});
result += "</tbody></table>";
console.log("Updating display");
$("#result").html(result);
$("#loading").hide();
});
});
</script>
</head>
<body>
<h1>Buggerall Sample</h1>
<div id="loading" style="font-size: 200%; font-weight: bold;">
Running a live query against bugzilla.mozilla.org
</div>
<div>
This query, which may not always produce useful results, is searching for a specific
set of bugs in Bugzilla. Change the query in the JavaScript above to see different
results.
</div>
<div id="query">
</div>
<div id="result">
</div>
</body>
</html>