|
1 |
| -<header class="site-header"> |
2 |
| - <nav class="navbar navbar-default navbar-fixed-top navbar-inverse"> |
3 |
| - <div class="container-fluid"> |
4 |
| - <div class="navbar-header"> |
5 |
| - <a class="logo-community" href="https://community.algolia.com/"> |
6 |
| - <img src="https://res.cloudinary.com/hilnmyskv/image/upload/logo-community-inline-dark.svg" width="150" alt="Algolia Community" /> |
7 |
| - </a> |
8 |
| - <a class="project-title" href="{{ site.baseurl }}/"> |
9 |
| - DocSearch |
10 |
| - </a> |
11 |
| - </div> |
12 |
| - <div class="navbar-collapse collapse"> |
13 |
| - <ul class="nav navbar-nav navbar-right"> |
14 |
| - <li class="searchbar-wrapper"> |
15 |
| - <div class="navbar-form"> |
16 |
| - <div class="form-group"> |
17 |
| - {% include searchbar.html %} |
18 |
| - </div> |
19 |
| - </div> |
20 |
| - </li> |
21 |
| - {% assign url = page.url %} |
22 |
| - {% for link in site.navigation %} |
23 |
| - <li {% if url == link.url %}class="active"{% endif %}> |
24 |
| - <a href="{{ site.baseurl }}{{ link.url }}" title="{{ link.title }}">{{ link.text }}</a> |
25 |
| - </li> |
26 |
| - {% endfor %} |
27 |
| - <li> |
28 |
| - <a class="navbar-github-link" href="//github.com/algolia/docsearch"><i class="fa fa-github"></i></a> |
29 |
| - </li> |
30 |
| - </ul> |
| 1 | +<div class='ac-nav'> |
| 2 | + <div class='ac-nav-container'> |
| 3 | + <div class='ac-nav-brand'> |
| 4 | + <a class='ac-logo' href='https://community.algolia.com/' title='Algolia Community'> |
| 5 | + <img alt='Algolia Community' class='ac-logo__lg' src='https://res.cloudinary.com/hilnmyskv/image/upload/logo-community-inline-dark.svg' width='150'> |
| 6 | + <img alt='Algolia Community' class='ac-logo__sm' src='https://res.cloudinary.com/hilnmyskv/image/upload/v1461180081/logo-community-sm.svg'> |
| 7 | + </a> |
| 8 | + <span class='ac-nav-brand-breadcrumb'></span> |
| 9 | + <a class='ac-nav-brand-title' href='./' title='Home'>DocSearch</a> |
| 10 | + </div> |
| 11 | + <div class='ac-nav-menu'> |
| 12 | + <div class='ac-nav-searchbox'> |
| 13 | + <form class='searchbox' id='docsearch-form' novalidate='novalidate' onsubmit='return false;' style='visibility:hidden;height:0'> |
| 14 | + <div class='searchbox__wrapper' role='search'> |
| 15 | + <input autocomplete='off' class='searchbox__input' id='docsearch' name='search' placeholder='Search in the doc' required='required' type='search'> |
| 16 | + <button class='searchbox__submit' title='Submit your search query.' type='submit'> |
| 17 | + <svg aria-label='Search' role='img'> |
| 18 | + <use xlink:href='#sbx-icon-search-13' xmlns:xlink='http://www.w3.org/1999/xlink'></use> |
| 19 | + </svg> |
| 20 | + </button> |
| 21 | + <button class='searchbox__reset hide' title='Clear the search query.' type='reset'> |
| 22 | + <svg aria-label='Reset' role='img'> |
| 23 | + <use xlink:href='#sbx-icon-clear-3' xmlns:xlink='http://www.w3.org/1999/xlink'></use> |
| 24 | + </svg> |
| 25 | + </button> |
| 26 | + </input> |
| 27 | + </div> |
| 28 | + </form> |
| 29 | + <div class='svg-icons' style='height: 0; width: 0; position: absolute; visibility: hidden'> |
| 30 | + <svg xmlns='http://www.w3.org/2000/svg'> |
| 31 | + <symbol id="sbx-icon-clear-3" viewBox="0 0 40 40"><path d="M16.228 20L1.886 5.657 0 3.772 3.772 0l1.885 1.886L20 16.228 34.343 1.886 36.228 0 40 3.772l-1.886 1.885L23.772 20l14.342 14.343L40 36.228 36.228 40l-1.885-1.886L20 23.772 5.657 38.114 3.772 40 0 36.228l1.886-1.885L16.228 20z" fill-rule="evenodd"/></symbol> |
| 32 | + <symbol id="sbx-icon-search-13" viewBox="0 0 12 12"><path d="M12 11.077c0-.245-.1-.483-.267-.65L9.26 7.955c.584-.843.894-1.853.894-2.877C10.154 2.272 7.882 0 5.077 0S0 2.272 0 5.077s2.272 5.077 5.077 5.077c1.024 0 2.034-.31 2.877-.894l2.474 2.466c.166.173.404.274.65.274.504 0 .922-.418.922-.923zm-3.692-6c0 1.78-1.45 3.23-3.23 3.23-1.782 0-3.232-1.45-3.232-3.23s1.45-3.23 3.23-3.23c1.782 0 3.232 1.45 3.232 3.23z" fill="#FFF" fill-rule="evenodd" opacity="0.85"/></symbol> |
| 33 | + </svg> |
31 | 34 | </div>
|
32 | 35 | </div>
|
33 |
| - </nav> |
34 |
| -</header> |
| 36 | + <ul class='ac-nav-menu-list'> |
| 37 | + {% assign url = page.url %} |
| 38 | + {% for link in site.navigation %} |
| 39 | + <li class='ac-nav-menu-list-item {% if url == link.url %}active{% endif %} '> |
| 40 | + <a data-path="{{ site.baseurl }}{{ link.url }}" href="{{ site.baseurl }}{{ link.url }}" data-current="{% if url == link.url %}true{% endif %}" title="{{ link.text }}">{{ link.text }}</a> |
| 41 | + </li> |
| 42 | + {% endfor %} |
| 43 | + <li class='ac-nav-menu-list-icon'> |
| 44 | + <a class='ac-icon' href='https://github.com/algolia/docsearch' title='GitHub repository'> |
| 45 | + <span class='ac-icon ac-icon-github'></span> |
| 46 | + </a> |
| 47 | + </li> |
| 48 | + </ul> |
| 49 | + </div> |
| 50 | +</div> |
| 51 | + |
| 52 | +</div> |
| 53 | + |
| 54 | +<script type="text/javascript"> |
| 55 | + |
| 56 | + $(function(){ |
| 57 | + $('.searchbox .aa-input').on('change', function() { |
| 58 | + $('.aa-input').addClass('filled'); |
| 59 | + }); |
| 60 | + |
| 61 | + $('.searchbox .aa-input').on('blur', function() { |
| 62 | + if ($(this).val().length === 0){ |
| 63 | + $(this).removeClass('filled'); |
| 64 | + } |
| 65 | + }); |
| 66 | + |
| 67 | + $('.searchbox [type="reset"]').on('click', function() { |
| 68 | + myDocSearch.autocomplete.autocomplete.setVal(''); |
| 69 | + $('.aa-input').focus(); |
| 70 | + $(this).addClass("hide"); |
| 71 | + }); |
| 72 | + }); |
| 73 | + function updateReset() { |
| 74 | + var searchbox = $('.aa-input'); |
| 75 | + var reset = $('.searchbox [type="reset"]'); |
| 76 | + reset.removeClass("hide"); |
| 77 | + if (searchbox.val().length === 0){ |
| 78 | + reset.addClass("hide"); |
| 79 | + } |
| 80 | + } |
| 81 | + |
| 82 | +</script> |
0 commit comments