3
3
< head >
4
4
< meta charset ="utf-8 ">
5
5
< meta name ="viewport " content ="initial-scale=1 ">
6
- < title > doxdox-plugin-bootstrap 1.1.4 — Bootstrap template plugin for doxdox.</ title >
6
+ < title > doxdox-plugin-bootstrap 1.1.5 — Bootstrap template plugin for doxdox.</ title >
7
7
< meta name ="description " content ="Bootstrap template plugin for doxdox. ">
8
8
< link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css ">
9
9
< link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/styles/github.min.css ">
10
10
< style >
11
11
12
+ input [type = "search" ]::-webkit-search-cancel-button {
13
+ -webkit-appearance : searchfield-cancel-button;
14
+ }
15
+
12
16
.jumbotron {
13
17
margin-bottom : 0 ;
14
18
border-radius : 0 ;
159
163
160
164
< h1 >
161
165
< a href ="https://github.com/neogeek/doxdox-plugin-bootstrap "> doxdox-plugin-bootstrap</ a >
162
- < small > 1.1.4 </ small >
166
+ < small > 1.1.5 </ small >
163
167
</ h1 >
164
168
165
169
< p > Bootstrap template plugin for doxdox.</ p >
176
180
177
181
< div class ="col-md-3 hidden-sm hidden-xs ">
178
182
179
- < input type ="text " class ="form-control search " id ="search-methods " placeholder ="Search... " autocomplete ="off ">
183
+ < input type ="search " class ="form-control search " id ="search-methods " placeholder ="Search... " autocomplete ="off ">
180
184
181
185
< ul class ="menu ">
182
186
@@ -337,9 +341,13 @@ <h3>Returns</h3>
337
341
hljs . highlightBlock ( this ) ;
338
342
} ) ;
339
343
344
+ var $searchInput = $ ( '#search-methods' ) ;
340
345
var $methodLinks = $ ( '.method-link' ) ;
346
+ var $methodNames = $ ( '.method .method-name' ) ;
341
347
342
- $ ( '#search-methods' ) . on ( 'keyup' , function ( e ) {
348
+ var urlQuery = window . location . search . match ( / q = ( [ ^ & ] + ) / ) ;
349
+
350
+ $searchInput . on ( 'keyup' , function ( e ) {
343
351
344
352
var query = new RegExp ( e . target . value . replace ( ' ' , '|' ) , 'ig' ) ;
345
353
@@ -359,8 +367,38 @@ <h3>Returns</h3>
359
367
360
368
} ) ;
361
369
370
+ $methodNames . each ( function ( ) {
371
+
372
+ var $this = $ ( this ) ;
373
+
374
+ if ( ! $this . text ( ) . match ( query ) ) {
375
+
376
+ $this . closest ( '.method' ) . hide ( ) ;
377
+
378
+ } else {
379
+
380
+ $this . closest ( '.method' ) . show ( ) ;
381
+
382
+ }
383
+
384
+ } ) ;
385
+
386
+ window . history . replaceState ( { } , '' , window . location . pathname + '?q=' + e . target . value ) ;
387
+
388
+ } ) ;
389
+
390
+ $searchInput . on ( 'search' , function ( ) {
391
+
392
+ $searchInput . trigger ( 'keyup' ) ;
393
+
362
394
} ) ;
363
395
396
+ if ( urlQuery && urlQuery . length > 1 ) {
397
+
398
+ $searchInput . val ( urlQuery [ 1 ] ) . trigger ( 'keyup' ) ;
399
+
400
+ }
401
+
364
402
$ ( window ) . on ( 'scroll' , handleScrollEvent ) ;
365
403
366
404
handleScrollEvent ( ) ;
0 commit comments