Skip to content
Permalink
Browse files
Add old sample config as an alternate version
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Mar 26, 2018
1 parent b371066 commit b5e14b754be52ab4ed1386e0b726365ad1634184
Showing with 55 additions and 2 deletions.
  1. +3 −2 v7/localsearch/README.md
  2. +52 −0 v7/localsearch/conf.py.sample.alt
@@ -4,9 +4,10 @@ search will be performed client side. It uses [Tipue Search](http://www.tipue.co

In ordrer to set up Tipue, you will need:

* the sample config from `conf.py.sample`
* a page set up to render `localsearch.tmpl` (which you may customize) —
* the sample config from `conf.py.sample` and a page set up to render `localsearch.tmpl` (which you may customize) —
an example is in `search-EXAMPLE.html`
* or the alternate sample config from `conf.py.sample.alt`, which uses a modal
and does not need another page

For more information about how to customize it and use it, please refer to the Tipue
docs at http://www.tipue.com/search/
@@ -0,0 +1,52 @@
# 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" ),
$.Deferred(function( deferred ){
$( deferred.resolve );
})
).done(function() {
$('#tipue_search_input').tipuesearch({
'mode': 'json',
'contentLocation': siteUrl + '/assets/js/tipuesearch_content.json'
});
$('#tipue_search_input').keyup(function (e) {
if (e.keyCode == 13) {
$('#search-results').modal()
}
});
});
});
</script>

0 comments on commit b5e14b7

Please sign in to comment.