-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtable_ids.html
145 lines (135 loc) · 3.89 KB
/
table_ids.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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1">
<meta charset="utf-8">
<title>id-gulka</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
margin: 0;
width: auto;
flex: auto;
font-family: Arial, Helvetica, sans-serif;
}
.topnav {
overflow: hidden;
background-color: #333;
}
.topnav a {
float: left;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.topnav a:hover {
background-color: #ddd;
color: black;
}
.topnav a.active {
background-color: #4CAF50;
color: white;
}
header {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 88px;
z-index: 10;
background: #eeeeee;
-webkit-box-shadow: 0 7px 8px rgba(0, 0, 0, 0.12);
-moz-box-shadow: 0 7px 8px rgba(0, 0, 0, 0.12);
box-shadow: 0 7px 8px rgba(0, 0, 0, 0.12);
}
.base_dataTable {
margin-top: 90px;
}
</style>
<link rel="stylesheet" href="https://cdn.datatables.net/2.0.8/css/dataTables.dataTables.css" />
</head>
<body>
<header>
<div class="topnav text-white">
<button type="button" class="btn btn-primary btn-lg" id="relsi" data-bs-toggle="button" autocomplete="off">Base SI</button>
<button type="button" class="btn btn-secondary btn-lg" id="relorig" data-bs-toggle="button" autocomplete="off">Original</button>
<div class="form-group">
<input type="text" class="form-control" id="search" placeholder="Поиск по таблице">
</div>
</div>
</header>
<div class="base_dataTable">
<table id="display_json_data" class="table table-bordered table-striped table-vcenter dataTable no-footer">
<thead>
<tr>
<th>Photo</th>
<th>ID</th>
<th>Name</th>
<th>Discription</th>
</tr>
</thead>
<tbody id="dataTable"></tbody>
</table>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script>
$(document).ready(function ()
{
$('#relsi').click(
function ()
{
Reload('https://mrgulka.github.io/2612257810.json')
});
$("#relorig").click(
function ()
{
Reload('https://mrgulka.github.io/1664827613.json')
}
)
});
function Reload(path)
{
$.getJSON(path, function (data)
{
var allRecordsHTML = '';
for (var i = 0; i < data.length; i++) {
if (data[i].Type == "Object"
|| data[i].Type == "Vehicle"
|| data[i].Type == "Effect"
|| data[i].Type == "Large"
|| data[i].Type == "Medium"
|| data[i].Type == "Decal") continue;
allRecordsHTML += '<tr>';
allRecordsHTML += '<td>' + '<img height="50" class="image" src="https://mrgulka.github.io/images/' + data[i].ID + '.png" oneerror=\'this.style.display = "none"\' alt=" "/>' + '</td>';
allRecordsHTML += '<td>' + data[i].ID + '</td>';
allRecordsHTML += '<td>' + data[i].Name + '</td>';
allRecordsHTML += '<td>' + data[i].Description + '</td>';
allRecordsHTML += '</tr>';
}
var table = document.getElementById("dataTable");
table.innerHTML = allRecordsHTML;
})
};
</script>
<script>
$(document).ready(function ()
{
$("#search").keyup(function ()
{
_this = this;
$.each($("#display_json_data tbody tr"), function ()
{
if ($(this).text().toLowerCase().indexOf($(_this).val().toLowerCase()) === -1) {
$(this).hide();
}
else {
$(this).show();
}
});
});
});
</script>
</body>
</html>