summaryrefslogtreecommitdiff
path: root/plugins/localsearch/conf.py.sample.alt
blob: 8c5c0285efb04ac6f71eb7c72f812ec8ba9853c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Alternate conf.py.sample -- for displaying in a modal dialog.
SEARCH_FORM = """
<span class="navbar-form navbar-left">
<input type="text" id="tipue_search_input" class="form-control" placeholder="Search">
</span>"""

EXTRA_HEAD_DATA = """
<link rel="stylesheet" type="text/css" href="/assets/css/tipuesearch.css">
"""

BODY_END = """
<!-- Modal -->
<div id="search-results" class="modal fade" role="dialog" style="height: 80%;">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Search Results:</h4>
      </div>
      <div class="modal-body" id="tipue_search_content" style="max-height: 600px; overflow-y: auto;">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>

  </div>
</div>
<script>
var siteUrl = """ + json.dumps(SITE_URL) + """
$(document).ready(function() {
    $.when(
        $.getScript( siteUrl + "/assets/js/tipuesearch_set.js" ),
        $.getScript( siteUrl + "/assets/js/tipuesearch.js" ),
        $.getScript( siteUrl + "/assets/js/tipuesearch_content.js" ),
        $.Deferred(function( deferred ){
            $( deferred.resolve );
        })
    ).done(function() {
        $('#tipue_search_input').tipuesearch({
           'showUrl': false
        });
        $('#tipue_search_input').keyup(function (e) {
            if (e.keyCode == 13) {
                $('#search-results').modal()
            }
        });
    });
});
</script>
"""