Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bar-tender committed Dec 7, 2023
1 parent a9d7d20 commit 78e9622
Showing 1 changed file with 49 additions and 49 deletions.
98 changes: 49 additions & 49 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

<style>
.container {
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-20%) translateY(-50%);
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-20%) translateY(-50%);
}
body {
background-image: url('AskJerry.png');
Expand All @@ -21,7 +21,7 @@
<div id="dropdowns">

</div>
<button onclick="myFunction()">Search</button>
<button onclick="doQuery()">Search</button>
</div>

<p id="demo"></p>
Expand All @@ -30,74 +30,74 @@

// TODO: add GH-issues, add mailing lists
var projects = [
["Chipyard",
"chipyard.readthedocs.io", ["latest", "stable", "1.10.0", "1.9.1", "1.9.0", "1.8.1", "1.8.0", "1.7.1", "1.7.0", "1.6.2", "1.6.1", "1.6.0", "1.5.0", "1.4.0", "1.3.0", "1.2.0", "1.1.0", "1.0.0", "main"]
],
["FireSim",
"docs.fires.im", ["latest", "stable", "1.17.1", "1.17.0", "1.16.0", "1.15.2", "1.15.1", "1.15.0", "1.14.2", "1.14.1", "1.14.0", "1.13.6", "1.13.5", "1.13.4", "1.13.3", "1.13.2", "1.13.1", "1.13.0", "1.12.0", "1.11.0", "1.10.1", "1.10.0", "1.9.0", "1.8.0", "1.7.0", "1.6.0", "1.5.0", "1.4.0", "1.3.2", "1.3.1", "1.3.0", "1.2", "1.1", "williamlyh", "main"]
],
["FireMarshal",
"firemarshal.readthedocs.io", ["latest", "stable", "v1.12.1", "v1.12.0", "v1.11.0", "v1.10.0"]
],
["BOOM",
"docs.boom-core.org", ["latest", "stable"]
],
["Hammer",
"hammer-vlsi.readthedocs.io", ["latest", "stable", "1.2.0", "1.1.2", "1.1.1", "1.1.0", "1.0.4", "1.0.1", "1.0.0", "0.1.0"]
]
[
"Chipyard",
"chipyard.readthedocs.io",
["latest", "stable", "1.10.0", "1.9.1", "1.9.0", "1.8.1", "1.8.0", "1.7.1", "1.7.0", "1.6.2", "1.6.1", "1.6.0", "1.5.0", "1.4.0", "1.3.0", "1.2.0", "1.1.0", "1.0.0", "main"]
],
[
"FireSim",
"docs.fires.im",
["latest", "stable", "1.17.1", "1.17.0", "1.16.0", "1.15.2", "1.15.1", "1.15.0", "1.14.2", "1.14.1", "1.14.0", "1.13.6", "1.13.5", "1.13.4", "1.13.3", "1.13.2", "1.13.1", "1.13.0", "1.12.0", "1.11.0", "1.10.1", "1.10.0", "1.9.0", "1.8.0", "1.7.0", "1.6.0", "1.5.0", "1.4.0", "1.3.2", "1.3.1", "1.3.0", "1.2", "1.1", "williamlyh", "main"]
],
[
"FireMarshal",
"firemarshal.readthedocs.io",
["latest", "stable", "v1.12.1", "v1.12.0", "v1.11.0", "v1.10.0"]
],
[
"BOOM",
"docs.boom-core.org",
["latest", "stable"]
],
[
"Hammer",
"hammer-vlsi.readthedocs.io",
["latest", "stable", "1.2.0", "1.1.2", "1.1.1", "1.1.0", "1.0.4", "1.0.1", "1.0.0", "0.1.0"]
]
];

for (var i = 0; i < projects.length; i++) {
var drop_name = projects[i][0];
dropdown_contents = drop_name + ' <select name="' + drop_name + '" id="' + drop_name +'" >';

drop_name = projects[i][0]
dropdown_contents = drop_name + ' <select name="' + drop_name + '" id="' + drop_name +'" >';

for (var j = 0; j < projects[i][2].length; j++) {
dropdown_contents += "\n";
var temp_val = projects[i][2][j];
dropdown_contents += '<option value="' + temp_val + '">' + temp_val + '</option>';

}

dropdown_contents += "</select> <br>";

document.getElementById("dropdowns").innerHTML += dropdown_contents;
for (var j = 0; j < projects[i][2].length; j++) {
dropdown_contents += "\n";
var temp_val = projects[i][2][j];
dropdown_contents += '<option value="' + temp_val + '">' + temp_val + '</option>';
}

dropdown_contents += "</select> <br>";
document.getElementById("dropdowns").innerHTML += dropdown_contents;
}


function myFunction() {
function doQuery() {
var querystring = document.getElementById("searchbox").value + " (";


for (var i = 0; i < projects.length; i++) {
version_num = document.getElementById(projects[i][0]).value;
url_part = projects[i][1];
querystring += "site:" + url_part + "/en/" + version_num;
version_num = document.getElementById(projects[i][0]).value;
url_part = projects[i][1];
querystring += "site:" + url_part + "/en/" + version_num;

if (i != projects.length-1) {
querystring += " OR ";
}
if (i != projects.length-1) {
querystring += " OR ";
}
}


// SPACE IS IMPORTANT
querystring += " )"


var googlequery = "https://www.google.com/search?q=";

googlequery += encodeURIComponent(querystring);


window.location.href = googlequery;
}

var wage = document.getElementById("searchbox");
wage.addEventListener("keydown", function (e) {
if (e.code === "Enter") { //checks whether the pressed key is "Enter"
myFunction();
}
if (e.code === "Enter") { //checks whether the pressed key is "Enter"
doQuery();
}
});

</script>
Expand Down

0 comments on commit 78e9622

Please sign in to comment.