diff options
Diffstat (limited to 'plugins/localsearch/conf.py.sample.alt')
| -rw-r--r-- | plugins/localsearch/conf.py.sample.alt | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/plugins/localsearch/conf.py.sample.alt b/plugins/localsearch/conf.py.sample.alt new file mode 100644 index 00000000..8c5c0285 --- /dev/null +++ b/plugins/localsearch/conf.py.sample.alt | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | # Alternate conf.py.sample -- for displaying in a modal dialog. | ||
| 2 | SEARCH_FORM = """ | ||
| 3 | <span class="navbar-form navbar-left"> | ||
| 4 | <input type="text" id="tipue_search_input" class="form-control" placeholder="Search"> | ||
| 5 | </span>""" | ||
| 6 | |||
| 7 | EXTRA_HEAD_DATA = """ | ||
| 8 | <link rel="stylesheet" type="text/css" href="/assets/css/tipuesearch.css"> | ||
| 9 | """ | ||
| 10 | |||
| 11 | BODY_END = """ | ||
| 12 | <!-- Modal --> | ||
| 13 | <div id="search-results" class="modal fade" role="dialog" style="height: 80%;"> | ||
| 14 | <div class="modal-dialog"> | ||
| 15 | |||
| 16 | <!-- Modal content--> | ||
| 17 | <div class="modal-content"> | ||
| 18 | <div class="modal-header"> | ||
| 19 | <button type="button" class="close" data-dismiss="modal">×</button> | ||
| 20 | <h4 class="modal-title">Search Results:</h4> | ||
| 21 | </div> | ||
| 22 | <div class="modal-body" id="tipue_search_content" style="max-height: 600px; overflow-y: auto;"> | ||
| 23 | </div> | ||
| 24 | <div class="modal-footer"> | ||
| 25 | <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> | ||
| 26 | </div> | ||
| 27 | </div> | ||
| 28 | |||
| 29 | </div> | ||
| 30 | </div> | ||
| 31 | <script> | ||
| 32 | var siteUrl = """ + json.dumps(SITE_URL) + """ | ||
| 33 | $(document).ready(function() { | ||
| 34 | $.when( | ||
| 35 | $.getScript( siteUrl + "/assets/js/tipuesearch_set.js" ), | ||
| 36 | $.getScript( siteUrl + "/assets/js/tipuesearch.js" ), | ||
| 37 | $.getScript( siteUrl + "/assets/js/tipuesearch_content.js" ), | ||
| 38 | $.Deferred(function( deferred ){ | ||
| 39 | $( deferred.resolve ); | ||
| 40 | }) | ||
| 41 | ).done(function() { | ||
| 42 | $('#tipue_search_input').tipuesearch({ | ||
| 43 | 'showUrl': false | ||
| 44 | }); | ||
| 45 | $('#tipue_search_input').keyup(function (e) { | ||
| 46 | if (e.keyCode == 13) { | ||
| 47 | $('#search-results').modal() | ||
| 48 | } | ||
| 49 | }); | ||
| 50 | }); | ||
| 51 | }); | ||
| 52 | </script> | ||
| 53 | """ | ||
