Skip to content

Commit 9f481e5

Browse files
committed
edited search function
The search function was moved to the index page for test purposes.
1 parent 5a719cb commit 9f481e5

File tree

2 files changed

+40
-5
lines changed

2 files changed

+40
-5
lines changed

index.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,38 @@ layout: page
66
title: "The Book of Statistical Proofs"
77
---
88

9+
<!-- Style -->
10+
<style type="text/css" media="screen">
11+
.container {
12+
text-align: center;
13+
}
14+
.list {
15+
text-align: left;
16+
}
17+
h1 {
18+
font-size: 4em;
19+
line-height: 1;
20+
letter-spacing: -1px;
21+
}
22+
form {
23+
text-align: center;
24+
}
25+
</style>
26+
27+
<!-- Script -->
28+
<script type="text/javascript">
29+
function openURL()
30+
{
31+
// get text box content
32+
var name = document.getElementById('q').value;
33+
34+
// create Google search URL
35+
var url = 'https://www.google.com/search?q=site%3AStatProofBook.github.io+%22' + encodeURIComponent(name) + '%22';
36+
37+
// open Google search URL
38+
window.location.href = url;
39+
}
40+
</script>
941

1042
Welcome to **The Book of Statistical Proofs** -- <br>
1143
*a centralized, open and collaboratively edited archive <br>
@@ -32,8 +64,11 @@ of statistical theorems for the computational sciences*! <br>
3264
</table>
3365

3466
<div align="center">
35-
You can also <a href="https://github.com/StatProofBook/StatProofBookTools/blob/master/write_book/StatProofBook.pdf">view</a> or <a href="https://github.com/StatProofBook/StatProofBookTools/raw/master/write_book/StatProofBook.pdf">download</a> the entire book as a single PDF.
67+
You can also <a href="https://github.com/StatProofBook/StatProofBookTools/blob/master/write_book/StatProofBook.pdf">view</a> or <a href="https://github.com/StatProofBook/StatProofBookTools/raw/master/write_book/StatProofBook.pdf">download</a> the entire book as a single PDF
3668
</div>
3769

38-
[//]: # (- [Proof by Author](I/Proof_by_Author) -- sorted by contributor)
39-
[//]: # (- [Definition by Author](I/Definition_by_Author) -- sorted by contributor)
70+
<form name="Search">
71+
or enter any search term: &ensp;
72+
<input type="text" maxlength="100" name="q" id="q"/>
73+
<input type="button" onclick="openURL()" value="Google Search"/>
74+
</form>

search.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
function openURL()
2727
{
2828
// get text box content
29-
var name = document.getElementById('TextBox').value;
29+
var name = document.getElementById('q').value;
3030

3131
// create Google search URL
3232
var url = 'https://www.google.com/search?q=site%3AStatProofBook.github.io+%22' + encodeURIComponent(name) + '%22';
@@ -44,6 +44,6 @@ <h1>Search the StatProofBook</h1>
4444
<!-- Form -->
4545
<form name="Search">
4646
Search the StatProofBook: &ensp;
47-
<input type="text" maxlength="100" name="TextBox" id="TextBox"/>
47+
<input type="text" maxlength="100" name="q" id="q"/>
4848
<input type="button" onclick="openURL()" value="Google Search"/>
4949
</form>

0 commit comments

Comments
 (0)