-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcable.html
More file actions
58 lines (57 loc) · 1.81 KB
/
cable.html
File metadata and controls
58 lines (57 loc) · 1.81 KB
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 lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Cable Channels</title>
<!-- CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="input-group" style="margin: 1em 0;">
<!--<span class="input-group-addon">Filter</span>-->
<input id="filter" type="text" class="form-control" placeholder="Search...">
</div>
<div class="table-responsive">
<table class="table table-striped table-condensed">
<colgroup>
<col style="width: 50%;"/>
<col style="width: 25%;"/>
<col style="width: 25%;"/>
</colgroup>
<thead>
<tr>
<th>Network</th>
<th>Channel</th>
<th>Channel (HD)</th>
</tr>
</thead>
<tbody class="searchable">
</tbody>
</table>
</div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(function() {
$.getJSON('channels.json', function(channels) {
$('.table tbody').append($.map(channels, function(c) {
return $('<tr>')
.append($('<td>').text(c.Network))
.append($('<td>').text(c.Channel))
.append($('<td>').text(c.ChannelHD));
}));
});
$('#filter').keyup(function () {
var rex = new RegExp($(this).val(), 'i');
$('.searchable tr').hide();
$('.searchable tr').filter(function () {
return rex.test($(this).text());
}).show();
});
});
</script>
</body>
</html>