forked from psd/pivotal-cards
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
109 lines (104 loc) · 3.7 KB
/
test.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div class="test-pane">
<div id="epics_itemList_epic123456780" class="item"></div>
<div id="current_itemList_story123456781" class="item"></div>
<div id="current_itemList_story123456782" class="item"></div>
<div id="current_itemList_story123456783" class="item"></div>
<div id="current_itemList_story123456784" class="item"></div>
<div id="current_itemList_story123456785" class="item"></div>
<div id="current_itemList_story123456786" class="item"></div>
</div>
</body>
<script src="jquery.js"></script>
<script src="underscore.js"></script>
<script>
/*
* stub pivitol code
*/
app = {
project: {
getName: function () {
return "My Project Name";
},
getEpicById: function (id) {
return {
"123456780": {
getName: function () { return "Build code, fight dragons" },
getLabels: function () { return [] },
getTasks: function () { return []; }
}
}[id];
},
getEpicByLabel: function (label) {
return label === "Build code, fight dragons";
},
getStoryById: function (id) {
return {
"123456781": {
"_storyType": { "_name": "feature" },
getName: function() { return "Write code and stuff" },
"_description": "As the Project Owner I would like the developers to write some code so I can run the code.",
"_epic_name": "Build code, fight dragons",
getLabels: function () { return ["one", "two", "three", "Build code, fight dragons"]; },
getTasks: function () { return [ { _complete: true, _description: "first task" }, { _complete: false, _description: "this is the second task" } ] },
getOwnedBy: function () { return { displayName: "Joe Bloggs" }; },
getEstimate: function () { return 8 }
},
"123456782": {
"_storyType": { "_name": "bug" },
getName: function() { return "The code doesn't do the expected stuff" },
"_description": "I ran the code and discovered that the code doesn't do the expected stuff. Can we have a fix, please?.",
getLabels: function () { return ["one", "two", "three"]; },
getTasks: function () { return []; },
getOwnedBy: function () { return { displayName: "Joe Bloggs" }; },
getRequestedBy: function () { return { displayName: "Anne Other" }; },
getEstimate: function () { return -1 }
},
"123456783": {
"_storyType": { "_name": "release" },
getName: function() { return "Release the stuff" },
"_description": "The stuff needs releasing.",
getLabels: function () { return ["one", "two", "three"]; },
getTasks: function () { return []; }
},
"123456784": {
"_storyType": { "_name": "chore" },
getName: function() { return "Wrangle stuff for the expected stuff" },
"_description": "The stuff needs wrangling.",
getLabels: function () { return ["one", "two", "three"]; },
getTasks: function () { return []; }
},
/* a chore ending in a question mark is a spike */
"123456785": {
"_storyType": { "_name": "chore" },
getName: function() { return "What do we need to wrangle for the stuff & ting?" },
"_description": "Spike to work out what stuff needs wrangling.",
getLabels: function () { return ["one", "two", "three"]; },
getTasks: function () { return []; }
},
"123456786": {
"_storyType": { "_name": "chore" },
getName: function() { return "An odd card to test an odd number of cards" },
"_description": "Spike to work out what stuff needs wrangling.",
getLabels: function () { return ["one", "two", "three"]; },
getTasks: function () { return []; }
}
}[id];
}
},
};
/*
* load and run bookmarklet
*/
(function($){
$(function () {
$.getScript('test-bookmarklet');
});
}(jQuery));
</script>
</html>