-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
150 lines (144 loc) · 4.04 KB
/
index.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
<html>
<head>
<title>Backbone.js MVC - Demo</title>
<style>
table {
width: 25%;
border: 1px solid black;
}
table tr:nth-child(odd) {
background-color: #ccc;
}
table th, table td {
padding: 5px;
}
table td:nth-child(2) {
text-align: right;
}
#site-count.error {
background-color: #fcc;
}
#error {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.5);
z-index: 10000;
text-align: center;
padding-top: 50px;
color: #f66;
}
</style>
</head>
<body>
<h1>Backbone.js MVC - Demo</h1>
<div id="controls">
<button id="add-one" class="adding">Add One</button>
<button id="add-some" class="adding">Add Some</button>
<button id="remove-last" class="removing">Remove Last</button>
<button id="clear-all" class="removing">Clear All</button>
<button id="fake-error">Fake Error</button>
<img src="spinner.gif" style="display: none;">
</div>
<div id="site-summary">
</div>
<div id="site-list">
<h2>Site List</h2>
<ul>
</ul>
</div>
<div id="site-details" style="display: none;">
</div>
<div id="error" style="display: none;">
<div>
</div>
<button>OK</button>
</div>
<script src="jquery-1.7.2.min.js"></script>
<script src="underscore-min.js"></script>
<script src="backbone-min.js"></script>
<script src="backbone-demo.js"></script>
<!-- Templates -->
<script type="text/template" id="site-template">
<li>
<a class="link" site_id='<%= site_id %>' href='#'><%= site_name %></a>
</li>
</script>
<script type="text/template" id="summary-template">
<h2>Site Summary</h2>
<table>
<tr>
<th>
Stat
</th>
<th>
Value
</th>
</tr>
<tr>
<td>
Count
</td>
<td id="site-count">
<%= site_count %>
</td>
</tr>
<tr>
<td>
Longest Name
</td>
<td id="longest-name">
<%= longest_name %>
</td>
</tr>
<tr>
<td>
Longest Url
</td>
<td id="longest-url">
<%= longest_url %>
</td>
</tr>
</table>
</script>
<script type="text/template" id="details-template">
<h2>Site Details</h2>
<table>
<tr>
<th>
Field
</th>
<th>
Value
</th>
</tr>
<tr>
<td>
Name
</td>
<td id="site-name">
<%= site_name %>
</td>
</tr>
<tr>
<td>
URL
</td>
<td id="site-url">
<%= site_url %>
</td>
</tr>
<tr>
<td>
Visits
</td>
<td id="site-visits">
<%= site_visits %>
</td>
</tr>
</table>
</script>
</body>
</html>