-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathresults.html
More file actions
60 lines (60 loc) · 2.21 KB
/
results.html
File metadata and controls
60 lines (60 loc) · 2.21 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
59
60
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="row" id="postlinkscheck">
<div id="results" class="card">
<center>
<h2><span class="badge audio"><i class="fa-solid fa-magnifying-glass"></i></span> <span id="title" class="title"> </span></h2>
<span id="hint"></span>
<p id="here"></p>
<script>
function createTable(tableData) {
var table = document.createElement('table');
table.classList.add("thintable");
table.setAttribute("id", "resultstable");
var tableBody = document.createElement('tbody');
tableData.forEach(function(rowData) {
var row = document.createElement('tr');
rowData.forEach(function(cellData) {
var cell = document.createElement('td');
cell.appendChild(document.createTextNode(cellData));
row.appendChild(cell);
});
tableBody.appendChild(row);
});
table.appendChild(tableBody);
here.appendChild(table);
}
createTable(lookupWords);
//bold titles
for(i = 0; i < 4; i++){
let titles = resultstable.rows[0].getElementsByTagName("TD")[i].innerHTML;
resultstable.rows[0].getElementsByTagName("TD")[i].innerHTML = '<b>'+titles+'<b>';
}
for(i = 1; i < resultstable.rows.length; i++){
//get contents of cell
let goodLink = resultstable.rows[i].getElementsByTagName("TD")[0].innerHTML;
//replace with hyperlink
resultstable.rows[i].getElementsByTagName("TD")[3].innerHTML = '<a href="https://defaultdnb.github.io/ReCollect64/blog.html'+goodLink+'" target="_blank"> HERE </a>' ;
}
title.innerHTML = resultstable.rows.length-1 + ' RESULTS FOR "' + keyword.toUpperCase()+'"';
if (resultstable.rows.length == 1){
hint.innerHTML = "HINT: Try single words & be specific"
} else {
hint.innerHTML = "";
}
</script>
<div style="width: fit-content;">
<div id="ctrl1">
<div id="again" onclick="keywordSearch();" title="𝗖𝗟𝗜𝗖𝗞 𝗧𝗢 𝗦𝗘𝗔𝗥𝗖𝗛 𝗔𝗚𝗔𝗜𝗡" class="badge search"><i class="fa-solid fa-magnifying-glass"></i> SEARCH AGAIN </div>
<p></p>
<div id="home" onclick="$(function(){$('#content-placeholder').load('postLinks.html');}); gototop();" title="𝗖𝗟𝗜𝗖𝗞 𝗧𝗢 𝗚𝗢 𝗛𝗢𝗠𝗘" class="badge controls"><i class="fa-solid fa-house"></i> BACK TO HOME</div>
</div>
</div>
</center>
</div>
</div>
</body>
</html>