Skip to content

Commit ccb5973

Browse files
committed
Add input field for search
1 parent 9713aad commit ccb5973

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

doc-tool/resources/_includes/sidebar.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
<li class="index-title">
1212
<span>API</span>
1313
</li>
14+
<li>
15+
<input id="search-api-input" type="text" placeholder="Search API"/>
16+
<script>
17+
var input = document.getElementById("search-api-input");
18+
input.onkeydown = function(evt) {
19+
evt = evt || window.event;
20+
if (evt.keyCode == 13)
21+
window.location = "{{ site.baseurl }}/api/search.html?searchTerm=" + input.value;
22+
};
23+
</script>
24+
</li>
1425
{% endif %}
1526
{% for pkg in docs %}
1627
<li class="index-entity entity-package">

doc-tool/resources/css/sidebar.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ ul.index-entities {
2525
padding-left: 0;
2626
}
2727

28+
ul.index-entities > li > input#search-api-input {
29+
border: 0;
30+
margin-left: 22px;
31+
outline: none;
32+
line-height: 35px;
33+
box-shadow: inset 0 0px 0 white, inset 0 -0.5px 0 rgba(0, 0, 0, 0.5);
34+
}
35+
2836
ul.toc {
2937
list-style-type: none;
3038
padding-top: 18px;

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ object DottyInjectedPlugin extends AutoPlugin {
891891
publishArtifact in Test := false,
892892
homepage := Some(url(dottyGithubUrl)),
893893
licenses += ("BSD New",
894-
url("$dottyGithubUrl/blob/master/LICENSE.md")),
894+
url(s"$dottyGithubUrl/blob/master/LICENSE.md")),
895895
scmInfo := Some(
896896
ScmInfo(
897897
url(dottyGithubUrl),

0 commit comments

Comments
 (0)