Skip to content

Commit 87c23cb

Browse files
Merge pull request DataDog#331 from DataDog/update-search
Updated search to allow for phrases
2 parents 4c36af8 + 37c5e8b commit 87c23cb

File tree

8 files changed

+500
-344
lines changed

8 files changed

+500
-344
lines changed

content/search.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
---
1+
---
22
title: Search Results
33
kind: search
44
---
55
<div id="tipue_search_content"></div>
66

77
<% content_for :javascript do %>
88
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
9-
<script type="text/javascript" src="/tipuesearch/tipuesearch-set.js"></script>
10-
<script type="text/javascript" src="/tipuesearch/tipuesearch_content.js"></script>
11-
<script type="text/javascript" src="/tipuesearch/tipuesearch.js"></script>
12-
13-
<% end %>
9+
<script type="text/javascript" src="/tipuesearch/tipuesearch-set.js"></script>
10+
<script type="text/javascript" src="/tipuesearch/tipuesearch_content.js"></script>
11+
<script type="text/javascript" src="/tipuesearch/tipuesearch.js"></script>
12+
13+
<% end %>

content/static/datadog-docs.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,11 @@
5757
}
5858
}
5959

60+
6061
})();
62+
63+
64+
$(document).ready(function() {
65+
$('#tipue_search_input').tipuesearch();
66+
});
67+

content/static/tipuesearch.css

Lines changed: 79 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,125 @@
11

22
/*
3-
Tipue Search 1.1.1
4-
Tipue Search Copyright (c) 2012 Tri-State Consultants
5-
Tipue Search is free for both both commercial and non-commercial use and released under the MIT License.
6-
For the latest release, documentation and licence see http://www.tipue.com/search
7-
*/
3+
Tipue Search 4.0
4+
Copyright (c) 2014 Tipue
5+
Tipue Search is released under the MIT License
6+
http://www.tipue.com/search
7+
*/
88

99

1010
#tipue_search_input
1111
{
12-
font-size: 12px;
12+
font: 13px/1.6 'open sans', sans-serif;
1313
color: #333;
14-
padding: 7px 7px 7px 41px;
15-
margin-top: 1px;
14+
padding: 12px 8px 12px 40px;
1615
width: 170px;
17-
border: 1px solid #d3d3d3;
18-
border-radius: 0px;
16+
border: 1px solid #e2e2e2;
17+
border-radius: 0;
1918
-moz-appearance: none;
2019
-webkit-appearance: none;
21-
outline: none;
22-
background: #fff url('images/search.png') no-repeat 15px;
23-
}
24-
#tipue_search_input:focus
25-
{
26-
border-color: #c3c3c3;
27-
-moz-box-shadow: 0 0 3px rgba(0,0,0,.2);
28-
-webkit-box-shadow: 0 0 3px rgba(0,0,0,.2);
29-
box-shadow: 0 0 3px rgba(0,0,0,.2);
30-
}
31-
#tipue_search_button
32-
{
33-
width: 60px;
34-
height: 33px;
35-
margin-top: 1px;
36-
border: 1px solid #dcdcdc;
37-
border-radius: 3px;
38-
background: #f1f1f1 url('/images/search.gif') no-repeat center;
39-
outline: none;
40-
}
41-
#tipue_search_button:hover
42-
{
43-
border: 1px solid #c3c3c3;
44-
-moz-box-shadow: 1px 1px 2px #e3e3e3;
45-
-webkit-box-shadow: 1px 1px 2px #e3e3e3;
46-
box-shadow: 1px 1px 2px #e3e3e3;
20+
box-shadow: none;
21+
outline: 0;
22+
margin: 0;
23+
background: #fff url('img/search.png') no-repeat 15px 15px;
4724
}
4825

4926
#tipue_search_content
5027
{
51-
clear: left;
52-
display: none;
53-
width: 650px;
54-
padding: 0 0 13px 0;
28+
max-width: 650px;
29+
padding-top: 0px;
5530
margin: 0;
5631
}
32+
#tipue_search_loading
33+
{
34+
padding-top: 60px;
35+
background: #fff url('img/loader.gif') no-repeat left;
36+
}
5737

