- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
44 lines (37 loc) · 1.75 KB
/
index.html
File metadata and controls
44 lines (37 loc) · 1.75 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
<!DOCTYPE html>
<html>
<head>
<title>Video Database For C++ Weekly</title>
<link href="https://unpkg.com/tabulator-tables@4.7.2/dist/css/tabulator.min.css" rel="stylesheet">
<script src="https://unpkg.com/tabulator-tables@4.7.2/dist/js/tabulator.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
</head>
<body>
<div id="example-table"></div>
</body>
<script>
var YouTubeURL = function(value, data, type, params, component){
//value - original value of the cell
//data - the data for the row
//type - the type of mutation occurring (data|edit)
//params - the mutatorParams object from the column definition
//component - when the "type" argument is "edit", this contains the cell component for the edited cell, otherwise it is the column component for the column
return "https://youtu.be/" + value;
}
var table = new Tabulator("#example-table", {
columns:[
{title:"Title", field:"Video", formatter:"link", formatterParams:{labelField:"Title", urlPrefix:"https://youtu.be/"} },
{title:"Video ID", field:"Video"},
{title:"Date Published", field:"Date"},
{title:"Tags", field:"Tags"},
{title:"CE Links", field:"CompilerExplorer", formatter:"link"},
{title:"Quick-Bench", field:"QuickBench", formatter:"link"},
{title:"GitHub", field:"GitHub", formatter:"link"},
{title:"Documentation", field:"Documentation", formatter:"link"},
],
});
$.getJSON("assets/videos.json", function(json) {
table.setData(json);
});
</script>
</html>