2014-01-06 23:55:19 +01:00
|
|
|
<!-- <form class="wy-form" action="{{ pathto('search') }}" method="get">
|
2013-12-25 00:10:19 +01: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 23:55:19 +01: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-25 00:10:19 +01:00
|
|
|
</form>
|
2014-01-06 23:55:19 +01: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();
|
|
|
|
|
2014-01-07 12:07:20 +01:00
|
|
|
$('#search-box-id').css('background-position', '1em center');
|
|
|
|
|
|
|
|
$('#search-box-id').on('blur', function() {
|
|
|
|
$('#search-box-id').css('background-position', '1em center');
|
|
|
|
});
|
|
|
|
|
2014-01-06 23:55:19 +01:00
|
|
|
$('#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>
|