5838
#tipue_search_warning_head
5939
{
60-
font-family: 'Open Sans', Verdana, Helvetica, sans-serif;
61-
font-size: 16px;
62-
color: #333;
40+
font: 300 15px/1.6 'Open Sans', sans-serif;
41+
color: #555;
6342
}
6443
#tipue_search_warning
6544
{
66-
font-family: 'Open Sans', Verdana, Helvetica, sans-serif;
67-
font-size: 12px;
68-
color: #555;
69-
margin: 13px 0;
45+
font: 300 13px/1.6 'Open Sans', sans-serif;
46+
color: #333;
47+
margin: 7px 0;
7048
}
7149
#tipue_search_warning a
7250
{
73-
color: #36c;
74-
text-decoration: none;
51+
color: #36c;
52+
font-weight: 300;
53+
text-decoration: none;
7554
}
7655
#tipue_search_warning a:hover
7756
{
78-
padding-bottom: 1px;
79-
border-bottom: 1px solid #ccc;
57+
color: #333;
8058
}
81-
8259
#tipue_search_results_count
8360
{
84-
font-family: 'Open Sans', Verdana, Helvetica, sans-serif;
85-
font-size: 12px;
86-
color: #555;
61+
font: 300 12px/1.6 'Open Sans', sans-serif;
62+
color: #333;
8763
}
88-
89-
#tipue_search_content_title
64+
.tipue_search_content_title
9065
{
91-
font-family: 'Open Sans', Verdana, Helvetica, sans-serif;
92-
font-size: 16px;
93-
color: #333;
94-
margin-top: 20px;
66+
font: 300 25px/1.3 'Open Sans', sans-serif;
67+
text-rendering: optimizelegibility;
68+
margin-top: 23px;
9569
}
96-
#tipue_search_content_title a
70+
.tipue_search_content_title a
9771
{
98-
color: #36c;
99-
text-decoration: none;
72+
color: #333;
73+
text-decoration: none;
10074
}
101-
#tipue_search_content_title a:hover
75+
.tipue_search_content_title a:hover
10276
{
103-
padding-bottom: 1px;
104-
border-bottom: 1px solid #ccc;
77+
color: #555;
10578
}
106-
#tipue_search_content_text
79+
.tipue_search_content_url
10780
{
108-
font-family: 'Open Sans', Verdana, Helvetica, sans-serif;
109-
font-size: 12px;
110-
color: #555;
111-
line-height: 20px;
112-
padding: 5px 0;
81+
font: 300 12px/1.5 'Open Sans', sans-serif;
82+
word-break: break-all;
83+
word-break: break-word;
84+
-webkit-hyphens: auto;
85+
-moz-hyphens: auto;
86+
hyphens: auto;
11387
}
114-
#tipue_search_content_loc
88+
.tipue_search_content_url a
11589
{
116-
font-family: 'Open Sans', Verdana, Helvetica, sans-serif;
117-
font-size: 13px;
90+
color: #06c;
91+
text-decoration: none;
11892
}
119-
#tipue_search_content_loc a
93+
.tipue_search_content_url a:hover
12094
{
121-
color: #777;
122-
text-decoration: none;
95+
color: #333;
96+
}
97+
.tipue_search_content_text
98+
{
99+
font: 300 13px/1.8 'Open Sans', sans-serif;
100+
color: #555;
101+
word-break: break-all;
102+
word-break: break-word;
103+
-webkit-hyphens: auto;
104+
-moz-hyphens: auto;
105+
hyphens: auto;
106+
margin-top: 3px;
123107
}
124-
#tipue_search_content_loc a:hover
108+
.h01
125109
{
126-
padding-bottom: 1px;
127-
border-bottom: 1px solid #ccc;
110+
color: #333;
111+
font-weight: 400;
128112
}
129113

