Ticket #10868: 0001-Add-search-function-to-the-API-docs.patch

File 0001-Add-search-function-to-the-API-docs.patch, 2.0 KB (added by waddlesplash, 10 years ago)

Patch, v3.

  • docs/user/book.css

    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 {  
    141141
    142142#banner span.subtitle {
    143143    position: relative;
    144     top: 54px;
     144    top: 30px;
    145145    left: 272px;
    146146    color: #333333; /* mine shaft */
    147147    text-transform: uppercase;
    h4 a:hover, a:active, h5 a:hover, a:active, h6 a:hover, a:active {  
    150150    font-weight: normal;
    151151}
    152152
     153input[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
    153164div.header {
    154165    margin-top: 20px;
    155166    margin: 10px auto;
  • docs/user/header.html

    diff --git a/docs/user/header.html b/docs/user/header.html
    index 277802f..99cfc72 100644
    a b  
    44    <meta http-equiv="Content-Type" content="text/html;charset=UTF8">
    55    <title>$title</title>
    66    <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>
    78</head>
    89<body>
    910    <div id="banner">
    1011        <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>
    1216        </div>
    1317    </div>