Add DISABLE_SEARCH config

This commit is contained in:
Brian C. Lane 2015-11-07 11:43:39 -08:00 committed by Luca Chiricozzi
parent dc630d6b36
commit d365aaafb7
3 changed files with 28 additions and 10 deletions

15
static/js/main-search.js Normal file
View File

@ -0,0 +1,15 @@
'use strict';
$(document).ready(function() {
$('.mg-container-social').height($('article').height());
$('#mg-panel-social').stick_in_parent({offset_top: 35});
$('#tipue_search_input').tipuesearch({
'show': 10,
'mode': 'json',
'showURL': false,
'descriptiveWords': 75,
'highlightEveryTerm': true,
'contentLocation': '/tipue_search.json'
});
});

View File

@ -3,13 +3,4 @@
$(document).ready(function() {
$('.mg-container-social').height($('article').height());
$('#mg-panel-social').stick_in_parent({offset_top: 35});
$('#tipue_search_input').tipuesearch({
'show': 10,
'mode': 'json',
'showURL': false,
'descriptiveWords': 75,
'highlightEveryTerm': true,
'contentLocation': '/tipue_search.json'
});
});

View File

@ -50,8 +50,10 @@
<link href='//fonts.googleapis.com/css?family=Open+Sans:800italic' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/uikit/2.23.0/css/uikit.min.css">
{% if not DISABLE_SEARCH %}
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/uikit/2.23.0/css/components/search.min.css">
<link rel="stylesheet" href="/theme/css/tipuesearch.css">
{% endif %}
<link rel="stylesheet" href="/theme/css/solarized.css">
<link rel="stylesheet" href="/theme/css/main.css">
@ -85,11 +87,13 @@
<div class="uk-width-medium-1-5 uk-hidden-small">
{% if not DISABLE_SEARCH %}
<div class="uk-panel uk-panel-box">
<form class="uk-search" action="search.html" data-uk-search>
<input class="uk-search-field tipue_search" type="search" name="q" id="tipue_search_input" autocomplete="off" placeholder="Search...">
</form>
</div>
{% endif %}
<div class="uk-panel uk-panel-box">
<ul class="uk-nav uk-nav-side">
@ -162,9 +166,11 @@
<div id="mg-offcanvas" class="uk-offcanvas">
<div class="uk-offcanvas-bar">
{% if not DISABLE_SEARCH %}
<form class="uk-search" action="search.html" data-uk-search>
<input class="uk-search-field" type="search" name="q" id="tipue_search_input" autocomplete="off" placeholder="Search...">
</form>
{% endif %}
<ul class="uk-nav uk-nav-offcanvas" data-uk-nav>
<li class="uk-nav-header">Categories</li>
@ -190,12 +196,18 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/uikit/2.23.0/js/uikit.min.js"></script>
{% if not DISABLE_SEARCH %}
<script src="//cdnjs.cloudflare.com/ajax/libs/uikit/2.23.0/js/components/search.min.js"></script>
<script src="/theme/js/jquery.sticky-kit.js"></script>
<script src="/theme/js/tipuesearch_set.js"></script>
<script src="/theme/js/tipuesearch.js"></script>
{% endif %}
<script src="/theme/js/jquery.sticky-kit.js"></script>
<script src="/theme/js/plugins.js"></script>
{% if DISABLE_SEARCH %}
<script src="/theme/js/main.js"></script>
{% else %}
<script src="/theme/js/main-search.js"></script>
{% endif %}
{% include 'disqus_count.html' %}
{% include 'analytics.html' %}