130114
#tipue_search_foot
131115
{
132-
margin: 43px 0 31px 0;
116+
margin: 51px 0 21px 0;
133117
}
134118
#tipue_search_foot_boxes
135119
{
136120
padding: 0;
137121
margin: 0;
138-
font-family: 'Lucida Grande', Verdana, Helvetica, sans-serif;
139-
font-size: 11px;
122+
font: 12px/1 'Open Sans', sans-serif;
140123
}
141124
#tipue_search_foot_boxes li
142125
{
@@ -147,33 +130,27 @@
147130
}
148131
#tipue_search_foot_boxes li a
149132
{
150-
padding: 8px 10px 11px 10px;
151-
background-color: #f5f5f5;
152-
background: -webkit-linear-gradient(top, #f7f7f7, #f1f1f1);
153-
background: -moz-linear-gradient(top, #f7f7f7, #f1f1f1);
154-
background: -ms-linear-gradient(top, #f7f7f7, #f1f1f1);
155-
background: -o-linear-gradient(top, #f7f7f7, #f1f1f1);
156-
border: 1px solid #dcdcdc;
157-
border-radius: 3px;
158-
color: #444;
133+
padding: 9px 15px 10px 15px;
134+
background-color: #f1f1f1;
135+
border: 1px solid #dcdcdc;
136+
border-radius: 1px;
137+
color: #333;
159138
margin-right: 7px;
160139
text-decoration: none;
161140
text-align: center;
162141
}
163142
#tipue_search_foot_boxes li.current
164143
{
165-
padding: 8px 10px 11px 10px;
166-
background: #fff;
167-
border: 1px solid #dcdcdc;
168-
border-radius: 3px;
144+
padding: 9px 15px 10px 15px;
145+
background: #fff;
146+
border: 1px solid #dcdcdc;
147+
border-radius: 1px;
169148
color: #333;
170149
margin-right: 7px;
171150
text-align: center;
172151
}
173152
#tipue_search_foot_boxes li a:hover
174153
{
175-
border: 1px solid #c3c3c3;
176-
-moz-box-shadow: 1px 1px 2px #e3e3e3;
177-
-webkit-box-shadow: 1px 1px 2px #e3e3e3;
178-
box-shadow: 1px 1px 2px #e3e3e3;
154+
border: 1px solid #ccc;
155+
background-color: #f3f3f3;
179156
}
Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
11

22
/*
3-
Tipue Search 1.1.1
4-
Tipue Search Copyright (c) 2012 Tri-State Consultants
5-
Tipue Search is free for both both commercial and non-commercial use and released under the MIT License.
6-
For the latest release, documentation and licence see http://www.tipue.com/search
7-
8-
These settings are documented in Tipue Search Settings at http://www.tipue.com/help/search/set
3+
Tipue Search 4.0
4+
Copyright (c) 2014 Tipue
5+
Tipue Search is released under the MIT License
6+
http://www.tipue.com/search
97
*/
108

119

12-
var tipuesearch_show = 5;
13-
var tipuesearch_show_url = 1;
14-
var tipuesearch_minimum_length = 2;
15-
var tipuesearch_new_window = 0;
16-
var tipuesearch_descriptive_words = 50;
17-
18-
var tipuesearch_stop_words = ["and","be","by","do","for","he","how","if","is","it","my","not","of","or","the","to","up","what","when"];
10+
var tipuesearch_stop_words = ["and", "be", "by", "do", "for", "he", "how", "if", "is", "it", "my", "not", "of", "or", "the", "to", "up", "what", "when"];
1911

2012
var tipuesearch_replace = {"words": [
21-
{"word": "tipua", replace_with: "tipue"},
22-
{"word": "javscript", replace_with: "javascript"}
13+
{"word": "tipua", "replace_with": "tipue"},
14+
{"word": "javscript", "replace_with": "javascript"}
2315
]};
2416

2517
var tipuesearch_stem = {"words": [
26-
{"word": "setup", stem: "install"},
27-
{"word": "email", stem: "contact"},
28-
{"word": "javascript", stem: "js"}
18+
{"word": "e-mail", "stem": "email"},
19+
{"word": "javascript", "stem": "script"},
20+
{"word": "javascript", "stem": "js"}
2921
]};
22+

0 commit comments

Comments
 (0)