-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtcp.html
108 lines (90 loc) · 2.69 KB
/
tcp.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
<html>
<head>
<title>TCP texts</title>
<!-- DataTables CSS -->
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css">
<style type="text/css">
td { vertical-align: top }
tfoot {
display: table-header-group;
}
</style>
<!-- jQuery -->
<script type="text/javascript" charset="utf8" src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<!-- DataTables -->
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.4/js/jquery.dataTables.js"></script>
<script type="text/javascript" class="init">
$(document).ready(function() {
$('#tcpcat tfoot th').each( function () {
var title = $('#tcpcat tfoot th').eq( $(this).index() ).text();
$(this).html( '<input type="text" placeholder="Search '+title+'">' );
} );
var table = $('#tcpcat').DataTable( {
"processing": true,
"serverSide": true,
"ajax": "/scripts/server_processing.php",
"columnDefs": [
{
"targets": [ 2 ],
"render": function ( data, type, row ) {
if ( data == 1 ) { return 'Free' } else { return 'Restricted' };
}
},
{
"targets": [ 3 ],
"visible": false
},
{
"targets": [ 5 ],
"render": function ( data, type, row ) {
return data + ' (<i>' + row[3] + '</i>)';
}
},
{
"targets": [ 0 ],
"render": function ( data, type, row ) {
$links = '<a href="http://www.ota.ox.ac.uk/text/'+data+'.html">HTML</a>; <a href="http://www.ota.ox.ac.uk/text/'+data+'.epub">ePub</a>';
if (row[2] == '1') { $links += '; <a href="http://www.ota.ox.ac.uk/text/'+data+'.xml">source</a>'} ;
return $links;
}
}
]
} );
table.columns().eq( 0 ).each( function ( colIdx ) {
$( 'input', table.column( colIdx ).footer() ).on( 'keyup change', function () {
table
.column( colIdx )
.search( this.value )
.draw();
} );
} );
} );
</script>
</head>
<body>
<table id="tcpcat" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>TCP</th>
<th>ID</th>
<th>Avail</th>
<th>Author</th>
<th>Date</th>
<th>Title</th>
<th>Pages</th>
</tr>
</thead>
<tfoot>
<tr>
<th>TCP</th>
<th>ID</th>
<th>Avail</th>
<th>Author</th>
<th>Date</th>
<th>Title</th>
<th>Pages</th>
</tr>
</tfoot>
</table>
</body>
</html>