Skip to content

Commit 5a719cb

Browse files
committed
added search function
A search function was added to the website, implemented as a simple redirect to Google.
1 parent e989329 commit 5a719cb

File tree

2 files changed

+55
-4
lines changed

2 files changed

+55
-4
lines changed

_includes/mathjax.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
<script type="text/javascript" charset="utf-8"
1616
src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS_CHTML">
1717
</script>
18+
<script
19+
src="https://cdn.jsdelivr.net/gh/dpvc/MathJax@issue2272/unpacked/MathJax.js?config=TeX-AMS_CHTML">
20+
</script>
1821
-->
19-
<script src="https://cdn.jsdelivr.net/gh/mathjax/MathJax@legacy-v2-develop/unpacked/MathJax.js?config=TeX-AMS_CHTML"></script>
20-
<!--
21-
<script src="https://cdn.jsdelivr.net/gh/dpvc/MathJax@issue2272/unpacked/MathJax.js?config=TeX-AMS_CHTML"></script>
22-
-->
22+
<script
23+
src="https://cdn.jsdelivr.net/gh/mathjax/MathJax@legacy-v2-develop/unpacked/MathJax.js?config=TeX-AMS_CHTML">
24+
</script>

search.html

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
permalink: /search
3+
layout: default
4+
---
5+
6+
<!-- Style -->
7+
<style type="text/css" media="screen">
8+
.container {
9+
text-align: center;
10+
}
11+
.list {
12+
text-align: left;
13+
}
14+
h1 {
15+
font-size: 4em;
16+
line-height: 1;
17+
letter-spacing: -1px;
18+
}
19+
form {
20+
text-align: center;
21+
}
22+
</style>
23+
24+
<!-- Script -->
25+
<script type="text/javascript">
26+
function openURL()
27+
{
28+
// get text box content
29+
var name = document.getElementById('TextBox').value;
30+
31+
// create Google search URL
32+
var url = 'https://www.google.com/search?q=site%3AStatProofBook.github.io+%22' + encodeURIComponent(name) + '%22';
33+
34+
// open Google search URL
35+
window.location.href = url;
36+
}
37+
</script>
38+
39+
<!-- Heading -->
40+
<div class="container">
41+
<h1>Search the StatProofBook</h1>
42+
</div>
43+
44+
<!-- Form -->
45+
<form name="Search">
46+
Search the StatProofBook: &ensp;
47+
<input type="text" maxlength="100" name="TextBox" id="TextBox"/>
48+
<input type="button" onclick="openURL()" value="Google Search"/>
49+
</form>

0 commit comments

Comments
 (0)