2014-01-06 22:55:19 +00:00
|
|
|
<!-- <form class="wy-form" action="{{ pathto('search') }}" method="get">
|
2013-12-24 23:10:19 +00:00
|
|
|
<input type="text" name="q" placeholder="Search docs" />
|
|
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
|
|
<input type="hidden" name="area" value="default" />
|
2014-01-06 22:55:19 +00:00
|
|
|
</form> -->
|
|
|
|
|
|
|
|
<script>
|
|
|
|
(function() {
|
|
|
|
var cx = '015514069825911246756:eu5pbnxp4po';
|
|
|
|
var gcse = document.createElement('script');
|
|
|
|
gcse.type = 'text/javascript';
|
|
|
|
gcse.async = true;
|
|
|
|
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
|
|
|
|
'//www.google.com/cse/cse.js?cx=' + cx;
|
|
|
|
var s = document.getElementsByTagName('script')[0];
|
|
|
|
s.parentNode.insertBefore(gcse, s);
|
|
|
|
})();
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<form id="search-form-id" action="">
|
|
|
|
<input type="text" name="query" id="search-box-id" />
|
|
|
|
<a class="search-reset-start" id="search-reset"><i class="fa fa-times"></i></a>
|
|
|
|
<a class="search-reset-start" id="search-start"><i class="fa fa-search"></i></a>
|
2013-12-24 23:10:19 +00:00
|
|
|
</form>
|
2014-01-06 22:55:19 +00:00
|
|
|
|
|
|
|
<script type="text/javascript" src="http://www.google.com/cse/brand?form=search-form-id&inputbox=search-box-id"></script>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
function executeQuery() {
|
|
|
|
var input = document.getElementById('search-box-id');
|
|
|
|
var element = google.search.cse.element.getElement('searchresults-only0');
|
|
|
|
element.resultsUrl = '/htmlout/search.html'
|
|
|
|
if (input.value == '') {
|
|
|
|
element.clearAllResults();
|
|
|
|
$('#page-content, .rst-footer-buttons, #search-start').show();
|
|
|
|
$('#search-results, #search-reset').hide();
|
|
|
|
} else {
|
|
|
|
$('#page-content, .rst-footer-buttons, #search-start').hide();
|
|
|
|
$('#search-results, #search-reset').show();
|
|
|
|
element.execute(input.value);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
$('#search-reset').hide();
|
|
|
|
|
|
|
|
$('#search-start').click(function(e) { executeQuery(); });
|
|
|
|
$('#search-reset').click(function(e) { $('#search-box-id').val(''); executeQuery(); });
|
|
|
|
|
|
|
|
$('#search-form-id').submit(function(e) {
|
|
|
|
console.log('submitting!');
|
|
|
|
executeQuery();
|
|
|
|
e.preventDefault();
|
|
|
|
});
|
|
|
|
</script>
|