-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.html
97 lines (94 loc) · 2.47 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>
BugHerd Projects
</title>
<link href="http://www.bugherd.com/content/new.css" rel="stylesheet" type="text/css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js" type="text/javascript">
</script>
<script type="text/javascript">
$(document).ready(function () {
$("#checking").show();
var url = "http://www.bugherd.com/project_list.json";
$.ajax({url:url,
dataType:"text",
success:function(data){
tempdata=data.replace(/http:\/\//gi,"").replace(/https:\/\//gi,"").replace(/file:\/\//gi,"");
localStorage["bh_projects"]= tempdata;
data = $.parseJSON(data);
chrome.browserAction.setIcon({path:"bugherd_16.png"});
for(var i=0;i<data.length;i++)
{
$("#loaded ul").append($("<li><a href='" + data[i]["url"] + "' target='_blank'>"+ data[i]["name"]+"</a></li>"));
}
$("#checking").hide();
$("#login_message").hide();
$("#loaded").show();
},
error:function(data){
chrome.browserAction.setIcon({path:"bugherd_error_16.png"});
$("#checking").hide();
$("#login_message").show();
$("#loaded").hide();
}
})
});
</script>
<style>
html{
overflow:visible;
}
body{
min-width:300px;
background:none;
font-size:12px;
margin:8px;
}
h3{
background:#333;
padding:2px 11px;
v-align:center;
}
h3 img{
float:right;
}
li{
list-style-type:none;
}
.popup_wrapper{
margin:12px;
}
a.help_link{
font-size:10px;
color:#888;
float:right;
}
</style>
</head>
<body>
<h3><img src="bugherd_48.png"><p>Projects</p></h3>
<div class="popup_wrapper">
<div id="checking">
checking...
</div>
<div id="login_message" style="display:none;">
<p>
You will need to log in to BugHerd.com to use this extension. <br/> <a href="http://www.bugherd.com/users/sign_in" target="_blank">sign in now</a>
</p>
</div>
<div id="loaded" style="display:none;">
<p>
Select a project and start logging bugs:
<ul></ul>
or <a href="http://www.bugherd.com/start" target="_blank">Create a new project</a>
</p>
</div>
<p>
<a href="http://support.bugherd.com" class="help_link" target="_blank"> Comments, suggestions, problems? </a>
</p>
</div>
</body>
</html>