Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions layout/_partial/search.ejs
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
<% if(theme.google_cse.enable) { %>
<div id="main" class="page">
<div id='cse' style='width:100%;text-align:center'>正在加载搜索结果,请稍等。</div>
<script async src="https://cse.google.com/cse.js?cx=<%=theme.google_cse.cx%>"></script>
<div class="gcse-search"></div>
</div>
<script src="http://www.google.com.hk/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1', {language : 'zh-CN',style: google.loader.themes.MINIMALIST});
google.setOnLoadCallback(function(){
var customSearchControl = new google.search.CustomSearchControl('<%= theme.google_cse.cx %>');
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
var options = new google.search.DrawOptions();
options.setAutoComplete(true);
customSearchControl.draw('cse', options);
var match = location.search.match(/q=([^&]*)(&|$)/);
if(match && match[1]){
var search = decodeURIComponent(match[1]);
customSearchControl.execute(search);
}
},true);
</script>
<% } %>