-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
136 lines (111 loc) · 5.21 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
<!DOCTYPE HTML>
<!--
Eventually by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<title>Galactic Mapping Project</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="assets/css/main.css" />
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="pretty-print-json.js"></script>
<link href="css/pretty-print-json.css" type="text/css" rel="stylesheet" />
<link href="https://unpkg.com/tabulator-tables@4.3.0/dist/css/tabulator_midnight.min.css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@4.3.0/dist/js/tabulator.min.js"></script>
</head>
<body class="is-preload">
<!-- Header -->
<header id="header">
<h1>Galactic Mapping Project</h1>
<p>Search The Galactic Mapping Project</p>
</header>
<!-- Signup Form -->
<script>
/**
* Get the URL parameters
* source: https://css-tricks.com/snippets/javascript/get-url-variables/
* @param {String} url The URL
* @return {Object} The URL parameters
*/
$( document ).ready(function() {
doDisplay();
});
function updateEntries(json){
console.log(json);
var table = new Tabulator("#entries-table", {
data:json, //load row data from array
layout:"fitDataTable", //fit columns to width of table
responsiveLayout:"hide", //hide columns that dont fit on the table
tooltips:true, //show tool tips on cells
addRowPos:"top", //when adding a new row, add it to the top of the table
pagination:"local", //paginate the data
paginationSize:50, //allow 7 rows per page of data
movableColumns:true, //allow column order to be changed
resizableRows:true, //allow row order to be changed
columns:[ //define the table columns
{title:"System", field:"galMapSearch", headerFilter:true,
formatter:"link", formatterParams:{
labelField:"galMapSearch",
urlField: "galMapUrl",
//urlPrefix:"https://www.edsm.net/en/system?systemName=",
target:"_blank",
},
width: "10%"
},
{title:"Name", field:"name", headerFilter:true, width: "10%"},
{title:"Type", field:"type", headerFilter:"input", width: "10%"},
{title:"description", field:"descriptionHtml", headerFilter:true,width: "70%",
formatter:function(cell, formatterParams, onRendered){
//cell - the cell component
//formatterParams - parameters set for the column
//onRendered - function to call when the formatter has been rendered
return '<div style="word-wrap: break-word; white-space: normal;">' + cell.getValue() + '</div>'; //return the contents of the cell;
}
},
],
});
}
function doDisplay(){
getSignalEntries()
}
function getSignalEntries() {
$("#result").text("Searching");
// Assuming your JSON file is hosted at 'data/signal_entries.json'
fetch('json-edd.json')
.then(response => response.json())
.then(json => updateEntries(json))
.catch(error => console.error('Error loading JSON:', error));
}
function submitform(){
var data = $(this).serializeArray();
doDecode($('input:text').val(),$("#data").val());
return false;
};
</script>
<div id="entries-table"> </div>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
</P>
</div><!-- /.container -->
<!-- Footer -->
<footer id="footer">
<ul class="icons">
<li><a href="http://twitter.com/CanonnResearch" class="icon brands fa-twitter"><span class="label">Twitter</span></a></li>
<li><a href="https://github.com/canonn-science/Aurvandil/blob/master/README.md" class="icon brands fa-github"><span class="label">GitHub</span></a></li>
</ul>
<ul class="copyright">
<li>© Canonn Interstellar Research.</li><li>Credits: <a href="http://html5up.net">HTML5 UP</a></li>
</ul>
</footer>
<!-- Scripts -->
<script src="assets/js/main.js"></script>
</body>
</html>