]> git.lizzy.rs Git - rust.git/commitdiff
(doc) Properly doc hotkeys in generated docs.
authorZach Pomerantz <zmp@umich.edu>
Wed, 18 Jun 2014 18:25:04 +0000 (11:25 -0700)
committerzzmp <zmp@umich.edu>
Thu, 19 Jun 2014 16:56:59 +0000 (09:56 -0700)
Updated search bar to match help text.
Used correct, normalized hotkeys in search.
Updated shortcut menu with working shortcuts (tabs).
Changed height of search help.

src/librustdoc/html/layout.rs
src/librustdoc/html/static/main.css
src/librustdoc/html/static/main.js

index 0304a1d690ef5ef620a9b7842073fad19cc722d5..61a2d3c5d9cc890d0a17e95ee3f7d2a8e2c0719f 100644 (file)
@@ -63,7 +63,7 @@ pub fn render<T: fmt::Show, S: fmt::Show>(
             <div class="search-container">
                 <input class="search-input" name="search"
                        autocomplete="off"
-                       placeholder="Click or press 's' to search, '?' for more options..."
+                       placeholder="Click or press 'S' to search, '?' for more options..."
                        type="search">
             </div>
         </form>
@@ -82,9 +82,9 @@ pub fn render<T: fmt::Show, S: fmt::Show>(
                 <dd>Show this help dialog</dd>
                 <dt>S</dt>
                 <dd>Focus the search field</dd>
-                <dt>&uarr;</dt>
+                <dt>&larrb;</dt>
                 <dd>Move up in search results</dd>
-                <dt>&darr;</dt>
+                <dt>&rarrb;</dt>
                 <dd>Move down in search results</dd>
                 <dt>&#9166;</dt>
                 <dd>Go to active search result</dd>
index a7bd082ec17d39d63235c4c5ab6ce34627c9cd04..a88992f6c4c508344f3ebac359ff0bdfb0f69072 100644 (file)
@@ -347,7 +347,7 @@ p a:hover { text-decoration: underline; }
     margin-top: -125px;
     margin-left: -275px;
     width: 550px;
-    height: 250px;
+    height: 300px;
     border: 1px solid #bfbfbf;
 }
 
index 697199e9abf5a34fca3ca8bcb964cb526c31b4f6..fc1e480f6afcf0731bad841f2a9e459e65a6d564 100644 (file)
             return;
         }
 
-        if (e.keyCode === 188 && $('#help').hasClass('hidden')) { // question mark
+        if (e.which === 191 && $('#help').hasClass('hidden')) { // question mark
             e.preventDefault();
             $('#help').removeClass('hidden');
-        } else if (e.keyCode === 27) { // esc
+        } else if (e.which === 27) { // esc
             if (!$('#help').hasClass('hidden')) {
                 e.preventDefault();
                 $('#help').addClass('hidden');
@@ -83,7 +83,7 @@
                 $('#search').addClass('hidden');
                 $('#main').removeClass('hidden');
             }
-        } else if (e.keyCode === 83) { // S
+        } else if (e.which === 83) { // S
             e.preventDefault();
             $('.search-input').focus();
         }
             $(document).on('keypress.searchnav', function(e) {
                 var $active = $results.filter('.highlighted');
 
-                if (e.keyCode === 38) { // up
+                if (e.which === 38) { // up
                     e.preventDefault();
                     if (!$active.length || !$active.prev()) {
                         return;
 
                     $active.prev().addClass('highlighted');
                     $active.removeClass('highlighted');
-                } else if (e.keyCode === 40) { // down
+                } else if (e.which === 40) { // down
                     e.preventDefault();
                     if (!$active.length) {
                         $results.first().addClass('highlighted');
                         $active.next().addClass('highlighted');
                         $active.removeClass('highlighted');
                     }
-                } else if (e.keyCode === 13) { // return
+                } else if (e.which === 13) { // return
                     e.preventDefault();
                     if ($active.length) {
                         document.location.href = $active.find('a').prop('href');