From e6300e4f6cfb92482fe3f2a839d7c9dd58e5dc88 Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Sun, 29 Jun 2014 21:30:14 -0400
Subject: [PATCH] Add search function to the API docs.
* Uses Google site search.
* CSS taken from the User Guide Translator's CSS.
---
docs/user/book.css | 13 ++++++++++++-
docs/user/header.html | 6 +++++-
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/docs/user/book.css b/docs/user/book.css
index fd8a8f4..a785f5b 100644
a
|
b
|
h4 a:hover, a:active, h5 a:hover, a:active, h6 a:hover, a:active {
|
141 | 141 | |
142 | 142 | #banner span.subtitle { |
143 | 143 | position: relative; |
144 | | top: 54px; |
| 144 | top: 30px; |
145 | 145 | left: 272px; |
146 | 146 | color: #333333; /* mine shaft */ |
147 | 147 | text-transform: uppercase; |
… |
… |
h4 a:hover, a:active, h5 a:hover, a:active, h6 a:hover, a:active {
|
150 | 150 | font-weight: normal; |
151 | 151 | } |
152 | 152 | |
| 153 | input[type=text], input[type=password] { |
| 154 | font-size: inherit; |
| 155 | border-top: 1px solid #818181; |
| 156 | border-left: 1px solid #818181; |
| 157 | border-bottom: 1px solid #858585; |
| 158 | border-right: 1px solid #858585; |
| 159 | margin-top: 3px; |
| 160 | padding: 2px; |
| 161 | width: 200px; |
| 162 | } |
| 163 | |
153 | 164 | div.header { |
154 | 165 | margin-top: 20px; |
155 | 166 | margin: 10px auto; |
diff --git a/docs/user/header.html b/docs/user/header.html
index 277802f..99cfc72 100644
a
|
b
|
|
4 | 4 | <meta http-equiv="Content-Type" content="text/html;charset=UTF8"> |
5 | 5 | <title>$title</title> |
6 | 6 | <link href="book.css" rel="stylesheet" type="text/css"> |
| 7 | <script type="text/javascript">function search(n,e){if(e.keyCode==13)window.location.href='https://www.google.com/search?q='+encodeURIComponent('site:api.haiku-os.org '+n.value);}</script> |
7 | 8 | </head> |
8 | 9 | <body> |
9 | 10 | <div id="banner"> |
10 | 11 | <div class="logo"> |
11 | | <span class="subtitle">API Documentation</span> |
| 12 | <span class="subtitle"> |
| 13 | API Documentation<br> |
| 14 | <input type="text" placeholder="Search" onkeydown="search(this,event);"> |
| 15 | </span> |
12 | 16 | </div> |
13 | 17 | </div> |